(self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([[4144],{

/***/ 92871:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  DEFAULT_CONTEXT_ITEM_RANK: () => (/* binding */ DEFAULT_CONTEXT_ITEM_RANK),
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/property-inspector@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/property-inspector/lib/index.js)
var property_inspector_lib_index_js_ = __webpack_require__(36236);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/commands@~2.3.3 (singleton) (fallback: ../node_modules/@lumino/commands/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(88532);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application-extension/lib/topbar.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




const TOPBAR_FACTORY = 'TopBar';
/**
 * A plugin adding a toolbar to the top area.
 */
const topbar = {
    id: '@jupyterlab/application-extension:top-bar',
    description: 'Adds a toolbar to the top area (next to the main menu bar).',
    autoStart: true,
    requires: [settingregistry_lib_index_js_.ISettingRegistry, lib_index_js_.IToolbarWidgetRegistry],
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, settingRegistry, toolbarRegistry, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const toolbar = new ui_components_lib_index_js_.Toolbar();
        toolbar.id = 'jp-top-bar';
        toolbar.node.setAttribute('aria-label', trans.__('Topbar toolbar'));
        // Set toolbar
        (0,lib_index_js_.setToolbar)(toolbar, (0,lib_index_js_.createToolbarFactory)(toolbarRegistry, settingRegistry, TOPBAR_FACTORY, topbar.id, translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator), toolbar);
        app.shell.add(toolbar, 'top', { rank: 900 });
    }
};
//# sourceMappingURL=topbar.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module application-extension
 */
















/**
 * Default context menu item rank
 */
const DEFAULT_CONTEXT_ITEM_RANK = 100;
/**
 * The command IDs used by the application plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.activateNextTab = 'application:activate-next-tab';
    CommandIDs.activatePreviousTab = 'application:activate-previous-tab';
    CommandIDs.activateNextTabBar = 'application:activate-next-tab-bar';
    CommandIDs.activatePreviousTabBar = 'application:activate-previous-tab-bar';
    CommandIDs.close = 'application:close';
    CommandIDs.closeOtherTabs = 'application:close-other-tabs';
    CommandIDs.closeRightTabs = 'application:close-right-tabs';
    CommandIDs.closeAll = 'application:close-all';
    CommandIDs.setMode = 'application:set-mode';
    CommandIDs.showPropertyPanel = 'property-inspector:show-panel';
    CommandIDs.resetLayout = 'application:reset-layout';
    CommandIDs.toggleContextMenu = 'application:toggle-context-menu';
    CommandIDs.toggleHeader = 'application:toggle-header';
    CommandIDs.toggleMode = 'application:toggle-mode';
    CommandIDs.toggleLeftArea = 'application:toggle-left-area';
    CommandIDs.toggleRightArea = 'application:toggle-right-area';
    CommandIDs.toggleSideTabBar = 'application:toggle-side-tabbar';
    CommandIDs.toggleSidebarWidget = 'application:toggle-sidebar-widget';
    CommandIDs.togglePresentationMode = 'application:toggle-presentation-mode';
    CommandIDs.toggleFullscreenMode = 'application:toggle-fullscreen-mode';
    CommandIDs.tree = 'router:tree';
    CommandIDs.switchSidebar = 'sidebar:switch';
})(CommandIDs || (CommandIDs = {}));
/**
 * A plugin to register the commands for the main application.
 */
const mainCommands = {
    id: '@jupyterlab/application-extension:commands',
    description: 'Adds commands related to the shell.',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator],
    optional: [index_js_.ILabShell, lib_index_js_.ICommandPalette],
    activate: (app, translator, labShell, palette) => {
        var _a;
        const { commands, shell } = app;
        const trans = translator.load('jupyterlab');
        const category = trans.__('Main Area');
        // Add Command to override the JLab context menu.
        commands.addCommand(index_js_.JupyterFrontEndContextMenu.contextMenu, {
            label: trans.__('Shift+Right Click for Browser Menu'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isEnabled: () => false,
            execute: () => void 0
        });
        // Returns the widget associated with the most recent contextmenu event.
        const contextMenuWidget = () => {
            const test = (node) => !!node.dataset.id;
            const node = app.contextMenuHitTest(test);
            if (!node) {
                // Fall back to active widget if path cannot be obtained from event.
                return shell.currentWidget;
            }
            return ((0,index_es6_js_.find)(shell.widgets('main'), widget => widget.id === node.dataset.id) ||
                shell.currentWidget);
        };
        // Closes an array of widgets.
        const closeWidgets = (widgets) => {
            widgets.forEach(widget => widget.close());
        };
        // Find the tab area for a widget within a specific dock area.
        const findTab = (area, widget) => {
            if (area.type === 'tab-area') {
                return area.widgets.includes(widget) ? area : null;
            }
            if (area.type === 'split-area') {
                for (const child of area.children) {
                    const found = findTab(child, widget);
                    if (found) {
                        return found;
                    }
                }
            }
            return null;
        };
        // Find the tab area for a widget within the main dock area.
        const tabAreaFor = (widget) => {
            var _a;
            const layout = labShell === null || labShell === void 0 ? void 0 : labShell.saveLayout();
            const mainArea = layout === null || layout === void 0 ? void 0 : layout.mainArea;
            if (!mainArea || coreutils_lib_index_js_.PageConfig.getOption('mode') !== 'multiple-document') {
                return null;
            }
            const area = (_a = mainArea.dock) === null || _a === void 0 ? void 0 : _a.main;
            return area ? findTab(area, widget) : null;
        };
        // Returns an array of all widgets to the right of a widget in a tab area.
        const widgetsRightOf = (widget) => {
            const { id } = widget;
            const tabArea = tabAreaFor(widget);
            const widgets = tabArea ? tabArea.widgets || [] : [];
            const index = widgets.findIndex(widget => widget.id === id);
            if (index < 0) {
                return [];
            }
            return widgets.slice(index + 1);
        };
        // Gets and returns the dataId of currently active tab in the specified sidebar (left or right)
        // or an empty string
        const activeSidePanelWidget = (side) => {
            // default active element is luancher (luancher-0)
            let activeTab;
            if (side != 'left' && side != 'right') {
                throw Error(`Unsupported sidebar: ${side}`);
            }
            if (side === 'left') {
                activeTab = document.querySelector('.lm-TabBar-tab.lm-mod-current');
            }
            else {
                const query = document.querySelectorAll('.lm-TabBar-tab.lm-mod-current');
                activeTab = query[query.length - 1];
            }
            const activeTabDataId = activeTab === null || activeTab === void 0 ? void 0 : activeTab.getAttribute('data-id');
            if (activeTabDataId) {
                return activeTabDataId === null || activeTabDataId === void 0 ? void 0 : activeTabDataId.toString();
            }
            else {
                return '';
            }
        };
        // Sets tab focus on the element
        function setTabFocus(focusElement) {
            if (focusElement) {
                focusElement.focus();
            }
        }
        commands.addCommand(CommandIDs.close, {
            label: () => trans.__('Close Tab'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isEnabled: () => {
                const widget = contextMenuWidget();
                return !!widget && widget.title.closable;
            },
            execute: () => {
                const widget = contextMenuWidget();
                if (widget) {
                    widget.close();
                }
            }
        });
        commands.addCommand(CommandIDs.closeOtherTabs, {
            label: () => trans.__('Close All Other Tabs'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isEnabled: () => {
                // Ensure there are at least two widgets.
                return (0,index_es6_js_.some)(shell.widgets('main'), (_, i) => i === 1);
            },
            execute: () => {
                const widget = contextMenuWidget();
                if (!widget) {
                    return;
                }
                const { id } = widget;
                for (const widget of shell.widgets('main')) {
                    if (widget.id !== id) {
                        widget.close();
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.closeRightTabs, {
            label: () => trans.__('Close Tabs to Right'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isEnabled: () => !!contextMenuWidget() &&
                widgetsRightOf(contextMenuWidget()).length > 0,
            execute: () => {
                const widget = contextMenuWidget();
                if (!widget) {
                    return;
                }
                closeWidgets(widgetsRightOf(widget));
            }
        });
        (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {
            [
                CommandIDs.close,
                CommandIDs.closeOtherTabs,
                CommandIDs.closeRightTabs
            ].forEach(cmd => commands.notifyCommandChanged(cmd));
        });
        if (labShell) {
            commands.addCommand(CommandIDs.activateNextTab, {
                label: trans.__('Activate Next Tab'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    labShell.activateNextTab();
                }
            });
            commands.addCommand(CommandIDs.activatePreviousTab, {
                label: trans.__('Activate Previous Tab'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    labShell.activatePreviousTab();
                }
            });
            commands.addCommand(CommandIDs.activateNextTabBar, {
                label: trans.__('Activate Next Tab Bar'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    labShell.activateNextTabBar();
                }
            });
            commands.addCommand(CommandIDs.activatePreviousTabBar, {
                label: trans.__('Activate Previous Tab Bar'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    labShell.activatePreviousTabBar();
                }
            });
            commands.addCommand(CommandIDs.closeAll, {
                label: trans.__('Close All Tabs'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    labShell.closeAll();
                }
            });
            commands.addCommand(CommandIDs.toggleHeader, {
                label: trans.__('Show Header'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    if (labShell.mode === 'single-document') {
                        labShell.toggleTopInSimpleModeVisibility();
                    }
                },
                isToggled: () => labShell.isTopInSimpleModeVisible(),
                isVisible: () => labShell.mode === 'single-document'
            });
            commands.addCommand(CommandIDs.toggleLeftArea, {
                label: trans.__('Show Left Sidebar'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    if (labShell.leftCollapsed) {
                        labShell.expandLeft();
                    }
                    else {
                        labShell.collapseLeft();
                        if (labShell.currentWidget) {
                            labShell.activateById(labShell.currentWidget.id);
                        }
                    }
                },
                isToggled: () => !labShell.leftCollapsed,
                isEnabled: () => !labShell.isEmpty('left')
            });
            commands.addCommand(CommandIDs.toggleRightArea, {
                label: trans.__('Show Right Sidebar'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    if (labShell.rightCollapsed) {
                        labShell.expandRight();
                    }
                    else {
                        labShell.collapseRight();
                        if (labShell.currentWidget) {
                            labShell.activateById(labShell.currentWidget.id);
                        }
                    }
                },
                isToggled: () => !labShell.rightCollapsed,
                isEnabled: () => !labShell.isEmpty('right')
            });
            commands.addCommand(CommandIDs.toggleSidebarWidget, {
                label: args => args === undefined ||
                    args.side === undefined ||
                    args.index === undefined
                    ? trans.__('Toggle Sidebar Element')
                    : args.side === 'right'
                        ? trans.__('Toggle Element %1 in Right Sidebar', parseInt(args.index, 10) + 1)
                        : trans.__('Toggle Element %1 in Left Sidebar', parseInt(args.index, 10) + 1),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {
                            side: {
                                type: 'string',
                                enum: ['left', 'right'],
                                description: trans.__('The sidebar side')
                            },
                            index: {
                                type: ['string', 'number'],
                                description: trans.__('The index of the sidebar widget')
                            }
                        },
                        required: ['side', 'index']
                    }
                },
                execute: args => {
                    const index = parseInt(args.index, 10);
                    if (args.side != 'left' && args.side != 'right') {
                        throw Error(`Unsupported sidebar: ${args.side}`);
                    }
                    const widgets = Array.from(labShell.widgets(args.side));
                    if (index >= widgets.length) {
                        return;
                    }
                    const widgetId = widgets[index].id;
                    const focusElement = document.querySelector("[data-id='" + widgetId + "']");
                    if (activeSidePanelWidget(args.side) === widgetId) {
                        if (args.side == 'left') {
                            labShell.collapseLeft();
                            setTabFocus(focusElement);
                        }
                        if (args.side == 'right') {
                            labShell.collapseRight();
                            setTabFocus(focusElement);
                        }
                    }
                    else {
                        labShell.activateById(widgetId);
                        setTabFocus(focusElement);
                    }
                }
            });
            commands.addCommand(CommandIDs.toggleSideTabBar, {
                label: args => args.side === 'right'
                    ? trans.__('Show Right Activity Bar')
                    : trans.__('Show Left Activity Bar'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {
                            side: {
                                type: 'string',
                                enum: ['left', 'right'],
                                description: trans.__('The sidebar side')
                            }
                        },
                        required: ['side']
                    }
                },
                execute: args => {
                    if (args.side === 'right') {
                        labShell.toggleSideTabBarVisibility('right');
                    }
                    else {
                        labShell.toggleSideTabBarVisibility('left');
                    }
                },
                isToggled: args => args.side === 'right'
                    ? labShell.isSideTabBarVisible('right')
                    : labShell.isSideTabBarVisible('left'),
                isEnabled: args => args.side === 'right'
                    ? !labShell.isEmpty('right')
                    : !labShell.isEmpty('left')
            });
            commands.addCommand(CommandIDs.togglePresentationMode, {
                label: () => trans.__('Presentation Mode'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    labShell.presentationMode = !labShell.presentationMode;
                },
                isToggled: () => labShell.presentationMode,
                isVisible: () => true
            });
            commands.addCommand(CommandIDs.toggleFullscreenMode, {
                label: trans.__('Fullscreen Mode'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    if (document.fullscreenElement === null ||
                        document.fullscreenElement === undefined) {
                        document.documentElement.requestFullscreen().catch(reason => {
                            console.error('Failed to enter fullscreen mode.', reason);
                        });
                    }
                    else if (document.fullscreenElement !== null) {
                        document.exitFullscreen().catch(reason => {
                            console.error('Failed to exit fullscreen mode.', reason);
                        });
                    }
                },
                isToggled: () => document.fullscreenElement !== null
            });
            commands.addCommand(CommandIDs.setMode, {
                label: args => args['mode']
                    ? trans.__('Set %1 mode.', args['mode'])
                    : trans.__('Set the layout `mode`.'),
                caption: trans.__('The layout `mode` can be "single-document" or "multiple-document".'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {
                            mode: {
                                type: 'string',
                                enum: ['single-document', 'multiple-document'],
                                description: trans.__('The layout mode')
                            }
                        },
                        required: ['mode']
                    }
                },
                isVisible: args => {
                    const mode = args['mode'];
                    return mode === 'single-document' || mode === 'multiple-document';
                },
                execute: args => {
                    const mode = args['mode'];
                    if (mode === 'single-document' || mode === 'multiple-document') {
                        labShell.mode = mode;
                        return;
                    }
                    throw new Error(`Unsupported application shell mode: ${mode}`);
                }
            });
            commands.addCommand(CommandIDs.toggleMode, {
                label: trans.__('Simple Interface'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                isToggled: () => labShell.mode === 'single-document',
                execute: () => {
                    const args = labShell.mode === 'multiple-document'
                        ? { mode: 'single-document' }
                        : { mode: 'multiple-document' };
                    return commands.execute(CommandIDs.setMode, args);
                }
            });
            commands.addCommand(CommandIDs.resetLayout, {
                label: trans.__('Reset Default Layout'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    // Turn off presentation mode
                    if (labShell.presentationMode) {
                        commands
                            .execute(CommandIDs.togglePresentationMode)
                            .catch(reason => {
                            console.error('Failed to undo presentation mode.', reason);
                        });
                    }
                    // Turn off fullscreen mode
                    if (document.fullscreenElement !== null ||
                        document.fullscreenElement !== undefined) {
                        commands.execute(CommandIDs.toggleFullscreenMode).catch(reason => {
                            console.error('Failed to exit fullscreen mode.', reason);
                        });
                    }
                    // Display top header
                    if (labShell.mode === 'single-document' &&
                        !labShell.isTopInSimpleModeVisible()) {
                        commands.execute(CommandIDs.toggleHeader).catch(reason => {
                            console.error('Failed to display title header.', reason);
                        });
                    }
                    // Display side tabbar
                    ['left', 'right'].forEach(side => {
                        if (!labShell.isSideTabBarVisible(side) &&
                            !labShell.isEmpty(side)) {
                            commands
                                .execute(CommandIDs.toggleSideTabBar, { side })
                                .catch(reason => {
                                console.error(`Failed to show ${side} activity bar.`, reason);
                            });
                        }
                    });
                    // Some actions are also trigger indirectly
                    // - by listening to this command execution.
                }
            });
        }
        if (palette) {
            [
                CommandIDs.activateNextTab,
                CommandIDs.activatePreviousTab,
                CommandIDs.activateNextTabBar,
                CommandIDs.activatePreviousTabBar,
                CommandIDs.close,
                CommandIDs.closeAll,
                CommandIDs.closeOtherTabs,
                CommandIDs.closeRightTabs,
                CommandIDs.toggleHeader,
                CommandIDs.toggleLeftArea,
                CommandIDs.toggleRightArea,
                CommandIDs.togglePresentationMode,
                CommandIDs.toggleFullscreenMode,
                CommandIDs.toggleMode,
                CommandIDs.resetLayout
            ].forEach(command => palette.addItem({ command, category }));
            ['right', 'left'].forEach(side => {
                palette.addItem({
                    command: CommandIDs.toggleSideTabBar,
                    category,
                    args: { side }
                });
            });
        }
    }
};
/**
 * The main extension.
 */
const main = {
    id: '@jupyterlab/application-extension:main',
    description: 'Initializes the application and provides the URL tree path handler.',
    requires: [
        index_js_.IRouter,
        lib_index_js_.IWindowResolver,
        translation_lib_index_js_.ITranslator,
        index_js_.JupyterFrontEnd.ITreeResolver
    ],
    optional: [index_js_.IConnectionLost],
    provides: index_js_.ITreePathUpdater,
    activate: (app, router, resolver, translator, treeResolver, connectionLost) => {
        const trans = translator.load('jupyterlab');
        if (!(app instanceof index_js_.JupyterLab)) {
            throw new Error(`${main.id} must be activated in JupyterLab.`);
        }
        // These two internal state variables are used to manage the two source
        // of the tree part of the URL being updated: 1) path of the active document,
        // 2) path of the default browser if the active main area widget isn't a document.
        let _docTreePath = '';
        let _defaultBrowserTreePath = '';
        function updateTreePath(treePath) {
            // Wait for tree resolver to finish before updating the path because it use the PageConfig['treePath']
            void treeResolver.paths.then(() => {
                _defaultBrowserTreePath = treePath;
                if (!_docTreePath) {
                    const url = coreutils_lib_index_js_.PageConfig.getUrl({ treePath });
                    const path = coreutils_lib_index_js_.URLExt.parse(url).pathname;
                    router.navigate(path, { skipRouting: true });
                    // Persist the new tree path to PageConfig as it is used elsewhere at runtime.
                    coreutils_lib_index_js_.PageConfig.setOption('treePath', treePath);
                }
            });
        }
        // Requiring the window resolver guarantees that the application extension
        // only loads if there is a viable window name. Otherwise, the application
        // will short-circuit and ask the user to navigate away.
        const workspace = resolver.name;
        console.debug(`Starting application in workspace: "${workspace}"`);
        // If there were errors registering plugins, tell the user.
        if (app.registerPluginErrors.length !== 0) {
            const body = (react_index_js_.createElement("pre", null, app.registerPluginErrors.map(e => e.message).join('\n')));
            void (0,lib_index_js_.showErrorMessage)(trans.__('Error Registering Plugins'), {
                message: body
            });
        }
        // Watch the mode and update the page URL to /lab or /doc to reflect the
        // change.
        app.shell.modeChanged.connect((_, args) => {
            const url = coreutils_lib_index_js_.PageConfig.getUrl({ mode: args });
            const path = coreutils_lib_index_js_.URLExt.parse(url).pathname;
            router.navigate(path, { skipRouting: true });
            // Persist this mode change to PageConfig as it is used elsewhere at runtime.
            coreutils_lib_index_js_.PageConfig.setOption('mode', args);
        });
        // Wait for tree resolver to finish before updating the path because it use the PageConfig['treePath']
        void treeResolver.paths.then(() => {
            // Watch the path of the current widget in the main area and update the page
            // URL to reflect the change.
            app.shell.currentPathChanged.connect((_, args) => {
                const maybeTreePath = args.newValue;
                const treePath = maybeTreePath || _defaultBrowserTreePath;
                const url = coreutils_lib_index_js_.PageConfig.getUrl({ treePath: treePath });
                const path = coreutils_lib_index_js_.URLExt.parse(url).pathname;
                router.navigate(path, { skipRouting: true });
                // Persist the new tree path to PageConfig as it is used elsewhere at runtime.
                coreutils_lib_index_js_.PageConfig.setOption('treePath', treePath);
                _docTreePath = maybeTreePath;
            });
        });
        // If the connection to the server is lost, handle it with the
        // connection lost handler.
        connectionLost = connectionLost || index_js_.ConnectionLost;
        app.serviceManager.connectionFailure.connect((manager, error) => connectionLost(manager, error, translator));
        const builder = app.serviceManager.builder;
        const build = () => {
            return builder
                .build()
                .then(() => {
                return (0,lib_index_js_.showDialog)({
                    title: trans.__('Build Complete'),
                    body: (react_index_js_.createElement("div", null,
                        trans.__('Build successfully completed, reload page?'),
                        react_index_js_.createElement("br", null),
                        trans.__('You will lose any unsaved changes.'))),
                    buttons: [
                        lib_index_js_.Dialog.cancelButton({
                            label: trans.__('Reload Without Saving'),
                            actions: ['reload']
                        }),
                        lib_index_js_.Dialog.okButton({ label: trans.__('Save and Reload') })
                    ],
                    hasClose: true
                });
            })
                .then(({ button: { accept, actions } }) => {
                if (accept) {
                    void app.commands
                        .execute('docmanager:save')
                        .then(() => {
                        router.reload();
                    })
                        .catch(err => {
                        void (0,lib_index_js_.showErrorMessage)(trans.__('Save Failed'), {
                            message: react_index_js_.createElement("pre", null, err.message)
                        });
                    });
                }
                else if (actions.includes('reload')) {
                    router.reload();
                }
            })
                .catch(err => {
                void (0,lib_index_js_.showErrorMessage)(trans.__('Build Failed'), {
                    message: react_index_js_.createElement("pre", null, err.message)
                });
            });
        };
        if (builder.isAvailable && builder.shouldCheck) {
            void builder.getStatus().then(response => {
                if (response.status === 'building') {
                    return build();
                }
                if (response.status !== 'needed') {
                    return;
                }
                const body = (react_index_js_.createElement("div", null,
                    trans.__('JupyterLab build is suggested:'),
                    react_index_js_.createElement("br", null),
                    react_index_js_.createElement("pre", null, response.message)));
                void (0,lib_index_js_.showDialog)({
                    title: trans.__('Build Recommended'),
                    body,
                    buttons: [
                        lib_index_js_.Dialog.cancelButton(),
                        lib_index_js_.Dialog.okButton({ label: trans.__('Build') })
                    ]
                }).then(result => (result.button.accept ? build() : undefined));
            });
        }
        return updateTreePath;
    },
    autoStart: true
};
/**
 * Plugin to build the context menu from the settings.
 */
const contextMenuPlugin = {
    id: '@jupyterlab/application-extension:context-menu',
    description: 'Populates the context menu.',
    autoStart: true,
    requires: [settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ICommandPalette],
    activate: (app, settingRegistry, translator, palette) => {
        const trans = translator.load('jupyterlab');
        function createMenu(options) {
            const menu = new ui_components_lib_index_js_.RankedMenu({ ...options, commands: app.commands });
            if (options.label) {
                menu.title.label = trans.__(options.label);
            }
            return menu;
        }
        // Load the context menu lately so plugins are loaded.
        app.started
            .then(() => {
            return Private.loadSettingsContextMenu(app.contextMenu, app.commands, settingRegistry, createMenu, translator);
        })
            .then(() => {
            if (palette) {
                palette === null || palette === void 0 ? void 0 : palette.addItem({
                    category: trans.__('Settings'),
                    command: CommandIDs.toggleContextMenu
                });
            }
        })
            .catch(reason => {
            console.error('Failed to load context menu items from settings registry.', reason);
        });
    }
};
/**
 * Check if the application is dirty before closing the browser tab.
 */
const dirty = {
    id: '@jupyterlab/application-extension:dirty',
    description: 'Adds safeguard dialog when closing the browser tab with unsaved modifications.',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator],
    activate: (app, translator) => {
        if (!(app instanceof index_js_.JupyterLab)) {
            throw new Error(`${dirty.id} must be activated in JupyterLab.`);
        }
        const trans = translator.load('jupyterlab');
        const message = trans.__('Are you sure you want to exit JupyterLab?\n\nAny unsaved changes will be lost.');
        // The spec for the `beforeunload` event is implemented differently by
        // the different browser vendors. Consequently, the `event.returnValue`
        // attribute needs to set in addition to a return value being returned.
        // For more information, see:
        // https://developer.mozilla.org/en/docs/Web/Events/beforeunload
        window.addEventListener('beforeunload', event => {
            if (app.status.isDirty) {
                return (event.returnValue = message);
            }
        });
    }
};
/**
 * The default layout restorer provider.
 */
const layout = {
    id: '@jupyterlab/application-extension:layout',
    description: 'Provides the shell layout restorer.',
    requires: [statedb_lib_index_js_.IStateDB, index_js_.ILabShell, settingregistry_lib_index_js_.ISettingRegistry],
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, state, labShell, settingRegistry, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const first = app.started;
        const registry = app.commands;
        const mode = coreutils_lib_index_js_.PageConfig.getOption('mode');
        const restorer = new index_js_.LayoutRestorer({
            connector: state,
            first,
            registry,
            mode
        });
        settingRegistry
            .load(shell.id)
            .then(settings => {
            var _a, _b;
            // Add a layer of customization to support app shell mode
            const customizedLayout = settings.composite['layout'];
            // Restore the layout.
            void labShell
                .restoreLayout(mode, restorer, {
                'multiple-document': (_a = customizedLayout.multiple) !== null && _a !== void 0 ? _a : {},
                'single-document': (_b = customizedLayout.single) !== null && _b !== void 0 ? _b : {}
            })
                .then(() => {
                labShell.layoutModified.connect(() => {
                    void restorer.save(labShell.saveLayout());
                });
                settings.changed.connect(onSettingsChanged);
                Private.activateSidebarSwitcher(app, labShell, settings, trans);
            });
        })
            .catch(reason => {
            console.error('Fail to load settings for the layout restorer.');
            console.error(reason);
        });
        return restorer;
        async function onSettingsChanged(settings) {
            if (!dist_index_js_.JSONExt.deepEqual(settings.composite['layout'], {
                single: labShell.userLayout['single-document'],
                multiple: labShell.userLayout['multiple-document']
            })) {
                const result = await (0,lib_index_js_.showDialog)({
                    title: trans.__('Information'),
                    body: trans.__('User layout customization has changed. You may need to reload JupyterLab to see the changes.'),
                    buttons: [
                        lib_index_js_.Dialog.cancelButton(),
                        lib_index_js_.Dialog.okButton({ label: trans.__('Reload') })
                    ]
                });
                if (result.button.accept) {
                    location.reload();
                }
            }
        }
    },
    autoStart: true,
    provides: index_js_.ILayoutRestorer
};
/**
 * The default URL router provider.
 */
const router = {
    id: '@jupyterlab/application-extension:router',
    description: 'Provides the URL router',
    requires: [index_js_.JupyterFrontEnd.IPaths],
    activate: (app, paths) => {
        const { commands } = app;
        const base = paths.urls.base;
        const router = new index_js_.Router({ base, commands });
        void app.started.then(() => {
            // Route the very first request on load.
            void router.route();
            // Route all pop state events.
            window.addEventListener('popstate', () => {
                void router.route();
            });
        });
        return router;
    },
    autoStart: true,
    provides: index_js_.IRouter
};
/**
 * The default tree route resolver plugin.
 */
const tree = {
    id: '@jupyterlab/application-extension:tree-resolver',
    description: 'Provides the tree route resolver',
    autoStart: true,
    requires: [index_js_.IRouter],
    optional: [translation_lib_index_js_.ITranslator],
    provides: index_js_.JupyterFrontEnd.ITreeResolver,
    activate: (app, router, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const { commands } = app;
        const set = new disposable_dist_index_es6_js_.DisposableSet();
        const delegate = new dist_index_js_.PromiseDelegate();
        const treePattern = new RegExp('/(lab|doc)(/workspaces/[a-zA-Z0-9-_]+)?(/tree/.*)?');
        set.add(commands.addCommand(CommandIDs.tree, {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        search: {
                            type: 'string',
                            description: trans.__('The URL search string containing query parameters')
                        }
                    }
                }
            },
            execute: async (args) => {
                var _a;
                if (set.isDisposed) {
                    return;
                }
                const query = coreutils_lib_index_js_.URLExt.queryStringToObject((_a = args.search) !== null && _a !== void 0 ? _a : '');
                const browser = query['file-browser-path'] || '';
                // Remove the file browser path from the query string.
                delete query['file-browser-path'];
                // Clean up artifacts immediately upon routing.
                set.dispose();
                delegate.resolve({ browser, file: coreutils_lib_index_js_.PageConfig.getOption('treePath') });
            }
        }));
        set.add(router.register({ command: CommandIDs.tree, pattern: treePattern }));
        // If a route is handled by the router without the tree command being
        // invoked, resolve to `null` and clean up artifacts.
        const listener = () => {
            if (set.isDisposed) {
                return;
            }
            set.dispose();
            delegate.resolve(null);
        };
        router.routed.connect(listener);
        set.add(new disposable_dist_index_es6_js_.DisposableDelegate(() => {
            router.routed.disconnect(listener);
        }));
        return { paths: delegate.promise };
    }
};
/**
 * The default URL not found extension.
 */
const notfound = {
    id: '@jupyterlab/application-extension:notfound',
    description: 'Defines the behavior for not found URL (aka route).',
    requires: [index_js_.JupyterFrontEnd.IPaths, index_js_.IRouter, translation_lib_index_js_.ITranslator],
    activate: (_, paths, router, translator) => {
        const trans = translator.load('jupyterlab');
        const bad = paths.urls.notFound;
        if (!bad) {
            return;
        }
        const base = router.base;
        const message = trans.__('The path: %1 was not found. JupyterLab redirected to: %2', bad, base);
        // Change the URL back to the base application URL.
        router.navigate('');
        void (0,lib_index_js_.showErrorMessage)(trans.__('Path Not Found'), { message });
    },
    autoStart: true
};
/**
 * Change the favicon changing based on the busy status;
 */
const busy = {
    id: '@jupyterlab/application-extension:faviconbusy',
    description: 'Handles the favicon depending on the application status.',
    requires: [index_js_.ILabStatus],
    activate: async (_, status) => {
        status.busySignal.connect((_, isBusy) => {
            const favicon = document.querySelector(`link[rel="icon"]${isBusy ? '.idle.favicon' : '.busy.favicon'}`);
            if (!favicon) {
                return;
            }
            const newFavicon = document.querySelector(`link${isBusy ? '.busy.favicon' : '.idle.favicon'}`);
            if (!newFavicon) {
                return;
            }
            // If we have the two icons with the special classes, then toggle them.
            if (favicon !== newFavicon) {
                favicon.rel = '';
                newFavicon.rel = 'icon';
                // Firefox doesn't seem to recognize just changing rel, so we also
                // reinsert the link into the DOM.
                newFavicon.parentNode.replaceChild(newFavicon, newFavicon);
            }
        });
    },
    autoStart: true
};
/**
 * The default JupyterLab application shell.
 */
const shell = {
    id: '@jupyterlab/application-extension:shell',
    description: 'Provides the JupyterLab shell. It has an extended API compared to `app.shell`.',
    optional: [settingregistry_lib_index_js_.ISettingRegistry],
    activate: (app, settingRegistry) => {
        if (!(app.shell instanceof index_js_.LabShell)) {
            throw new Error(`${shell.id} did not find a LabShell instance.`);
        }
        if (settingRegistry) {
            void settingRegistry.load(shell.id).then(settings => {
                app.shell.updateConfig(settings.composite);
                settings.changed.connect(() => {
                    app.shell.updateConfig(settings.composite);
                });
            });
        }
        return app.shell;
    },
    autoStart: true,
    provides: index_js_.ILabShell
};
/**
 * The default JupyterLab application status provider.
 */
const lib_status = {
    id: '@jupyterlab/application-extension:status',
    description: 'Provides the application status.',
    activate: (app) => {
        if (!(app instanceof index_js_.JupyterLab)) {
            throw new Error(`${lib_status.id} must be activated in JupyterLab.`);
        }
        return app.status;
    },
    autoStart: true,
    provides: index_js_.ILabStatus
};
/**
 * The default JupyterLab application-specific information provider.
 *
 * #### Notes
 * This plugin should only be used by plugins that specifically need to access
 * JupyterLab application information, e.g., listing extensions that have been
 * loaded or deferred within JupyterLab.
 */
const info = {
    id: '@jupyterlab/application-extension:info',
    description: 'Provides the application information.',
    activate: (app) => {
        if (!(app instanceof index_js_.JupyterLab)) {
            throw new Error(`${info.id} must be activated in JupyterLab.`);
        }
        return app.info;
    },
    autoStart: true,
    provides: index_js_.JupyterLab.IInfo
};
/**
 * The default JupyterLab paths dictionary provider.
 */
const paths = {
    id: '@jupyterlab/application-extension:paths',
    description: 'Provides the application paths.',
    activate: (app) => {
        if (!(app instanceof index_js_.JupyterLab)) {
            throw new Error(`${paths.id} must be activated in JupyterLab.`);
        }
        return app.paths;
    },
    autoStart: true,
    provides: index_js_.JupyterFrontEnd.IPaths
};
/**
 * The default property inspector provider.
 */
const propertyInspector = {
    id: '@jupyterlab/application-extension:property-inspector',
    description: 'Provides the property inspector.',
    autoStart: true,
    requires: [index_js_.ILabShell, translation_lib_index_js_.ITranslator],
    optional: [index_js_.ILayoutRestorer],
    provides: property_inspector_lib_index_js_.IPropertyInspectorProvider,
    activate: (app, labshell, translator, restorer) => {
        const trans = translator.load('jupyterlab');
        const widget = new property_inspector_lib_index_js_.SideBarPropertyInspectorProvider({
            shell: labshell,
            translator
        });
        widget.title.icon = ui_components_lib_index_js_.buildIcon;
        widget.title.caption = trans.__('Property Inspector');
        widget.id = 'jp-property-inspector';
        labshell.add(widget, 'right', { rank: 100, type: 'Property Inspector' });
        app.commands.addCommand(CommandIDs.showPropertyPanel, {
            label: trans.__('Property Inspector'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                labshell.activateById(widget.id);
            }
        });
        if (restorer) {
            restorer.add(widget, 'jp-property-inspector');
        }
        return widget;
    }
};
const jupyterLogo = {
    id: '@jupyterlab/application-extension:logo',
    description: 'Sets the application logo.',
    autoStart: true,
    requires: [index_js_.ILabShell],
    activate: (app, shell) => {
        const logo = new widgets_dist_index_es6_js_.Widget();
        ui_components_lib_index_js_.jupyterIcon.element({
            container: logo.node,
            elementPosition: 'center',
            margin: '2px 2px 2px 8px',
            height: 'auto',
            width: '16px'
        });
        logo.id = 'jp-MainLogo';
        shell.add(logo, 'top', { rank: 0 });
    }
};
/**
 * The simple interface mode switch in the status bar.
 */
const modeSwitchPlugin = {
    id: '@jupyterlab/application-extension:mode-switch',
    description: 'Adds the interface mode switch',
    requires: [index_js_.ILabShell, translation_lib_index_js_.ITranslator],
    optional: [statusbar_lib_index_js_.IStatusBar, settingregistry_lib_index_js_.ISettingRegistry],
    activate: (app, labShell, translator, statusBar, settingRegistry) => {
        if (statusBar === null) {
            // Bail early
            return;
        }
        const trans = translator.load('jupyterlab');
        const modeSwitch = new ui_components_lib_index_js_.Switch();
        modeSwitch.id = 'jp-single-document-mode';
        modeSwitch.valueChanged.connect((_, args) => {
            labShell.mode = args.newValue ? 'single-document' : 'multiple-document';
        });
        labShell.modeChanged.connect((_, mode) => {
            modeSwitch.value = mode === 'single-document';
        });
        if (settingRegistry) {
            const loadSettings = settingRegistry.load(shell.id);
            const updateSettings = (settings) => {
                const startMode = settings.get('startMode').composite;
                if (startMode) {
                    labShell.mode =
                        startMode === 'single' ? 'single-document' : 'multiple-document';
                }
            };
            Promise.all([loadSettings, app.restored])
                .then(([settings]) => {
                updateSettings(settings);
            })
                .catch((reason) => {
                console.error(reason.message);
            });
        }
        // Show the current file browser shortcut in its title.
        const updateModeSwitchTitle = () => {
            const binding = app.commands.keyBindings.find(b => b.command === 'application:toggle-mode');
            if (binding) {
                const ks = binding.keys.map(dist_index_es6_js_.CommandRegistry.formatKeystroke).join(', ');
                modeSwitch.caption = trans.__('Simple Interface (%1)', ks);
            }
            else {
                modeSwitch.caption = trans.__('Simple Interface');
            }
        };
        updateModeSwitchTitle();
        app.commands.keyBindingChanged.connect(() => {
            updateModeSwitchTitle();
        });
        modeSwitch.label = trans.__('Simple');
        statusBar.registerStatusItem(modeSwitchPlugin.id, {
            priority: 1,
            item: modeSwitch,
            align: 'left',
            rank: -1
        });
    },
    autoStart: true
};
/**
 * Export the plugins as default.
 */
const plugins = [
    contextMenuPlugin,
    dirty,
    main,
    mainCommands,
    layout,
    router,
    tree,
    notfound,
    busy,
    shell,
    lib_status,
    info,
    modeSwitchPlugin,
    paths,
    propertyInspector,
    jupyterLogo,
    topbar
];
/* harmony default export */ const lib = (plugins);
var Private;
(function (Private) {
    async function displayInformation(trans) {
        const result = await (0,lib_index_js_.showDialog)({
            title: trans.__('Information'),
            body: trans.__('Context menu customization has changed. You will need to reload JupyterLab to see the changes.'),
            buttons: [
                lib_index_js_.Dialog.cancelButton(),
                lib_index_js_.Dialog.okButton({ label: trans.__('Reload') })
            ]
        });
        if (result.button.accept) {
            location.reload();
        }
    }
    async function loadSettingsContextMenu(contextMenu, commands, registry, menuFactory, translator) {
        var _a;
        const trans = translator.load('jupyterlab');
        const pluginId = contextMenuPlugin.id;
        let canonical = null;
        let loaded = {};
        /**
         * Populate the plugin's schema defaults.
         *
         * We keep track of disabled entries in case the plugin is loaded
         * after the menu initialization.
         */
        function populate(schema) {
            var _a, _b;
            loaded = {};
            const pluginDefaults = Object.keys(registry.plugins)
                .map(plugin => {
                var _a, _b;
                const items = (_b = (_a = registry.plugins[plugin].schema['jupyter.lab.menus']) === null || _a === void 0 ? void 0 : _a.context) !== null && _b !== void 0 ? _b : [];
                loaded[plugin] = items;
                return items;
            })
                .concat([(_b = (_a = schema['jupyter.lab.menus']) === null || _a === void 0 ? void 0 : _a.context) !== null && _b !== void 0 ? _b : []])
                .reduceRight((acc, val) => settingregistry_lib_index_js_.SettingRegistry.reconcileItems(acc, val, true), []);
            // Apply default value as last step to take into account overrides.json
            // The standard default being [] as the plugin must use `jupyter.lab.menus.context`
            // to define their default value.
            schema.properties.contextMenu.default = settingregistry_lib_index_js_.SettingRegistry.reconcileItems(pluginDefaults, schema.properties.contextMenu.default, true)
                // flatten one level
                .sort((a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : Infinity) - ((_b = b.rank) !== null && _b !== void 0 ? _b : Infinity); });
        }
        // Transform the plugin object to return different schema than the default.
        registry.transform(pluginId, {
            compose: plugin => {
                var _a, _b, _c, _d;
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                const defaults = (_c = (_b = (_a = canonical.properties) === null || _a === void 0 ? void 0 : _a.contextMenu) === null || _b === void 0 ? void 0 : _b.default) !== null && _c !== void 0 ? _c : [];
                const user = {
                    ...plugin.data.user,
                    contextMenu: (_d = plugin.data.user.contextMenu) !== null && _d !== void 0 ? _d : []
                };
                const composite = {
                    ...plugin.data.composite,
                    contextMenu: settingregistry_lib_index_js_.SettingRegistry.reconcileItems(defaults, user.contextMenu, false)
                };
                plugin.data = { composite, user };
                return plugin;
            },
            fetch: plugin => {
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                return {
                    data: plugin.data,
                    id: plugin.id,
                    raw: plugin.raw,
                    schema: canonical,
                    version: plugin.version
                };
            }
        });
        // Repopulate the canonical variable after the setting registry has
        // preloaded all initial plugins.
        const settings = await registry.load(pluginId);
        // Set the suppress flag on document.body if necessary.
        const setDisabled = (settings) => {
            const root = document.body;
            const isDisabled = root.hasAttribute('data-jp-suppress-context-menu');
            const shouldDisable = settings.get('disabled').composite;
            if (isDisabled && !shouldDisable) {
                root.removeAttribute('data-jp-suppress-context-menu');
            }
            else if (shouldDisable && !isDisabled) {
                root.setAttribute('data-jp-suppress-context-menu', 'true');
            }
        };
        const contextItems = (_a = settings.composite.contextMenu) !== null && _a !== void 0 ? _a : [];
        // Create menu item for non-disabled element
        settingregistry_lib_index_js_.SettingRegistry.filterDisabledItems(contextItems).forEach(item => {
            lib_index_js_.MenuFactory.addContextItem({
                // We have to set the default rank because Lumino is sorting the visible items
                rank: DEFAULT_CONTEXT_ITEM_RANK,
                ...item
            }, contextMenu, menuFactory);
        });
        settings.changed.connect(() => {
            var _a;
            // As extension may change the context menu through API,
            // prompt the user to reload if the menu has been updated.
            const newItems = (_a = settings.composite.contextMenu) !== null && _a !== void 0 ? _a : [];
            if (!dist_index_js_.JSONExt.deepEqual(contextItems, newItems)) {
                void displayInformation(trans);
            }
            setDisabled(settings);
        });
        registry.pluginChanged.connect(async (sender, plugin) => {
            var _a, _b, _c, _d;
            if (plugin !== pluginId) {
                // If the plugin changed its menu.
                const oldItems = (_a = loaded[plugin]) !== null && _a !== void 0 ? _a : [];
                const newItems = (_c = (_b = registry.plugins[plugin].schema['jupyter.lab.menus']) === null || _b === void 0 ? void 0 : _b.context) !== null && _c !== void 0 ? _c : [];
                if (!dist_index_js_.JSONExt.deepEqual(oldItems, newItems)) {
                    if (loaded[plugin]) {
                        // The plugin has changed, request the user to reload the UI
                        await displayInformation(trans);
                    }
                    else {
                        // The plugin was not yet loaded when the menu was built => update the menu
                        loaded[plugin] = dist_index_js_.JSONExt.deepCopy(newItems);
                        // Merge potential disabled state
                        const toAdd = (_d = settingregistry_lib_index_js_.SettingRegistry.reconcileItems(newItems, contextItems, false, false)) !== null && _d !== void 0 ? _d : [];
                        settingregistry_lib_index_js_.SettingRegistry.filterDisabledItems(toAdd).forEach(item => {
                            lib_index_js_.MenuFactory.addContextItem({
                                // We have to set the default rank because Lumino is sorting the visible items
                                rank: DEFAULT_CONTEXT_ITEM_RANK,
                                ...item
                            }, contextMenu, menuFactory);
                        });
                    }
                }
            }
        });
        // Handle disabled status.
        setDisabled(settings);
        commands.addCommand(CommandIDs.toggleContextMenu, {
            label: trans.__('Enable Context Menu'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isToggleable: true,
            isToggled: () => !settings.get('disabled').composite,
            execute: () => void settings.set('disabled', !settings.get('disabled').composite)
        });
    }
    Private.loadSettingsContextMenu = loadSettingsContextMenu;
    function activateSidebarSwitcher(app, labShell, settings, trans) {
        // Add a command to switch a side panels's side
        app.commands.addCommand(CommandIDs.switchSidebar, {
            label: trans.__('Switch Sidebar Side'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                // First, try to find the correct panel based on the application
                // context menu click. Bail if we don't find a sidebar for the widget.
                const contextNode = app.contextMenuHitTest(node => !!node.dataset.id);
                if (!contextNode) {
                    return;
                }
                const id = contextNode.dataset['id'];
                const leftPanel = document.getElementById('jp-left-stack');
                const node = document.getElementById(id);
                let newLayout = null;
                // Move the panel to the other side.
                if (leftPanel && node && leftPanel.contains(node)) {
                    const widget = (0,index_es6_js_.find)(labShell.widgets('left'), w => w.id === id);
                    if (widget) {
                        newLayout = labShell.move(widget, 'right');
                        labShell.activateById(widget.id);
                    }
                }
                else {
                    const widget = (0,index_es6_js_.find)(labShell.widgets('right'), w => w.id === id);
                    if (widget) {
                        newLayout = labShell.move(widget, 'left');
                        labShell.activateById(widget.id);
                    }
                }
                if (newLayout) {
                    settings
                        .set('layout', {
                        single: newLayout['single-document'],
                        multiple: newLayout['multiple-document']
                    })
                        .catch(reason => {
                        console.error('Failed to save user layout customization.', reason);
                    });
                }
            }
        });
        app.commands.commandExecuted.connect((registry, executed) => {
            if (executed.id === CommandIDs.resetLayout) {
                settings.remove('layout').catch(reason => {
                    console.error('Failed to remove user layout customization.', reason);
                });
            }
        });
    }
    Private.activateSidebarSwitcher = activateSidebarSwitcher;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 32723:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js + 1 modules
var statusbar_style = __webpack_require__(546);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/property-inspector/style/index.js + 1 modules
var property_inspector_style = __webpack_require__(62374);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/application-extension/style/base.css
var base = __webpack_require__(6347);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 76853:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ConnectionLost: () => (/* reexport */ ConnectionLost),
  IConnectionLost: () => (/* reexport */ IConnectionLost),
  ILabShell: () => (/* reexport */ ILabShell),
  ILabStatus: () => (/* reexport */ ILabStatus),
  ILayoutRestorer: () => (/* reexport */ layoutrestorer/* ILayoutRestorer */.L),
  IMimeDocumentTracker: () => (/* reexport */ mimerenderers/* IMimeDocumentTracker */.w2),
  IRouter: () => (/* reexport */ IRouter),
  ITreePathUpdater: () => (/* reexport */ ITreePathUpdater),
  JupyterFrontEnd: () => (/* reexport */ JupyterFrontEnd),
  JupyterFrontEndContextMenu: () => (/* reexport */ JupyterFrontEndContextMenu),
  JupyterLab: () => (/* reexport */ JupyterLab),
  LabShell: () => (/* reexport */ LabShell),
  LabStatus: () => (/* reexport */ lib_status/* LabStatus */.J),
  LayoutRestorer: () => (/* reexport */ layoutrestorer/* LayoutRestorer */.c),
  Router: () => (/* reexport */ Router),
  addSemanticCommand: () => (/* reexport */ addSemanticCommand),
  createRendermimePlugin: () => (/* reexport */ mimerenderers/* createRendermimePlugin */.aX),
  createRendermimePlugins: () => (/* reexport */ mimerenderers/* createRendermimePlugins */.as),
  createSemanticCommand: () => (/* reexport */ createSemanticCommand)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var lib_index_js_ = __webpack_require__(17968);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/connectionlost.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A default connection lost handler, which brings up an error dialog.
 */
const ConnectionLost = async function (manager, err, translator) {
    translator = translator || lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const title = trans.__('Server Connection Error');
    const networkMsg = trans.__('A connection to the Jupyter server could not be established.\n' +
        'JupyterLab will continue trying to reconnect.\n' +
        'Check your network connection or Jupyter server configuration.\n');
    if (!Private.displayConnectionLost) {
        return;
    }
    if (Private.serverConnectionLost) {
        // Wait for the pre-existing promise to complete
        await Private.serverConnectionLost;
        return;
    }
    const dialog = (0,index_js_.showDialog)({
        title: title,
        body: networkMsg,
        checkbox: {
            label: trans.__('Do not show this message again in this session.'),
            caption: trans.__('If checked, you will not see a dialog informing you about an issue with server connection in this session.')
        },
        buttons: [index_js_.Dialog.cancelButton({ label: trans.__('Close') })]
    })
        .then(result => {
        if (result.isChecked) {
            Private.displayConnectionLost = false;
        }
        return;
    })
        .catch(error => {
        console.error('An error occurred while showing the dialog: ', error);
    })
        .finally(() => {
        Private.serverConnectionLost = undefined;
    });
    Private.serverConnectionLost = dialog;
};
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * Boolean determining if connection lost dialog is displayed.
     */
    Private.displayConnectionLost = true;
})(Private || (Private = {}));
//# sourceMappingURL=connectionlost.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/application@~2.4.8 (singleton) (fallback: ../node_modules/@lumino/application/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23277);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/frontend.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * The base Jupyter front-end application class.
 *
 * @typeparam `T` - The `shell` type. Defaults to `JupyterFrontEnd.IShell`.
 *
 * @typeparam `U` - The type for supported format names. Defaults to `string`.
 *
 * #### Notes
 * This type is useful as a generic application against which front-end plugins
 * can be authored. It inherits from the Lumino `Application`.
 */
class JupyterFrontEnd extends index_es6_js_.Application {
    /**
     * Construct a new JupyterFrontEnd object.
     */
    constructor(options) {
        super(options);
        this._formatChanged = new dist_index_es6_js_.Signal(this);
        // Class to scope global Jupyter CSS rules
        options.shell.addClass('jp-ThemedContainer');
        // render context menu/submenus with inline svg icon tweaks
        this.contextMenu = new ui_components_lib_index_js_.ContextMenuSvg({
            commands: this.commands,
            renderer: options.contextMenuRenderer,
            groupByTarget: false,
            sortBySelector: false
        });
        // The default restored promise if one does not exist in the options.
        const restored = new Promise(resolve => {
            requestAnimationFrame(() => {
                resolve();
            });
        });
        this.commandLinker =
            options.commandLinker || new index_js_.CommandLinker({ commands: this.commands });
        this.docRegistry = options.docRegistry || new docregistry_lib_index_js_.DocumentRegistry();
        this.restored =
            options.restored ||
                this.started.then(() => restored).catch(() => restored);
        this.serviceManager = options.serviceManager || new services_lib_index_js_.ServiceManager();
    }
    /**
     * The application form factor, e.g., `desktop` or `mobile`.
     */
    get format() {
        return this._format;
    }
    set format(format) {
        if (this._format !== format) {
            this._format = format;
            document.body.dataset['format'] = format;
            this._formatChanged.emit(format);
        }
    }
    /**
     * A signal that emits when the application form factor changes.
     */
    get formatChanged() {
        return this._formatChanged;
    }
    /**
     * Walks up the DOM hierarchy of the target of the active `contextmenu`
     * event, testing each HTMLElement ancestor for a user-supplied function. This can
     * be used to find an HTMLElement on which to operate, given a context menu click.
     *
     * @param fn - a function that takes an `HTMLElement` and returns a
     *   boolean for whether it is the element the requester is seeking.
     *
     * @returns an HTMLElement or undefined, if none is found.
     */
    contextMenuHitTest(fn) {
        if (!this._contextMenuEvent ||
            !(this._contextMenuEvent.target instanceof Node)) {
            return undefined;
        }
        let node = this._contextMenuEvent.target;
        do {
            if (node instanceof HTMLElement && fn(node)) {
                return node;
            }
            node = node.parentNode;
        } while (node && node.parentNode && node !== node.parentNode);
        return undefined;
        // TODO: we should be able to use .composedPath() to simplify this function
        // down to something like the below, but it seems like composedPath is
        // sometimes returning an empty list.
        /*
        if (this._contextMenuEvent) {
          this._contextMenuEvent
            .composedPath()
            .filter(x => x instanceof HTMLElement)
            .find(test);
        }
        return undefined;
        */
    }
    /**
     * A method invoked on a document `'contextmenu'` event.
     */
    evtContextMenu(event) {
        this._contextMenuEvent = event;
        if (event.shiftKey ||
            frontend_Private.suppressContextMenu(event.target)) {
            return;
        }
        const opened = this.contextMenu.open(event);
        if (opened) {
            const items = this.contextMenu.menu.items;
            // If only the context menu information will be shown,
            // with no real commands, close the context menu and
            // allow the native one to open.
            if (items.length === 1 &&
                items[0].command === JupyterFrontEndContextMenu.contextMenu) {
                this.contextMenu.menu.close();
                return;
            }
            // Stop propagation and allow the application context menu to show.
            event.preventDefault();
            event.stopPropagation();
        }
    }
}
/**
 * The namespace for `JupyterFrontEnd` class statics.
 */
(function (JupyterFrontEnd) {
    /**
     * Is JupyterLab in document mode?
     *
     * @param path - Full URL of JupyterLab
     * @param paths - The current IPaths object hydrated from PageConfig.
     */
    function inDocMode(path, paths) {
        const docPattern = new RegExp(`^${paths.urls.doc}`);
        const match = path.match(docPattern);
        if (match) {
            return true;
        }
        else {
            return false;
        }
    }
    JupyterFrontEnd.inDocMode = inDocMode;
    /**
     * The application paths dictionary token.
     */
    JupyterFrontEnd.IPaths = new dist_index_js_.Token('@jupyterlab/application:IPaths', `A service providing information about various
  URLs and server paths for the current application. Use this service if you want to
  assemble URLs to use the JupyterLab REST API.`);
    /**
     * The application tree resolver token.
     *
     * #### Notes
     * Not all Jupyter front-end applications will have a tree resolver
     * implemented on the client-side. This token should not be required as a
     * dependency if it is possible to make it an optional dependency.
     */
    JupyterFrontEnd.ITreeResolver = new dist_index_js_.Token('@jupyterlab/application:ITreeResolver', 'A service to resolve the tree path.');
})(JupyterFrontEnd || (JupyterFrontEnd = {}));
/**
 * A namespace for module-private functionality.
 */
var frontend_Private;
(function (Private) {
    /**
     * Returns whether the element is itself, or a child of, an element with the `jp-suppress-context-menu` data attribute.
     */
    function suppressContextMenu(element) {
        return element.closest('[data-jp-suppress-context-menu]') !== null;
    }
    Private.suppressContextMenu = suppressContextMenu;
})(frontend_Private || (frontend_Private = {}));
/**
 * A namespace for the context menu override.
 */
var JupyterFrontEndContextMenu;
(function (JupyterFrontEndContextMenu) {
    /**
     * An id for a private context-menu-info ersatz command.
     */
    JupyterFrontEndContextMenu.contextMenu = '__internal:context-menu-info';
})(JupyterFrontEndContextMenu || (JupyterFrontEndContextMenu = {}));
//# sourceMappingURL=frontend.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/lib/mimerenderers.js
var mimerenderers = __webpack_require__(75677);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/shell.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.









/**
 * The class name added to AppShell instances.
 */
const APPLICATION_SHELL_CLASS = 'jp-LabShell';
/**
 * The class name added to side bar instances.
 */
const SIDEBAR_CLASS = 'jp-SideBar';
/**
 * The class name added to the current widget's title.
 */
const CURRENT_CLASS = 'jp-mod-current';
/**
 * The class name added to the active widget's title.
 */
const ACTIVE_CLASS = 'jp-mod-active';
/**
 * The default rank of items added to a sidebar.
 */
const DEFAULT_RANK = 900;
const ACTIVITY_CLASS = 'jp-Activity';
/**
 * The JupyterLab application shell token.
 */
const ILabShell = new dist_index_js_.Token('@jupyterlab/application:ILabShell', 'A service for interacting with the JupyterLab shell. The top-level `application` object also has a reference to the shell, but it has a restricted interface in order to be agnostic to different shell implementations on the application. Use this to get more detailed information about currently active widgets and layout state.');
/**
 * The application shell for JupyterLab.
 */
class LabShell extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new application shell.
     */
    constructor(options) {
        super();
        /**
         * A message hook for child add/remove messages on the main area dock panel.
         */
        this._dockChildHook = (handler, msg) => {
            switch (msg.type) {
                case 'child-added':
                    msg.child.addClass(ACTIVITY_CLASS);
                    this._tracker.add(msg.child);
                    break;
                case 'child-removed':
                    msg.child.removeClass(ACTIVITY_CLASS);
                    this._tracker.remove(msg.child);
                    break;
                default:
                    break;
            }
            return true;
        };
        this._activeChanged = new dist_index_es6_js_.Signal(this);
        this._cachedLayout = null;
        this._currentChanged = new dist_index_es6_js_.Signal(this);
        this._currentPath = '';
        this._currentPathChanged = new dist_index_es6_js_.Signal(this);
        this._modeChanged = new dist_index_es6_js_.Signal(this);
        this._isRestored = false;
        this._layoutModified = new dist_index_es6_js_.Signal(this);
        this._layoutDebouncer = new polling_dist_index_es6_js_.Debouncer(() => {
            this._layoutModified.emit(undefined);
        }, 0);
        this._restored = new dist_index_js_.PromiseDelegate();
        this._tracker = new widgets_dist_index_es6_js_.FocusTracker();
        this._topHandlerHiddenByUser = false;
        this._idTypeMap = new Map();
        this._mainOptionsCache = new Map();
        this._sideOptionsCache = new Map();
        this._delayedWidget = new Array();
        this.addClass(APPLICATION_SHELL_CLASS);
        this.id = 'main';
        if ((options === null || options === void 0 ? void 0 : options.waitForRestore) === false) {
            this._userLayout = { 'multiple-document': {}, 'single-document': {} };
        }
        // Skip Links
        const skipLinkWidget = (this._skipLinkWidget = new shell_Private.SkipLinkWidget(this));
        this._skipLinkWidget.show();
        //  Wrap the skip widget to customize its position and size
        const skipLinkWrapper = new widgets_dist_index_es6_js_.Panel();
        skipLinkWrapper.addClass('jp-skiplink-wrapper');
        skipLinkWrapper.addWidget(skipLinkWidget);
        const headerPanel = (this._headerPanel = new widgets_dist_index_es6_js_.BoxPanel());
        const menuHandler = (this._menuHandler = new shell_Private.PanelHandler());
        menuHandler.panel.node.setAttribute('role', 'navigation');
        const topHandler = (this._topHandler = new shell_Private.PanelHandler());
        topHandler.panel.node.setAttribute('role', 'banner');
        const bottomPanel = (this._bottomPanel = new widgets_dist_index_es6_js_.BoxPanel());
        bottomPanel.node.setAttribute('role', 'contentinfo');
        const hboxPanel = new widgets_dist_index_es6_js_.BoxPanel();
        const vsplitPanel = (this._vsplitPanel =
            new shell_Private.RestorableSplitPanel());
        const dockPanel = (this._dockPanel = new ui_components_lib_index_js_.DockPanelSvg({
            hiddenMode: widgets_dist_index_es6_js_.Widget.HiddenMode.Display
        }));
        messaging_dist_index_es6_js_.MessageLoop.installMessageHook(dockPanel, this._dockChildHook);
        const hsplitPanel = (this._hsplitPanel =
            new shell_Private.RestorableSplitPanel());
        const downPanel = (this._downPanel = new ui_components_lib_index_js_.TabPanelSvg({
            tabsMovable: true
        }));
        const leftHandler = (this._leftHandler = new shell_Private.SideBarHandler());
        const rightHandler = (this._rightHandler = new shell_Private.SideBarHandler());
        const rootLayout = new widgets_dist_index_es6_js_.BoxLayout();
        headerPanel.id = 'jp-header-panel';
        menuHandler.panel.id = 'jp-menu-panel';
        topHandler.panel.id = 'jp-top-panel';
        bottomPanel.id = 'jp-bottom-panel';
        hboxPanel.id = 'jp-main-content-panel';
        vsplitPanel.id = 'jp-main-vsplit-panel';
        dockPanel.id = 'jp-main-dock-panel';
        hsplitPanel.id = 'jp-main-split-panel';
        downPanel.id = 'jp-down-stack';
        leftHandler.sideBar.addClass(SIDEBAR_CLASS);
        leftHandler.sideBar.addClass('jp-mod-left');
        leftHandler.sideBar.node.setAttribute('role', 'complementary');
        leftHandler.stackedPanel.id = 'jp-left-stack';
        rightHandler.sideBar.addClass(SIDEBAR_CLASS);
        rightHandler.sideBar.addClass('jp-mod-right');
        rightHandler.sideBar.node.setAttribute('role', 'complementary');
        rightHandler.stackedPanel.id = 'jp-right-stack';
        dockPanel.node.setAttribute('role', 'main');
        hboxPanel.spacing = 0;
        vsplitPanel.spacing = 1;
        dockPanel.spacing = 5;
        hsplitPanel.spacing = 1;
        headerPanel.direction = 'top-to-bottom';
        vsplitPanel.orientation = 'vertical';
        hboxPanel.direction = 'left-to-right';
        hsplitPanel.orientation = 'horizontal';
        bottomPanel.direction = 'bottom-to-top';
        widgets_dist_index_es6_js_.SplitPanel.setStretch(leftHandler.stackedPanel, 0);
        widgets_dist_index_es6_js_.SplitPanel.setStretch(downPanel, 0);
        widgets_dist_index_es6_js_.SplitPanel.setStretch(dockPanel, 1);
        widgets_dist_index_es6_js_.SplitPanel.setStretch(rightHandler.stackedPanel, 0);
        widgets_dist_index_es6_js_.BoxPanel.setStretch(leftHandler.sideBar, 0);
        widgets_dist_index_es6_js_.BoxPanel.setStretch(hsplitPanel, 1);
        widgets_dist_index_es6_js_.BoxPanel.setStretch(rightHandler.sideBar, 0);
        widgets_dist_index_es6_js_.SplitPanel.setStretch(vsplitPanel, 1);
        hsplitPanel.addWidget(leftHandler.stackedPanel);
        hsplitPanel.addWidget(dockPanel);
        hsplitPanel.addWidget(rightHandler.stackedPanel);
        vsplitPanel.addWidget(hsplitPanel);
        vsplitPanel.addWidget(downPanel);
        hboxPanel.addWidget(leftHandler.sideBar);
        hboxPanel.addWidget(vsplitPanel);
        hboxPanel.addWidget(rightHandler.sideBar);
        rootLayout.direction = 'top-to-bottom';
        rootLayout.spacing = 0; // TODO make this configurable?
        // Use relative sizing to set the width of the side panels.
        // This will still respect the min-size of children widget in the stacked
        // panel. The default sizes will be overwritten during layout restoration.
        vsplitPanel.setRelativeSizes([3, 1]);
        hsplitPanel.setRelativeSizes([1, 2.5, 1]);
        widgets_dist_index_es6_js_.BoxLayout.setStretch(headerPanel, 0);
        widgets_dist_index_es6_js_.BoxLayout.setStretch(menuHandler.panel, 0);
        widgets_dist_index_es6_js_.BoxLayout.setStretch(topHandler.panel, 0);
        widgets_dist_index_es6_js_.BoxLayout.setStretch(hboxPanel, 1);
        widgets_dist_index_es6_js_.BoxLayout.setStretch(bottomPanel, 0);
        rootLayout.addWidget(skipLinkWrapper);
        rootLayout.addWidget(headerPanel);
        rootLayout.addWidget(topHandler.panel);
        rootLayout.addWidget(hboxPanel);
        rootLayout.addWidget(bottomPanel);
        // initially hiding header and bottom panel when no elements inside,
        this._headerPanel.hide();
        this._bottomPanel.hide();
        this._downPanel.hide();
        this.layout = rootLayout;
        // Connect change listeners.
        this._tracker.currentChanged.connect(this._onCurrentChanged, this);
        this._tracker.activeChanged.connect(this._onActiveChanged, this);
        // Connect main layout change listener.
        this._dockPanel.layoutModified.connect(this._onLayoutModified, this);
        // Connect vsplit layout change listener
        this._vsplitPanel.updated.connect(this._onLayoutModified, this);
        // Connect down panel change listeners
        this._downPanel.currentChanged.connect(this._onLayoutModified, this);
        this._downPanel.tabBar.tabMoved.connect(this._onTabPanelChanged, this);
        this._downPanel.stackedPanel.widgetRemoved.connect(this._onTabPanelChanged, this);
        // Catch current changed events on the side handlers.
        this._leftHandler.updated.connect(this._onLayoutModified, this);
        this._rightHandler.updated.connect(this._onLayoutModified, this);
        // Catch update events on the horizontal split panel
        this._hsplitPanel.updated.connect(this._onLayoutModified, this);
        // Setup single-document-mode title bar
        const titleHandler = (this._titleHandler = new shell_Private.TitleHandler(this));
        this.add(titleHandler, 'top', { rank: 100 });
        if (this._dockPanel.mode === 'multiple-document') {
            this._topHandler.addWidget(this._menuHandler.panel, 100);
            titleHandler.hide();
        }
        else {
            rootLayout.insertWidget(3, this._menuHandler.panel);
        }
        this.translator = lib_index_js_.nullTranslator;
        // Wire up signals to update the title panel of the simple interface mode to
        // follow the title of this.currentWidget
        this.currentChanged.connect((sender, args) => {
            let newValue = args.newValue;
            let oldValue = args.oldValue;
            // Stop watching the title of the previously current widget
            if (oldValue) {
                oldValue.title.changed.disconnect(this._updateTitlePanelTitle, this);
                if (oldValue instanceof docregistry_lib_index_js_.DocumentWidget) {
                    oldValue.context.pathChanged.disconnect(this._updateCurrentPath, this);
                }
            }
            // Start watching the title of the new current widget
            if (newValue) {
                newValue.title.changed.connect(this._updateTitlePanelTitle, this);
                this._updateTitlePanelTitle();
                if (newValue instanceof docregistry_lib_index_js_.DocumentWidget) {
                    newValue.context.pathChanged.connect(this._updateCurrentPath, this);
                }
            }
            this._updateCurrentPath();
        });
    }
    /**
     * A signal emitted when main area's active focus changes.
     */
    get activeChanged() {
        return this._activeChanged;
    }
    /**
     * The active widget in the shell's main area.
     */
    get activeWidget() {
        return this._tracker.activeWidget;
    }
    /**
     * Whether the add buttons for each main area tab bar are enabled.
     */
    get addButtonEnabled() {
        return this._dockPanel.addButtonEnabled;
    }
    set addButtonEnabled(value) {
        this._dockPanel.addButtonEnabled = value;
    }
    /**
     * A signal emitted when the add button on a main area tab bar is clicked.
     */
    get addRequested() {
        return this._dockPanel.addRequested;
    }
    /**
     * A signal emitted when main area's current focus changes.
     */
    get currentChanged() {
        return this._currentChanged;
    }
    /**
     * Current document path.
     */
    // FIXME deprecation `undefined` is to ensure backward compatibility in 4.x
    get currentPath() {
        return this._currentPath;
    }
    /**
     * A signal emitted when the path of the current document changes.
     *
     * This also fires when the current document itself changes.
     */
    get currentPathChanged() {
        return this._currentPathChanged;
    }
    /**
     * The current widget in the shell's main area.
     */
    get currentWidget() {
        return this._tracker.currentWidget;
    }
    /**
     * A signal emitted when the main area's layout is modified.
     */
    get layoutModified() {
        return this._layoutModified;
    }
    /**
     * Whether the left area is collapsed.
     */
    get leftCollapsed() {
        return !this._leftHandler.sideBar.currentTitle;
    }
    /**
     * Whether the left area is collapsed.
     */
    get rightCollapsed() {
        return !this._rightHandler.sideBar.currentTitle;
    }
    /**
     * Whether JupyterLab is in presentation mode with the
     * `jp-mod-presentationMode` CSS class.
     */
    get presentationMode() {
        return this.hasClass('jp-mod-presentationMode');
    }
    set presentationMode(value) {
        this.toggleClass('jp-mod-presentationMode', value);
    }
    /**
     * The main dock area's user interface mode.
     */
    get mode() {
        return this._dockPanel.mode;
    }
    set mode(mode) {
        const dock = this._dockPanel;
        if (mode === dock.mode) {
            return;
        }
        const applicationCurrentWidget = this.currentWidget;
        if (mode === 'single-document') {
            // Cache the current multi-document layout before changing the mode.
            this._cachedLayout = dock.saveLayout();
            dock.mode = mode;
            // In case the active widget in the dock panel is *not* the active widget
            // of the application, defer to the application.
            if (this.currentWidget) {
                dock.activateWidget(this.currentWidget);
            }
            // Adjust menu and title
            this.layout.insertWidget(3, this._menuHandler.panel);
            this._titleHandler.show();
            this._updateTitlePanelTitle();
            if (this._topHandlerHiddenByUser) {
                this._topHandler.panel.hide();
            }
        }
        else {
            // Cache a reference to every widget currently in the dock panel before
            // changing its mode.
            const widgets = Array.from(dock.widgets());
            dock.mode = mode;
            // Restore cached layout if possible.
            if (this._cachedLayout) {
                // Remove any disposed widgets in the cached layout and restore.
                shell_Private.normalizeAreaConfig(dock, this._cachedLayout.main);
                dock.restoreLayout(this._cachedLayout);
                this._cachedLayout = null;
            }
            // If layout restoration has been deferred, restore layout now.
            if (this._layoutRestorer.isDeferred) {
                this._layoutRestorer
                    .restoreDeferred()
                    .then(mainArea => {
                    if (mainArea) {
                        const { currentWidget, dock } = mainArea;
                        if (dock) {
                            this._dockPanel.restoreLayout(dock);
                        }
                        if (currentWidget) {
                            this.activateById(currentWidget.id);
                        }
                    }
                })
                    .catch(reason => {
                    console.error('Failed to restore the deferred layout.');
                    console.error(reason);
                });
            }
            // Add any widgets created during single document mode, which have
            // subsequently been removed from the dock panel after the multiple document
            // layout has been restored. If the widget has add options cached for
            // the widget (i.e., if it has been placed with respect to another widget),
            // then take that into account.
            widgets.forEach(widget => {
                if (!widget.parent) {
                    this._addToMainArea(widget, {
                        ...this._mainOptionsCache.get(widget),
                        activate: false
                    });
                }
            });
            this._mainOptionsCache.clear();
            // In case the active widget in the dock panel is *not* the active widget
            // of the application, defer to the application.
            if (applicationCurrentWidget) {
                dock.activateWidget(applicationCurrentWidget);
            }
            // Adjust menu and title
            this.add(this._menuHandler.panel, 'top', { rank: 100 });
            this._titleHandler.hide();
        }
        // Set the mode data attribute on the applications shell node.
        this.node.dataset.shellMode = mode;
        this._downPanel.fit();
        // Emit the mode changed signal
        this._modeChanged.emit(mode);
    }
    /**
     * A signal emitted when the shell/dock panel change modes (single/multiple document).
     */
    get modeChanged() {
        return this._modeChanged;
    }
    /**
     * Promise that resolves when state is first restored, returning layout
     * description.
     */
    get restored() {
        return this._restored.promise;
    }
    get translator() {
        var _a;
        return (_a = this._translator) !== null && _a !== void 0 ? _a : lib_index_js_.nullTranslator;
    }
    set translator(value) {
        if (value !== this._translator) {
            this._translator = value;
            // Set translator for tab bars
            ui_components_lib_index_js_.TabBarSvg.translator = value;
            const trans = value.load('jupyterlab');
            this._menuHandler.panel.node.setAttribute('aria-label', trans.__('main menu'));
            this._leftHandler.sideBar.node.setAttribute('aria-label', trans.__('main sidebar'));
            this._leftHandler.sideBar.contentNode.setAttribute('aria-label', trans.__('main sidebar'));
            this._rightHandler.sideBar.node.setAttribute('aria-label', trans.__('alternate sidebar'));
            this._rightHandler.sideBar.contentNode.setAttribute('aria-label', trans.__('alternate sidebar'));
            this._topHandler.panel.node.setAttribute('aria-label', trans.__('Top Bar'));
            this._bottomPanel.node.setAttribute('aria-label', trans.__('Bottom Panel'));
            this._dockPanel.node.setAttribute('aria-label', trans.__('Main Content'));
        }
    }
    /**
     * User customized shell layout.
     */
    get userLayout() {
        return dist_index_js_.JSONExt.deepCopy(this._userLayout);
    }
    /**
     * Activate a widget in its area.
     */
    activateById(id) {
        if (this._leftHandler.has(id)) {
            this._leftHandler.activate(id);
            return;
        }
        if (this._rightHandler.has(id)) {
            this._rightHandler.activate(id);
            return;
        }
        const tabIndex = this._downPanel.tabBar.titles.findIndex(title => title.owner.id === id);
        if (tabIndex >= 0) {
            this._downPanel.currentIndex = tabIndex;
            return;
        }
        const dock = this._dockPanel;
        const widget = (0,algorithm_dist_index_es6_js_.find)(dock.widgets(), value => value.id === id);
        if (widget) {
            dock.activateWidget(widget);
        }
    }
    /**
     * Activate widget in specified area.
     *
     * ### Notes
     * The alpha version of this method only supports activating the "main" area.
     *
     * @alpha
     * @param area Name of area to activate
     */
    activateArea(area = 'main') {
        switch (area) {
            case 'main':
                {
                    const current = this._currentTabBar();
                    if (!current) {
                        return;
                    }
                    if (current.currentTitle) {
                        current.currentTitle.owner.activate();
                    }
                }
                return;
            case 'left':
            case 'right':
            case 'header':
            case 'top':
            case 'menu':
            case 'bottom':
                console.debug(`Area: ${area} activation not yet implemented`);
                break;
            default:
                throw new Error(`Invalid area: ${area}`);
        }
    }
    /**
     * Activate the next Tab in the active TabBar.
     */
    activateNextTab() {
        const current = this._currentTabBar();
        if (!current) {
            return;
        }
        const ci = current.currentIndex;
        if (ci === -1) {
            return;
        }
        if (ci < current.titles.length - 1) {
            current.currentIndex += 1;
            if (current.currentTitle) {
                current.currentTitle.owner.activate();
            }
            return;
        }
        if (ci === current.titles.length - 1) {
            const nextBar = this._adjacentBar('next');
            if (nextBar) {
                nextBar.currentIndex = 0;
                if (nextBar.currentTitle) {
                    nextBar.currentTitle.owner.activate();
                }
            }
        }
    }
    /**
     * Activate the previous Tab in the active TabBar.
     */
    activatePreviousTab() {
        const current = this._currentTabBar();
        if (!current) {
            return;
        }
        const ci = current.currentIndex;
        if (ci === -1) {
            return;
        }
        if (ci > 0) {
            current.currentIndex -= 1;
            if (current.currentTitle) {
                current.currentTitle.owner.activate();
            }
            return;
        }
        if (ci === 0) {
            const prevBar = this._adjacentBar('previous');
            if (prevBar) {
                const len = prevBar.titles.length;
                prevBar.currentIndex = len - 1;
                if (prevBar.currentTitle) {
                    prevBar.currentTitle.owner.activate();
                }
            }
        }
    }
    /**
     * Activate the next TabBar.
     */
    activateNextTabBar() {
        const nextBar = this._adjacentBar('next');
        if (nextBar) {
            if (nextBar.currentTitle) {
                nextBar.currentTitle.owner.activate();
            }
        }
    }
    /**
     * Activate the next TabBar.
     */
    activatePreviousTabBar() {
        const nextBar = this._adjacentBar('previous');
        if (nextBar) {
            if (nextBar.currentTitle) {
                nextBar.currentTitle.owner.activate();
            }
        }
    }
    /**
     * Add a widget to the JupyterLab shell
     *
     * @param widget Widget
     * @param area Area
     * @param options Options
     */
    add(widget, area = 'main', options) {
        var _a;
        if (!this._userLayout) {
            this._delayedWidget.push({ widget, area, options });
            return;
        }
        let userPosition;
        if ((options === null || options === void 0 ? void 0 : options.type) && this._userLayout[this.mode][options.type]) {
            userPosition = this._userLayout[this.mode][options.type];
            this._idTypeMap.set(widget.id, options.type);
        }
        else {
            userPosition = this._userLayout[this.mode][widget.id];
        }
        if (options === null || options === void 0 ? void 0 : options.type) {
            this._idTypeMap.set(widget.id, options.type);
            widget.disposed.connect(() => {
                this._idTypeMap.delete(widget.id);
            });
        }
        area = (_a = userPosition === null || userPosition === void 0 ? void 0 : userPosition.area) !== null && _a !== void 0 ? _a : area;
        options =
            options || (userPosition === null || userPosition === void 0 ? void 0 : userPosition.options)
                ? {
                    ...options,
                    ...userPosition === null || userPosition === void 0 ? void 0 : userPosition.options
                }
                : undefined;
        switch (area || 'main') {
            case 'bottom':
                return this._addToBottomArea(widget, options);
            case 'down':
                return this._addToDownArea(widget, options);
            case 'header':
                return this._addToHeaderArea(widget, options);
            case 'left':
                return this._addToLeftArea(widget, options);
            case 'main':
                return this._addToMainArea(widget, options);
            case 'menu':
                return this._addToMenuArea(widget, options);
            case 'right':
                return this._addToRightArea(widget, options);
            case 'top':
                return this._addToTopArea(widget, options);
            default:
                throw new Error(`Invalid area: ${area}`);
        }
    }
    /**
     * Move a widget type to a new area.
     *
     * The type is determined from the `widget.id` and fallback to `widget.id`.
     *
     * #### Notes
     * If `mode` is undefined, both mode are updated.
     * The new layout is now persisted.
     *
     * @param widget Widget to move
     * @param area New area
     * @param mode Mode to change
     * @returns The new user layout
     */
    move(widget, area, mode) {
        var _a;
        const type = (_a = this._idTypeMap.get(widget.id)) !== null && _a !== void 0 ? _a : widget.id;
        for (const m of ['single-document', 'multiple-document'].filter(c => !mode || c === mode)) {
            this._userLayout[m][type] = {
                ...this._userLayout[m][type],
                area
            };
        }
        this.add(widget, area);
        return this._userLayout;
    }
    /**
     * Collapse the left area.
     */
    collapseLeft() {
        this._leftHandler.collapse();
        this._onLayoutModified();
    }
    /**
     * Collapse the right area.
     */
    collapseRight() {
        this._rightHandler.collapse();
        this._onLayoutModified();
    }
    /**
     * Dispose the shell.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._layoutDebouncer.dispose();
        super.dispose();
    }
    /**
     * Expand the left area.
     *
     * #### Notes
     * This will open the most recently used tab,
     * or the first tab if there is no most recently used.
     */
    expandLeft() {
        this._leftHandler.expand();
        this._onLayoutModified();
    }
    /**
     * Expand the right area.
     *
     * #### Notes
     * This will open the most recently used tab,
     * or the first tab if there is no most recently used.
     */
    expandRight() {
        this._rightHandler.expand();
        this._onLayoutModified();
    }
    /**
     * Close all widgets in the main and down area.
     */
    closeAll() {
        // Make a copy of all the widget in the dock panel (using `Array.from()`)
        // before removing them because removing them while iterating through them
        // modifies the underlying data of the iterator.
        Array.from(this._dockPanel.widgets()).forEach(widget => widget.close());
        this._downPanel.stackedPanel.widgets.forEach(widget => widget.close());
    }
    /**
     * Whether an side tab bar is visible or not.
     *
     * @param side Sidebar of interest
     * @returns Side tab bar visibility
     */
    isSideTabBarVisible(side) {
        switch (side) {
            case 'left':
                return this._leftHandler.isVisible;
            case 'right':
                return this._rightHandler.isVisible;
        }
    }
    /**
     * Whether the top bar in simple mode is visible or not.
     *
     * @returns Top bar visibility
     */
    isTopInSimpleModeVisible() {
        return !this._topHandlerHiddenByUser;
    }
    /**
     * True if the given area is empty.
     */
    isEmpty(area) {
        switch (area) {
            case 'bottom':
                return this._bottomPanel.widgets.length === 0;
            case 'down':
                return this._downPanel.stackedPanel.widgets.length === 0;
            case 'header':
                return this._headerPanel.widgets.length === 0;
            case 'left':
                return this._leftHandler.stackedPanel.widgets.length === 0;
            case 'main':
                return this._dockPanel.isEmpty;
            case 'menu':
                return this._menuHandler.panel.widgets.length === 0;
            case 'right':
                return this._rightHandler.stackedPanel.widgets.length === 0;
            case 'top':
                return this._topHandler.panel.widgets.length === 0;
            default:
                return true;
        }
    }
    /**
     * Restore the layout state and configuration for the application shell.
     *
     * #### Notes
     * This should only be called once.
     */
    async restoreLayout(mode, layoutRestorer, configuration = {}) {
        var _a, _b, _c, _d;
        // Set the configuration and add widgets added before the shell was ready.
        this._userLayout = {
            'single-document': (_a = configuration['single-document']) !== null && _a !== void 0 ? _a : {},
            'multiple-document': (_b = configuration['multiple-document']) !== null && _b !== void 0 ? _b : {}
        };
        this._delayedWidget.forEach(({ widget, area, options }) => {
            this.add(widget, area, options);
        });
        this._delayedWidget.length = 0;
        this._layoutRestorer = layoutRestorer;
        // Get the layout from the restorer
        const layout = await layoutRestorer.fetch();
        // Reset the layout
        const { mainArea, downArea, leftArea, rightArea, topArea, relativeSizes } = layout;
        // Rehydrate the main area.
        if (mainArea) {
            const { currentWidget, dock } = mainArea;
            if (dock && mode === 'multiple-document') {
                this._dockPanel.restoreLayout(dock);
            }
            if (mode) {
                this.mode = mode;
            }
            if (currentWidget) {
                this.activateById(currentWidget.id);
            }
        }
        else {
            // This is needed when loading in an empty workspace in single doc mode
            if (mode) {
                this.mode = mode;
            }
        }
        if ((topArea === null || topArea === void 0 ? void 0 : topArea.simpleVisibility) !== undefined) {
            this._topHandlerHiddenByUser = !topArea.simpleVisibility;
            if (this.mode === 'single-document') {
                this._topHandler.panel.setHidden(this._topHandlerHiddenByUser);
            }
        }
        // Rehydrate the down area
        if (downArea) {
            const { currentWidget, widgets, size } = downArea;
            const widgetIds = (_c = widgets === null || widgets === void 0 ? void 0 : widgets.map(widget => widget.id)) !== null && _c !== void 0 ? _c : [];
            // Remove absent widgets
            this._downPanel.tabBar.titles
                .filter(title => !widgetIds.includes(title.owner.id))
                .map(title => title.owner.close());
            // Add new widgets
            const titleIds = this._downPanel.tabBar.titles.map(title => title.owner.id);
            widgets === null || widgets === void 0 ? void 0 : widgets.filter(widget => !titleIds.includes(widget.id)).map(widget => this._downPanel.addWidget(widget));
            // Reorder tabs
            while (!algorithm_dist_index_es6_js_.ArrayExt.shallowEqual(widgetIds, this._downPanel.tabBar.titles.map(title => title.owner.id))) {
                this._downPanel.tabBar.titles.forEach((title, index) => {
                    const position = widgetIds.findIndex(id => title.owner.id == id);
                    if (position >= 0 && position != index) {
                        this._downPanel.tabBar.insertTab(position, title);
                    }
                });
            }
            if (currentWidget) {
                const index = this._downPanel.stackedPanel.widgets.findIndex(widget => widget.id === currentWidget.id);
                if (index) {
                    this._downPanel.currentIndex = index;
                    (_d = this._downPanel.currentWidget) === null || _d === void 0 ? void 0 : _d.activate();
                }
            }
            if (size && size > 0.0) {
                this._vsplitPanel.setRelativeSizes([1.0 - size, size]);
            }
            else {
                // Close all tabs and hide the panel
                this._downPanel.stackedPanel.widgets.forEach(widget => widget.close());
                this._downPanel.hide();
            }
        }
        // Rehydrate the left area.
        if (leftArea) {
            this._leftHandler.rehydrate(leftArea);
        }
        else {
            if (mode === 'single-document') {
                this.collapseLeft();
            }
        }
        // Rehydrate the right area.
        if (rightArea) {
            this._rightHandler.rehydrate(rightArea);
        }
        else {
            if (mode === 'single-document') {
                this.collapseRight();
            }
        }
        // Restore the relative sizes.
        if (relativeSizes) {
            this._hsplitPanel.setRelativeSizes(relativeSizes);
        }
        if (!this._isRestored) {
            // Make sure all messages in the queue are finished before notifying
            // any extensions that are waiting for the promise that guarantees the
            // application state has been restored.
            messaging_dist_index_es6_js_.MessageLoop.flush();
            this._restored.resolve(layout);
        }
    }
    /**
     * Save the dehydrated state of the application shell.
     */
    saveLayout() {
        // If the application is in single document mode, use the cached layout if
        // available. Otherwise, default to querying the dock panel for layout.
        const layout = {
            mainArea: {
                currentWidget: this._tracker.currentWidget,
                dock: this.mode === 'single-document'
                    ? this._cachedLayout || this._dockPanel.saveLayout()
                    : this._dockPanel.saveLayout()
            },
            downArea: {
                currentWidget: this._downPanel.currentWidget,
                widgets: Array.from(this._downPanel.stackedPanel.widgets),
                size: this._vsplitPanel.relativeSizes()[1]
            },
            leftArea: this._leftHandler.dehydrate(),
            rightArea: this._rightHandler.dehydrate(),
            topArea: { simpleVisibility: !this._topHandlerHiddenByUser },
            relativeSizes: this._hsplitPanel.relativeSizes()
        };
        return layout;
    }
    /**
     * Toggle top header visibility in simple mode
     *
     * Note: Does nothing in multi-document mode
     */
    toggleTopInSimpleModeVisibility() {
        if (this.mode === 'single-document') {
            if (this._topHandler.panel.isVisible) {
                this._topHandlerHiddenByUser = true;
                this._topHandler.panel.hide();
            }
            else {
                this._topHandlerHiddenByUser = false;
                this._topHandler.panel.show();
                this._updateTitlePanelTitle();
            }
            this._onLayoutModified();
        }
    }
    /**
     * Toggle side tab bar visibility
     *
     * @param side Sidebar of interest
     */
    toggleSideTabBarVisibility(side) {
        if (side === 'right') {
            if (this._rightHandler.isVisible) {
                this._rightHandler.hide();
            }
            else {
                this._rightHandler.show();
            }
        }
        else {
            if (this._leftHandler.isVisible) {
                this._leftHandler.hide();
            }
            else {
                this._leftHandler.show();
            }
        }
    }
    /**
     * Update the shell configuration.
     *
     * @param config Shell configuration
     */
    updateConfig(config) {
        if (config.hiddenMode) {
            switch (config.hiddenMode) {
                case 'display':
                    this._dockPanel.hiddenMode = widgets_dist_index_es6_js_.Widget.HiddenMode.Display;
                    break;
                case 'scale':
                    this._dockPanel.hiddenMode = widgets_dist_index_es6_js_.Widget.HiddenMode.Scale;
                    break;
                case 'contentVisibility':
                    this._dockPanel.hiddenMode = widgets_dist_index_es6_js_.Widget.HiddenMode.ContentVisibility;
                    break;
            }
        }
    }
    /**
     * Returns the widgets for an application area.
     */
    widgets(area) {
        switch (area !== null && area !== void 0 ? area : 'main') {
            case 'main':
                return this._dockPanel.widgets();
            case 'left':
                return (0,algorithm_dist_index_es6_js_.map)(this._leftHandler.sideBar.titles, t => t.owner);
            case 'right':
                return (0,algorithm_dist_index_es6_js_.map)(this._rightHandler.sideBar.titles, t => t.owner);
            case 'header':
                return this._headerPanel.children();
            case 'top':
                return this._topHandler.panel.children();
            case 'menu':
                return this._menuHandler.panel.children();
            case 'bottom':
                return this._bottomPanel.children();
            default:
                throw new Error(`Invalid area: ${area}`);
        }
    }
    /**
     * Handle `after-attach` messages for the application shell.
     */
    onAfterAttach(msg) {
        this.node.dataset.shellMode = this.mode;
    }
    /**
     * Update the title panel title based on the title of the current widget.
     */
    _updateTitlePanelTitle() {
        let current = this.currentWidget;
        const inputElement = this._titleHandler.inputElement;
        inputElement.value = current ? current.title.label : '';
        inputElement.title = current ? current.title.caption : '';
    }
    /**
     * The path of the current widget changed, fire the _currentPathChanged signal.
     */
    _updateCurrentPath() {
        let current = this.currentWidget;
        let newValue = '';
        if (current && current instanceof docregistry_lib_index_js_.DocumentWidget) {
            newValue = current.context.path;
        }
        this._currentPathChanged.emit({
            newValue: newValue,
            oldValue: this._currentPath
        });
        this._currentPath = newValue;
    }
    /**
     * Add a widget to the left content area.
     *
     * #### Notes
     * Widgets must have a unique `id` property, which will be used as the DOM id.
     */
    _addToLeftArea(widget, options) {
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        options = options || this._sideOptionsCache.get(widget) || {};
        this._sideOptionsCache.set(widget, options);
        const rank = 'rank' in options ? options.rank : DEFAULT_RANK;
        this._leftHandler.addWidget(widget, rank);
        this._onLayoutModified();
    }
    /**
     * Add a widget to the main content area.
     *
     * #### Notes
     * Widgets must have a unique `id` property, which will be used as the DOM id.
     * All widgets added to the main area should be disposed after removal
     * (disposal before removal will remove the widget automatically).
     *
     * In the options, `ref` defaults to `null`, `mode` defaults to `'tab-after'`,
     * and `activate` defaults to `true`.
     */
    _addToMainArea(widget, options) {
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        options = options || {};
        const dock = this._dockPanel;
        const mode = options.mode || 'tab-after';
        let ref = this.currentWidget;
        if (options.ref) {
            ref = (0,algorithm_dist_index_es6_js_.find)(dock.widgets(), value => value.id === options.ref) || null;
        }
        const { title } = widget;
        // Add widget ID to tab so that we can get a handle on the tab's widget
        // (for context menu support)
        title.dataset = { ...title.dataset, id: widget.id };
        if (title.icon instanceof ui_components_lib_index_js_.LabIcon) {
            // bind an appropriate style to the icon
            title.icon = title.icon.bindprops({
                stylesheet: 'mainAreaTab'
            });
        }
        else if (typeof title.icon === 'string' || !title.icon) {
            // add some classes to help with displaying css background imgs
            title.iconClass = (0,ui_components_lib_index_js_.classes)(title.iconClass, 'jp-Icon');
        }
        dock.addWidget(widget, { mode, ref });
        // The dock panel doesn't account for placement information while
        // in single document mode, so upon rehydrating any widgets that were
        // added will not be in the correct place. Cache the placement information
        // here so that we can later rehydrate correctly.
        if (dock.mode === 'single-document') {
            this._mainOptionsCache.set(widget, options);
        }
        if (options.activate !== false) {
            dock.activateWidget(widget);
        }
    }
    /**
     * Add a widget to the right content area.
     *
     * #### Notes
     * Widgets must have a unique `id` property, which will be used as the DOM id.
     */
    _addToRightArea(widget, options) {
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        options = options || this._sideOptionsCache.get(widget) || {};
        const rank = 'rank' in options ? options.rank : DEFAULT_RANK;
        this._sideOptionsCache.set(widget, options);
        this._rightHandler.addWidget(widget, rank);
        this._onLayoutModified();
    }
    /**
     * Add a widget to the top content area.
     *
     * #### Notes
     * Widgets must have a unique `id` property, which will be used as the DOM id.
     */
    _addToTopArea(widget, options) {
        var _a;
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        options = options || {};
        const rank = (_a = options.rank) !== null && _a !== void 0 ? _a : DEFAULT_RANK;
        this._topHandler.addWidget(widget, rank);
        this._onLayoutModified();
        if (this._topHandler.panel.isHidden) {
            this._topHandler.panel.show();
        }
    }
    /**
     * Add a widget to the title content area.
     *
     * #### Notes
     * Widgets must have a unique `id` property, which will be used as the DOM id.
     */
    _addToMenuArea(widget, options) {
        var _a;
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        options = options || {};
        const rank = (_a = options.rank) !== null && _a !== void 0 ? _a : DEFAULT_RANK;
        this._menuHandler.addWidget(widget, rank);
        this._onLayoutModified();
        if (this._menuHandler.panel.isHidden) {
            this._menuHandler.panel.show();
        }
    }
    /**
     * Add a widget to the header content area.
     *
     * #### Notes
     * Widgets must have a unique `id` property, which will be used as the DOM id.
     */
    _addToHeaderArea(widget, options) {
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        // Temporary: widgets are added to the panel in order of insertion.
        this._headerPanel.addWidget(widget);
        this._onLayoutModified();
        if (this._headerPanel.isHidden) {
            this._headerPanel.show();
        }
    }
    /**
     * Add a widget to the bottom content area.
     *
     * #### Notes
     * Widgets must have a unique `id` property, which will be used as the DOM id.
     */
    _addToBottomArea(widget, options) {
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        // Temporary: widgets are added to the panel in order of insertion.
        this._bottomPanel.addWidget(widget);
        this._onLayoutModified();
        if (this._bottomPanel.isHidden) {
            this._bottomPanel.show();
        }
    }
    _addToDownArea(widget, options) {
        if (!widget.id) {
            console.error('Widgets added to app shell must have unique id property.');
            return;
        }
        options = options || {};
        const { title } = widget;
        // Add widget ID to tab so that we can get a handle on the tab's widget
        // (for context menu support)
        title.dataset = { ...title.dataset, id: widget.id };
        if (title.icon instanceof ui_components_lib_index_js_.LabIcon) {
            // bind an appropriate style to the icon
            title.icon = title.icon.bindprops({
                stylesheet: 'mainAreaTab'
            });
        }
        else if (typeof title.icon === 'string' || !title.icon) {
            // add some classes to help with displaying css background imgs
            title.iconClass = (0,ui_components_lib_index_js_.classes)(title.iconClass, 'jp-Icon');
        }
        this._downPanel.addWidget(widget);
        this._onLayoutModified();
        if (this._downPanel.isHidden) {
            this._downPanel.show();
        }
    }
    /*
     * Return the tab bar adjacent to the current TabBar or `null`.
     */
    _adjacentBar(direction) {
        const current = this._currentTabBar();
        if (!current) {
            return null;
        }
        const bars = Array.from(this._dockPanel.tabBars());
        const len = bars.length;
        const index = bars.indexOf(current);
        if (direction === 'previous') {
            return index > 0 ? bars[index - 1] : index === 0 ? bars[len - 1] : null;
        }
        // Otherwise, direction is 'next'.
        return index < len - 1
            ? bars[index + 1]
            : index === len - 1
                ? bars[0]
                : null;
    }
    /*
     * Return the TabBar that has the currently active Widget or null.
     */
    _currentTabBar() {
        const current = this._tracker.currentWidget;
        if (!current) {
            return null;
        }
        const title = current.title;
        const bars = this._dockPanel.tabBars();
        return (0,algorithm_dist_index_es6_js_.find)(bars, bar => bar.titles.indexOf(title) > -1) || null;
    }
    /**
     * Handle a change to the dock area active widget.
     */
    _onActiveChanged(sender, args) {
        if (args.newValue) {
            args.newValue.title.className += ` ${ACTIVE_CLASS}`;
        }
        if (args.oldValue) {
            args.oldValue.title.className = args.oldValue.title.className.replace(ACTIVE_CLASS, '');
        }
        this._activeChanged.emit(args);
    }
    /**
     * Handle a change to the dock area current widget.
     */
    _onCurrentChanged(sender, args) {
        if (args.newValue) {
            args.newValue.title.className += ` ${CURRENT_CLASS}`;
        }
        if (args.oldValue) {
            args.oldValue.title.className = args.oldValue.title.className.replace(CURRENT_CLASS, '');
        }
        this._currentChanged.emit(args);
        this._onLayoutModified();
    }
    /**
     * Handle a change on the down panel widgets
     */
    _onTabPanelChanged() {
        if (this._downPanel.stackedPanel.widgets.length === 0) {
            this._downPanel.hide();
        }
        this._onLayoutModified();
    }
    /**
     * Handle a change to the layout.
     */
    _onLayoutModified() {
        void this._layoutDebouncer.invoke();
    }
}
var shell_Private;
(function (Private) {
    /**
     * A less-than comparison function for side bar rank items.
     */
    function itemCmp(first, second) {
        return first.rank - second.rank;
    }
    Private.itemCmp = itemCmp;
    /**
     * Removes widgets that have been disposed from an area config, mutates area.
     */
    function normalizeAreaConfig(parent, area) {
        if (!area) {
            return;
        }
        if (area.type === 'tab-area') {
            area.widgets = area.widgets.filter(widget => !widget.isDisposed && widget.parent === parent);
            return;
        }
        area.children.forEach(child => {
            normalizeAreaConfig(parent, child);
        });
    }
    Private.normalizeAreaConfig = normalizeAreaConfig;
    /**
     * A class which manages a panel and sorts its widgets by rank.
     */
    class PanelHandler {
        constructor() {
            /**
             * A message hook for child add/remove messages on the main area dock panel.
             */
            this._panelChildHook = (handler, msg) => {
                switch (msg.type) {
                    case 'child-added':
                        {
                            const widget = msg.child;
                            // If we already know about this widget, we're done
                            if (this._items.find(v => v.widget === widget)) {
                                break;
                            }
                            // Otherwise, add to the end by default
                            const rank = this._items[this._items.length - 1].rank;
                            this._items.push({ widget, rank });
                        }
                        break;
                    case 'child-removed':
                        {
                            const widget = msg.child;
                            algorithm_dist_index_es6_js_.ArrayExt.removeFirstWhere(this._items, v => v.widget === widget);
                        }
                        break;
                    default:
                        break;
                }
                return true;
            };
            this._items = new Array();
            this._panel = new widgets_dist_index_es6_js_.Panel();
            messaging_dist_index_es6_js_.MessageLoop.installMessageHook(this._panel, this._panelChildHook);
        }
        /**
         * Get the panel managed by the handler.
         */
        get panel() {
            return this._panel;
        }
        /**
         * Add a widget to the panel.
         *
         * If the widget is already added, it will be moved.
         */
        addWidget(widget, rank) {
            widget.parent = null;
            const item = { widget, rank };
            const index = algorithm_dist_index_es6_js_.ArrayExt.upperBound(this._items, item, Private.itemCmp);
            algorithm_dist_index_es6_js_.ArrayExt.insert(this._items, index, item);
            this._panel.insertWidget(index, widget);
        }
    }
    Private.PanelHandler = PanelHandler;
    /**
     * A class which manages a side bar and related stacked panel.
     */
    class SideBarHandler {
        /**
         * Construct a new side bar handler.
         */
        constructor() {
            this._isHiddenByUser = false;
            this._items = new Array();
            this._updated = new dist_index_es6_js_.Signal(this);
            this._sideBar = new widgets_dist_index_es6_js_.TabBar({
                insertBehavior: 'none',
                removeBehavior: 'none',
                allowDeselect: true,
                orientation: 'vertical'
            });
            this._stackedPanel = new widgets_dist_index_es6_js_.StackedPanel();
            this._sideBar.hide();
            this._stackedPanel.hide();
            this._lastCurrent = null;
            this._sideBar.currentChanged.connect(this._onCurrentChanged, this);
            this._sideBar.tabActivateRequested.connect(this._onTabActivateRequested, this);
            this._stackedPanel.widgetRemoved.connect(this._onWidgetRemoved, this);
        }
        /**
         * Whether the side bar is visible
         */
        get isVisible() {
            return this._sideBar.isVisible;
        }
        /**
         * Get the tab bar managed by the handler.
         */
        get sideBar() {
            return this._sideBar;
        }
        /**
         * Get the stacked panel managed by the handler
         */
        get stackedPanel() {
            return this._stackedPanel;
        }
        /**
         * Signal fires when the stack panel or the sidebar changes
         */
        get updated() {
            return this._updated;
        }
        /**
         * Handles a movement to the handles of a widget
         */
        _onHandleMoved() {
            return this._refreshVisibility();
        }
        /**
         * Handles changes to the expansion status of a widget
         */
        _onExpansionToggle(sender, index) {
            return this._refreshVisibility();
        }
        /**
         * Expand the sidebar.
         *
         * #### Notes
         * This will open the most recently used tab, or the first tab
         * if there is no most recently used.
         */
        expand() {
            const previous = this._lastCurrent || (this._items.length > 0 && this._items[0].widget);
            if (previous) {
                this.activate(previous.id);
            }
        }
        /**
         * Activate a widget residing in the side bar by ID.
         *
         * @param id - The widget's unique ID.
         */
        activate(id) {
            const widget = this._findWidgetByID(id);
            if (widget) {
                this._sideBar.currentTitle = widget.title;
                widget.activate();
            }
        }
        /**
         * Test whether the sidebar has the given widget by id.
         */
        has(id) {
            return this._findWidgetByID(id) !== null;
        }
        /**
         * Collapse the sidebar so no items are expanded.
         */
        collapse() {
            this._sideBar.currentTitle = null;
        }
        /**
         * Add a widget and its title to the stacked panel and side bar.
         *
         * If the widget is already added, it will be moved.
         */
        addWidget(widget, rank) {
            var _a, _b, _c, _d;
            widget.parent = null;
            widget.hide();
            const item = { widget, rank };
            const index = this._findInsertIndex(item);
            algorithm_dist_index_es6_js_.ArrayExt.insert(this._items, index, item);
            this._stackedPanel.insertWidget(index, widget);
            const title = this._sideBar.insertTab(index, widget.title);
            // Store the parent id in the title dataset
            // in order to dispatch click events to the right widget.
            title.dataset = { id: widget.id };
            if (title.icon instanceof ui_components_lib_index_js_.LabIcon) {
                // bind an appropriate style to the icon
                title.icon = title.icon.bindprops({
                    stylesheet: 'sideBar'
                });
            }
            else if (typeof title.icon === 'string' && title.icon != '') {
                // add some classes to help with displaying css background imgs
                title.iconClass = (0,ui_components_lib_index_js_.classes)(title.iconClass, 'jp-Icon', 'jp-Icon-20');
            }
            else if (!title.icon && !title.label) {
                // add a fallback icon if there is no title label nor icon
                title.icon = ui_components_lib_index_js_.tabIcon.bindprops({
                    stylesheet: 'sideBar'
                });
            }
            // @ts-expect-error sometimes widget is an Accordion Panel
            (_b = (_a = widget.content) === null || _a === void 0 ? void 0 : _a.expansionToggled) === null || _b === void 0 ? void 0 : _b.connect(this._onExpansionToggle, this);
            // @ts-expect-error sometimes widget is a SidePanel
            (_d = (_c = widget.content) === null || _c === void 0 ? void 0 : _c.handleMoved) === null || _d === void 0 ? void 0 : _d.connect(this._onHandleMoved, this);
            this._refreshVisibility();
        }
        /**
         * Dehydrate the side bar data.
         */
        dehydrate() {
            const collapsed = this._sideBar.currentTitle === null;
            const widgets = Array.from(this._stackedPanel.widgets);
            const currentWidget = widgets[this._sideBar.currentIndex];
            const widgetStates = {};
            this._stackedPanel.widgets.forEach((w) => {
                if (w.id && w.content instanceof widgets_dist_index_es6_js_.SplitPanel) {
                    widgetStates[w.id] = {
                        sizes: w.content.relativeSizes(),
                        expansionStates: w.content.widgets.map(wi => wi.isVisible)
                    };
                }
            });
            return {
                collapsed,
                currentWidget,
                visible: !this._isHiddenByUser,
                widgets,
                widgetStates
            };
        }
        /**
         * Rehydrate the side bar.
         */
        rehydrate(data) {
            if (data.currentWidget) {
                this.activate(data.currentWidget.id);
            }
            if (data.collapsed) {
                this.collapse();
            }
            if (!data.visible) {
                this.hide();
            }
            if (data.widgetStates) {
                this._stackedPanel.widgets.forEach((w) => {
                    var _a;
                    if (w.id && w.content instanceof widgets_dist_index_es6_js_.SplitPanel) {
                        const state = (_a = data.widgetStates[w.id]) !== null && _a !== void 0 ? _a : {};
                        w.content.widgets.forEach((wi, widx) => {
                            var _a;
                            const expansion = ((_a = state.expansionStates) !== null && _a !== void 0 ? _a : [])[widx];
                            if (typeof expansion === 'boolean' &&
                                w.content instanceof widgets_dist_index_es6_js_.AccordionPanel) {
                                expansion ? w.content.expand(widx) : w.content.collapse(widx);
                            }
                        });
                        if (state.sizes) {
                            w.content.setRelativeSizes(state.sizes);
                        }
                    }
                });
            }
        }
        /**
         * Hide the side bar even if it contains widgets
         */
        hide() {
            this._isHiddenByUser = true;
            this._refreshVisibility();
        }
        /**
         * Show the side bar if it contains widgets
         */
        show() {
            this._isHiddenByUser = false;
            this._refreshVisibility();
        }
        /**
         * Find the insertion index for a rank item.
         */
        _findInsertIndex(item) {
            return algorithm_dist_index_es6_js_.ArrayExt.upperBound(this._items, item, Private.itemCmp);
        }
        /**
         * Find the index of the item with the given widget, or `-1`.
         */
        _findWidgetIndex(widget) {
            return algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(this._items, i => i.widget === widget);
        }
        /**
         * Find the widget which owns the given title, or `null`.
         */
        _findWidgetByTitle(title) {
            const item = (0,algorithm_dist_index_es6_js_.find)(this._items, value => value.widget.title === title);
            return item ? item.widget : null;
        }
        /**
         * Find the widget with the given id, or `null`.
         */
        _findWidgetByID(id) {
            const item = (0,algorithm_dist_index_es6_js_.find)(this._items, value => value.widget.id === id);
            return item ? item.widget : null;
        }
        /**
         * Refresh the visibility of the side bar and stacked panel.
         */
        _refreshVisibility() {
            this._stackedPanel.setHidden(this._sideBar.currentTitle === null);
            this._sideBar.setHidden(this._isHiddenByUser || this._sideBar.titles.length === 0);
            this._updated.emit();
        }
        /**
         * Handle the `currentChanged` signal from the sidebar.
         */
        _onCurrentChanged(sender, args) {
            const oldWidget = args.previousTitle
                ? this._findWidgetByTitle(args.previousTitle)
                : null;
            const newWidget = args.currentTitle
                ? this._findWidgetByTitle(args.currentTitle)
                : null;
            if (oldWidget) {
                oldWidget.hide();
            }
            if (newWidget) {
                newWidget.show();
            }
            this._lastCurrent = newWidget || oldWidget;
            this._refreshVisibility();
        }
        /**
         * Handle a `tabActivateRequest` signal from the sidebar.
         */
        _onTabActivateRequested(sender, args) {
            args.title.owner.activate();
        }
        /*
         * Handle the `widgetRemoved` signal from the stacked panel.
         */
        _onWidgetRemoved(sender, widget) {
            if (widget === this._lastCurrent) {
                this._lastCurrent = null;
            }
            algorithm_dist_index_es6_js_.ArrayExt.removeAt(this._items, this._findWidgetIndex(widget));
            this._sideBar.removeTab(widget.title);
            this._refreshVisibility();
        }
    }
    Private.SideBarHandler = SideBarHandler;
    class SkipLinkWidget extends widgets_dist_index_es6_js_.Widget {
        /**
         * Construct a new skipLink widget.
         */
        constructor(shell) {
            super();
            this.addClass('jp-skiplink');
            this.id = 'jp-skiplink';
            this._shell = shell;
            this._createSkipLink('Skip to main panel', 'main');
        }
        handleEvent(event) {
            var _a, _b;
            switch (event.type) {
                case 'click':
                    if (event.target instanceof HTMLElement) {
                        this._shell.activateArea((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.targetarea);
                    }
                    break;
            }
        }
        /**
         * Handle `after-attach` messages for the widget.
         */
        onAfterAttach(msg) {
            super.onAfterAttach(msg);
            this.node.addEventListener('click', this);
        }
        /**
         * A message handler invoked on a `'before-detach'`
         * message
         */
        onBeforeDetach(msg) {
            this.node.removeEventListener('click', this);
            super.onBeforeDetach(msg);
        }
        _createSkipLink(skipLinkText, area) {
            const skipLink = document.createElement('a');
            skipLink.href = '#';
            skipLink.tabIndex = 0;
            skipLink.text = skipLinkText;
            skipLink.className = 'skip-link';
            skipLink.dataset['targetarea'] = area;
            this.node.appendChild(skipLink);
        }
    }
    Private.SkipLinkWidget = SkipLinkWidget;
    class TitleHandler extends widgets_dist_index_es6_js_.Widget {
        /**
         * Construct a new title handler.
         */
        constructor(shell) {
            super();
            this._selected = false;
            const inputElement = document.createElement('input');
            inputElement.type = 'text';
            this.node.appendChild(inputElement);
            this._shell = shell;
            this.id = 'jp-title-panel-title';
        }
        /**
         * Handle `after-attach` messages for the widget.
         */
        onAfterAttach(msg) {
            super.onAfterAttach(msg);
            this.inputElement.addEventListener('keyup', this);
            this.inputElement.addEventListener('click', this);
            this.inputElement.addEventListener('blur', this);
        }
        /**
         * Handle `before-detach` messages for the widget.
         */
        onBeforeDetach(msg) {
            super.onBeforeDetach(msg);
            this.inputElement.removeEventListener('keyup', this);
            this.inputElement.removeEventListener('click', this);
            this.inputElement.removeEventListener('blur', this);
        }
        handleEvent(event) {
            switch (event.type) {
                case 'keyup':
                    void this._evtKeyUp(event);
                    break;
                case 'click':
                    this._evtClick(event);
                    break;
                case 'blur':
                    this._selected = false;
                    break;
            }
        }
        /**
         * Handle `keyup` events on the handler.
         */
        async _evtKeyUp(event) {
            if (event.key == 'Enter') {
                const widget = this._shell.currentWidget;
                if (widget == null) {
                    return;
                }
                const oldName = widget.title.label;
                const inputElement = this.inputElement;
                const newName = inputElement.value;
                inputElement.blur();
                if (newName !== oldName) {
                    widget.title.label = newName;
                }
                else {
                    inputElement.value = oldName;
                }
            }
        }
        /**
         * Handle `click` events on the handler.
         */
        _evtClick(event) {
            // only handle primary button clicks
            if (event.button !== 0 || this._selected) {
                return;
            }
            const inputElement = this.inputElement;
            event.preventDefault();
            event.stopPropagation();
            this._selected = true;
            const selectEnd = inputElement.value.indexOf('.');
            if (selectEnd === -1) {
                inputElement.select();
            }
            else {
                inputElement.setSelectionRange(0, selectEnd);
            }
        }
        /**
         * The input element containing the parent widget's title.
         */
        get inputElement() {
            return this.node.children[0];
        }
    }
    Private.TitleHandler = TitleHandler;
    class RestorableSplitPanel extends widgets_dist_index_es6_js_.SplitPanel {
        /**
         * Construct a new RestorableSplitPanel.
         */
        constructor(options = {}) {
            super(options);
            this._updated = new dist_index_es6_js_.Signal(this);
        }
        /**
         * A signal emitted when the split panel is updated.
         */
        get updated() {
            return this._updated;
        }
        /**
         * Emit 'updated' signal on 'update' requests.
         */
        onUpdateRequest(msg) {
            super.onUpdateRequest(msg);
            this._updated.emit();
        }
    }
    Private.RestorableSplitPanel = RestorableSplitPanel;
})(shell_Private || (shell_Private = {}));
//# sourceMappingURL=shell.js.map
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/lib/status.js
var lib_status = __webpack_require__(20389);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/lab.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * JupyterLab is the main application class. It is instantiated once and shared.
 */
class JupyterLab extends JupyterFrontEnd {
    /**
     * Construct a new JupyterLab object.
     */
    constructor(options = { shell: new LabShell() }) {
        super({
            ...options,
            shell: options.shell || new LabShell(),
            serviceManager: options.serviceManager ||
                new services_lib_index_js_.ServiceManager({
                    standby: () => {
                        return !this._info.isConnected || 'when-hidden';
                    }
                })
        });
        /**
         * The name of the JupyterLab application.
         */
        this.name = coreutils_lib_index_js_.PageConfig.getOption('appName') || 'JupyterLab';
        /**
         * A namespace/prefix plugins may use to denote their provenance.
         */
        this.namespace = coreutils_lib_index_js_.PageConfig.getOption('appNamespace') || this.name;
        /**
         * A list of all errors encountered when registering plugins.
         *
         * @deprecated This is unused and may be removed in a future version.
         */
        this.registerPluginErrors = [];
        /**
         * The application busy and dirty status signals and flags.
         */
        this.status = new lib_status/* LabStatus */.J(this);
        /**
         * The version of the JupyterLab application.
         */
        this.version = coreutils_lib_index_js_.PageConfig.getOption('appVersion') || 'unknown';
        this._allPluginsActivated = new dist_index_js_.PromiseDelegate();
        // Populate application info.
        this._info = new JupyterLab.Info(options);
        this.restored = this.shell.restored
            .then(async () => {
            const activated = [];
            const deferred = this.activateDeferredPlugins().catch(error => {
                console.error('Error when activating deferred plugins\n:', error);
            });
            activated.push(deferred);
            if (this._info.deferred) {
                const customizedDeferred = Promise.all(this._info.deferred.matches.map(pluginID => this.activatePlugin(pluginID))).catch(error => {
                    console.error('Error when activating customized list of deferred plugins:\n', error);
                });
                activated.push(customizedDeferred);
            }
            Promise.all(activated)
                .then(() => {
                this._allPluginsActivated.resolve();
            })
                .catch(() => undefined);
        })
            .catch(() => undefined);
        // Populate application paths override the defaults if necessary.
        const defaultURLs = JupyterLab.defaultPaths.urls;
        const defaultDirs = JupyterLab.defaultPaths.directories;
        const optionURLs = (options.paths && options.paths.urls) || {};
        const optionDirs = (options.paths && options.paths.directories) || {};
        this._paths = {
            urls: Object.keys(defaultURLs).reduce((acc, key) => {
                if (key in optionURLs) {
                    const value = optionURLs[key];
                    acc[key] = value;
                }
                else {
                    acc[key] = defaultURLs[key];
                }
                return acc;
            }, {}),
            directories: Object.keys(JupyterLab.defaultPaths.directories).reduce((acc, key) => {
                if (key in optionDirs) {
                    const value = optionDirs[key];
                    acc[key] = value;
                }
                else {
                    acc[key] = defaultDirs[key];
                }
                return acc;
            }, {})
        };
        if (this._info.devMode) {
            this.shell.addClass('jp-mod-devMode');
        }
        // Add initial model factory.
        this.docRegistry.addModelFactory(new docregistry_lib_index_js_.Base64ModelFactory());
        if (options.mimeExtensions) {
            for (const plugin of (0,mimerenderers/* createRendermimePlugins */.as)(options.mimeExtensions)) {
                this.registerPlugin(plugin);
            }
        }
    }
    /**
     * The JupyterLab application information dictionary.
     */
    get info() {
        return this._info;
    }
    /**
     * The JupyterLab application paths dictionary.
     */
    get paths() {
        return this._paths;
    }
    /**
     * Promise that resolves when all the plugins are activated, including the deferred.
     */
    get allPluginsActivated() {
        return this._allPluginsActivated.promise;
    }
    /**
     * Register plugins from a plugin module.
     *
     * @param mod - The plugin module to register.
     *
     * @deprecated This is unused and may be removed in a future version.
     */
    registerPluginModule(mod) {
        let data = mod.default;
        // Handle commonjs exports.
        if (!mod.hasOwnProperty('__esModule')) {
            data = mod;
        }
        if (!Array.isArray(data)) {
            data = [data];
        }
        data.forEach(item => {
            try {
                this.registerPlugin(item);
            }
            catch (error) {
                this.registerPluginErrors.push(error);
            }
        });
    }
    /**
     * Register the plugins from multiple plugin modules.
     *
     * @param mods - The plugin modules to register.
     *
     * @deprecated This is unused and may be removed in a future version.
     */
    registerPluginModules(mods) {
        mods.forEach(mod => {
            this.registerPluginModule(mod);
        });
    }
    /**
     * Override keydown handling to prevent command shortcuts from preventing user input.
     *
     * This introduces a slight delay to the command invocation, but no delay to user input.
     */
    evtKeydown(keyDownEvent) {
        const permissionToExecute = new dist_index_js_.PromiseDelegate();
        // Hold the execution of any keybinding until we know if this event would cause text insertion
        this.commands.holdKeyBindingExecution(keyDownEvent, permissionToExecute.promise);
        // Process the key immediately to invoke the prevent default handlers as needed
        this.commands.processKeydownEvent(keyDownEvent);
        // If we do not know the target, we cannot check if input would be inserted
        // as there is no target to attach the `beforeinput` event listener; in that
        // case we just permit execution immediately (this may happen for programmatic
        // uses of keydown)
        const target = keyDownEvent.target;
        if (!target) {
            return permissionToExecute.resolve(true);
        }
        let onBeforeInput = null;
        let onBeforeKeyUp = null;
        const disconnectListeners = () => {
            if (onBeforeInput) {
                target.removeEventListener('beforeinput', onBeforeInput);
            }
            if (onBeforeKeyUp) {
                target.removeEventListener('keyup', onBeforeKeyUp);
            }
        };
        // Permit the execution conditionally, depending on whether the event would lead to text insertion
        const causesInputPromise = Promise.race([
            new Promise(resolve => {
                onBeforeInput = (inputEvent) => {
                    switch (inputEvent.inputType) {
                        case 'historyUndo':
                        case 'historyRedo': {
                            if (inputEvent.target instanceof Element &&
                                inputEvent.target.closest('[data-jp-undoer]')) {
                                // Allow to use custom undo/redo bindings on `jpUndoer`s
                                inputEvent.preventDefault();
                                disconnectListeners();
                                return resolve(false);
                            }
                            break;
                        }
                        case 'insertLineBreak': {
                            if (inputEvent.target instanceof Element &&
                                inputEvent.target.closest('.jp-Cell')) {
                                // Allow to override the default action of Shift + Enter on cells as this is used for cell execution
                                inputEvent.preventDefault();
                                disconnectListeners();
                                return resolve(false);
                            }
                            break;
                        }
                    }
                    disconnectListeners();
                    return resolve(true);
                };
                target.addEventListener('beforeinput', onBeforeInput, { once: true });
            }),
            new Promise(resolve => {
                onBeforeKeyUp = (keyUpEvent) => {
                    if (keyUpEvent.code === keyDownEvent.code) {
                        disconnectListeners();
                        return resolve(false);
                    }
                };
                target.addEventListener('keyup', onBeforeKeyUp, { once: true });
            }),
            new Promise(resolve => {
                setTimeout(() => {
                    disconnectListeners();
                    return resolve(false);
                }, lab_Private.INPUT_GUARD_TIMEOUT);
            })
        ]);
        causesInputPromise
            .then(willCauseInput => {
            permissionToExecute.resolve(!willCauseInput);
        })
            .catch(console.warn);
    }
}
/**
 * The namespace for `JupyterLab` class statics.
 */
(function (JupyterLab) {
    /**
     * The application info token.
     */
    JupyterLab.IInfo = new dist_index_js_.Token('@jupyterlab/application:IInfo', 'A service providing metadata about the current application, including disabled extensions and whether dev mode is enabled.');
    /**
     * The information about a JupyterLab application.
     */
    class Info {
        constructor({ connectionStatus, ...options } = {}) {
            var _a, _b, _c, _d, _e, _f, _g;
            this._connectionStatus = connectionStatus !== null && connectionStatus !== void 0 ? connectionStatus : new services_lib_index_js_.ConnectionStatus();
            this._availablePlugins =
                (_a = options.availablePlugins) !== null && _a !== void 0 ? _a : JupyterLab.defaultInfo.availablePlugins;
            this._devMode = (_b = options.devMode) !== null && _b !== void 0 ? _b : JupyterLab.defaultInfo.devMode;
            this._deferred = JSON.parse(JSON.stringify((_c = options.deferred) !== null && _c !== void 0 ? _c : JupyterLab.defaultInfo.deferred));
            this._disabled = JSON.parse(JSON.stringify((_d = options.disabled) !== null && _d !== void 0 ? _d : JupyterLab.defaultInfo.disabled));
            this._filesCached =
                (_e = options.filesCached) !== null && _e !== void 0 ? _e : JupyterLab.defaultInfo.filesCached;
            this._mimeExtensions = JSON.parse(JSON.stringify((_f = options.mimeExtensions) !== null && _f !== void 0 ? _f : JupyterLab.defaultInfo.mimeExtensions));
            this.isConnected =
                (_g = options.isConnected) !== null && _g !== void 0 ? _g : JupyterLab.defaultInfo.isConnected;
        }
        /**
         * The information about available plugins.
         */
        get availablePlugins() {
            return this._availablePlugins;
        }
        /**
         * Whether the application is in dev mode.
         */
        get devMode() {
            return this._devMode;
        }
        /**
         * The collection of deferred extension patterns and matched extensions.
         */
        get deferred() {
            return this._deferred;
        }
        /**
         * The collection of disabled extension patterns and matched extensions.
         */
        get disabled() {
            return this._disabled;
        }
        /**
         * Whether files are cached on the server.
         */
        get filesCached() {
            return this._filesCached;
        }
        /**
         * Every periodic network polling should be paused while this is set
         * to `false`. Extensions should use this value to decide whether to proceed
         * with the polling.
         * The extensions may also set this value to `false` if there is no need to
         * fetch anything from the server backend basing on some conditions
         * (e.g. when an error message dialog is displayed).
         * At the same time, the extensions are responsible for setting this value
         * back to `true`.
         */
        get isConnected() {
            return this._connectionStatus.isConnected;
        }
        set isConnected(v) {
            this._connectionStatus.isConnected = v;
        }
        /**
         * The mime renderer extensions.
         */
        get mimeExtensions() {
            return this._mimeExtensions;
        }
    }
    JupyterLab.Info = Info;
    /**
     * The default JupyterLab application info.
     */
    JupyterLab.defaultInfo = {
        devMode: coreutils_lib_index_js_.PageConfig.getOption('devMode').toLowerCase() === 'true',
        deferred: { patterns: [], matches: [] },
        disabled: { patterns: [], matches: [] },
        mimeExtensions: [],
        availablePlugins: [],
        filesCached: coreutils_lib_index_js_.PageConfig.getOption('cacheFiles').toLowerCase() === 'true',
        isConnected: true
    };
    /**
     * The default JupyterLab application paths.
     */
    JupyterLab.defaultPaths = {
        urls: {
            base: coreutils_lib_index_js_.PageConfig.getOption('baseUrl'),
            notFound: coreutils_lib_index_js_.PageConfig.getOption('notFoundUrl'),
            app: coreutils_lib_index_js_.PageConfig.getOption('appUrl'),
            doc: coreutils_lib_index_js_.PageConfig.getOption('docUrl'),
            static: coreutils_lib_index_js_.PageConfig.getOption('staticUrl'),
            settings: coreutils_lib_index_js_.PageConfig.getOption('settingsUrl'),
            themes: coreutils_lib_index_js_.PageConfig.getOption('themesUrl'),
            translations: coreutils_lib_index_js_.PageConfig.getOption('translationsApiUrl'),
            hubHost: coreutils_lib_index_js_.PageConfig.getOption('hubHost') || undefined,
            hubPrefix: coreutils_lib_index_js_.PageConfig.getOption('hubPrefix') || undefined,
            hubUser: coreutils_lib_index_js_.PageConfig.getOption('hubUser') || undefined,
            hubServerName: coreutils_lib_index_js_.PageConfig.getOption('hubServerName') || undefined
        },
        directories: {
            appSettings: coreutils_lib_index_js_.PageConfig.getOption('appSettingsDir'),
            schemas: coreutils_lib_index_js_.PageConfig.getOption('schemasDir'),
            static: coreutils_lib_index_js_.PageConfig.getOption('staticDir'),
            templates: coreutils_lib_index_js_.PageConfig.getOption('templatesDir'),
            themes: coreutils_lib_index_js_.PageConfig.getOption('themesDir'),
            userSettings: coreutils_lib_index_js_.PageConfig.getOption('userSettingsDir'),
            serverRoot: coreutils_lib_index_js_.PageConfig.getOption('serverRoot'),
            workspaces: coreutils_lib_index_js_.PageConfig.getOption('workspacesDir')
        }
    };
})(JupyterLab || (JupyterLab = {}));
/**
 * A namespace for module-private functionality.
 */
var lab_Private;
(function (Private) {
    /**
     * The delay for invoking a command introduced by user input guard.
     * Decreasing this value may lead to commands incorrectly triggering
     * on user input. Increasing this value will lead to longer delay for
     * command invocation. Note that user input is never delayed.
     *
     * The value represents the number in milliseconds.
     */
    Private.INPUT_GUARD_TIMEOUT = 10;
})(lab_Private || (lab_Private = {}));
//# sourceMappingURL=lab.js.map
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/lib/layoutrestorer.js
var layoutrestorer = __webpack_require__(67863);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/router.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/




/**
 * A static class that routes URLs within the application.
 */
class Router {
    /**
     * Create a URL router.
     */
    constructor(options) {
        /**
         * If a matching rule's command resolves with the `stop` token during routing,
         * no further matches will execute.
         */
        this.stop = new dist_index_js_.Token('@jupyterlab/application:Router#stop');
        this._routed = new dist_index_es6_js_.Signal(this);
        this._rules = new Map();
        this.base = options.base;
        this.commands = options.commands;
    }
    /**
     * Returns the parsed current URL of the application.
     */
    get current() {
        var _a, _b;
        const { base } = this;
        const parsed = coreutils_lib_index_js_.URLExt.parse(window.location.href);
        const { search, hash } = parsed;
        const path = (_b = (_a = parsed.pathname) === null || _a === void 0 ? void 0 : _a.replace(base, '/')) !== null && _b !== void 0 ? _b : '';
        const request = path + search + hash;
        return { hash, path, request, search };
    }
    /**
     * A signal emitted when the router routes a route.
     */
    get routed() {
        return this._routed;
    }
    /**
     * Navigate to a new path within the application.
     *
     * @param path - The new path or empty string if redirecting to root.
     *
     * @param options - The navigation options.
     */
    navigate(path, options = {}) {
        const { base } = this;
        const { history } = window;
        const { hard } = options;
        const old = document.location.href;
        const url = path && path.indexOf(base) === 0 ? path : coreutils_lib_index_js_.URLExt.join(base, path);
        if (url === old) {
            return hard ? this.reload() : undefined;
        }
        history.pushState({}, '', url);
        if (hard) {
            return this.reload();
        }
        if (!options.skipRouting) {
            // Because a `route()` call may still be in the stack after having received
            // a `stop` token, wait for the next stack frame before calling `route()`.
            requestAnimationFrame(() => {
                void this.route();
            });
        }
    }
    /**
     * Register to route a path pattern to a command.
     *
     * @param options - The route registration options.
     *
     * @returns A disposable that removes the registered rule from the router.
     */
    register(options) {
        var _a;
        const { command, pattern } = options;
        const rank = (_a = options.rank) !== null && _a !== void 0 ? _a : 100;
        const rules = this._rules;
        rules.set(pattern, { command, rank });
        return new disposable_dist_index_es6_js_.DisposableDelegate(() => {
            rules.delete(pattern);
        });
    }
    /**
     * Cause a hard reload of the document.
     */
    reload() {
        window.location.reload();
    }
    /**
     * Route a specific path to an action.
     *
     * #### Notes
     * If a pattern is matched, its command will be invoked with arguments that
     * match the `IRouter.ILocation` interface.
     */
    route() {
        const { commands, current, stop } = this;
        const { request } = current;
        const routed = this._routed;
        const rules = this._rules;
        const matches = [];
        // Collect all rules that match the URL.
        rules.forEach((rule, pattern) => {
            if (request === null || request === void 0 ? void 0 : request.match(pattern)) {
                matches.push(rule);
            }
        });
        // Order the matching rules by rank and enqueue them.
        const queue = matches.sort((a, b) => b.rank - a.rank);
        const done = new dist_index_js_.PromiseDelegate();
        // Process each enqueued command sequentially and short-circuit if a promise
        // resolves with the `stop` token.
        const next = async () => {
            if (!queue.length) {
                routed.emit(current);
                done.resolve(undefined);
                return;
            }
            const { command } = queue.pop();
            try {
                const request = this.current.request;
                const result = await commands.execute(command, current);
                if (result === stop) {
                    queue.length = 0;
                    console.debug(`Routing ${request} was short-circuited by ${command}`);
                }
            }
            catch (reason) {
                console.warn(`Routing ${request} to ${command} failed`, reason);
            }
            void next();
        };
        void next();
        return done.promise;
    }
}
//# sourceMappingURL=router.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A token for which a plugin can provide to respond to connection failures
 * to the application server.
 */
const IConnectionLost = new dist_index_js_.Token('@jupyterlab/application:IConnectionLost', `A service for invoking the dialog shown
  when JupyterLab has lost its connection to the server. Use this if, for some reason,
  you want to bring up the "connection lost" dialog under new circumstances.`);
/**
 * The application status token.
 */
const ILabStatus = new dist_index_js_.Token('@jupyterlab/application:ILabStatus', `A service for interacting with the application busy/dirty
  status. Use this if you want to set the application "busy" favicon, or to set
  the application "dirty" status, which asks the user for confirmation before leaving the application page.`);
/**
 * The URL Router token.
 */
const IRouter = new dist_index_js_.Token('@jupyterlab/application:IRouter', 'The URL router used by the application. Use this to add custom URL-routing for your extension (e.g., to invoke a command if the user navigates to a sub-path).');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/treepathupdater.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * The tree path updater token.
 */
const ITreePathUpdater = new dist_index_js_.Token('@jupyterlab/application:ITreePathUpdater', 'A service to update the tree path.');
//# sourceMappingURL=treepathupdater.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/utils.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


/**
 * Add a semantic commands to the application and take care
 * of setting up the command changed signal.
 *
 * @param options Semantic command options
 */
function addSemanticCommand(options) {
    const { id, commands, shell, semanticCommands, default: defaultValues, overrides, trans } = options;
    commands.addCommand(id, {
        ...createSemanticCommand({ commands, shell }, semanticCommands, defaultValues !== null && defaultValues !== void 0 ? defaultValues : {}, trans !== null && trans !== void 0 ? trans : lib_index_js_.nullTranslator.load('jupyterlab')),
        ...overrides
    });
    const commandList = Array.isArray(semanticCommands)
        ? semanticCommands
        : [semanticCommands];
    const onCommandChanged = (commands, args) => {
        if (args.id) {
            if (args.id === id && args.type === 'removed') {
                commands.commandChanged.disconnect(onCommandChanged);
            }
            else {
                const commandIds = commandList.reduce((agg, cmd) => agg.concat(cmd.ids), []);
                if (commandIds.includes(args.id)) {
                    // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
                    switch (args.type) {
                        case 'changed':
                        case 'many-changed':
                            commands.notifyCommandChanged(id);
                            break;
                        case 'removed':
                            for (const cmd of commandList) {
                                cmd.remove(args.id);
                            }
                            break;
                    }
                }
            }
        }
    };
    commands.commandChanged.connect(onCommandChanged);
}
/**
 * Create the command options from the given semantic commands list
 * and the given default values.
 *
 * @param app Jupyter Application
 * @param semanticCommands Single semantic command  or a list of commands
 * @param defaultValues Default values
 * @param trans Translation bundle
 * @returns Command options
 *
 * @deprecated Please use {@link addSemanticCommand}. This function will
 * be removed of the public API in JupyterLab 5.
 */
function createSemanticCommand(app, semanticCommands, defaultValues, trans) {
    const { commands, shell } = app;
    const commandList = Array.isArray(semanticCommands)
        ? semanticCommands
        : [semanticCommands];
    return {
        label: concatenateTexts('label'),
        caption: concatenateTexts('caption'),
        isEnabled: () => {
            var _a;
            const isEnabled = reduceAttribute('isEnabled');
            return ((isEnabled.length > 0 &&
                !isEnabled.some(enabled => enabled === false)) ||
                ((_a = defaultValues.isEnabled) !== null && _a !== void 0 ? _a : false));
        },
        isToggled: () => {
            var _a;
            const isToggled = reduceAttribute('isToggled');
            return (isToggled.some(enabled => enabled === true) ||
                ((_a = defaultValues.isToggled) !== null && _a !== void 0 ? _a : false));
        },
        isVisible: () => {
            var _a;
            const isVisible = reduceAttribute('isVisible');
            return ((isVisible.length > 0 &&
                !isVisible.some(visible => visible === false)) ||
                ((_a = defaultValues.isVisible) !== null && _a !== void 0 ? _a : true));
        },
        execute: async () => {
            const widget = shell.currentWidget;
            const commandIds = commandList.map(cmd => widget !== null ? cmd.getActiveCommandId(widget) : null);
            const toExecute = commandIds.filter(commandId => commandId !== null && commands.isEnabled(commandId));
            let result = null;
            if (toExecute.length > 0) {
                for (const commandId of toExecute) {
                    const args = { [index_js_.SemanticCommand.WIDGET]: widget.id };
                    result = await commands.execute(commandId, args);
                    if (typeof result === 'boolean' && result === false) {
                        // If a command returns a boolean, assume it is the execution success status
                        // So break if it is false.
                        break;
                    }
                }
            }
            else if (defaultValues.execute) {
                result = await commands.execute(defaultValues.execute);
            }
            return result;
        }
    };
    function reduceAttribute(attribute) {
        const widget = shell.currentWidget;
        const commandIds = commandList.map(cmd => widget !== null ? cmd.getActiveCommandId(widget) : null);
        const attributes = commandIds
            .filter(commandId => commandId !== null)
            .map(commandId => commands[attribute](commandId));
        return attributes;
    }
    function concatenateTexts(attribute) {
        return () => {
            var _a;
            const texts = reduceAttribute(attribute).map((text, textIndex) => attribute == 'caption' && textIndex > 0
                ? text.toLocaleLowerCase()
                : text);
            switch (texts.length) {
                case 0:
                    return (_a = defaultValues[attribute]) !== null && _a !== void 0 ? _a : '';
                case 1:
                    return texts[0];
                default: {
                    const hasEllipsis = texts.some(l => /…$/.test(l));
                    const main = texts
                        .slice(undefined, -1)
                        .map(l => l.replace(/…$/, ''))
                        .join(', ');
                    const end = texts.slice(-1)[0].replace(/…$/, '') + (hasEllipsis ? '…' : '');
                    return trans.__('%1 and %2', main, end);
                }
            }
        };
    }
}
//# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module application
 */











//# sourceMappingURL=index.js.map

/***/ }),

/***/ 67863:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ ILayoutRestorer),
/* harmony export */   c: () => (/* binding */ LayoutRestorer)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10249);
/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_properties__WEBPACK_IMPORTED_MODULE_1__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/


/**
 * The layout restorer token.
 */
const ILayoutRestorer = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/application:ILayoutRestorer', 'A service providing application layout restoration functionality. Use this to have your activities restored across page loads.');
/**
 * The data connector key for restorer data.
 */
const KEY = 'layout-restorer:data';
/**
 * The default implementation of a layout restorer.
 *
 * #### Notes
 * The lifecycle for state restoration is subtle. The sequence of events is:
 *
 * 1. The layout restorer plugin is instantiated and makes a `fetch` call to
 *    the data connector that stores the layout restoration data. The `fetch`
 *    call returns a promise that resolves in step 6, below.
 *
 * 2. Other plugins that care about state restoration require the layout
 *    restorer as a dependency.
 *
 * 3. As each load-time plugin initializes (which happens before the front-end
 *    application has `started`), it instructs the layout restorer whether
 *    the restorer ought to `restore` its widgets by passing in its widget
 *    tracker.
 *    Alternatively, a plugin that does not require its own widget tracker
 *    (because perhaps it only creates a single widget, like a command palette),
 *    can simply `add` its widget along with a persistent unique name to the
 *    layout restorer so that its layout state can be restored when the lab
 *    application restores.
 *
 * 4. After all the load-time plugins have finished initializing, the front-end
 *    application `started` promise will resolve. This is the `first`
 *    promise that the layout restorer waits for. By this point, all of the
 *    plugins that care about restoration will have instructed the layout
 *    restorer to `restore` their widget trackers.
 *
 * 5. The layout restorer will then instruct each plugin's widget tracker
 *    to restore its state and reinstantiate whichever widgets it wants. The
 *    tracker returns a promise to the layout restorer that resolves when it
 *    has completed restoring the tracked widgets it cares about.
 *
 * 6. As each widget tracker finishes restoring the widget instances it cares
 *    about, it resolves the promise that was returned to the layout restorer
 *    (in step 5). After all of the promises that the restorer is awaiting have
 *    settled, the restorer then resolves the outstanding `fetch` promise
 *    (from step 1) and hands off a layout state object to the application
 *    shell's `restoreLayout` method for restoration.
 *
 * 7. Once the application shell has finished restoring the layout, the
 *    JupyterLab application's `restored` promise is resolved.
 *
 * Of particular note are steps 5 and 6: since data restoration of plugins
 * is accomplished by executing commands, the command that is used to restore
 * the data of each plugin must return a promise that only resolves when the
 * widget has been created and added to the plugin's widget tracker.
 */
class LayoutRestorer {
    /**
     * Create a layout restorer.
     */
    constructor(options) {
        this._deferred = new Array();
        this._deferredMainArea = null;
        this._firstDone = false;
        this._promisesDone = false;
        this._promises = [];
        this._restored = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        this._trackers = new Set();
        this._widgets = new Map();
        this._mode = 'multiple-document';
        this._connector = options.connector;
        this._first = options.first;
        this._registry = options.registry;
        if (options.mode) {
            this._mode = options.mode;
        }
        void this._first
            .then(() => {
            this._firstDone = true;
        })
            .then(() => Promise.all(this._promises))
            .then(() => {
            this._promisesDone = true;
            // Release the tracker set.
            this._trackers.clear();
        })
            .then(() => {
            this._restored.resolve(void 0);
        });
    }
    /**
     * Whether full layout restoration is deferred and is currently incomplete.
     *
     * #### Notes
     * This flag is useful for tracking when the application has started in
     * 'single-document' mode and the main area has not yet been restored.
     */
    get isDeferred() {
        return this._deferred.length > 0;
    }
    /**
     * A promise resolved when the layout restorer is ready to receive signals.
     */
    get restored() {
        return this._restored.promise;
    }
    /**
     * Add a widget to be tracked by the layout restorer.
     */
    add(widget, name) {
        Private.nameProperty.set(widget, name);
        this._widgets.set(name, widget);
        widget.disposed.connect(this._onWidgetDisposed, this);
    }
    /**
     * Fetch the layout state for the application.
     *
     * #### Notes
     * Fetching the layout relies on all widget restoration to be complete, so
     * calls to `fetch` are guaranteed to return after restoration is complete.
     */
    async fetch() {
        var _a;
        const blank = {
            fresh: true,
            mainArea: null,
            downArea: null,
            leftArea: null,
            rightArea: null,
            topArea: null,
            relativeSizes: null
        };
        const layout = this._connector.fetch(KEY);
        try {
            const [data] = await Promise.all([layout, this.restored]);
            if (!data) {
                return blank;
            }
            const { main, down, left, right, relativeSizes, top } = data;
            // If any data exists, then this is not a fresh session.
            const fresh = false;
            // Rehydrate main area.
            let mainArea = null;
            if (this._mode === 'multiple-document') {
                mainArea = this._rehydrateMainArea(main);
            }
            else {
                this._deferredMainArea = main;
            }
            // Rehydrate down area.
            const downArea = this._rehydrateDownArea(down);
            // Rehydrate left area.
            const leftArea = this._rehydrateSideArea(left);
            // Rehydrate right area.
            const rightArea = this._rehydrateSideArea(right);
            return {
                fresh,
                mainArea,
                downArea,
                leftArea,
                rightArea,
                relativeSizes: relativeSizes || null,
                topArea: (_a = top) !== null && _a !== void 0 ? _a : null
            };
        }
        catch (error) {
            return blank;
        }
    }
    /**
     * Restore the widgets of a particular widget tracker.
     *
     * @param tracker - The widget tracker whose widgets will be restored.
     *
     * @param options - The restoration options.
     */
    async restore(tracker, options) {
        if (this._firstDone) {
            throw new Error('restore() must be called before `first` has resolved.');
        }
        const { namespace } = tracker;
        if (this._trackers.has(namespace)) {
            throw new Error(`The tracker "${namespace}" is already restored.`);
        }
        const { args, command, name, when } = options;
        // Add the tracker to the private trackers collection.
        this._trackers.add(namespace);
        // Whenever a new widget is added to the tracker, record its name.
        tracker.widgetAdded.connect((_, widget) => {
            const widgetName = name(widget);
            if (widgetName) {
                this.add(widget, `${namespace}:${widgetName}`);
            }
        }, this);
        // Whenever a widget is updated, get its new name.
        tracker.widgetUpdated.connect((_, widget) => {
            const widgetName = name(widget);
            if (widgetName) {
                const name = `${namespace}:${widgetName}`;
                Private.nameProperty.set(widget, name);
                this._widgets.set(name, widget);
            }
        });
        const first = this._first;
        if (this._mode == 'multiple-document') {
            const promise = tracker
                .restore({
                args: args || (() => _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.JSONExt.emptyObject),
                command,
                connector: this._connector,
                name,
                registry: this._registry,
                when: when ? [first].concat(when) : first
            })
                .catch(error => {
                console.error(error);
            });
            this._promises.push(promise);
            return promise;
        }
        tracker.defer({
            args: args || (() => _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.JSONExt.emptyObject),
            command,
            connector: this._connector,
            name,
            registry: this._registry,
            when: when ? [first].concat(when) : first
        });
        this._deferred.push(tracker);
    }
    /**
     * Restore the application layout if its restoration has been deferred.
     *
     * @returns - the rehydrated main area.
     */
    async restoreDeferred() {
        if (!this.isDeferred) {
            return null;
        }
        // Empty the deferred list and wait for all trackers to restore.
        const wait = Promise.resolve();
        const promises = this._deferred.map(t => wait.then(() => t.restore()));
        this._deferred.length = 0;
        await Promise.all(promises);
        // Rehydrate the main area layout.
        return this._rehydrateMainArea(this._deferredMainArea);
    }
    /**
     * Save the layout state for the application.
     */
    save(layout) {
        var _a;
        // If there are promises that are unresolved, bail.
        if (!this._promisesDone) {
            const warning = 'save() was called prematurely.';
            console.warn(warning);
            return Promise.reject(warning);
        }
        const dehydrated = {};
        // Save the cached main area layout if restoration is deferred.
        dehydrated.main = this.isDeferred
            ? this._deferredMainArea
            : this._dehydrateMainArea(layout.mainArea);
        // Update only the current widget in the db when restoration is deferred.
        // Useful for providing the tab title in doc mode.
        if (this.isDeferred) {
            const currentWidget = (_a = layout.mainArea) === null || _a === void 0 ? void 0 : _a.currentWidget;
            if (currentWidget) {
                const widgetName = Private.nameProperty.get(currentWidget);
                dehydrated.main = {
                    ...dehydrated.main,
                    current: widgetName || undefined
                };
            }
        }
        dehydrated.down = this._dehydrateDownArea(layout.downArea);
        dehydrated.left = this._dehydrateSideArea(layout.leftArea);
        dehydrated.right = this._dehydrateSideArea(layout.rightArea);
        dehydrated.relativeSizes = layout.relativeSizes;
        dehydrated.top = { ...layout.topArea };
        return this._connector.save(KEY, dehydrated);
    }
    /**
     * Dehydrate a main area description into a serializable object.
     */
    _dehydrateMainArea(area) {
        if (!area) {
            return null;
        }
        return Private.serializeMain(area);
    }
    /**
     * Rehydrate a serialized main area description object.
     *
     * #### Notes
     * This function consumes data that can become corrupted, so it uses type
     * coercion to guarantee the dehydrated object is safely processed.
     */
    _rehydrateMainArea(area) {
        if (!area) {
            return null;
        }
        return Private.deserializeMain(area, this._widgets);
    }
    /**
     * Dehydrate a down area description into a serializable object.
     */
    _dehydrateDownArea(area) {
        if (!area) {
            return null;
        }
        const dehydrated = {
            size: area.size
        };
        if (area.currentWidget) {
            const current = Private.nameProperty.get(area.currentWidget);
            if (current) {
                dehydrated.current = current;
            }
        }
        if (area.widgets) {
            dehydrated.widgets = area.widgets
                .map(widget => Private.nameProperty.get(widget))
                .filter(name => !!name);
        }
        return dehydrated;
    }
    /**
     * Rehydrate a serialized side area description object.
     *
     * #### Notes
     * This function consumes data that can become corrupted, so it uses type
     * coercion to guarantee the dehydrated object is safely processed.
     */
    _rehydrateDownArea(area) {
        var _a;
        if (!area) {
            return { currentWidget: null, size: 0.0, widgets: null };
        }
        const internal = this._widgets;
        const currentWidget = area.current && internal.has(`${area.current}`)
            ? internal.get(`${area.current}`)
            : null;
        const widgets = !Array.isArray(area.widgets)
            ? null
            : area.widgets
                .map(name => internal.has(`${name}`) ? internal.get(`${name}`) : null)
                .filter(widget => !!widget);
        return {
            currentWidget: currentWidget,
            size: (_a = area.size) !== null && _a !== void 0 ? _a : 0.0,
            widgets: widgets
        };
    }
    /**
     * Dehydrate a side area description into a serializable object.
     */
    _dehydrateSideArea(area) {
        if (!area) {
            return null;
        }
        const dehydrated = {
            collapsed: area.collapsed,
            visible: area.visible
        };
        if (area.currentWidget) {
            const current = Private.nameProperty.get(area.currentWidget);
            if (current) {
                dehydrated.current = current;
            }
        }
        if (area.widgets) {
            dehydrated.widgets = area.widgets
                .map(widget => Private.nameProperty.get(widget))
                .filter(name => !!name);
        }
        if (area.widgetStates) {
            dehydrated.widgetStates = area.widgetStates;
        }
        return dehydrated;
    }
    /**
     * Rehydrate a serialized side area description object.
     *
     * #### Notes
     * This function consumes data that can become corrupted, so it uses type
     * coercion to guarantee the dehydrated object is safely processed.
     */
    _rehydrateSideArea(area) {
        var _a, _b;
        if (!area) {
            return {
                collapsed: true,
                currentWidget: null,
                visible: true,
                widgets: null,
                widgetStates: {
                    ['null']: {
                        sizes: null,
                        expansionStates: null
                    }
                }
            };
        }
        const internal = this._widgets;
        const collapsed = (_a = area.collapsed) !== null && _a !== void 0 ? _a : false;
        const currentWidget = area.current && internal.has(`${area.current}`)
            ? internal.get(`${area.current}`)
            : null;
        const widgets = !Array.isArray(area.widgets)
            ? null
            : area.widgets
                .map(name => internal.has(`${name}`) ? internal.get(`${name}`) : null)
                .filter(widget => !!widget);
        const widgetStates = area.widgetStates;
        return {
            collapsed,
            currentWidget: currentWidget,
            widgets: widgets,
            visible: (_b = area.visible) !== null && _b !== void 0 ? _b : true,
            widgetStates: widgetStates
        };
    }
    /**
     * Handle a widget disposal.
     */
    _onWidgetDisposed(widget) {
        const name = Private.nameProperty.get(widget);
        this._widgets.delete(name);
    }
}
/*
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * An attached property for a widget's ID in the serialized restore data.
     */
    Private.nameProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_1__.AttachedProperty({
        name: 'name',
        create: owner => ''
    });
    /**
     * Serialize individual areas within the main area.
     */
    function serializeArea(area) {
        if (!area || !area.type) {
            return null;
        }
        if (area.type === 'tab-area') {
            return {
                type: 'tab-area',
                currentIndex: area.currentIndex,
                widgets: area.widgets
                    .map(widget => Private.nameProperty.get(widget))
                    .filter(name => !!name)
            };
        }
        return {
            type: 'split-area',
            orientation: area.orientation,
            sizes: area.sizes,
            children: area.children
                .map(serializeArea)
                .filter(area => !!area)
        };
    }
    /**
     * Return a dehydrated, serializable version of the main dock panel.
     */
    function serializeMain(area) {
        const dehydrated = {
            dock: (area && area.dock && serializeArea(area.dock.main)) || null
        };
        if (area) {
            if (area.currentWidget) {
                const current = Private.nameProperty.get(area.currentWidget);
                if (current) {
                    dehydrated.current = current;
                }
            }
        }
        return dehydrated;
    }
    Private.serializeMain = serializeMain;
    /**
     * Deserialize individual areas within the main area.
     *
     * #### Notes
     * Because this data comes from a potentially unreliable foreign source, it is
     * typed as a `JSONObject`; but the actual expected type is:
     * `ITabArea | ISplitArea`.
     *
     * For fault tolerance, types are manually checked in deserialization.
     */
    function deserializeArea(area, names) {
        if (!area) {
            return null;
        }
        // Because this data is saved to a foreign data source, its type safety is
        // not guaranteed when it is retrieved, so exhaustive checks are necessary.
        const type = area.type || 'unknown';
        if (type === 'unknown' || (type !== 'tab-area' && type !== 'split-area')) {
            console.warn(`Attempted to deserialize unknown type: ${type}`);
            return null;
        }
        if (type === 'tab-area') {
            const { currentIndex, widgets } = area;
            const hydrated = {
                type: 'tab-area',
                currentIndex: currentIndex || 0,
                widgets: (widgets &&
                    widgets
                        .map(widget => names.get(widget))
                        .filter(widget => !!widget)) ||
                    []
            };
            // Make sure the current index is within bounds.
            if (hydrated.currentIndex > hydrated.widgets.length - 1) {
                hydrated.currentIndex = 0;
            }
            return hydrated;
        }
        const { orientation, sizes, children } = area;
        const hydrated = {
            type: 'split-area',
            orientation: orientation,
            sizes: sizes || [],
            children: (children &&
                children
                    .map(child => deserializeArea(child, names))
                    .filter(widget => !!widget)) ||
                []
        };
        return hydrated;
    }
    /**
     * Return the hydrated version of the main dock panel, ready to restore.
     *
     * #### Notes
     * Because this data comes from a potentially unreliable foreign source, it is
     * typed as a `JSONObject`; but the actual expected type is: `IMainArea`.
     *
     * For fault tolerance, types are manually checked in deserialization.
     */
    function deserializeMain(area, names) {
        if (!area) {
            return null;
        }
        const name = area.current || null;
        const dock = area.dock || null;
        return {
            currentWidget: (name && names.has(name) && names.get(name)) || null,
            dock: dock ? { main: deserializeArea(dock, names) } : null
        };
    }
    Private.deserializeMain = deserializeMain;
})(Private || (Private = {}));
//# sourceMappingURL=layoutrestorer.js.map

/***/ }),

/***/ 75677:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   aX: () => (/* binding */ createRendermimePlugin),
/* harmony export */   as: () => (/* binding */ createRendermimePlugins),
/* harmony export */   w2: () => (/* binding */ IMimeDocumentTracker)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34992);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61832);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10249);
/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_properties__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _layoutrestorer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67863);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The mime document tracker token.
 */
const IMimeDocumentTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_5__.Token('@jupyterlab/application:IMimeDocumentTracker', 'A widget tracker for documents rendered using a mime renderer extension. Use this if you want to list and interact with documents rendered by such extensions.');
/**
 * Create rendermime plugins for rendermime extension modules.
 */
function createRendermimePlugins(extensions) {
    const plugins = [];
    const namespace = 'application-mimedocuments';
    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.WidgetTracker({ namespace });
    extensions.forEach(mod => {
        let data = mod.default;
        // Handle CommonJS exports.
        if (!mod.hasOwnProperty('__esModule')) {
            data = mod;
        }
        if (!Array.isArray(data)) {
            data = [data];
        }
        data.forEach(item => {
            plugins.push(createRendermimePlugin(tracker, item));
        });
    });
    // Also add a meta-plugin handling state restoration
    // and exposing the mime document widget tracker.
    plugins.push({
        id: '@jupyterlab/application-extension:mimedocument',
        description: 'Provides a mime document widget tracker.',
        optional: [_layoutrestorer__WEBPACK_IMPORTED_MODULE_7__/* .ILayoutRestorer */ .L],
        provides: IMimeDocumentTracker,
        autoStart: true,
        activate: (app, restorer) => {
            if (restorer) {
                void restorer.restore(tracker, {
                    command: 'docmanager:open',
                    args: widget => ({
                        path: widget.context.path,
                        factory: Private.factoryNameProperty.get(widget)
                    }),
                    name: widget => `${widget.context.path}:${Private.factoryNameProperty.get(widget)}`
                });
            }
            return tracker;
        }
    });
    return plugins;
}
/**
 * Create rendermime plugins for rendermime extension modules.
 */
function createRendermimePlugin(tracker, item) {
    return {
        id: item.id,
        description: item.description,
        requires: [_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__.IRenderMimeRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],
        autoStart: true,
        activate: (app, rendermime, translator) => {
            // Add the mime renderer.
            if (item.rank !== undefined) {
                rendermime.addFactory(item.rendererFactory, item.rank);
            }
            else {
                rendermime.addFactory(item.rendererFactory);
            }
            // Handle the widget factory.
            if (!item.documentWidgetFactoryOptions) {
                return;
            }
            const registry = app.docRegistry;
            let options = [];
            if (Array.isArray(item.documentWidgetFactoryOptions)) {
                options = item.documentWidgetFactoryOptions;
            }
            else {
                options = [
                    item.documentWidgetFactoryOptions
                ];
            }
            if (item.fileTypes) {
                item.fileTypes.forEach(ft => {
                    if (ft.icon) {
                        // upconvert the contents of the icon field to a proper LabIcon
                        ft = { ...ft, icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__.LabIcon.resolve({ icon: ft.icon }) };
                    }
                    app.docRegistry.addFileType(ft);
                });
            }
            options.forEach(option => {
                const toolbarFactory = option.toolbarFactory
                    ? (w) => option.toolbarFactory(w.content.renderer)
                    : undefined;
                const factory = new _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__.MimeDocumentFactory({
                    renderTimeout: item.renderTimeout,
                    dataType: item.dataType,
                    rendermime,
                    modelName: option.modelName,
                    name: option.name,
                    primaryFileType: registry.getFileType(option.primaryFileType),
                    fileTypes: option.fileTypes,
                    defaultFor: option.defaultFor,
                    defaultRendered: option.defaultRendered,
                    toolbarFactory,
                    translator,
                    factory: item.rendererFactory
                });
                registry.addWidgetFactory(factory);
                factory.widgetCreated.connect((sender, widget) => {
                    Private.factoryNameProperty.set(widget, factory.name);
                    // Notify the widget tracker if restore data needs to update.
                    widget.context.pathChanged.connect(() => {
                        void tracker.save(widget);
                    });
                    void tracker.add(widget);
                });
            });
        }
    };
}
/**
 * Private namespace for the module.
 */
var Private;
(function (Private) {
    /**
     * An attached property for keeping the factory name
     * that was used to create a mimedocument.
     */
    Private.factoryNameProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({
        name: 'factoryName',
        create: () => undefined
    });
})(Private || (Private = {}));
//# sourceMappingURL=mimerenderers.js.map

/***/ }),

/***/ 20389:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   J: () => (/* binding */ LabStatus)
/* harmony export */ });
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61533);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_1__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * The application status signals and flags class.
 */
class LabStatus {
    /**
     * Construct a new  status object.
     */
    constructor(app) {
        this._busyCount = 0;
        this._dirtyCount = 0;
        this._busySignal = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(app);
        this._dirtySignal = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(app);
    }
    /**
     * Returns a signal for when application changes its busy status.
     */
    get busySignal() {
        return this._busySignal;
    }
    /**
     * Returns a signal for when application changes its dirty status.
     */
    get dirtySignal() {
        return this._dirtySignal;
    }
    /**
     * Whether the application is busy.
     */
    get isBusy() {
        return this._busyCount > 0;
    }
    /**
     * Whether the application is dirty.
     */
    get isDirty() {
        return this._dirtyCount > 0;
    }
    /**
     * Set the application state to dirty.
     *
     * @returns A disposable used to clear the dirty state for the caller.
     */
    setDirty() {
        const oldDirty = this.isDirty;
        this._dirtyCount++;
        if (this.isDirty !== oldDirty) {
            this._dirtySignal.emit(this.isDirty);
        }
        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__.DisposableDelegate(() => {
            const oldDirty = this.isDirty;
            this._dirtyCount = Math.max(0, this._dirtyCount - 1);
            if (this.isDirty !== oldDirty) {
                this._dirtySignal.emit(this.isDirty);
            }
        });
    }
    /**
     * Set the application state to busy.
     *
     * @returns A disposable used to clear the busy state for the caller.
     */
    setBusy() {
        const oldBusy = this.isBusy;
        this._busyCount++;
        if (this.isBusy !== oldBusy) {
            this._busySignal.emit(this.isBusy);
        }
        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__.DisposableDelegate(() => {
            const oldBusy = this.isBusy;
            this._busyCount--;
            if (this.isBusy !== oldBusy) {
                this._busySignal.emit(this.isBusy);
            }
        });
    }
}
//# sourceMappingURL=status.js.map

/***/ }),

/***/ 67663:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@fortawesome/fontawesome-free/css/all.min.css
var all_min = __webpack_require__(94891);
// EXTERNAL MODULE: ../node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css
var v4_shims_min = __webpack_require__(60609);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/application/style/base.css
var base = __webpack_require__(82119);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/application/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */










/***/ }),

/***/ 3147:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib),
  kernelSettings: () => (/* binding */ kernelSettings),
  toggleHeader: () => (/* binding */ toggleHeader)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(75205);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/announcements.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */





const COMMAND_HELP_OPEN = 'help:open';
const NEWS_API_URL = '/lab/api/news';
const UPDATE_API_URL = '/lab/api/update';
const PRIVACY_URL = 'https://jupyterlab.readthedocs.io/en/stable/privacy_policies.html';
/**
 * Call the announcement API
 *
 * @param endpoint Endpoint to request
 * @param init Initial values for the request
 * @param serverSettings The server settings to use for the request
 * @returns The response body interpreted as JSON
 */
async function requestAPI(endpoint, init = {}, serverSettings) {
    // Make request to Jupyter API
    const settings = serverSettings !== null && serverSettings !== void 0 ? serverSettings : services_lib_index_js_.ServerConnection.makeSettings();
    const requestUrl = coreutils_lib_index_js_.URLExt.join(settings.baseUrl, endpoint);
    let response;
    try {
        response = await services_lib_index_js_.ServerConnection.makeRequest(requestUrl, init, settings);
    }
    catch (error) {
        throw new services_lib_index_js_.ServerConnection.NetworkError(error);
    }
    const data = await response.json();
    if (!response.ok) {
        throw new services_lib_index_js_.ServerConnection.ResponseError(response, data.message);
    }
    return data;
}
const announcements = {
    id: '@jupyterlab/apputils-extension:announcements',
    description: 'Add the announcement feature. It will fetch news on the internet and check for application updates.',
    autoStart: true,
    optional: [services_lib_index_js_.IConfigSectionManager, settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    activate: (app, configSectionManager, settingRegistry, translator) => {
        var _a, _b;
        const CONFIG_SECTION_NAME = announcements.id.replace(/[^\w]/g, '');
        void Promise.all([
            app.restored,
            (_a = settingRegistry === null || settingRegistry === void 0 ? void 0 : settingRegistry.load('@jupyterlab/apputils-extension:notification')) !== null && _a !== void 0 ? _a : Promise.resolve(null),
            // Use config instead of state to store independently of the workspace
            // if a news has been displayed or not.
            (_b = configSectionManager === null || configSectionManager === void 0 ? void 0 : configSectionManager.create({
                name: CONFIG_SECTION_NAME
            })) !== null && _b !== void 0 ? _b : Promise.resolve(null)
        ]).then(async ([_, settings, config]) => {
            const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
            // Store dismiss state
            lib_index_js_.Notification.manager.changed.connect((manager, change) => {
                var _a;
                if (change.type !== 'removed') {
                    return;
                }
                const { id, tags } = ((_a = change
                    .notification.options.data) !== null && _a !== void 0 ? _a : {});
                if ((tags !== null && tags !== void 0 ? tags : []).some(tag => ['news', 'update'].includes(tag)) && id) {
                    const update = {};
                    update[id] = { seen: true, dismissed: true };
                    config === null || config === void 0 ? void 0 : config.update(update).catch(reason => {
                        console.error(`Failed to update the announcements config:\n${reason}`);
                    });
                }
            });
            const mustFetchNews = settings === null || settings === void 0 ? void 0 : settings.get('fetchNews').composite;
            if (mustFetchNews === 'none') {
                const notificationId = lib_index_js_.Notification.emit(trans.__('Would you like to get notified about official Jupyter news?'), 'default', {
                    autoClose: false,
                    actions: [
                        {
                            label: trans.__('Open privacy policy'),
                            caption: PRIVACY_URL,
                            callback: event => {
                                event.preventDefault();
                                if (app.commands.hasCommand(COMMAND_HELP_OPEN)) {
                                    void app.commands.execute(COMMAND_HELP_OPEN, {
                                        text: trans.__('Privacy policies'),
                                        url: PRIVACY_URL
                                    });
                                }
                                else {
                                    window.open(PRIVACY_URL, '_blank', 'noreferrer');
                                }
                            },
                            displayType: 'link'
                        },
                        {
                            label: trans.__('Yes'),
                            callback: () => {
                                lib_index_js_.Notification.dismiss(notificationId);
                                config === null || config === void 0 ? void 0 : config.update({}).then(() => fetchNews()).catch(reason => {
                                    console.error(`Failed to get the news:\n${reason}`);
                                });
                                settings === null || settings === void 0 ? void 0 : settings.set('fetchNews', 'true').catch((reason) => {
                                    console.error(`Failed to save setting 'fetchNews':\n${reason}`);
                                });
                            }
                        },
                        {
                            label: trans.__('No'),
                            callback: () => {
                                lib_index_js_.Notification.dismiss(notificationId);
                                settings === null || settings === void 0 ? void 0 : settings.set('fetchNews', 'false').catch((reason) => {
                                    console.error(`Failed to save setting 'fetchNews':\n${reason}`);
                                });
                            }
                        }
                    ]
                });
            }
            else {
                await fetchNews();
            }
            async function fetchNews() {
                var _a, _b, _c, _d;
                if (((_a = settings === null || settings === void 0 ? void 0 : settings.get('fetchNews').composite) !== null && _a !== void 0 ? _a : 'false') === 'true') {
                    try {
                        const response = await requestAPI(NEWS_API_URL, {}, app.serviceManager.serverSettings);
                        for (const { link, message, type, options } of response.news) {
                            // @ts-expect-error data has no index
                            const id = options.data['id'];
                            // Filter those notifications
                            const state = (_b = config === null || config === void 0 ? void 0 : config.data[id]) !== null && _b !== void 0 ? _b : {
                                seen: false,
                                dismissed: false
                            };
                            if (!state.dismissed) {
                                options.actions = [
                                    {
                                        label: trans.__('Hide'),
                                        caption: trans.__('Never show this notification again.'),
                                        callback: () => {
                                            const update = {};
                                            update[id] = { seen: true, dismissed: true };
                                            config === null || config === void 0 ? void 0 : config.update(update).catch(reason => {
                                                console.error(`Failed to update the announcements config:\n${reason}`);
                                            });
                                        }
                                    }
                                ];
                                if ((link === null || link === void 0 ? void 0 : link.length) === 2) {
                                    options.actions.push({
                                        label: link[0],
                                        caption: link[1],
                                        callback: () => {
                                            window.open(link[1], '_blank', 'noreferrer');
                                        },
                                        displayType: 'link'
                                    });
                                }
                                if (!state.seen) {
                                    options.autoClose = 5000;
                                    const update = {};
                                    update[id] = { seen: true };
                                    config === null || config === void 0 ? void 0 : config.update(update).catch(reason => {
                                        console.error(`Failed to update the announcements config:\n${reason}`);
                                    });
                                }
                                lib_index_js_.Notification.emit(message, type, options);
                            }
                        }
                    }
                    catch (reason) {
                        console.log('Failed to get the announcements.', reason);
                    }
                }
                if ((_c = settings === null || settings === void 0 ? void 0 : settings.get('checkForUpdates').composite) !== null && _c !== void 0 ? _c : true) {
                    const response = await requestAPI(UPDATE_API_URL, {}, app.serviceManager.serverSettings);
                    if (response.notification) {
                        const { link, message, type, options } = response.notification;
                        // @ts-expect-error data has no index
                        const id = options.data['id'];
                        const state = (_d = config === null || config === void 0 ? void 0 : config.data[id]) !== null && _d !== void 0 ? _d : {
                            seen: false,
                            dismissed: false
                        };
                        if (!state.dismissed) {
                            let notificationId;
                            options.actions = [
                                {
                                    label: trans.__('Ignore all updates'),
                                    caption: trans.__('Do not prompt me if a new JupyterLab version is available.'),
                                    callback: () => {
                                        settings === null || settings === void 0 ? void 0 : settings.set('checkForUpdates', false).then(() => {
                                            lib_index_js_.Notification.dismiss(notificationId);
                                        }).catch((reason) => {
                                            console.error('Failed to set the `checkForUpdates` setting.', reason);
                                        });
                                    }
                                }
                            ];
                            if ((link === null || link === void 0 ? void 0 : link.length) === 2) {
                                options.actions.push({
                                    label: link[0],
                                    caption: link[1],
                                    callback: () => {
                                        window.open(link[1], '_blank', 'noreferrer');
                                    },
                                    // Because the link to the changelog is the primary option,
                                    // display it in an accent color.
                                    displayType: 'accent'
                                });
                            }
                            if (!state.seen) {
                                options.autoClose = 5000;
                                const update = {};
                                update[id] = { seen: true };
                                config === null || config === void 0 ? void 0 : config.update(update).catch(reason => {
                                    console.error(`Failed to update the announcements config:\n${reason}`);
                                });
                            }
                            notificationId = lib_index_js_.Notification.emit(message, type, options);
                        }
                    }
                }
            }
        });
    }
};
//# sourceMappingURL=announcements.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/mainmenu@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/mainmenu/lib/index.js)
var mainmenu_lib_index_js_ = __webpack_require__(38911);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/licensesplugin.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */






/**
 * The command IDs used by the licenses plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.licenses = 'apputils:licenses';
    CommandIDs.licenseReport = 'apputils:license-report';
    CommandIDs.refreshLicenses = 'apputils:licenses-refresh';
})(CommandIDs || (CommandIDs = {}));
/**
 * The license client plugin for fetching licenses.
 */
const licensesClient = {
    id: '@jupyterlab/apputils-extension:licenses-client',
    description: 'The licenses client plugin for fetching licenses.',
    autoStart: true,
    provides: lib_index_js_.ILicensesClient,
    activate: (app) => {
        const serverSettings = app.serviceManager.serverSettings;
        return new lib_index_js_.Licenses.LicensesClient({ serverSettings });
    }
};
/**
 * A plugin to add a licenses reporting tools.
 */
const licensesPlugin = {
    id: '@jupyterlab/apputils-extension:licenses-plugin',
    description: 'Adds licenses reporting tools.',
    requires: [lib_index_js_.ILicensesClient, translation_lib_index_js_.ITranslator],
    optional: [index_js_.ILayoutRestorer, mainmenu_lib_index_js_.IMainMenu, lib_index_js_.ICommandPalette],
    autoStart: true,
    activate: (app, client, translator, restorer, menu, palette) => {
        const { commands, shell } = app;
        const trans = translator.load('jupyterlab');
        const category = trans.__('Help');
        const downloadAsText = trans.__('Download All Licenses as');
        const refreshLicenses = trans.__('Refresh Licenses');
        const licensesNamespace = 'help-licenses';
        const licensesTracker = new lib_index_js_.WidgetTracker({
            namespace: licensesNamespace
        });
        // translation strings
        const licensesText = trans.__('Licenses');
        // an incrementer for license widget ids
        let counter = 0;
        /**
         * Create a MainAreaWidget for a license viewer
         */
        function createLicenseWidget(args) {
            const licensesModel = new lib_index_js_.Licenses.Model({
                ...args,
                client,
                trans
            });
            const content = new lib_index_js_.Licenses({ model: licensesModel });
            content.id = `${licensesNamespace}-${++counter}`;
            content.title.label = licensesText;
            content.title.icon = ui_components_lib_index_js_.copyrightIcon;
            const main = new lib_index_js_.MainAreaWidget({
                content,
                reveal: licensesModel.licensesReady
            });
            main.toolbar.addItem('refresh-licenses', new ui_components_lib_index_js_.CommandToolbarButton({
                id: CommandIDs.refreshLicenses,
                args: { noLabel: 1 },
                commands
            }));
            main.toolbar.addItem('spacer', ui_components_lib_index_js_.Toolbar.createSpacerItem());
            for (const format of Object.keys(lib_index_js_.Licenses.REPORT_FORMATS)) {
                const button = new ui_components_lib_index_js_.CommandToolbarButton({
                    id: CommandIDs.licenseReport,
                    args: { format, noLabel: 1 },
                    commands
                });
                main.toolbar.addItem(`download-${format}`, button);
            }
            return main;
        }
        /**
         * Return a full license report format based on a format name
         */
        function formatOrDefault(format) {
            return (lib_index_js_.Licenses.REPORT_FORMATS[format] ||
                lib_index_js_.Licenses.REPORT_FORMATS[lib_index_js_.Licenses.DEFAULT_FORMAT]);
        }
        // register license-related commands
        commands.addCommand(CommandIDs.licenses, {
            label: licensesText,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: (args) => {
                // bail if no license API is available from the server
                if (!coreutils_lib_index_js_.PageConfig.getOption('licensesUrl')) {
                    console.warn('No license API available from the server');
                    return;
                }
                const licenseMain = createLicenseWidget(args);
                shell.add(licenseMain, 'main', { type: 'Licenses' });
                // add to tracker so it can be restored, and update when choices change
                void licensesTracker.add(licenseMain);
                licenseMain.content.model.trackerDataChanged.connect(() => {
                    void licensesTracker.save(licenseMain);
                });
                return licenseMain;
            }
        });
        commands.addCommand(CommandIDs.refreshLicenses, {
            label: args => (args.noLabel ? '' : refreshLicenses),
            caption: refreshLicenses,
            icon: ui_components_lib_index_js_.refreshIcon,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        noLabel: {
                            oneOf: [{ type: 'boolean' }, { type: 'number' }],
                            description: 'Whether to hide the label (truthy values hide label)'
                        }
                    }
                }
            },
            execute: async () => {
                var _a;
                return (_a = licensesTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.model.initLicenses();
            }
        });
        commands.addCommand(CommandIDs.licenseReport, {
            label: args => {
                if (args.noLabel) {
                    return '';
                }
                const format = formatOrDefault(`${args.format}`);
                return `${downloadAsText} ${format.title}`;
            },
            caption: args => {
                const format = formatOrDefault(`${args.format}`);
                return `${downloadAsText} ${format.title}`;
            },
            icon: args => {
                const format = formatOrDefault(`${args.format}`);
                return format.icon;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        format: {
                            type: 'string',
                            description: trans.__('The report format to use for download')
                        },
                        noLabel: {
                            oneOf: [{ type: 'boolean' }, { type: 'number' }],
                            description: 'Whether to hide the label (truthy values hide label)'
                        }
                    },
                    required: ['format']
                }
            },
            execute: async (args) => {
                var _a;
                const format = formatOrDefault(`${args.format}`);
                return await ((_a = licensesTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.model.download({
                    format: format.id
                }));
            }
        });
        // handle optional integrations
        if (palette) {
            palette.addItem({ command: CommandIDs.licenses, category });
        }
        if (menu) {
            const helpMenu = menu.helpMenu;
            helpMenu.addGroup([{ command: CommandIDs.licenses }], 0);
        }
        if (restorer) {
            void restorer.restore(licensesTracker, {
                command: CommandIDs.licenses,
                name: widget => 'licenses',
                args: widget => {
                    const { currentBundleName, currentPackageIndex, packageFilter } = widget.content.model;
                    const args = {
                        currentBundleName,
                        currentPackageIndex,
                        packageFilter
                    };
                    return args;
                }
            });
        }
    }
};
//# sourceMappingURL=licensesplugin.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
// EXTERNAL MODULE: ../node_modules/react-dom/client.js
var client = __webpack_require__(37634);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/notificationplugin.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */









/**
 * Toast close button class
 */
const TOAST_CLOSE_BUTTON_CLASS = 'jp-Notification-Toast-Close';
/**
 * Toast close button class right margin required due to custom hover effect
 */
const TOAST_CLOSE_BUTTON_MARGIN_CLASS = 'jp-Notification-Toast-Close-Margin';
/**
 * Maximal number of characters displayed in a notification.
 */
const MAX_MESSAGE_LENGTH = 140;
var notificationplugin_CommandIDs;
(function (CommandIDs) {
    /**
     * Dismiss a notification
     */
    CommandIDs.dismiss = 'apputils:dismiss-notification';
    /**
     * Display all notifications
     */
    CommandIDs.display = 'apputils:display-notifications';
    /**
     * Create a notification
     */
    CommandIDs.notify = 'apputils:notify';
    /**
     * Update a notification
     */
    CommandIDs.update = 'apputils:update-notification';
})(notificationplugin_CommandIDs || (notificationplugin_CommandIDs = {}));
/**
 * Half spacing between subitems in a status item.
 */
const HALF_SPACING = 4;
/**
 * Notification center view
 */
function NotificationCenter(props) {
    const { manager, onClose, trans } = props;
    // Markdown parsed notifications
    const [notifications, setNotifications] = react_index_js_.useState([]);
    // Load asynchronously react-toastify icons
    const [icons, setIcons] = react_index_js_.useState(null);
    react_index_js_.useEffect(() => {
        async function onChanged() {
            setNotifications(await Promise.all(manager.notifications.map(async (n) => {
                return Object.freeze({
                    ...n
                });
            })));
        }
        if (notifications.length !== manager.count) {
            void onChanged();
        }
        manager.changed.connect(onChanged);
        return () => {
            manager.changed.disconnect(onChanged);
        };
    }, [manager]);
    react_index_js_.useEffect(() => {
        Private.getIcons()
            .then(toastifyIcons => {
            setIcons(toastifyIcons);
        })
            .catch(r => {
            console.error(`Failed to get react-toastify icons:\n${r}`);
        });
    }, []);
    return (react_index_js_.createElement(ui_components_lib_index_js_.UseSignal, { signal: manager.changed }, () => (react_index_js_.createElement(react_index_js_.Fragment, null,
        react_index_js_.createElement("h2", { className: "jp-Notification-Header jp-Toolbar" },
            react_index_js_.createElement("span", { className: "jp-Toolbar-item" }, manager.count > 0
                ? trans._n('%1 notification', '%1 notifications', manager.count)
                : trans.__('No notifications')),
            react_index_js_.createElement("span", { className: "jp-Toolbar-item jp-Toolbar-spacer" }),
            react_index_js_.createElement(ui_components_lib_index_js_.ToolbarButtonComponent, { noFocusOnClick: false, onClick: () => {
                    manager.dismiss();
                }, icon: ui_components_lib_index_js_.deleteIcon, tooltip: trans.__('Dismiss all notifications'), enabled: manager.count > 0 }),
            react_index_js_.createElement(ui_components_lib_index_js_.ToolbarButtonComponent, { noFocusOnClick: false, onClick: onClose, icon: ui_components_lib_index_js_.closeIcon, tooltip: trans.__('Hide notifications') })),
        react_index_js_.createElement("ol", { className: "jp-Notification-List" }, notifications.map(notification => {
            var _a;
            const { id, message, type, options } = notification;
            const toastType = type === 'in-progress' ? 'default' : type;
            const closeNotification = () => {
                manager.dismiss(id);
            };
            const icon = type === 'default'
                ? null
                : type === 'in-progress'
                    ? (_a = icons === null || icons === void 0 ? void 0 : icons.spinner) !== null && _a !== void 0 ? _a : null
                    : icons && icons[type];
            return (react_index_js_.createElement("li", { className: "jp-Notification-List-Item", key: notification.id, onClick: event => {
                    // Stop propagation to avoid closing the popup on click
                    event.stopPropagation();
                } },
                react_index_js_.createElement("div", { className: `Toastify__toast Toastify__toast-theme--light Toastify__toast--${toastType} jp-Notification-Toast-${toastType}` },
                    react_index_js_.createElement("div", { className: "Toastify__toast-body" },
                        icon && (react_index_js_.createElement("div", { className: "Toastify__toast-icon" }, icon({ theme: 'light', type: toastType }))),
                        react_index_js_.createElement("div", null, Private.createContent(message, closeNotification, options.actions))),
                    react_index_js_.createElement(Private.CloseButton, { close: closeNotification, closeIcon: ui_components_lib_index_js_.deleteIcon.react, title: trans.__('Dismiss notification'), closeIconMargin: true }))));
        }))))));
}
/**
 * Status widget model
 */
class NotificationStatusModel extends ui_components_lib_index_js_.VDomModel {
    constructor(manager) {
        super();
        this.manager = manager;
        this._highlight = false;
        this._listOpened = false;
        this._doNotDisturbMode = false;
        this._count = manager.count;
        this.manager.changed.connect(this.onNotificationChanged, this);
    }
    /**
     * Number of notifications.
     */
    get count() {
        return this._count;
    }
    /**
     * Whether to silence all notifications or not.
     */
    get doNotDisturbMode() {
        return this._doNotDisturbMode;
    }
    set doNotDisturbMode(v) {
        this._doNotDisturbMode = v;
    }
    /**
     * Whether to highlight the status widget or not.
     */
    get highlight() {
        return this._highlight;
    }
    /**
     * Whether the popup is opened or not.
     */
    get listOpened() {
        return this._listOpened;
    }
    set listOpened(v) {
        this._listOpened = v;
        if (this._listOpened || this._highlight) {
            this._highlight = false;
        }
        this.stateChanged.emit();
    }
    onNotificationChanged(_, change) {
        // Set private attribute to trigger only once the signal emission
        this._count = this.manager.count;
        const { autoClose } = change.notification.options;
        const noToast = this.doNotDisturbMode ||
            (typeof autoClose === 'number' && autoClose <= 0);
        // Highlight if
        //   the list is not opened (the style change if list is opened due to clickedItem style in statusbar.)
        //   the change type is not removed
        //   the notification will be hidden
        if (!this._listOpened && change.type !== 'removed' && noToast) {
            this._highlight = true;
        }
        this.stateChanged.emit();
    }
}
/**
 * Status view
 */
function NotificationStatus(props) {
    return (react_index_js_.createElement(statusbar_lib_index_js_.GroupItem, { role: "button", tabIndex: 0, "aria-haspopup": true, spacing: HALF_SPACING, onClick: () => {
            props.onClick();
        }, onKeyDown: (event) => {
            if (event.key === 'Enter' || event.key === ' ') {
                props.onClick();
            }
        }, title: props.count > 0
            ? props.trans._n('%1 notification', '%1 notifications', props.count)
            : props.trans.__('No notifications') },
        react_index_js_.createElement(statusbar_lib_index_js_.TextItem, { className: "jp-Notification-Status-Text", source: `${props.count}` }),
        react_index_js_.createElement(ui_components_lib_index_js_.bellIcon.react, { top: '2px', stylesheet: 'statusBar' })));
}
/**
 * Add notification center and toast
 */
const notificationPlugin = {
    id: '@jupyterlab/apputils-extension:notification',
    description: 'Add the notification center and its status indicator.',
    autoStart: true,
    optional: [statusbar_lib_index_js_.IStatusBar, settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    activate: (app, statusBar, settingRegistry, translator) => {
        Private.translator = translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator;
        const trans = Private.translator.load('jupyterlab');
        const model = new NotificationStatusModel(lib_index_js_.Notification.manager);
        model.doNotDisturbMode = false;
        if (settingRegistry) {
            void Promise.all([
                settingRegistry.load(notificationPlugin.id),
                app.restored
            ]).then(([plugin]) => {
                const updateSettings = () => {
                    model.doNotDisturbMode = plugin.get('doNotDisturbMode')
                        .composite;
                };
                updateSettings();
                plugin.changed.connect(updateSettings);
            });
        }
        app.commands.addCommand(notificationplugin_CommandIDs.notify, {
            label: trans.__('Emit a notification'),
            caption: trans.__('Notification is described by {message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        message: {
                            type: 'string',
                            description: 'The notification message text'
                        },
                        type: {
                            type: 'string',
                            description: 'The notification type (e.g., "default", "info", "warning", "error")'
                        },
                        options: {
                            type: 'object',
                            description: 'Additional notification options',
                            properties: {
                                autoClose: {
                                    oneOf: [{ type: 'number' }, { type: 'boolean' }],
                                    description: 'Auto-close timeout in milliseconds, or false to disable'
                                },
                                actions: {
                                    type: 'array',
                                    description: 'Array of action buttons for the notification',
                                    items: {
                                        type: 'object',
                                        properties: {
                                            label: {
                                                type: 'string',
                                                description: 'The action button label'
                                            },
                                            commandId: {
                                                type: 'string',
                                                description: 'The command ID to execute when clicked'
                                            },
                                            args: {
                                                description: 'Arguments to pass to the command'
                                            },
                                            caption: {
                                                type: 'string',
                                                description: 'The action button caption/tooltip'
                                            },
                                            className: {
                                                type: 'string',
                                                description: 'CSS class name for the action button'
                                            }
                                        },
                                        required: ['label', 'commandId']
                                    }
                                },
                                data: {
                                    description: 'Additional data associated with the notification'
                                }
                            }
                        }
                    },
                    required: ['message']
                }
            },
            execute: args => {
                var _a;
                const { message, type } = args;
                const options = (_a = args.options) !== null && _a !== void 0 ? _a : {};
                return lib_index_js_.Notification.manager.notify(message, type !== null && type !== void 0 ? type : 'default', {
                    ...options,
                    actions: options.actions
                        ? options.actions.map((action) => {
                            return {
                                ...action,
                                callback: () => {
                                    app.commands
                                        .execute(action.commandId, action.args)
                                        .catch(r => {
                                        console.error(`Failed to executed '${action.commandId}':\n${r}`);
                                    });
                                }
                            };
                        })
                        : null
                });
            }
        });
        app.commands.addCommand(notificationplugin_CommandIDs.update, {
            label: trans.__('Update a notification'),
            caption: trans.__('Notification is described by {id: string, message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        id: {
                            type: 'string',
                            description: 'The notification ID to update'
                        },
                        message: {
                            type: 'string',
                            description: 'The notification message text'
                        },
                        type: {
                            type: 'string',
                            description: 'The notification type (e.g., "default", "info", "warning", "error")'
                        },
                        options: {
                            type: 'object',
                            description: 'Additional notification options',
                            properties: {
                                autoClose: {
                                    oneOf: [{ type: 'number' }, { type: 'boolean' }],
                                    description: 'Auto-close timeout in milliseconds, or false to disable'
                                },
                                actions: {
                                    type: 'array',
                                    description: 'Array of action buttons for the notification',
                                    items: {
                                        type: 'object',
                                        properties: {
                                            label: {
                                                type: 'string',
                                                description: 'The action button label'
                                            },
                                            commandId: {
                                                type: 'string',
                                                description: 'The command ID to execute when clicked'
                                            },
                                            args: {
                                                description: 'Arguments to pass to the command'
                                            },
                                            caption: {
                                                type: 'string',
                                                description: 'The action button caption/tooltip'
                                            },
                                            className: {
                                                type: 'string',
                                                description: 'CSS class name for the action button'
                                            }
                                        },
                                        required: ['label', 'commandId']
                                    }
                                },
                                data: {
                                    description: 'Additional data associated with the notification'
                                }
                            }
                        }
                    },
                    required: ['id', 'message']
                }
            },
            execute: args => {
                const { id, message, type, ...options } = args;
                return lib_index_js_.Notification.manager.update({
                    id,
                    message,
                    type: type !== null && type !== void 0 ? type : 'default',
                    ...options,
                    actions: options.actions
                        ? options.actions.map((action) => {
                            return {
                                ...action,
                                callback: () => {
                                    app.commands
                                        .execute(action.commandId, action.args)
                                        .catch(r => {
                                        console.error(`Failed to executed '${action.commandId}':\n${r}`);
                                    });
                                }
                            };
                        })
                        : null
                });
            }
        });
        app.commands.addCommand(notificationplugin_CommandIDs.dismiss, {
            label: trans.__('Dismiss a notification'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        id: {
                            type: 'string',
                            description: 'The notification ID to dismiss'
                        }
                    },
                    required: ['id']
                }
            },
            execute: args => {
                const { id } = args;
                lib_index_js_.Notification.manager.dismiss(id);
            }
        });
        let popup = null;
        model.listOpened = false;
        const notificationList = lib_index_js_.ReactWidget.create(react_index_js_.createElement(NotificationCenter, { manager: lib_index_js_.Notification.manager, onClose: () => {
                popup === null || popup === void 0 ? void 0 : popup.dispose();
            }, trans: trans }));
        notificationList.addClass('jp-Notification-Center');
        async function onNotification(manager, change) {
            var _a;
            if (model.doNotDisturbMode || (popup !== null && !popup.isDisposed)) {
                return;
            }
            const { message, type, options, id } = change.notification;
            if (typeof options.autoClose === 'number' && options.autoClose <= 0) {
                // If the notification is silent, bail early.
                return;
            }
            switch (change.type) {
                case 'added':
                    await Private.createToast(id, message, type, options);
                    break;
                case 'updated':
                    {
                        const toast = await Private.toast();
                        const actions = options.actions;
                        const autoClose = (_a = options.autoClose) !== null && _a !== void 0 ? _a : (actions && actions.length > 0 ? false : null);
                        if (toast.isActive(id)) {
                            // Update existing toast
                            const closeToast = () => {
                                // Dismiss the displayed toast
                                toast.dismiss(id);
                                // Dismiss the notification from the queue
                                manager.dismiss(id);
                            };
                            toast.update(id, {
                                type: type === 'in-progress' ? null : type,
                                isLoading: type === 'in-progress',
                                autoClose: autoClose,
                                render: Private.createContent(message, closeToast, options.actions)
                            });
                        }
                        else {
                            // Needs to recreate a closed toast
                            await Private.createToast(id, message, type, options);
                        }
                    }
                    break;
                case 'removed':
                    await Private.toast().then(t => {
                        t.dismiss(id);
                    });
                    break;
            }
        }
        lib_index_js_.Notification.manager.changed.connect(onNotification);
        const displayNotifications = () => {
            if (popup) {
                popup.dispose();
                popup = null;
            }
            else {
                popup = (0,statusbar_lib_index_js_.showPopup)({
                    body: notificationList,
                    anchor: notificationStatus,
                    align: 'right',
                    hasDynamicSize: true,
                    startHidden: true
                });
                // Dismiss all toasts when opening the notification center
                Private.toast()
                    .then(t => {
                    t.dismiss();
                })
                    .catch(r => {
                    console.error(`Failed to dismiss all toasts:\n${r}`);
                })
                    .finally(() => {
                    popup === null || popup === void 0 ? void 0 : popup.launch();
                    // Focus on the pop-up
                    notificationList.node.focus();
                    popup === null || popup === void 0 ? void 0 : popup.disposed.connect(() => {
                        model.listOpened = false;
                        popup = null;
                    });
                });
            }
            model.listOpened = popup !== null;
        };
        app.commands.addCommand(notificationplugin_CommandIDs.display, {
            label: trans.__('Show Notifications'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: displayNotifications
        });
        const notificationStatus = lib_index_js_.ReactWidget.create(react_index_js_.createElement(ui_components_lib_index_js_.UseSignal, { signal: model.stateChanged }, () => {
            if (model.highlight || (popup && !popup.isDisposed)) {
                notificationStatus.addClass('jp-mod-selected');
            }
            else {
                notificationStatus.removeClass('jp-mod-selected');
            }
            return (react_index_js_.createElement(NotificationStatus, { count: model.count, highlight: model.highlight, trans: trans, onClick: displayNotifications }));
        }));
        notificationStatus.addClass('jp-Notification-Status');
        if (statusBar) {
            statusBar.registerStatusItem(notificationPlugin.id, {
                item: notificationStatus,
                align: 'right',
                rank: -1
            });
        }
        else {
            notificationStatus.addClass('jp-ThemedContainer');
            // if the status bar is not available, position the notification
            // status in the bottom right corner of the page
            notificationStatus.node.style.position = 'fixed';
            notificationStatus.node.style.bottom = '0';
            // 10px is the default padding for the status bar
            notificationStatus.node.style.right = '10px';
            widgets_dist_index_es6_js_.Widget.attach(notificationStatus, document.body);
            notificationStatus.show();
        }
    }
};
var Private;
(function (Private) {
    /**
     * Translator object for private namespace
     */
    Private.translator = translation_lib_index_js_.nullTranslator;
    /**
     * Pointer to asynchronously loaded react-toastify
     */
    let toastify = null;
    function CloseButton(props) {
        var _a;
        return (react_index_js_.createElement("button", { className: `jp-Button jp-mod-minimal ${TOAST_CLOSE_BUTTON_CLASS}${props.closeIconMargin ? ` ${TOAST_CLOSE_BUTTON_MARGIN_CLASS}` : ''}`, title: (_a = props.title) !== null && _a !== void 0 ? _a : '', onClick: props.close },
            react_index_js_.createElement(props.closeIcon, { className: "jp-icon-hover", tag: "span" })));
    }
    Private.CloseButton = CloseButton;
    function ToastifyCloseButton(props) {
        const trans = Private.translator.load('jupyterlab');
        return (react_index_js_.createElement(CloseButton, { close: props.closeToast, closeIcon: ui_components_lib_index_js_.closeIcon.react, title: trans.__('Hide notification') }));
    }
    let waitForToastify = null;
    /**
     * Asynchronously load the toast container
     *
     * @returns The toast object
     */
    async function toast() {
        if (waitForToastify === null) {
            waitForToastify = new dist_index_js_.PromiseDelegate();
        }
        else {
            await waitForToastify.promise;
        }
        if (toastify === null) {
            toastify = await __webpack_require__.e(/* import() */ 53).then(__webpack_require__.t.bind(__webpack_require__, 60053, 23));
            const container = document.body.appendChild(document.createElement('div'));
            container.id = 'react-toastify-container';
            container.classList.add('jp-ThemedContainer');
            const root = (0,client/* createRoot */.s)(container);
            root.render(react_index_js_.createElement(toastify.ToastContainer, { draggable: false, closeOnClick: false, hideProgressBar: true, newestOnTop: true, pauseOnFocusLoss: true, pauseOnHover: true, position: "bottom-right", className: "jp-toastContainer", transition: toastify.Slide, closeButton: ToastifyCloseButton }));
            waitForToastify.resolve();
        }
        return toastify.toast;
    }
    Private.toast = toast;
    /**
     * react-toastify icons loader
     */
    async function getIcons() {
        if (toastify === null) {
            await toast();
        }
        return toastify.Icons;
    }
    Private.getIcons = getIcons;
    const displayType2Class = {
        accent: 'jp-mod-accept',
        link: 'jp-mod-link',
        warn: 'jp-mod-warn',
        default: ''
    };
    /**
     * Create a button with customized callback in a toast
     */
    function ToastButton({ action, closeToast }) {
        var _a, _b;
        const clickHandler = (event) => {
            action.callback(event);
            if (!event.defaultPrevented) {
                closeToast();
            }
        };
        const classes = [
            'jp-toast-button',
            displayType2Class[(_a = action.displayType) !== null && _a !== void 0 ? _a : 'default']
        ].join(' ');
        return (react_index_js_.createElement(ui_components_lib_index_js_.Button, { title: (_b = action.caption) !== null && _b !== void 0 ? _b : action.label, className: classes, onClick: clickHandler, small: true }, action.label));
    }
    /**
     * Helper function to construct the notification content
     *
     * @param message Message to print in the notification
     * @param closeHandler Function closing the notification
     * @param actions Toast actions
     */
    function createContent(message, closeHandler, actions) {
        var _a;
        const shortenMessage = message.length > MAX_MESSAGE_LENGTH
            ? message.slice(0, MAX_MESSAGE_LENGTH) + '…'
            : message;
        return (react_index_js_.createElement(react_index_js_.Fragment, null,
            react_index_js_.createElement("div", { className: "jp-toast-message" }, shortenMessage.split('\n').map((part, index) => (react_index_js_.createElement(react_index_js_.Fragment, { key: `part-${index}` },
                index > 0 ? react_index_js_.createElement("br", null) : null,
                part)))),
            ((_a = actions === null || actions === void 0 ? void 0 : actions.length) !== null && _a !== void 0 ? _a : 0) > 0 && (react_index_js_.createElement("div", { className: "jp-toast-buttonBar" },
                react_index_js_.createElement("div", { className: "jp-toast-spacer" }),
                actions.map((action, idx) => {
                    return (react_index_js_.createElement(ToastButton, { key: 'button-' + idx, action: action, closeToast: closeHandler }));
                })))));
    }
    Private.createContent = createContent;
    /**
     * Create a toast notification
     *
     * @param toastId Toast unique id
     * @param message Toast message
     * @param type Toast type
     * @param options Toast options
     * @returns Toast id
     */
    async function createToast(toastId, message, type, options = {}) {
        const { actions, autoClose, data } = options;
        const t = await toast();
        const toastOptions = {
            autoClose: autoClose !== null && autoClose !== void 0 ? autoClose : (actions && actions.length > 0 ? false : undefined),
            data: data,
            className: `jp-Notification-Toast-${type}`,
            toastId,
            type: type === 'in-progress' ? null : type,
            isLoading: type === 'in-progress'
        };
        return t(({ closeToast }) => createContent(message, () => {
            if (closeToast)
                closeToast();
            lib_index_js_.Notification.manager.dismiss(toastId);
        }, actions), toastOptions);
    }
    Private.createToast = createToast;
})(Private || (Private = {}));
//# sourceMappingURL=notificationplugin.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/commands@~2.3.3 (singleton) (fallback: ../node_modules/@lumino/commands/dist/index.es6.js)
var commands_dist_index_es6_js_ = __webpack_require__(88532);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/palette.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/







/**
 * The command IDs used by the apputils extension.
 */
var palette_CommandIDs;
(function (CommandIDs) {
    CommandIDs.activate = 'apputils:activate-command-palette';
})(palette_CommandIDs || (palette_CommandIDs = {}));
const PALETTE_PLUGIN_ID = '@jupyterlab/apputils-extension:palette';
/**
 * A thin wrapper around the `CommandPalette` class to conform with the
 * JupyterLab interface for the application-wide command palette.
 */
class Palette {
    /**
     * Create a palette instance.
     */
    constructor(palette, translator) {
        this.translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = this.translator.load('jupyterlab');
        this._palette = palette;
        this._palette.title.label = '';
        this._palette.title.caption = trans.__('Command Palette');
    }
    /**
     * The placeholder text of the command palette's search input.
     */
    set placeholder(placeholder) {
        this._palette.inputNode.placeholder = placeholder;
    }
    get placeholder() {
        return this._palette.inputNode.placeholder;
    }
    /**
     * Activate the command palette for user input.
     */
    activate() {
        this._palette.activate();
    }
    /**
     * Add a command item to the command palette.
     *
     * @param options - The options for creating the command item.
     *
     * @returns A disposable that will remove the item from the palette.
     */
    addItem(options) {
        const item = this._palette.addItem(options);
        return new index_es6_js_.DisposableDelegate(() => {
            this._palette.removeItem(item);
        });
    }
}
/**
 * A namespace for `Palette` statics.
 */
(function (Palette) {
    /**
     * Activate the command palette.
     */
    function activate(app, translator, settingRegistry) {
        const { commands, shell } = app;
        const trans = translator.load('jupyterlab');
        const palette = palette_Private.createPalette(app, translator);
        const modalPalette = new lib_index_js_.ModalCommandPalette({
            commandPalette: palette,
            restore: () => {
                const widget = app.shell.currentWidget;
                if (widget) {
                    widget.activate();
                }
            }
        });
        let modal = false;
        palette.node.setAttribute('role', 'region');
        palette.node.setAttribute('aria-label', trans.__('Command Palette Section'));
        shell.add(palette, 'left', { rank: 300, type: 'Command Palette' });
        if (settingRegistry) {
            const loadSettings = settingRegistry.load(PALETTE_PLUGIN_ID);
            const updateSettings = (settings) => {
                const newModal = settings.get('modal').composite;
                if (modal && !newModal) {
                    palette.parent = null;
                    modalPalette.detach();
                    shell.add(palette, 'left', { rank: 300, type: 'Command Palette' });
                }
                else if (!modal && newModal) {
                    palette.parent = null;
                    modalPalette.palette = palette;
                    palette.show();
                    modalPalette.attach();
                }
                modal = newModal;
            };
            Promise.all([loadSettings, app.restored])
                .then(([settings]) => {
                updateSettings(settings);
                settings.changed.connect(settings => {
                    updateSettings(settings);
                });
            })
                .catch((reason) => {
                console.error(reason.message);
            });
        }
        // Show the current palette shortcut in its title.
        const updatePaletteTitle = () => {
            const binding = (0,algorithm_dist_index_es6_js_.find)(app.commands.keyBindings, b => b.command === palette_CommandIDs.activate);
            if (binding) {
                const ks = binding.keys.map(commands_dist_index_es6_js_.CommandRegistry.formatKeystroke).join(', ');
                palette.title.caption = trans.__('Commands (%1)', ks);
            }
            else {
                palette.title.caption = trans.__('Commands');
            }
        };
        updatePaletteTitle();
        app.commands.keyBindingChanged.connect(() => {
            updatePaletteTitle();
        });
        commands.addCommand(palette_CommandIDs.activate, {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                if (modal) {
                    modalPalette.activate();
                }
                else {
                    shell.activateById(palette.id);
                }
            },
            label: trans.__('Activate Command Palette')
        });
        palette.inputNode.placeholder = trans.__('SEARCH');
        return new Palette(palette, translator);
    }
    Palette.activate = activate;
    /**
     * Restore the command palette.
     */
    function restore(app, restorer, translator) {
        const palette = palette_Private.createPalette(app, translator);
        // Let the application restorer track the command palette for restoration of
        // application state (e.g. setting the command palette as the current side bar
        // widget).
        restorer.add(palette, 'command-palette');
    }
    Palette.restore = restore;
})(Palette || (Palette = {}));
/**
 * The namespace for module private data.
 */
var palette_Private;
(function (Private) {
    /**
     * The private command palette instance.
     */
    let palette;
    /**
     * Create the application-wide command palette.
     */
    function createPalette(app, translator) {
        if (!palette) {
            // use a renderer tweaked to use inline svg icons
            palette = new widgets_dist_index_es6_js_.CommandPalette({
                commands: app.commands,
                renderer: ui_components_lib_index_js_.CommandPaletteSvg.defaultRenderer
            });
            palette.id = 'command-palette';
            palette.title.icon = ui_components_lib_index_js_.paletteIcon;
            const trans = translator.load('jupyterlab');
            palette.title.label = trans.__('Commands');
        }
        return palette;
    }
    Private.createPalette = createPalette;
})(palette_Private || (palette_Private = {}));
//# sourceMappingURL=palette.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/settingconnector.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * A data connector for fetching settings.
 *
 * #### Notes
 * This connector adds a query parameter to the base services setting manager.
 */
class SettingConnector extends statedb_lib_index_js_.DataConnector {
    constructor(connector) {
        super();
        this._throttlers = Object.create(null);
        this._connector = connector;
    }
    /**
     * Fetch settings for a plugin.
     * @param id - The plugin ID
     *
     * #### Notes
     * The REST API requests are throttled at one request per plugin per 100ms.
     */
    fetch(id) {
        const throttlers = this._throttlers;
        if (!(id in throttlers)) {
            throttlers[id] = new dist_index_es6_js_.Throttler(() => this._connector.fetch(id), 100);
        }
        return throttlers[id].invoke();
    }
    async list(query = 'all') {
        const { isDisabled } = coreutils_lib_index_js_.PageConfig.Extension;
        const { ids, values } = await this._connector.list(query === 'ids' ? 'ids' : undefined);
        if (query === 'all') {
            return { ids, values };
        }
        if (query === 'ids') {
            return { ids };
        }
        return {
            ids: ids.filter(id => !isDisabled(id)),
            values: values.filter(({ id }) => !isDisabled(id))
        };
    }
    async save(id, raw) {
        await this._connector.save(id, raw);
    }
}
//# sourceMappingURL=settingconnector.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/settingsplugin.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/



/**
 * Provides the settings connector as a separate plugin to allow for alternative
 * implementations that may want to fetch settings from a different source or
 * endpoint.
 */
const settingsConnector = {
    id: '@jupyterlab/apputils-extension:settings-connector',
    description: 'Provides the settings connector.',
    autoStart: true,
    provides: settingregistry_lib_index_js_.ISettingConnector,
    activate: (app) => new SettingConnector(app.serviceManager.settings)
};
/**
 * The default setting registry provider.
 */
const settingsPlugin = {
    id: '@jupyterlab/apputils-extension:settings',
    autoStart: true,
    provides: settingregistry_lib_index_js_.ISettingRegistry,
    optional: [settingregistry_lib_index_js_.ISettingConnector],
    description: 'Provides the setting registry.',
    activate: async (app, settingsConnector) => {
        const { isDisabled } = coreutils_lib_index_js_.PageConfig.Extension;
        const connector = settingsConnector !== null && settingsConnector !== void 0 ? settingsConnector : new SettingConnector(app.serviceManager.settings);
        // On startup, check if a plugin is available in the application.
        // This helps avoid loading plugin files from other lab-based applications
        // that have placed their schemas next to the JupyterLab schemas. Different lab-based
        // applications might not have the same set of plugins loaded on the page.
        // As an example this helps prevent having new toolbar items added by another application
        // appear in JupyterLab as a side-effect when they are defined via the settings system.
        const registry = new settingregistry_lib_index_js_.SettingRegistry({
            connector,
            plugins: (await connector.list('active')).values.filter(value => app.hasPlugin(value.id))
        });
        // If there are plugins that have schemas that are not in the setting
        // registry after the application has restored, try to load them manually
        // because otherwise, its settings will never become available in the
        // setting registry.
        void app.restored.then(async () => {
            const plugins = await connector.list('ids');
            plugins.ids.forEach(async (id) => {
                if (!app.hasPlugin(id) || isDisabled(id) || id in registry.plugins) {
                    return;
                }
                try {
                    await registry.load(id);
                }
                catch (error) {
                    console.warn(`Settings failed to load for (${id})`, error);
                    if (!app.isPluginActivated(id)) {
                        console.warn(`If 'jupyter.lab.transform=true' in the plugin schema, this ` +
                            `may happen if {autoStart: false} in (${id}) or if it is ` +
                            `one of the deferredExtensions in page config.`);
                    }
                }
            });
        });
        return registry;
    }
};
//# sourceMappingURL=settingsplugin.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/statusbarplugin.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/





/**
 * A plugin that provides a kernel status item to the status bar.
 */
const kernelStatus = {
    id: '@jupyterlab/apputils-extension:kernel-status',
    description: 'Provides the kernel status indicator model.',
    autoStart: true,
    requires: [statusbar_lib_index_js_.IStatusBar],
    provides: lib_index_js_.IKernelStatusModel,
    optional: [lib_index_js_.ISessionContextDialogs, translation_lib_index_js_.ITranslator, index_js_.ILabShell],
    activate: (app, statusBar, sessionDialogs_, translator_, labShell) => {
        const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
        const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new lib_index_js_.SessionContextDialogs({ translator });
        // When the status item is clicked, launch the kernel
        // selection dialog for the current session.
        const changeKernel = async () => {
            if (!item.model.sessionContext) {
                return;
            }
            await sessionDialogs.selectKernel(item.model.sessionContext);
        };
        const changeKernelOnKeyDown = async (event) => {
            if (event.key === 'Enter' ||
                event.key === 'Spacebar' ||
                event.key === ' ') {
                event.preventDefault();
                event.stopPropagation();
                return changeKernel();
            }
        };
        // Create the status item.
        const item = new lib_index_js_.KernelStatus({ onClick: changeKernel, onKeyDown: changeKernelOnKeyDown }, translator);
        const providers = new Set();
        const addSessionProvider = (provider) => {
            providers.add(provider);
            if (app.shell.currentWidget) {
                updateSession(app.shell, {
                    newValue: app.shell.currentWidget,
                    oldValue: null
                });
            }
        };
        function updateSession(shell, changes) {
            var _a;
            const { oldValue, newValue } = changes;
            // Clean up after the old value if it exists,
            // listen for changes to the title of the activity
            if (oldValue) {
                oldValue.title.changed.disconnect(onTitleChanged);
            }
            item.model.sessionContext =
                (_a = [...providers]
                    .map(provider => provider(changes.newValue))
                    .filter(session => session !== null)[0]) !== null && _a !== void 0 ? _a : null;
            if (newValue && item.model.sessionContext) {
                onTitleChanged(newValue.title);
                newValue.title.changed.connect(onTitleChanged);
            }
        }
        // When the title of the active widget changes, update the label
        // of the hover text.
        const onTitleChanged = (title) => {
            item.model.activityName = title.label;
        };
        if (labShell) {
            labShell.currentChanged.connect(updateSession);
        }
        statusBar.registerStatusItem(kernelStatus.id, {
            priority: 1,
            item,
            align: 'left',
            rank: 1,
            isActive: () => item.model.sessionContext !== null
        });
        return { addSessionProvider };
    }
};
/*
 * A plugin providing running terminals and sessions information
 * to the status bar.
 */
const runningSessionsStatus = {
    id: '@jupyterlab/apputils-extension:running-sessions-status',
    description: 'Add the running sessions and terminals status bar item.',
    autoStart: true,
    requires: [statusbar_lib_index_js_.IStatusBar, translation_lib_index_js_.ITranslator],
    optional: [settingregistry_lib_index_js_.ISettingRegistry],
    activate: (app, statusBar, translator, settingRegistry) => {
        const createStatusItem = (options) => {
            const item = new lib_index_js_.RunningSessions({
                onClick: () => app.shell.activateById('jp-running-sessions'),
                onKeyDown: (event) => {
                    if (event.key === 'Enter' ||
                        event.key === 'Spacebar' ||
                        event.key === ' ') {
                        event.preventDefault();
                        event.stopPropagation();
                        app.shell.activateById('jp-running-sessions');
                    }
                },
                serviceManager: app.serviceManager,
                translator,
                ...options
            });
            item.model.sessions = Array.from(app.serviceManager.sessions.running()).length;
            item.model.terminals = Array.from(app.serviceManager.terminals.running()).length;
            return item;
        };
        const registerItem = (options) => {
            const item = createStatusItem(options);
            return statusBar.registerStatusItem(runningSessionsStatus.id, {
                item,
                align: 'left',
                rank: 0
            });
        };
        if (settingRegistry) {
            let disposable;
            const onSettingsUpdated = (kernelSettings, terminalsSettings) => {
                var _a, _b;
                const showTerminalsMap = {
                    'if-any': undefined,
                    never: false,
                    always: true
                };
                const showKernels = (_a = kernelSettings === null || kernelSettings === void 0 ? void 0 : kernelSettings.get('showStatusBarItem').composite) !== null && _a !== void 0 ? _a : true;
                const showTerminals = showTerminalsMap[(_b = terminalsSettings === null || terminalsSettings === void 0 ? void 0 : terminalsSettings.get('showStatusBarItem').composite) !== null && _b !== void 0 ? _b : 'if-any'];
                disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
                if (showKernels || showTerminals !== false) {
                    disposable = registerItem({
                        showKernels,
                        showTerminals
                    });
                }
            };
            const kernelsPluginId = '@jupyterlab/apputils-extension:kernels-settings';
            const terminalPluginId = '@jupyterlab/terminal-extension:plugin';
            void Promise.all([
                // Settings may be missing if the respective plugins are not enabled/included.
                kernelsPluginId in settingRegistry.plugins
                    ? settingRegistry.load(kernelsPluginId).catch(() => undefined)
                    : Promise.resolve(undefined),
                terminalPluginId in settingRegistry.plugins
                    ? settingRegistry.load(terminalPluginId).catch(() => undefined)
                    : Promise.resolve(undefined)
            ]).then(([kernelSettings, terminalSettings]) => {
                onSettingsUpdated(kernelSettings, terminalSettings);
                if (kernelSettings) {
                    kernelSettings.changed.connect(settings => {
                        kernelSettings = settings;
                        onSettingsUpdated(kernelSettings, terminalSettings);
                    });
                }
                if (terminalSettings) {
                    terminalSettings.changed.connect(settings => {
                        terminalSettings = settings;
                        onSettingsUpdated(kernelSettings, terminalSettings);
                    });
                }
            });
        }
        else {
            registerItem({
                showKernels: true
            });
        }
    }
};
//# sourceMappingURL=statusbarplugin.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/subshell-settings.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*
 * A plugin loading kernel subshell settings.
 */
const subshellsSettings = {
    id: '@jupyterlab/apputils-extension:subshell-settings',
    description: 'Kernel subshell settings.',
    autoStart: true,
    requires: [],
    optional: [settingregistry_lib_index_js_.ISettingRegistry],
    activate: (app, settingRegistry) => {
        if (settingRegistry) {
            app.started
                .then(async () => {
                const subshellsSettings = await settingRegistry.load('@jupyterlab/apputils-extension:kernels-settings');
                const commsOverSubshells = subshellsSettings.get('commsOverSubshells')
                    .composite;
                app.serviceManager.kernels.commsOverSubshells = commsOverSubshells;
                subshellsSettings.changed.connect(() => {
                    const commsOverSubshells = subshellsSettings.get('commsOverSubshells').composite;
                    app.serviceManager.kernels.commsOverSubshells = commsOverSubshells;
                });
            })
                .catch(reason => {
                console.error('Fail to load settings for the subshells.');
                console.error(reason);
            });
        }
    }
};
//# sourceMappingURL=subshell-settings.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/style/scrollbar.raw.css
const scrollbar_raw_namespaceObject = "/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n * Webkit scrollbar styling.\n * Separate file which is dynamically loaded based on user/theme settings.\n */\n\n/* use standard opaque scrollbars for most nodes */\n\n::-webkit-scrollbar,\n::-webkit-scrollbar-corner {\n  background: var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-thumb {\n  background: rgb(var(--jp-scrollbar-thumb-color));\n  border: var(--jp-scrollbar-thumb-margin) solid transparent;\n  background-clip: content-box;\n  border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n::-webkit-scrollbar-track:horizontal {\n  border-left: var(--jp-scrollbar-endpad) solid\n    var(--jp-scrollbar-background-color);\n  border-right: var(--jp-scrollbar-endpad) solid\n    var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-track:vertical {\n  border-top: var(--jp-scrollbar-endpad) solid\n    var(--jp-scrollbar-background-color);\n  border-bottom: var(--jp-scrollbar-endpad) solid\n    var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar */\n\n.CodeMirror-hscrollbar::-webkit-scrollbar,\n.CodeMirror-vscrollbar::-webkit-scrollbar,\n.CodeMirror-hscrollbar::-webkit-scrollbar-corner,\n.CodeMirror-vscrollbar::-webkit-scrollbar-corner {\n  background-color: transparent;\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-thumb,\n.CodeMirror-vscrollbar::-webkit-scrollbar-thumb {\n  background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n  border: var(--jp-scrollbar-thumb-margin) solid transparent;\n  background-clip: content-box;\n  border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-track:horizontal {\n  border-left: var(--jp-scrollbar-endpad) solid transparent;\n  border-right: var(--jp-scrollbar-endpad) solid transparent;\n}\n\n.CodeMirror-vscrollbar::-webkit-scrollbar-track:vertical {\n  border-top: var(--jp-scrollbar-endpad) solid transparent;\n  border-bottom: var(--jp-scrollbar-endpad) solid transparent;\n}\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/themesplugins.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/







var themesplugins_CommandIDs;
(function (CommandIDs) {
    CommandIDs.changeTheme = 'apputils:change-theme';
    CommandIDs.changePreferredLightTheme = 'apputils:change-light-theme';
    CommandIDs.changePreferredDarkTheme = 'apputils:change-dark-theme';
    CommandIDs.toggleAdaptiveTheme = 'apputils:adaptive-theme';
    CommandIDs.themeScrollbars = 'apputils:theme-scrollbars';
    CommandIDs.changeFont = 'apputils:change-font';
    CommandIDs.incrFontSize = 'apputils:incr-font-size';
    CommandIDs.decrFontSize = 'apputils:decr-font-size';
})(themesplugins_CommandIDs || (themesplugins_CommandIDs = {}));
function createStyleSheet(text) {
    const style = document.createElement('style');
    style.setAttribute('type', 'text/css');
    style.appendChild(document.createTextNode(text));
    return style;
}
/**
 * The default theme manager provider.
 */
const themesPlugin = {
    id: '@jupyterlab/apputils-extension:themes',
    description: 'Provides the theme manager.',
    requires: [settingregistry_lib_index_js_.ISettingRegistry, index_js_.JupyterFrontEnd.IPaths, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ISplashScreen],
    activate: (app, settings, paths, translator, splash) => {
        const trans = translator.load('jupyterlab');
        const host = app.shell;
        const commands = app.commands;
        const url = coreutils_lib_index_js_.URLExt.join(app.serviceManager.serverSettings.baseUrl, paths.urls.themes);
        const key = themesPlugin.id;
        const manager = new lib_index_js_.ThemeManager({
            key,
            host,
            settings,
            splash: splash !== null && splash !== void 0 ? splash : undefined,
            url
        });
        let scrollbarsStyleElement = null;
        // Keep a synchronously set reference to the current theme,
        // since the asynchronous setting of the theme in `changeTheme`
        // can lead to an incorrect toggle on the currently used theme.
        let currentTheme;
        manager.themeChanged.connect((sender, args) => {
            // Set data attributes on the application shell for the current theme.
            currentTheme = args.newValue;
            document.body.dataset.jpThemeLight = String(manager.isLight(currentTheme));
            document.body.dataset.jpThemeName = currentTheme;
            document.body.style.colorScheme = manager.isLight(currentTheme)
                ? 'light'
                : 'dark';
            if (document.body.dataset.jpThemeScrollbars !==
                String(manager.themeScrollbars(currentTheme))) {
                document.body.dataset.jpThemeScrollbars = String(manager.themeScrollbars(currentTheme));
                if (manager.themeScrollbars(currentTheme)) {
                    if (!scrollbarsStyleElement) {
                        scrollbarsStyleElement = createStyleSheet(scrollbar_raw_namespaceObject);
                    }
                    if (!scrollbarsStyleElement.parentElement) {
                        document.body.appendChild(scrollbarsStyleElement);
                    }
                }
                else {
                    if (scrollbarsStyleElement && scrollbarsStyleElement.parentElement) {
                        scrollbarsStyleElement.parentElement.removeChild(scrollbarsStyleElement);
                    }
                }
            }
            commands.notifyCommandChanged(themesplugins_CommandIDs.changeTheme);
        });
        commands.addCommand(themesplugins_CommandIDs.changeTheme, {
            label: args => {
                if (args.theme === undefined) {
                    return trans.__('Switch to the provided `theme`.');
                }
                const theme = args['theme'];
                const displayName = manager.getDisplayName(theme);
                return args['isPalette']
                    ? trans.__('Use Theme: %1', displayName)
                    : displayName;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        theme: {
                            type: 'string',
                            description: trans.__('The theme name to switch to')
                        },
                        isPalette: {
                            type: 'boolean',
                            description: trans.__('Whether the command is being called from the palette')
                        }
                    },
                    required: ['theme']
                }
            },
            isToggled: args => args['theme'] === currentTheme,
            execute: args => {
                const theme = args['theme'];
                if (theme === manager.theme) {
                    return;
                }
                // Disable adaptive theme if users decide to change the theme when adaptive theme is on
                if (manager.isToggledAdaptiveTheme()) {
                    return manager.toggleAdaptiveTheme();
                }
                return manager.setTheme(theme);
            }
        });
        commands.addCommand(themesplugins_CommandIDs.changePreferredLightTheme, {
            label: args => {
                if (args.theme === undefined) {
                    return trans.__('Switch to the provided light `theme`.');
                }
                const theme = args['theme'];
                const displayName = manager.getDisplayName(theme);
                return args['isPalette']
                    ? trans.__('Set Preferred Light Theme: %1', displayName)
                    : displayName;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        theme: {
                            type: 'string',
                            description: trans.__('The preferred light theme name')
                        },
                        isPalette: {
                            type: 'boolean',
                            description: trans.__('Whether the command is being called from the palette')
                        }
                    },
                    required: ['theme']
                }
            },
            isToggled: args => args['theme'] === manager.preferredLightTheme,
            execute: args => {
                const theme = args['theme'];
                if (theme === manager.preferredLightTheme) {
                    return;
                }
                return manager.setPreferredLightTheme(theme);
            }
        });
        commands.addCommand(themesplugins_CommandIDs.changePreferredDarkTheme, {
            label: args => {
                if (args.theme === undefined) {
                    return trans.__('Switch to the provided dark `theme`.');
                }
                const theme = args['theme'];
                const displayName = manager.getDisplayName(theme);
                return args['isPalette']
                    ? trans.__('Set Preferred Dark Theme: %1', displayName)
                    : displayName;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        theme: {
                            type: 'string',
                            description: trans.__('The preferred dark theme name')
                        },
                        isPalette: {
                            type: 'boolean',
                            description: trans.__('Whether the command is being called from the palette')
                        }
                    },
                    required: ['theme']
                }
            },
            isToggled: args => args['theme'] === manager.preferredDarkTheme,
            execute: args => {
                const theme = args['theme'];
                if (theme === manager.preferredDarkTheme) {
                    return;
                }
                return manager.setPreferredDarkTheme(theme);
            }
        });
        commands.addCommand(themesplugins_CommandIDs.toggleAdaptiveTheme, {
            // Avoid lengthy option text in menu
            label: args => args['isPalette']
                ? trans.__('Synchronize Styling Theme with System Settings')
                : trans.__('Synchronize with System Settings'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        isPalette: {
                            type: 'boolean',
                            description: trans.__('Whether the command is being called from the palette')
                        }
                    }
                }
            },
            isToggled: () => manager.isToggledAdaptiveTheme(),
            execute: () => {
                manager.toggleAdaptiveTheme().catch(console.warn);
            }
        });
        commands.addCommand(themesplugins_CommandIDs.themeScrollbars, {
            label: trans.__('Theme Scrollbars'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isToggled: () => manager.isToggledThemeScrollbars(),
            execute: () => manager.toggleThemeScrollbars()
        });
        commands.addCommand(themesplugins_CommandIDs.changeFont, {
            label: args => args['enabled'] ? `${args['font']}` : trans.__('waiting for fonts'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        enabled: {
                            type: 'boolean',
                            description: trans.__('Whether the font is available and enabled')
                        },
                        font: {
                            type: 'string',
                            description: trans.__('The font name')
                        },
                        key: {
                            type: 'string',
                            description: trans.__('The CSS property key to modify')
                        }
                    },
                    required: ['enabled', 'font', 'key']
                }
            },
            isEnabled: args => args['enabled'],
            isToggled: args => manager.getCSS(args['key']) === args['font'],
            execute: args => manager.setCSSOverride(args['key'], args['font'])
        });
        commands.addCommand(themesplugins_CommandIDs.incrFontSize, {
            label: args => {
                switch (args.key) {
                    case 'code-font-size':
                        return trans.__('Increase Code Font Size');
                    case 'content-font-size1':
                        return trans.__('Increase Content Font Size');
                    case 'ui-font-size1':
                        return trans.__('Increase UI Font Size');
                    default:
                        return trans.__('Increase Font Size');
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        key: {
                            type: 'string',
                            description: trans.__('The font size key to increase (e.g., "code-font-size", "content-font-size1", "ui-font-size1")')
                        }
                    },
                    required: ['key']
                }
            },
            execute: args => manager.incrFontSize(args['key'])
        });
        commands.addCommand(themesplugins_CommandIDs.decrFontSize, {
            label: args => {
                switch (args.key) {
                    case 'code-font-size':
                        return trans.__('Decrease Code Font Size');
                    case 'content-font-size1':
                        return trans.__('Decrease Content Font Size');
                    case 'ui-font-size1':
                        return trans.__('Decrease UI Font Size');
                    default:
                        return trans.__('Decrease Font Size');
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        key: {
                            type: 'string',
                            description: trans.__('The font size key to decrease (e.g., "code-font-size", "content-font-size1", "ui-font-size1")')
                        }
                    },
                    required: ['key']
                }
            },
            execute: args => manager.decrFontSize(args['key'])
        });
        const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
        const syncThemeOnSystemChange = (event) => {
            // Only act if the "Synchronize with System Settings" option is enabled.
            if (manager.isToggledAdaptiveTheme()) {
                const newTheme = event.matches
                    ? manager.preferredDarkTheme
                    : manager.preferredLightTheme;
                // Switch the theme if it's not already the correct one.
                if (manager.theme !== newTheme) {
                    void manager.setTheme(newTheme);
                }
            }
        };
        darkModeMediaQuery.addEventListener('change', syncThemeOnSystemChange);
        return manager;
    },
    autoStart: true,
    provides: lib_index_js_.IThemeManager
};
/**
 * The default theme manager's UI command palette and main menu functionality.
 *
 * #### Notes
 * This plugin loads separately from the theme manager plugin in order to
 * prevent blocking of the theme manager while it waits for the command palette
 * and main menu to become available.
 */
const themesPaletteMenuPlugin = {
    id: '@jupyterlab/apputils-extension:themes-palette-menu',
    description: 'Adds theme commands to the menu and the command palette.',
    requires: [lib_index_js_.IThemeManager, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ICommandPalette, mainmenu_lib_index_js_.IMainMenu],
    activate: (app, manager, translator, palette, mainMenu) => {
        const trans = translator.load('jupyterlab');
        // If we have a main menu, add the theme manager to the settings menu.
        if (mainMenu) {
            void app.restored.then(() => {
                var _a;
                const isPalette = false;
                const themeMenu = (_a = mainMenu.settingsMenu.items.find(item => {
                    var _a;
                    return item.type === 'submenu' &&
                        ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-settings-apputilstheme';
                })) === null || _a === void 0 ? void 0 : _a.submenu;
                // choose a theme
                if (themeMenu) {
                    manager.themes.forEach((theme, index) => {
                        themeMenu.insertItem(index, {
                            command: themesplugins_CommandIDs.changeTheme,
                            args: { isPalette, theme }
                        });
                    });
                }
            });
        }
        // If we have a command palette, add theme switching options to it.
        if (palette) {
            void app.restored.then(() => {
                const category = trans.__('Theme');
                const command = themesplugins_CommandIDs.changeTheme;
                const isPalette = true;
                // choose a theme
                manager.themes.forEach(theme => {
                    palette.addItem({ command, args: { isPalette, theme }, category });
                });
                // choose preferred light theme
                manager.themes.forEach(theme => {
                    palette.addItem({
                        command: themesplugins_CommandIDs.changePreferredLightTheme,
                        args: { isPalette, theme },
                        category
                    });
                });
                // choose preferred dark theme
                manager.themes.forEach(theme => {
                    palette.addItem({
                        command: themesplugins_CommandIDs.changePreferredDarkTheme,
                        args: { isPalette, theme },
                        category
                    });
                });
                // toggle adaptive theme
                palette.addItem({
                    command: themesplugins_CommandIDs.toggleAdaptiveTheme,
                    args: { isPalette },
                    category
                });
                // toggle scrollbar theming
                palette.addItem({ command: themesplugins_CommandIDs.themeScrollbars, category });
                // increase/decrease code font size
                palette.addItem({
                    command: themesplugins_CommandIDs.incrFontSize,
                    args: {
                        key: 'code-font-size'
                    },
                    category
                });
                palette.addItem({
                    command: themesplugins_CommandIDs.decrFontSize,
                    args: {
                        key: 'code-font-size'
                    },
                    category
                });
                // increase/decrease content font size
                palette.addItem({
                    command: themesplugins_CommandIDs.incrFontSize,
                    args: {
                        key: 'content-font-size1'
                    },
                    category
                });
                palette.addItem({
                    command: themesplugins_CommandIDs.decrFontSize,
                    args: {
                        key: 'content-font-size1'
                    },
                    category
                });
                // increase/decrease ui font size
                palette.addItem({
                    command: themesplugins_CommandIDs.incrFontSize,
                    args: {
                        key: 'ui-font-size1'
                    },
                    category
                });
                palette.addItem({
                    command: themesplugins_CommandIDs.decrFontSize,
                    args: {
                        key: 'ui-font-size1'
                    },
                    category
                });
            });
        }
    },
    autoStart: true
};
//# sourceMappingURL=themesplugins.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/toolbarregistryplugin.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/**
 * The default toolbar registry.
 */
const toolbarRegistry = {
    id: '@jupyterlab/apputils-extension:toolbar-registry',
    description: 'Provides toolbar items registry.',
    autoStart: true,
    provides: lib_index_js_.IToolbarWidgetRegistry,
    activate: (app) => {
        const registry = new lib_index_js_.ToolbarWidgetRegistry({
            defaultFactory: (0,lib_index_js_.createDefaultFactory)(app.commands)
        });
        return registry;
    }
};
//# sourceMappingURL=toolbarregistryplugin.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/workspaces@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/workspaces/lib/index.js)
var workspaces_lib_index_js_ = __webpack_require__(8174);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/workspacesplugin.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







const WORKSPACE_NAME = 'jupyterlab-workspace';
const WORKSPACE_EXT = '.' + WORKSPACE_NAME;
const LAST_SAVE_ID = 'workspace-ui:lastSave';
const ICON_NAME = 'jp-JupyterIcon';
/**
 * The workspace MIME renderer.
 */
const workspacesPlugin = {
    id: '@jupyterlab/apputils-extension:workspaces',
    description: 'Add workspace file type.',
    autoStart: true,
    requires: [statedb_lib_index_js_.IStateDB, translation_lib_index_js_.ITranslator, index_js_.JupyterFrontEnd.IPaths],
    optional: [index_js_.IRouter, workspaces_lib_index_js_.IWorkspaceCommands],
    activate: (app, state, translator, paths, router, workspaceCommands) => {
        // The workspace factory creates dummy widgets to load a new workspace.
        const factory = new workspacesplugin_Private.WorkspaceFactory({
            workspaces: app.serviceManager.workspaces,
            state,
            translator,
            open: async (id) => {
                if (workspaceCommands) {
                    await app.commands.execute(workspaceCommands.open, { workspace: id });
                }
                else {
                    const workspacesBase = coreutils_lib_index_js_.URLExt.join(paths.urls.app, 'workspaces');
                    const url = coreutils_lib_index_js_.URLExt.join(workspacesBase, id);
                    if (!url.startsWith(workspacesBase)) {
                        throw new Error('Can only be used for workspaces');
                    }
                    if (router) {
                        router.navigate(url, { hard: true });
                    }
                    else {
                        document.location.href = url;
                    }
                }
            }
        });
        const trans = translator.load('jupyterlab');
        app.docRegistry.addFileType({
            name: WORKSPACE_NAME,
            contentType: 'file',
            fileFormat: 'text',
            displayName: trans.__('JupyterLab Workspace File'),
            extensions: [WORKSPACE_EXT],
            mimeTypes: ['text/json'],
            iconClass: ICON_NAME
        });
        app.docRegistry.addWidgetFactory(factory);
    }
};
var workspacesplugin_Private;
(function (Private) {
    /**
     * This widget factory is used to handle double click on workspace
     */
    class WorkspaceFactory extends docregistry_lib_index_js_.ABCWidgetFactory {
        /**
         * Construct a widget factory that uploads a workspace and navigates to it.
         *
         * @param options - The instantiation options for a `WorkspaceFactory`.
         */
        constructor(options) {
            const trans = (options.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
            super({
                name: 'Workspace loader',
                label: trans.__('Workspace loader'),
                fileTypes: [WORKSPACE_NAME],
                defaultFor: [WORKSPACE_NAME],
                readOnly: true
            });
            this._state = options.state;
            this._workspaces = options.workspaces;
            this._open = options.open;
        }
        /**
         * Loads the workspace into load, and jump to it
         * @param context This is used to query the workspace content
         */
        createNewWidget(context) {
            // Save a file's contents as a workspace and navigate to that workspace.
            void context.ready.then(async () => {
                const file = context.model;
                const workspace = file.toJSON();
                const path = context.path;
                const id = workspace.metadata.id;
                // Save the file contents as a workspace.
                await this._workspaces.save(id, workspace);
                // Save last save location for the save command.
                await this._state.save(LAST_SAVE_ID, path);
                // Navigate to new workspace.
                await this._open(id);
            });
            return dummyWidget(context);
        }
    }
    Private.WorkspaceFactory = WorkspaceFactory;
    /**
     * Returns a dummy widget with disposed content that doesn't render in the UI.
     *
     * @param context - The file context.
     */
    function dummyWidget(context) {
        const widget = new docregistry_lib_index_js_.DocumentWidget({ content: new widgets_dist_index_es6_js_.Widget(), context });
        widget.content.dispose();
        return widget;
    }
})(workspacesplugin_Private || (workspacesplugin_Private = {}));
//# sourceMappingURL=workspacesplugin.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var domutils_dist_index_es6_js_ = __webpack_require__(19451);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/shortcuts.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




/**
 * The class name for each row of ContextShortcutTable
 */
const SHORTCUT_TABLE_ROW_CLASS = 'jp-ContextualShortcut-TableRow';
/**
 * The class name for the last row of ContextShortcutTable
 */
const SHORTCUT_TABLE_LAST_ROW_CLASS = 'jp-ContextualShortcut-TableLastRow';
/**
 * The class name for each item of ContextShortcutTable
 */
const SHORTCUT_TABLE_ITEM_CLASS = 'jp-ContextualShortcut-TableItem';
/**
 * The class name for each button-like symbol representing a key used in a shortcut in the ContextShortcutTable
 */
const SHORTCUT_KEY_CLASS = 'jp-ContextualShortcut-Key';
function displayShortcuts(options) {
    const { commands, trans, activeElement } = options;
    const elt = activeElement !== null && activeElement !== void 0 ? activeElement : document.activeElement;
    /**
     * Find the distance from the target node to the first matching node.
     *
     * Based on Lumino private function commands.Private.targetDistance
     * This traverses the DOM path from `elt` to the root
     * computes the distance from `elt` to the first node which matches
     * the CSS selector. If no match is found, `-1` is returned.
     *
     * It also stops traversal if the `data-lm-suppress-shortcuts` or
     * `data-p-suppress-shortcuts` attributes are found.
     */
    function formatKeys(keys) {
        const topContainer = [];
        keys.forEach((key, index) => {
            const container = [];
            key.split(' ').forEach((ch, chIndex) => {
                container.push(react_index_js_.createElement("span", { className: SHORTCUT_KEY_CLASS, key: `ch-${chIndex}` },
                    react_index_js_.createElement("kbd", null, ch)), react_index_js_.createElement(react_index_js_.Fragment, { key: `fragment-${chIndex}` }, " + "));
            });
            topContainer.push(react_index_js_.createElement("span", { key: `key-${index}` }, container.slice(0, -1)), react_index_js_.createElement(react_index_js_.Fragment, { key: `fragment-${index}` }, " + "));
        });
        return react_index_js_.createElement("span", null, topContainer.slice(0, -1));
    }
    function capitalizeString(str) {
        const capitalizedStr = str.charAt(0).toUpperCase() + str.slice(1);
        return capitalizedStr;
    }
    function formatLabel(b) {
        const label = commands.label(b.command);
        const commandID = b.command.split(':')[1];
        const automaticLabel = commandID.split('-');
        let capitalizedLabel = '';
        for (let i = 0; i < automaticLabel.length; i++) {
            const str = capitalizeString(automaticLabel[i]);
            capitalizedLabel = capitalizedLabel + ' ' + str;
        }
        if (label.length > 0) {
            return label;
        }
        else {
            return capitalizedLabel;
        }
    }
    function matchDistance(selector, elt) {
        let targ = elt;
        for (let dist = 0; targ !== null && targ !== targ.parentElement; targ = targ.parentElement, ++dist) {
            if (targ.hasAttribute('data-lm-suppress-shortcuts')) {
                return -1;
            }
            if (targ.matches(selector)) {
                return dist;
            }
        }
        return -1;
    }
    // Find active keybindings for target element
    const activeBindings = new Map();
    for (let i = 0; i < commands.keyBindings.length; i++) {
        const kb = commands.keyBindings[i];
        let distance = matchDistance(kb.selector, elt);
        if (distance < 0) {
            continue;
        }
        let formatted = commands_dist_index_es6_js_.CommandRegistry.formatKeystroke(kb.keys);
        if (activeBindings.has(formatted)) {
            let oldBinding = activeBindings.get(formatted);
            // if the existing binding takes precedence, ignore this binding by continuing
            if (oldBinding[0] < distance ||
                (oldBinding[0] === distance &&
                    domutils_dist_index_es6_js_.Selector.calculateSpecificity(oldBinding[1].selector) >
                        domutils_dist_index_es6_js_.Selector.calculateSpecificity(kb.selector))) {
                continue;
            }
        }
        activeBindings.set(formatted, [distance, kb]);
    }
    // Group shortcuts by distance
    let maxDistance = -1;
    const groupedBindings = new Map();
    for (let [distance, binding] of activeBindings.values()) {
        maxDistance = Math.max(distance, maxDistance);
        if (!groupedBindings.has(distance)) {
            groupedBindings.set(distance, []);
        }
        groupedBindings.get(distance).push(binding);
    }
    // Display shortcuts by group
    const bindingTable = [];
    for (let d = 0; d <= maxDistance; d++) {
        if (groupedBindings.has(d)) {
            bindingTable.push(groupedBindings.get(d).map(b => (react_index_js_.createElement("tr", { className: SHORTCUT_TABLE_ROW_CLASS, key: `${b.command}-${b.keys.join('-').replace(' ', '_')}` },
                react_index_js_.createElement("td", { className: SHORTCUT_TABLE_ITEM_CLASS }, formatLabel(b)),
                react_index_js_.createElement("td", { className: SHORTCUT_TABLE_ITEM_CLASS }, formatKeys([...b.keys]))))));
            bindingTable.push(react_index_js_.createElement("tr", { className: SHORTCUT_TABLE_LAST_ROW_CLASS, key: `group-${d}-last` }));
        }
    }
    const body = (react_index_js_.createElement("table", null,
        react_index_js_.createElement("tbody", null, bindingTable)));
    return (0,lib_index_js_.showDialog)({
        title: trans.__('Keyboard Shortcuts'),
        body,
        buttons: [
            lib_index_js_.Dialog.cancelButton({
                label: trans.__('Close')
            })
        ]
    });
}
//# sourceMappingURL=shortcuts.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module apputils-extension
 */






















/**
 * The interval in milliseconds before recover options appear during splash.
 */
const SPLASH_RECOVER_TIMEOUT = 12000;
/**
 * The command IDs used by the apputils plugin.
 */
var lib_CommandIDs;
(function (CommandIDs) {
    CommandIDs.loadState = 'apputils:load-statedb';
    CommandIDs.print = 'apputils:print';
    CommandIDs.reset = 'apputils:reset';
    CommandIDs.resetOnLoad = 'apputils:reset-on-load';
    CommandIDs.runFirstEnabled = 'apputils:run-first-enabled';
    CommandIDs.runAllEnabled = 'apputils:run-all-enabled';
    CommandIDs.toggleHeader = 'apputils:toggle-header';
    CommandIDs.displayShortcuts = 'apputils:display-shortcuts';
})(lib_CommandIDs || (lib_CommandIDs = {}));
/**
 * The default command palette extension.
 */
const palette = {
    id: '@jupyterlab/apputils-extension:palette',
    description: 'Provides the command palette.',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator],
    provides: lib_index_js_.ICommandPalette,
    optional: [settingregistry_lib_index_js_.ISettingRegistry],
    activate: (app, translator, settingRegistry) => {
        return Palette.activate(app, translator, settingRegistry);
    }
};
/**
 * The default command palette's restoration extension.
 *
 * #### Notes
 * The command palette's restoration logic is handled separately from the
 * command palette provider extension because the layout restorer dependency
 * causes the command palette to be unavailable to other extensions earlier
 * in the application load cycle.
 */
const paletteRestorer = {
    id: '@jupyterlab/apputils-extension:palette-restorer',
    description: 'Restores the command palette.',
    autoStart: true,
    requires: [index_js_.ILayoutRestorer, translation_lib_index_js_.ITranslator],
    activate: (app, restorer, translator) => {
        Palette.restore(app, restorer, translator);
    }
};
/**
 * The default window name resolver provider.
 */
const resolver = {
    id: '@jupyterlab/apputils-extension:resolver',
    description: 'Provides the window name resolver.',
    autoStart: true,
    provides: lib_index_js_.IWindowResolver,
    requires: [index_js_.JupyterFrontEnd.IPaths, index_js_.IRouter],
    activate: async (app, paths, router) => {
        const { hash, search } = router.current;
        const query = coreutils_lib_index_js_.URLExt.queryStringToObject(search || '');
        const solver = new lib_index_js_.WindowResolver();
        const workspace = coreutils_lib_index_js_.PageConfig.getOption('workspace');
        const treePath = coreutils_lib_index_js_.PageConfig.getOption('treePath');
        const mode = coreutils_lib_index_js_.PageConfig.getOption('mode') === 'multiple-document' ? 'lab' : 'doc';
        // This is used as a key in local storage to refer to workspaces, either the name
        // of the workspace or the string PageConfig.defaultWorkspace. Both lab and doc modes share the same workspace.
        const candidate = workspace ? workspace : coreutils_lib_index_js_.PageConfig.defaultWorkspace;
        const rest = treePath ? coreutils_lib_index_js_.URLExt.join('tree', treePath) : '';
        try {
            await solver.resolve(candidate);
            return solver;
        }
        catch (error) {
            // Window resolution has failed so the URL must change. Return a promise
            // that never resolves to prevent the application from loading plugins
            // that rely on `IWindowResolver`.
            return new Promise(() => {
                const { base } = paths.urls;
                const pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
                const random = pool[Math.floor(Math.random() * pool.length)];
                let path = coreutils_lib_index_js_.URLExt.join(base, mode, 'workspaces', `auto-${random}`);
                path = rest ? coreutils_lib_index_js_.URLExt.join(path, coreutils_lib_index_js_.URLExt.encodeParts(rest)) : path;
                // Reset the workspace on load.
                query['reset'] = '';
                const url = path + coreutils_lib_index_js_.URLExt.objectToQueryString(query) + (hash || '');
                router.navigate(url, { hard: true });
            });
        }
    }
};
/**
 * The default splash screen provider.
 */
const splash = {
    id: '@jupyterlab/apputils-extension:splash',
    description: 'Provides the splash screen.',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator],
    provides: lib_index_js_.ISplashScreen,
    activate: (app, translator) => {
        const trans = translator.load('jupyterlab');
        const { commands, restored } = app;
        // Create splash element and populate it.
        const splash = document.createElement('div');
        const galaxy = document.createElement('div');
        const logo = document.createElement('div');
        splash.id = 'jupyterlab-splash';
        galaxy.id = 'galaxy';
        logo.id = 'main-logo';
        ui_components_lib_index_js_.jupyterFaviconIcon.element({
            container: logo,
            stylesheet: 'splash'
        });
        galaxy.appendChild(logo);
        ['1', '2', '3'].forEach(id => {
            const moon = document.createElement('div');
            const planet = document.createElement('div');
            moon.id = `moon${id}`;
            moon.className = 'moon orbit';
            planet.id = `planet${id}`;
            planet.className = 'planet';
            moon.appendChild(planet);
            galaxy.appendChild(moon);
        });
        splash.appendChild(galaxy);
        // Create debounced recovery dialog function.
        let dialog;
        const recovery = new dist_index_es6_js_.Throttler(async () => {
            if (dialog) {
                return;
            }
            dialog = new lib_index_js_.Dialog({
                title: trans.__('Loading…'),
                body: trans.__(`The loading screen is taking a long time.
Would you like to clear the workspace or keep waiting?`),
                buttons: [
                    lib_index_js_.Dialog.cancelButton({ label: trans.__('Keep Waiting') }),
                    lib_index_js_.Dialog.warnButton({ label: trans.__('Clear Workspace') })
                ]
            });
            try {
                const result = await dialog.launch();
                dialog.dispose();
                dialog = null;
                if (result.button.accept && commands.hasCommand(lib_CommandIDs.reset)) {
                    return commands.execute(lib_CommandIDs.reset);
                }
                // Re-invoke the recovery timer in the next frame.
                requestAnimationFrame(() => {
                    // Because recovery can be stopped, handle invocation rejection.
                    void recovery.invoke().catch(_ => undefined);
                });
            }
            catch (error) {
                /* no-op */
            }
        }, { limit: SPLASH_RECOVER_TIMEOUT, edge: 'trailing' });
        // Return ISplashScreen.
        let splashCount = 0;
        return {
            show: (light = true) => {
                splash.classList.remove('splash-fade');
                splash.classList.toggle('light', light);
                splash.classList.toggle('dark', !light);
                splashCount++;
                document.body.appendChild(splash);
                // Because recovery can be stopped, handle invocation rejection.
                void recovery.invoke().catch(_ => undefined);
                return new index_es6_js_.DisposableDelegate(async () => {
                    await restored;
                    if (--splashCount === 0) {
                        void recovery.stop();
                        if (dialog) {
                            dialog.dispose();
                            dialog = null;
                        }
                        splash.classList.add('splash-fade');
                        window.setTimeout(() => {
                            document.body.removeChild(splash);
                        }, 200);
                    }
                });
            }
        };
    }
};
const print = {
    id: '@jupyterlab/apputils-extension:print',
    description: 'Add the print capability',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator],
    activate: (app, translator) => {
        var _a;
        const trans = translator.load('jupyterlab');
        app.commands.addCommand(lib_CommandIDs.print, {
            label: trans.__('Print…'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isEnabled: () => {
                const widget = app.shell.currentWidget;
                return lib_index_js_.Printing.getPrintFunction(widget) !== null;
            },
            execute: async () => {
                const widget = app.shell.currentWidget;
                const printFunction = lib_index_js_.Printing.getPrintFunction(widget);
                if (printFunction) {
                    await printFunction();
                }
            }
        });
        (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {
            app.commands.notifyCommandChanged(lib_CommandIDs.print);
        });
    }
};
const toggleHeader = {
    id: '@jupyterlab/apputils-extension:toggle-header',
    description: 'Adds a command to display the main area widget content header.',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ICommandPalette],
    activate: (app, translator, palette) => {
        var _a;
        const trans = translator.load('jupyterlab');
        const category = trans.__('Main Area');
        app.commands.addCommand(lib_CommandIDs.toggleHeader, {
            label: trans.__('Show Header Above Content'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            isEnabled: () => app.shell.currentWidget instanceof lib_index_js_.MainAreaWidget &&
                !app.shell.currentWidget.contentHeader.isDisposed &&
                app.shell.currentWidget.contentHeader.widgets.length > 0,
            isToggled: () => {
                const widget = app.shell.currentWidget;
                return widget instanceof lib_index_js_.MainAreaWidget
                    ? !widget.contentHeader.isHidden
                    : false;
            },
            execute: async () => {
                const widget = app.shell.currentWidget;
                if (widget instanceof lib_index_js_.MainAreaWidget) {
                    widget.contentHeader.setHidden(!widget.contentHeader.isHidden);
                }
            }
        });
        (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {
            app.commands.notifyCommandChanged(lib_CommandIDs.toggleHeader);
        });
        if (palette) {
            palette.addItem({ command: lib_CommandIDs.toggleHeader, category });
        }
    }
};
/**
 * Update the browser title based on the workspace and the current
 * active item.
 */
async function updateTabTitle(options) {
    var _a, _b;
    const { workspace, db, name, currentWidget } = options;
    const data = await db.toJSON();
    let current = (_b = (_a = data['layout-restorer:data']) === null || _a === void 0 ? void 0 : _a.main) === null || _b === void 0 ? void 0 : _b.current;
    if (current === undefined ||
        !(current.startsWith('notebook') || current.startsWith('editor'))) {
        document.title = `${coreutils_lib_index_js_.PageConfig.getOption('appName') || 'JupyterLab'}${workspace === 'default' ? '' : ` (${workspace})`}`;
    }
    else {
        let currentFile;
        // If we have a DocumentWidget, use its context.path for more reliable file name
        // rather than parsing the URL which may not always reflect the actual file,
        // may be missing, or may be formatted in a different way in other lab-based
        // applications (for example with a query string parameter such as ?path=example.ipynb)
        if (currentWidget instanceof docregistry_lib_index_js_.DocumentWidget) {
            currentFile = coreutils_lib_index_js_.PathExt.basename(currentWidget.context.path);
        }
        else {
            // File name from current path
            currentFile = coreutils_lib_index_js_.PathExt.basename(decodeURIComponent(window.location.href));
        }
        // Truncate to first 12 characters of current document name + ... if length > 15
        currentFile =
            currentFile.length > 15
                ? currentFile.slice(0, 12).concat(`…`)
                : currentFile;
        const truncatedWorkspace = workspace.length > 15 ? workspace.slice(0, 12).concat(`…`) : workspace;
        // Number of restorable items that are either notebooks or editors
        const count = Object.keys(data).filter(item => item.startsWith('notebook') || item.startsWith('editor')).length;
        document.title = `${currentFile}${count > 1 ? ` (${count})` : ``} - ${workspace === 'default' ? name : truncatedWorkspace}`;
    }
}
/**
 * The default state database for storing application state.
 *
 * #### Notes
 * If this extension is loaded with a window resolver, it will automatically add
 * state management commands, URL support for `clone` and `reset`, and workspace
 * auto-saving. Otherwise, it will return a simple in-memory state database.
 */
const state = {
    id: '@jupyterlab/apputils-extension:state',
    description: 'Provides the application state. It is stored per workspaces.',
    autoStart: true,
    provides: statedb_lib_index_js_.IStateDB,
    requires: [index_js_.JupyterFrontEnd.IPaths, index_js_.IRouter, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.IWindowResolver],
    activate: (app, paths, router, translator, resolver) => {
        const trans = translator.load('jupyterlab');
        if (resolver === null) {
            return new statedb_lib_index_js_.StateDB();
        }
        let resolved = false;
        const { commands, name, serviceManager } = app;
        const { workspaces } = serviceManager;
        const workspace = resolver.name;
        const transform = new dist_index_js_.PromiseDelegate();
        const db = new statedb_lib_index_js_.StateDB({ transform: transform.promise });
        const save = new dist_index_es6_js_.Debouncer(async () => {
            const id = workspace;
            const metadata = { id };
            const data = await db.toJSON();
            await workspaces.save(id, { data, metadata });
        });
        // Any time the local state database changes, save the workspace.
        db.changed.connect(() => void save.invoke(), db);
        db.changed.connect(() => {
            var _a;
            return updateTabTitle({
                workspace,
                db,
                name,
                currentWidget: (_a = app.shell.currentWidget) !== null && _a !== void 0 ? _a : undefined
            });
        });
        commands.addCommand(lib_CommandIDs.loadState, {
            label: trans.__('Load state for the current workspace.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        hash: {
                            type: 'string',
                            description: trans.__('The URL hash')
                        },
                        path: {
                            type: 'string',
                            description: trans.__('The URL path')
                        },
                        search: {
                            type: 'string',
                            description: trans.__('The URL search string containing query parameters')
                        }
                    }
                }
            },
            execute: async (args) => {
                // Since the command can be executed an arbitrary number of times, make
                // sure it is safe to call multiple times.
                if (resolved) {
                    return;
                }
                const { hash, path, search } = args;
                const query = coreutils_lib_index_js_.URLExt.queryStringToObject(search || '');
                const clone = typeof query['clone'] === 'string'
                    ? query['clone'] === ''
                        ? coreutils_lib_index_js_.PageConfig.defaultWorkspace
                        : query['clone']
                    : null;
                const source = clone || workspace || null;
                if (source === null) {
                    console.error(`${lib_CommandIDs.loadState} cannot load null workspace.`);
                    return;
                }
                try {
                    const saved = await workspaces.fetch(source);
                    // If this command is called after a reset, the state database
                    // will already be resolved.
                    if (!resolved) {
                        resolved = true;
                        transform.resolve({ type: 'overwrite', contents: saved.data });
                    }
                }
                catch ({ message }) {
                    console.warn(`Fetching workspace "${workspace}" failed.`, message);
                    // If the workspace does not exist, cancel the data transformation
                    // and save a workspace with the current user state data.
                    if (!resolved) {
                        resolved = true;
                        transform.resolve({ type: 'cancel', contents: null });
                    }
                }
                if (source === clone) {
                    // Maintain the query string parameters but remove `clone`.
                    delete query['clone'];
                    const url = path + coreutils_lib_index_js_.URLExt.objectToQueryString(query) + hash;
                    const cloned = save.invoke().then(() => router.stop);
                    // After the state has been cloned, navigate to the URL.
                    void cloned.then(() => {
                        router.navigate(url);
                    });
                    return cloned;
                }
                // After the state database has finished loading, save it.
                await save.invoke();
            }
        });
        commands.addCommand(lib_CommandIDs.reset, {
            label: trans.__('Reset Application State'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        reload: {
                            type: 'boolean',
                            description: trans.__('Whether to reload the page after resetting')
                        }
                    }
                }
            },
            execute: async ({ reload }) => {
                await db.clear();
                await save.invoke();
                if (reload) {
                    router.reload();
                }
            }
        });
        commands.addCommand(lib_CommandIDs.resetOnLoad, {
            label: trans.__('Reset state when loading for the workspace.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        hash: {
                            type: 'string',
                            description: trans.__('The URL hash')
                        },
                        path: {
                            type: 'string',
                            description: trans.__('The URL path')
                        },
                        search: {
                            type: 'string',
                            description: trans.__('The URL search string containing query parameters')
                        }
                    }
                }
            },
            execute: (args) => {
                const { hash, path, search } = args;
                const query = coreutils_lib_index_js_.URLExt.queryStringToObject(search || '');
                const reset = 'reset' in query;
                const clone = 'clone' in query;
                if (!reset) {
                    return;
                }
                // If the state database has already been resolved, resetting is
                // impossible without reloading.
                if (resolved) {
                    return router.reload();
                }
                // Empty the state database.
                resolved = true;
                transform.resolve({ type: 'clear', contents: null });
                // Maintain the query string parameters but remove `reset`.
                delete query['reset'];
                const url = path + coreutils_lib_index_js_.URLExt.objectToQueryString(query) + hash;
                const cleared = db.clear().then(() => save.invoke());
                // After the state has been reset, navigate to the URL.
                if (clone) {
                    void cleared.then(() => {
                        router.navigate(url, { hard: true });
                    });
                }
                else {
                    void cleared.then(() => {
                        router.navigate(url);
                    });
                }
                return cleared;
            }
        });
        router.register({
            command: lib_CommandIDs.loadState,
            pattern: /.?/,
            rank: 30 // High priority: 30:100.
        });
        router.register({
            command: lib_CommandIDs.resetOnLoad,
            pattern: /(\?reset|\&reset)($|&)/,
            rank: 20 // High priority: 20:100.
        });
        return db;
    }
};
/**
 * The default session context dialogs extension.
 */
const sessionDialogs = {
    id: '@jupyterlab/apputils-extension:sessionDialogs',
    description: 'Provides the session context dialogs.',
    provides: lib_index_js_.ISessionContextDialogs,
    optional: [translation_lib_index_js_.ITranslator, settingregistry_lib_index_js_.ISettingRegistry],
    autoStart: true,
    activate: async (app, translator, settingRegistry) => {
        return new lib_index_js_.SessionContextDialogs({
            translator: translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator,
            settingRegistry: settingRegistry !== null && settingRegistry !== void 0 ? settingRegistry : null
        });
    }
};
/**
 * Utility commands
 */
const utilityCommands = {
    id: '@jupyterlab/apputils-extension:utilityCommands',
    description: 'Adds meta commands to run set of other commands.',
    requires: [translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ICommandPalette],
    autoStart: true,
    activate: (app, translator, palette) => {
        const trans = translator.load('jupyterlab');
        const { commands } = app;
        commands.addCommand(lib_CommandIDs.runFirstEnabled, {
            label: trans.__('Run First Enabled Command'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        commands: {
                            type: 'array',
                            items: {
                                type: 'string'
                            },
                            description: trans.__('Array of command IDs to attempt to run')
                        },
                        args: {
                            description: trans.__('Arguments to pass to the commands')
                        }
                    },
                    required: ['commands']
                }
            },
            execute: args => {
                const commands = args.commands;
                const commandArgs = args.args;
                const argList = Array.isArray(args);
                for (let i = 0; i < commands.length; i++) {
                    const cmd = commands[i];
                    const arg = argList ? commandArgs[i] : commandArgs;
                    if (app.commands.isEnabled(cmd, arg)) {
                        return app.commands.execute(cmd, arg);
                    }
                }
            }
        });
        // Add a command for taking lists of commands and command arguments
        // and running all the enabled commands.
        commands.addCommand(lib_CommandIDs.runAllEnabled, {
            label: trans.__('Run All Enabled Commands Passed as Args'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        commands: {
                            type: 'array',
                            items: {
                                type: 'string'
                            },
                            description: trans.__('Array of command IDs to run')
                        },
                        args: {
                            description: trans.__('Arguments to pass to the commands')
                        },
                        errorIfNotEnabled: {
                            type: 'boolean',
                            description: trans.__('Whether to log an error if a command is not enabled')
                        }
                    }
                }
            },
            execute: async (args) => {
                var _a, _b;
                const commands = (_a = args.commands) !== null && _a !== void 0 ? _a : [];
                const commandArgs = args.args;
                const argList = Array.isArray(args);
                const errorIfNotEnabled = (_b = args.errorIfNotEnabled) !== null && _b !== void 0 ? _b : false;
                for (let i = 0; i < commands.length; i++) {
                    const cmd = commands[i];
                    const arg = argList ? commandArgs[i] : commandArgs;
                    if (app.commands.isEnabled(cmd, arg)) {
                        await app.commands.execute(cmd, arg);
                    }
                    else {
                        if (errorIfNotEnabled) {
                            console.error(`${cmd} is not enabled.`);
                        }
                    }
                }
            },
            isEnabled: args => {
                var _a;
                const commands = (_a = args.commands) !== null && _a !== void 0 ? _a : [];
                const commandArgs = args.args;
                const argList = Array.isArray(args);
                return commands.some((cmd, idx) => app.commands.isEnabled(cmd, argList ? commandArgs[idx] : commandArgs));
            }
        });
        commands.addCommand(lib_CommandIDs.displayShortcuts, {
            label: trans.__('Show Keyboard Shortcuts…'),
            caption: trans.__('Show relevant keyboard shortcuts for the current active widget'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: args => {
                var _a;
                const currentWidget = app.shell.currentWidget;
                const included = currentWidget === null || currentWidget === void 0 ? void 0 : currentWidget.node.contains(document.activeElement);
                if (!included && currentWidget instanceof lib_index_js_.MainAreaWidget) {
                    const currentNode = (_a = currentWidget.content.node) !== null && _a !== void 0 ? _a : currentWidget === null || currentWidget === void 0 ? void 0 : currentWidget.node;
                    currentNode === null || currentNode === void 0 ? void 0 : currentNode.focus();
                }
                const options = { commands, trans };
                return displayShortcuts(options);
            }
        });
        if (palette) {
            const category = trans.__('Help');
            palette.addItem({ command: lib_CommandIDs.displayShortcuts, category });
        }
    }
};
/**
 * The default HTML sanitizer.
 */
const sanitizer = {
    id: '@jupyterlab/apputils-extension:sanitizer',
    description: 'Provides the HTML sanitizer.',
    autoStart: true,
    provides: lib_index_js_.ISanitizer,
    requires: [settingregistry_lib_index_js_.ISettingRegistry],
    activate: (app, settings) => {
        const sanitizer = new lib_index_js_.Sanitizer();
        const loadSetting = (setting) => {
            const allowedSchemes = setting.get('allowedSchemes')
                .composite;
            const autolink = setting.get('autolink').composite;
            const allowNamedProperties = setting.get('allowNamedProperties')
                .composite;
            if (allowedSchemes) {
                sanitizer.setAllowedSchemes(allowedSchemes);
            }
            sanitizer.setAutolink(autolink);
            sanitizer.setAllowNamedProperties(allowNamedProperties);
        };
        // Wait for the application to be restored and
        // for the settings for this plugin to be loaded
        settings
            .load('@jupyterlab/apputils-extension:sanitizer')
            .then(setting => {
            // Read the settings
            loadSetting(setting);
            // Listen for your plugin setting changes using Signal
            setting.changed.connect(loadSetting);
        })
            .catch(reason => {
            console.error(`Failed to load sanitizer settings:`, reason);
        });
        return sanitizer;
    }
};
/*
 * A plugin owning the kernel settings
 */
const kernelSettings = {
    id: '@jupyterlab/apputils-extension:kernels-settings',
    description: 'Reserves the name for kernel settings.',
    autoStart: true,
    requires: [settingregistry_lib_index_js_.ISettingRegistry],
    activate: (_app, settingRegistry) => {
        void settingRegistry.load(kernelSettings.id);
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    kernelSettings,
    announcements,
    kernelStatus,
    licensesClient,
    licensesPlugin,
    notificationPlugin,
    palette,
    paletteRestorer,
    print,
    resolver,
    runningSessionsStatus,
    subshellsSettings,
    sanitizer,
    settingsConnector,
    settingsPlugin,
    state,
    splash,
    sessionDialogs,
    themesPlugin,
    themesPaletteMenuPlugin,
    toggleHeader,
    toolbarRegistry,
    utilityCommands,
    workspacesPlugin
];
/* harmony default export */ const lib = (plugins);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 82649:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js + 1 modules
var statusbar_style = __webpack_require__(546);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/mainmenu/style/index.js
var mainmenu_style = __webpack_require__(70022);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/apputils-extension/style/base.css
var base = __webpack_require__(92606);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */











/***/ }),

/***/ 13296:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  Clipboard: () => (/* reexport */ Clipboard),
  Collapse: () => (/* reexport */ index_js_.Collapser),
  CommandLinker: () => (/* reexport */ CommandLinker),
  CommandToolbarButton: () => (/* reexport */ index_js_.CommandToolbarButton),
  CommandToolbarButtonComponent: () => (/* reexport */ index_js_.CommandToolbarButtonComponent),
  DOMUtils: () => (/* reexport */ DOMUtils),
  Dialog: () => (/* reexport */ Dialog),
  HoverBox: () => (/* reexport */ index_js_.HoverBox),
  ICommandPalette: () => (/* reexport */ ICommandPalette),
  IFrame: () => (/* reexport */ index_js_.IFrame),
  IKernelStatusModel: () => (/* reexport */ IKernelStatusModel),
  ILicensesClient: () => (/* reexport */ ILicensesClient),
  ISanitizer: () => (/* reexport */ ISanitizer),
  ISessionContextDialogs: () => (/* reexport */ ISessionContextDialogs),
  ISplashScreen: () => (/* reexport */ ISplashScreen),
  IThemeManager: () => (/* reexport */ IThemeManager),
  IToolbarWidgetRegistry: () => (/* reexport */ IToolbarWidgetRegistry),
  IWindowResolver: () => (/* reexport */ IWindowResolver),
  InputDialog: () => (/* reexport */ InputDialog),
  KernelStatus: () => (/* reexport */ KernelStatus),
  Licenses: () => (/* reexport */ Licenses),
  MainAreaWidget: () => (/* reexport */ MainAreaWidget),
  MenuFactory: () => (/* reexport */ MenuFactory),
  ModalCommandPalette: () => (/* reexport */ ModalCommandPalette),
  Notification: () => (/* reexport */ Notification),
  NotificationManager: () => (/* reexport */ NotificationManager),
  Printing: () => (/* reexport */ Printing),
  ReactWidget: () => (/* reexport */ index_js_.ReactWidget),
  RunningSessions: () => (/* reexport */ RunningSessions),
  Sanitizer: () => (/* reexport */ Sanitizer),
  SemanticCommand: () => (/* reexport */ SemanticCommand),
  SessionContext: () => (/* reexport */ SessionContext),
  SessionContextDialogs: () => (/* reexport */ SessionContextDialogs),
  Spinner: () => (/* reexport */ index_js_.Spinner),
  Styling: () => (/* reexport */ index_js_.Styling),
  SystemClipboard: () => (/* reexport */ SystemClipboard),
  ThemeManager: () => (/* reexport */ ThemeManager),
  Toolbar: () => (/* binding */ Toolbar),
  ToolbarButton: () => (/* reexport */ index_js_.ToolbarButton),
  ToolbarButtonComponent: () => (/* reexport */ index_js_.ToolbarButtonComponent),
  ToolbarWidgetRegistry: () => (/* reexport */ ToolbarWidgetRegistry),
  UseSignal: () => (/* reexport */ index_js_.UseSignal),
  VDomModel: () => (/* reexport */ index_js_.VDomModel),
  VDomRenderer: () => (/* reexport */ index_js_.VDomRenderer),
  WidgetTracker: () => (/* reexport */ WidgetTracker),
  WindowResolver: () => (/* reexport */ WindowResolver),
  addCommandToolbarButtonClass: () => (/* reexport */ index_js_.addCommandToolbarButtonClass),
  addToolbarButtonClass: () => (/* reexport */ index_js_.addToolbarButtonClass),
  createDefaultFactory: () => (/* reexport */ createDefaultFactory),
  createToolbarFactory: () => (/* reexport */ createToolbarFactory),
  setToolbar: () => (/* reexport */ setToolbar),
  showDialog: () => (/* reexport */ showDialog),
  showErrorMessage: () => (/* reexport */ showErrorMessage),
  translateKernelStatuses: () => (/* reexport */ translateKernelStatuses)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var signaling_dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/widgettracker.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A class that keeps track of widget instances on an Application shell.
 *
 * @typeparam T - The type of widget being tracked. Defaults to `Widget`.
 *
 * #### Notes
 * The API surface area of this concrete implementation is substantially larger
 * than the widget tracker interface it implements. The interface is intended
 * for export by JupyterLab plugins that create widgets and have clients who may
 * wish to keep track of newly created widgets. This class, however, can be used
 * internally by plugins to restore state as well.
 */
class WidgetTracker {
    /**
     * Create a new widget tracker.
     *
     * @param options - The instantiation options for a widget tracker.
     */
    constructor(options) {
        this._currentChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._deferred = null;
        this._isDisposed = false;
        this._widgetAdded = new signaling_dist_index_es6_js_.Signal(this);
        this._widgetUpdated = new signaling_dist_index_es6_js_.Signal(this);
        const focus = (this._focusTracker = new index_es6_js_.FocusTracker());
        const pool = (this._pool = new statedb_lib_index_js_.RestorablePool(options));
        this.namespace = options.namespace;
        focus.currentChanged.connect((_, current) => {
            if (current.newValue !== this.currentWidget) {
                pool.current = current.newValue;
            }
        }, this);
        pool.added.connect((_, widget) => {
            this._widgetAdded.emit(widget);
        }, this);
        pool.currentChanged.connect((_, widget) => {
            // If the pool's current reference is `null` but the focus tracker has a
            // current widget, update the pool to match the focus tracker.
            if (widget === null && focus.currentWidget) {
                pool.current = focus.currentWidget;
                return;
            }
            this.onCurrentChanged(widget);
            this._currentChanged.emit(widget);
        }, this);
        pool.updated.connect((_, widget) => {
            this._widgetUpdated.emit(widget);
        }, this);
    }
    /**
     * A signal emitted when the current widget changes.
     */
    get currentChanged() {
        return this._currentChanged;
    }
    /**
     * The current widget is the most recently focused or added widget.
     *
     * #### Notes
     * It is the most recently focused widget, or the most recently added
     * widget if no widget has taken focus.
     */
    get currentWidget() {
        return this._pool.current || null;
    }
    /**
     * A promise resolved when the tracker has been restored.
     */
    get restored() {
        if (this._deferred) {
            return Promise.resolve();
        }
        else {
            return this._pool.restored;
        }
    }
    /**
     * The number of widgets held by the tracker.
     */
    get size() {
        return this._pool.size;
    }
    /**
     * A signal emitted when a widget is added.
     *
     * #### Notes
     * This signal will only fire when a widget is added to the tracker. It will
     * not fire if a widget is injected into the tracker.
     */
    get widgetAdded() {
        return this._widgetAdded;
    }
    /**
     * A signal emitted when a widget is updated.
     */
    get widgetUpdated() {
        return this._widgetUpdated;
    }
    /**
     * Add a new widget to the tracker.
     *
     * @param widget - The widget being added.
     *
     * #### Notes
     * The widget passed into the tracker is added synchronously; its existence in
     * the tracker can be checked with the `has()` method. The promise this method
     * returns resolves after the widget has been added and saved to an underlying
     * restoration connector, if one is available.
     *
     * The newly added widget becomes the current widget unless the focus tracker
     * already had a focused widget.
     */
    async add(widget) {
        this._focusTracker.add(widget);
        await this._pool.add(widget);
        if (!this._focusTracker.activeWidget) {
            this._pool.current = widget;
        }
    }
    /**
     * Test whether the tracker is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the tracker.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._pool.dispose();
        this._focusTracker.dispose();
        signaling_dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Find the first widget in the tracker that satisfies a filter function.
     *
     * @param fn The filter function to call on each widget.
     *
     * #### Notes
     * If no widget is found, the value returned is `undefined`.
     */
    find(fn) {
        return this._pool.find(fn);
    }
    /**
     * Iterate through each widget in the tracker.
     *
     * @param fn - The function to call on each widget.
     */
    forEach(fn) {
        return this._pool.forEach(fn);
    }
    /**
     * Filter the widgets in the tracker based on a predicate.
     *
     * @param fn - The function by which to filter.
     */
    filter(fn) {
        return this._pool.filter(fn);
    }
    /**
     * Inject a foreign widget into the widget tracker.
     *
     * @param widget - The widget to inject into the tracker.
     *
     * #### Notes
     * Injected widgets will not have their state saved by the tracker.
     *
     * The primary use case for widget injection is for a plugin that offers a
     * sub-class of an extant plugin to have its instances share the same commands
     * as the parent plugin (since most relevant commands will use the
     * `currentWidget` of the parent plugin's widget tracker). In this situation,
     * the sub-class plugin may well have its own widget tracker for layout and
     * state restoration in addition to injecting its widgets into the parent
     * plugin's widget tracker.
     */
    inject(widget) {
        return this._pool.inject(widget);
    }
    /**
     * Check if this tracker has the specified widget.
     *
     * @param widget - The widget whose existence is being checked.
     */
    has(widget) {
        return this._pool.has(widget);
    }
    /**
     * Restore the widgets in this tracker's namespace.
     *
     * @param options - The configuration options that describe restoration.
     *
     * @returns A promise that resolves when restoration has completed.
     *
     * #### Notes
     * This function should not typically be invoked by client code.
     * Its primary use case is to be invoked by a restorer.
     */
    async restore(options) {
        const deferred = this._deferred;
        if (deferred) {
            this._deferred = null;
            return this._pool.restore(deferred);
        }
        if (options) {
            return this._pool.restore(options);
        }
        console.warn('No options provided to restore the tracker.');
    }
    /**
     * Save the restore options for this tracker, but do not restore yet.
     *
     * @param options - The configuration options that describe restoration.
     *
     * ### Notes
     * This function is useful when starting the shell in 'single-document' mode,
     * to avoid restoring all useless widgets. It should not ordinarily be called
     * by client code.
     */
    defer(options) {
        this._deferred = options;
    }
    /**
     * Save the restore data for a given widget.
     *
     * @param widget - The widget being saved.
     */
    async save(widget) {
        return this._pool.save(widget);
    }
    /**
     * Handle the current change event.
     *
     * #### Notes
     * The default implementation is a no-op.
     */
    onCurrentChanged(value) {
        /* no-op */
    }
}
//# sourceMappingURL=widgettracker.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/dialog.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * Create and show a dialog.
 *
 * @param options - The dialog setup options.
 *
 * @returns A promise that resolves with whether the dialog was accepted.
 */
function showDialog(options = {}) {
    const dialog = new Dialog(options);
    return dialog.launch();
}
/**
 * Show an error message dialog.
 *
 * @param title - The title of the dialog box.
 *
 * @param error - the error to show in the dialog body (either a string
 *   or an object with a string `message` property).
 */
function showErrorMessage(title, error, buttons) {
    const trans = Dialog.translator.load('jupyterlab');
    buttons = buttons !== null && buttons !== void 0 ? buttons : [Dialog.cancelButton({ label: trans.__('Close') })];
    console.warn('Showing error:', error);
    // Cache promises to prevent multiple copies of identical dialogs showing
    // to the user.
    const body = typeof error === 'string' ? error : error.message;
    const key = title + '----' + body;
    const promise = Private.errorMessagePromiseCache.get(key);
    if (promise) {
        return promise;
    }
    else {
        const dialogPromise = showDialog({
            title: title,
            body: body,
            buttons: buttons
        }).then(() => {
            Private.errorMessagePromiseCache.delete(key);
        }, error => {
            // TODO: Use .finally() above when supported
            Private.errorMessagePromiseCache.delete(key);
            throw error;
        });
        Private.errorMessagePromiseCache.set(key, dialogPromise);
        return dialogPromise;
    }
}
/**
 * A modal dialog widget.
 */
class Dialog extends index_es6_js_.Widget {
    /**
     * Create a dialog panel instance.
     *
     * @param options - The dialog setup options.
     */
    constructor(options = {}) {
        const dialogNode = document.createElement('dialog');
        dialogNode.ariaModal = 'true';
        super({ node: dialogNode });
        this._hasValidationErrors = false;
        this._ready = new dist_index_js_.PromiseDelegate();
        this._focusNodeSelector = '';
        this.addClass('jp-Dialog');
        this.addClass('jp-ThemedContainer');
        const normalized = Private.handleOptions(options);
        const renderer = normalized.renderer;
        this._host = normalized.host;
        this._defaultButton = normalized.defaultButton;
        this._buttons = normalized.buttons;
        this._hasClose = normalized.hasClose;
        this._buttonNodes = this._buttons.map(b => renderer.createButtonNode(b));
        this._checkboxNode = null;
        this._lastMouseDownInDialog = false;
        if (normalized.checkbox) {
            const { label = '', caption = '', checked = false, className = '' } = normalized.checkbox;
            this._checkboxNode = renderer.createCheckboxNode({
                label,
                caption: caption !== null && caption !== void 0 ? caption : label,
                checked,
                className
            });
        }
        const layout = (this.layout = new index_es6_js_.PanelLayout());
        const content = new index_es6_js_.Panel();
        content.addClass('jp-Dialog-content');
        if (typeof options.body === 'string') {
            content.addClass('jp-Dialog-content-small');
            dialogNode.ariaLabel = [normalized.title, options.body].join(' ');
        }
        layout.addWidget(content);
        this._body = normalized.body;
        const header = renderer.createHeader(normalized.title, () => this.reject(), options);
        const body = renderer.createBody(normalized.body);
        const footer = renderer.createFooter(this._buttonNodes, this._checkboxNode);
        content.addWidget(header);
        content.addWidget(body);
        content.addWidget(footer);
        this._bodyWidget = body;
        this._primary = this._buttonNodes[this._defaultButton];
        this._focusNodeSelector = options.focusNodeSelector;
        // Add new dialogs to the tracker.
        void Dialog.tracker.add(this);
    }
    /**
     * A promise that resolves when the Dialog first rendering is done.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Dispose of the resources used by the dialog.
     */
    dispose() {
        const promise = this._promise;
        if (promise) {
            this._promise = null;
            promise.reject(void 0);
            dist_index_es6_js_.ArrayExt.removeFirstOf(Private.launchQueue, promise.promise);
        }
        super.dispose();
    }
    /**
     * Launch the dialog as a modal window.
     *
     * @returns a promise that resolves with the result of the dialog.
     */
    launch() {
        // Return the existing dialog if already open.
        if (this._promise) {
            return this._promise.promise;
        }
        const promise = (this._promise = new dist_index_js_.PromiseDelegate());
        const promises = Promise.all(Private.launchQueue);
        Private.launchQueue.push(this._promise.promise);
        return promises.then(() => {
            // Do not show Dialog if it was disposed of before it was at the front of the launch queue
            if (!this._promise) {
                return Promise.resolve({
                    button: Dialog.cancelButton(),
                    isChecked: null,
                    value: null
                });
            }
            index_es6_js_.Widget.attach(this, this._host);
            return promise.promise;
        });
    }
    /**
     * Resolve the current dialog.
     *
     * @param index - An optional index to the button to resolve.
     *
     * #### Notes
     * Will default to the defaultIndex.
     * Will resolve the current `show()` with the button value.
     * Will be a no-op if the dialog is not shown.
     */
    resolve(index) {
        if (!this._promise) {
            return;
        }
        if (index === undefined) {
            index = this._defaultButton;
        }
        this._resolve(this._buttons[index]);
    }
    /**
     * Reject the current dialog with a default reject value.
     *
     * #### Notes
     * Will be a no-op if the dialog is not shown.
     */
    reject() {
        if (!this._promise) {
            return;
        }
        this._resolve(Dialog.cancelButton());
    }
    /**
     * Handle the DOM events for the directory listing.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'keydown':
                this._evtKeydown(event);
                break;
            case 'mousedown':
                this._evtMouseDown(event);
                break;
            case 'click':
                this._evtClick(event);
                break;
            case 'input':
                this._evtInput(event);
                break;
            case 'focus':
                this._evtFocus(event);
                break;
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
            default:
                break;
        }
    }
    /**
     *  A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        const node = this.node;
        node.addEventListener('keydown', this, true);
        node.addEventListener('contextmenu', this, true);
        node.addEventListener('click', this, true);
        document.addEventListener('mousedown', this, true);
        document.addEventListener('focus', this, true);
        document.addEventListener('input', this, true);
        this._first = Private.findFirstFocusable(this.node);
        this._original = document.activeElement;
        const setFocus = () => {
            var _a;
            if (this._focusNodeSelector) {
                const body = this.node.querySelector('.jp-Dialog-body');
                const el = body === null || body === void 0 ? void 0 : body.querySelector(this._focusNodeSelector);
                if (el) {
                    this._primary = el;
                }
            }
            (_a = this._primary) === null || _a === void 0 ? void 0 : _a.focus();
            this._ready.resolve();
        };
        if (this._bodyWidget instanceof index_js_.ReactWidget &&
            this._bodyWidget.renderPromise !== undefined) {
            this._bodyWidget
                .renderPromise.then(() => {
                setFocus();
            })
                .catch(() => {
                console.error("Error while loading Dialog's body");
            });
        }
        else {
            setFocus();
        }
    }
    /**
     *  A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        const node = this.node;
        node.removeEventListener('keydown', this, true);
        node.removeEventListener('contextmenu', this, true);
        node.removeEventListener('click', this, true);
        document.removeEventListener('focus', this, true);
        document.removeEventListener('mousedown', this, true);
        document.removeEventListener('input', this, true);
        this._original.focus();
    }
    /**
     * A message handler invoked on a `'close-request'` message.
     */
    onCloseRequest(msg) {
        if (this._promise) {
            this.reject();
        }
        super.onCloseRequest(msg);
    }
    /**
     * Handle the `'input'` event for dialog's children.
     *
     * @param event - The DOM event sent to the widget
     */
    _evtInput(_event) {
        this._hasValidationErrors = !!this.node.querySelector(':invalid');
        for (let i = 0; i < this._buttons.length; i++) {
            if (this._buttons[i].accept) {
                this._buttonNodes[i].disabled = this._hasValidationErrors;
            }
        }
    }
    /**
     * Handle the `'click'` event for a dialog button.
     *
     * @param event - The DOM event sent to the widget
     */
    _evtClick(event) {
        const content = this.node.getElementsByClassName('jp-Dialog-content')[0];
        if (!content.contains(event.target)) {
            event.stopPropagation();
            event.preventDefault();
            if (this._hasClose && !this._lastMouseDownInDialog) {
                this.reject();
            }
            return;
        }
        for (const buttonNode of this._buttonNodes) {
            if (buttonNode.contains(event.target)) {
                const index = this._buttonNodes.indexOf(buttonNode);
                this.resolve(index);
            }
        }
    }
    /**
     * Handle the `'keydown'` event for the widget.
     *
     * @param event - The DOM event sent to the widget
     */
    _evtKeydown(event) {
        // Check for escape key
        switch (event.keyCode) {
            case 27: // Escape.
                event.stopPropagation();
                event.preventDefault();
                if (this._hasClose) {
                    this.reject();
                }
                break;
            case 37: {
                // Left arrow
                const activeEl = document.activeElement;
                if (activeEl instanceof HTMLButtonElement) {
                    let idx = this._buttonNodes.indexOf(activeEl) - 1;
                    // Handle a left arrows on the first button
                    if (idx < 0) {
                        idx = this._buttonNodes.length - 1;
                    }
                    const node = this._buttonNodes[idx];
                    event.stopPropagation();
                    event.preventDefault();
                    node.focus();
                }
                break;
            }
            case 39: {
                // Right arrow
                const activeEl = document.activeElement;
                if (activeEl instanceof HTMLButtonElement) {
                    let idx = this._buttonNodes.indexOf(activeEl) + 1;
                    // Handle a right arrows on the last button
                    if (idx == this._buttons.length) {
                        idx = 0;
                    }
                    const node = this._buttonNodes[idx];
                    event.stopPropagation();
                    event.preventDefault();
                    node.focus();
                }
                break;
            }
            case 9: {
                // Tab.
                // Handle a tab on the last button.
                const node = this._buttonNodes[this._buttons.length - 1];
                if (document.activeElement === node && !event.shiftKey) {
                    event.stopPropagation();
                    event.preventDefault();
                    this._first.focus();
                }
                break;
            }
            case 13: {
                // Enter.
                event.stopPropagation();
                event.preventDefault();
                const activeEl = document.activeElement;
                if (activeEl instanceof HTMLButtonElement) {
                    const index = this._buttonNodes.indexOf(activeEl);
                    if (index !== -1) {
                        this.resolve(index);
                    }
                }
                else if (!(activeEl instanceof HTMLTextAreaElement)) {
                    const index = this._defaultButton;
                    this.resolve(index);
                }
                break;
            }
            default:
                break;
        }
    }
    /**
     * Handle the `'focus'` event for the widget.
     *
     * @param event - The DOM event sent to the widget
     */
    _evtFocus(event) {
        var _a;
        const target = event.target;
        if (!this.node.contains(target)) {
            event.stopPropagation();
            (_a = this._buttonNodes[this._defaultButton]) === null || _a === void 0 ? void 0 : _a.focus();
        }
    }
    /**
     * Handle the `'mousedown'` event for the widget.
     *
     * @param event - The DOM event sent to the widget
     */
    _evtMouseDown(event) {
        const content = this.node.getElementsByClassName('jp-Dialog-content')[0];
        const target = event.target;
        this._lastMouseDownInDialog = content.contains(target);
    }
    /**
     * Resolve a button item.
     */
    _resolve(button) {
        var _a, _b, _c;
        if (this._hasValidationErrors && button.accept) {
            // Do not allow accepting with validation errors
            return;
        }
        // Prevent loopback.
        const promise = this._promise;
        if (!promise) {
            this.dispose();
            return;
        }
        this._promise = null;
        dist_index_es6_js_.ArrayExt.removeFirstOf(Private.launchQueue, promise.promise);
        const body = this._body;
        let value = null;
        if (button.accept &&
            body instanceof index_es6_js_.Widget &&
            typeof body.getValue === 'function') {
            value = body.getValue();
        }
        this.dispose();
        promise.resolve({
            button,
            isChecked: (_c = (_b = (_a = this._checkboxNode) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.checked) !== null && _c !== void 0 ? _c : null,
            value
        });
    }
}
/**
 * The namespace for Dialog class statics.
 */
(function (Dialog) {
    /**
     * Translator object.
     */
    Dialog.translator = lib_index_js_.nullTranslator;
    /**
     * Create a button item.
     */
    function createButton(value) {
        value.accept = value.accept !== false;
        const trans = Dialog.translator.load('jupyterlab');
        const defaultLabel = value.accept ? trans.__('Ok') : trans.__('Cancel');
        return {
            ariaLabel: value.ariaLabel || value.label || defaultLabel,
            label: value.label || defaultLabel,
            iconClass: value.iconClass || '',
            iconLabel: value.iconLabel || '',
            caption: value.caption || '',
            className: value.className || '',
            accept: value.accept,
            actions: value.actions || [],
            displayType: value.displayType || 'default'
        };
    }
    Dialog.createButton = createButton;
    /**
     * Create a reject button.
     */
    function cancelButton(options = {}) {
        options.accept = false;
        return createButton(options);
    }
    Dialog.cancelButton = cancelButton;
    /**
     * Create an accept button.
     */
    function okButton(options = {}) {
        options.accept = true;
        return createButton(options);
    }
    Dialog.okButton = okButton;
    /**
     * Create a warn button.
     */
    function warnButton(options = {}) {
        options.displayType = 'warn';
        return createButton(options);
    }
    Dialog.warnButton = warnButton;
    /**
     * Disposes all dialog instances.
     *
     * #### Notes
     * This function should only be used in tests or cases where application state
     * may be discarded.
     */
    function flush() {
        Dialog.tracker.forEach(dialog => {
            dialog.dispose();
        });
    }
    Dialog.flush = flush;
    /**
     * The default implementation of a dialog renderer.
     */
    class Renderer {
        /**
         * Create the header of the dialog.
         *
         * @param title - The title of the dialog.
         *
         * @returns A widget for the dialog header.
         */
        createHeader(title, reject = () => {
            /* empty */
        }, options = {}) {
            let header;
            const handleMouseDown = (event) => {
                // Fire action only when left button is pressed.
                if (event.button === 0) {
                    event.preventDefault();
                    reject();
                }
            };
            const handleKeyDown = (event) => {
                const { key } = event;
                if (key === 'Enter' || key === ' ') {
                    reject();
                }
            };
            if (typeof title === 'string') {
                const trans = Dialog.translator.load('jupyterlab');
                header = index_js_.ReactWidget.create(react_index_js_.createElement(react_index_js_.Fragment, null,
                    title,
                    options.hasClose && (react_index_js_.createElement(index_js_.Button, { className: "jp-Dialog-close-button", onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, title: trans.__('Cancel'), minimal: true },
                        react_index_js_.createElement(index_js_.LabIcon.resolveReact, { icon: index_js_.closeIcon, tag: "span" })))));
            }
            else {
                header = index_js_.ReactWidget.create(title);
            }
            header.addClass('jp-Dialog-header');
            index_js_.Styling.styleNode(header.node);
            return header;
        }
        /**
         * Create the body of the dialog.
         *
         * @param value - The input value for the body.
         *
         * @returns A widget for the body.
         */
        createBody(value) {
            const styleReactWidget = (widget) => {
                if (widget.renderPromise !== undefined) {
                    widget.renderPromise
                        .then(() => {
                        index_js_.Styling.styleNode(widget.node);
                    })
                        .catch(() => {
                        console.error("Error while loading Dialog's body");
                    });
                }
                else {
                    index_js_.Styling.styleNode(widget.node);
                }
            };
            let body;
            if (typeof value === 'string') {
                body = new index_es6_js_.Widget({ node: document.createElement('span') });
                body.node.textContent = value;
            }
            else if (value instanceof index_es6_js_.Widget) {
                body = value;
                if (body instanceof index_js_.ReactWidget) {
                    styleReactWidget(body);
                }
                else {
                    index_js_.Styling.styleNode(body.node);
                }
            }
            else {
                body = index_js_.ReactWidget.create(value);
                // Immediately update the body even though it has not yet attached in
                // order to trigger a render of the DOM nodes from the React element.
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(body, index_es6_js_.Widget.Msg.UpdateRequest);
                styleReactWidget(body);
            }
            body.addClass('jp-Dialog-body');
            return body;
        }
        /**
         * Create the footer of the dialog.
         *
         * @param buttons - The buttons nodes to add to the footer.
         * @param checkbox - The checkbox node to add to the footer.
         *
         * @returns A widget for the footer.
         */
        createFooter(buttons, checkbox) {
            const footer = new index_es6_js_.Widget();
            footer.addClass('jp-Dialog-footer');
            if (checkbox) {
                footer.node.appendChild(checkbox);
                footer.node.insertAdjacentHTML('beforeend', '<div class="jp-Dialog-spacer"></div>');
            }
            const footerButton = document.createElement('div');
            footerButton.classList.add('jp-Dialog-footerButtons');
            for (const button of buttons) {
                footerButton.appendChild(button);
            }
            footer.node.appendChild(footerButton);
            index_js_.Styling.styleNode(footer.node);
            return footer;
        }
        /**
         * Create a button node for the dialog.
         *
         * @param button - The button data.
         *
         * @returns A node for the button.
         */
        createButtonNode(button) {
            const e = document.createElement('button');
            e.className = this.createItemClass(button);
            e.appendChild(this.renderIcon(button));
            e.appendChild(this.renderLabel(button));
            return e;
        }
        /**
         * Create a checkbox node for the dialog.
         *
         * @param checkbox - The checkbox data.
         *
         * @returns A node for the checkbox.
         */
        createCheckboxNode(checkbox) {
            const e = document.createElement('label');
            e.className = 'jp-Dialog-checkbox';
            if (checkbox.className) {
                e.classList.add(checkbox.className);
            }
            e.title = checkbox.caption;
            e.textContent = checkbox.label;
            const input = document.createElement('input');
            input.type = 'checkbox';
            input.checked = !!checkbox.checked;
            e.insertAdjacentElement('afterbegin', input);
            return e;
        }
        /**
         * Create the class name for the button.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the button.
         */
        createItemClass(data) {
            // Setup the initial class name.
            let name = 'jp-Dialog-button';
            // Add the other state classes.
            if (data.accept) {
                name += ' jp-mod-accept';
            }
            else {
                name += ' jp-mod-reject';
            }
            if (data.displayType === 'warn') {
                name += ' jp-mod-warn';
            }
            // Add the extra class.
            const extra = data.className;
            if (extra) {
                name += ` ${extra}`;
            }
            // Return the complete class name.
            return name;
        }
        /**
         * Render an icon element for a dialog item.
         *
         * @param data - The data to use for rendering the icon.
         *
         * @returns An HTML element representing the icon.
         */
        renderIcon(data) {
            const e = document.createElement('div');
            e.className = this.createIconClass(data);
            e.appendChild(document.createTextNode(data.iconLabel));
            return e;
        }
        /**
         * Create the class name for the button icon.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the item icon.
         */
        createIconClass(data) {
            const name = 'jp-Dialog-buttonIcon';
            const extra = data.iconClass;
            return extra ? `${name} ${extra}` : name;
        }
        /**
         * Render the label element for a button.
         *
         * @param data - The data to use for rendering the label.
         *
         * @returns An HTML element representing the item label.
         */
        renderLabel(data) {
            const e = document.createElement('div');
            e.className = 'jp-Dialog-buttonLabel';
            e.title = data.caption;
            e.ariaLabel = data.ariaLabel;
            e.appendChild(document.createTextNode(data.label));
            return e;
        }
    }
    Dialog.Renderer = Renderer;
    /**
     * The default renderer instance.
     */
    Dialog.defaultRenderer = new Renderer();
    /**
     * The dialog widget tracker.
     */
    Dialog.tracker = new WidgetTracker({
        namespace: '@jupyterlab/apputils:Dialog'
    });
})(Dialog || (Dialog = {}));
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * The queue for launching dialogs.
     */
    Private.launchQueue = [];
    Private.errorMessagePromiseCache = new Map();
    /**
     * Handle the input options for a dialog.
     *
     * @param options - The input options.
     *
     * @returns A new options object with defaults applied.
     */
    function handleOptions(options = {}) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j;
        const buttons = (_a = options.buttons) !== null && _a !== void 0 ? _a : [
            Dialog.cancelButton(),
            Dialog.okButton()
        ];
        return {
            title: (_b = options.title) !== null && _b !== void 0 ? _b : '',
            body: (_c = options.body) !== null && _c !== void 0 ? _c : '',
            host: (_d = options.host) !== null && _d !== void 0 ? _d : document.body,
            checkbox: (_e = options.checkbox) !== null && _e !== void 0 ? _e : null,
            buttons,
            defaultButton: (_f = options.defaultButton) !== null && _f !== void 0 ? _f : buttons.length - 1,
            renderer: (_g = options.renderer) !== null && _g !== void 0 ? _g : Dialog.defaultRenderer,
            focusNodeSelector: (_h = options.focusNodeSelector) !== null && _h !== void 0 ? _h : '',
            hasClose: (_j = options.hasClose) !== null && _j !== void 0 ? _j : true
        };
    }
    Private.handleOptions = handleOptions;
    /**
     *  Find the first focusable item in the dialog.
     */
    function findFirstFocusable(node) {
        const candidateSelectors = [
            'input',
            'select',
            'a[href]',
            'textarea',
            'button',
            '[tabindex]'
        ].join(',');
        return node.querySelectorAll(candidateSelectors)[0];
    }
    Private.findFirstFocusable = findFirstFocusable;
})(Private || (Private = {}));
//# sourceMappingURL=dialog.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/sessioncontext.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The default implementation for a session context object.
 */
class SessionContext {
    /**
     * Construct a new session context.
     */
    constructor(options) {
        var _a, _b, _c, _d;
        this._path = '';
        this._name = '';
        this._type = '';
        this._prevKernelName = '';
        this._isDisposed = false;
        this._disposed = new signaling_dist_index_es6_js_.Signal(this);
        this._session = null;
        this._ready = new dist_index_js_.PromiseDelegate();
        this._initializing = false;
        this._initStarted = new dist_index_js_.PromiseDelegate();
        this._initPromise = new dist_index_js_.PromiseDelegate();
        this._isReady = false;
        this._isTerminating = false;
        this._isRestarting = false;
        this._kernelChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._preferenceChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._sessionChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._statusChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._connectionStatusChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._pendingInput = false;
        this._iopubMessage = new signaling_dist_index_es6_js_.Signal(this);
        this._unhandledMessage = new signaling_dist_index_es6_js_.Signal(this);
        this._propertyChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._dialog = null;
        this._busyDisposable = null;
        this._pendingKernelName = '';
        this._pendingSessionRequest = '';
        this.kernelManager = options.kernelManager;
        this.sessionManager = options.sessionManager;
        this.specsManager = options.specsManager;
        this.translator = options.translator || lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._path = (_a = options.path) !== null && _a !== void 0 ? _a : dist_index_js_.UUID.uuid4();
        this._type = (_b = options.type) !== null && _b !== void 0 ? _b : '';
        this._name = (_c = options.name) !== null && _c !== void 0 ? _c : '';
        this._setBusy = options.setBusy;
        this._kernelPreference = (_d = options.kernelPreference) !== null && _d !== void 0 ? _d : {};
    }
    /**
     * The current session connection.
     */
    get session() {
        var _a;
        return (_a = this._session) !== null && _a !== void 0 ? _a : null;
    }
    /**
     * The session path.
     *
     * #### Notes
     * Typically `.session.path` should be used. This attribute is useful if
     * there is no current session.
     */
    get path() {
        return this._path;
    }
    /**
     * The session type.
     *
     * #### Notes
     * Typically `.session.type` should be used. This attribute is useful if
     * there is no current session.
     */
    get type() {
        return this._type;
    }
    /**
     * The session name.
     *
     * #### Notes
     * Typically `.session.name` should be used. This attribute is useful if
     * there is no current session.
     */
    get name() {
        return this._name;
    }
    /**
     * A signal emitted when the kernel connection changes, proxied from the session connection.
     */
    get kernelChanged() {
        return this._kernelChanged;
    }
    /**
     * A signal emitted when the session connection changes.
     */
    get sessionChanged() {
        return this._sessionChanged;
    }
    /**
     * A signal emitted when the kernel status changes, proxied from the kernel.
     */
    get statusChanged() {
        return this._statusChanged;
    }
    /**
     * A flag indicating if the session has pending input, proxied from the kernel.
     */
    get pendingInput() {
        return this._pendingInput;
    }
    /**
     * A signal emitted when the kernel status changes, proxied from the kernel.
     */
    get connectionStatusChanged() {
        return this._connectionStatusChanged;
    }
    /**
     * A signal emitted for iopub kernel messages, proxied from the kernel.
     */
    get iopubMessage() {
        return this._iopubMessage;
    }
    /**
     * A signal emitted for an unhandled kernel message, proxied from the kernel.
     */
    get unhandledMessage() {
        return this._unhandledMessage;
    }
    /**
     * A signal emitted when a session property changes, proxied from the current session.
     */
    get propertyChanged() {
        return this._propertyChanged;
    }
    /**
     * The kernel preference of this client session.
     *
     * This is used when selecting a new kernel, and should reflect the sort of
     * kernel the activity prefers.
     */
    get kernelPreference() {
        return this._kernelPreference;
    }
    set kernelPreference(value) {
        if (!dist_index_js_.JSONExt.deepEqual(value, this._kernelPreference)) {
            const oldValue = this._kernelPreference;
            this._kernelPreference = value;
            this._preferenceChanged.emit({
                name: 'kernelPreference',
                oldValue,
                newValue: dist_index_js_.JSONExt.deepCopy(value)
            });
        }
    }
    /**
     * Signal emitted if the kernel preference changes.
     */
    get kernelPreferenceChanged() {
        return this._preferenceChanged;
    }
    /**
     * Whether the context is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that is fulfilled when the context is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Whether the context is terminating.
     */
    get isTerminating() {
        return this._isTerminating;
    }
    /**
     * Whether the context is restarting.
     */
    get isRestarting() {
        return this._isRestarting;
    }
    /**
     * Whether the kernel is "No Kernel" or not.
     *
     * #### Notes
     * As the displayed name is translated, this can be used directly.
     */
    get hasNoKernel() {
        return this.kernelDisplayName === this.noKernelName;
    }
    /**
     * The display name of the current kernel, or a sensible alternative.
     *
     * #### Notes
     * This is a convenience function to have a consistent sensible name for the
     * kernel.
     */
    get kernelDisplayName() {
        var _a, _b, _c, _d, _e, _f, _g;
        const kernel = (_a = this.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (this._pendingKernelName === this.noKernelName) {
            return this.noKernelName;
        }
        if (this._pendingKernelName) {
            return ((_d = (_c = (_b = this.specsManager.specs) === null || _b === void 0 ? void 0 : _b.kernelspecs[this._pendingKernelName]) === null || _c === void 0 ? void 0 : _c.display_name) !== null && _d !== void 0 ? _d : this._pendingKernelName);
        }
        if (!kernel) {
            return this.noKernelName;
        }
        return ((_g = (_f = (_e = this.specsManager.specs) === null || _e === void 0 ? void 0 : _e.kernelspecs[kernel.name]) === null || _f === void 0 ? void 0 : _f.display_name) !== null && _g !== void 0 ? _g : kernel.name);
    }
    /**
     * A sensible status to display
     *
     * #### Notes
     * This combines the status and connection status into a single status for
     * the user.
     */
    get kernelDisplayStatus() {
        var _a, _b;
        const kernel = (_a = this.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (this._isTerminating) {
            return 'terminating';
        }
        if (this._isRestarting) {
            return 'restarting';
        }
        if (this._pendingKernelName === this.noKernelName) {
            return 'unknown';
        }
        if (!kernel && this._pendingKernelName) {
            return 'initializing';
        }
        if (!kernel &&
            !this.isReady &&
            this.kernelPreference.canStart !== false &&
            this.kernelPreference.shouldStart !== false) {
            return 'initializing';
        }
        return ((_b = ((kernel === null || kernel === void 0 ? void 0 : kernel.connectionStatus) === 'connected'
            ? kernel === null || kernel === void 0 ? void 0 : kernel.status
            : kernel === null || kernel === void 0 ? void 0 : kernel.connectionStatus)) !== null && _b !== void 0 ? _b : 'unknown');
    }
    /**
     * The name of the previously started kernel.
     */
    get prevKernelName() {
        return this._prevKernelName;
    }
    /**
     * Test whether the context is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * A signal emitted when the poll is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Get the constant displayed name for "No Kernel"
     */
    get noKernelName() {
        return this._trans.__('No Kernel');
    }
    /**
     * Dispose of the resources held by the context.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._disposed.emit();
        if (this._session) {
            if (this.kernelPreference.shutdownOnDispose) {
                // Fire and forget the session shutdown request
                this.sessionManager.shutdown(this._session.id).catch(reason => {
                    console.error(`Kernel not shut down ${reason}`);
                });
            }
            // Dispose the session connection
            this._session.dispose();
            this._session = null;
        }
        if (this._dialog) {
            this._dialog.dispose();
        }
        if (this._busyDisposable) {
            this._busyDisposable.dispose();
            this._busyDisposable = null;
        }
        signaling_dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Starts new Kernel.
     *
     * @returns Whether to ask the user to pick a kernel.
     */
    async startKernel() {
        const preference = this.kernelPreference;
        if (!preference.autoStartDefault && preference.shouldStart === false) {
            return true;
        }
        let options;
        if (preference.id) {
            options = { id: preference.id };
        }
        else {
            const name = sessioncontext_Private.getDefaultKernel({
                specs: this.specsManager.specs,
                sessions: this.sessionManager.running(),
                preference
            });
            if (name) {
                options = { name };
            }
        }
        if (options) {
            try {
                await this._changeKernel(options);
                return false;
            }
            catch (err) {
                /* no-op */
            }
        }
        // Always fall back to selecting a kernel
        return true;
    }
    /**
     * Restart the current Kernel.
     *
     * @returns A promise that resolves when the kernel is restarted.
     */
    async restartKernel() {
        var _a, _b, _c, _d, _e, _f;
        const kernel = ((_a = this.session) === null || _a === void 0 ? void 0 : _a.kernel) || null;
        if (this._isRestarting) {
            return;
        }
        this._isRestarting = true;
        this._isReady = false;
        this._statusChanged.emit('restarting');
        try {
            await ((_c = (_b = this.session) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.restart());
            this._isReady = true;
        }
        catch (e) {
            console.error(e);
        }
        this._isRestarting = false;
        this._statusChanged.emit(((_e = (_d = this.session) === null || _d === void 0 ? void 0 : _d.kernel) === null || _e === void 0 ? void 0 : _e.status) || 'unknown');
        this._kernelChanged.emit({
            name: 'kernel',
            oldValue: kernel,
            newValue: ((_f = this.session) === null || _f === void 0 ? void 0 : _f.kernel) || null
        });
    }
    /**
     * Change the current kernel associated with the session.
     */
    async changeKernel(options = {}) {
        if (this.isDisposed) {
            throw new Error('Disposed');
        }
        // Wait for the initialization method to try
        // and start its kernel first to ensure consistent
        // ordering.
        await this._initStarted.promise;
        return this._changeKernel(options);
    }
    /**
     * Kill the kernel and shutdown the session.
     *
     * @returns A promise that resolves when the session is shut down.
     */
    async shutdown() {
        if (this.isDisposed || !this._initializing) {
            return;
        }
        await this._initStarted.promise;
        this._pendingSessionRequest = '';
        this._pendingKernelName = this.noKernelName;
        return this._shutdownSession();
    }
    /**
     * Initialize the session context
     *
     * @returns A promise that resolves with whether to ask the user to select a kernel.
     *
     * #### Notes
     * If a server session exists on the current path, we will connect to it.
     * If preferences include disabling `canStart` or `shouldStart`, no
     * server session will be started.
     * If a kernel id is given, we attempt to start a session with that id.
     * If a default kernel is available, we connect to it.
     * Otherwise we ask the user to select a kernel.
     */
    async initialize() {
        if (this._initializing) {
            return this._initPromise.promise;
        }
        this._initializing = true;
        const needsSelection = await this._initialize();
        if (!needsSelection) {
            this._isReady = true;
            this._ready.resolve(undefined);
        }
        if (!this._pendingSessionRequest) {
            this._initStarted.resolve(void 0);
        }
        this._initPromise.resolve(needsSelection);
        return needsSelection;
    }
    /**
     * Inner initialize function that doesn't handle promises.
     * This makes it easier to consolidate promise handling logic.
     */
    async _initialize() {
        const manager = this.sessionManager;
        await manager.ready;
        await manager.refreshRunning();
        const model = (0,dist_index_es6_js_.find)(manager.running(), item => {
            return item.path === this._path;
        });
        if (model) {
            try {
                const session = manager.connectTo({ model });
                this._handleNewSession(session);
            }
            catch (err) {
                void this._handleSessionError(err);
                return Promise.reject(err);
            }
        }
        return await this._startIfNecessary();
    }
    /**
     * Shut down the current session.
     */
    async _shutdownSession() {
        var _a;
        const session = this._session;
        // Capture starting values in case an error is raised.
        const isTerminating = this._isTerminating;
        const isReady = this._isReady;
        this._isTerminating = true;
        this._isReady = false;
        this._statusChanged.emit('terminating');
        try {
            await (session === null || session === void 0 ? void 0 : session.shutdown());
            this._isTerminating = false;
            session === null || session === void 0 ? void 0 : session.dispose();
            this._session = null;
            const kernel = (session === null || session === void 0 ? void 0 : session.kernel) || null;
            this._statusChanged.emit('unknown');
            this._kernelChanged.emit({
                name: 'kernel',
                oldValue: kernel,
                newValue: null
            });
            this._sessionChanged.emit({
                name: 'session',
                oldValue: session,
                newValue: null
            });
        }
        catch (err) {
            this._isTerminating = isTerminating;
            this._isReady = isReady;
            const status = (_a = session === null || session === void 0 ? void 0 : session.kernel) === null || _a === void 0 ? void 0 : _a.status;
            if (status === undefined) {
                this._statusChanged.emit('unknown');
            }
            else {
                this._statusChanged.emit(status);
            }
            throw err;
        }
        return;
    }
    /**
     * Start the session if necessary.
     *
     * @returns Whether to ask the user to pick a kernel.
     */
    async _startIfNecessary() {
        var _a;
        const preference = this.kernelPreference;
        if (this.isDisposed ||
            ((_a = this.session) === null || _a === void 0 ? void 0 : _a.kernel) ||
            preference.shouldStart === false ||
            preference.canStart === false) {
            // Not necessary to start a kernel
            return false;
        }
        return this.startKernel();
    }
    /**
     * Change the kernel.
     */
    async _changeKernel(model = {}) {
        if (model.name) {
            this._pendingKernelName = model.name;
        }
        if (!this._session) {
            this._kernelChanged.emit({
                name: 'kernel',
                oldValue: null,
                newValue: null
            });
        }
        // Guarantee that the initialized kernel
        // will be started first.
        if (!this._pendingSessionRequest) {
            this._initStarted.resolve(void 0);
        }
        // If we already have a session, just change the kernel.
        if (this._session && !this._isTerminating) {
            try {
                await this._session.changeKernel(model);
                return this._session.kernel;
            }
            catch (err) {
                void this._handleSessionError(err);
                throw err;
            }
        }
        // Use a UUID for the path to overcome a race condition on the server
        // where it will re-use a session for a given path but only after
        // the kernel finishes starting.
        // We later switch to the real path below.
        // Use the correct directory so the kernel will be started in that directory.
        const dirName = coreutils_lib_index_js_.PathExt.dirname(this._path);
        const requestId = (this._pendingSessionRequest = coreutils_lib_index_js_.PathExt.join(dirName, dist_index_js_.UUID.uuid4()));
        try {
            this._statusChanged.emit('starting');
            const session = await this.sessionManager.startNew({
                path: requestId,
                type: this._type,
                name: this._name,
                kernel: model
            });
            // Handle a preempt.
            if (this._pendingSessionRequest !== session.path) {
                await session.shutdown();
                session.dispose();
                return null;
            }
            // Change to the real path.
            await session.setPath(this._path);
            // Update the name in case it has changed since we launched the session.
            await session.setName(this._name);
            if (this._session && !this._isTerminating) {
                await this._shutdownSession();
            }
            return this._handleNewSession(session);
        }
        catch (err) {
            void this._handleSessionError(err);
            throw err;
        }
    }
    /**
     * Handle a new session object.
     */
    _handleNewSession(session) {
        var _a, _b, _c;
        if (this.isDisposed) {
            throw Error('Disposed');
        }
        if (!this._isReady) {
            this._isReady = true;
            this._ready.resolve(undefined);
        }
        if (this._session) {
            this._session.dispose();
        }
        this._session = session;
        this._pendingKernelName = '';
        if (session) {
            this._prevKernelName = (_b = (_a = session.kernel) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';
            session.disposed.connect(this._onSessionDisposed, this);
            session.propertyChanged.connect(this._onPropertyChanged, this);
            session.kernelChanged.connect(this._onKernelChanged, this);
            session.statusChanged.connect(this._onStatusChanged, this);
            session.connectionStatusChanged.connect(this._onConnectionStatusChanged, this);
            session.pendingInput.connect(this._onPendingInput, this);
            session.iopubMessage.connect(this._onIopubMessage, this);
            session.unhandledMessage.connect(this._onUnhandledMessage, this);
            if (session.path !== this._path) {
                this._onPropertyChanged(session, 'path');
            }
            if (session.name !== this._name) {
                this._onPropertyChanged(session, 'name');
            }
            if (session.type !== this._type) {
                this._onPropertyChanged(session, 'type');
            }
        }
        // Any existing session/kernel connection was disposed above when the session was
        // disposed, so the oldValue should be null.
        this._sessionChanged.emit({
            name: 'session',
            oldValue: null,
            newValue: session
        });
        this._kernelChanged.emit({
            oldValue: null,
            newValue: (session === null || session === void 0 ? void 0 : session.kernel) || null,
            name: 'kernel'
        });
        this._statusChanged.emit(((_c = session === null || session === void 0 ? void 0 : session.kernel) === null || _c === void 0 ? void 0 : _c.status) || 'unknown');
        return (session === null || session === void 0 ? void 0 : session.kernel) || null;
    }
    /**
     * Handle an error in session startup.
     */
    async _handleSessionError(err) {
        this._handleNewSession(null);
        let traceback = '';
        let message = '';
        try {
            traceback = err.traceback;
            message = err.message;
        }
        catch (err) {
            // no-op
        }
        await this._displayKernelError(message, traceback);
    }
    /**
     * Display kernel error
     */
    async _displayKernelError(message, traceback) {
        const body = (react_index_js_.createElement("div", null,
            message && react_index_js_.createElement("pre", null, message),
            traceback && (react_index_js_.createElement("details", { className: "jp-mod-wide" },
                react_index_js_.createElement("pre", null, traceback)))));
        const dialog = (this._dialog = new Dialog({
            title: this._trans.__('Error Starting Kernel'),
            body,
            buttons: [Dialog.okButton()]
        }));
        await dialog.launch();
        this._dialog = null;
    }
    /**
     * Handle a session termination.
     */
    _onSessionDisposed() {
        if (this._session) {
            const oldValue = this._session;
            this._session = null;
            const newValue = this._session;
            this._sessionChanged.emit({ name: 'session', oldValue, newValue });
        }
    }
    /**
     * Handle a change to a session property.
     */
    _onPropertyChanged(sender, property) {
        switch (property) {
            case 'path':
                this._path = sender.path;
                break;
            case 'name':
                this._name = sender.name;
                break;
            case 'type':
                this._type = sender.type;
                break;
            default:
                throw new Error(`unrecognized property ${property}`);
        }
        this._propertyChanged.emit(property);
    }
    /**
     * Handle a change to the kernel.
     */
    _onKernelChanged(sender, args) {
        this._kernelChanged.emit(args);
    }
    /**
     * Handle a change to the session status.
     */
    _onStatusChanged(sender, status) {
        var _a;
        if (status === 'dead') {
            const model = (_a = sender.kernel) === null || _a === void 0 ? void 0 : _a.model;
            if (model === null || model === void 0 ? void 0 : model.reason) {
                const traceback = model.traceback || '';
                void this._displayKernelError(model.reason, traceback);
            }
        }
        // Set that this kernel is busy, if we haven't already
        // If we have already, and now we aren't busy, dispose
        // of the busy disposable.
        if (this._setBusy) {
            if (status === 'busy') {
                if (!this._busyDisposable) {
                    this._busyDisposable = this._setBusy();
                }
            }
            else {
                if (this._busyDisposable) {
                    this._busyDisposable.dispose();
                    this._busyDisposable = null;
                }
            }
        }
        // Proxy the signal
        this._statusChanged.emit(status);
    }
    /**
     * Handle a change to the session status.
     */
    _onConnectionStatusChanged(sender, status) {
        // Proxy the signal
        this._connectionStatusChanged.emit(status);
    }
    /**
     * Handle a change to the pending input.
     */
    _onPendingInput(sender, value) {
        // Set the signal value
        this._pendingInput = value;
    }
    /**
     * Handle an iopub message.
     */
    _onIopubMessage(sender, message) {
        if (message.header.msg_type === 'shutdown_reply') {
            this.session.kernel.removeInputGuard();
        }
        this._iopubMessage.emit(message);
    }
    /**
     * Handle an unhandled message.
     */
    _onUnhandledMessage(sender, message) {
        this._unhandledMessage.emit(message);
    }
}
/**
 * A namespace for `SessionContext` statics.
 */
(function (SessionContext) {
    /**
     * Get the default kernel name given select options.
     */
    function getDefaultKernel(options) {
        const { preference } = options;
        const { shouldStart } = preference;
        if (shouldStart === false) {
            return null;
        }
        return sessioncontext_Private.getDefaultKernel(options);
    }
    SessionContext.getDefaultKernel = getDefaultKernel;
})(SessionContext || (SessionContext = {}));
/**
 * The default implementation of the client session dialog provider.
 */
class SessionContextDialogs {
    constructor(options = {}) {
        var _a;
        this._translator = (_a = options.translator) !== null && _a !== void 0 ? _a : lib_index_js_.nullTranslator;
        this._settingRegistry = options.settingRegistry || null;
    }
    /**
     * Select a kernel for the session.
     */
    async selectKernel(sessionContext) {
        if (sessionContext.isDisposed) {
            return Promise.resolve();
        }
        const translator = this._translator;
        const trans = translator.load('jupyterlab');
        // If there is no existing kernel, offer the option to keep no kernel.
        let label = trans.__('Cancel');
        if (sessionContext.hasNoKernel) {
            label = sessionContext.kernelDisplayName;
        }
        const buttons = [
            Dialog.cancelButton({ label }),
            Dialog.okButton({
                label: trans.__('Select'),
                ariaLabel: trans.__('Select Kernel')
            })
        ];
        const autoStartDefault = sessionContext.kernelPreference.autoStartDefault;
        const hasCheckbox = typeof autoStartDefault === 'boolean';
        const dialog = new Dialog({
            title: trans.__('Select Kernel'),
            body: sessioncontext_Private.createKernelSelector(sessionContext, translator),
            buttons,
            checkbox: hasCheckbox
                ? {
                    label: trans.__('Always start the preferred kernel'),
                    caption: trans.__('Remember my choice and always start the preferred kernel'),
                    checked: autoStartDefault
                }
                : null
        });
        const result = await dialog.launch();
        if (sessionContext.isDisposed || !result.button.accept) {
            return;
        }
        if (hasCheckbox && result.isChecked !== null) {
            sessionContext.kernelPreference = {
                ...sessionContext.kernelPreference,
                autoStartDefault: result.isChecked
            };
        }
        const model = result.value;
        if (model === null && !sessionContext.hasNoKernel) {
            return sessionContext.shutdown();
        }
        if (model) {
            await sessionContext.changeKernel(model);
        }
    }
    /**
     * Restart the session.
     *
     * @returns A promise that resolves with whether the kernel has restarted.
     *
     * #### Notes
     * If there is a running kernel, present a dialog.
     * If there is no kernel, we start a kernel with the last run
     * kernel name and resolves with `true`.
     */
    async restart(sessionContext, restartOptions) {
        var _a, _b, _c, _d, _e;
        const trans = this._translator.load('jupyterlab');
        await sessionContext.initialize();
        if (sessionContext.isDisposed) {
            throw new Error('session already disposed');
        }
        const kernel = (_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!kernel && sessionContext.prevKernelName) {
            await sessionContext.changeKernel({
                name: sessionContext.prevKernelName
            });
            return true;
        }
        // Bail if there is no previous kernel to start.
        if (!kernel) {
            throw new Error('No kernel to restart');
        }
        // Skip the dialog and restart the kernel
        const kernelPluginId = '@jupyterlab/apputils-extension:sessionDialogs';
        const skipKernelRestartDialog = (_c = (_b = sessionContext.kernelPreference) === null || _b === void 0 ? void 0 : _b.skipKernelRestartDialog) !== null && _c !== void 0 ? _c : false;
        const skipKernelRestartDialogSetting = (_e = (await ((_d = this._settingRegistry) === null || _d === void 0 ? void 0 : _d.get(kernelPluginId, 'skipKernelRestartDialog')))) === null || _e === void 0 ? void 0 : _e.composite;
        if (skipKernelRestartDialogSetting || skipKernelRestartDialog) {
            await sessionContext.restartKernel();
            return true;
        }
        const restartBtn = Dialog.warnButton({
            label: trans.__('Restart'),
            ariaLabel: trans.__('Confirm Kernel Restart')
        });
        const result = await showDialog({
            title: trans.__('Restart Kernel?'),
            body: trans.__('Do you want to restart the kernel of %1? All variables will be lost.', sessionContext.name),
            buttons: [
                Dialog.cancelButton({ ariaLabel: trans.__('Cancel Kernel Restart') }),
                restartBtn
            ],
            checkbox: {
                label: trans.__('Do not ask me again.'),
                caption: trans.__('If checked, the kernel will restart without confirmation prompt in the future; you can change this back in the settings.')
            }
        });
        if (kernel.isDisposed) {
            return false;
        }
        if (result.button.accept) {
            if (typeof result.isChecked === 'boolean' && result.isChecked == true) {
                sessionContext.kernelPreference = {
                    ...sessionContext.kernelPreference,
                    skipKernelRestartDialog: true
                };
            }
            await (restartOptions === null || restartOptions === void 0 ? void 0 : restartOptions.onBeforeRestart());
            await sessionContext.restartKernel();
            return true;
        }
        return false;
    }
}
(function (SessionContextDialogs) {
    /**
     * Returns available kernel options grouped based on session context.
     *
     * #### Notes
     * If a language preference is set in the given session context, the options
     * returned are grouped with the language preference at the top:
     *
     *  - (Start %1 Kernel, language)
     *    - { all kernelspecs whose language matches in alphabetical order }
     *  - (Use No Kernel)
     *    - `No Kernel`
     *  - (Start Kernel)
     *    - { all other kernelspecs in alphabetical order }
     *  - (Connect to Existing %1 Kernel, language)
     *    - { all running kernels whose language matches in alphabetical order }
     *  - (Connect to Kernel)
     *    - { all other running kernels in alphabetical order }
     *
     * If no language preference is set, these groups and options are returned:
     *
     *  - (Start Kernel)
     *    - { all kernelspecs in alphabetical order }
     *  - (Use No Kernel)
     *    - `No Kernel`
     *  - (Connect to Existing Kernel)
     *    - { all running kernels in alphabetical order  }
     *
     * If the session has a kernel ID and a kernel exists with that id, its
     * corresponding option has `selected` set to `true`. Otherwise if the session
     * context language preference is set, the first kernelspec that matches it is
     * selected.
     */
    function kernelOptions(sessionContext, translator = null) {
        var _a, _b, _c, _d, _e, _f, _g;
        const options = { disabled: false, groups: [] };
        // Create mapping of sessions and kernel ids.
        const kernels = Array.from((_b = (_a = sessionContext.kernelManager) === null || _a === void 0 ? void 0 : _a.running()) !== null && _b !== void 0 ? _b : 
        // If kernel manager is unavailable use kernels from running sessions.
        // TODO: Remove this (next version) when kernel manager is guaranteed.
        Array.from(sessionContext.sessionManager.running())
            .filter(session => !!session.kernel)
            .map(session => session.kernel));
        const sessions = Array.from((_c = sessionContext.sessionManager.running()) !== null && _c !== void 0 ? _c : []).reduce((sessions, session) => {
            var _a;
            if ((_a = session.kernel) === null || _a === void 0 ? void 0 : _a.id)
                sessions[session.kernel.id] = session;
            return sessions;
        }, {});
        const preference = {
            ...sessionContext.kernelPreference,
            id: (_e = (_d = sessionContext.session) === null || _d === void 0 ? void 0 : _d.kernel) === null || _e === void 0 ? void 0 : _e.id
        };
        const currentKernelDisplayName = !sessionContext.hasNoKernel
            ? sessionContext.kernelDisplayName
            : null;
        const specs = {
            default: '',
            kernelspecs: Object.create(null),
            ...sessionContext.specsManager.specs
        };
        // Create mapping of languages and kernel names.
        const sorted = [];
        const languages = Object.create(null);
        for (const name in specs.kernelspecs) {
            sorted.push(specs.kernelspecs[name]);
            languages[name] = specs.kernelspecs[name].language;
        }
        sorted.sort((a, b) => a.display_name.localeCompare(b.display_name));
        translator = translator || lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const language = preference.language ||
            languages[preference.name] ||
            (preference.id ? languages[(_f = sessions[preference.id]) === null || _f === void 0 ? void 0 : _f.name] : '');
        const labels = {
            connectKernel: trans.__('Connect to Existing Kernel'),
            startPreferred: trans.__('Start %1 Kernel', language),
            startOther: trans.__('Start Kernel'),
            connectToPreferred: trans.__('Connect to Existing %1 Kernel', language),
            connectToOther: trans.__('Connect to Other Kernel'),
            noKernel: trans.__('No Kernel'),
            startKernel: trans.__('Start Kernel'),
            useNoKernel: trans.__('Use No Kernel')
        };
        const noKernel = {
            label: labels.useNoKernel,
            options: [
                {
                    text: labels.noKernel,
                    title: labels.noKernel,
                    value: JSON.stringify(null)
                }
            ]
        };
        const optionForKernel = (kernel, displayName, session) => {
            const sessionName = session
                ? session.name || coreutils_lib_index_js_.PathExt.basename(session.path)
                : kernel.name || trans.__('Unknown Kernel');
            return {
                text: `${sessionName} (${kernel.id.split('-')[0]})`,
                title: (session ? `${trans.__('Path: %1', session.path)}\n` : ``) +
                    `${trans.__('Name: %1', sessionName)}\n` +
                    `${trans.__('Kernel Name: %1', displayName !== null && displayName !== void 0 ? displayName : kernel.name)}\n` +
                    `${trans.__('Kernel Id: %1', kernel.id)}`,
                value: JSON.stringify({ id: kernel.id })
            };
        };
        const optionForSpec = (spec) => ({
            text: spec.display_name,
            value: JSON.stringify({ name: spec.name })
        });
        // If a kernel cannot be started, bail.
        if (preference.canStart === false) {
            options.disabled = true;
            options.groups.push(noKernel);
            return options;
        }
        // Create kernel option groups based on whether language preference exists.
        if (language) {
            // Add all kernelspecs, separating out the preferred language first.
            const preferred = {
                label: labels.startPreferred,
                options: []
            };
            const other = {
                label: labels.startOther,
                options: []
            };
            const preferredRunning = {
                label: labels.connectToPreferred,
                options: []
            };
            const otherRunning = {
                label: labels.connectToOther,
                options: []
            };
            for (const spec of sorted) {
                (spec.language === language ? preferred : other).options.push(optionForSpec(spec));
            }
            options.groups.push(preferred);
            options.groups.push(noKernel);
            options.groups.push(other);
            kernels
                .map(kernel => {
                var _a, _b;
                return ({
                    option: optionForKernel(kernel, (_b = (_a = specs.kernelspecs[kernel.name]) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : '', sessions[kernel.id]),
                    language: languages[kernel.name]
                });
            })
                .sort((a, b) => a.option.text.localeCompare(b.option.text))
                .forEach(kernel => (language === kernel.language
                ? preferredRunning
                : otherRunning).options.push(kernel.option));
            if (preferredRunning.options.length)
                options.groups.push(preferredRunning);
            if (otherRunning.options.length)
                options.groups.push(otherRunning);
        }
        else {
            // Add kernelspecs first.
            options.groups.push({
                label: labels.startKernel,
                options: sorted.map(spec => optionForSpec(spec))
            });
            // Next add the no kernel option.
            options.groups.push(noKernel);
            // Add running kernels.
            options.groups.push({
                label: labels.connectKernel,
                options: kernels
                    .map(kernel => {
                    var _a, _b;
                    return optionForKernel(kernel, (_b = (_a = specs.kernelspecs[kernel.name]) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : '', sessions[kernel.id]);
                })
                    .sort((a, b) => a.text.localeCompare(b.text))
            });
        }
        // Set the selected option.
        if (preference.id || currentKernelDisplayName || preference.name) {
            for (const group of options.groups) {
                for (const option of group.options) {
                    const choice = JSON.parse(option.value);
                    if (!choice)
                        continue;
                    if (preference.id) {
                        if (preference.id === choice.id) {
                            option.selected = true;
                            return options;
                        }
                        continue;
                    }
                    if (currentKernelDisplayName) {
                        if (currentKernelDisplayName ===
                            ((_g = specs.kernelspecs[choice.name]) === null || _g === void 0 ? void 0 : _g.display_name)) {
                            option.selected = true;
                            return options;
                        }
                        continue;
                    }
                    if (preference.name) {
                        if (preference.name === choice.name) {
                            option.selected = true;
                            return options;
                        }
                        continue;
                    }
                }
            }
        }
        return options;
    }
    SessionContextDialogs.kernelOptions = kernelOptions;
})(SessionContextDialogs || (SessionContextDialogs = {}));
/**
 * The namespace for module private data.
 */
var sessioncontext_Private;
(function (Private) {
    /**
     * Return a kernel selector widget.
     */
    Private.createKernelSelector = (sessionContext, translator) => new KernelSelector({
        node: createSelectorNode(sessionContext, translator)
    });
    /**
     * A widget that provides a kernel selection.
     */
    class KernelSelector extends index_es6_js_.Widget {
        /**
         * Get the value of the kernel selector widget.
         */
        getValue() {
            const selector = this.node.querySelector('select');
            return JSON.parse(selector.value);
        }
    }
    /**
     * Create an HTML node for a kernel selector widget.
     */
    function createSelectorNode(sessionContext, translator) {
        // Create the dialog body.
        translator = translator || lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const body = document.createElement('div');
        const text = document.createElement('label');
        text.textContent = `${trans.__('Select kernel for:')} "${sessionContext.name}"`;
        body.appendChild(text);
        const select = document.createElement('select');
        const options = SessionContextDialogs.kernelOptions(sessionContext, translator);
        if (options.disabled)
            select.disabled = true;
        for (const group of options.groups) {
            const { label, options } = group;
            const optgroup = document.createElement('optgroup');
            optgroup.label = label;
            for (const { selected, text, title, value } of options) {
                const option = document.createElement('option');
                if (selected)
                    option.selected = true;
                if (title)
                    option.title = title;
                option.text = text;
                option.value = value;
                optgroup.appendChild(option);
            }
            select.appendChild(optgroup);
        }
        body.appendChild(select);
        return body;
    }
    /**
     * Get the default kernel name given select options.
     */
    function getDefaultKernel(options) {
        var _a;
        const { specs, preference } = options;
        const { name, language, canStart, autoStartDefault } = preference;
        if (!specs || canStart === false) {
            return null;
        }
        const defaultName = autoStartDefault ? specs.default : null;
        if (!name && !language) {
            return defaultName;
        }
        // Look for an exact match of a spec name.
        for (const specName in specs.kernelspecs) {
            if (specName === name) {
                return name;
            }
        }
        // Bail if there is no language.
        if (!language) {
            return defaultName;
        }
        // Check for a single kernel matching the language.
        const matches = [];
        for (const specName in specs.kernelspecs) {
            const kernelLanguage = (_a = specs.kernelspecs[specName]) === null || _a === void 0 ? void 0 : _a.language;
            if (language === kernelLanguage) {
                matches.push(specName);
            }
        }
        if (matches.length === 1) {
            const specName = matches[0];
            console.warn('No exact match found for ' +
                specName +
                ', using kernel ' +
                specName +
                ' that matches ' +
                'language=' +
                language);
            return specName;
        }
        // No matches found.
        return defaultName;
    }
    Private.getDefaultKernel = getDefaultKernel;
})(sessioncontext_Private || (sessioncontext_Private = {}));
//# sourceMappingURL=sessioncontext.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/kernelstatuses.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * Helper function to translate kernel statuses mapping by using
 * input translator.
 *
 * @param translator - Language translator.
 * @return The translated kernel status mapping.
 */
function translateKernelStatuses(translator) {
    translator = translator || lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const translated = {
        unknown: trans.__('Unknown'),
        starting: trans.__('Starting'),
        idle: trans.__('Idle'),
        busy: trans.__('Busy'),
        terminating: trans.__('Terminating'),
        restarting: trans.__('Restarting'),
        autorestarting: trans.__('Autorestarting'),
        dead: trans.__('Dead'),
        connected: trans.__('Connected'),
        connecting: trans.__('Connecting'),
        disconnected: trans.__('Disconnected'),
        initializing: trans.__('Initializing'),
        '': ''
    };
    return translated;
}
/**
 * A pure functional component for rendering kernel status.
 */
function KernelStatusComponent(props) {
    const translator = props.translator || lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    let statusText = '';
    if (props.status) {
        statusText = ` | ${props.status}`;
    }
    return (react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { role: "button", "aria-haspopup": true, onClick: props.handleClick, onKeyDown: props.handleKeyDown, source: `${props.kernelName}${statusText}`, title: trans.__('Change kernel for %1', props.activityName), tabIndex: 0 }));
}
/**
 * A VDomRenderer widget for displaying the status of a kernel.
 */
class KernelStatus extends index_js_.VDomRenderer {
    /**
     * Construct the kernel status widget.
     */
    constructor(opts, translator) {
        super(new KernelStatus.Model(translator));
        this.translator = translator || lib_index_js_.nullTranslator;
        this._handleClick = opts.onClick;
        this._handleKeyDown = opts.onKeyDown;
        this.addClass('jp-mod-highlighted');
    }
    /**
     * Render the kernel status item.
     */
    render() {
        if (this.model === null) {
            return null;
        }
        else {
            return (react_index_js_default().createElement(KernelStatusComponent, { status: this.model.status, kernelName: this.model.kernelName, activityName: this.model.activityName, handleClick: this._handleClick, handleKeyDown: this._handleKeyDown, translator: this.translator }));
        }
    }
}
/**
 * A namespace for KernelStatus statics.
 */
(function (KernelStatus) {
    /**
     * A VDomModel for the kernel status indicator.
     */
    class Model extends index_js_.VDomModel {
        constructor(translator) {
            super();
            this._activityName = '';
            this._kernelName = '';
            this._kernelStatus = '';
            this._sessionContext = null;
            translator = translator !== null && translator !== void 0 ? translator : lib_index_js_.nullTranslator;
            this._trans = translator.load('jupyterlab');
            this._statusNames = translateKernelStatuses(translator);
        }
        /**
         * The name of the kernel.
         */
        get kernelName() {
            return this._kernelName;
        }
        /**
         * The current status of the kernel.
         */
        get status() {
            return this._kernelStatus
                ? this._statusNames[this._kernelStatus]
                : undefined;
        }
        /**
         * A display name for the activity.
         */
        get activityName() {
            return this._activityName;
        }
        set activityName(val) {
            const oldVal = this._activityName;
            if (oldVal === val) {
                return;
            }
            this._activityName = val;
            this.stateChanged.emit();
        }
        /**
         * The current client session associated with the kernel status indicator.
         */
        get sessionContext() {
            return this._sessionContext;
        }
        set sessionContext(sessionContext) {
            var _a, _b, _c, _d;
            (_a = this._sessionContext) === null || _a === void 0 ? void 0 : _a.statusChanged.disconnect(this._onKernelStatusChanged, this);
            (_b = this._sessionContext) === null || _b === void 0 ? void 0 : _b.connectionStatusChanged.disconnect(this._onKernelStatusChanged, this);
            (_c = this._sessionContext) === null || _c === void 0 ? void 0 : _c.kernelChanged.disconnect(this._onKernelChanged, this);
            const oldState = this._getAllState();
            this._sessionContext = sessionContext;
            this._kernelStatus = sessionContext === null || sessionContext === void 0 ? void 0 : sessionContext.kernelDisplayStatus;
            this._kernelName =
                (_d = sessionContext === null || sessionContext === void 0 ? void 0 : sessionContext.kernelDisplayName) !== null && _d !== void 0 ? _d : this._trans.__('No Kernel');
            sessionContext === null || sessionContext === void 0 ? void 0 : sessionContext.statusChanged.connect(this._onKernelStatusChanged, this);
            sessionContext === null || sessionContext === void 0 ? void 0 : sessionContext.connectionStatusChanged.connect(this._onKernelStatusChanged, this);
            sessionContext === null || sessionContext === void 0 ? void 0 : sessionContext.kernelChanged.connect(this._onKernelChanged, this);
            this._triggerChange(oldState, this._getAllState());
        }
        /**
         * React to changes to the kernel status.
         */
        _onKernelStatusChanged() {
            var _a;
            this._kernelStatus = (_a = this._sessionContext) === null || _a === void 0 ? void 0 : _a.kernelDisplayStatus;
            this.stateChanged.emit(void 0);
        }
        /**
         * React to changes in the kernel.
         */
        _onKernelChanged(_sessionContext, change) {
            var _a;
            const oldState = this._getAllState();
            // sync setting of status and display name
            this._kernelStatus = (_a = this._sessionContext) === null || _a === void 0 ? void 0 : _a.kernelDisplayStatus;
            this._kernelName = _sessionContext.kernelDisplayName;
            this._triggerChange(oldState, this._getAllState());
        }
        _getAllState() {
            return [this._kernelName, this._kernelStatus, this._activityName];
        }
        _triggerChange(oldState, newState) {
            if (dist_index_js_.JSONExt.deepEqual(oldState, newState)) {
                this.stateChanged.emit(void 0);
            }
        }
    }
    KernelStatus.Model = Model;
})(KernelStatus || (KernelStatus = {}));
//# sourceMappingURL=kernelstatuses.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/toolbar/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * The class name added to toolbar kernel name text.
 */
const TOOLBAR_KERNEL_NAME_CLASS = 'jp-Toolbar-kernelName';
/**
 * The class name added to toolbar kernel status icon.
 */
const TOOLBAR_KERNEL_STATUS_CLASS = 'jp-Toolbar-kernelStatus';
/**
 * The namespace for Toolbar class statics.
 */
var widget_Toolbar;
(function (Toolbar) {
    /**
     * Create an interrupt toolbar item.
     *
     * @deprecated since version v3.2
     * This is dead code now.
     */
    function createInterruptButton(sessionContext, translator) {
        translator = translator || lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        return new index_js_.ToolbarButton({
            icon: index_js_.stopIcon,
            onClick: () => {
                var _a, _b;
                void ((_b = (_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.interrupt());
            },
            tooltip: trans.__('Interrupt the kernel')
        });
    }
    Toolbar.createInterruptButton = createInterruptButton;
    /**
     * Create a restart toolbar item.
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createRestartButton(sessionContext, dialogs, translator) {
        translator = translator !== null && translator !== void 0 ? translator : lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        return new index_js_.ToolbarButton({
            icon: index_js_.refreshIcon,
            onClick: () => {
                void (dialogs !== null && dialogs !== void 0 ? dialogs : new SessionContextDialogs({ translator })).restart(sessionContext);
            },
            tooltip: trans.__('Restart the kernel')
        });
    }
    Toolbar.createRestartButton = createRestartButton;
    /**
     * Create a kernel name indicator item.
     *
     * #### Notes
     * It will display the `'display_name`' of the session context. It can
     * handle a change in context or kernel.
     */
    function createKernelNameItem(sessionContext, dialogs, translator) {
        const el = index_js_.ReactWidget.create(react_index_js_.createElement(widget_Private.KernelNameComponent, { sessionContext: sessionContext, dialogs: dialogs !== null && dialogs !== void 0 ? dialogs : new SessionContextDialogs({ translator }), translator: translator }));
        el.addClass('jp-KernelName');
        return el;
    }
    Toolbar.createKernelNameItem = createKernelNameItem;
    /**
     * Create a kernel status indicator item.
     *
     * @deprecated since v3.5
     * The kernel status indicator is now replaced by the execution status indicator.
     *
     * #### Notes
     * It will show a busy status if the kernel status is busy.
     * It will show the current status in the node title.
     * It can handle a change to the context or the kernel.
     */
    function createKernelStatusItem(sessionContext, translator) {
        return new widget_Private.KernelStatus(sessionContext, translator);
    }
    Toolbar.createKernelStatusItem = createKernelStatusItem;
})(widget_Toolbar || (widget_Toolbar = {}));
/**
 * A namespace for private data.
 */
var widget_Private;
(function (Private) {
    /**
     * React component for a kernel name button.
     *
     * This wraps the ToolbarButtonComponent and watches the kernel
     * session for changes.
     */
    function KernelNameComponent(props) {
        const translator = props.translator || lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const callback = () => {
            void props.dialogs.selectKernel(props.sessionContext);
        };
        return (react_index_js_.createElement(index_js_.UseSignal, { signal: props.sessionContext.kernelChanged, initialSender: props.sessionContext }, sessionContext => (react_index_js_.createElement(index_js_.ToolbarButtonComponent, { className: TOOLBAR_KERNEL_NAME_CLASS, onClick: callback, tooltip: trans.__('Switch kernel'), label: sessionContext === null || sessionContext === void 0 ? void 0 : sessionContext.kernelDisplayName }))));
    }
    Private.KernelNameComponent = KernelNameComponent;
    /**
     * A toolbar item that displays kernel status.
     *
     * @deprecated This code is not use any longer and will be removed in JupyterLab 5
     */
    class KernelStatus extends index_es6_js_.Widget {
        /**
         * Construct a new kernel status widget.
         */
        constructor(sessionContext, translator) {
            super();
            this.translator = translator || lib_index_js_.nullTranslator;
            this._trans = this.translator.load('jupyterlab');
            this.addClass(TOOLBAR_KERNEL_STATUS_CLASS);
            this._statusNames = translateKernelStatuses(this.translator);
            this._onStatusChanged(sessionContext);
            sessionContext.statusChanged.connect(this._onStatusChanged, this);
            sessionContext.connectionStatusChanged.connect(this._onStatusChanged, this);
        }
        /**
         * Handle a status on a kernel.
         */
        _onStatusChanged(sessionContext) {
            if (this.isDisposed) {
                return;
            }
            const status = sessionContext.kernelDisplayStatus;
            const circleIconProps = {
                container: this.node,
                title: this._trans.__('Kernel %1', this._statusNames[status] || status),
                stylesheet: 'toolbarButton',
                alignSelf: 'normal',
                height: '24px'
            };
            // set the icon
            index_js_.LabIcon.remove(this.node);
            if (status === 'busy' ||
                status === 'starting' ||
                status === 'terminating' ||
                status === 'restarting' ||
                status === 'initializing') {
                index_js_.circleIcon.element(circleIconProps);
            }
            else if (status === 'connecting' ||
                status === 'disconnected' ||
                status === 'unknown') {
                index_js_.offlineBoltIcon.element(circleIconProps);
            }
            else {
                index_js_.circleEmptyIcon.element(circleIconProps);
            }
        }
    }
    Private.KernelStatus = KernelStatus;
})(widget_Private || (widget_Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/clipboard.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The clipboard interface.
 */
var Clipboard;
(function (Clipboard) {
    /**
     * Get the application clipboard instance.
     */
    function getInstance() {
        return clipboard_Private.instance;
    }
    Clipboard.getInstance = getInstance;
    /**
     * Set the application clipboard instance.
     *
     * @deprecated will be removed in a future release. Use `SystemClipboard.getInstance`.
     */
    function setInstance(value) {
        clipboard_Private.instance = value;
    }
    Clipboard.setInstance = setInstance;
    /**
     * Copy text to the system clipboard.
     *
     * #### Notes
     * This can only be called in response to a user input event.
     */
    function copyToSystem(clipboardData) {
        const node = document.body;
        const handler = (event) => {
            const data = event.clipboardData || window.clipboardData;
            if (typeof clipboardData === 'string') {
                data.setData('text', clipboardData);
            }
            else {
                clipboardData.types().map((mimeType) => {
                    data.setData(mimeType, clipboardData.getData(mimeType));
                });
            }
            event.preventDefault();
            node.removeEventListener('copy', handler);
        };
        node.addEventListener('copy', handler);
        generateEvent(node);
    }
    Clipboard.copyToSystem = copyToSystem;
    /**
     * Generate a clipboard event on a node.
     *
     * @param node - The element on which to generate the event.
     *
     * @param type - The type of event to generate.
     *   `'paste'` events cannot be programmatically generated.
     *
     * #### Notes
     * This can only be called in response to a user input event.
     */
    function generateEvent(node, type = 'copy') {
        // http://stackoverflow.com/a/5210367
        // Identify selected text.
        let sel = window.getSelection();
        // Save the current selection.
        const savedRanges = [];
        for (let i = 0, len = (sel === null || sel === void 0 ? void 0 : sel.rangeCount) || 0; i < len; ++i) {
            savedRanges[i] = sel.getRangeAt(i).cloneRange();
        }
        // Select the node content.
        const range = document.createRange();
        range.selectNodeContents(node);
        if (sel) {
            sel.removeAllRanges();
            sel.addRange(range);
        }
        // Execute the command.
        document.execCommand(type);
        // Restore the previous selection.
        sel = window.getSelection();
        if (sel) {
            sel.removeAllRanges();
            for (let i = 0, len = savedRanges.length; i < len; ++i) {
                sel.addRange(savedRanges[i]);
            }
        }
    }
    Clipboard.generateEvent = generateEvent;
})(Clipboard || (Clipboard = {}));
/**
 * The clipboard interface supporting the native clipboard API.
 */
var SystemClipboard;
(function (SystemClipboard) {
    /**
     * Get the system clipboard instance.
     */
    function getInstance() {
        return clipboard_Private.systemInstance;
    }
    SystemClipboard.getInstance = getInstance;
})(SystemClipboard || (SystemClipboard = {}));
/**
 * The namespace for module private data.
 */
var clipboard_Private;
(function (Private) {
    /**
     * The mimetype used for Jupyter cell data.
     */
    const JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';
    /**
     * An implementation of the clipboard interface.
     * This uses the native clipboard API when available, with a fallback to
     * a MimeData instance otherwise - The native clipboard API only works in
     * secure contexts (pages served over HTTPS or localhost).
     */
    class ClipboardImpl {
        /**
         * Create a new clipboard instance.
         */
        constructor(fallback) {
            this.fallback = fallback || new dist_index_js_.MimeData();
            const { systemClipboard } = this;
            if (!systemClipboard) {
                console.warn('Clipboard API not available');
            }
        }
        /**
         * Clear the clipboard.
         * This is a no-op for the native clipboard API.
         * The fallback clipboard is cleared by setting the data to an empty
         */
        clear() {
            this.fallback.clear();
        }
        /**
         * Whether the clipboard has data for a given mime type.
         * Returns `false` if the data does not exist.
         *
         * @param mime - The mime type to check.
         */
        async hasData(mime) {
            const { systemClipboard } = this;
            if (!systemClipboard) {
                return this.fallback.hasData(mime);
            }
            let text;
            try {
                text = await systemClipboard.readText();
            }
            catch (reason) {
                console.warn('Failed to read data from clipboard:', reason);
                if (reason.name === 'NotAllowedError') {
                    // If the clipboard API is not allowed, fall back to the
                    // internal clipboard.
                    return this.fallback.hasData(mime);
                }
                return false;
            }
            try {
                this.convertStringToData(mime, text);
                return true;
            }
            catch (reason) {
                return false;
            }
        }
        /**
         * Retrieve the data for a given mime type.
         *
         * @param mime - The mime type to retrieve.
         * @returns A promise that resolves with the data for the given mime type.
         */
        async getData(mime) {
            const { systemClipboard } = this;
            if (!systemClipboard) {
                return this.fallback.getData(mime);
            }
            try {
                const text = await systemClipboard.readText();
                return this.convertStringToData(mime, text);
            }
            catch (reason) {
                console.warn('Failed to read data from clipboard:', reason);
                if (reason.name === 'NotAllowedError') {
                    // If the clipboard API is not allowed, fall back to the
                    // internal clipboard.
                    return this.fallback.getData(mime);
                }
                return null;
            }
        }
        /**
         * Set the data for a given mime type.
         *
         * @param mime - The mime type to set.
         * @param data - The data to set.
         */
        async setData(mime, data) {
            const { systemClipboard } = this;
            if (!systemClipboard) {
                this.fallback.clear();
                this.fallback.setData(mime, data);
                return;
            }
            try {
                await systemClipboard.writeText(this.convertDataToString(mime, data));
            }
            catch (reason) {
                console.warn('Failed to write data to clipboard:', reason);
                // If the clipboard API is not allowed, fall back to the
                // internal clipboard.
                this.fallback.clear();
                this.fallback.setData(mime, data);
            }
        }
        /**
         * Convert the data to a string for the given mime type.
         */
        convertDataToString(mime, data) {
            if (mime === JUPYTER_CELL_MIME) {
                return JSON.stringify(data);
            }
            return (data || '').toString();
        }
        /**
         * Convert the string to data for the given mime type.
         */
        convertStringToData(mime, text) {
            if (mime === JUPYTER_CELL_MIME) {
                return JSON.parse(text);
            }
            return text;
        }
        /**
         * Get the system clipboard instance.
         */
        get systemClipboard() {
            return navigator.clipboard;
        }
    }
    /**
     * The application clipboard instance.
     */
    Private.instance = new dist_index_js_.MimeData();
    /**
     * The system clipboard instance.
     */
    Private.systemInstance = new ClipboardImpl();
})(clipboard_Private || (clipboard_Private = {}));
//# sourceMappingURL=clipboard.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/commandlinker.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * The command data attribute added to nodes that are connected.
 */
const COMMAND_ATTR = 'commandlinker-command';
/**
 * The args data attribute added to nodes that are connected.
 */
const ARGS_ATTR = 'commandlinker-args';
/**
 * A static class that provides helper methods to generate clickable nodes that
 * execute registered commands with pre-populated arguments.
 */
class CommandLinker {
    /**
     * Instantiate a new command linker.
     */
    constructor(options) {
        this._isDisposed = false;
        this._commands = options.commands;
        document.body.addEventListener('click', this);
    }
    /**
     * Test whether the linker is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the linker.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        document.body.removeEventListener('click', this);
    }
    /**
     * Connect a command/argument pair to a given node so that when it is clicked,
     * the command will execute.
     *
     * @param node - The node being connected.
     *
     * @param command - The command ID to execute upon click.
     *
     * @param args - The arguments with which to invoke the command.
     *
     * @returns The same node that was passed in, after it has been connected.
     *
     * #### Notes
     * Only `click` events will execute the command on a connected node. So, there
     * are two considerations that are relevant:
     * 1. If a node is connected, the default click action will be prevented.
     * 2. The `HTMLElement` passed in should be clickable.
     */
    connectNode(node, command, args) {
        node.setAttribute(`data-${COMMAND_ATTR}`, command);
        if (args !== void 0) {
            node.setAttribute(`data-${ARGS_ATTR}`, JSON.stringify(args));
        }
        return node;
    }
    /**
     * Disconnect a node that has been connected to execute a command on click.
     *
     * @param node - The node being disconnected.
     *
     * @returns The same node that was passed in, after it has been disconnected.
     *
     * #### Notes
     * This method is safe to call multiple times and is safe to call on nodes
     * that were never connected.
     *
     * This method can be called on rendered virtual DOM nodes that were populated
     * using the `populateVNodeDataset` method in order to disconnect them from
     * executing their command/argument pair.
     */
    disconnectNode(node) {
        node.removeAttribute(`data-${COMMAND_ATTR}`);
        node.removeAttribute(`data-${ARGS_ATTR}`);
        return node;
    }
    /**
     * Handle the DOM events for the command linker helper class.
     *
     * @param event - The DOM event sent to the class.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'click':
                this._evtClick(event);
                break;
            default:
                return;
        }
    }
    /**
     * Populate the `dataset` attribute within the collection of attributes used
     * to instantiate a virtual DOM node with the values necessary for its
     * rendered DOM node to respond to clicks by executing a command/argument
     * pair.
     *
     * @param command - The command ID to execute upon click.
     *
     * @param args - The arguments with which to invoke the command.
     *
     * @returns A `dataset` collection for use within virtual node attributes.
     *
     * #### Notes
     * The return value can be used on its own as the value for the `dataset`
     * attribute of a virtual element, or it can be added to an existing `dataset`
     * as in the example below.
     *
     * #### Example
     * ```typescript
     * let command = 'some:command-id';
     * let args = { alpha: 'beta' };
     * let anchor = h.a({
     *   className: 'some-class',
     *   dataset: {
     *     foo: '1',
     *     bar: '2',
     *     ../...linker.populateVNodeDataset(command, args)
     *   }
     * }, 'some text');
     * ```
     */
    populateVNodeDataset(command, args) {
        let dataset;
        if (args !== void 0) {
            dataset = { [ARGS_ATTR]: JSON.stringify(args), [COMMAND_ATTR]: command };
        }
        else {
            dataset = { [COMMAND_ATTR]: command };
        }
        return dataset;
    }
    /**
     * The global click handler that deploys commands/argument pairs that are
     * attached to the node being clicked.
     */
    _evtClick(event) {
        let target = event.target;
        while (target && target.parentElement) {
            if (target.hasAttribute(`data-${COMMAND_ATTR}`)) {
                event.preventDefault();
                const command = target.getAttribute(`data-${COMMAND_ATTR}`);
                if (!command) {
                    return;
                }
                const argsValue = target.getAttribute(`data-${ARGS_ATTR}`);
                let args = dist_index_js_.JSONExt.emptyObject;
                if (argsValue) {
                    args = JSON.parse(argsValue);
                }
                void this._commands.execute(command, args);
                return;
            }
            target = target.parentElement;
        }
    }
}
//# sourceMappingURL=commandlinker.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/commandpalette.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/


/**
 * Class name identifying the input group with search icon.
 */
const SEARCH_ICON_GROUP_CLASS = 'jp-SearchIconGroup';
/**
 * Wrap the command palette in a modal to make it more usable.
 */
class ModalCommandPalette extends index_es6_js_.Panel {
    constructor(options) {
        super();
        this._options = options;
        this.addClass('jp-ModalCommandPalette');
        this.addClass('jp-ThemedContainer');
        this.id = 'modal-command-palette';
        this.palette = options.commandPalette;
        this._commandPalette.commands.commandExecuted.connect(() => {
            if (this.isAttached && this.isVisible) {
                this.hideAndReset();
            }
        });
        // required to properly receive blur and focus events;
        // selection of items with mouse may not work without this.
        this.node.tabIndex = 0;
    }
    get palette() {
        return this._commandPalette;
    }
    set palette(value) {
        this._commandPalette = value;
        if (!this.searchIconGroup) {
            this._commandPalette.inputNode.insertAdjacentElement('afterend', this.createSearchIconGroup());
        }
        this.addWidget(value);
        this.hideAndReset();
    }
    attach() {
        index_es6_js_.Widget.attach(this, document.body);
    }
    detach() {
        index_es6_js_.Widget.detach(this);
    }
    /**
     * Hide the modal command palette and reset its search.
     */
    hideAndReset() {
        var _a, _b;
        this.hide();
        this._commandPalette.inputNode.value = '';
        this._commandPalette.refresh();
        (_b = (_a = this._options).restore) === null || _b === void 0 ? void 0 : _b.call(_a);
    }
    /**
     * Handle incoming events.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'keydown':
                this._evtKeydown(event);
                break;
            case 'blur': {
                // if the focus shifted outside of this DOM element, hide and reset.
                if (
                // focus went away from child element
                this.node.contains(event.target) &&
                    // and it did NOT go to another child element but someplace else
                    !this.node.contains(event.relatedTarget)) {
                    event.stopPropagation();
                    this.hideAndReset();
                }
                break;
            }
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
            default:
                break;
        }
    }
    /**
     * Find the element with search icon group.
     */
    get searchIconGroup() {
        return this._commandPalette.node.getElementsByClassName(SEARCH_ICON_GROUP_CLASS)[0];
    }
    /**
     * Create element with search icon group.
     */
    createSearchIconGroup() {
        const inputGroup = document.createElement('div');
        inputGroup.classList.add(SEARCH_ICON_GROUP_CLASS);
        index_js_.searchIcon.render(inputGroup);
        return inputGroup;
    }
    /**
     *  A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        this.node.addEventListener('keydown', this, true);
        this.node.addEventListener('contextmenu', this, true);
    }
    /**
     *  A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('keydown', this, true);
        this.node.removeEventListener('contextmenu', this, true);
    }
    onBeforeHide(msg) {
        document.removeEventListener('blur', this, true);
    }
    onAfterShow(msg) {
        document.addEventListener('blur', this, true);
    }
    /**
     * A message handler invoked on an `'activate-request'` message.
     */
    onActivateRequest(msg) {
        if (this.isAttached) {
            this.show();
            this._commandPalette.activate();
        }
    }
    /**
     * Handle the `'keydown'` event for the widget.
     */
    _evtKeydown(event) {
        // Check for escape key
        switch (event.keyCode) {
            case 27: // Escape.
                event.stopPropagation();
                event.preventDefault();
                this.hideAndReset();
                break;
            default:
                break;
        }
    }
}
//# sourceMappingURL=commandpalette.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var domutils_dist_index_es6_js_ = __webpack_require__(19451);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/domutils.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * The namespace for DOM utilities.
 */
var DOMUtils;
(function (DOMUtils) {
    /**
     * Get the index of the node at a client position, or `-1`.
     */
    function hitTestNodes(nodes, x, y) {
        return dist_index_es6_js_.ArrayExt.findFirstIndex(nodes, node => {
            return domutils_dist_index_es6_js_.ElementExt.hitTest(node, x, y);
        });
    }
    DOMUtils.hitTestNodes = hitTestNodes;
    /**
     * Find the first element matching a class name.
     * Only use this function when the element existence is guaranteed.
     */
    function findElement(parent, className) {
        return parent.querySelector(`.${className}`);
    }
    DOMUtils.findElement = findElement;
    /**
     * Find the first element matching a class name.
     */
    function findElements(parent, className) {
        return parent.getElementsByClassName(className);
    }
    DOMUtils.findElements = findElements;
    /**
     * Create a DOM id with prefix "id-" to solve bug for UUIDs beginning with numbers.
     */
    function createDomID() {
        return `id-${dist_index_js_.UUID.uuid4()}`;
    }
    DOMUtils.createDomID = createDomID;
    /**
     * Check whether the active element descendant from given parent is editable.
     * When checking active elements it includes elements in the open shadow DOM.
     */
    function hasActiveEditableElement(parent, root = document) {
        const element = root.activeElement;
        return !!(element &&
            parent.contains(element) &&
            (element.matches(':read-write') ||
                (element.shadowRoot &&
                    hasActiveEditableElement(element.shadowRoot, element.shadowRoot))));
    }
    DOMUtils.hasActiveEditableElement = hasActiveEditableElement;
})(DOMUtils || (DOMUtils = {}));
//# sourceMappingURL=domutils.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/inputdialog.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


const INPUT_DIALOG_CLASS = 'jp-Input-Dialog';
const INPUT_BOOLEAN_DIALOG_CLASS = 'jp-Input-Boolean-Dialog';
/**
 * Namespace for input dialogs
 */
var InputDialog;
(function (InputDialog) {
    /**
     * Create and show a input dialog for a boolean.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted
     */
    function getBoolean(options) {
        return showDialog({
            ...options,
            body: new InputBooleanDialog(options),
            buttons: [
                Dialog.cancelButton({ label: options.cancelLabel }),
                Dialog.okButton({ label: options.okLabel })
            ],
            focusNodeSelector: 'input'
        });
    }
    InputDialog.getBoolean = getBoolean;
    /**
     * Create and show a input dialog for a number.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted
     */
    function getNumber(options) {
        return showDialog({
            ...options,
            body: new InputNumberDialog(options),
            buttons: [
                Dialog.cancelButton({ label: options.cancelLabel }),
                Dialog.okButton({ label: options.okLabel })
            ],
            focusNodeSelector: 'input'
        });
    }
    InputDialog.getNumber = getNumber;
    /**
     * Create and show a input dialog for a choice.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted
     */
    function getItem(options) {
        return showDialog({
            ...options,
            body: new InputItemsDialog(options),
            buttons: [
                Dialog.cancelButton({ label: options.cancelLabel }),
                Dialog.okButton({ label: options.okLabel })
            ],
            focusNodeSelector: options.editable ? 'input' : 'select'
        });
    }
    InputDialog.getItem = getItem;
    /**
     * Create and show a input dialog for a choice.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted
     */
    function getMultipleItems(options) {
        return showDialog({
            ...options,
            body: new InputMultipleItemsDialog(options),
            buttons: [
                Dialog.cancelButton({ label: options.cancelLabel }),
                Dialog.okButton({ label: options.okLabel })
            ]
        });
    }
    InputDialog.getMultipleItems = getMultipleItems;
    /**
     * Create and show a input dialog for a text.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted
     */
    function getText(options) {
        return showDialog({
            ...options,
            body: new InputTextDialog(options),
            buttons: [
                Dialog.cancelButton({ label: options.cancelLabel }),
                Dialog.okButton({ label: options.okLabel })
            ],
            focusNodeSelector: 'input'
        });
    }
    InputDialog.getText = getText;
    /**
     * Create and show a input dialog for a password.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted
     */
    function getPassword(options) {
        return showDialog({
            ...options,
            body: new InputPasswordDialog(options),
            buttons: [
                Dialog.cancelButton({ label: options.cancelLabel }),
                Dialog.okButton({ label: options.okLabel })
            ],
            focusNodeSelector: 'input'
        });
    }
    InputDialog.getPassword = getPassword;
})(InputDialog || (InputDialog = {}));
/**
 * Base widget for input dialog body
 */
class InputDialogBase extends index_es6_js_.Widget {
    /**
     * InputDialog constructor
     *
     * @param label Input field label
     */
    constructor(options) {
        super();
        this.addClass(INPUT_DIALOG_CLASS);
        this._input = document.createElement('input');
        this._input.classList.add('jp-mod-styled');
        this._input.id = 'jp-dialog-input-id';
        if (options.label !== undefined) {
            const labelElement = document.createElement('label');
            labelElement.textContent = options.label;
            labelElement.htmlFor = this._input.id;
            // Initialize the node
            this.node.appendChild(labelElement);
        }
        const wrapper = document.createElement('div');
        wrapper.className = 'jp-InputDialog-inputWrapper';
        if (options.prefix) {
            const prefix = document.createElement('span');
            prefix.className = 'jp-InputDialog-inputPrefix';
            prefix.textContent = options.prefix;
            // Both US WDS (https://designsystem.digital.gov/components/input-prefix-suffix/)
            // and UK DS (https://design-system.service.gov.uk/components/text-input/) recommend
            // hiding prefixes and suffixes from screen readers.
            prefix.ariaHidden = 'true';
            wrapper.appendChild(prefix);
        }
        wrapper.appendChild(this._input);
        if (options.suffix) {
            const suffix = document.createElement('span');
            suffix.className = 'jp-InputDialog-inputSuffix';
            suffix.textContent = options.suffix;
            suffix.ariaHidden = 'true';
            wrapper.appendChild(suffix);
        }
        this.node.appendChild(wrapper);
    }
}
/**
 * Widget body for input boolean dialog
 */
class InputBooleanDialog extends InputDialogBase {
    /**
     * InputBooleanDialog constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        super(options);
        this.addClass(INPUT_BOOLEAN_DIALOG_CLASS);
        this._input.type = 'checkbox';
        this._input.checked = options.value ? true : false;
    }
    /**
     * Get the text specified by the user
     */
    getValue() {
        return this._input.checked;
    }
}
/**
 * Widget body for input number dialog
 */
class InputNumberDialog extends InputDialogBase {
    /**
     * InputNumberDialog constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        super(options);
        this._input.type = 'number';
        this._input.value = options.value ? options.value.toString() : '0';
    }
    /**
     * Get the number specified by the user.
     */
    getValue() {
        if (this._input.value) {
            return Number(this._input.value);
        }
        else {
            return Number.NaN;
        }
    }
}
/**
 * Base widget body for input text/password/email dialog
 */
class InputDialogTextBase extends InputDialogBase {
    /**
     * InputDialogTextBase constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        super(options);
        this._input.value = options.text ? options.text : '';
        if (options.placeholder) {
            this._input.placeholder = options.placeholder;
        }
        if (options.pattern) {
            this._input.pattern = options.pattern;
        }
        if (options.required) {
            this._input.required = options.required;
        }
    }
    /**
     * Get the text specified by the user
     */
    getValue() {
        return this._input.value;
    }
}
/**
 * Widget body for input text dialog
 */
class InputTextDialog extends InputDialogTextBase {
    /**
     * InputTextDialog constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        var _a;
        super(options);
        this._input.type = 'text';
        this._initialSelectionRange = Math.min(this._input.value.length, Math.max(0, (_a = options.selectionRange) !== null && _a !== void 0 ? _a : this._input.value.length));
    }
    /**
     *  A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        if (this._initialSelectionRange > 0 && this._input.value) {
            this._input.setSelectionRange(0, this._initialSelectionRange);
        }
    }
}
/**
 * Widget body for input password dialog
 */
class InputPasswordDialog extends InputDialogTextBase {
    /**
     * InputPasswordDialog constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        super(options);
        this._input.type = 'password';
    }
    /**
     *  A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        if (this._input.value) {
            this._input.select();
        }
    }
}
/**
 * Widget body for input list dialog
 */
class InputItemsDialog extends InputDialogBase {
    /**
     * InputItemsDialog constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        super(options);
        this._editable = options.editable || false;
        let current = options.current || 0;
        let defaultIndex;
        if (typeof current === 'number') {
            defaultIndex = Math.max(0, Math.min(current, options.items.length - 1));
            current = '';
        }
        this._list = document.createElement('select');
        options.items.forEach((item, index) => {
            const option = document.createElement('option');
            if (index === defaultIndex) {
                option.selected = true;
                current = item;
            }
            option.value = item;
            option.textContent = item;
            this._list.appendChild(option);
        });
        if (options.editable) {
            /* Use of list and datalist */
            const data = document.createElement('datalist');
            data.id = 'input-dialog-items';
            data.appendChild(this._list);
            this._input.type = 'list';
            this._input.value = current;
            this._input.setAttribute('list', data.id);
            if (options.placeholder) {
                this._input.placeholder = options.placeholder;
            }
            this.node.appendChild(data);
        }
        else {
            /* Use select directly */
            this._input.parentElement.replaceChild(this._list, this._input);
        }
    }
    /**
     * Get the user choice
     */
    getValue() {
        if (this._editable) {
            return this._input.value;
        }
        else {
            return this._list.value;
        }
    }
}
/**
 * Widget body for input list dialog
 */
class InputMultipleItemsDialog extends InputDialogBase {
    /**
     * InputMultipleItemsDialog constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        super(options);
        let defaults = options.defaults || [];
        this._list = document.createElement('select');
        this._list.setAttribute('multiple', '');
        options.items.forEach(item => {
            const option = document.createElement('option');
            option.value = item;
            option.textContent = item;
            this._list.appendChild(option);
        });
        // use the select
        this._input.remove();
        this.node.appendChild(this._list);
        // select the current ones
        const htmlOptions = this._list.options;
        for (let i = 0; i < htmlOptions.length; i++) {
            const option = htmlOptions[i];
            if (defaults.includes(option.value)) {
                option.selected = true;
            }
            else {
                option.selected = false;
            }
        }
    }
    /**
     * Get the user choices
     */
    getValue() {
        let result = [];
        for (let opt of this._list.options) {
            if (opt.selected && !opt.classList.contains('hidden')) {
                result.push(opt.value || opt.text);
            }
        }
        return result;
    }
}
//# sourceMappingURL=inputdialog.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @lumino/virtualdom@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/virtualdom/dist/index.es6.js)
var virtualdom_dist_index_es6_js_ = __webpack_require__(17197);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/licenses.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








const FILTER_SECTION_TITLE_CLASS = 'jp-Licenses-Filters-title';
/**
 * A license viewer
 */
class Licenses extends index_es6_js_.SplitPanel {
    constructor(options) {
        super();
        this.addClass('jp-Licenses');
        this.model = options.model;
        this.initLeftPanel();
        this.initFilters();
        this.initBundles();
        this.initGrid();
        this.initLicenseText();
        this.setRelativeSizes([1, 2, 3]);
        void this.model.initLicenses().then(() => this._updateBundles());
        this.model.trackerDataChanged.connect(() => {
            this.title.label = this.model.title;
        });
    }
    /**
     * Handle disposing of the widget
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._bundles.currentChanged.disconnect(this.onBundleSelected, this);
        this.model.dispose();
        super.dispose();
    }
    /**
     * Initialize the left area for filters and bundles
     */
    initLeftPanel() {
        this._leftPanel = new index_es6_js_.Panel();
        this._leftPanel.addClass('jp-Licenses-FormArea');
        this.addWidget(this._leftPanel);
        index_es6_js_.SplitPanel.setStretch(this._leftPanel, 1);
    }
    /**
     * Initialize the filters
     */
    initFilters() {
        this._filters = new Licenses.Filters(this.model);
        index_es6_js_.SplitPanel.setStretch(this._filters, 1);
        this._leftPanel.addWidget(this._filters);
    }
    /**
     * Initialize the listing of available bundles
     */
    initBundles() {
        this._bundles = new index_es6_js_.TabBar({
            orientation: 'vertical',
            renderer: new Licenses.BundleTabRenderer(this.model)
        });
        this._bundles.addClass('jp-Licenses-Bundles');
        index_es6_js_.SplitPanel.setStretch(this._bundles, 1);
        this._leftPanel.addWidget(this._bundles);
        this._bundles.currentChanged.connect(this.onBundleSelected, this);
        this.model.stateChanged.connect(() => this._bundles.update());
    }
    /**
     * Initialize the listing of packages within the current bundle
     */
    initGrid() {
        this._grid = new Licenses.Grid(this.model);
        index_es6_js_.SplitPanel.setStretch(this._grid, 1);
        this.addWidget(this._grid);
    }
    /**
     * Initialize the full text of the current package
     */
    initLicenseText() {
        this._licenseText = new Licenses.FullText(this.model);
        index_es6_js_.SplitPanel.setStretch(this._grid, 1);
        this.addWidget(this._licenseText);
    }
    /**
     * Event handler for updating the model with the current bundle
     */
    onBundleSelected() {
        var _a;
        if ((_a = this._bundles.currentTitle) === null || _a === void 0 ? void 0 : _a.label) {
            this.model.currentBundleName = this._bundles.currentTitle.label;
        }
    }
    /**
     * Update the bundle tabs.
     */
    _updateBundles() {
        this._bundles.clearTabs();
        let i = 0;
        const { currentBundleName } = this.model;
        let currentIndex = 0;
        for (const bundle of this.model.bundleNames) {
            const tab = new index_es6_js_.Widget();
            tab.title.label = bundle;
            if (bundle === currentBundleName) {
                currentIndex = i;
            }
            this._bundles.insertTab(++i, tab.title);
        }
        this._bundles.currentIndex = currentIndex;
    }
}
/** A namespace for license components */
(function (Licenses) {
    /**
     * License report formats understood by the server (once lower-cased)
     */
    Licenses.REPORT_FORMATS = {
        markdown: {
            id: 'markdown',
            title: 'Markdown',
            icon: index_js_.markdownIcon
        },
        csv: {
            id: 'csv',
            title: 'CSV',
            icon: index_js_.spreadsheetIcon
        },
        json: {
            id: 'json',
            title: 'JSON',
            icon: index_js_.jsonIcon
        }
    };
    /**
     * The default format (most human-readable)
     */
    Licenses.DEFAULT_FORMAT = 'markdown';
    /**
     * A class used for fetching licenses from the server.
     */
    class LicensesClient {
        /**
         * Create a new license client.
         */
        constructor(options = {}) {
            var _a;
            this._preferredLicensesUrl = options.licensesUrl;
            this._serverSettings =
                (_a = options.serverSettings) !== null && _a !== void 0 ? _a : services_lib_index_js_.ServerConnection.makeSettings();
        }
        /**
         * Download the licenses in the requested format.
         */
        async download(options) {
            const url = `${this._licensesUrl}?format=${options.format}&download=1`;
            const element = document.createElement('a');
            element.href = url;
            element.download = '';
            document.body.appendChild(element);
            element.click();
            document.body.removeChild(element);
            URL.revokeObjectURL(url);
            return void 0;
        }
        /**
         * Fetch the license bundles from the server.
         */
        async getBundles() {
            const response = await services_lib_index_js_.ServerConnection.makeRequest(this._licensesUrl, {}, this._serverSettings);
            return response.json();
        }
        /**
         * The licences URL.
         *
         * This respects runtime changes to the `licensesUrl` page config option.
         */
        get _licensesUrl() {
            var _a;
            return ((_a = this._preferredLicensesUrl) !== null && _a !== void 0 ? _a : coreutils_lib_index_js_.URLExt.join(this._serverSettings.baseUrl, coreutils_lib_index_js_.PageConfig.getOption('licensesUrl')) + '/');
        }
    }
    Licenses.LicensesClient = LicensesClient;
    /**
     * A model for license data
     */
    class Model extends index_js_.VDomModel {
        constructor(options) {
            super();
            this._selectedPackageChanged = new signaling_dist_index_es6_js_.Signal(this);
            this._trackerDataChanged = new signaling_dist_index_es6_js_.Signal(this);
            this._currentPackageIndex = 0;
            this._licensesReady = new dist_index_js_.PromiseDelegate();
            this._packageFilter = {};
            this._trans = options.trans;
            this._client = options.client;
            if (options.currentBundleName) {
                this._currentBundleName = options.currentBundleName;
            }
            if (options.packageFilter) {
                this._packageFilter = options.packageFilter;
            }
            if (options.currentPackageIndex) {
                this._currentPackageIndex = options.currentPackageIndex;
            }
        }
        /**
         * Handle the initial request for the licenses from the server.
         */
        async initLicenses() {
            try {
                this._serverResponse = await this._client.getBundles();
                this._licensesReady.resolve();
                this.stateChanged.emit(void 0);
            }
            catch (err) {
                this._licensesReady.reject(err);
            }
        }
        /**
         * Download the licenses in the requested format.
         */
        async download(options) {
            return this._client.download(options);
        }
        /**
         * A promise that resolves when the licenses from the server change
         */
        get selectedPackageChanged() {
            return this._selectedPackageChanged;
        }
        /**
         * A promise that resolves when the trackable data changes
         */
        get trackerDataChanged() {
            return this._trackerDataChanged;
        }
        /**
         * The names of the license bundles available
         */
        get bundleNames() {
            var _a;
            return Object.keys(((_a = this._serverResponse) === null || _a === void 0 ? void 0 : _a.bundles) || {});
        }
        /**
         * The current license bundle
         */
        get currentBundleName() {
            if (this._currentBundleName) {
                return this._currentBundleName;
            }
            if (this.bundleNames.length) {
                return this.bundleNames[0];
            }
            return null;
        }
        /**
         * Set the current license bundle, and reset the selected index
         */
        set currentBundleName(currentBundleName) {
            if (this._currentBundleName !== currentBundleName) {
                this._currentBundleName = currentBundleName;
                this.stateChanged.emit(void 0);
                this._trackerDataChanged.emit(void 0);
            }
        }
        /**
         * A promise that resolves when the licenses are available from the server
         */
        get licensesReady() {
            return this._licensesReady.promise;
        }
        /**
         * All the license bundles, keyed by the distributing packages
         */
        get bundles() {
            var _a;
            return ((_a = this._serverResponse) === null || _a === void 0 ? void 0 : _a.bundles) || {};
        }
        /**
         * The index of the currently-selected package within its license bundle
         */
        get currentPackageIndex() {
            return this._currentPackageIndex;
        }
        /**
         * Update the currently-selected package within its license bundle
         */
        set currentPackageIndex(currentPackageIndex) {
            if (this._currentPackageIndex === currentPackageIndex) {
                return;
            }
            this._currentPackageIndex = currentPackageIndex;
            this._selectedPackageChanged.emit(void 0);
            this.stateChanged.emit(void 0);
            this._trackerDataChanged.emit(void 0);
        }
        /**
         * The license data for the currently-selected package
         */
        get currentPackage() {
            var _a;
            if (this.currentBundleName &&
                this.bundles &&
                this._currentPackageIndex != null) {
                return this.getFilteredPackages(((_a = this.bundles[this.currentBundleName]) === null || _a === void 0 ? void 0 : _a.packages) || [])[this._currentPackageIndex];
            }
            return null;
        }
        /**
         * A translation bundle
         */
        get trans() {
            return this._trans;
        }
        get title() {
            return `${this._currentBundleName || ''} ${this._trans.__('Licenses')}`.trim();
        }
        /**
         * The current package filter
         */
        get packageFilter() {
            return this._packageFilter;
        }
        set packageFilter(packageFilter) {
            this._packageFilter = packageFilter;
            this.stateChanged.emit(void 0);
            this._trackerDataChanged.emit(void 0);
        }
        /**
         * Get filtered packages from current bundle where at least one token of each
         * key is present.
         */
        getFilteredPackages(allRows) {
            let rows = [];
            let filters = Object.entries(this._packageFilter)
                .filter(([k, v]) => v && `${v}`.trim().length)
                .map(([k, v]) => [k, `${v}`.toLowerCase().trim().split(' ')]);
            for (const row of allRows) {
                let keyHits = 0;
                for (const [key, bits] of filters) {
                    let bitHits = 0;
                    let rowKeyValue = `${row[key]}`.toLowerCase();
                    for (const bit of bits) {
                        if (rowKeyValue.includes(bit)) {
                            bitHits += 1;
                        }
                    }
                    if (bitHits) {
                        keyHits += 1;
                    }
                }
                if (keyHits === filters.length) {
                    rows.push(row);
                }
            }
            return Object.values(rows);
        }
    }
    Licenses.Model = Model;
    /**
     * A filter form for limiting the packages displayed
     */
    class Filters extends index_js_.VDomRenderer {
        constructor(model) {
            super(model);
            /**
             * Render a filter input
             */
            this.renderFilter = (key) => {
                const value = this.model.packageFilter[key] || '';
                return (react_index_js_.createElement("input", { type: "text", name: key, defaultValue: value, className: "jp-mod-styled", onInput: this.onFilterInput }));
            };
            /**
             * Handle a filter input changing
             */
            this.onFilterInput = (evt) => {
                const input = evt.currentTarget;
                const { name, value } = input;
                this.model.packageFilter = { ...this.model.packageFilter, [name]: value };
            };
            this.addClass('jp-Licenses-Filters');
            this.addClass('jp-RenderedHTMLCommon');
        }
        render() {
            const { trans } = this.model;
            return (react_index_js_.createElement("div", null,
                react_index_js_.createElement("label", null,
                    react_index_js_.createElement("strong", { className: FILTER_SECTION_TITLE_CLASS }, trans.__('Filter Licenses By'))),
                react_index_js_.createElement("ul", null,
                    react_index_js_.createElement("li", null,
                        react_index_js_.createElement("label", null, trans.__('Package')),
                        this.renderFilter('name')),
                    react_index_js_.createElement("li", null,
                        react_index_js_.createElement("label", null, trans.__('Version')),
                        this.renderFilter('versionInfo')),
                    react_index_js_.createElement("li", null,
                        react_index_js_.createElement("label", null, trans.__('License')),
                        this.renderFilter('licenseId'))),
                react_index_js_.createElement("label", null,
                    react_index_js_.createElement("strong", { className: FILTER_SECTION_TITLE_CLASS }, trans.__('Distributions')))));
        }
    }
    Licenses.Filters = Filters;
    /**
     * A fancy bundle renderer with the package count
     */
    class BundleTabRenderer extends index_es6_js_.TabBar.Renderer {
        constructor(model) {
            super();
            this.closeIconSelector = '.lm-TabBar-tabCloseIcon';
            this.model = model;
        }
        /**
         * Render a full bundle
         */
        renderTab(data) {
            let title = data.title.caption;
            let key = this.createTabKey(data);
            let style = this.createTabStyle(data);
            let className = this.createTabClass(data);
            let dataset = this.createTabDataset(data);
            return virtualdom_dist_index_es6_js_.h.li({ key, className, title, style, dataset }, this.renderIcon(data), this.renderLabel(data), this.renderCountBadge(data));
        }
        /**
         * Render the package count
         */
        renderCountBadge(data) {
            const bundle = data.title.label;
            const { bundles } = this.model;
            const packages = this.model.getFilteredPackages((bundles && bundle ? bundles[bundle].packages : []) || []);
            return virtualdom_dist_index_es6_js_.h.label({}, `${packages.length}`);
        }
    }
    Licenses.BundleTabRenderer = BundleTabRenderer;
    /**
     * A grid of licenses
     */
    class Grid extends index_js_.VDomRenderer {
        constructor(model) {
            super(model);
            /**
             * Render a single package's license information
             */
            this.renderRow = (row, index) => {
                const selected = index === this.model.currentPackageIndex;
                const onCheck = () => (this.model.currentPackageIndex = index);
                return (react_index_js_.createElement("tr", { key: row.name, className: selected ? 'jp-mod-selected' : '', onClick: onCheck },
                    react_index_js_.createElement("td", null,
                        react_index_js_.createElement("input", { type: "radio", name: "show-package-license", value: index, onChange: onCheck, checked: selected })),
                    react_index_js_.createElement("th", null, row.name),
                    react_index_js_.createElement("td", null,
                        react_index_js_.createElement("code", null, row.versionInfo)),
                    react_index_js_.createElement("td", null,
                        react_index_js_.createElement("code", null, row.licenseId))));
            };
            this.addClass('jp-Licenses-Grid');
            this.addClass('jp-RenderedHTMLCommon');
        }
        /**
         * Render a grid of package license information
         */
        render() {
            var _a;
            const { bundles, currentBundleName, trans } = this.model;
            const filteredPackages = this.model.getFilteredPackages(bundles && currentBundleName
                ? ((_a = bundles[currentBundleName]) === null || _a === void 0 ? void 0 : _a.packages) || []
                : []);
            if (!filteredPackages.length) {
                return (react_index_js_.createElement("blockquote", null,
                    react_index_js_.createElement("em", null, trans.__('No Packages found'))));
            }
            return (react_index_js_.createElement("form", null,
                react_index_js_.createElement("table", null,
                    react_index_js_.createElement("thead", null,
                        react_index_js_.createElement("tr", null,
                            react_index_js_.createElement("td", null),
                            react_index_js_.createElement("th", null, trans.__('Package')),
                            react_index_js_.createElement("th", null, trans.__('Version')),
                            react_index_js_.createElement("th", null, trans.__('License')))),
                    react_index_js_.createElement("tbody", null, filteredPackages.map(this.renderRow)))));
        }
    }
    Licenses.Grid = Grid;
    /**
     * A package's full license text
     */
    class FullText extends index_js_.VDomRenderer {
        constructor(model) {
            super(model);
            this.addClass('jp-Licenses-Text');
            this.addClass('jp-RenderedHTMLCommon');
            this.addClass('jp-RenderedMarkdown');
        }
        /**
         * Render the license text, or a null state if no package is selected
         */
        render() {
            const { currentPackage, trans } = this.model;
            let head = '';
            let quote = trans.__('No Package selected');
            let code = '';
            if (currentPackage) {
                const { name, versionInfo, licenseId, extractedText } = currentPackage;
                head = `${name} v${versionInfo}`;
                quote = `${trans.__('License')}: ${licenseId || trans.__('No License ID found')}`;
                code = extractedText || trans.__('No License Text found');
            }
            return [
                react_index_js_.createElement("h1", { key: "h1" }, head),
                react_index_js_.createElement("blockquote", { key: "quote" },
                    react_index_js_.createElement("em", null, quote)),
                react_index_js_.createElement("code", { key: "code" }, code)
            ];
        }
    }
    Licenses.FullText = FullText;
})(Licenses || (Licenses = {}));
//# sourceMappingURL=licenses.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/printing.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Any object is "printable" if it implements the `IPrintable` interface.
 *
 * To do this it, it must have a method called `Printing.symbol` which returns either a function
 * to print the object or null if it cannot be printed.
 *
 * One way of printing is to use the `printWidget` function, which creates a hidden iframe
 * and copies the DOM nodes from your widget to that iframe and printing just that iframe.
 *
 * Another way to print is to use the `printURL` function, which takes a URL and prints that page.
 */
var Printing;
(function (Printing) {
    /**
     * Symbol to use for a method that returns a function to print an object.
     */
    Printing.symbol = Symbol('printable');
    /**
     * Returns whether an object implements a print method.
     */
    function isPrintable(a) {
        if (typeof a !== 'object' || !a) {
            return false;
        }
        return Printing.symbol in a;
    }
    Printing.isPrintable = isPrintable;
    /**
     * Returns the print function for an object, or null if it does not provide a handler.
     */
    function getPrintFunction(val) {
        if (isPrintable(val)) {
            return val[Printing.symbol]();
        }
        return null;
    }
    Printing.getPrintFunction = getPrintFunction;
    /**
     * Prints a widget by copying it's DOM node
     * to a hidden iframe and printing that iframe.
     */
    function printWidget(widget) {
        return printContent(widget.node);
    }
    Printing.printWidget = printWidget;
    /**
     * Prints a URL by loading it into an iframe.
     *
     * @param url URL to load into an iframe.
     * @param serverSettings The server settings to use for the request.
     */
    async function printURL(url, serverSettings) {
        const settings = serverSettings !== null && serverSettings !== void 0 ? serverSettings : services_lib_index_js_.ServerConnection.makeSettings();
        const text = await (await services_lib_index_js_.ServerConnection.makeRequest(url, {}, settings)).text();
        return printContent(text);
    }
    Printing.printURL = printURL;
    /**
     * Prints a URL or an element in an iframe and then removes the iframe after printing.
     */
    async function printContent(textOrEl) {
        const isText = typeof textOrEl === 'string';
        const iframe = createIFrame();
        const parent = window.document.body;
        parent.appendChild(iframe);
        if (isText) {
            iframe.srcdoc = textOrEl;
            await resolveWhenLoaded(iframe);
        }
        else {
            iframe.src = 'about:blank';
            await resolveWhenLoaded(iframe);
            setIFrameNode(iframe, textOrEl);
        }
        const printed = resolveAfterEvent();
        launchPrint(iframe.contentWindow);
        // Once the print dialog has been dismissed, we regain event handling,
        // and it should be safe to discard the hidden iframe.
        await printed;
        parent.removeChild(iframe);
    }
    /**
     * Creates a new hidden iframe and appends it to the document
     *
     * Modified from
     * https://github.com/joseluisq/printd/blob/eb7948d602583c055ab6dee3ee294b6a421da4b6/src/index.ts#L24
     */
    function createIFrame() {
        const el = window.document.createElement('iframe');
        // We need both allow-modals and allow-same-origin to be able to
        // call print in the iframe.
        // We intentionally do not allow scripts:
        // https://github.com/jupyterlab/jupyterlab/pull/5850#pullrequestreview-230899790
        el.setAttribute('sandbox', 'allow-modals allow-same-origin');
        const css = 'visibility:hidden;width:0;height:0;position:absolute;z-index:-9999;bottom:0;';
        el.setAttribute('style', css);
        el.setAttribute('width', '0');
        el.setAttribute('height', '0');
        return el;
    }
    /**
     * Copies a node from the base document to the iframe.
     */
    function setIFrameNode(iframe, node) {
        iframe.contentDocument.body.appendChild(node.cloneNode(true));
        iframe.contentDocument.close();
    }
    /**
     * Promise that resolves when all resources are loaded in the window.
     */
    function resolveWhenLoaded(iframe) {
        return new Promise(resolve => {
            iframe.onload = () => resolve();
        });
    }
    /**
     * A promise that resolves after the next mousedown, mousemove, or
     * keydown event. We use this as a proxy for determining when the
     * main window has regained control after the print dialog is removed.
     *
     * We can't use the usual window.onafterprint handler because we
     * disallow Javascript execution in the print iframe.
     */
    function resolveAfterEvent() {
        return new Promise(resolve => {
            const onEvent = () => {
                document.removeEventListener('mousemove', onEvent, true);
                document.removeEventListener('mousedown', onEvent, true);
                document.removeEventListener('keydown', onEvent, true);
                resolve();
            };
            document.addEventListener('mousemove', onEvent, true);
            document.addEventListener('mousedown', onEvent, true);
            document.addEventListener('keydown', onEvent, true);
        });
    }
    /**
     * Prints a content window.
     */
    function launchPrint(contentWindow) {
        const result = contentWindow.document.execCommand('print', false);
        // execCommand won't work in firefox so we call the `print` method instead if it fails
        // https://github.com/joseluisq/printd/blob/eb7948d602583c055ab6dee3ee294b6a421da4b6/src/index.ts#L148
        if (!result) {
            contentWindow.print();
        }
    }
})(Printing || (Printing = {}));
//# sourceMappingURL=printing.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/mainareawidget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * A flag to indicate that event handlers are caught in the capture phase.
 */
const USE_CAPTURE = true;
/**
 * A widget meant to be contained in the JupyterLab main area.
 *
 * #### Notes
 * Mirrors all of the `title` attributes of the content.
 * This widget is `closable` by default.
 * This widget is automatically disposed when closed.
 * This widget ensures its own focus when activated.
 */
class MainAreaWidget extends index_es6_js_.Widget {
    /**
     * Construct a new main area widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        this._changeGuard = false;
        this._spinner = new index_js_.Spinner();
        this._isRevealed = false;
        this._evtMouseDown = () => {
            if (!this.node.contains(document.activeElement)) {
                this._focusContent();
            }
        };
        this.addClass('jp-MainAreaWidget');
        // Set contain=strict to avoid many forced layout rendering while adding cells.
        // Don't forget to remove the CSS class when your remove the spinner to allow
        // the content to be rendered.
        // @see https://github.com/jupyterlab/jupyterlab/issues/9381
        this.addClass('jp-MainAreaWidget-ContainStrict');
        this.id = DOMUtils.createDomID();
        const trans = (options.translator || lib_index_js_.nullTranslator).load('jupyterlab');
        const content = (this._content = options.content);
        content.node.setAttribute('role', 'region');
        content.node.setAttribute('aria-label', trans.__('main area content'));
        const toolbar = (this._toolbar =
            options.toolbar || new index_js_.ReactiveToolbar({ noFocusOnClick: true }));
        toolbar.node.setAttribute('role', 'toolbar');
        toolbar.node.setAttribute('aria-label', trans.__('main area toolbar'));
        const contentHeader = (this._contentHeader =
            options.contentHeader ||
                new index_es6_js_.BoxPanel({
                    direction: 'top-to-bottom',
                    spacing: 0
                }));
        const layout = (this.layout = new index_es6_js_.BoxLayout({ spacing: 0 }));
        layout.direction = 'top-to-bottom';
        index_es6_js_.BoxLayout.setStretch(toolbar, 0);
        index_es6_js_.BoxLayout.setStretch(contentHeader, 0);
        index_es6_js_.BoxLayout.setStretch(content, 1);
        layout.addWidget(toolbar);
        layout.addWidget(contentHeader);
        layout.addWidget(content);
        if (!content.id) {
            content.id = DOMUtils.createDomID();
        }
        content.node.tabIndex = -1;
        this._updateTitle();
        content.title.changed.connect(this._updateTitle, this);
        this.title.closable = true;
        this.title.changed.connect(this._updateContentTitle, this);
        if (options.reveal) {
            this.node.appendChild(this._spinner.node);
            this._revealed = options.reveal
                .then(() => {
                if (content.isDisposed) {
                    this.dispose();
                    return;
                }
                content.disposed.connect(() => this.dispose());
                const active = document.activeElement === this._spinner.node;
                this._disposeSpinner();
                this._isRevealed = true;
                if (active) {
                    this._focusContent();
                }
            })
                .catch(e => {
                // Show a revealed promise error.
                const error = new index_es6_js_.Widget();
                error.addClass('jp-MainAreaWidget-error');
                // Show the error to the user.
                const pre = document.createElement('pre');
                pre.textContent = String(e);
                error.node.appendChild(pre);
                index_es6_js_.BoxLayout.setStretch(error, 1);
                this._disposeSpinner();
                content.dispose();
                this._content = null;
                toolbar.dispose();
                this._toolbar = null;
                layout.addWidget(error);
                this._isRevealed = true;
                throw error;
            });
        }
        else {
            // Handle no reveal promise.
            this._spinner.dispose();
            this.removeClass('jp-MainAreaWidget-ContainStrict');
            content.disposed.connect(() => this.dispose());
            this._isRevealed = true;
            this._revealed = Promise.resolve(undefined);
        }
    }
    /**
     * Print method. Deferred to content.
     */
    [Printing.symbol]() {
        if (!this._content) {
            return null;
        }
        return Printing.getPrintFunction(this._content);
    }
    /**
     * The content hosted by the widget.
     */
    get content() {
        return this._content;
    }
    /**
     * The toolbar hosted by the widget.
     */
    get toolbar() {
        return this._toolbar;
    }
    /**
     * A panel for widgets that sit between the toolbar and the content.
     * Imagine a formatting toolbar, notification headers, etc.
     */
    get contentHeader() {
        return this._contentHeader;
    }
    /**
     * Whether the content widget or an error is revealed.
     */
    get isRevealed() {
        return this._isRevealed;
    }
    /**
     * A promise that resolves when the widget is revealed.
     */
    get revealed() {
        return this._revealed;
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        if (this._isRevealed) {
            this._focusContent();
        }
        else {
            this._spinner.node.focus();
        }
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        // Focus content in capture phase to ensure relevant commands operate on the
        // current main area widget.
        // Add the event listener directly instead of using `handleEvent` in order
        // to save sub-classes from needing to reason about calling it as well.
        this.node.addEventListener('mousedown', this._evtMouseDown, USE_CAPTURE);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        this.node.removeEventListener('mousedown', this._evtMouseDown, USE_CAPTURE);
        super.onBeforeDetach(msg);
    }
    /**
     * Handle `'close-request'` messages.
     */
    onCloseRequest(msg) {
        this.dispose();
    }
    /**
     * Handle `'update-request'` messages by forwarding them to the content.
     */
    onUpdateRequest(msg) {
        if (this._content) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(this._content, msg);
        }
    }
    _disposeSpinner() {
        this.node.removeChild(this._spinner.node);
        this._spinner.dispose();
        this.removeClass('jp-MainAreaWidget-ContainStrict');
    }
    /**
     * Update the title based on the attributes of the child widget.
     */
    _updateTitle() {
        if (this._changeGuard || !this.content) {
            return;
        }
        this._changeGuard = true;
        const content = this.content;
        this.title.label = content.title.label;
        this.title.mnemonic = content.title.mnemonic;
        this.title.icon = content.title.icon;
        this.title.iconClass = content.title.iconClass;
        this.title.iconLabel = content.title.iconLabel;
        this.title.caption = content.title.caption;
        this.title.className = content.title.className;
        this.title.dataset = content.title.dataset;
        this._changeGuard = false;
    }
    /**
     * Update the content title based on attributes of the main widget.
     */
    _updateContentTitle() {
        if (this._changeGuard || !this.content) {
            return;
        }
        this._changeGuard = true;
        const content = this.content;
        content.title.label = this.title.label;
        content.title.mnemonic = this.title.mnemonic;
        content.title.icon = this.title.icon;
        content.title.iconClass = this.title.iconClass;
        content.title.iconLabel = this.title.iconLabel;
        content.title.caption = this.title.caption;
        content.title.className = this.title.className;
        content.title.dataset = this.title.dataset;
        this._changeGuard = false;
    }
    /**
     * Give focus to the content.
     */
    _focusContent() {
        if (!this.content) {
            return;
        }
        // Focus the content node if we aren't already focused on it or a
        // descendent.
        if (!this.content.node.contains(document.activeElement)) {
            this.content.node.focus();
        }
        // Activate the content asynchronously (which may change the focus).
        this.content.activate();
    }
}
//# sourceMappingURL=mainareawidget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/menufactory.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * Helper functions to build a menu from the settings
 */
var MenuFactory;
(function (MenuFactory) {
    /**
     * Create menus from their description
     *
     * @param data Menubar description
     * @param menuFactory Factory for empty menu
     */
    function createMenus(data, menuFactory) {
        return data
            .filter(item => !item.disabled)
            .sort((a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : Infinity) - ((_b = b.rank) !== null && _b !== void 0 ? _b : Infinity); })
            .map(menuItem => {
            return dataToMenu(menuItem, menuFactory);
        });
    }
    MenuFactory.createMenus = createMenus;
    /**
     * Convert a menu description in a JupyterLabMenu object
     *
     * @param item Menu description
     * @param menuFactory Empty menu factory
     * @returns The menu widget
     */
    function dataToMenu(item, menuFactory) {
        var _a, _b;
        const menu = menuFactory(item);
        menu.id = item.id;
        // Set the label in case the menu factory did not.
        if (!menu.title.label) {
            menu.title.label = (_a = item.label) !== null && _a !== void 0 ? _a : coreutils_lib_index_js_.Text.titleCase(menu.id.trim());
        }
        if (item.icon) {
            menu.title.icon = index_js_.LabIcon.resolve({ icon: item.icon });
        }
        if (item.mnemonic !== undefined) {
            menu.title.mnemonic = item.mnemonic;
        }
        (_b = item.items) === null || _b === void 0 ? void 0 : _b.filter(item => !item.disabled).sort((a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : Infinity) - ((_b = b.rank) !== null && _b !== void 0 ? _b : Infinity); }).map(item => {
            addItem(item, menu, menuFactory);
        });
        return menu;
    }
    /**
     * Convert an item description in a context menu item object
     *
     * @param item Context menu item
     * @param menu Context menu to populate
     * @param menuFactory Empty menu factory
     */
    function addContextItem(item, menu, menuFactory) {
        const { submenu, ...newItem } = item;
        // Commands may not have been registered yet; so we don't force it to exist
        menu.addItem({
            ...newItem,
            submenu: submenu ? dataToMenu(submenu, menuFactory) : null
        });
    }
    MenuFactory.addContextItem = addContextItem;
    /**
     * Convert an item description in a menu item object
     *
     * @param item Menu item
     * @param menu Menu to populate
     * @param menuFactory Empty menu factory
     */
    function addItem(item, menu, menuFactory) {
        const { submenu, ...newItem } = item;
        // Commands may not have been registered yet; so we don't force it to exist
        menu.addItem({
            ...newItem,
            submenu: submenu ? dataToMenu(submenu, menuFactory) : null
        });
    }
    /**
     * Update an existing list of menu and returns
     * the new elements.
     *
     * #### Note
     * New elements are added to the current menu list.
     *
     * @param menus Current menus
     * @param data New description to take into account
     * @param menuFactory Empty menu factory
     * @returns Newly created menus
     */
    function updateMenus(menus, data, menuFactory) {
        const newMenus = [];
        data.forEach(item => {
            const menu = menus.find(menu => menu.id === item.id);
            if (menu) {
                mergeMenus(item, menu, menuFactory);
            }
            else {
                if (!item.disabled) {
                    newMenus.push(dataToMenu(item, menuFactory));
                }
            }
        });
        menus.push(...newMenus);
        return newMenus;
    }
    MenuFactory.updateMenus = updateMenus;
    function mergeMenus(item, menu, menuFactory) {
        var _a;
        if (item.disabled) {
            menu.dispose();
        }
        else {
            (_a = item.items) === null || _a === void 0 ? void 0 : _a.forEach(entry => {
                var _a, _b;
                const existingItem = menu === null || menu === void 0 ? void 0 : menu.items.find((i, idx) => {
                    var _a, _b, _c;
                    return i.type === entry.type &&
                        i.command === ((_a = entry.command) !== null && _a !== void 0 ? _a : '') &&
                        ((_b = i.submenu) === null || _b === void 0 ? void 0 : _b.id) === ((_c = entry.submenu) === null || _c === void 0 ? void 0 : _c.id);
                });
                if (existingItem && entry.type !== 'separator') {
                    if (entry.disabled) {
                        menu.removeItem(existingItem);
                    }
                    else {
                        switch ((_a = entry.type) !== null && _a !== void 0 ? _a : 'command') {
                            case 'command':
                                if (entry.command) {
                                    if (!dist_index_js_.JSONExt.deepEqual(existingItem.args, (_b = entry.args) !== null && _b !== void 0 ? _b : {})) {
                                        addItem(entry, menu, menuFactory);
                                    }
                                }
                                break;
                            case 'submenu':
                                if (entry.submenu) {
                                    mergeMenus(entry.submenu, existingItem.submenu, menuFactory);
                                }
                        }
                    }
                }
                else {
                    addItem(entry, menu, menuFactory);
                }
            });
        }
    }
})(MenuFactory || (MenuFactory = {}));
//# sourceMappingURL=menufactory.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/notification.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


/**
 * Notification manager
 */
class NotificationManager {
    constructor() {
        this._isDisposed = false;
        this._queue = [];
        this._changed = new signaling_dist_index_es6_js_.Signal(this);
    }
    /**
     * Signal emitted whenever a notification changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Total number of notifications.
     */
    get count() {
        return this._queue.length;
    }
    /**
     * Whether the manager is disposed or not.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * The list of notifications.
     */
    get notifications() {
        return this._queue.slice();
    }
    /**
     * Dismiss one notification (specified by its id) or all if no id provided.
     *
     * @param id Notification id
     */
    dismiss(id) {
        if (typeof id === 'undefined') {
            const q = this._queue.slice();
            this._queue.length = 0;
            for (const notification of q) {
                this._changed.emit({
                    type: 'removed',
                    notification
                });
            }
        }
        else {
            const notificationIndex = this._queue.findIndex(n => n.id === id);
            if (notificationIndex > -1) {
                const notification = this._queue.splice(notificationIndex, 1)[0];
                this._changed.emit({
                    type: 'removed',
                    notification
                });
            }
        }
    }
    /**
     * Dispose the manager.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Test whether a notification exists or not.
     *
     * @param id Notification id
     * @returns Notification status
     */
    has(id) {
        return this._queue.findIndex(n => n.id === id) > -1;
    }
    /**
     * Add a new notification.
     *
     * This will trigger the `changed` signal with an `added` event.
     *
     * @param message Notification message
     * @param type Notification type
     * @param options Notification option
     * @returns Notification unique id
     */
    notify(message, type, options) {
        const now = Date.now();
        const { progress, ...othersOptions } = options;
        const notification = Object.freeze({
            id: dist_index_js_.UUID.uuid4(),
            createdAt: now,
            modifiedAt: now,
            message,
            type,
            options: {
                // By default notification will be silent
                autoClose: 0,
                progress: typeof progress === 'number'
                    ? Math.min(Math.max(0, progress), 1)
                    : progress,
                ...othersOptions
            }
        });
        this._queue.unshift(notification);
        this._changed.emit({
            type: 'added',
            notification
        });
        return notification.id;
    }
    /**
     * Update an existing notification.
     *
     * If the notification does not exists this won't do anything.
     *
     * Once updated the notification will be moved at the begin
     * of the notification stack.
     *
     * @param args Update options
     * @returns Whether the update was successful or not.
     */
    update(args) {
        const { id, message, actions, autoClose, data, progress, type } = args;
        const newProgress = typeof progress === 'number'
            ? Math.min(Math.max(0, progress), 1)
            : progress;
        const notificationIndex = this._queue.findIndex(n => n.id === id);
        if (notificationIndex > -1) {
            const oldNotification = this._queue[notificationIndex];
            // We need to create a new object as notification are frozen; i.e. cannot be edited
            const notification = Object.freeze({
                ...oldNotification,
                message: message !== null && message !== void 0 ? message : oldNotification.message,
                type: type !== null && type !== void 0 ? type : oldNotification.type,
                options: {
                    actions: actions !== null && actions !== void 0 ? actions : oldNotification.options.actions,
                    autoClose: autoClose !== null && autoClose !== void 0 ? autoClose : oldNotification.options.autoClose,
                    data: data !== null && data !== void 0 ? data : oldNotification.options.data,
                    progress: newProgress !== null && newProgress !== void 0 ? newProgress : oldNotification.options.progress
                },
                modifiedAt: Date.now()
            });
            this._queue.splice(notificationIndex, 1);
            this._queue.unshift(notification);
            this._changed.emit({
                type: 'updated',
                notification
            });
            return true;
        }
        return false;
    }
}
/**
 * Notification namespace
 */
var Notification;
(function (Notification) {
    /**
     * The global notification manager.
     */
    Notification.manager = new NotificationManager();
    /**
     * Dismiss one notification (specified by its id) or all if no id provided
     *
     * @param id notification id
     */
    function dismiss(id) {
        Notification.manager.dismiss(id);
    }
    Notification.dismiss = dismiss;
    /**
     * Helper function to emit a notification.
     *
     * #### Notes
     * The message will be truncated if longer than 140 characters.
     *
     * @param message Notification message
     * @param type Notification type
     * @param options Options for the error notification
     * @returns Notification unique id
     */
    function emit(message, type = 'default', options = {}) {
        return Notification.manager.notify(message, type, options);
    }
    Notification.emit = emit;
    /**
     * Helper function to emit an error notification.
     *
     * #### Notes
     * The message will be truncated if longer than 140 characters.
     *
     * @param message Notification message
     * @param options Options for the error notification
     * @returns Notification unique id
     */
    function error(message, options = {}) {
        return Notification.manager.notify(message, 'error', options);
    }
    Notification.error = error;
    /**
     * Helper function to emit an info notification.
     *
     * #### Notes
     * The message will be truncated if longer than 140 characters.
     *
     * @param message Notification message
     * @param options Options for the info notification
     * @returns Notification unique id
     */
    function info(message, options = {}) {
        return Notification.manager.notify(message, 'info', options);
    }
    Notification.info = info;
    /**
     * Helper function to show an in-progress notification.
     *
     * #### Notes
     * The message will be truncated if longer than 140 characters.
     *
     * @param promise Promise to wait for
     * @param options Options for the in-progress notification
     * @returns Notification unique id
     */
    function promise(promise, options) {
        var _a;
        const { pending, error, success } = options;
        const id = Notification.manager.notify(pending.message, 'in-progress', (_a = pending.options) !== null && _a !== void 0 ? _a : {});
        promise
            .then(result => {
            var _a, _b, _c;
            Notification.manager.update({
                id,
                message: success.message(result, (_a = success.options) === null || _a === void 0 ? void 0 : _a.data),
                type: 'success',
                ...success.options,
                data: (_c = (_b = success.options) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : result
            });
        })
            .catch(reason => {
            var _a, _b, _c;
            Notification.manager.update({
                id,
                message: error.message(reason, (_a = error.options) === null || _a === void 0 ? void 0 : _a.data),
                type: 'error',
                ...error.options,
                data: (_c = (_b = error.options) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : reason
            });
        });
        return id;
    }
    Notification.promise = promise;
    /**
     * Helper function to emit a success notification.
     *
     * #### Notes
     * The message will be truncated if longer than 140 characters.
     *
     * @param message Notification message
     * @param options Options for the success notification
     * @returns Notification unique id
     */
    function success(message, options = {}) {
        return Notification.manager.notify(message, 'success', options);
    }
    Notification.success = success;
    /**
     * Helper function to update a notification.
     *
     * If the notification does not exists, nothing will happen.
     *
     * Once updated the notification will be moved at the begin
     * of the notification stack.
     *
     * #### Notes
     * The message will be truncated if longer than 140 characters.
     *
     * @param args Update options
     * @returns Whether the update was successful or not.
     */
    function update(args) {
        return Notification.manager.update(args);
    }
    Notification.update = update;
    /**
     * Helper function to emit a warning notification.
     *
     * #### Notes
     * The message will be truncated if longer than 140 characters.
     *
     * @param message Notification message
     * @param options Options for the warning notification
     * @returns Notification unique id
     */
    function warning(message, options = {}) {
        return Notification.manager.notify(message, 'warning', options);
    }
    Notification.warning = warning;
})(Notification || (Notification = {}));
//# sourceMappingURL=notification.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/runningSessions.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * Half spacing between subitems in a status item, in pixels.
 */
const HALF_SPACING = 4;
/**
 * A pure functional component for rendering kernel and terminal sessions.
 *
 * @param props the props for the component.
 *
 * @returns a tsx component for the running sessions.
 */
function RunningSessionsComponent(props) {
    var _a, _b;
    const showKernels = (_a = props.showKernels) !== null && _a !== void 0 ? _a : true;
    const showTerminals = (_b = props.showTerminals) !== null && _b !== void 0 ? _b : props.terminals > 0;
    return (react_index_js_default().createElement(statusbar_lib_index_js_.GroupItem, { role: "button", tabIndex: 0, spacing: HALF_SPACING, onClick: props.handleClick, onKeyDown: props.handleKeyDown, style: { cursor: 'pointer' } },
        showTerminals ? (react_index_js_default().createElement(statusbar_lib_index_js_.GroupItem, { spacing: HALF_SPACING },
            react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { source: props.terminals }),
            react_index_js_default().createElement(index_js_.terminalIcon.react, { verticalAlign: "middle", stylesheet: "statusBar" }))) : null,
        showKernels ? (react_index_js_default().createElement(statusbar_lib_index_js_.GroupItem, { spacing: HALF_SPACING },
            react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { source: props.sessions }),
            react_index_js_default().createElement(index_js_.kernelIcon.react, { verticalAlign: "middle", stylesheet: "statusBar" }))) : null));
}
/**
 * A VDomRenderer for a RunningSessions status item.
 */
class RunningSessions extends index_js_.VDomRenderer {
    /**
     * Create a new RunningSessions widget.
     */
    constructor(opts) {
        super(new RunningSessions.Model());
        this._serviceManager = opts.serviceManager;
        this._handleClick = opts.onClick;
        this._handleKeyDown = opts.onKeyDown;
        this.translator = opts.translator || lib_index_js_.nullTranslator;
        this._showKernels = opts.showKernels;
        this._showTerminals = opts.showTerminals;
        this._trans = this.translator.load('jupyterlab');
        this._serviceManager.sessions.runningChanged.connect(this._onSessionsRunningChanged, this);
        this._serviceManager.terminals.runningChanged.connect(this._onTerminalsRunningChanged, this);
        this.addClass('jp-mod-highlighted');
    }
    /**
     * Render the running sessions widget.
     */
    render() {
        if (!this.model) {
            return null;
        }
        // TODO-TRANS: Should probably be handled differently.
        // This is more localizable friendly: "Terminals: %1 | Kernels: %2"
        // Generate a localized caption for the tooltip
        const caption = this._trans.__('%1 Terminals, %2 Kernel sessions', this.model.terminals, this.model.sessions);
        // Explicitly synchronize the title attribute with the Lumino widget's DOM
        // This ensures the tooltip displays correctly when hovering over the widget
        this.node.title = caption;
        return (react_index_js_default().createElement(RunningSessionsComponent, { sessions: this.model.sessions, terminals: this.model.terminals, handleClick: this._handleClick, handleKeyDown: this._handleKeyDown, showKernels: this._showKernels, showTerminals: this._showTerminals }));
    }
    /**
     * Dispose of the status item.
     */
    dispose() {
        super.dispose();
        this._serviceManager.sessions.runningChanged.disconnect(this._onSessionsRunningChanged, this);
        this._serviceManager.terminals.runningChanged.disconnect(this._onTerminalsRunningChanged, this);
    }
    /**
     * Set the number of kernel sessions when the list changes.
     */
    _onSessionsRunningChanged(manager, sessions) {
        this.model.sessions = sessions.length;
    }
    /**
     * Set the number of terminal sessions when the list changes.
     */
    _onTerminalsRunningChanged(manager, terminals) {
        this.model.terminals = terminals.length;
    }
}
/**
 * A namespace for RunningSessions statics.
 */
(function (RunningSessions) {
    /**
     * A VDomModel for the RunningSessions status item.
     */
    class Model extends index_js_.VDomModel {
        constructor() {
            super(...arguments);
            this._terminals = 0;
            this._sessions = 0;
        }
        /**
         * The number of active kernel sessions.
         */
        get sessions() {
            return this._sessions;
        }
        set sessions(sessions) {
            const oldSessions = this._sessions;
            this._sessions = sessions;
            if (oldSessions !== this._sessions) {
                this.stateChanged.emit(void 0);
            }
        }
        /**
         * The number of active terminal sessions.
         */
        get terminals() {
            return this._terminals;
        }
        set terminals(terminals) {
            const oldTerminals = this._terminals;
            this._terminals = terminals;
            if (oldTerminals !== this._terminals) {
                this.stateChanged.emit(void 0);
            }
        }
    }
    RunningSessions.Model = Model;
})(RunningSessions || (RunningSessions = {}));
//# sourceMappingURL=runningSessions.js.map
// EXTERNAL MODULE: ../node_modules/sanitize-html/index.js
var sanitize_html = __webpack_require__(64926);
var sanitize_html_default = /*#__PURE__*/__webpack_require__.n(sanitize_html);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/sanitizer.js
/* eslint-disable camelcase */
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Helper class that contains regular expressions for inline CSS style validation.
 *
 * Which properties (and values) to allow is largely based on the Google Caja project:
 *   https://github.com/google/caja
 *
 * The regular expressions are largly based on the syntax definition found at
 * https://developer.mozilla.org/en-US/docs/Web/CSS.
 */
class CssProp {
    static reg(r) {
        return new RegExp('^' + r + '$', 'i');
    }
}
/*
 * Numeric base expressions used to help build more complex regular expressions
 */
CssProp.N = {
    integer: `[+-]?[0-9]+`,
    integer_pos: `[+]?[0-9]+`,
    integer_zero_ff: `([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])`,
    integer_non_zero: `[+-]?([1-9][0-9]*)`,
    integer_pos_non_zero: `[+]?([1-9][0-9]*)`,
    number: `[+-]?([0-9]*[.])?[0-9]+(e-?[0-9]*)?`,
    number_pos: `[+]?([0-9]*[.])?[0-9]+(e-?[0-9]*)?`,
    number_zero_hundred: `[+]?(([0-9]|[1-9][0-9])([.][0-9]+)?|100)`,
    number_zero_one: `[+]?(1([.][0]+)?|0?([.][0-9]+)?)`
};
/*
 * Base expressions of common CSS syntax elements
 */
CssProp._B = {
    angle: `(${CssProp.N.number}(deg|rad|grad|turn)|0)`,
    frequency: `${CssProp.N.number}(Hz|kHz)`,
    ident: String.raw `-?([_a-z]|[\xA0-\xFF]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\xA0-\xFF]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*`,
    len_or_perc: `(0|${CssProp.N.number}(px|em|rem|ex|in|cm|mm|pt|pc|%))`,
    length: `(${CssProp.N.number}(px|em|rem|ex|in|cm|mm|pt|pc)|0)`,
    length_pos: `(${CssProp.N.number_pos}(px|em|rem|ex|in|cm|mm|pt|pc)|0)`,
    percentage: `${CssProp.N.number}%`,
    percentage_pos: `${CssProp.N.number_pos}%`,
    percentage_zero_hundred: `${CssProp.N.number_zero_hundred}%`,
    string: String.raw `(\"([^\n\r\f\\"]|\\\n|\r\n|\r|\f|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*\")|(\'([^\n\r\f\\']|\\\n|\r\n|\r|\f|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*\')`,
    time: `${CssProp.N.number}(s|ms)`,
    url: `url\\(.*?\\)`,
    z_index: `[+-]?[0-9]{1,7}`
};
/*
 * Extended base expressions of common CSS syntax elements
 */
CssProp._B1 = {
    flex: `(${CssProp.N.number}|${CssProp._B.len_or_perc}|none|auto)\\s*((${CssProp.N.number}|${CssProp._B.len_or_perc}|auto)\\s*){0,2}`,
    fixed_breadth: `${CssProp._B.len_or_perc}`,
    grid_line: `auto|${CssProp._B.ident}|(${CssProp.N.integer_non_zero}(\\s+${CssProp._B.ident})?)|(span\\s+(${CssProp.N.integer_pos_non_zero}|${CssProp._B.ident}))`,
    line_names: String.raw `\[\s*${CssProp._B.ident}(\s+${CssProp._B.ident})*\s*\]`
};
CssProp._B2 = {
    inflexible_breadth: `${CssProp._B.len_or_perc}|auto|min-content|max-content`,
    track_breadth: `${CssProp._B.len_or_perc}|${CssProp._B1.flex}|auto|min-content|max-content`
};
CssProp._B3 = {
    fixed_size: `${CssProp._B1.fixed_breadth}|minmax\\(\\s*${CssProp._B2.inflexible_breadth}\\s*,\\s*${CssProp._B1.fixed_breadth}\\s*\\)|minmax\\(\\s*${CssProp._B1.fixed_breadth}\\s*,\\s*${CssProp._B2.track_breadth}\\s*\\)`,
    track_size: `${CssProp._B2.track_breadth}|minmax\\(\\s*${CssProp._B2.inflexible_breadth}\\s*,\\s*${CssProp._B2.track_breadth}\\s*\\)|fit-content\\(\\s*(${CssProp._B.len_or_perc}\\s*)*\\)`
};
CssProp._B4 = {
    name_repeat: `repeat\\(\\s*(${CssProp.N.integer_pos_non_zero}|auto-fill)\\s*,\\s*(${CssProp._B1.line_names})+\\s*\\)`,
    auto_repeat: `repeat\\(\\s*(auto-fill|auto-fit)\\s*,\\s*((${CssProp._B1.line_names}\\s+)?${CssProp._B3.fixed_size}\\s*)+(${CssProp._B1.line_names})?\\s*\\)`,
    fixed_repeat: `repeat\\(\\s*(${CssProp.N.integer_pos_non_zero})\\s*,\\s*((${CssProp._B1.line_names}\\s+)?${CssProp._B3.fixed_size}\\s*)+(${CssProp._B1.line_names})?\\s*\\)`
};
CssProp._B5 = {
    auto_track_list: `(${CssProp._B1.line_names}\\s*)?(${CssProp._B3.fixed_size}|${CssProp._B4.fixed_repeat})*(${CssProp._B1.line_names}\\s*)?${CssProp._B4.auto_repeat}(${CssProp._B1.line_names}\\s*)?(${CssProp._B3.fixed_size}|${CssProp._B4.fixed_repeat})*(${CssProp._B1.line_names}\\s*)?`,
    explicit_track_list: `(${CssProp._B1.line_names}\\s*)?(${CssProp._B3.track_size})+(${CssProp._B1.line_names}\\s*)?`,
    track_list: `(${CssProp._B1.line_names}\\s*)?(${CssProp._B3.track_size}|${CssProp._B4.name_repeat})+(${CssProp._B1.line_names}\\s*)?`
};
CssProp._B6 = {
    grid_template_rows: `none|${CssProp._B5.track_list}|${CssProp._B5.auto_track_list}|subgrid\\s*(${CssProp._B1.line_names})?`,
    grid_template_columns: `none|${CssProp._B5.track_list}|${CssProp._B5.auto_track_list}|subgrid\\s*(${CssProp._B1.line_names})?`
};
CssProp.B = {
    ...CssProp._B,
    ...CssProp._B1,
    ...CssProp._B2,
    ...CssProp._B3,
    ...CssProp._B4,
    ...CssProp._B5,
    ...CssProp._B6
};
/*
 * Atomic (i.e. not dependent on other regular expressions) sub RegEx segments
 */
CssProp.A = {
    absolute_size: `xx-small|x-small|small|medium|large|x-large|xx-large`,
    attachment: `scroll|fixed|local`,
    bg_origin: `border-box|padding-box|content-box`,
    border_style: `none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset`,
    box: `border-box|padding-box|content-box`,
    display_inside: `auto|block|table|flex|grid`,
    display_outside: `block-level|inline-level|none|table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption`,
    ending_shape: `circle|ellipse`,
    generic_family: `serif|sans-serif|cursive|fantasy|monospace`,
    generic_voice: `male|female|child`,
    relative_size: `smaller|larger`,
    repeat_style: `repeat-x|repeat-y|((?:repeat|space|round|no-repeat)(?:\\s*(?:repeat|space|round|no-repeat))?)`,
    side_or_corner: `(left|right)?\\s*(top|bottom)?`,
    single_animation_direction: `normal|reverse|alternate|alternate-reverse`,
    single_animation_fill_mode: `none|forwards|backwards|both`,
    single_animation_play_state: `running|paused`
};
/*
 * Color definition sub expressions
 */
CssProp._COLOR = {
    hex: `\\#(0x)?[0-9a-f]+`,
    name: `aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|transparent|violet|wheat|white|whitesmoke|yellow|yellowgreen`,
    rgb: String.raw `rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)`,
    rgba: String.raw `rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(${CssProp.N.integer_zero_ff}|${CssProp.N.number_zero_one}|${CssProp.B.percentage_zero_hundred})\s*\)`
};
/*
 * Compound (i.e. dependent on other (sub) regular expressions) sub RegEx segments
 */
CssProp._C = {
    alpha: `${CssProp.N.integer_zero_ff}|${CssProp.N.number_zero_one}|${CssProp.B.percentage_zero_hundred}`,
    alphavalue: CssProp.N.number_zero_one,
    bg_position: `((${CssProp.B.len_or_perc}|left|center|right|top|bottom)\\s*){1,4}`,
    bg_size: `(${CssProp.B.length_pos}|${CssProp.B.percentage}|auto){1,2}|cover|contain`,
    border_width: `thin|medium|thick|${CssProp.B.length}`,
    bottom: `${CssProp.B.length}|auto`,
    color: `${CssProp._COLOR.hex}|${CssProp._COLOR.rgb}|${CssProp._COLOR.rgba}|${CssProp._COLOR.name}`,
    color_stop_length: `(${CssProp.B.len_or_perc}\\s*){1,2}`,
    linear_color_hint: `${CssProp.B.len_or_perc}`,
    family_name: `${CssProp.B.string}|(${CssProp.B.ident}\\s*)+`,
    image_decl: CssProp.B.url,
    left: `${CssProp.B.length}|auto`,
    loose_quotable_words: `(${CssProp.B.ident})+`,
    margin_width: `${CssProp.B.len_or_perc}|auto`,
    padding_width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}`,
    page_url: CssProp.B.url,
    position: `((${CssProp.B.len_or_perc}|left|center|right|top|bottom)\\s*){1,4}`,
    right: `${CssProp.B.length}|auto`,
    shadow: '',
    size: `closest-side|farthest-side|closest-corner|farthest-corner|${CssProp.B.length}|(${CssProp.B.len_or_perc})\\s+(${CssProp.B.len_or_perc})`,
    top: `${CssProp.B.length}|auto`
};
CssProp._C1 = {
    image_list: `image\\(\\s*(${CssProp.B.url})*\\s*(${CssProp.B.url}|${CssProp._C.color})\\s*\\)`,
    linear_color_stop: `(${CssProp._C.color})(\\s*${CssProp._C.color_stop_length})?`,
    shadow: `((${CssProp._C.color})\\s+((${CssProp.B.length})\\s*){2,4}(\s+inset)?)|((inset\\s+)?((${CssProp.B.length})\\s*){2,4}\\s*(${CssProp._C.color})?)`
};
CssProp._C2 = {
    color_stop_list: `((${CssProp._C1.linear_color_stop})(\\s*(${CssProp._C.linear_color_hint}))?\\s*,\\s*)+(${CssProp._C1.linear_color_stop})`,
    shape: `rect\\(\\s*(${CssProp._C.top})\\s*,\\s*(${CssProp._C.right})\\s*,\\s*(${CssProp._C.bottom})\\s*,\\s*(${CssProp._C.left})\\s*\\)`
};
CssProp._C3 = {
    linear_gradient: `linear-gradient\\((((${CssProp.B.angle})|to\\s+(${CssProp.A.side_or_corner}))\\s*,\\s*)?\\s*(${CssProp._C2.color_stop_list})\\s*\\)`,
    radial_gradient: `radial-gradient\\(((((${CssProp.A.ending_shape})|(${CssProp._C.size}))\\s*)*\\s*(at\\s+${CssProp._C.position})?\\s*,\\s*)?\\s*(${CssProp._C2.color_stop_list})\\s*\\)`
};
CssProp._C4 = {
    image: `${CssProp.B.url}|${CssProp._C3.linear_gradient}|${CssProp._C3.radial_gradient}|${CssProp._C1.image_list}`,
    bg_image: `(${CssProp.B.url}|${CssProp._C3.linear_gradient}|${CssProp._C3.radial_gradient}|${CssProp._C1.image_list})|none`
};
CssProp.C = {
    ...CssProp._C,
    ...CssProp._C1,
    ...CssProp._C2,
    ...CssProp._C3,
    ...CssProp._C4
};
/*
 * Property value regular expressions not dependent on other sub expressions
 */
CssProp.AP = {
    baseline_position: `baseline|first baseline|last baseline`,
    border_collapse: `collapse|separate`,
    box: `normal|none|contents`,
    box_sizing: `content-box|padding-box|border-box`,
    caption_side: `top|bottom`,
    clear: `none|left|right|both`,
    content_position: `start|end|center|flex-start|flex-end`,
    content_distribution: `stretch|space-between|space-around|space-evenly`,
    direction: `ltr|rtl`,
    empty_cells: `show|hide`,
    flex_direction: `row|row-reverse|column|column-reverse`,
    flex_wrap: `nowrap|wrap|wrap-reverse`,
    float: `left|right|none`,
    font_stretch: `normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded`,
    font_style: `normal|italic|oblique`,
    font_variant: `normal|small-caps`,
    font_weight: `normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900`,
    list_style_position: `inside|outside`,
    gap: `normal`,
    grid_auto_flow: `row|column|dense|row dense|column dense`,
    justify_content: `start|end|center|stretch|space-between|space-around|space-evenly`,
    justify_items: `start|end|center|stretch`,
    justify_self: `auto|start|end|center|stretch`,
    list_style_type: `disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none`,
    overflow: `visible|hidden|scroll|auto`,
    overflow_position: `unsafe|safe`,
    overflow_wrap: `normal|break-word`,
    overflow_x: `visible|hidden|scroll|auto|no-display|no-content`,
    page_break_after: `auto|always|avoid|left|right`,
    page_break_before: `auto|always|avoid|left|right`,
    page_break_inside: `avoid|auto`,
    place_content: `(center|start|end|space-between|space-around|space-evenly|stretch){1,2}`,
    place_items: `(center|start|end|baseline|stretch){1,2}`,
    place_self: `(center|start|end|baseline|stretch){1,2}`,
    position: `static|relative|absolute`,
    resize: `none|both|horizontal|vertical`,
    speak: `normal|none|spell-out`,
    self_position: `center|start|end|self-start|self-end|flex-start|flex-end`,
    speak_header: `once|always`,
    speak_numeral: `digits|continuous`,
    speak_punctuation: `code|none`,
    table_layout: `auto|fixed`,
    text_align: `left|right|center|justify`,
    text_decoration: `none|((underline|overline|line-through|blink)\\s*)+`,
    text_transform: `capitalize|uppercase|lowercase|none`,
    text_wrap: `normal|unrestricted|none|suppress`,
    unicode_bidi: `normal|embed|bidi-override`,
    visibility: `visible|hidden|collapse`,
    white_space: `normal|pre|nowrap|pre-wrap|pre-line`,
    word_break: `normal|keep-all|break-all`
};
/*
 * Compound propertiy value regular expressions (i.e. dependent on other sub expressions)
 */
CssProp._CP = {
    align_content: `normal|${CssProp.AP.baseline_position}|${CssProp.AP.content_distribution}|${CssProp.AP.overflow_position}|${CssProp.AP.content_position}`,
    align_items: `normal|stretch|${CssProp.AP.baseline_position}|(${CssProp.AP.overflow_position})?\\s*${CssProp.AP.self_position}|anchor-center`,
    align_self: `auto|normal|stretch|${CssProp.AP.baseline_position}|(${CssProp.AP.overflow_position})?\\s*${CssProp.AP.self_position}|anchor-center`,
    background_attachment: `${CssProp.A.attachment}(,\\s*${CssProp.A.attachment})*`,
    background_color: CssProp.C.color,
    background_origin: `${CssProp.A.box}(,\\s*${CssProp.A.box})*`,
    background_repeat: `${CssProp.A.repeat_style}(,\\s*${CssProp.A.repeat_style})*`,
    border: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\s*){1,3}`,
    border_radius: `((${CssProp.B.len_or_perc})\\s*){1,4}(\\/\\s*((${CssProp.B.len_or_perc})\\s*){1,4})?`,
    border_spacing: `${CssProp.B.length}\\s*(${CssProp.B.length})?`,
    border_top_color: CssProp.C.color,
    border_top_style: CssProp.A.border_style,
    border_width: `((${CssProp.C.border_width})\\s*){1,4}`,
    color: CssProp.C.color,
    cursor: `(${CssProp.B.url}(\\s*,\\s*)?)*(auto|crosshair|default|pointer|move|e-resize|ne-resize|nw-resize|n-resize|se-resize|sw-resize|s-resize|w-resize|text|wait|help|progress|all-scroll|col-resize|hand|no-drop|not-allowed|row-resize|vertical-text)`,
    display: `inline|block|list-item|run-in|inline-list-item|inline-block|table|inline-table|table-cell|table-caption|flex|inline-flex|grid|inline-grid|${CssProp.A.display_inside}|${CssProp.A.display_outside}|inherit|inline-box|inline-stack`,
    display_outside: CssProp.A.display_outside,
    elevation: `${CssProp.B.angle}|below|level|above|higher|lower`,
    font_family: `(${CssProp.C.family_name}|${CssProp.A.generic_family})(,\\s*(${CssProp.C.family_name}|${CssProp.A.generic_family}))*`,
    height: `${CssProp.B.length}|${CssProp.B.percentage}|auto`,
    letter_spacing: `normal|${CssProp.B.length}`,
    list_style_image: `${CssProp.C.image}|none`,
    margin_right: CssProp.C.margin_width,
    max_height: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|none|auto`,
    min_height: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|auto`,
    opacity: CssProp.C.alphavalue,
    outline_color: `${CssProp.C.color}|invert`,
    outline_width: CssProp.C.border_width,
    padding: `((${CssProp.C.padding_width})\\s*){1,4}`,
    padding_top: CssProp.C.padding_width,
    pitch_range: CssProp.N.number,
    right: `${CssProp.B.length}|${CssProp.B.percentage}|auto`,
    stress: CssProp.N.number,
    text_indent: `${CssProp.B.length}|${CssProp.B.percentage}`,
    text_shadow: `none|${CssProp.C.shadow}(,\\s*(${CssProp.C.shadow}))*`,
    volume: `${CssProp.N.number_pos}|${CssProp.B.percentage_pos}|silent|x-soft|soft|medium|loud|x-loud`,
    word_wrap: CssProp.AP.overflow_wrap,
    zoom: `normal|${CssProp.N.number_pos}|${CssProp.B.percentage_pos}`,
    backface_visibility: CssProp.AP.visibility,
    background_clip: `${CssProp.A.box}(,\\s*(${CssProp.A.box}))*`,
    background_position: `${CssProp.C.bg_position}(,\\s*(${CssProp.C.bg_position}))*`,
    border_bottom_color: CssProp.C.color,
    border_bottom_style: CssProp.A.border_style,
    border_color: `((${CssProp.C.color})\\s*){1,4}`,
    border_left_color: CssProp.C.color,
    border_right_color: CssProp.C.color,
    border_style: `((${CssProp.A.border_style})\\s*){1,4}`,
    border_top_left_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,
    border_top_width: CssProp.C.border_width,
    box_shadow: `none|${CssProp.C.shadow}(,\\s*(${CssProp.C.shadow}))*`,
    clip: `${CssProp.C.shape}|auto`,
    display_inside: CssProp.A.display_inside,
    font_size: `${CssProp.A.absolute_size}|${CssProp.A.relative_size}|${CssProp.B.length_pos}|${CssProp.B.percentage_pos}`,
    line_height: `normal|${CssProp.N.number_pos}|${CssProp.B.length_pos}|${CssProp.B.percentage_pos}`,
    margin_left: CssProp.C.margin_width,
    max_width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|none|auto`,
    outline_style: CssProp.A.border_style,
    padding_bottom: CssProp.C.padding_width,
    padding_right: CssProp.C.padding_width,
    perspective: `none|${CssProp.B.length}`,
    richness: CssProp.N.number,
    text_overflow: `((clip|ellipsis|${CssProp.B.string})\\s*){1,2}`,
    top: `${CssProp.B.length}|${CssProp.B.percentage}|auto`,
    width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|auto`,
    z_index: `auto|${CssProp.B.z_index}`,
    // Simplified background
    background: `(((${CssProp.C.bg_position}\\s*(\\/\\s*${CssProp.C.bg_size})?)|(${CssProp.A.repeat_style})|(${CssProp.A.attachment})|(${CssProp.A.bg_origin})|(${CssProp.C.bg_image})|(${CssProp.C.color}))\\s*)+`,
    background_size: `${CssProp.C.bg_size}(,\\s*${CssProp.C.bg_size})*`,
    border_bottom_left_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,
    border_bottom_width: CssProp.C.border_width,
    border_left_style: CssProp.A.border_style,
    border_right_style: CssProp.A.border_style,
    border_top: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\s*){1,3}`,
    bottom: `${CssProp.B.len_or_perc}|auto`,
    list_style: `((${CssProp.AP.list_style_type}|${CssProp.AP.list_style_position}|${CssProp.C.image}|none})\\s*){1,3}`,
    margin_top: CssProp.C.margin_width,
    outline: `((${CssProp.C.color}|invert|${CssProp.A.border_style}|${CssProp.C.border_width})\\s*){1,3}`,
    overflow_y: CssProp.AP.overflow_x,
    pitch: `${CssProp.B.frequency}|x-low|low|medium|high|x-high`,
    vertical_align: `baseline|sub|super|top|text-top|middle|bottom|text-bottom|${CssProp.B.len_or_perc}`,
    word_spacing: `normal|${CssProp.B.length}`,
    background_image: `${CssProp.C.bg_image}(,\\s*${CssProp.C.bg_image})*`,
    border_bottom_right_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,
    border_left_width: CssProp.C.border_width,
    border_right_width: CssProp.C.border_width,
    left: `${CssProp.B.len_or_perc}|auto`,
    margin_bottom: CssProp.C.margin_width,
    pause_after: `${CssProp.B.time}|${CssProp.B.percentage}`,
    speech_rate: `${CssProp.N.number}|x-slow|slow|medium|fast|x-fast|faster|slower`,
    transition_duration: `${CssProp.B.time}(,\\s*${CssProp.B.time})*`,
    border_bottom: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\s*){1,3}`,
    border_right: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\s*){1,3}`,
    margin: `((${CssProp.C.margin_width})\\s*){1,4}`,
    padding_left: CssProp.C.padding_width,
    border_left: `((${CssProp.C.border_width}|${CssProp.A.border_style}|${CssProp.C.color})\\s*){1,3}`,
    quotes: `(${CssProp.B.string}\\s*${CssProp.B.string})+|none`,
    border_top_right_radius: `(${CssProp.B.length}|${CssProp.B.percentage})(\\s*(${CssProp.B.length}|${CssProp.B.percentage}))?`,
    min_width: `${CssProp.B.length_pos}|${CssProp.B.percentage_pos}|auto`,
    // Add flexbox and grid properties
    flex_basis: `${CssProp.B.len_or_perc}|auto|content|max-content|min-content|fit-content\\(\\s*(${CssProp.B.len_or_perc}\\s*)*\\)`, // simplified no <calc-size()> and <anchor-size()>
    flex_grow: CssProp.N.number_pos,
    flex_shrink: CssProp.N.number_pos,
    grid: `(${CssProp.B.string}|none|subgrid)\\s*(\\/\\s*(${CssProp.B.string}|none|subgrid))?`,
    grid_area: `${CssProp.B.ident}|auto|(${CssProp.N.integer}\\s*\\/\\s*${CssProp.N.integer}\\s*\\/\\s*${CssProp.N.integer}\\s*\\/\\s*${CssProp.N.integer})`,
    grid_auto_columns: `(${CssProp.B.track_size})+`,
    grid_auto_rows: `(${CssProp.B.track_size})+`,
    grid_column: `${CssProp.B.grid_line}(\\s*\\/\\s*${CssProp.B.grid_line})?`,
    grid_column_start: `${CssProp.B.grid_line}`,
    grid_column_end: `${CssProp.B.grid_line}`,
    grid_column_gap: `${CssProp.B.len_or_perc}|normal`,
    grid_gap: `(${CssProp.B.len_or_perc}|normal)(\\s*(${CssProp.B.len_or_perc}|normal))?`,
    grid_row: `${CssProp.B.grid_line}(\\s*\\/\\s*${CssProp.B.grid_line})?`,
    grid_row_start: `${CssProp.B.grid_line}`,
    grid_row_end: `${CssProp.B.grid_line}`,
    grid_row_gap: `${CssProp.B.len_or_perc}|normal`,
    grid_template: `none|(${CssProp.B.grid_template_rows}\\s*\\/\\s*${CssProp.B.grid_template_columns})|(${CssProp.B.line_names}\\s*)?(${CssProp.B.string}\\s*${CssProp.B.track_size}\\s*(${CssProp.B.line_names}\\s*)?)+\\s*(\\/\\s*${CssProp.B.explicit_track_list})?`,
    grid_template_areas: `none|(${CssProp.B.string})+`,
    grid_template_columns: `${CssProp.B.grid_template_columns}`,
    grid_template_rows: `${CssProp.B.grid_template_rows}`,
    row_gap: `${CssProp.B.len_or_perc}|normal`,
    column_gap: `${CssProp.B.len_or_perc}|normal`,
    gap: `(${CssProp.B.len_or_perc}|normal)(\\s*(${CssProp.B.len_or_perc}|normal))?`,
    order: CssProp.N.integer
};
CssProp._CP1 = {
    font: `(((((${CssProp.AP.font_style}|${CssProp.AP.font_variant}|${CssProp.AP.font_weight})\\s*){1,3})?\\s*(${CssProp._CP.font_size})\\s*(\\/\\s*(${CssProp._CP.line_height}))?\\s+(${CssProp._CP.font_family}))|caption|icon|menu|message-box|small-caption|status-bar)`
};
CssProp.CP = { ...CssProp._CP, ...CssProp._CP1 };
// CSS Property value validation regular expressions for use with sanitize-html
CssProp.BORDER_COLLAPSE = CssProp.reg(CssProp.AP.border_collapse);
CssProp.BOX = CssProp.reg(CssProp.AP.box);
CssProp.BOX_SIZING = CssProp.reg(CssProp.AP.box_sizing);
CssProp.CAPTION_SIDE = CssProp.reg(CssProp.AP.caption_side);
CssProp.CLEAR = CssProp.reg(CssProp.AP.clear);
CssProp.DIRECTION = CssProp.reg(CssProp.AP.direction);
CssProp.EMPTY_CELLS = CssProp.reg(CssProp.AP.empty_cells);
CssProp.FLOAT = CssProp.reg(CssProp.AP.float);
CssProp.FONT_STRETCH = CssProp.reg(CssProp.AP.font_stretch);
CssProp.FONT_STYLE = CssProp.reg(CssProp.AP.font_style);
CssProp.FONT_VARIANT = CssProp.reg(CssProp.AP.font_variant);
CssProp.FONT_WEIGHT = CssProp.reg(CssProp.AP.font_weight);
CssProp.LIST_STYLE_POSITION = CssProp.reg(CssProp.AP.list_style_position);
CssProp.LIST_STYLE_TYPE = CssProp.reg(CssProp.AP.list_style_type);
CssProp.OVERFLOW = CssProp.reg(CssProp.AP.overflow);
CssProp.OVERFLOW_WRAP = CssProp.reg(CssProp.AP.overflow_wrap);
CssProp.OVERFLOW_X = CssProp.reg(CssProp.AP.overflow_x);
CssProp.PAGE_BREAK_AFTER = CssProp.reg(CssProp.AP.page_break_after);
CssProp.PAGE_BREAK_BEFORE = CssProp.reg(CssProp.AP.page_break_before);
CssProp.PAGE_BREAK_INSIDE = CssProp.reg(CssProp.AP.page_break_inside);
CssProp.POSITION = CssProp.reg(CssProp.AP.position);
CssProp.RESIZE = CssProp.reg(CssProp.AP.resize);
CssProp.SPEAK = CssProp.reg(CssProp.AP.speak);
CssProp.SPEAK_HEADER = CssProp.reg(CssProp.AP.speak_header);
CssProp.SPEAK_NUMERAL = CssProp.reg(CssProp.AP.speak_numeral);
CssProp.SPEAK_PUNCTUATION = CssProp.reg(CssProp.AP.speak_punctuation);
CssProp.TABLE_LAYOUT = CssProp.reg(CssProp.AP.table_layout);
CssProp.TEXT_ALIGN = CssProp.reg(CssProp.AP.text_align);
CssProp.TEXT_DECORATION = CssProp.reg(CssProp.AP.text_decoration);
CssProp.TEXT_TRANSFORM = CssProp.reg(CssProp.AP.text_transform);
CssProp.TEXT_WRAP = CssProp.reg(CssProp.AP.text_wrap);
CssProp.UNICODE_BIDI = CssProp.reg(CssProp.AP.unicode_bidi);
CssProp.VISIBILITY = CssProp.reg(CssProp.AP.visibility);
CssProp.WHITE_SPACE = CssProp.reg(CssProp.AP.white_space);
CssProp.WORD_BREAK = CssProp.reg(CssProp.AP.word_break);
CssProp.BACKGROUND_ATTACHMENT = CssProp.reg(CssProp.CP.background_attachment);
CssProp.BACKGROUND_COLOR = CssProp.reg(CssProp.CP.background_color);
CssProp.BACKGROUND_ORIGIN = CssProp.reg(CssProp.CP.background_origin);
CssProp.BACKGROUND_REPEAT = CssProp.reg(CssProp.CP.background_repeat);
CssProp.BORDER = CssProp.reg(CssProp.CP.border);
CssProp.BORDER_RADIUS = CssProp.reg(CssProp.CP.border_radius);
CssProp.BORDER_SPACING = CssProp.reg(CssProp.CP.border_spacing);
CssProp.BORDER_TOP_COLOR = CssProp.reg(CssProp.CP.border_top_color);
CssProp.BORDER_TOP_STYLE = CssProp.reg(CssProp.CP.border_top_style);
CssProp.BORDER_WIDTH = CssProp.reg(CssProp.CP.border_width);
CssProp.COLOR = CssProp.reg(CssProp.CP.color);
CssProp.CURSOR = CssProp.reg(CssProp.CP.cursor);
CssProp.DISPLAY = CssProp.reg(CssProp.CP.display);
CssProp.DISPLAY_OUTSIDE = CssProp.reg(CssProp.CP.display_outside);
CssProp.ELEVATION = CssProp.reg(CssProp.CP.elevation);
CssProp.FONT_FAMILY = CssProp.reg(CssProp.CP.font_family);
CssProp.HEIGHT = CssProp.reg(CssProp.CP.height);
CssProp.LETTER_SPACING = CssProp.reg(CssProp.CP.letter_spacing);
CssProp.LIST_STYLE_IMAGE = CssProp.reg(CssProp.CP.list_style_image);
CssProp.MARGIN_RIGHT = CssProp.reg(CssProp.CP.margin_right);
CssProp.MAX_HEIGHT = CssProp.reg(CssProp.CP.max_height);
CssProp.MIN_HEIGHT = CssProp.reg(CssProp.CP.min_height);
CssProp.OPACITY = CssProp.reg(CssProp.CP.opacity);
CssProp.OUTLINE_COLOR = CssProp.reg(CssProp.CP.outline_color);
CssProp.OUTLINE_WIDTH = CssProp.reg(CssProp.CP.outline_width);
CssProp.PADDING = CssProp.reg(CssProp.CP.padding);
CssProp.PADDING_TOP = CssProp.reg(CssProp.CP.padding_top);
CssProp.PITCH_RANGE = CssProp.reg(CssProp.CP.pitch_range);
CssProp.RIGHT = CssProp.reg(CssProp.CP.right);
CssProp.STRESS = CssProp.reg(CssProp.CP.stress);
CssProp.TEXT_INDENT = CssProp.reg(CssProp.CP.text_indent);
CssProp.TEXT_SHADOW = CssProp.reg(CssProp.CP.text_shadow);
CssProp.VOLUME = CssProp.reg(CssProp.CP.volume);
CssProp.WORD_WRAP = CssProp.reg(CssProp.CP.word_wrap);
CssProp.ZOOM = CssProp.reg(CssProp.CP.zoom);
CssProp.BACKFACE_VISIBILITY = CssProp.reg(CssProp.CP.backface_visibility);
CssProp.BACKGROUND_CLIP = CssProp.reg(CssProp.CP.background_clip);
CssProp.BACKGROUND_POSITION = CssProp.reg(CssProp.CP.background_position);
CssProp.BORDER_BOTTOM_COLOR = CssProp.reg(CssProp.CP.border_bottom_color);
CssProp.BORDER_BOTTOM_STYLE = CssProp.reg(CssProp.CP.border_bottom_style);
CssProp.BORDER_COLOR = CssProp.reg(CssProp.CP.border_color);
CssProp.BORDER_LEFT_COLOR = CssProp.reg(CssProp.CP.border_left_color);
CssProp.BORDER_RIGHT_COLOR = CssProp.reg(CssProp.CP.border_right_color);
CssProp.BORDER_STYLE = CssProp.reg(CssProp.CP.border_style);
CssProp.BORDER_TOP_LEFT_RADIUS = CssProp.reg(CssProp.CP.border_top_left_radius);
CssProp.BORDER_TOP_WIDTH = CssProp.reg(CssProp.CP.border_top_width);
CssProp.BOX_SHADOW = CssProp.reg(CssProp.CP.box_shadow);
CssProp.CLIP = CssProp.reg(CssProp.CP.clip);
CssProp.DISPLAY_INSIDE = CssProp.reg(CssProp.CP.display_inside);
CssProp.FONT_SIZE = CssProp.reg(CssProp.CP.font_size);
CssProp.LINE_HEIGHT = CssProp.reg(CssProp.CP.line_height);
CssProp.MARGIN_LEFT = CssProp.reg(CssProp.CP.margin_left);
CssProp.MAX_WIDTH = CssProp.reg(CssProp.CP.max_width);
CssProp.OUTLINE_STYLE = CssProp.reg(CssProp.CP.outline_style);
CssProp.PADDING_BOTTOM = CssProp.reg(CssProp.CP.padding_bottom);
CssProp.PADDING_RIGHT = CssProp.reg(CssProp.CP.padding_right);
CssProp.PERSPECTIVE = CssProp.reg(CssProp.CP.perspective);
CssProp.RICHNESS = CssProp.reg(CssProp.CP.richness);
CssProp.TEXT_OVERFLOW = CssProp.reg(CssProp.CP.text_overflow);
CssProp.TOP = CssProp.reg(CssProp.CP.top);
CssProp.WIDTH = CssProp.reg(CssProp.CP.width);
CssProp.Z_INDEX = CssProp.reg(CssProp.CP.z_index);
CssProp.BACKGROUND = CssProp.reg(CssProp.CP.background);
CssProp.BACKGROUND_SIZE = CssProp.reg(CssProp.CP.background_size);
CssProp.BORDER_BOTTOM_LEFT_RADIUS = CssProp.reg(CssProp.CP.border_bottom_left_radius);
CssProp.BORDER_BOTTOM_WIDTH = CssProp.reg(CssProp.CP.border_bottom_width);
CssProp.BORDER_LEFT_STYLE = CssProp.reg(CssProp.CP.border_left_style);
CssProp.BORDER_RIGHT_STYLE = CssProp.reg(CssProp.CP.border_right_style);
CssProp.BORDER_TOP = CssProp.reg(CssProp.CP.border_top);
CssProp.BOTTOM = CssProp.reg(CssProp.CP.bottom);
CssProp.LIST_STYLE = CssProp.reg(CssProp.CP.list_style);
CssProp.MARGIN_TOP = CssProp.reg(CssProp.CP.margin_top);
CssProp.OUTLINE = CssProp.reg(CssProp.CP.outline);
CssProp.OVERFLOW_Y = CssProp.reg(CssProp.CP.overflow_y);
CssProp.PITCH = CssProp.reg(CssProp.CP.pitch);
CssProp.VERTICAL_ALIGN = CssProp.reg(CssProp.CP.vertical_align);
CssProp.WORD_SPACING = CssProp.reg(CssProp.CP.word_spacing);
CssProp.BACKGROUND_IMAGE = CssProp.reg(CssProp.CP.background_image);
CssProp.BORDER_BOTTOM_RIGHT_RADIUS = CssProp.reg(CssProp.CP.border_bottom_right_radius);
CssProp.BORDER_LEFT_WIDTH = CssProp.reg(CssProp.CP.border_left_width);
CssProp.BORDER_RIGHT_WIDTH = CssProp.reg(CssProp.CP.border_right_width);
CssProp.LEFT = CssProp.reg(CssProp.CP.left);
CssProp.MARGIN_BOTTOM = CssProp.reg(CssProp.CP.margin_bottom);
CssProp.PAUSE_AFTER = CssProp.reg(CssProp.CP.pause_after);
CssProp.SPEECH_RATE = CssProp.reg(CssProp.CP.speech_rate);
CssProp.TRANSITION_DURATION = CssProp.reg(CssProp.CP.transition_duration);
CssProp.BORDER_BOTTOM = CssProp.reg(CssProp.CP.border_bottom);
CssProp.BORDER_RIGHT = CssProp.reg(CssProp.CP.border_right);
CssProp.MARGIN = CssProp.reg(CssProp.CP.margin);
CssProp.PADDING_LEFT = CssProp.reg(CssProp.CP.padding_left);
CssProp.BORDER_LEFT = CssProp.reg(CssProp.CP.border_left);
CssProp.FONT = CssProp.reg(CssProp.CP.font);
CssProp.QUOTES = CssProp.reg(CssProp.CP.quotes);
CssProp.BORDER_TOP_RIGHT_RADIUS = CssProp.reg(CssProp.CP.border_top_right_radius);
CssProp.MIN_WIDTH = CssProp.reg(CssProp.CP.min_width);
// Flexbox properties
CssProp.ALIGN_CONTENT = CssProp.reg(CssProp.CP.align_content);
CssProp.ALIGN_ITEMS = CssProp.reg(CssProp.CP.align_items);
CssProp.ALIGN_SELF = CssProp.reg(CssProp.CP.align_self);
CssProp.FLEX = CssProp.reg(CssProp.B.flex);
CssProp.FLEX_BASIS = CssProp.reg(CssProp.CP.flex_basis);
CssProp.FLEX_DIRECTION = CssProp.reg(CssProp.AP.flex_direction);
CssProp.FLEX_GROW = CssProp.reg(CssProp.CP.flex_grow);
CssProp.FLEX_SHRINK = CssProp.reg(CssProp.CP.flex_shrink);
CssProp.FLEX_WRAP = CssProp.reg(CssProp.AP.flex_wrap);
CssProp.JUSTIFY_CONTENT = CssProp.reg(CssProp.AP.justify_content);
CssProp.JUSTIFY_ITEMS = CssProp.reg(CssProp.AP.justify_items);
CssProp.JUSTIFY_SELF = CssProp.reg(CssProp.AP.justify_self);
CssProp.ORDER = CssProp.reg(CssProp.CP.order);
// Grid properties
CssProp.GRID = CssProp.reg(CssProp.CP.grid);
CssProp.GRID_AREA = CssProp.reg(CssProp.CP.grid_area);
CssProp.GRID_AUTO_COLUMNS = CssProp.reg(CssProp.CP.grid_auto_columns);
CssProp.GRID_AUTO_FLOW = CssProp.reg(CssProp.AP.grid_auto_flow);
CssProp.GRID_AUTO_ROWS = CssProp.reg(CssProp.CP.grid_auto_rows);
CssProp.GRID_COLUMN = CssProp.reg(CssProp.CP.grid_column);
CssProp.GRID_COLUMN_END = CssProp.reg(CssProp.CP.grid_column_end);
CssProp.GRID_COLUMN_GAP = CssProp.reg(CssProp.CP.grid_column_gap);
CssProp.GRID_COLUMN_START = CssProp.reg(CssProp.CP.grid_column_start);
CssProp.GRID_GAP = CssProp.reg(CssProp.CP.grid_gap);
CssProp.GRID_ROW = CssProp.reg(CssProp.CP.grid_row);
CssProp.GRID_ROW_END = CssProp.reg(CssProp.CP.grid_row_end);
CssProp.GRID_ROW_GAP = CssProp.reg(CssProp.CP.grid_row_gap);
CssProp.GRID_ROW_START = CssProp.reg(CssProp.CP.grid_row_start);
CssProp.GRID_TEMPLATE = CssProp.reg(CssProp.CP.grid_template);
CssProp.GRID_TEMPLATE_AREAS = CssProp.reg(CssProp.CP.grid_template_areas);
CssProp.GRID_TEMPLATE_COLUMNS = CssProp.reg(CssProp.CP.grid_template_columns);
CssProp.GRID_TEMPLATE_ROWS = CssProp.reg(CssProp.CP.grid_template_rows);
CssProp.GAP = CssProp.reg(CssProp.CP.gap);
CssProp.ROW_GAP = CssProp.reg(CssProp.CP.row_gap);
CssProp.COLUMN_GAP = CssProp.reg(CssProp.CP.column_gap);
CssProp.PLACE_CONTENT = CssProp.reg(CssProp.AP.place_content);
CssProp.PLACE_ITEMS = CssProp.reg(CssProp.AP.place_items);
CssProp.PLACE_SELF = CssProp.reg(CssProp.AP.place_self);
/**
 * A class to sanitize HTML strings.
 */
class Sanitizer {
    constructor() {
        this._autolink = true;
        this._allowNamedProperties = false;
        this._generateOptions = () => {
            const schemesToAllow = Array.isArray(this._customAllowedSchemes)
                ? this._customAllowedSchemes
                : [...(sanitize_html_default()).defaults.allowedSchemes];
            return {
                // HTML tags that are allowed to be used. Tags were extracted from Google Caja
                allowedTags: [
                    'a',
                    'abbr',
                    'acronym',
                    'address',
                    'area',
                    'article',
                    'aside',
                    'audio',
                    'b',
                    'bdi',
                    'bdo',
                    'big',
                    'blockquote',
                    'br',
                    'button',
                    'canvas',
                    'caption',
                    'center',
                    'cite',
                    'code',
                    'col',
                    'colgroup',
                    'colspan',
                    'command',
                    'data',
                    'datalist',
                    'dd',
                    'del',
                    'details',
                    'dfn',
                    'dir',
                    'div',
                    'dl',
                    'dt',
                    'em',
                    'fieldset',
                    'figcaption',
                    'figure',
                    'font',
                    'footer',
                    'form',
                    'h1',
                    'h2',
                    'h3',
                    'h4',
                    'h5',
                    'h6',
                    'header',
                    'hgroup',
                    'hr',
                    'i',
                    // 'iframe' is allowed by Google Caja, but disallowed by default by sanitize-html
                    // , 'iframe'
                    'img',
                    'input',
                    'ins',
                    'kbd',
                    'label',
                    'legend',
                    'li',
                    'map',
                    'mark',
                    'menu',
                    'meter',
                    'nav',
                    'nobr',
                    'ol',
                    'optgroup',
                    'option',
                    'output',
                    'p',
                    'pre',
                    'progress',
                    'q',
                    'rowspan',
                    's',
                    'samp',
                    'section',
                    'select',
                    'small',
                    'source',
                    'span',
                    'strike',
                    'strong',
                    'sub',
                    'summary',
                    'sup',
                    'table',
                    'tbody',
                    'td',
                    'textarea',
                    'tfoot',
                    'th',
                    'thead',
                    'time',
                    'tr',
                    'track',
                    'tt',
                    'u',
                    'ul',
                    'var',
                    'video',
                    'wbr'
                ],
                // Attributes that HTML tags are allowed to have, extracted from Google Caja.
                // See https://github.com/jupyterlab/jupyterlab/issues/1812#issuecomment-285848435
                allowedAttributes: {
                    '*': [
                        'class',
                        'data-jupyter-id',
                        'dir',
                        'draggable',
                        'hidden',
                        'id',
                        'inert',
                        'itemprop',
                        'itemref',
                        'itemscope',
                        'lang',
                        'spellcheck',
                        'style',
                        'title',
                        'translate'
                    ],
                    // 'rel' and 'target' were *not* allowed by Google Caja
                    a: [
                        'accesskey',
                        'coords',
                        'href',
                        'hreflang',
                        ...(this._allowNamedProperties ? ['name'] : []),
                        'rel',
                        'shape',
                        'tabindex',
                        'target',
                        'type'
                    ],
                    area: [
                        'accesskey',
                        'alt',
                        'coords',
                        'href',
                        'nohref',
                        'shape',
                        'tabindex'
                    ],
                    // 'autoplay' was *not* allowed by Google Caja
                    audio: [
                        'autoplay',
                        'controls',
                        'loop',
                        'mediagroup',
                        'muted',
                        'preload',
                        'src'
                    ],
                    bdo: ['dir'],
                    blockquote: ['cite'],
                    br: ['clear'],
                    button: [
                        'accesskey',
                        'data-commandlinker-args',
                        'data-commandlinker-command',
                        'disabled',
                        ...(this._allowNamedProperties ? ['name'] : []),
                        'tabindex',
                        'type',
                        'value'
                    ],
                    canvas: ['height', 'width'],
                    caption: ['align'],
                    col: ['align', 'char', 'charoff', 'span', 'valign', 'width'],
                    colgroup: ['align', 'char', 'charoff', 'span', 'valign', 'width'],
                    command: [
                        'checked',
                        'command',
                        'disabled',
                        'icon',
                        'label',
                        'radiogroup',
                        'type'
                    ],
                    data: ['value'],
                    del: ['cite', 'datetime'],
                    details: ['open'],
                    dir: ['compact'],
                    div: ['align'],
                    dl: ['compact'],
                    fieldset: ['disabled'],
                    font: ['color', 'face', 'size'],
                    form: [
                        'accept',
                        'autocomplete',
                        'enctype',
                        'method',
                        ...(this._allowNamedProperties ? ['name'] : []),
                        'novalidate'
                    ],
                    h1: ['align'],
                    h2: ['align'],
                    h3: ['align'],
                    h4: ['align'],
                    h5: ['align'],
                    h6: ['align'],
                    hr: ['align', 'noshade', 'size', 'width'],
                    iframe: [
                        'align',
                        'frameborder',
                        'height',
                        'marginheight',
                        'marginwidth',
                        'width'
                    ],
                    img: [
                        'align',
                        'alt',
                        'border',
                        'height',
                        'hspace',
                        'ismap',
                        ...(this._allowNamedProperties ? ['name'] : []),
                        'src',
                        'usemap',
                        'vspace',
                        'width'
                    ],
                    input: [
                        'accept',
                        'accesskey',
                        'align',
                        'alt',
                        'autocomplete',
                        'checked',
                        'disabled',
                        'inputmode',
                        'ismap',
                        'list',
                        'max',
                        'maxlength',
                        'min',
                        'multiple',
                        ...(this._allowNamedProperties ? ['name'] : []),
                        'placeholder',
                        'readonly',
                        'required',
                        'size',
                        'src',
                        'step',
                        'tabindex',
                        'type',
                        'usemap',
                        'value'
                    ],
                    ins: ['cite', 'datetime'],
                    label: ['accesskey', 'for'],
                    legend: ['accesskey', 'align'],
                    li: ['type', 'value'],
                    map: this._allowNamedProperties ? ['name'] : [],
                    menu: ['compact', 'label', 'type'],
                    meter: ['high', 'low', 'max', 'min', 'value'],
                    ol: ['compact', 'reversed', 'start', 'type'],
                    optgroup: ['disabled', 'label'],
                    option: ['disabled', 'label', 'selected', 'value'],
                    output: ['for', ...(this._allowNamedProperties ? ['name'] : [])],
                    p: ['align'],
                    pre: ['width'],
                    progress: ['max', 'min', 'value'],
                    q: ['cite'],
                    select: [
                        'autocomplete',
                        'disabled',
                        'multiple',
                        ...(this._allowNamedProperties ? ['name'] : []),
                        'required',
                        'size',
                        'tabindex'
                    ],
                    source: ['type'],
                    table: [
                        'align',
                        'bgcolor',
                        'border',
                        'cellpadding',
                        'cellspacing',
                        'frame',
                        'rules',
                        'summary',
                        'width'
                    ],
                    tbody: ['align', 'char', 'charoff', 'valign'],
                    td: [
                        'abbr',
                        'align',
                        'axis',
                        'bgcolor',
                        'char',
                        'charoff',
                        'colspan',
                        'headers',
                        'height',
                        'nowrap',
                        'rowspan',
                        'scope',
                        'valign',
                        'width'
                    ],
                    textarea: [
                        'accesskey',
                        'autocomplete',
                        'cols',
                        'disabled',
                        'inputmode',
                        ...(this._allowNamedProperties ? ['name'] : []),
                        'placeholder',
                        'readonly',
                        'required',
                        'rows',
                        'tabindex',
                        'wrap'
                    ],
                    tfoot: ['align', 'char', 'charoff', 'valign'],
                    th: [
                        'abbr',
                        'align',
                        'axis',
                        'bgcolor',
                        'char',
                        'charoff',
                        'colspan',
                        'headers',
                        'height',
                        'nowrap',
                        'rowspan',
                        'scope',
                        'valign',
                        'width'
                    ],
                    thead: ['align', 'char', 'charoff', 'valign'],
                    tr: ['align', 'bgcolor', 'char', 'charoff', 'valign'],
                    track: ['default', 'kind', 'label', 'srclang'],
                    ul: ['compact', 'type'],
                    video: [
                        'autoplay',
                        'controls',
                        'height',
                        'loop',
                        'mediagroup',
                        'muted',
                        'poster',
                        'preload',
                        'src',
                        'width'
                    ]
                },
                // Inline CSS styles that HTML tags may have (and their allowed values)
                allowedStyles: {
                    // To simplify the data, all styles are allowed on all tags that allow the style attribute
                    '*': {
                        'backface-visibility': [CssProp.BACKFACE_VISIBILITY],
                        background: [CssProp.BACKGROUND],
                        'background-attachment': [CssProp.BACKGROUND_ATTACHMENT],
                        'background-clip': [CssProp.BACKGROUND_CLIP],
                        'background-color': [CssProp.BACKGROUND_COLOR],
                        'background-image': [CssProp.BACKGROUND_IMAGE],
                        'background-origin': [CssProp.BACKGROUND_ORIGIN],
                        'background-position': [CssProp.BACKGROUND_POSITION],
                        'background-repeat': [CssProp.BACKGROUND_REPEAT],
                        'background-size': [CssProp.BACKGROUND_SIZE],
                        border: [CssProp.BORDER],
                        'border-bottom': [CssProp.BORDER_BOTTOM],
                        'border-bottom-color': [CssProp.BORDER_BOTTOM_COLOR],
                        'border-bottom-left-radius': [CssProp.BORDER_BOTTOM_LEFT_RADIUS],
                        'border-bottom-right-radius': [CssProp.BORDER_BOTTOM_RIGHT_RADIUS],
                        'border-bottom-style': [CssProp.BORDER_BOTTOM_STYLE],
                        'border-bottom-width': [CssProp.BORDER_BOTTOM_WIDTH],
                        'border-collapse': [CssProp.BORDER_COLLAPSE],
                        'border-color': [CssProp.BORDER_COLOR],
                        'border-left': [CssProp.BORDER_LEFT],
                        'border-left-color': [CssProp.BORDER_LEFT_COLOR],
                        'border-left-style': [CssProp.BORDER_LEFT_STYLE],
                        'border-left-width': [CssProp.BORDER_LEFT_WIDTH],
                        'border-radius': [CssProp.BORDER_RADIUS],
                        'border-right': [CssProp.BORDER_RIGHT],
                        'border-right-color': [CssProp.BORDER_RIGHT_COLOR],
                        'border-right-style': [CssProp.BORDER_RIGHT_STYLE],
                        'border-right-width': [CssProp.BORDER_RIGHT_WIDTH],
                        'border-spacing': [CssProp.BORDER_SPACING],
                        'border-style': [CssProp.BORDER_STYLE],
                        'border-top': [CssProp.BORDER_TOP],
                        'border-top-color': [CssProp.BORDER_TOP_COLOR],
                        'border-top-left-radius': [CssProp.BORDER_TOP_LEFT_RADIUS],
                        'border-top-right-radius': [CssProp.BORDER_TOP_RIGHT_RADIUS],
                        'border-top-style': [CssProp.BORDER_TOP_STYLE],
                        'border-top-width': [CssProp.BORDER_TOP_WIDTH],
                        'border-width': [CssProp.BORDER_WIDTH],
                        bottom: [CssProp.BOTTOM],
                        box: [CssProp.BOX],
                        'box-shadow': [CssProp.BOX_SHADOW],
                        'box-sizing': [CssProp.BOX_SIZING],
                        'caption-side': [CssProp.CAPTION_SIDE],
                        clear: [CssProp.CLEAR],
                        clip: [CssProp.CLIP],
                        color: [CssProp.COLOR],
                        cursor: [CssProp.CURSOR],
                        direction: [CssProp.DIRECTION],
                        display: [CssProp.DISPLAY],
                        'display-inside': [CssProp.DISPLAY_INSIDE],
                        'display-outside': [CssProp.DISPLAY_OUTSIDE],
                        elevation: [CssProp.ELEVATION],
                        'empty-cells': [CssProp.EMPTY_CELLS],
                        float: [CssProp.FLOAT],
                        font: [CssProp.FONT],
                        'font-family': [CssProp.FONT_FAMILY],
                        'font-size': [CssProp.FONT_SIZE],
                        'font-stretch': [CssProp.FONT_STRETCH],
                        'font-style': [CssProp.FONT_STYLE],
                        'font-variant': [CssProp.FONT_VARIANT],
                        'font-weight': [CssProp.FONT_WEIGHT],
                        height: [CssProp.HEIGHT],
                        left: [CssProp.LEFT],
                        'letter-spacing': [CssProp.LETTER_SPACING],
                        'line-height': [CssProp.LINE_HEIGHT],
                        'list-style': [CssProp.LIST_STYLE],
                        'list-style-image': [CssProp.LIST_STYLE_IMAGE],
                        'list-style-position': [CssProp.LIST_STYLE_POSITION],
                        'list-style-type': [CssProp.LIST_STYLE_TYPE],
                        margin: [CssProp.MARGIN],
                        'margin-bottom': [CssProp.MARGIN_BOTTOM],
                        'margin-left': [CssProp.MARGIN_LEFT],
                        'margin-right': [CssProp.MARGIN_RIGHT],
                        'margin-top': [CssProp.MARGIN_TOP],
                        'max-height': [CssProp.MAX_HEIGHT],
                        'max-width': [CssProp.MAX_WIDTH],
                        'min-height': [CssProp.MIN_HEIGHT],
                        'min-width': [CssProp.MIN_WIDTH],
                        opacity: [CssProp.OPACITY],
                        outline: [CssProp.OUTLINE],
                        'outline-color': [CssProp.OUTLINE_COLOR],
                        'outline-style': [CssProp.OUTLINE_STYLE],
                        'outline-width': [CssProp.OUTLINE_WIDTH],
                        overflow: [CssProp.OVERFLOW],
                        'overflow-wrap': [CssProp.OVERFLOW_WRAP],
                        'overflow-x': [CssProp.OVERFLOW_X],
                        'overflow-y': [CssProp.OVERFLOW_Y],
                        padding: [CssProp.PADDING],
                        'padding-bottom': [CssProp.PADDING_BOTTOM],
                        'padding-left': [CssProp.PADDING_LEFT],
                        'padding-right': [CssProp.PADDING_RIGHT],
                        'padding-top': [CssProp.PADDING_TOP],
                        'page-break-after': [CssProp.PAGE_BREAK_AFTER],
                        'page-break-before': [CssProp.PAGE_BREAK_BEFORE],
                        'page-break-inside': [CssProp.PAGE_BREAK_INSIDE],
                        'pause-after': [CssProp.PAUSE_AFTER],
                        perspective: [CssProp.PERSPECTIVE],
                        pitch: [CssProp.PITCH],
                        'pitch-range': [CssProp.PITCH_RANGE],
                        position: [CssProp.POSITION],
                        quotes: [CssProp.QUOTES],
                        resize: [CssProp.RESIZE],
                        richness: [CssProp.RICHNESS],
                        right: [CssProp.RIGHT],
                        speak: [CssProp.SPEAK],
                        'speak-header': [CssProp.SPEAK_HEADER],
                        'speak-numeral': [CssProp.SPEAK_NUMERAL],
                        'speak-punctuation': [CssProp.SPEAK_PUNCTUATION],
                        'speech-rate': [CssProp.SPEECH_RATE],
                        stress: [CssProp.STRESS],
                        'table-layout': [CssProp.TABLE_LAYOUT],
                        'text-align': [CssProp.TEXT_ALIGN],
                        'text-decoration': [CssProp.TEXT_DECORATION],
                        'text-indent': [CssProp.TEXT_INDENT],
                        'text-overflow': [CssProp.TEXT_OVERFLOW],
                        'text-shadow': [CssProp.TEXT_SHADOW],
                        'text-transform': [CssProp.TEXT_TRANSFORM],
                        'text-wrap': [CssProp.TEXT_WRAP],
                        top: [CssProp.TOP],
                        'unicode-bidi': [CssProp.UNICODE_BIDI],
                        'vertical-align': [CssProp.VERTICAL_ALIGN],
                        visibility: [CssProp.VISIBILITY],
                        volume: [CssProp.VOLUME],
                        'white-space': [CssProp.WHITE_SPACE],
                        width: [CssProp.WIDTH],
                        'word-break': [CssProp.WORD_BREAK],
                        'word-spacing': [CssProp.WORD_SPACING],
                        'word-wrap': [CssProp.WORD_WRAP],
                        'z-index': [CssProp.Z_INDEX],
                        zoom: [CssProp.ZOOM],
                        // Flexbox and Grid properties
                        'align-content': [CssProp.ALIGN_CONTENT],
                        'align-items': [CssProp.ALIGN_ITEMS],
                        'align-self': [CssProp.ALIGN_SELF],
                        flex: [CssProp.FLEX],
                        'flex-basis': [CssProp.FLEX_BASIS],
                        'flex-direction': [CssProp.FLEX_DIRECTION],
                        'flex-grow': [CssProp.FLEX_GROW],
                        'flex-shrink': [CssProp.FLEX_SHRINK],
                        'flex-wrap': [CssProp.FLEX_WRAP],
                        grid: [CssProp.GRID],
                        'grid-area': [CssProp.GRID_AREA],
                        'grid-auto-columns': [CssProp.GRID_AUTO_COLUMNS],
                        'grid-auto-flow': [CssProp.GRID_AUTO_FLOW],
                        'grid-auto-rows': [CssProp.GRID_AUTO_ROWS],
                        'grid-column': [CssProp.GRID_COLUMN],
                        'grid-column-end': [CssProp.GRID_COLUMN_END],
                        'grid-column-gap': [CssProp.GRID_COLUMN_GAP],
                        'grid-column-start': [CssProp.GRID_COLUMN_START],
                        'grid-gap': [CssProp.GRID_GAP],
                        'grid-row': [CssProp.GRID_ROW],
                        'grid-row-end': [CssProp.GRID_ROW_END],
                        'grid-row-gap': [CssProp.GRID_ROW_GAP],
                        'grid-row-start': [CssProp.GRID_ROW_START],
                        'grid-template': [CssProp.GRID_TEMPLATE],
                        'grid-template-areas': [CssProp.GRID_TEMPLATE_AREAS],
                        'grid-template-columns': [CssProp.GRID_TEMPLATE_COLUMNS],
                        'grid-template-rows': [CssProp.GRID_TEMPLATE_ROWS],
                        gap: [CssProp.GAP],
                        'row-gap': [CssProp.ROW_GAP],
                        'column-gap': [CssProp.COLUMN_GAP],
                        'justify-content': [CssProp.JUSTIFY_CONTENT],
                        'justify-items': [CssProp.JUSTIFY_ITEMS],
                        'justify-self': [CssProp.JUSTIFY_SELF],
                        order: [CssProp.ORDER],
                        'place-content': [CssProp.PLACE_CONTENT],
                        'place-items': [CssProp.PLACE_ITEMS],
                        'place-self': [CssProp.PLACE_SELF]
                    }
                },
                transformTags: {
                    // Set the "rel" attribute for <a> tags to "nofollow".
                    a: sanitize_html_default().simpleTransform('a', { rel: 'nofollow' }),
                    // Set the "disabled" attribute for <input> tags.
                    input: sanitize_html_default().simpleTransform('input', { disabled: 'disabled' }),
                    // Replace "id" attribute by "data-jupyter-id" if "id" is not allowed.
                    ...(this._allowNamedProperties
                        ? {}
                        : {
                            '*': function (tagName, attribs) {
                                if (attribs.id !== undefined) {
                                    attribs['data-jupyter-id'] = attribs.id;
                                    delete attribs.id;
                                }
                                return {
                                    tagName,
                                    attribs: {
                                        ...attribs
                                    }
                                };
                            }
                        })
                },
                allowedSchemes: schemesToAllow,
                allowedSchemesByTag: {
                    // Allow 'attachment:' img src (used for markdown cell attachments).
                    img: [...schemesToAllow, 'attachment']
                },
                // Override of the default option, so we can skip 'src' attribute validation.
                // 'src' Attributes are validated to be URIs, which does not allow for embedded (image) data.
                // Since embedded data is no longer deemed to be a threat, validation can be skipped.
                // See https://github.com/jupyterlab/jupyterlab/issues/5183
                allowedSchemesAppliedToAttributes: ['href', 'cite']
            };
        };
        this._options = this._generateOptions();
    }
    /**
     * Sanitize an HTML string.
     *
     * @param dirty - The dirty text.
     *
     * @param options - The optional sanitization options.
     *
     * @returns The sanitized string.
     */
    sanitize(dirty, options) {
        return sanitize_html_default()(dirty, { ...this._options, ...(options || {}) });
    }
    /**
     * @returns Whether to replace URLs by HTML anchors.
     */
    getAutolink() {
        return this._autolink;
    }
    /**
     * @returns Whether to allow name and id attributes.
     */
    get allowNamedProperties() {
        return this._allowNamedProperties;
    }
    /**
     * Set the allowed schemes
     *
     * @param scheme Allowed schemes.
     * Automatically regenerates sanitizer options to apply the change.
     * Note: the schemes merge into the current config and does not get overwritten.
     */
    setAllowedSchemes(scheme) {
        // Force copy of `scheme`
        this._customAllowedSchemes = [...scheme];
        this._options = this._generateOptions();
    }
    /**
     * Set the URL replacement boolean.
     *
     * @param autolink URL replacement boolean.
     */
    setAutolink(autolink) {
        this._autolink = autolink;
    }
    /**
     * Set the whether to allow `name` and `id` attributes.
     */
    setAllowNamedProperties(allowNamedProperties) {
        this._allowNamedProperties = allowNamedProperties;
        this._options = this._generateOptions();
    }
}
//# sourceMappingURL=sanitizer.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/semanticCommand.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
/**
 * Semantic group of commands
 */
class SemanticCommand {
    constructor() {
        this._commands = new Array();
    }
    /**
     * The command IDs used by this semantic command.
     */
    get ids() {
        return this._commands.map(c => c.id);
    }
    /**
     * Add a command to the semantic group
     *
     * @param command Command to add
     */
    add(command) {
        if (this._commands.map(c => c.id).includes(command.id)) {
            throw Error(`Command ${command.id} is already defined.`);
        }
        this._commands.push({
            isEnabled: () => true,
            rank: SemanticCommand.DEFAULT_RANK,
            ...command
        });
    }
    /**
     * Get the command id of the enabled command from this group
     * for the given widget.
     *
     * @param widget Widget
     * @returns Command id
     */
    getActiveCommandId(widget) {
        var _a;
        const commands = this._commands
            .filter(c => c.isEnabled(widget))
            .sort((a, b) => {
            const rankDelta = a.rank - b.rank;
            return rankDelta || (a.id < b.id ? -1 : 1);
        });
        const command = (_a = commands[0]) !== null && _a !== void 0 ? _a : { id: null };
        return command.id;
    }
    /**
     * Remove a command ID.
     *
     * @param id Command ID to remove
     */
    remove(id) {
        const index = this._commands.findIndex(c => c.id === id);
        if (index >= 0) {
            this._commands.splice(index, 1);
        }
    }
}
/**
 * Default rank for semantic command
 */
SemanticCommand.DEFAULT_RANK = 500;
/**
 * The `args` key for a semantic command's current widget ID.
 */
SemanticCommand.WIDGET = 'semanticWidget';
//# sourceMappingURL=semanticCommand.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/thememanager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * The number of milliseconds between theme loading attempts.
 */
const REQUEST_INTERVAL = 75;
/**
 * The number of times to attempt to load a theme before giving up.
 */
const REQUEST_THRESHOLD = 20;
/**
 * A class that provides theme management.
 */
class ThemeManager {
    /**
     * Construct a new theme manager.
     */
    constructor(options) {
        this._current = null;
        this._links = [];
        this._overrides = {};
        this._overrideProps = {};
        this._outstanding = null;
        this._pending = 0;
        this._requests = {};
        this._themes = {};
        this._themeChanged = new signaling_dist_index_es6_js_.Signal(this);
        const { host, key, splash, url } = options;
        this.translator = options.translator || lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        const registry = options.settings;
        this._base = url;
        this._host = host;
        this._splash = splash || null;
        void registry.load(key).then(settings => {
            this._settings = settings;
            // set up css overrides once we have a pointer to the settings schema
            this._initOverrideProps();
            this._settings.changed.connect(this._loadSettings, this);
            this._loadSettings();
        });
    }
    /**
     * Get the name of the current theme.
     */
    get theme() {
        return this._current;
    }
    /**
     * Get the name of the preferred light theme.
     */
    get preferredLightTheme() {
        return this._settings.composite['preferred-light-theme'];
    }
    /**
     * Get the name of the preferred dark theme.
     */
    get preferredDarkTheme() {
        return this._settings.composite['preferred-dark-theme'];
    }
    /**
     * Get the name of the preferred theme
     * When `adaptive-theme` is disabled, get current theme;
     * Else, depending on the system settings, get preferred light or dark theme.
     */
    get preferredTheme() {
        if (!this.isToggledAdaptiveTheme()) {
            return this.theme;
        }
        if (this.isSystemColorSchemeDark()) {
            return this.preferredDarkTheme;
        }
        return this.preferredLightTheme;
    }
    /**
     * The names of the registered themes.
     */
    get themes() {
        return Object.keys(this._themes);
    }
    /**
     * Get the names of the light themes.
     */
    get lightThemes() {
        return Object.entries(this._themes)
            .filter(([_, theme]) => theme.isLight)
            .map(([name, _]) => name);
    }
    /**
     * Get the names of the dark themes.
     */
    get darkThemes() {
        return Object.entries(this._themes)
            .filter(([_, theme]) => !theme.isLight)
            .map(([name, _]) => name);
    }
    /**
     * A signal fired when the application theme changes.
     */
    get themeChanged() {
        return this._themeChanged;
    }
    /**
     * Test if the system's preferred color scheme is dark
     */
    isSystemColorSchemeDark() {
        return (window.matchMedia &&
            window.matchMedia('(prefers-color-scheme: dark)').matches);
    }
    /**
     * Get the value of a CSS variable from its key.
     *
     * @param key - A Jupyterlab CSS variable, without the leading '--jp-'.
     *
     * @returns value - The current value of the Jupyterlab CSS variable
     */
    getCSS(key) {
        var _a;
        return ((_a = this._overrides[key]) !== null && _a !== void 0 ? _a : getComputedStyle(document.documentElement).getPropertyValue(`--jp-${key}`));
    }
    /**
     * Load a theme CSS file by path.
     *
     * @param path - The path of the file to load.
     */
    loadCSS(path) {
        const base = this._base;
        const href = coreutils_lib_index_js_.URLExt.isLocal(path) ? coreutils_lib_index_js_.URLExt.join(base, path) : path;
        const links = this._links;
        return new Promise((resolve, reject) => {
            const link = document.createElement('link');
            link.setAttribute('rel', 'stylesheet');
            link.setAttribute('type', 'text/css');
            link.setAttribute('href', href);
            link.addEventListener('load', () => {
                resolve(undefined);
            });
            link.addEventListener('error', () => {
                reject(`Stylesheet failed to load: ${href}`);
            });
            document.body.appendChild(link);
            links.push(link);
            // add any css overrides to document
            this.loadCSSOverrides();
        });
    }
    /**
     * Loads all current CSS overrides from settings. If an override has been
     * removed or is invalid, this function unloads it instead.
     */
    loadCSSOverrides() {
        var _a;
        const newOverrides = (_a = this._settings.user['overrides']) !== null && _a !== void 0 ? _a : {};
        // iterate over the union of current and new CSS override keys
        Object.keys({ ...this._overrides, ...newOverrides }).forEach(key => {
            const val = newOverrides[key];
            if (val && this.validateCSS(key, val)) {
                // validation succeeded, set the override
                document.documentElement.style.setProperty(`--jp-${key}`, val);
            }
            else {
                // if key is not present or validation failed, the override will be removed
                delete newOverrides[key];
                document.documentElement.style.removeProperty(`--jp-${key}`);
            }
        });
        // replace the current overrides with the new ones
        this._overrides = newOverrides;
    }
    /**
     * Validate a CSS value w.r.t. a key
     *
     * @param key - A Jupyterlab CSS variable, without the leading '--jp-'.
     *
     * @param val - A candidate CSS value
     */
    validateCSS(key, val) {
        // determine the css property corresponding to the key
        const prop = this._overrideProps[key];
        if (!prop) {
            console.warn('CSS validation failed: could not find property corresponding to key.\n' +
                `key: '${key}', val: '${val}'`);
            return false;
        }
        // use built-in validation once we have the corresponding property
        if (CSS.supports(prop, val)) {
            return true;
        }
        else {
            console.warn('CSS validation failed: invalid value.\n' +
                `key: '${key}', val: '${val}', prop: '${prop}'`);
            return false;
        }
    }
    /**
     * Register a theme with the theme manager.
     *
     * @param theme - The theme to register.
     *
     * @returns A disposable that can be used to unregister the theme.
     */
    register(theme) {
        const { name } = theme;
        const themes = this._themes;
        if (themes[name]) {
            throw new Error(`Theme already registered for ${name}`);
        }
        themes[name] = theme;
        return new disposable_dist_index_es6_js_.DisposableDelegate(() => {
            delete themes[name];
        });
    }
    /**
     * Add a CSS override to the settings.
     */
    setCSSOverride(key, value) {
        return this._settings.set('overrides', {
            ...this._overrides,
            [key]: value
        });
    }
    /**
     * Set the current theme.
     */
    setTheme(name) {
        return this._settings.set('theme', name);
    }
    /**
     * Set the preferred light theme.
     */
    setPreferredLightTheme(name) {
        return this._settings.set('preferred-light-theme', name);
    }
    /**
     * Set the preferred dark theme.
     */
    setPreferredDarkTheme(name) {
        return this._settings.set('preferred-dark-theme', name);
    }
    /**
     * Test whether a given theme is light.
     */
    isLight(name) {
        return this._themes[name].isLight;
    }
    /**
     * Increase a font size w.r.t. its current setting or its value in the
     * current theme.
     *
     * @param key - A Jupyterlab font size CSS variable, without the leading '--jp-'.
     */
    incrFontSize(key) {
        return this._incrFontSize(key, true);
    }
    /**
     * Decrease a font size w.r.t. its current setting or its value in the
     * current theme.
     *
     * @param key - A Jupyterlab font size CSS variable, without the leading '--jp-'.
     */
    decrFontSize(key) {
        return this._incrFontSize(key, false);
    }
    /**
     * Test whether a given theme styles scrollbars,
     * and if the user has scrollbar styling enabled.
     */
    themeScrollbars(name) {
        return (!!this._settings.composite['theme-scrollbars'] &&
            !!this._themes[name].themeScrollbars);
    }
    /**
     * Test if the user has scrollbar styling enabled.
     */
    isToggledThemeScrollbars() {
        return !!this._settings.composite['theme-scrollbars'];
    }
    /**
     * Toggle the `theme-scrollbars` setting.
     */
    toggleThemeScrollbars() {
        return this._settings.set('theme-scrollbars', !this._settings.composite['theme-scrollbars']);
    }
    /**
     * Test if the user enables adaptive theme.
     */
    isToggledAdaptiveTheme() {
        return !!this._settings.composite['adaptive-theme'];
    }
    /**
     * Toggle the `adaptive-theme` setting.
     */
    toggleAdaptiveTheme() {
        return this._settings.set('adaptive-theme', !this._settings.composite['adaptive-theme']);
    }
    /**
     * Get the display name of the theme.
     */
    getDisplayName(name) {
        var _a, _b;
        return (_b = (_a = this._themes[name]) === null || _a === void 0 ? void 0 : _a.displayName) !== null && _b !== void 0 ? _b : name;
    }
    /**
     * Change a font size by a positive or negative increment.
     */
    _incrFontSize(key, add = true) {
        var _a;
        // get the numeric and unit parts of the current font size
        const parts = ((_a = this.getCSS(key)) !== null && _a !== void 0 ? _a : '13px').split(/([a-zA-Z]+)/);
        // determine the increment
        const incr = (add ? 1 : -1) * (parts[1] === 'em' ? 0.1 : 1);
        // increment the font size and set it as an override
        return this.setCSSOverride(key, `${Number(parts[0]) + incr}${parts[1]}`);
    }
    /**
     * Initialize the key -> property dict for the overrides
     */
    _initOverrideProps() {
        const definitions = this._settings.schema.definitions;
        const overidesSchema = definitions.cssOverrides.properties;
        Object.keys(overidesSchema).forEach(key => {
            // Map each override key to its corresponding CSS property for
            // validation via CSS.supports(). These must be hardcoded rather
            // than read from schema description fields, which get translated
            // by the i18n system and break CSS validation in non-English locales.
            let cssProp;
            switch (key) {
                case 'code-font-family':
                case 'content-font-family':
                case 'ui-font-family':
                    cssProp = 'font-family';
                    break;
                case 'code-font-size':
                case 'content-font-size1':
                case 'ui-font-size1':
                    cssProp = 'font-size';
                    break;
                default:
                    console.warn(`No CSS property mapping for override key '${key}'. ` +
                        'CSS validation will be skipped for this key.');
                    break;
            }
            if (cssProp) {
                this._overrideProps[key] = cssProp;
            }
        });
    }
    /**
     * Handle the current settings.
     */
    _loadSettings() {
        const outstanding = this._outstanding;
        const pending = this._pending;
        const requests = this._requests;
        // If another request is pending, cancel it.
        if (pending) {
            window.clearTimeout(pending);
            this._pending = 0;
        }
        const settings = this._settings;
        const themes = this._themes;
        let theme = settings.composite['theme'];
        if (this.isToggledAdaptiveTheme()) {
            if (this.isSystemColorSchemeDark()) {
                theme = this.preferredDarkTheme;
            }
            else {
                theme = this.preferredLightTheme;
            }
        }
        // If another promise is outstanding, wait until it finishes before
        // attempting to load the settings. Because outstanding promises cannot
        // be aborted, the order in which they occur must be enforced.
        if (outstanding) {
            outstanding
                .then(() => {
                this._loadSettings();
            })
                .catch(() => {
                this._loadSettings();
            });
            this._outstanding = null;
            return;
        }
        // Increment the request counter.
        requests[theme] = requests[theme] ? requests[theme] + 1 : 1;
        // If the theme exists, load it right away.
        if (themes[theme]) {
            this._outstanding = this._loadTheme(theme);
            delete requests[theme];
            return;
        }
        // If the request has taken too long, give up.
        if (requests[theme] > REQUEST_THRESHOLD) {
            const fallback = settings.default('theme');
            // Stop tracking the requests for this theme.
            delete requests[theme];
            if (!themes[fallback]) {
                this._onError(this._trans.__('Neither theme %1 nor default %2 loaded.', theme, fallback));
                return;
            }
            console.warn(`Could not load theme ${theme}, using default ${fallback}.`);
            this._outstanding = this._loadTheme(fallback);
            return;
        }
        // If the theme does not yet exist, attempt to wait for it.
        this._pending = window.setTimeout(() => {
            this._loadSettings();
        }, REQUEST_INTERVAL);
    }
    /**
     * Load the theme.
     *
     * #### Notes
     * This method assumes that the `theme` exists.
     */
    _loadTheme(theme) {
        var _a;
        const current = this._current;
        const links = this._links;
        const themes = this._themes;
        const splash = this._splash
            ? this._splash.show(themes[theme].isLight)
            : new disposable_dist_index_es6_js_.DisposableDelegate(() => undefined);
        // Unload any CSS files that have been loaded.
        links.forEach(link => {
            if (link.parentElement) {
                link.parentElement.removeChild(link);
            }
        });
        links.length = 0;
        const themeProps = (_a = this._settings.schema.properties) === null || _a === void 0 ? void 0 : _a.theme;
        if (themeProps) {
            // Use oneOf with const/title so the stored value is always the
            // untranslated theme name while the dropdown shows the translated
            // displayName. Using enum with displayNames broke validation in
            // non-English locales (see #18543).
            delete themeProps.enum;
            themeProps.oneOf = Object.keys(themes).map(value => {
                var _a;
                return ({
                    const: value,
                    title: (_a = themes[value].displayName) !== null && _a !== void 0 ? _a : value
                });
            });
        }
        // Unload the previously loaded theme.
        const old = current ? themes[current].unload() : Promise.resolve();
        return Promise.all([old, themes[theme].load()])
            .then(() => {
            this._current = theme;
            this._themeChanged.emit({
                name: 'theme',
                oldValue: current,
                newValue: theme
            });
            // Need to force a redraw of the app here to avoid a Chrome rendering
            // bug that can leave the scrollbars in an invalid state
            this._host.hide();
            // If we hide/show the widget too quickly, no redraw will happen.
            // requestAnimationFrame delays until after the next frame render.
            requestAnimationFrame(() => {
                this._host.show();
                thememanager_Private.fitAll(this._host);
                splash.dispose();
            });
        })
            .catch(reason => {
            this._onError(reason);
            splash.dispose();
        });
    }
    /**
     * Handle a theme error.
     */
    _onError(reason) {
        void showDialog({
            title: this._trans.__('Error Loading Theme'),
            body: String(reason),
            buttons: [Dialog.okButton({ label: this._trans.__('OK') })]
        });
    }
}
/**
 * A namespace for module private data.
 */
var thememanager_Private;
(function (Private) {
    /**
     * Fit a widget and all of its children, recursively.
     */
    function fitAll(widget) {
        for (const child of widget.children()) {
            fitAll(child);
        }
        widget.fit();
    }
    Private.fitAll = fitAll;
})(thememanager_Private || (thememanager_Private = {}));
//# sourceMappingURL=thememanager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The command palette token.
 */
const ICommandPalette = new dist_index_js_.Token('@jupyterlab/apputils:ICommandPalette', `A service for the application command palette
  in the left panel. Use this to add commands to the palette.`);
/**
 * The kernel status indicator model.
 */
const IKernelStatusModel = new dist_index_js_.Token('@jupyterlab/apputils:IKernelStatusModel', 'A service to register kernel session provider to the kernel status indicator.');
/**
 * The license client for fetching licenses.
 */
const ILicensesClient = new dist_index_js_.Token('@jupyterlab/apputils:ILicensesClient', 'A service for fetching licenses.');
/**
 * The session context dialogs token.
 */
const ISessionContextDialogs = new dist_index_js_.Token('@jupyterlab/apputils:ISessionContextDialogs', 'A service for handling the session dialogs.');
/**
 * The theme manager token.
 */
const IThemeManager = new dist_index_js_.Token('@jupyterlab/apputils:IThemeManager', 'A service for the theme manager for the application. This is used primarily in theme extensions to register new themes.');
/**
 * The sanitizer token.
 */
const ISanitizer = new dist_index_js_.Token('@jupyterlab/apputils:ISanitizer', 'A service for sanitizing HTML strings.');
/**
 * The main menu token.
 */
const ISplashScreen = new dist_index_js_.Token('@jupyterlab/apputils:ISplashScreen', `A service for the splash screen for the application.
  Use this if you want to show the splash screen for your own purposes.`);
/**
 * The default window resolver token.
 */
const IWindowResolver = new dist_index_js_.Token('@jupyterlab/apputils:IWindowResolver', `A service for a window resolver for the
  application. JupyterLab workspaces are given a name, which are determined using
  the window resolver. Require this if you want to use the name of the current workspace.`);
/**
 * The toolbar registry token.
 */
const IToolbarWidgetRegistry = new dist_index_js_.Token('@jupyterlab/apputils:IToolbarWidgetRegistry', `A registry for toolbar widgets. Require this
  if you want to build the toolbar dynamically from a data definition (stored in settings for example).`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/toolbar/registry.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * Concrete implementation of IToolbarWidgetRegistry interface
 */
class ToolbarWidgetRegistry {
    constructor(options) {
        this._widgets = new Map();
        this._factoryAdded = new signaling_dist_index_es6_js_.Signal(this);
        this._defaultFactory = options.defaultFactory;
    }
    /**
     * Default toolbar item factory
     */
    get defaultFactory() {
        return this._defaultFactory;
    }
    set defaultFactory(factory) {
        this._defaultFactory = factory;
    }
    /**
     * A signal emitted when a factory widget has been added.
     */
    get factoryAdded() {
        return this._factoryAdded;
    }
    /**
     * Create a toolbar item widget
     *
     * @param widgetFactory The widget factory name that creates the toolbar
     * @param widget The newly widget containing the toolbar
     * @param toolbarItem The toolbar item definition
     * @returns The widget to be inserted in the toolbar.
     */
    createWidget(widgetFactory, widget, toolbarItem) {
        var _a;
        const factory = (_a = this._widgets.get(widgetFactory)) === null || _a === void 0 ? void 0 : _a.get(toolbarItem.name);
        return factory
            ? factory(widget)
            : this._defaultFactory(widgetFactory, widget, toolbarItem);
    }
    /**
     * Add a new toolbar item factory
     *
     * @param widgetFactory The widget factory name that creates the toolbar
     * @param toolbarItemName The unique toolbar item
     * @param factory The factory function that receives the widget containing the toolbar and returns the toolbar widget.
     * @returns The previously defined factory
     */
    addFactory(widgetFactory, toolbarItemName, factory) {
        let namespace = this._widgets.get(widgetFactory);
        const oldFactory = namespace === null || namespace === void 0 ? void 0 : namespace.get(toolbarItemName);
        if (!namespace) {
            namespace = new Map();
            this._widgets.set(widgetFactory, namespace);
        }
        namespace.set(toolbarItemName, factory);
        this._factoryAdded.emit(toolbarItemName);
        return oldFactory;
    }
    /**
     * Register a new toolbar item factory
     *
     * @param widgetFactory The widget factory name that creates the toolbar
     * @param toolbarItemName The unique toolbar item
     * @param factory The factory function that receives the widget containing the toolbar and returns the toolbar widget.
     * @returns The previously defined factory
     *
     * @deprecated since v4 use `addFactory` instead
     */
    registerFactory(widgetFactory, toolbarItemName, factory) {
        return this.addFactory(widgetFactory, toolbarItemName, factory);
    }
}
/**
 * Create the default toolbar item widget factory
 *
 * @param commands Application commands registry
 * @returns Default factory
 */
function createDefaultFactory(commands) {
    return (widgetFactory, widget, toolbarItem) => {
        var _a, _b;
        switch ((_a = toolbarItem.type) !== null && _a !== void 0 ? _a : 'command') {
            case 'command': {
                const { command: tId, args: tArgs, label: tLabel, caption: tCaption, icon: tIcon } = toolbarItem;
                const id = tId !== null && tId !== void 0 ? tId : '';
                const args = { toolbar: true, ...tArgs };
                const icon = tIcon ? index_js_.LabIcon.resolve({ icon: tIcon }) : undefined;
                const toolbar = widget.toolbar;
                // If there is an icon, undefined label will results in no label
                // otherwise the label will be set using the setting or the command label
                const label = (icon !== null && icon !== void 0 ? icon : commands.icon(id, args)) ? tLabel !== null && tLabel !== void 0 ? tLabel : '' : tLabel;
                return new index_js_.CommandToolbarButton({
                    commands,
                    id,
                    args,
                    icon,
                    label,
                    caption: tCaption,
                    noFocusOnClick: (_b = toolbar === null || toolbar === void 0 ? void 0 : toolbar.noFocusOnClick) !== null && _b !== void 0 ? _b : false
                });
            }
            case 'spacer':
                return index_js_.Toolbar.createSpacerItem();
            default:
                return new index_es6_js_.Widget();
        }
    };
}
//# sourceMappingURL=registry.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var observables_lib_index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/toolbar/factory.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */





/**
 * Default toolbar item rank
 *
 * #### Notes
 * This will place item just before the white spacer item in the notebook toolbar.
 */
const DEFAULT_TOOLBAR_ITEM_RANK = 50;
const TOOLBAR_KEY = 'jupyter.lab.toolbars';
/**
 * Display warning when the toolbar definition have been modified.
 *
 * @param trans Translation bundle
 */
async function displayInformation(trans) {
    const result = await showDialog({
        title: trans.__('Information'),
        body: trans.__('Toolbar customization has changed. You will need to reload JupyterLab to see the changes.'),
        buttons: [
            Dialog.cancelButton(),
            Dialog.okButton({ label: trans.__('Reload') })
        ]
    });
    if (result.button.accept) {
        location.reload();
    }
}
/**
 * Set the toolbar definition by accumulating all settings definition.
 *
 * The list will be populated only with the enabled items.
 *
 * @param toolbarItems Observable list to populate
 * @param registry Application settings registry
 * @param factoryName Widget factory name that needs a toolbar
 * @param pluginId Settings plugin id
 * @param translator Translator object
 * @param propertyId Property holding the toolbar definition in the settings; default 'toolbar'
 * @returns List of toolbar items
 */
async function setToolbarItems(toolbarItems, registry, factoryName, pluginId, translator, propertyId = 'toolbar') {
    var _a;
    const trans = translator.load('jupyterlab');
    let canonical = null;
    let loaded = {};
    let listenPlugin = true;
    try {
        /**
         * Populate the plugin's schema defaults.
         *
         * We keep track of disabled entries in case the plugin is loaded
         * after the toolbar initialization.
         */
        function populate(schema) {
            var _a, _b;
            loaded = {};
            const pluginDefaults = Object.keys(registry.plugins)
                // Filter out the current plugin (will be listed when reloading)
                // because we control its addition after the mapping step
                .filter(plugin => plugin !== pluginId)
                .map(plugin => {
                var _a, _b;
                const items = (_b = ((_a = registry.plugins[plugin].schema[TOOLBAR_KEY]) !== null && _a !== void 0 ? _a : {})[factoryName]) !== null && _b !== void 0 ? _b : [];
                loaded[plugin] = items;
                return items;
            })
                .concat([(_b = ((_a = schema[TOOLBAR_KEY]) !== null && _a !== void 0 ? _a : {})[factoryName]) !== null && _b !== void 0 ? _b : []])
                .reduceRight((acc, val) => settingregistry_lib_index_js_.SettingRegistry.reconcileToolbarItems(acc, val, true), []);
            // Apply default value as last step to take into account overrides.json
            // The standard toolbars default is [] as the plugin must use
            // `jupyter.lab.toolbars.<factory>` to define its default value.
            schema.properties[propertyId].default =
                settingregistry_lib_index_js_.SettingRegistry.reconcileToolbarItems(pluginDefaults, schema.properties[propertyId].default, true).sort((a, b) => {
                    var _a, _b;
                    return ((_a = a.rank) !== null && _a !== void 0 ? _a : DEFAULT_TOOLBAR_ITEM_RANK) -
                        ((_b = b.rank) !== null && _b !== void 0 ? _b : DEFAULT_TOOLBAR_ITEM_RANK);
                });
        }
        // Transform the plugin object to return different schema than the default.
        registry.transform(pluginId, {
            compose: plugin => {
                var _a, _b, _c, _d, _e;
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                const defaults = (_c = ((_b = ((_a = canonical.properties) !== null && _a !== void 0 ? _a : {})[propertyId]) !== null && _b !== void 0 ? _b : {}).default) !== null && _c !== void 0 ? _c : [];
                // Initialize the settings
                const user = plugin.data.user;
                const composite = plugin.data.composite;
                // Overrides the value with using the aggregated default for the toolbar property
                user[propertyId] =
                    (_d = plugin.data.user[propertyId]) !== null && _d !== void 0 ? _d : [];
                composite[propertyId] = ((_e = settingregistry_lib_index_js_.SettingRegistry.reconcileToolbarItems(defaults, user[propertyId], false)) !== null && _e !== void 0 ? _e : []).sort((a, b) => {
                    var _a, _b;
                    return ((_a = a.rank) !== null && _a !== void 0 ? _a : DEFAULT_TOOLBAR_ITEM_RANK) -
                        ((_b = b.rank) !== null && _b !== void 0 ? _b : DEFAULT_TOOLBAR_ITEM_RANK);
                });
                plugin.data = { composite, user };
                return plugin;
            },
            fetch: plugin => {
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                return {
                    data: plugin.data,
                    id: plugin.id,
                    raw: plugin.raw,
                    schema: canonical,
                    version: plugin.version
                };
            }
        });
    }
    catch (error) {
        if (error.name === 'TransformError') {
            // Assume the existing transformer is the toolbar builder transformer
            // from another factory set up.
            listenPlugin = false;
        }
        else {
            throw error;
        }
    }
    // Repopulate the canonical variable after the setting registry has
    // preloaded all initial plugins.
    const settings = await registry.load(pluginId);
    // React to customization by the user
    settings.changed.connect(() => {
        var _a;
        const newItems = (_a = settings.composite[propertyId]) !== null && _a !== void 0 ? _a : [];
        transferSettings(newItems);
    });
    const transferSettings = (newItems) => {
        // This is not optimal but safer because a toolbar item with the same
        // name cannot be inserted (it will be a no-op). But that could happen
        // if the settings are changing the items order.
        toolbarItems.clear();
        toolbarItems.pushAll(newItems.filter(item => !item.disabled));
    };
    // Initialize the toolbar
    transferSettings((_a = settings.composite[propertyId]) !== null && _a !== void 0 ? _a : []);
    // React to plugin changes if no other transformer exists, otherwise bail.
    if (!listenPlugin) {
        return;
    }
    registry.pluginChanged.connect(async (sender, plugin) => {
        var _a, _b, _c;
        // Since the plugin storing the toolbar definition is transformed above,
        // if it has changed, it means that a request to reload was triggered.
        // Hence the toolbar definitions from the other plugins have been
        // automatically reset during the transform step.
        if (plugin === pluginId) {
            return;
        }
        // If a plugin changed its toolbar items
        const oldItems = (_a = loaded[plugin]) !== null && _a !== void 0 ? _a : [];
        const newItems = (_c = ((_b = registry.plugins[plugin].schema[TOOLBAR_KEY]) !== null && _b !== void 0 ? _b : {})[factoryName]) !== null && _c !== void 0 ? _c : [];
        if (!dist_index_js_.JSONExt.deepEqual(oldItems, newItems)) {
            if (loaded[plugin]) {
                // The plugin has changed, request the user to reload the UI
                await displayInformation(trans);
            }
            else {
                if (newItems.length > 0) {
                    // Empty the default values to avoid toolbar settings collisions.
                    canonical = null;
                    const schema = registry.plugins[pluginId].schema;
                    schema.properties.toolbar.default = [];
                    // Run again the transformations.
                    await registry.load(pluginId, true);
                }
            }
        }
    });
}
/**
 * Create the toolbar factory for a given container widget based
 * on a data description stored in settings
 *
 * @param toolbarRegistry Toolbar widgets registry
 * @param settingsRegistry Settings registry
 * @param factoryName Toolbar container factory name
 * @param pluginId Settings plugin id
 * @param translator Translator
 * @param propertyId Toolbar definition key in the settings plugin
 * @returns List of toolbar widgets factory
 */
function createToolbarFactory(toolbarRegistry, settingsRegistry, factoryName, pluginId, translator, propertyId = 'toolbar') {
    const items = new observables_lib_index_js_.ObservableList({
        itemCmp: (a, b) => dist_index_js_.JSONExt.deepEqual(a, b)
    });
    // Get toolbar definition from the settings
    setToolbarItems(items, settingsRegistry, factoryName, pluginId, translator, propertyId).catch(reason => {
        console.error(`Failed to load toolbar items for factory ${factoryName} from ${pluginId}`, reason);
    });
    return (widget) => {
        const updateToolbar = (list, change) => {
            switch (change.type) {
                case 'move':
                    toolbar.move(change.oldIndex, change.newIndex);
                    break;
                case 'add':
                    change.newValues.forEach(item => toolbar.push({
                        name: item.name,
                        widget: toolbarRegistry.createWidget(factoryName, widget, item)
                    }));
                    break;
                case 'remove':
                    change.oldValues.forEach(() => toolbar.remove(change.oldIndex));
                    break;
                case 'set':
                    change.newValues.forEach(item => toolbar.set(change.newIndex, {
                        name: item.name,
                        widget: toolbarRegistry.createWidget(factoryName, widget, item)
                    }));
                    break;
                case 'clear':
                    change.oldValues.forEach(() => toolbar.remove(change.oldIndex));
                    break;
            }
        };
        const updateWidget = (registry, itemName) => {
            const itemIndex = Array.from(items).findIndex(item => item.name === itemName);
            if (itemIndex >= 0) {
                toolbar.set(itemIndex, {
                    name: itemName,
                    widget: toolbarRegistry.createWidget(factoryName, widget, items.get(itemIndex))
                });
            }
        };
        const toolbar = new observables_lib_index_js_.ObservableList({
            values: Array.from(items).map(item => {
                return {
                    name: item.name,
                    widget: toolbarRegistry.createWidget(factoryName, widget, item)
                };
            })
        });
        // Re-render the widget if a new factory has been added.
        toolbarRegistry.factoryAdded.connect(updateWidget);
        items.changed.connect(updateToolbar);
        widget.disposed.connect(() => {
            items.changed.disconnect(updateToolbar);
            toolbarRegistry.factoryAdded.disconnect(updateWidget);
        });
        return toolbar;
    };
}
/**
 * Set the toolbar items of a widget from a factory
 *
 * @param widget Widget with the toolbar to set
 * @param factory Toolbar items factory
 * @param toolbar Separated toolbar if widget is a raw widget
 */
function setToolbar(widget, factory, toolbar) {
    var _a;
    // @ts-expect-error Widget has no toolbar
    if (!widget.toolbar && !toolbar) {
        console.log(`Widget ${widget.id} has no 'toolbar' and no explicit toolbar was provided.`);
        return;
    }
    // @ts-expect-error Widget has no toolbar
    const toolbar_ = (_a = widget.toolbar) !== null && _a !== void 0 ? _a : toolbar;
    const items = factory(widget);
    if (Array.isArray(items)) {
        items.forEach(({ name, widget: item }) => {
            toolbar_.addItem(name, item);
        });
    }
    else {
        const updateToolbar = (list, changes) => {
            switch (changes.type) {
                case 'add':
                    changes.newValues.forEach((item, index) => {
                        toolbar_.insertItem(changes.newIndex + index, item.name, item.widget);
                    });
                    break;
                case 'move':
                    changes.oldValues.forEach(item => {
                        item.widget.parent = null;
                    });
                    changes.newValues.forEach((item, index) => {
                        toolbar_.insertItem(changes.newIndex + index, item.name, item.widget);
                    });
                    break;
                case 'remove':
                    changes.oldValues.forEach(item => {
                        item.widget.parent = null;
                    });
                    break;
                case 'set':
                    changes.oldValues.forEach(item => {
                        item.widget.parent = null;
                    });
                    changes.newValues.forEach((item, index) => {
                        const existingIndex = (0,dist_index_es6_js_.findIndex)(toolbar_.names(), name => item.name === name);
                        if (existingIndex >= 0) {
                            Array.from(toolbar_.children())[existingIndex].parent = null;
                        }
                        toolbar_.insertItem(changes.newIndex + index, item.name, item.widget);
                    });
                    break;
                case 'clear':
                    Array.from(toolbar_.children()).forEach(child => {
                        child.parent = null;
                    });
                    break;
            }
        };
        updateToolbar(items, {
            newIndex: 0,
            newValues: Array.from(items),
            oldIndex: 0,
            oldValues: [],
            type: 'add'
        });
        items.changed.connect(updateToolbar);
        widget.disposed.connect(() => {
            items.changed.disconnect(updateToolbar);
        });
    }
}
//# sourceMappingURL=factory.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/windowresolver.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A concrete implementation of a window name resolver.
 */
class WindowResolver {
    /**
     * The resolved window name.
     *
     * #### Notes
     * If the `resolve` promise has not resolved, the behavior is undefined.
     */
    get name() {
        return this._name;
    }
    /**
     * Resolve a window name to use as a handle among shared resources.
     *
     * @param candidate - The potential window name being resolved.
     *
     * #### Notes
     * Typically, the name candidate should be a JupyterLab workspace name or
     * an empty string if there is no workspace.
     *
     * If the returned promise rejects, a window name cannot be resolved without
     * user intervention, which typically means navigation to a new URL.
     */
    resolve(candidate) {
        return windowresolver_Private.resolve(candidate).then(name => {
            this._name = name;
        });
    }
}
/*
 * A namespace for private module data.
 */
var windowresolver_Private;
(function (Private) {
    /**
     * The internal prefix for private local storage keys.
     */
    const PREFIX = '@jupyterlab/statedb:StateDB';
    /**
     * The local storage beacon key.
     */
    const BEACON = `${PREFIX}:beacon`;
    /**
     * The timeout (in ms) to wait for beacon responders.
     *
     * #### Notes
     * This value is a whole number between 200 and 500 in order to prevent
     * perfect timeout collisions between multiple simultaneously opening windows
     * that have the same URL. This is an edge case because multiple windows
     * should not ordinarily share the same URL, but it can be contrived.
     */
    const TIMEOUT = Math.floor(200 + Math.random() * 300);
    /**
     * The local storage window key.
     */
    const WINDOW = `${PREFIX}:window`;
    /**
     * Current beacon request
     *
     * #### Notes
     * We keep track of the current request so that we can ignore our own beacon
     * requests. This is to work around a bug in Safari, where Safari sometimes
     * triggers local storage events for changes made by the current tab. See
     * https://github.com/jupyterlab/jupyterlab/issues/6921#issuecomment-540817283
     * for more details.
     */
    let currentBeaconRequest = null;
    /**
     * A potential preferred default window name.
     */
    let candidate = null;
    /**
     * The window name promise.
     */
    const delegate = new dist_index_js_.PromiseDelegate();
    /**
     * The known window names.
     */
    const known = {};
    /**
     * The window name.
     */
    let name = null;
    /**
     * Whether the name resolution has completed.
     */
    let resolved = false;
    /**
     * Start the storage event handler.
     */
    function initialize() {
        // Listen to all storage events for beacons and window names.
        window.addEventListener('storage', (event) => {
            const { key, newValue } = event;
            // All the keys we care about have values.
            if (newValue === null) {
                return;
            }
            // If the beacon was fired, respond with a ping.
            if (key === BEACON &&
                newValue !== currentBeaconRequest &&
                candidate !== null) {
                ping(resolved ? name : candidate);
                return;
            }
            // If the window name is resolved, bail.
            if (resolved || key !== WINDOW) {
                return;
            }
            const reported = newValue.replace(/\-\d+$/, '');
            // Store the reported window name.
            known[reported] = null;
            // If a reported window name and candidate collide, reject the candidate.
            if (!candidate || candidate in known) {
                reject();
            }
        });
    }
    /**
     * Ping peers with payload.
     */
    function ping(payload) {
        if (payload === null) {
            return;
        }
        const { localStorage } = window;
        localStorage.setItem(WINDOW, `${payload}-${new Date().getTime()}`);
    }
    /**
     * Reject the candidate.
     */
    function reject() {
        resolved = true;
        currentBeaconRequest = null;
        delegate.reject(`Window name candidate "${candidate}" already exists`);
    }
    /**
     * Returns a promise that resolves with the window name used for restoration.
     */
    function resolve(potential) {
        if (resolved) {
            return delegate.promise;
        }
        // Set the local candidate.
        candidate = potential;
        if (candidate in known) {
            reject();
            return delegate.promise;
        }
        const { localStorage, setTimeout } = window;
        // Wait until other windows have reported before claiming the candidate.
        setTimeout(() => {
            if (resolved) {
                return;
            }
            // If the window name has not already been resolved, check one last time
            // to confirm it is not a duplicate before resolving.
            if (!candidate || candidate in known) {
                return reject();
            }
            resolved = true;
            currentBeaconRequest = null;
            delegate.resolve((name = candidate));
            ping(name);
        }, TIMEOUT);
        // Fire the beacon to collect other windows' names.
        currentBeaconRequest = `${Math.random()}-${new Date().getTime()}`;
        localStorage.setItem(BEACON, currentBeaconRequest);
        return delegate.promise;
    }
    Private.resolve = resolve;
    // Initialize the storage listener at runtime.
    (() => {
        initialize();
    })();
})(windowresolver_Private || (windowresolver_Private = {}));
//# sourceMappingURL=windowresolver.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module apputils
 */


/**
 * @deprecated since v4
 * These widgets are now in @jupyterlab/ui-components
 */






















// Merge Toolbar namespace to preserve API
/**
 * @deprecated since v4
 * This class is in @jupyterlab/ui-components
 */
class Toolbar extends index_js_.Toolbar {
}
(function (Toolbar) {
    Toolbar.createInterruptButton = widget_Toolbar.createInterruptButton;
    Toolbar.createKernelNameItem = widget_Toolbar.createKernelNameItem;
    Toolbar.createKernelStatusItem = widget_Toolbar.createKernelStatusItem;
    Toolbar.createRestartButton = widget_Toolbar.createRestartButton;
    /**
     * @deprecated since v4
     * This helper function is in @jupyterlab/ui-components
     */
    Toolbar.createSpacerItem = index_js_.Toolbar.createSpacerItem;
})(Toolbar || (Toolbar = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 57261:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js + 1 modules
var statusbar_style = __webpack_require__(546);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/apputils/style/base.css
var base = __webpack_require__(11997);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/apputils/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 44042:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  AttachmentsModel: () => (/* reexport */ AttachmentsModel),
  AttachmentsResolver: () => (/* reexport */ AttachmentsResolver)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/attachments/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * The default implementation of the IAttachmentsModel.
 */
class AttachmentsModel {
    /**
     * Construct a new observable outputs instance.
     */
    constructor(options) {
        var _a;
        this._map = new index_js_.ObservableMap();
        this._isDisposed = false;
        this._stateChanged = new index_es6_js_.Signal(this);
        this._changed = new index_es6_js_.Signal(this);
        this._serialized = null;
        this._changeGuard = false;
        this.contentFactory =
            (_a = options.contentFactory) !== null && _a !== void 0 ? _a : AttachmentsModel.defaultContentFactory;
        if (options.values) {
            for (const key of Object.keys(options.values)) {
                if (options.values[key] !== undefined) {
                    this.set(key, options.values[key]);
                }
            }
        }
        this._map.changed.connect(this._onMapChanged, this);
    }
    /**
     * A signal emitted when the model state changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * A signal emitted when the model changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * The keys of the attachments in the model.
     */
    get keys() {
        return this._map.keys();
    }
    /**
     * Get the length of the items in the model.
     */
    get length() {
        return this._map.keys().length;
    }
    /**
     * Test whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._map.dispose();
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Whether the specified key is set.
     */
    has(key) {
        return this._map.has(key);
    }
    /**
     * Get an item at the specified key.
     */
    get(key) {
        return this._map.get(key);
    }
    /**
     * Set the value at the specified key.
     */
    set(key, value) {
        // Normalize stream data.
        const item = this._createItem({ value });
        this._map.set(key, item);
    }
    /**
     * Remove the attachment whose name is the specified key
     */
    remove(key) {
        this._map.delete(key);
    }
    /**
     * Clear all of the attachments.
     */
    clear() {
        this._map.values().forEach((item) => {
            item.dispose();
        });
        this._map.clear();
    }
    /**
     * Deserialize the model from JSON.
     *
     * #### Notes
     * This will clear any existing data.
     */
    fromJSON(values) {
        this.clear();
        Object.keys(values).forEach(key => {
            if (values[key] !== undefined) {
                this.set(key, values[key]);
            }
        });
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        const ret = {};
        for (const key of this._map.keys()) {
            ret[key] = this._map.get(key).toJSON();
        }
        return ret;
    }
    /**
     * Create an attachment item and hook up its signals.
     */
    _createItem(options) {
        const factory = this.contentFactory;
        const item = factory.createAttachmentModel(options);
        item.changed.connect(this._onGenericChange, this);
        return item;
    }
    /**
     * Handle a change to the list.
     */
    _onMapChanged(sender, args) {
        if (this._serialized && !this._changeGuard) {
            this._changeGuard = true;
            this._serialized.set(this.toJSON());
            this._changeGuard = false;
        }
        this._changed.emit(args);
        this._stateChanged.emit(void 0);
    }
    /**
     * Handle a change to an item.
     */
    _onGenericChange() {
        this._stateChanged.emit(void 0);
    }
}
/**
 * The namespace for AttachmentsModel class statics.
 */
(function (AttachmentsModel) {
    /**
     * The default implementation of a `IAttachmentsModel.IContentFactory`.
     */
    class ContentFactory {
        /**
         * Create an attachment model.
         */
        createAttachmentModel(options) {
            return new lib_index_js_.AttachmentModel(options);
        }
    }
    AttachmentsModel.ContentFactory = ContentFactory;
    /**
     * The default attachment model factory.
     */
    AttachmentsModel.defaultContentFactory = new ContentFactory();
})(AttachmentsModel || (AttachmentsModel = {}));
/**
 * A resolver for cell attachments 'attachment:filename'.
 *
 * Will resolve to a data: url.
 */
class AttachmentsResolver {
    /**
     * Create an attachments resolver object.
     */
    constructor(options) {
        this._parent = options.parent || null;
        this._model = options.model;
    }
    /**
     * Resolve a relative url to a correct server path.
     */
    async resolveUrl(url, context) {
        if (this._parent && !url.startsWith('attachment:')) {
            return this._parent.resolveUrl(url, context);
        }
        return url;
    }
    /**
     * Get the download url of a given absolute server path.
     *
     * #### Notes
     * The returned URL may include a query parameter.
     */
    async getDownloadUrl(path) {
        if (this._parent && !path.startsWith('attachment:')) {
            return this._parent.getDownloadUrl(path);
        }
        // Return a data URL with the data of the url
        const key = path.slice('attachment:'.length);
        const attachment = this._model.get(key);
        if (attachment === undefined) {
            // Resolve with unprocessed path, to show as broken image
            return path;
        }
        const { data } = attachment;
        const mimeType = Object.keys(data)[0];
        // Only support known safe types:
        if (mimeType === undefined ||
            lib_index_js_.imageRendererFactory.mimeTypes.indexOf(mimeType) === -1) {
            throw new Error(`Cannot render unknown image mime type "${mimeType}".`);
        }
        const dataUrl = `data:${mimeType};base64,${data[mimeType]}`;
        return dataUrl;
    }
    /**
     * Whether the URL should be handled by the resolver
     * or not.
     */
    isLocal(url) {
        var _a, _b, _c;
        if (this._parent && !url.startsWith('attachment:')) {
            return (_c = (_b = (_a = this._parent).isLocal) === null || _b === void 0 ? void 0 : _b.call(_a, url)) !== null && _c !== void 0 ? _c : true;
        }
        return true;
    }
}
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/attachments/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module attachments
 */

//# sourceMappingURL=index.js.map

/***/ }),

/***/ 85099:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AudioDocumentWidget: () => (/* binding */ AudioDocumentWidget),
/* harmony export */   AudioViewer: () => (/* binding */ AudioViewer),
/* harmony export */   AudioViewerFactory: () => (/* binding */ AudioViewerFactory),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34992);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37253);
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_5__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module audio-extension
 */






/**
 * The class name added to an audio viewer.
 */
const AUDIO_CLASS = 'jp-AudioViewer';
/**
 * The name of the factory that creates audio widgets.
 */
const FACTORY_AUDIO = 'AudioViewer';
/**
 * Content provider ID for audio streaming
 */
const AUDIO_CONTENT_PROVIDER_ID = 'audio-provider';
/**
 * Get audio file types from the document registry
 */
function getAudioFileTypes(docRegistry) {
    const audioFileTypes = [];
    // Iterate through all registered file types
    for (const fileType of docRegistry.fileTypes()) {
        // Check if it's an audio file type by checking the MIME types
        if (fileType.mimeTypes.some(mimeType => mimeType.startsWith('audio/'))) {
            audioFileTypes.push(fileType.name);
        }
    }
    return audioFileTypes;
}
/**
 * An audio viewer widget.
 */
class AudioViewer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_5__.Widget {
    /**
     * Construct a new audio viewer widget.
     */
    constructor(options) {
        super();
        this.addClass(AUDIO_CLASS);
        this._context = options.context;
        this._contentsManager = options.contentsManager;
        // Create the audio element
        this._audio = document.createElement('audio');
        this._audio.controls = true;
        this.node.appendChild(this._audio);
        // Load audio when context is ready
        void this._context.ready.then(() => {
            void this._updateAudio();
        });
        // Listen for context model changes
        this._context.model.contentChanged.connect(this._updateAudio, this);
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
    }
    /**
     * Handle `resize` messages for the widget.
     */
    onResize(msg) {
        super.onResize(msg);
        if (this._audio) {
            this._audio.style.width = '100%';
        }
    }
    /**
     * Update the audio source.
     */
    async _updateAudio() {
        // Use getDownloadUrl for proper URL encoding and security tokens
        const audioUrl = await this._contentsManager.getDownloadUrl(this._context.path);
        this._audio.src = audioUrl;
    }
}
/**
 * A document widget for audio.
 */
class AudioDocumentWidget extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__.DocumentWidget {
    constructor(options) {
        super(options);
    }
}
/**
 * A widget factory for audio viewers.
 */
class AudioViewerFactory extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__.ABCWidgetFactory {
    /**
     * Construct a new audio viewer factory.
     */
    constructor(options) {
        super(options);
        this._contentsManager = options.contentsManager;
    }
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        const content = new AudioViewer({
            context,
            contentsManager: this._contentsManager
        });
        const widget = new AudioDocumentWidget({
            content,
            context
        });
        return widget;
    }
}
/**
 * A content provider for audio files.
 *
 * This overrides the default behavior of the RestContentProvider to not include the file content.
 */
class AudioContentProvider extends _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__.RestContentProvider {
    constructor(options) {
        super(options);
    }
    /**
     * Get a file or directory.
     *
     * @param localPath - The path to the file.
     * @param options - The options used to fetch the file.
     *
     * @returns A promise which resolves with the file content.
     */
    async get(localPath, options) {
        return super.get(localPath, { ...options, content: false });
    }
}
/**
 * The audio extension.
 */
const plugin = {
    id: '@jupyterlab/audio-extension:plugin',
    description: 'Adds a viewer for audio files',
    autoStart: true,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__.IDefaultDrive],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
    activate: (app, translator, defaultDrive, restorer) => {
        const trans = translator.load('jupyterlab');
        const { contents, serverSettings } = app.serviceManager;
        // Get audio file types from the document registry
        const audioFileTypes = getAudioFileTypes(app.docRegistry);
        // Register the audio stream content provider once
        const registry = defaultDrive.contentProviderRegistry;
        if (registry) {
            const audioContentProvider = new AudioContentProvider({
                apiEndpoint: '/api/contents',
                serverSettings
            });
            registry.register(AUDIO_CONTENT_PROVIDER_ID, audioContentProvider);
        }
        // Create tracker for all audio widgets
        const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
            namespace: 'audioviewer'
        });
        // Create single factory for all audio types
        const factory = new AudioViewerFactory({
            name: FACTORY_AUDIO,
            label: trans.__('Audio Viewer'),
            fileTypes: audioFileTypes,
            defaultFor: audioFileTypes,
            readOnly: true,
            translator,
            modelName: 'base64',
            contentProviderId: AUDIO_CONTENT_PROVIDER_ID,
            contentsManager: contents
        });
        app.docRegistry.addWidgetFactory(factory);
        factory.widgetCreated.connect(async (sender, widget) => {
            // Track the widget
            void tracker.add(widget);
            // Notify the widget tracker if restore data needs to update
            widget.context.pathChanged.connect(() => {
                void tracker.save(widget);
            });
            // Set appropriate icon based on file type from document registry
            const fileTypes = app.docRegistry.getFileTypesForPath(widget.context.path);
            const audioFileType = fileTypes.find(ft => ft.mimeTypes.some(mimeType => mimeType.startsWith('audio/')));
            if (audioFileType) {
                widget.title.icon = audioFileType.icon;
                widget.title.iconClass = audioFileType.iconClass || '';
                widget.title.iconLabel = audioFileType.iconLabel || '';
            }
        });
        if (restorer) {
            // Handle state restoration for all audio types
            void restorer.restore(tracker, {
                command: 'docmanager:open',
                args: widget => ({
                    path: widget.context.path,
                    factory: FACTORY_AUDIO
                }),
                name: widget => widget.context.path
            });
        }
    }
};
/**
 * Export the plugin as default.
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 96434:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/audio-extension/style/base.css
var base = __webpack_require__(1715);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/audio-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/audio-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








/***/ }),

/***/ 6347:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
|
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

#jp-MainLogo {
  width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));
}

#jp-top-bar {
  --jp-private-toolbar-height: var(--jp-private-menu-panel-height);

  flex: 1 1 auto;
  padding: 0 2px;
  box-shadow: none;
  border: none;
  align-items: center;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application-extension/style/base.css"],"names":[],"mappings":"AAAA;;;;8EAI8E;;AAE9E;EACE,yEAAyE;AAC3E;;AAEA;EACE,gEAAgE;;EAEhE,cAAc;EACd,cAAc;EACd,gBAAgB;EAChB,YAAY;EACZ,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n|\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n#jp-MainLogo {\n  width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));\n}\n\n#jp-top-bar {\n  --jp-private-toolbar-height: var(--jp-private-menu-panel-height);\n\n  flex: 1 1 auto;\n  padding: 0 2px;\n  box-shadow: none;\n  border: none;\n  align-items: center;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 82119:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_core_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71852);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_datagrid_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77893);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_dockpanel_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19792);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_menus_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15760);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_scrollbar_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2452);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_tabs_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(21171);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_buttons_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(40313);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_sidepanel_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(71728);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_titlepanel_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61059);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_skiplink_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(17285);
// Imports












var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_core_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_datagrid_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_dockpanel_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_menus_css__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_scrollbar_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_tabs_css__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_buttons_css__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_sidepanel_css__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_titlepanel_css__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_skiplink_css__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* Sibling imports */
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,oBAAoB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Sibling imports */\n@import './core.css';\n@import './datagrid.css';\n@import './dockpanel.css';\n@import './menus.css';\n@import './scrollbar.css';\n@import './tabs.css';\n@import './buttons.css';\n@import './sidepanel.css';\n@import './titlepanel.css';\n@import './skiplink.css';\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 40313:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --jp-flat-button-height: 24px;
  --jp-flat-button-padding: 8px 12px;
}

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-ThemedContainer button {
  border-radius: var(--jp-border-radius);
}

.jp-ThemedContainer button:focus-visible {
  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));
  outline-offset: -1px;
}

button.jp-mod-styled.jp-mod-accept {
  background: var(--jp-accept-color-normal, var(--md-blue-500, #2196f3));
  border: 0;
  color: white;
}

button.jp-mod-styled.jp-mod-accept:hover {
  background: var(--jp-accept-color-hover, var(--md-blue-600, #1e88e5));
}

button.jp-mod-styled.jp-mod-accept:active {
  background: var(--jp-accept-color-active, var(--md-blue-700, #1976d2));
}

button.jp-mod-styled.jp-mod-accept:focus-visible {
  outline: 1px solid var(--jp-accept-color-active, var(--jp-brand-color1));
}

button.jp-mod-styled.jp-mod-reject {
  background: var(--jp-reject-color-normal, var(--md-grey-500, #9e9e9e));
  border: 0;
  color: white;
}

button.jp-mod-styled.jp-mod-reject:hover {
  background: var(--jp-reject-color-hover, var(--md-grey-600, #757575));
}

button.jp-mod-styled.jp-mod-reject:active {
  background: var(--jp-reject-color-active, var(--md-grey-700, #616161));
}

button.jp-mod-styled.jp-mod-reject:focus-visible {
  outline: 1px solid var(--jp-reject-color-active, var(--md-grey-700, #616161));
}

button.jp-mod-styled.jp-mod-warn {
  background: var(--jp-warn-color-normal, var(--jp-error-color1));
  border: 0;
  color: white;
}

button.jp-mod-styled.jp-mod-warn:hover {
  background: var(--jp-warn-color-hover, var(--md-red-600, #e53935));
}

button.jp-mod-styled.jp-mod-warn:active {
  background: var(--jp-warn-color-active, var(--md-red-700, #d32f2f));
}

button.jp-mod-styled.jp-mod-warn:focus-visible {
  outline: 1px solid var(--jp-warn-color-active, var(--md-red-700, #d32f2f));
}

.jp-Button-flat {
  text-decoration: none;
  padding: var(--jp-flat-button-padding);
  font-weight: 500;
  background-color: transparent;
  height: var(--jp-private-running-shutdown-button-height);
  line-height: var(--jp-private-running-shutdown-button-height);
  transition: background-color 0.1s ease;
  border-radius: 2px;
}

.jp-Button-flat:focus {
  border: none;
  box-shadow: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/buttons.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;8EAE8E;;AAE9E;EACE,6BAA6B;EAC7B,kCAAkC;AACpC;;AAEA;;;8EAG8E;;AAE9E;EACE,sCAAsC;AACxC;;AAEA;EACE,mEAAmE;EACnE,oBAAoB;AACtB;;AAEA;EACE,sEAAsE;EACtE,SAAS;EACT,YAAY;AACd;;AAEA;EACE,qEAAqE;AACvE;;AAEA;EACE,sEAAsE;AACxE;;AAEA;EACE,wEAAwE;AAC1E;;AAEA;EACE,sEAAsE;EACtE,SAAS;EACT,YAAY;AACd;;AAEA;EACE,qEAAqE;AACvE;;AAEA;EACE,sEAAsE;AACxE;;AAEA;EACE,6EAA6E;AAC/E;;AAEA;EACE,+DAA+D;EAC/D,SAAS;EACT,YAAY;AACd;;AAEA;EACE,kEAAkE;AACpE;;AAEA;EACE,mEAAmE;AACrE;;AAEA;EACE,0EAA0E;AAC5E;;AAEA;EACE,qBAAqB;EACrB,sCAAsC;EACtC,gBAAgB;EAChB,6BAA6B;EAC7B,wDAAwD;EACxD,6DAA6D;EAC7D,sCAAsC;EACtC,kBAAkB;AACpB;;AAEA;EACE,YAAY;EACZ,gBAAgB;AAClB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-flat-button-height: 24px;\n  --jp-flat-button-padding: 8px 12px;\n}\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-ThemedContainer button {\n  border-radius: var(--jp-border-radius);\n}\n\n.jp-ThemedContainer button:focus-visible {\n  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));\n  outline-offset: -1px;\n}\n\nbutton.jp-mod-styled.jp-mod-accept {\n  background: var(--jp-accept-color-normal, var(--md-blue-500, #2196f3));\n  border: 0;\n  color: white;\n}\n\nbutton.jp-mod-styled.jp-mod-accept:hover {\n  background: var(--jp-accept-color-hover, var(--md-blue-600, #1e88e5));\n}\n\nbutton.jp-mod-styled.jp-mod-accept:active {\n  background: var(--jp-accept-color-active, var(--md-blue-700, #1976d2));\n}\n\nbutton.jp-mod-styled.jp-mod-accept:focus-visible {\n  outline: 1px solid var(--jp-accept-color-active, var(--jp-brand-color1));\n}\n\nbutton.jp-mod-styled.jp-mod-reject {\n  background: var(--jp-reject-color-normal, var(--md-grey-500, #9e9e9e));\n  border: 0;\n  color: white;\n}\n\nbutton.jp-mod-styled.jp-mod-reject:hover {\n  background: var(--jp-reject-color-hover, var(--md-grey-600, #757575));\n}\n\nbutton.jp-mod-styled.jp-mod-reject:active {\n  background: var(--jp-reject-color-active, var(--md-grey-700, #616161));\n}\n\nbutton.jp-mod-styled.jp-mod-reject:focus-visible {\n  outline: 1px solid var(--jp-reject-color-active, var(--md-grey-700, #616161));\n}\n\nbutton.jp-mod-styled.jp-mod-warn {\n  background: var(--jp-warn-color-normal, var(--jp-error-color1));\n  border: 0;\n  color: white;\n}\n\nbutton.jp-mod-styled.jp-mod-warn:hover {\n  background: var(--jp-warn-color-hover, var(--md-red-600, #e53935));\n}\n\nbutton.jp-mod-styled.jp-mod-warn:active {\n  background: var(--jp-warn-color-active, var(--md-red-700, #d32f2f));\n}\n\nbutton.jp-mod-styled.jp-mod-warn:focus-visible {\n  outline: 1px solid var(--jp-warn-color-active, var(--md-red-700, #d32f2f));\n}\n\n.jp-Button-flat {\n  text-decoration: none;\n  padding: var(--jp-flat-button-padding);\n  font-weight: 500;\n  background-color: transparent;\n  height: var(--jp-private-running-shutdown-button-height);\n  line-height: var(--jp-private-running-shutdown-button-height);\n  transition: background-color 0.1s ease;\n  border-radius: 2px;\n}\n\n.jp-Button-flat:focus {\n  border: none;\n  box-shadow: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 71852:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

:root {
  --jp-private-menu-panel-height: 27px;
}

.lm-Widget.lm-mod-hidden {
  display: none !important;
}

.jp-ThemedContainer {
  font-family: var(--jp-ui-font-family);
  background: var(--jp-layout-color3);
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.jp-LabShell {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.jp-LabShell.jp-mod-devMode {
  border-top: 4px solid red;
}

#jp-main-dock-panel {
  padding: 5px;
}

#jp-main-dock-panel[data-mode='single-document'] {
  padding: 0;
}

#jp-main-dock-panel[data-mode='single-document'] .jp-MainAreaWidget {
  border: none;
}

#jp-top-panel {
  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);
  background: var(--jp-layout-color1);
  display: flex;
  min-height: var(--jp-private-menubar-height);
  overflow: visible;

  /* relax lumino strict CSS contaiment to allow painting the menu bar item
  over the menu in order to create an illusion of partial border */
  contain: style size !important;
}

#jp-menu-panel {
  min-height: var(--jp-private-menu-panel-height);
  background: var(--jp-layout-color1);
}

#jp-down-stack {
  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
}

.jp-LabShell[data-shell-mode='single-document'] #jp-top-panel {
  border-bottom: none;
}

.jp-LabShell[data-shell-mode='single-document'] #jp-menu-panel {
  padding-left: calc(
    var(--jp-private-sidebar-tab-width) + var(--jp-border-width)
  );
  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);

  /* Adjust min-height so open menus show up in the right place */
  min-height: calc(
    var(--jp-private-menu-panel-height) + var(--jp-border-width)
  );
}

#jp-bottom-panel {
  background: var(--jp-layout-color1);
  display: flex;
}

#jp-single-document-mode {
  margin: 0 8px;
  display: flex;
  align-items: center;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/core.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,oCAAoC;AACtC;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,qCAAqC;EACrC,mCAAmC;EACnC,SAAS;EACT,UAAU;EACV,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,QAAQ;EACR,SAAS;AACX;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,mEAAmE;EACnE,mCAAmC;EACnC,aAAa;EACb,4CAA4C;EAC5C,iBAAiB;;EAEjB;kEACgE;EAChE,8BAA8B;AAChC;;AAEA;EACE,+CAA+C;EAC/C,mCAAmC;AACrC;;AAEA;EACE,mEAAmE;AACrE;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE;;GAEC;EACD,mEAAmE;;EAEnE,+DAA+D;EAC/D;;GAEC;AACH;;AAEA;EACE,mCAAmC;EACnC,aAAa;AACf;;AAEA;EACE,aAAa;EACb,aAAa;EACb,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-menu-panel-height: 27px;\n}\n\n.lm-Widget.lm-mod-hidden {\n  display: none !important;\n}\n\n.jp-ThemedContainer {\n  font-family: var(--jp-ui-font-family);\n  background: var(--jp-layout-color3);\n  margin: 0;\n  padding: 0;\n  overflow: hidden;\n}\n\n.jp-LabShell {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n}\n\n.jp-LabShell.jp-mod-devMode {\n  border-top: 4px solid red;\n}\n\n#jp-main-dock-panel {\n  padding: 5px;\n}\n\n#jp-main-dock-panel[data-mode='single-document'] {\n  padding: 0;\n}\n\n#jp-main-dock-panel[data-mode='single-document'] .jp-MainAreaWidget {\n  border: none;\n}\n\n#jp-top-panel {\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n  background: var(--jp-layout-color1);\n  display: flex;\n  min-height: var(--jp-private-menubar-height);\n  overflow: visible;\n\n  /* relax lumino strict CSS contaiment to allow painting the menu bar item\n  over the menu in order to create an illusion of partial border */\n  contain: style size !important;\n}\n\n#jp-menu-panel {\n  min-height: var(--jp-private-menu-panel-height);\n  background: var(--jp-layout-color1);\n}\n\n#jp-down-stack {\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.jp-LabShell[data-shell-mode='single-document'] #jp-top-panel {\n  border-bottom: none;\n}\n\n.jp-LabShell[data-shell-mode='single-document'] #jp-menu-panel {\n  padding-left: calc(\n    var(--jp-private-sidebar-tab-width) + var(--jp-border-width)\n  );\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n\n  /* Adjust min-height so open menus show up in the right place */\n  min-height: calc(\n    var(--jp-private-menu-panel-height) + var(--jp-border-width)\n  );\n}\n\n#jp-bottom-panel {\n  background: var(--jp-layout-color1);\n  display: flex;\n}\n\n#jp-single-document-mode {\n  margin: 0 8px;\n  display: flex;\n  align-items: center;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 77893:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.lm-DataGrid {
  min-width: 64px;
  min-height: 64px;
  border: 1px solid #a0a0a0;
}

.lm-DataGrid-scrollCorner {
  background-color: #f0f0f0;
}

.lm-DataGrid-scrollCorner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  background-color: #a0a0a0;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/datagrid.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,eAAe;EACf,gBAAgB;EAChB,yBAAyB;AAC3B;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,UAAU;EACV,WAAW;EACX,yBAAyB;AAC3B","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.lm-DataGrid {\n  min-width: 64px;\n  min-height: 64px;\n  border: 1px solid #a0a0a0;\n}\n\n.lm-DataGrid-scrollCorner {\n  background-color: #f0f0f0;\n}\n\n.lm-DataGrid-scrollCorner::after {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 1px;\n  height: 1px;\n  background-color: #a0a0a0;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 19792:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| DockPanel
|----------------------------------------------------------------------------*/

.lm-DockPanel-widget,
.lm-TabPanel-stackedPanel {
  background: var(--jp-layout-color0);
  border-left: var(--jp-border-width) solid var(--jp-border-color1);
  border-right: var(--jp-border-width) solid var(--jp-border-color1);
  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
}

.lm-DockPanel-overlay {
  background: rgba(33, 150, 243, 0.1);
  border: var(--jp-border-width) dashed var(--jp-brand-color1);
  transition-property: top, left, right, bottom;
  transition-duration: 150ms;
  transition-timing-function: ease;
}

.lm-DockPanel-overlay.lm-mod-root-top,
.lm-DockPanel-overlay.lm-mod-root-left,
.lm-DockPanel-overlay.lm-mod-root-right,
.lm-DockPanel-overlay.lm-mod-root-bottom,
.lm-DockPanel-overlay.lm-mod-root-center {
  border-width: 2px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/dockpanel.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;;8EAE8E;;AAE9E;;EAEE,mCAAmC;EACnC,iEAAiE;EACjE,kEAAkE;EAClE,mEAAmE;AACrE;;AAEA;EACE,mCAAmC;EACnC,4DAA4D;EAC5D,6CAA6C;EAC7C,0BAA0B;EAC1B,gCAAgC;AAClC;;AAEA;;;;;EAKE,iBAAiB;AACnB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| DockPanel\n|----------------------------------------------------------------------------*/\n\n.lm-DockPanel-widget,\n.lm-TabPanel-stackedPanel {\n  background: var(--jp-layout-color0);\n  border-left: var(--jp-border-width) solid var(--jp-border-color1);\n  border-right: var(--jp-border-width) solid var(--jp-border-color1);\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.lm-DockPanel-overlay {\n  background: rgba(33, 150, 243, 0.1);\n  border: var(--jp-border-width) dashed var(--jp-brand-color1);\n  transition-property: top, left, right, bottom;\n  transition-duration: 150ms;\n  transition-timing-function: ease;\n}\n\n.lm-DockPanel-overlay.lm-mod-root-top,\n.lm-DockPanel-overlay.lm-mod-root-left,\n.lm-DockPanel-overlay.lm-mod-root-right,\n.lm-DockPanel-overlay.lm-mod-root-bottom,\n.lm-DockPanel-overlay.lm-mod-root-center {\n  border-width: 2px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 15760:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --jp-private-menubar-height: 28px;
  --jp-private-menu-item-height: 24px;
}

/*-----------------------------------------------------------------------------
| MenuBar
|----------------------------------------------------------------------------*/

.lm-MenuBar {
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  overflow: hidden;
}

.lm-MenuBar:hover {
  overflow-x: auto;
}

.lm-MenuBar-menu.jp-ThemedContainer {
  top: calc(-2 * var(--jp-border-width));
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow: auto;
  background:
    linear-gradient(var(--jp-layout-color0) 30%, rgba(0, 0, 0, 0)) center top,
    linear-gradient(rgba(0, 0, 0, 0), var(--jp-layout-color0) 70%) center bottom,
    radial-gradient(
        farthest-side at 50% 0,
        color-mix(
          in hsl,
          var(--jp-layout-color0) 50%,
          var(--jp-inverse-layout-color0) 30%
        ),
        rgba(0, 0, 0, 0)
      )
      center top,
    radial-gradient(
        farthest-side at 50% 100%,
        color-mix(
          in hsl,
          var(--jp-layout-color0) 50%,
          var(--jp-inverse-layout-color0) 30%
        ),
        rgba(0, 0, 0, 0)
      )
      center bottom;
  background-color: var(--jp-layout-color0);
  background-repeat: no-repeat;
  background-size:
    100% 40px,
    100% 40px,
    100% 14px,
    100% 14px;
  background-attachment: local, local, scroll, scroll;
}

.lm-MenuBar-menu.jp-ThemedContainer::-webkit-scrollbar {
  display: none;
}

.lm-MenuBar-item {
  padding: 0 8px;
  border-left: var(--jp-border-width) solid transparent;
  border-right: var(--jp-border-width) solid transparent;
  border-top: var(--jp-border-width) solid transparent;
  line-height: calc(
    var(--jp-private-menubar-height) - var(--jp-border-width) * 2
  );
}

.lm-MenuBar-content:focus-visible {
  outline-offset: -3px; /* this value is a compromise between Firefox, Chrome,
    and Safari over this outline's visibility and discretion */
}

.lm-MenuBar:focus-visible {
  outline: 1px solid var(--jp-accept-color-active, var(--jp-brand-color1));
  outline-offset: -1px;
}

.lm-MenuBar-menu:focus-visible,
.lm-MenuBar-item:focus-visible,
.lm-Menu-item:focus-visible {
  outline: unset;
  outline-offset: unset;
  -moz-outline-radius: unset;
}

.lm-MenuBar-item.lm-mod-active {
  background: var(--jp-layout-color2);
}

.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active {
  z-index: 10001;
  background: var(--jp-layout-color0);
  color: var(--jp-ui-font-color0);
  border-left: var(--jp-border-width) solid var(--jp-border-color1);
  border-right: var(--jp-border-width) solid var(--jp-border-color1);
  box-shadow: var(--jp-elevation-z6);
}

/* stylelint-disable-next-line selector-max-class */
.jp-LabShell[data-shell-mode='single-document']
  .lm-MenuBar.lm-mod-active
  .lm-MenuBar-item.lm-mod-active {
  border-top: var(--jp-border-width) solid var(--jp-border-color1);
}

.lm-MenuBar-item.lm-mod-disabled {
  color: var(--jp-ui-font-color3);
}

.lm-MenuBar-item.lm-type-separator {
  margin: 2px;
  padding: 0;
  border: none;
  border-left: var(--jp-border-width) solid var(--jp-border-color2);
}

.lm-MenuBar-itemMnemonic {
  text-decoration: underline;
}

/*-----------------------------------------------------------------------------
| Menu
|----------------------------------------------------------------------------*/

.lm-Menu {
  z-index: 10000;
  padding: 4px 0;
  background: var(--jp-layout-color0);
  color: var(--jp-ui-font-color0);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  font-size: var(--jp-ui-font-size1);
  box-shadow: var(--jp-elevation-z6);
}

.lm-Menu-item {
  min-height: var(--jp-private-menu-item-height);
  max-height: var(--jp-private-menu-item-height);
  padding: 0;
  line-height: var(--jp-private-menu-item-height);
}

.lm-Menu-item.lm-mod-active {
  background: var(--jp-layout-color2);
}

.lm-Menu-item.lm-mod-disabled {
  color: var(--jp-ui-font-color3);
}

.lm-Menu-itemIcon {
  width: 21px;
  padding: 0 2px 0 4px;
  margin-top: -2px;
}

.lm-Menu-itemLabel {
  padding: 0 32px 0 2px;
}

.lm-Menu-itemMnemonic {
  text-decoration: underline;
}

.lm-Menu-itemShortcut {
  padding: 0;
}

.lm-Menu-itemSubmenuIcon {
  width: 18px;
  padding: 0 4px 0 0;
}

.lm-Menu-item[data-type='separator'] > div {
  padding: 0;
  height: 9px;
}

.lm-Menu-item[data-type='separator'] > div::after {
  content: '';
  display: block;
  position: relative;
  top: 4px;
  border-top: var(--jp-border-width) solid var(--jp-layout-color2);
  mix-blend-mode: multiply;
}

/* gray out icon/caret for disabled menu items */
.lm-Menu-item.lm-mod-disabled > .lm-Menu-itemIcon,
.lm-Menu-item[data-type='submenu'].lm-mod-disabled > .lm-Menu-itemSubmenuIcon {
  opacity: 0.4;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/menus.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,iCAAiC;EACjC,mCAAmC;AACrC;;AAEA;;8EAE8E;;AAE9E;EACE,mCAAmC;EACnC,+BAA+B;EAC/B,kCAAkC;EAClC,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,sCAAsC;EACtC,qBAAqB;EACrB,wBAAwB;EACxB,cAAc;EACd;;;;;;;;;;;;;;;;;;;;;;mBAsBiB;EACjB,yCAAyC;EACzC,4BAA4B;EAC5B;;;;aAIW;EACX,mDAAmD;AACrD;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,cAAc;EACd,qDAAqD;EACrD,sDAAsD;EACtD,oDAAoD;EACpD;;GAEC;AACH;;AAEA;EACE,oBAAoB,EAAE;8DACsC;AAC9D;;AAEA;EACE,wEAAwE;EACxE,oBAAoB;AACtB;;AAEA;;;EAGE,cAAc;EACd,qBAAqB;EACrB,0BAA0B;AAC5B;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,cAAc;EACd,mCAAmC;EACnC,+BAA+B;EAC/B,iEAAiE;EACjE,kEAAkE;EAClE,kCAAkC;AACpC;;AAEA,mDAAmD;AACnD;;;EAGE,gEAAgE;AAClE;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,WAAW;EACX,UAAU;EACV,YAAY;EACZ,iEAAiE;AACnE;;AAEA;EACE,0BAA0B;AAC5B;;AAEA;;8EAE8E;;AAE9E;EACE,cAAc;EACd,cAAc;EACd,mCAAmC;EACnC,+BAA+B;EAC/B,4DAA4D;EAC5D,kCAAkC;EAClC,kCAAkC;AACpC;;AAEA;EACE,8CAA8C;EAC9C,8CAA8C;EAC9C,UAAU;EACV,+CAA+C;AACjD;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,WAAW;EACX,oBAAoB;EACpB,gBAAgB;AAClB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,0BAA0B;AAC5B;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,UAAU;EACV,WAAW;AACb;;AAEA;EACE,WAAW;EACX,cAAc;EACd,kBAAkB;EAClB,QAAQ;EACR,gEAAgE;EAChE,wBAAwB;AAC1B;;AAEA,gDAAgD;AAChD;;EAEE,YAAY;AACd","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-menubar-height: 28px;\n  --jp-private-menu-item-height: 24px;\n}\n\n/*-----------------------------------------------------------------------------\n| MenuBar\n|----------------------------------------------------------------------------*/\n\n.lm-MenuBar {\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  overflow: hidden;\n}\n\n.lm-MenuBar:hover {\n  overflow-x: auto;\n}\n\n.lm-MenuBar-menu.jp-ThemedContainer {\n  top: calc(-2 * var(--jp-border-width));\n  scrollbar-width: none;\n  -ms-overflow-style: none;\n  overflow: auto;\n  background:\n    linear-gradient(var(--jp-layout-color0) 30%, rgba(0, 0, 0, 0)) center top,\n    linear-gradient(rgba(0, 0, 0, 0), var(--jp-layout-color0) 70%) center bottom,\n    radial-gradient(\n        farthest-side at 50% 0,\n        color-mix(\n          in hsl,\n          var(--jp-layout-color0) 50%,\n          var(--jp-inverse-layout-color0) 30%\n        ),\n        rgba(0, 0, 0, 0)\n      )\n      center top,\n    radial-gradient(\n        farthest-side at 50% 100%,\n        color-mix(\n          in hsl,\n          var(--jp-layout-color0) 50%,\n          var(--jp-inverse-layout-color0) 30%\n        ),\n        rgba(0, 0, 0, 0)\n      )\n      center bottom;\n  background-color: var(--jp-layout-color0);\n  background-repeat: no-repeat;\n  background-size:\n    100% 40px,\n    100% 40px,\n    100% 14px,\n    100% 14px;\n  background-attachment: local, local, scroll, scroll;\n}\n\n.lm-MenuBar-menu.jp-ThemedContainer::-webkit-scrollbar {\n  display: none;\n}\n\n.lm-MenuBar-item {\n  padding: 0 8px;\n  border-left: var(--jp-border-width) solid transparent;\n  border-right: var(--jp-border-width) solid transparent;\n  border-top: var(--jp-border-width) solid transparent;\n  line-height: calc(\n    var(--jp-private-menubar-height) - var(--jp-border-width) * 2\n  );\n}\n\n.lm-MenuBar-content:focus-visible {\n  outline-offset: -3px; /* this value is a compromise between Firefox, Chrome,\n    and Safari over this outline's visibility and discretion */\n}\n\n.lm-MenuBar:focus-visible {\n  outline: 1px solid var(--jp-accept-color-active, var(--jp-brand-color1));\n  outline-offset: -1px;\n}\n\n.lm-MenuBar-menu:focus-visible,\n.lm-MenuBar-item:focus-visible,\n.lm-Menu-item:focus-visible {\n  outline: unset;\n  outline-offset: unset;\n  -moz-outline-radius: unset;\n}\n\n.lm-MenuBar-item.lm-mod-active {\n  background: var(--jp-layout-color2);\n}\n\n.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active {\n  z-index: 10001;\n  background: var(--jp-layout-color0);\n  color: var(--jp-ui-font-color0);\n  border-left: var(--jp-border-width) solid var(--jp-border-color1);\n  border-right: var(--jp-border-width) solid var(--jp-border-color1);\n  box-shadow: var(--jp-elevation-z6);\n}\n\n/* stylelint-disable-next-line selector-max-class */\n.jp-LabShell[data-shell-mode='single-document']\n  .lm-MenuBar.lm-mod-active\n  .lm-MenuBar-item.lm-mod-active {\n  border-top: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.lm-MenuBar-item.lm-mod-disabled {\n  color: var(--jp-ui-font-color3);\n}\n\n.lm-MenuBar-item.lm-type-separator {\n  margin: 2px;\n  padding: 0;\n  border: none;\n  border-left: var(--jp-border-width) solid var(--jp-border-color2);\n}\n\n.lm-MenuBar-itemMnemonic {\n  text-decoration: underline;\n}\n\n/*-----------------------------------------------------------------------------\n| Menu\n|----------------------------------------------------------------------------*/\n\n.lm-Menu {\n  z-index: 10000;\n  padding: 4px 0;\n  background: var(--jp-layout-color0);\n  color: var(--jp-ui-font-color0);\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  font-size: var(--jp-ui-font-size1);\n  box-shadow: var(--jp-elevation-z6);\n}\n\n.lm-Menu-item {\n  min-height: var(--jp-private-menu-item-height);\n  max-height: var(--jp-private-menu-item-height);\n  padding: 0;\n  line-height: var(--jp-private-menu-item-height);\n}\n\n.lm-Menu-item.lm-mod-active {\n  background: var(--jp-layout-color2);\n}\n\n.lm-Menu-item.lm-mod-disabled {\n  color: var(--jp-ui-font-color3);\n}\n\n.lm-Menu-itemIcon {\n  width: 21px;\n  padding: 0 2px 0 4px;\n  margin-top: -2px;\n}\n\n.lm-Menu-itemLabel {\n  padding: 0 32px 0 2px;\n}\n\n.lm-Menu-itemMnemonic {\n  text-decoration: underline;\n}\n\n.lm-Menu-itemShortcut {\n  padding: 0;\n}\n\n.lm-Menu-itemSubmenuIcon {\n  width: 18px;\n  padding: 0 4px 0 0;\n}\n\n.lm-Menu-item[data-type='separator'] > div {\n  padding: 0;\n  height: 9px;\n}\n\n.lm-Menu-item[data-type='separator'] > div::after {\n  content: '';\n  display: block;\n  position: relative;\n  top: 4px;\n  border-top: var(--jp-border-width) solid var(--jp-layout-color2);\n  mix-blend-mode: multiply;\n}\n\n/* gray out icon/caret for disabled menu items */\n.lm-Menu-item.lm-mod-disabled > .lm-Menu-itemIcon,\n.lm-Menu-item[data-type='submenu'].lm-mod-disabled > .lm-Menu-itemSubmenuIcon {\n  opacity: 0.4;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 2452:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*
 * Mozilla scrollbar styling
 */

/* use standard opaque scrollbars for most nodes */
[data-jp-theme-scrollbars='true'] {
  scrollbar-color: rgb(var(--jp-scrollbar-thumb-color))
    var(--jp-scrollbar-background-color);
}

/* for code nodes, use a transparent style of scrollbar. These selectors
 * will match lower in the tree, and so will override the above */
[data-jp-theme-scrollbars='true'] .CodeMirror-hscrollbar,
[data-jp-theme-scrollbars='true'] .CodeMirror-vscrollbar {
  scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;
}

/* tiny scrollbar */

.jp-scrollbar-tiny {
  scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;
  scrollbar-width: thin;
}

/* tiny scrollbar */

.jp-scrollbar-tiny::-webkit-scrollbar,
.jp-scrollbar-tiny::-webkit-scrollbar-corner {
  background-color: transparent;
  height: 4px;
  width: 4px;
}

.jp-scrollbar-tiny::-webkit-scrollbar-thumb {
  background: rgba(var(--jp-scrollbar-thumb-color), 0.5);
}

.jp-scrollbar-tiny::-webkit-scrollbar-track:horizontal {
  border-left: 0 solid transparent;
  border-right: 0 solid transparent;
}

.jp-scrollbar-tiny::-webkit-scrollbar-track:vertical {
  border-top: 0 solid transparent;
  border-bottom: 0 solid transparent;
}

/*
 * Lumino
 */

.lm-ScrollBar[data-orientation='horizontal'] {
  min-height: 16px;
  max-height: 16px;
  min-width: 45px;
  border-top: 1px solid #a0a0a0;
}

.lm-ScrollBar[data-orientation='vertical'] {
  min-width: 16px;
  max-width: 16px;
  min-height: 45px;
  border-left: 1px solid #a0a0a0;
}

.lm-ScrollBar-button {
  background-color: #f0f0f0;
  background-position: center center;
  min-height: 15px;
  max-height: 15px;
  min-width: 15px;
  max-width: 15px;
}

.lm-ScrollBar-button:hover {
  background-color: #dadada;
}

.lm-ScrollBar-button.lm-mod-active {
  background-color: #cdcdcd;
}

.lm-ScrollBar-track {
  background: #f0f0f0;
}

.lm-ScrollBar-thumb {
  background: #cdcdcd;
}

.lm-ScrollBar-thumb:hover {
  background: #bababa;
}

.lm-ScrollBar-thumb.lm-mod-active {
  background: #a0a0a0;
}

.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-thumb {
  height: 100%;
  min-width: 15px;
  border-left: 1px solid #a0a0a0;
  border-right: 1px solid #a0a0a0;
}

.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-thumb {
  width: 100%;
  min-height: 15px;
  border-top: 1px solid #a0a0a0;
  border-bottom: 1px solid #a0a0a0;
}

.lm-ScrollBar[data-orientation='horizontal']
  .lm-ScrollBar-button[data-action='decrement'] {
  background-image: var(--jp-icon-caret-left);
  background-size: 17px;
}

.lm-ScrollBar[data-orientation='horizontal']
  .lm-ScrollBar-button[data-action='increment'] {
  background-image: var(--jp-icon-caret-right);
  background-size: 17px;
}

.lm-ScrollBar[data-orientation='vertical']
  .lm-ScrollBar-button[data-action='decrement'] {
  background-image: var(--jp-icon-caret-up);
  background-size: 17px;
}

.lm-ScrollBar[data-orientation='vertical']
  .lm-ScrollBar-button[data-action='increment'] {
  background-image: var(--jp-icon-caret-down);
  background-size: 17px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/scrollbar.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;EAEE;;AAEF,kDAAkD;AAClD;EACE;wCACsC;AACxC;;AAEA;iEACiE;AACjE;;EAEE,uEAAuE;AACzE;;AAEA,mBAAmB;;AAEnB;EACE,uEAAuE;EACvE,qBAAqB;AACvB;;AAEA,mBAAmB;;AAEnB;;EAEE,6BAA6B;EAC7B,WAAW;EACX,UAAU;AACZ;;AAEA;EACE,sDAAsD;AACxD;;AAEA;EACE,gCAAgC;EAChC,iCAAiC;AACnC;;AAEA;EACE,+BAA+B;EAC/B,kCAAkC;AACpC;;AAEA;;EAEE;;AAEF;EACE,gBAAgB;EAChB,gBAAgB;EAChB,eAAe;EACf,6BAA6B;AAC/B;;AAEA;EACE,eAAe;EACf,eAAe;EACf,gBAAgB;EAChB,8BAA8B;AAChC;;AAEA;EACE,yBAAyB;EACzB,kCAAkC;EAClC,gBAAgB;EAChB,gBAAgB;EAChB,eAAe;EACf,eAAe;AACjB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,YAAY;EACZ,eAAe;EACf,8BAA8B;EAC9B,+BAA+B;AACjC;;AAEA;EACE,WAAW;EACX,gBAAgB;EAChB,6BAA6B;EAC7B,gCAAgC;AAClC;;AAEA;;EAEE,2CAA2C;EAC3C,qBAAqB;AACvB;;AAEA;;EAEE,4CAA4C;EAC5C,qBAAqB;AACvB;;AAEA;;EAEE,yCAAyC;EACzC,qBAAqB;AACvB;;AAEA;;EAEE,2CAA2C;EAC3C,qBAAqB;AACvB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*\n * Mozilla scrollbar styling\n */\n\n/* use standard opaque scrollbars for most nodes */\n[data-jp-theme-scrollbars='true'] {\n  scrollbar-color: rgb(var(--jp-scrollbar-thumb-color))\n    var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar. These selectors\n * will match lower in the tree, and so will override the above */\n[data-jp-theme-scrollbars='true'] .CodeMirror-hscrollbar,\n[data-jp-theme-scrollbars='true'] .CodeMirror-vscrollbar {\n  scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;\n}\n\n/* tiny scrollbar */\n\n.jp-scrollbar-tiny {\n  scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;\n  scrollbar-width: thin;\n}\n\n/* tiny scrollbar */\n\n.jp-scrollbar-tiny::-webkit-scrollbar,\n.jp-scrollbar-tiny::-webkit-scrollbar-corner {\n  background-color: transparent;\n  height: 4px;\n  width: 4px;\n}\n\n.jp-scrollbar-tiny::-webkit-scrollbar-thumb {\n  background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n}\n\n.jp-scrollbar-tiny::-webkit-scrollbar-track:horizontal {\n  border-left: 0 solid transparent;\n  border-right: 0 solid transparent;\n}\n\n.jp-scrollbar-tiny::-webkit-scrollbar-track:vertical {\n  border-top: 0 solid transparent;\n  border-bottom: 0 solid transparent;\n}\n\n/*\n * Lumino\n */\n\n.lm-ScrollBar[data-orientation='horizontal'] {\n  min-height: 16px;\n  max-height: 16px;\n  min-width: 45px;\n  border-top: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='vertical'] {\n  min-width: 16px;\n  max-width: 16px;\n  min-height: 45px;\n  border-left: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar-button {\n  background-color: #f0f0f0;\n  background-position: center center;\n  min-height: 15px;\n  max-height: 15px;\n  min-width: 15px;\n  max-width: 15px;\n}\n\n.lm-ScrollBar-button:hover {\n  background-color: #dadada;\n}\n\n.lm-ScrollBar-button.lm-mod-active {\n  background-color: #cdcdcd;\n}\n\n.lm-ScrollBar-track {\n  background: #f0f0f0;\n}\n\n.lm-ScrollBar-thumb {\n  background: #cdcdcd;\n}\n\n.lm-ScrollBar-thumb:hover {\n  background: #bababa;\n}\n\n.lm-ScrollBar-thumb.lm-mod-active {\n  background: #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-thumb {\n  height: 100%;\n  min-width: 15px;\n  border-left: 1px solid #a0a0a0;\n  border-right: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-thumb {\n  width: 100%;\n  min-height: 15px;\n  border-top: 1px solid #a0a0a0;\n  border-bottom: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='horizontal']\n  .lm-ScrollBar-button[data-action='decrement'] {\n  background-image: var(--jp-icon-caret-left);\n  background-size: 17px;\n}\n\n.lm-ScrollBar[data-orientation='horizontal']\n  .lm-ScrollBar-button[data-action='increment'] {\n  background-image: var(--jp-icon-caret-right);\n  background-size: 17px;\n}\n\n.lm-ScrollBar[data-orientation='vertical']\n  .lm-ScrollBar-button[data-action='decrement'] {\n  background-image: var(--jp-icon-caret-up);\n  background-size: 17px;\n}\n\n.lm-ScrollBar[data-orientation='vertical']\n  .lm-ScrollBar-button[data-action='increment'] {\n  background-image: var(--jp-icon-caret-down);\n  background-size: 17px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 71728:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --jp-private-sidebar-tab-width: 32px;
}

/*-----------------------------------------------------------------------------
| SideBar
|----------------------------------------------------------------------------*/

.jp-SideBar {
  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
}

.jp-SideBar.lm-TabBar,
#jp-down-stack .lm-TabBar {
  color: var(--jp-ui-font-color2);
  background: var(--jp-layout-color2);
  font-size: var(--jp-ui-font-size1);
  overflow: visible;
}

.jp-SideBar.lm-TabBar {
  min-width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));
  max-width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));
  display: block;
}

.jp-SideBar .lm-TabBar-content {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  list-style-type: none;
  height: var(--jp-private-sidebar-tab-width);
}

.jp-SideBar .lm-TabBar-tab {
  padding: 16px 0;
  border: none;
  overflow: visible;
  flex-direction: column;
  position: relative;
}

.jp-SideBar .lm-TabBar-tab:focus-visible {
  /* --accent-fill-focus is computed by the jp toolkit to ensure accessibility */
  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));
  outline-offset: -3px;
}

.jp-SideBar .lm-TabBar-tab.lm-mod-current::after {
  /* Internal border override pseudo-element */
  position: absolute;
  content: '';
  bottom: 0;
  right: 0;
  top: 0;
  left: 0;
  border: var(--jp-border-width) solid var(--jp-layout-color1);
}

.jp-SideBar .lm-TabBar-tab:not(.lm-mod-current),
#jp-down-stack .lm-TabBar-tab:not(.lm-mod-current) {
  background: var(--jp-layout-color2);
}

.jp-SideBar .lm-TabBar-tabIcon.jp-SideBar-tabIcon {
  min-width: 20px;
  min-height: 20px;
  background-size: 20px;
  display: inline-block;
  vertical-align: middle;
  background-repeat: no-repeat;
  background-position: center;
}

.jp-SideBar .lm-TabBar-tabLabel {
  line-height: var(--jp-private-sidebar-tab-width);
}

.jp-SideBar .lm-TabBar-tab:hover:not(.lm-mod-current),
#jp-down-stack .lm-TabBar-tab:hover:not(.lm-mod-current) {
  background: var(--jp-layout-color1);
}

.jp-SideBar.lm-TabBar::after {
  /* Internal border pseudo-element */
  position: absolute;
  content: '';
  bottom: 0;
  right: 0;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Borders */

/* stylelint-disable selector-max-class */

.jp-SideBar.lm-TabBar .lm-TabBar-tab + .lm-TabBar-tab {
  border-top: var(--jp-border-width) solid var(--jp-layout-color2);
}

.jp-SideBar.lm-TabBar .lm-TabBar-tab.lm-mod-current + .lm-TabBar-tab {
  border-top: var(--jp-border-width) solid var(--jp-border-color0);
}

.jp-SideBar.lm-TabBar .lm-TabBar-tab + .lm-TabBar-tab.lm-mod-current {
  border-top: var(--jp-border-width) solid var(--jp-border-color0);
}

.jp-SideBar.lm-TabBar .lm-TabBar-tab.lm-mod-current:last-child {
  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);
}

.jp-SideBar.lm-TabBar .lm-TabBar-tabLabel {
  writing-mode: vertical-rl;
}

/* Left */

/* Borders */

.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-content {
  /* Internal border spacing */
  margin-right: var(--jp-border-width);
}

.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-tab.lm-mod-current::after {
  /* Internal border override */
  right: calc(-1 * var(--jp-border-width));
}

.jp-SideBar.lm-TabBar.jp-mod-left::after {
  /* Internal border */
  border-right: var(--jp-border-width) solid var(--jp-border-color0);
}

/* Transforms */

.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-tabLabel {
  transform: rotate(180deg);
}

/* Right */

/* Borders */

.jp-SideBar.lm-TabBar.jp-mod-right .lm-TabBar-content {
  /* Internal border spacing */
  margin-left: var(--jp-border-width);
}

.jp-SideBar.lm-TabBar.jp-mod-right .lm-TabBar-tab.lm-mod-current::after {
  /* Internal border override */
  left: calc(-1 * var(--jp-border-width));
}

.jp-SideBar.lm-TabBar.jp-mod-right::after {
  /* Internal border */
  border-left: var(--jp-border-width) solid var(--jp-border-color0);
}

/* Down */

/* Borders */

#jp-down-stack > .lm-TabBar {
  border-top: var(--jp-border-width) solid var(--jp-border-color0);
  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);
}

#jp-down-stack > .lm-TabBar .lm-TabBar-tab {
  border-left: none;
  border-right: none;
}

#jp-down-stack > .lm-TabBar .lm-TabBar-tab.lm-mod-current {
  border: var(--jp-border-width) solid var(--jp-border-color1);
  border-bottom: none;
  transform: translateY(var(--jp-border-width));
}

#jp-down-stack > .lm-TabBar .lm-TabBar-tab.lm-mod-current:first-child {
  border: none;
  border-right: var(--jp-border-width) solid var(--jp-border-color1);
}

/* stylelint-enable selector-max-class */

/* Stack panels */

#jp-left-stack > .lm-Widget,
#jp-right-stack > .lm-Widget {
  min-width: var(--jp-sidebar-min-width);
  background-color: var(--jp-layout-color1);
}

#jp-right-stack {
  border-left: var(--jp-border-width) solid var(--jp-border-color1);
}

#jp-left-stack {
  border-right: var(--jp-border-width) solid var(--jp-border-color1);
}

#jp-down-stack > .lm-TabPanel-stackedPanel {
  border: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/sidepanel.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,oCAAoC;AACtC;;AAEA;;8EAE8E;;AAE9E;EACE;iCAC+B;EAC/B,kCAAkC;AACpC;;AAEA;;EAEE,+BAA+B;EAC/B,mCAAmC;EACnC,kCAAkC;EAClC,iBAAiB;AACnB;;AAEA;EACE,6EAA6E;EAC7E,6EAA6E;EAC7E,cAAc;AAChB;;AAEA;EACE,SAAS;EACT,UAAU;EACV,aAAa;EACb,oBAAoB;EACpB,qBAAqB;EACrB,2CAA2C;AAC7C;;AAEA;EACE,eAAe;EACf,YAAY;EACZ,iBAAiB;EACjB,sBAAsB;EACtB,kBAAkB;AACpB;;AAEA;EACE,8EAA8E;EAC9E,mEAAmE;EACnE,oBAAoB;AACtB;;AAEA;EACE,4CAA4C;EAC5C,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,QAAQ;EACR,MAAM;EACN,OAAO;EACP,4DAA4D;AAC9D;;AAEA;;EAEE,mCAAmC;AACrC;;AAEA;EACE,eAAe;EACf,gBAAgB;EAChB,qBAAqB;EACrB,qBAAqB;EACrB,sBAAsB;EACtB,4BAA4B;EAC5B,2BAA2B;AAC7B;;AAEA;EACE,gDAAgD;AAClD;;AAEA;;EAEE,mCAAmC;AACrC;;AAEA;EACE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,QAAQ;EACR,MAAM;EACN,OAAO;EACP,oBAAoB;AACtB;;AAEA,YAAY;;AAEZ,yCAAyC;;AAEzC;EACE,gEAAgE;AAClE;;AAEA;EACE,gEAAgE;AAClE;;AAEA;EACE,gEAAgE;AAClE;;AAEA;EACE,mEAAmE;AACrE;;AAEA;EACE,yBAAyB;AAC3B;;AAEA,SAAS;;AAET,YAAY;;AAEZ;EACE,4BAA4B;EAC5B,oCAAoC;AACtC;;AAEA;EACE,6BAA6B;EAC7B,wCAAwC;AAC1C;;AAEA;EACE,oBAAoB;EACpB,kEAAkE;AACpE;;AAEA,eAAe;;AAEf;EACE,yBAAyB;AAC3B;;AAEA,UAAU;;AAEV,YAAY;;AAEZ;EACE,4BAA4B;EAC5B,mCAAmC;AACrC;;AAEA;EACE,6BAA6B;EAC7B,uCAAuC;AACzC;;AAEA;EACE,oBAAoB;EACpB,iEAAiE;AACnE;;AAEA,SAAS;;AAET,YAAY;;AAEZ;EACE,gEAAgE;EAChE,mEAAmE;AACrE;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,4DAA4D;EAC5D,mBAAmB;EACnB,6CAA6C;AAC/C;;AAEA;EACE,YAAY;EACZ,kEAAkE;AACpE;;AAEA,wCAAwC;;AAExC,iBAAiB;;AAEjB;;EAEE,sCAAsC;EACtC,yCAAyC;AAC3C;;AAEA;EACE,iEAAiE;AACnE;;AAEA;EACE,kEAAkE;AACpE;;AAEA;EACE,YAAY;AACd","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-sidebar-tab-width: 32px;\n}\n\n/*-----------------------------------------------------------------------------\n| SideBar\n|----------------------------------------------------------------------------*/\n\n.jp-SideBar {\n  /* This is needed so that all font sizing of children done in ems is\n   * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-SideBar.lm-TabBar,\n#jp-down-stack .lm-TabBar {\n  color: var(--jp-ui-font-color2);\n  background: var(--jp-layout-color2);\n  font-size: var(--jp-ui-font-size1);\n  overflow: visible;\n}\n\n.jp-SideBar.lm-TabBar {\n  min-width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));\n  max-width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));\n  display: block;\n}\n\n.jp-SideBar .lm-TabBar-content {\n  margin: 0;\n  padding: 0;\n  display: flex;\n  align-items: stretch;\n  list-style-type: none;\n  height: var(--jp-private-sidebar-tab-width);\n}\n\n.jp-SideBar .lm-TabBar-tab {\n  padding: 16px 0;\n  border: none;\n  overflow: visible;\n  flex-direction: column;\n  position: relative;\n}\n\n.jp-SideBar .lm-TabBar-tab:focus-visible {\n  /* --accent-fill-focus is computed by the jp toolkit to ensure accessibility */\n  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));\n  outline-offset: -3px;\n}\n\n.jp-SideBar .lm-TabBar-tab.lm-mod-current::after {\n  /* Internal border override pseudo-element */\n  position: absolute;\n  content: '';\n  bottom: 0;\n  right: 0;\n  top: 0;\n  left: 0;\n  border: var(--jp-border-width) solid var(--jp-layout-color1);\n}\n\n.jp-SideBar .lm-TabBar-tab:not(.lm-mod-current),\n#jp-down-stack .lm-TabBar-tab:not(.lm-mod-current) {\n  background: var(--jp-layout-color2);\n}\n\n.jp-SideBar .lm-TabBar-tabIcon.jp-SideBar-tabIcon {\n  min-width: 20px;\n  min-height: 20px;\n  background-size: 20px;\n  display: inline-block;\n  vertical-align: middle;\n  background-repeat: no-repeat;\n  background-position: center;\n}\n\n.jp-SideBar .lm-TabBar-tabLabel {\n  line-height: var(--jp-private-sidebar-tab-width);\n}\n\n.jp-SideBar .lm-TabBar-tab:hover:not(.lm-mod-current),\n#jp-down-stack .lm-TabBar-tab:hover:not(.lm-mod-current) {\n  background: var(--jp-layout-color1);\n}\n\n.jp-SideBar.lm-TabBar::after {\n  /* Internal border pseudo-element */\n  position: absolute;\n  content: '';\n  bottom: 0;\n  right: 0;\n  top: 0;\n  left: 0;\n  pointer-events: none;\n}\n\n/* Borders */\n\n/* stylelint-disable selector-max-class */\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab + .lm-TabBar-tab {\n  border-top: var(--jp-border-width) solid var(--jp-layout-color2);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab.lm-mod-current + .lm-TabBar-tab {\n  border-top: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab + .lm-TabBar-tab.lm-mod-current {\n  border-top: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab.lm-mod-current:last-child {\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tabLabel {\n  writing-mode: vertical-rl;\n}\n\n/* Left */\n\n/* Borders */\n\n.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-content {\n  /* Internal border spacing */\n  margin-right: var(--jp-border-width);\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-tab.lm-mod-current::after {\n  /* Internal border override */\n  right: calc(-1 * var(--jp-border-width));\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-left::after {\n  /* Internal border */\n  border-right: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n/* Transforms */\n\n.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-tabLabel {\n  transform: rotate(180deg);\n}\n\n/* Right */\n\n/* Borders */\n\n.jp-SideBar.lm-TabBar.jp-mod-right .lm-TabBar-content {\n  /* Internal border spacing */\n  margin-left: var(--jp-border-width);\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-right .lm-TabBar-tab.lm-mod-current::after {\n  /* Internal border override */\n  left: calc(-1 * var(--jp-border-width));\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-right::after {\n  /* Internal border */\n  border-left: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n/* Down */\n\n/* Borders */\n\n#jp-down-stack > .lm-TabBar {\n  border-top: var(--jp-border-width) solid var(--jp-border-color0);\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n#jp-down-stack > .lm-TabBar .lm-TabBar-tab {\n  border-left: none;\n  border-right: none;\n}\n\n#jp-down-stack > .lm-TabBar .lm-TabBar-tab.lm-mod-current {\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  border-bottom: none;\n  transform: translateY(var(--jp-border-width));\n}\n\n#jp-down-stack > .lm-TabBar .lm-TabBar-tab.lm-mod-current:first-child {\n  border: none;\n  border-right: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n/* stylelint-enable selector-max-class */\n\n/* Stack panels */\n\n#jp-left-stack > .lm-Widget,\n#jp-right-stack > .lm-Widget {\n  min-width: var(--jp-sidebar-min-width);\n  background-color: var(--jp-layout-color1);\n}\n\n#jp-right-stack {\n  border-left: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n#jp-left-stack {\n  border-right: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n#jp-down-stack > .lm-TabPanel-stackedPanel {\n  border: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 17285:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
|
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-skiplink-wrapper {
  overflow: visible;

  /* override strict containment added via Lumino PR
   [#506](https://github.com/jupyterlab/lumino/pull/506) */
  contain: size style !important;
}

.jp-skiplink {
  position: absolute;
  top: -100em;
}

.jp-skiplink:focus-within {
  position: absolute;
  z-index: 10000;
  top: 0;
  left: 46%;
  margin: 0 auto;
  padding: 1em;
  width: 15%;
  box-shadow: var(--jp-elevation-z4);
  border-radius: 4px;
  background: var(--jp-layout-color0);
  text-align: center;
}

.jp-skiplink:focus-within a {
  text-decoration: underline;
  color: var(--jp-content-link-color);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/skiplink.css"],"names":[],"mappings":"AAAA;;;;8EAI8E;;AAE9E;EACE,iBAAiB;;EAEjB;0DACwD;EACxD,8BAA8B;AAChC;;AAEA;EACE,kBAAkB;EAClB,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,cAAc;EACd,MAAM;EACN,SAAS;EACT,cAAc;EACd,YAAY;EACZ,UAAU;EACV,kCAAkC;EAClC,kBAAkB;EAClB,mCAAmC;EACnC,kBAAkB;AACpB;;AAEA;EACE,0BAA0B;EAC1B,mCAAmC;AACrC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n|\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-skiplink-wrapper {\n  overflow: visible;\n\n  /* override strict containment added via Lumino PR\n   [#506](https://github.com/jupyterlab/lumino/pull/506) */\n  contain: size style !important;\n}\n\n.jp-skiplink {\n  position: absolute;\n  top: -100em;\n}\n\n.jp-skiplink:focus-within {\n  position: absolute;\n  z-index: 10000;\n  top: 0;\n  left: 46%;\n  margin: 0 auto;\n  padding: 1em;\n  width: 15%;\n  box-shadow: var(--jp-elevation-z4);\n  border-radius: 4px;\n  background: var(--jp-layout-color0);\n  text-align: center;\n}\n\n.jp-skiplink:focus-within a {\n  text-decoration: underline;\n  color: var(--jp-content-link-color);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 21171:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  /* These need to be root because tabs get attached to the body during dragging. */
  --jp-private-horizontal-tab-height: 24px;
  --jp-private-horizontal-tab-width: 216px;
  --jp-private-horizontal-tab-active-top-border: 2px;
}

/*-----------------------------------------------------------------------------
| Tabs in the dock panel
|----------------------------------------------------------------------------*/

.lm-DockPanel-tabBar,
.lm-TabPanel-tabBar {
  overflow: visible;
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
}

.lm-DockPanel-tabBar[data-orientation='horizontal'],
.lm-TabPanel-tabBar[data-orientation='horizontal'] {
  min-height: calc(
    var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)
  );
}

.lm-DockPanel-tabBar[data-orientation='vertical'] {
  min-width: 80px;
}

.lm-DockPanel-tabBar > .lm-TabBar-content,
.lm-TabPanel-tabBar > .lm-TabBar-content {
  align-items: flex-end;
  min-width: 0;
  min-height: 0;
}

.lm-DockPanel-tabBar .lm-TabBar-tab,
.lm-TabPanel-tabBar .lm-TabBar-tab {
  flex: 0 1 var(--jp-private-horizontal-tab-width);
  align-items: center;
  min-height: calc(
    var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)
  );
  min-width: 0;
  margin-left: calc(-1 * var(--jp-border-width));
  line-height: var(--jp-private-horizontal-tab-height);
  padding: 0 8px;
  background: var(--jp-layout-color2);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  border-bottom: none;
  position: relative;
}

.lm-DockPanel-tabBar .lm-TabBar-tab:focus-visible,
.lm-DockPanel-tabBar .lm-TabBar-addButton:focus-visible,
.lm-TabPanel-tabBar .lm-TabBar-tab:focus-visible {
  border: 1px solid var(--accent-fill-focus);
  border-bottom: none;

  /* Thicken the border by 1px within the element border */
  box-shadow: 0 0 0 1px inset var(--accent-fill-focus);
  outline: none;
}

.lm-DockPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current):focus-visible::after,
.lm-TabPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current):focus-visible::after {
  border-bottom-color: var(--accent-fill-focus);
}

.lm-DockPanel-tabBar .lm-TabBar-tab:hover:not(.lm-mod-current),
.lm-TabPanel-tabBar .lm-TabBar-tab:hover:not(.lm-mod-current) {
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
}

.lm-DockPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current)::after,
.lm-DockPanel-tabBar .lm-TabBar-addButton::after {
  position: absolute;
  content: '';
  bottom: 0;
  left: calc(-1 * var(--jp-border-width));
  width: calc(100% + 2 * var(--jp-border-width));
  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
}

.lm-DockPanel-tabBar .lm-TabBar-tab:first-child,
.lm-TabPanel-tabBar .lm-TabBar-tab:first-child {
  margin-left: 0;
}

/* This is a current tab of a tab bar in the dock panel: each tab bar has 1. */
.lm-DockPanel-tabBar .lm-TabBar-tab.lm-mod-current {
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
}

.lm-TabPanel-tabBar .lm-TabBar-tab.lm-mod-current {
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
}

/* This is the main application level current tab: only 1 exists. */
.lm-DockPanel-tabBar .lm-TabBar-tab.jp-mod-current::before {
  position: absolute;
  top: calc(-1 * var(--jp-border-width) + 1px);
  left: calc(-1 * var(--jp-border-width));
  content: '';
  height: var(--jp-private-horizontal-tab-active-top-border);
  width: calc(100% + 2 * var(--jp-border-width));
  background: var(--jp-brand-color1);
}

/* This is the left tab bar current tab: only 1 exists. */
.lm-TabBar-tab.lm-mod-current {
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
}

.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab,
.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab {
  flex: 0 1 40px;
  margin-top: -1px;
  line-height: 40px;
}

.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab {
  border-right: none;
}

.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab {
  border-left: none;
}

.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab:first-child,
.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab:first-child {
  margin-top: 0;
}

/* stylelint-disable selector-max-class */

.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab.lm-mod-current,
.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab.lm-mod-current {
  min-width: 80px;
  max-width: 80px;
}

.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab.lm-mod-current {
  transform: translateX(-1px);
}

.lm-DockPanel-tabBar .lm-TabBar-tab .lm-TabBar-tabIcon,
.lm-TabBar-tab.lm-mod-drag-image .lm-TabBar-tabIcon,
.lm-TabPanel-tabBar .lm-TabBar-tab .lm-TabBar-tabIcon {
  width: 14px;
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 14px;
  margin-right: 4px;
}

/* stylelint-enable selector-max-class */

.lm-TabBar-tab.lm-mod-drag-image {
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  border-top: var(--jp-border-width) solid var(--jp-brand-color1);
  box-shadow: var(--jp-elevation-z4);
  font-size: var(--jp-ui-font-size1);
  line-height: var(--jp-private-horizontal-tab-height);
  min-height: var(--jp-private-horizontal-tab-height);
  min-width: var(--jp-private-horizontal-tab-width);
  padding: 0 10px;
  transform: translateX(-40%) translateY(-58%);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/tabs.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,iFAAiF;EACjF,wCAAwC;EACxC,wCAAwC;EACxC,kDAAkD;AACpD;;AAEA;;8EAE8E;;AAE9E;;EAEE,iBAAiB;EACjB,+BAA+B;EAC/B,kCAAkC;AACpC;;AAEA;;EAEE;;GAEC;AACH;;AAEA;EACE,eAAe;AACjB;;AAEA;;EAEE,qBAAqB;EACrB,YAAY;EACZ,aAAa;AACf;;AAEA;;EAEE,gDAAgD;EAChD,mBAAmB;EACnB;;GAEC;EACD,YAAY;EACZ,8CAA8C;EAC9C,oDAAoD;EACpD,cAAc;EACd,mCAAmC;EACnC,4DAA4D;EAC5D,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;;;EAGE,0CAA0C;EAC1C,mBAAmB;;EAEnB,wDAAwD;EACxD,oDAAoD;EACpD,aAAa;AACf;;AAEA;;EAEE,6CAA6C;AAC/C;;AAEA;;EAEE,mCAAmC;EACnC,+BAA+B;AACjC;;AAEA;;EAEE,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,uCAAuC;EACvC,8CAA8C;EAC9C,mEAAmE;AACrE;;AAEA;;EAEE,cAAc;AAChB;;AAEA,8EAA8E;AAC9E;EACE,mCAAmC;EACnC,+BAA+B;AACjC;;AAEA;EACE,mCAAmC;EACnC,+BAA+B;AACjC;;AAEA,mEAAmE;AACnE;EACE,kBAAkB;EAClB,4CAA4C;EAC5C,uCAAuC;EACvC,WAAW;EACX,0DAA0D;EAC1D,8CAA8C;EAC9C,kCAAkC;AACpC;;AAEA,yDAAyD;AACzD;EACE,mCAAmC;EACnC,+BAA+B;AACjC;;AAEA;;EAEE,cAAc;EACd,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;EAEE,aAAa;AACf;;AAEA,yCAAyC;;AAEzC;;EAEE,eAAe;EACf,eAAe;AACjB;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;;;EAGE,WAAW;EACX,gCAAgC;EAChC,4BAA4B;EAC5B,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA,wCAAwC;;AAExC;EACE,mCAAmC;EACnC,+BAA+B;EAC/B,4DAA4D;EAC5D,+DAA+D;EAC/D,kCAAkC;EAClC,kCAAkC;EAClC,oDAAoD;EACpD,mDAAmD;EACnD,iDAAiD;EACjD,eAAe;EACf,4CAA4C;AAC9C","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  /* These need to be root because tabs get attached to the body during dragging. */\n  --jp-private-horizontal-tab-height: 24px;\n  --jp-private-horizontal-tab-width: 216px;\n  --jp-private-horizontal-tab-active-top-border: 2px;\n}\n\n/*-----------------------------------------------------------------------------\n| Tabs in the dock panel\n|----------------------------------------------------------------------------*/\n\n.lm-DockPanel-tabBar,\n.lm-TabPanel-tabBar {\n  overflow: visible;\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n}\n\n.lm-DockPanel-tabBar[data-orientation='horizontal'],\n.lm-TabPanel-tabBar[data-orientation='horizontal'] {\n  min-height: calc(\n    var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)\n  );\n}\n\n.lm-DockPanel-tabBar[data-orientation='vertical'] {\n  min-width: 80px;\n}\n\n.lm-DockPanel-tabBar > .lm-TabBar-content,\n.lm-TabPanel-tabBar > .lm-TabBar-content {\n  align-items: flex-end;\n  min-width: 0;\n  min-height: 0;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab,\n.lm-TabPanel-tabBar .lm-TabBar-tab {\n  flex: 0 1 var(--jp-private-horizontal-tab-width);\n  align-items: center;\n  min-height: calc(\n    var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)\n  );\n  min-width: 0;\n  margin-left: calc(-1 * var(--jp-border-width));\n  line-height: var(--jp-private-horizontal-tab-height);\n  padding: 0 8px;\n  background: var(--jp-layout-color2);\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  border-bottom: none;\n  position: relative;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:focus-visible,\n.lm-DockPanel-tabBar .lm-TabBar-addButton:focus-visible,\n.lm-TabPanel-tabBar .lm-TabBar-tab:focus-visible {\n  border: 1px solid var(--accent-fill-focus);\n  border-bottom: none;\n\n  /* Thicken the border by 1px within the element border */\n  box-shadow: 0 0 0 1px inset var(--accent-fill-focus);\n  outline: none;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current):focus-visible::after,\n.lm-TabPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current):focus-visible::after {\n  border-bottom-color: var(--accent-fill-focus);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:hover:not(.lm-mod-current),\n.lm-TabPanel-tabBar .lm-TabBar-tab:hover:not(.lm-mod-current) {\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current)::after,\n.lm-DockPanel-tabBar .lm-TabBar-addButton::after {\n  position: absolute;\n  content: '';\n  bottom: 0;\n  left: calc(-1 * var(--jp-border-width));\n  width: calc(100% + 2 * var(--jp-border-width));\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:first-child,\n.lm-TabPanel-tabBar .lm-TabBar-tab:first-child {\n  margin-left: 0;\n}\n\n/* This is a current tab of a tab bar in the dock panel: each tab bar has 1. */\n.lm-DockPanel-tabBar .lm-TabBar-tab.lm-mod-current {\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n}\n\n.lm-TabPanel-tabBar .lm-TabBar-tab.lm-mod-current {\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n}\n\n/* This is the main application level current tab: only 1 exists. */\n.lm-DockPanel-tabBar .lm-TabBar-tab.jp-mod-current::before {\n  position: absolute;\n  top: calc(-1 * var(--jp-border-width) + 1px);\n  left: calc(-1 * var(--jp-border-width));\n  content: '';\n  height: var(--jp-private-horizontal-tab-active-top-border);\n  width: calc(100% + 2 * var(--jp-border-width));\n  background: var(--jp-brand-color1);\n}\n\n/* This is the left tab bar current tab: only 1 exists. */\n.lm-TabBar-tab.lm-mod-current {\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab,\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab {\n  flex: 0 1 40px;\n  margin-top: -1px;\n  line-height: 40px;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab {\n  border-right: none;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab {\n  border-left: none;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab:first-child,\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab:first-child {\n  margin-top: 0;\n}\n\n/* stylelint-disable selector-max-class */\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab.lm-mod-current,\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab.lm-mod-current {\n  min-width: 80px;\n  max-width: 80px;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab.lm-mod-current {\n  transform: translateX(-1px);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab .lm-TabBar-tabIcon,\n.lm-TabBar-tab.lm-mod-drag-image .lm-TabBar-tabIcon,\n.lm-TabPanel-tabBar .lm-TabBar-tab .lm-TabBar-tabIcon {\n  width: 14px;\n  background-position: left center;\n  background-repeat: no-repeat;\n  background-size: 14px;\n  margin-right: 4px;\n}\n\n/* stylelint-enable selector-max-class */\n\n.lm-TabBar-tab.lm-mod-drag-image {\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  border-top: var(--jp-border-width) solid var(--jp-brand-color1);\n  box-shadow: var(--jp-elevation-z4);\n  font-size: var(--jp-ui-font-size1);\n  line-height: var(--jp-private-horizontal-tab-height);\n  min-height: var(--jp-private-horizontal-tab-height);\n  min-width: var(--jp-private-horizontal-tab-width);\n  padding: 0 10px;\n  transform: translateX(-40%) translateY(-58%);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 61059:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

:root {
  --jp-private-title-panel-height: 28px;
}

#jp-title-panel {
  min-height: var(--jp-private-title-panel-height);
  width: 100%;
  display: flex;
  background: var(--jp-layout-color1);
}

#jp-title-panel-title {
  flex: 1 1 auto;
  margin-left: 8px;
}

#jp-title-panel-title input {
  background: transparent;
  margin: 0;
  height: 28px;
  width: 100%;
  box-sizing: border-box;
  border: none;
  font-size: 18px;
  font-weight: normal;
  font-family: var(--jp-ui-font-family);
  line-height: var(--jp-private-title-panel-height);
  color: var(--jp-ui-font-color0);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/application/style/titlepanel.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,qCAAqC;AACvC;;AAEA;EACE,gDAAgD;EAChD,WAAW;EACX,aAAa;EACb,mCAAmC;AACrC;;AAEA;EACE,cAAc;EACd,gBAAgB;AAClB;;AAEA;EACE,uBAAuB;EACvB,SAAS;EACT,YAAY;EACZ,WAAW;EACX,sBAAsB;EACtB,YAAY;EACZ,eAAe;EACf,mBAAmB;EACnB,qCAAqC;EACrC,iDAAiD;EACjD,+BAA+B;EAC/B,aAAa;EACb,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;AACvB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-title-panel-height: 28px;\n}\n\n#jp-title-panel {\n  min-height: var(--jp-private-title-panel-height);\n  width: 100%;\n  display: flex;\n  background: var(--jp-layout-color1);\n}\n\n#jp-title-panel-title {\n  flex: 1 1 auto;\n  margin-left: 8px;\n}\n\n#jp-title-panel-title input {\n  background: transparent;\n  margin: 0;\n  height: 28px;\n  width: 100%;\n  box-sizing: border-box;\n  border: none;\n  font-size: 18px;\n  font-weight: normal;\n  font-family: var(--jp-ui-font-family);\n  line-height: var(--jp-private-title-panel-height);\n  color: var(--jp-ui-font-color0);\n  outline: none;\n  appearance: none;\n  -webkit-appearance: none;\n  -moz-appearance: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 92606:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_notification_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64758);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_splash_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92027);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_contextualhelp_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59177);
// Imports





var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_notification_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_splash_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_contextualhelp_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n@import './notification.css';\n@import './splash.css';\n@import './contextualhelp.css';\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 59177:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

:root {
  --jp-private-shortcuts-key-padding-horizontal: 0.47em;
  --jp-private-shortcuts-key-padding-vertical: 0.28em;
  --jp-private-shortcuts-label-padding-horizontal: 0.47em;
}

.jp-ContextualShortcut-TableRow {
  font-size: var(--jp-ui-font-size1);
  font-family: var(--jp-ui-font-family);
}

.jp-ContextualShortcut-TableItem {
  margin-left: auto;
  margin-right: auto;
  color: var(--jp-inverse-layout-color0);
  font-size: var(--jp-ui-font-size1);
  line-height: 2em;
  padding-right: var(--jp-private-shortcuts-label-padding-horizontal);
}

.jp-ContextualShortcut-TableLastRow {
  height: 2em;
}

.jp-ContextualShortcut-Key {
  font-family: var(--jp-code-font-family);
  border-width: var(--jp-border-width);
  border-radius: var(--jp-border-radius);
  border-style: solid;
  border-color: var(--jp-border-color1);
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);
  padding-left: var(--jp-private-shortcuts-key-padding-horizontal);
  padding-right: var(--jp-private-shortcuts-key-padding-horizontal);
  padding-top: var(--jp-private-shortcuts-key-padding-vertical);
  padding-bottom: var(--jp-private-shortcuts-key-padding-vertical);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils-extension/style/contextualhelp.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,qDAAqD;EACrD,mDAAmD;EACnD,uDAAuD;AACzD;;AAEA;EACE,kCAAkC;EAClC,qCAAqC;AACvC;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,sCAAsC;EACtC,kCAAkC;EAClC,gBAAgB;EAChB,mEAAmE;AACrE;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,uCAAuC;EACvC,oCAAoC;EACpC,sCAAsC;EACtC,mBAAmB;EACnB,qCAAqC;EACrC,+BAA+B;EAC/B,mCAAmC;EACnC,gEAAgE;EAChE,iEAAiE;EACjE,6DAA6D;EAC7D,gEAAgE;AAClE","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n:root {\n  --jp-private-shortcuts-key-padding-horizontal: 0.47em;\n  --jp-private-shortcuts-key-padding-vertical: 0.28em;\n  --jp-private-shortcuts-label-padding-horizontal: 0.47em;\n}\n\n.jp-ContextualShortcut-TableRow {\n  font-size: var(--jp-ui-font-size1);\n  font-family: var(--jp-ui-font-family);\n}\n\n.jp-ContextualShortcut-TableItem {\n  margin-left: auto;\n  margin-right: auto;\n  color: var(--jp-inverse-layout-color0);\n  font-size: var(--jp-ui-font-size1);\n  line-height: 2em;\n  padding-right: var(--jp-private-shortcuts-label-padding-horizontal);\n}\n\n.jp-ContextualShortcut-TableLastRow {\n  height: 2em;\n}\n\n.jp-ContextualShortcut-Key {\n  font-family: var(--jp-code-font-family);\n  border-width: var(--jp-border-width);\n  border-radius: var(--jp-border-radius);\n  border-style: solid;\n  border-color: var(--jp-border-color1);\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n  padding-left: var(--jp-private-shortcuts-key-padding-horizontal);\n  padding-right: var(--jp-private-shortcuts-key-padding-horizontal);\n  padding-top: var(--jp-private-shortcuts-key-padding-vertical);\n  padding-bottom: var(--jp-private-shortcuts-key-padding-vertical);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 64758:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_react_toastify_dist_ReactToastify_min_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96715);
// Imports



var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_react_toastify_dist_ReactToastify_min_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

:root {
  --toastify-color-light: var(--jp-layout-color1);
  --toastify-color-dark: var(--jp-layout-color1);
  --toastify-color-info: var(--jp-info-color1);
  --toastify-color-success: var(--jp-success-color1);
  --toastify-color-warning: var(--jp-warn-color1);
  --toastify-color-error: var(--jp-error-color1);
  --toastify-color-transparent: rgba(255, 255, 255, 0.7);
  --toastify-icon-color-info: var(--toastify-color-info);
  --toastify-icon-color-success: var(--toastify-color-success);
  --toastify-icon-color-warning: var(--toastify-color-warning);
  --toastify-icon-color-error: var(--toastify-color-error);
  --toastify-toast-width: 25em;
  --toastify-toast-background: var(--jp-layout-color1);
  --toastify-toast-min-height: 64px;
  --toastify-toast-max-height: 800px;
  --toastify-font-family: var(--jp-ui-font-family);
  --toastify-z-index: 9999;
  --toastify-text-color-light: var(--jp-ui-font-color1);
  --toastify-text-color-dark: var(--jp-ui-font-color1);
  --toastify-text-color-info: var(--jp-ui-font-color1);
  --toastify-text-color-success: var(--jp-ui-font-color1);
  --toastify-text-color-warning: var(--jp-ui-font-color1);
  --toastify-text-color-error: var(--jp-ui-font-color1);
  --toastify-spinner-color: #616161;
  --toastify-spinner-color-empty-area: #e0e0e0;
  --toastify-color-progress-light: linear-gradient(
    to right,
    #4cd964,
    #5ac8fa,
    #007aff,
    #34aadc,
    #5856d6,
    #ff2d55
  );
  --toastify-color-progress-dark: #bb86fc;
  --toastify-color-progress-info: var(--toastify-color-info);
  --toastify-color-progress-success: var(--toastify-color-success);
  --toastify-color-progress-warning: var(--toastify-color-warning);
  --toastify-color-progress-error: var(--toastify-color-error);
}

.jp-Notification-List {
  list-style: none;
  margin: 0;
  padding: 4px;
  width: var(--toastify-toast-width);
  overflow-y: auto;
  max-height: 55vh;
  box-sizing: border-box;
  background-color: var(--jp-layout-color2);
}

.jp-Notification-Header {
  display: flex;
  font-size: var(--jp-ui-font-size1);
  padding-left: 8px;
  padding-right: 4px;
  margin: 0;
  align-items: center;
  user-select: none;
}

.jp-Notification-List-Item {
  padding: 2px 0;
}

.jp-Notification-List .Toastify__toast {
  margin: 0;
}

.jp-Notification-Status.jp-mod-selected {
  background-color: var(--jp-brand-color1);
}

.jp-Notification-Status.jp-mod-selected .jp-Notification-Status-Text {
  color: var(--jp-ui-inverse-font-color1);
}

.Toastify__toast {
  min-height: unset;
  padding: 4px;
  font-size: var(--jp-ui-font-size1);
  border-width: var(--jp-border-width);
  border-radius: var(--jp-border-radius);
  border-color: var(--jp-border-color1);
  box-shadow: var(--jp-elevation-z4);
  cursor: default;
}

.Toastify__toast-body {
  display: flex;
  flex-grow: 1;
}

.jp-Notification-Toast-Close {
  padding: 0;
  position: absolute;
  right: 0.1px;
  cursor: pointer;
}

.jp-Notification-Toast-Close-Margin {
  margin-right: 4px;
}

.jp-toastContainer .jp-Notification-Toast-Close:hover {
  /* The close button has its own hover style */
  background: none;
}

.Toastify__toast.jp-Notification-Toast-error {
  border-top: 5px solid var(--jp-error-color1);
}

.Toastify__toast.jp-Notification-Toast-warning {
  border-top: 5px solid var(--jp-warn-color1);
}

.Toastify__toast.jp-Notification-Toast-info {
  border-top: 5px solid var(--jp-info-color1);
}

.Toastify__toast.jp-Notification-Toast-success {
  border-top: 5px solid var(--jp-success-color1);
}

.Toastify__toast.jp-Notification-Toast-in-progress {
  border-top: 5px solid var(--jp-layout-color1);
}

.Toastify__toast-body a {
  color: var(--jp-content-link-color);
}

.Toastify__toast-body a:hover {
  color: var(--jp-content-link-color);
  text-decoration: underline;
}

.jp-toast-message {
  padding-inline-end: 16px;
}

/* p elements are added by the markdown rendering.
 * Removing its default margin allows to reduce toast size.
 */
.Toastify__toast-body p:first-child,
.Toastify__toast-body h1:first-child,
.Toastify__toast-body h2:first-child,
.Toastify__toast-body h3:first-child,
.Toastify__toast-body h4:first-child,
.Toastify__toast-body h5:first-child,
.Toastify__toast-body h6:first-child,
.Toastify__toast-body ol:first-child,
.Toastify__toast-body ul:first-child {
  margin-top: 0;
}

.Toastify__toast-body p:last-child,
.Toastify__toast-body h1:last-child,
.Toastify__toast-body h2:last-child,
.Toastify__toast-body h3:last-child,
.Toastify__toast-body h4:last-child,
.Toastify__toast-body h5:last-child,
.Toastify__toast-body h6:last-child,
.Toastify__toast-body ol:last-child,
.Toastify__toast-body ul:last-child {
  margin-bottom: 0;
}

.jp-toast-buttonBar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  padding-block-start: 8px;
}

.jp-toast-spacer {
  flex-grow: 1;
  flex-shrink: 1;
}

.jp-toast-button {
  margin-top: 1px;
  margin-bottom: 1px;
  margin-right: 0;
  margin-left: 3px;
  color: var(--jp-ui-font-color1);
  background-color: var(--jp-layout-color2);
  border: none;
}

.jp-toast-button:focus {
  outline: 1px solid var(--jp-reject-color-normal, var(--jp-layout-color2));
  outline-offset: 1px;
  -moz-outline-radius: 0;
}

.jp-toast-button:focus-visible {
  border: none;
}

.jp-toast-button:hover {
  background-color: var(--jp-layout-color3);
}

.jp-toast-button.jp-mod-accept {
  background: var(--jp-accept-color-normal, var(--jp-brand-color1));
  color: var(--jp-ui-inverse-font-color1);
}

.jp-toast-button.jp-mod-accept:focus {
  outline-color: var(--jp-accept-color-normal, var(--jp-brand-color1));
}

.jp-toast-button.jp-mod-accept:hover {
  background: var(--jp-accept-color-hover, var(--jp-brand-color0));
}

.jp-toast-button.jp-mod-warn {
  background: var(--jp-warn-color-normal, var(--jp-warn-color1));
  color: var(--jp-ui-inverse-font-color1);
}

.jp-toast-button.jp-mod-warn:focus {
  outline-color: var(--jp-warn-color-normal, var(--jp-warn-color1));
}

.jp-toast-button.jp-mod-warn:hover {
  background: var(--jp-warn-color-hover, var(--jp-warn-color0));
}

.jp-toast-button.jp-mod-link {
  color: var(--jp-content-link-color);
  text-decoration: underline;
  text-decoration-color: var(--jp-content-link-color);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils-extension/style/notification.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAIF;EACE,+CAA+C;EAC/C,8CAA8C;EAC9C,4CAA4C;EAC5C,kDAAkD;EAClD,+CAA+C;EAC/C,8CAA8C;EAC9C,sDAAsD;EACtD,sDAAsD;EACtD,4DAA4D;EAC5D,4DAA4D;EAC5D,wDAAwD;EACxD,4BAA4B;EAC5B,oDAAoD;EACpD,iCAAiC;EACjC,kCAAkC;EAClC,gDAAgD;EAChD,wBAAwB;EACxB,qDAAqD;EACrD,oDAAoD;EACpD,oDAAoD;EACpD,uDAAuD;EACvD,uDAAuD;EACvD,qDAAqD;EACrD,iCAAiC;EACjC,4CAA4C;EAC5C;;;;;;;;GAQC;EACD,uCAAuC;EACvC,0DAA0D;EAC1D,gEAAgE;EAChE,gEAAgE;EAChE,4DAA4D;AAC9D;;AAEA;EACE,gBAAgB;EAChB,SAAS;EACT,YAAY;EACZ,kCAAkC;EAClC,gBAAgB;EAChB,gBAAgB;EAChB,sBAAsB;EACtB,yCAAyC;AAC3C;;AAEA;EACE,aAAa;EACb,kCAAkC;EAClC,iBAAiB;EACjB,kBAAkB;EAClB,SAAS;EACT,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,SAAS;AACX;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,iBAAiB;EACjB,YAAY;EACZ,kCAAkC;EAClC,oCAAoC;EACpC,sCAAsC;EACtC,qCAAqC;EACrC,kCAAkC;EAClC,eAAe;AACjB;;AAEA;EACE,aAAa;EACb,YAAY;AACd;;AAEA;EACE,UAAU;EACV,kBAAkB;EAClB,YAAY;EACZ,eAAe;AACjB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,6CAA6C;EAC7C,gBAAgB;AAClB;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,8CAA8C;AAChD;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,mCAAmC;EACnC,0BAA0B;AAC5B;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;;EAEE;AACF;;;;;;;;;EASE,aAAa;AACf;;AAEA;;;;;;;;;EASE,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,iBAAiB;EACjB,cAAc;EACd,wBAAwB;AAC1B;;AAEA;EACE,YAAY;EACZ,cAAc;AAChB;;AAEA;EACE,eAAe;EACf,kBAAkB;EAClB,eAAe;EACf,gBAAgB;EAChB,+BAA+B;EAC/B,yCAAyC;EACzC,YAAY;AACd;;AAEA;EACE,yEAAyE;EACzE,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,iEAAiE;EACjE,uCAAuC;AACzC;;AAEA;EACE,oEAAoE;AACtE;;AAEA;EACE,gEAAgE;AAClE;;AAEA;EACE,8DAA8D;EAC9D,uCAAuC;AACzC;;AAEA;EACE,iEAAiE;AACnE;;AAEA;EACE,6DAA6D;AAC/D;;AAEA;EACE,mCAAmC;EACnC,0BAA0B;EAC1B,mDAAmD;AACrD","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n@import '~react-toastify/dist/ReactToastify.min.css';\n\n:root {\n  --toastify-color-light: var(--jp-layout-color1);\n  --toastify-color-dark: var(--jp-layout-color1);\n  --toastify-color-info: var(--jp-info-color1);\n  --toastify-color-success: var(--jp-success-color1);\n  --toastify-color-warning: var(--jp-warn-color1);\n  --toastify-color-error: var(--jp-error-color1);\n  --toastify-color-transparent: rgba(255, 255, 255, 0.7);\n  --toastify-icon-color-info: var(--toastify-color-info);\n  --toastify-icon-color-success: var(--toastify-color-success);\n  --toastify-icon-color-warning: var(--toastify-color-warning);\n  --toastify-icon-color-error: var(--toastify-color-error);\n  --toastify-toast-width: 25em;\n  --toastify-toast-background: var(--jp-layout-color1);\n  --toastify-toast-min-height: 64px;\n  --toastify-toast-max-height: 800px;\n  --toastify-font-family: var(--jp-ui-font-family);\n  --toastify-z-index: 9999;\n  --toastify-text-color-light: var(--jp-ui-font-color1);\n  --toastify-text-color-dark: var(--jp-ui-font-color1);\n  --toastify-text-color-info: var(--jp-ui-font-color1);\n  --toastify-text-color-success: var(--jp-ui-font-color1);\n  --toastify-text-color-warning: var(--jp-ui-font-color1);\n  --toastify-text-color-error: var(--jp-ui-font-color1);\n  --toastify-spinner-color: #616161;\n  --toastify-spinner-color-empty-area: #e0e0e0;\n  --toastify-color-progress-light: linear-gradient(\n    to right,\n    #4cd964,\n    #5ac8fa,\n    #007aff,\n    #34aadc,\n    #5856d6,\n    #ff2d55\n  );\n  --toastify-color-progress-dark: #bb86fc;\n  --toastify-color-progress-info: var(--toastify-color-info);\n  --toastify-color-progress-success: var(--toastify-color-success);\n  --toastify-color-progress-warning: var(--toastify-color-warning);\n  --toastify-color-progress-error: var(--toastify-color-error);\n}\n\n.jp-Notification-List {\n  list-style: none;\n  margin: 0;\n  padding: 4px;\n  width: var(--toastify-toast-width);\n  overflow-y: auto;\n  max-height: 55vh;\n  box-sizing: border-box;\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-Notification-Header {\n  display: flex;\n  font-size: var(--jp-ui-font-size1);\n  padding-left: 8px;\n  padding-right: 4px;\n  margin: 0;\n  align-items: center;\n  user-select: none;\n}\n\n.jp-Notification-List-Item {\n  padding: 2px 0;\n}\n\n.jp-Notification-List .Toastify__toast {\n  margin: 0;\n}\n\n.jp-Notification-Status.jp-mod-selected {\n  background-color: var(--jp-brand-color1);\n}\n\n.jp-Notification-Status.jp-mod-selected .jp-Notification-Status-Text {\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.Toastify__toast {\n  min-height: unset;\n  padding: 4px;\n  font-size: var(--jp-ui-font-size1);\n  border-width: var(--jp-border-width);\n  border-radius: var(--jp-border-radius);\n  border-color: var(--jp-border-color1);\n  box-shadow: var(--jp-elevation-z4);\n  cursor: default;\n}\n\n.Toastify__toast-body {\n  display: flex;\n  flex-grow: 1;\n}\n\n.jp-Notification-Toast-Close {\n  padding: 0;\n  position: absolute;\n  right: 0.1px;\n  cursor: pointer;\n}\n\n.jp-Notification-Toast-Close-Margin {\n  margin-right: 4px;\n}\n\n.jp-toastContainer .jp-Notification-Toast-Close:hover {\n  /* The close button has its own hover style */\n  background: none;\n}\n\n.Toastify__toast.jp-Notification-Toast-error {\n  border-top: 5px solid var(--jp-error-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-warning {\n  border-top: 5px solid var(--jp-warn-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-info {\n  border-top: 5px solid var(--jp-info-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-success {\n  border-top: 5px solid var(--jp-success-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-in-progress {\n  border-top: 5px solid var(--jp-layout-color1);\n}\n\n.Toastify__toast-body a {\n  color: var(--jp-content-link-color);\n}\n\n.Toastify__toast-body a:hover {\n  color: var(--jp-content-link-color);\n  text-decoration: underline;\n}\n\n.jp-toast-message {\n  padding-inline-end: 16px;\n}\n\n/* p elements are added by the markdown rendering.\n * Removing its default margin allows to reduce toast size.\n */\n.Toastify__toast-body p:first-child,\n.Toastify__toast-body h1:first-child,\n.Toastify__toast-body h2:first-child,\n.Toastify__toast-body h3:first-child,\n.Toastify__toast-body h4:first-child,\n.Toastify__toast-body h5:first-child,\n.Toastify__toast-body h6:first-child,\n.Toastify__toast-body ol:first-child,\n.Toastify__toast-body ul:first-child {\n  margin-top: 0;\n}\n\n.Toastify__toast-body p:last-child,\n.Toastify__toast-body h1:last-child,\n.Toastify__toast-body h2:last-child,\n.Toastify__toast-body h3:last-child,\n.Toastify__toast-body h4:last-child,\n.Toastify__toast-body h5:last-child,\n.Toastify__toast-body h6:last-child,\n.Toastify__toast-body ol:last-child,\n.Toastify__toast-body ul:last-child {\n  margin-bottom: 0;\n}\n\n.jp-toast-buttonBar {\n  display: flex;\n  flex-direction: row;\n  flex-wrap: nowrap;\n  flex: 0 0 auto;\n  padding-block-start: 8px;\n}\n\n.jp-toast-spacer {\n  flex-grow: 1;\n  flex-shrink: 1;\n}\n\n.jp-toast-button {\n  margin-top: 1px;\n  margin-bottom: 1px;\n  margin-right: 0;\n  margin-left: 3px;\n  color: var(--jp-ui-font-color1);\n  background-color: var(--jp-layout-color2);\n  border: none;\n}\n\n.jp-toast-button:focus {\n  outline: 1px solid var(--jp-reject-color-normal, var(--jp-layout-color2));\n  outline-offset: 1px;\n  -moz-outline-radius: 0;\n}\n\n.jp-toast-button:focus-visible {\n  border: none;\n}\n\n.jp-toast-button:hover {\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-toast-button.jp-mod-accept {\n  background: var(--jp-accept-color-normal, var(--jp-brand-color1));\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-toast-button.jp-mod-accept:focus {\n  outline-color: var(--jp-accept-color-normal, var(--jp-brand-color1));\n}\n\n.jp-toast-button.jp-mod-accept:hover {\n  background: var(--jp-accept-color-hover, var(--jp-brand-color0));\n}\n\n.jp-toast-button.jp-mod-warn {\n  background: var(--jp-warn-color-normal, var(--jp-warn-color1));\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-toast-button.jp-mod-warn:focus {\n  outline-color: var(--jp-warn-color-normal, var(--jp-warn-color1));\n}\n\n.jp-toast-button.jp-mod-warn:hover {\n  background: var(--jp-warn-color-hover, var(--jp-warn-color0));\n}\n\n.jp-toast-button.jp-mod-link {\n  color: var(--jp-content-link-color);\n  text-decoration: underline;\n  text-decoration-color: var(--jp-content-link-color);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 92027:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

#jupyterlab-splash {
  z-index: 10;
  position: absolute;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background-position: center 40%;
  background-repeat: no-repeat;
  background-size: cover;
}

#jupyterlab-splash.light {
  background-color: white;
}

#jupyterlab-splash.dark {
  background-color: var(--md-grey-900, #212121);
}

.splash-fade {
  animation: 0.5s fade-out forwards;
}

#galaxy {
  position: relative;
  width: 100%;
  height: 100%;
}

.planet {
  background-repeat: no-repeat;
  background-size: cover;
  animation-iteration-count: infinite;
  animation-name: orbit;
}

#moon1.orbit {
  opacity: 1;
  animation: orbit 2s ease;
  width: 200px;
  height: 140px;
  margin-top: -53px;
  margin-left: -54px;
}

#moon2.orbit {
  opacity: 1;
  animation: orbit 2s ease;
  width: 132px;
  height: 180px;
  margin-top: -66px;
  margin-left: -85px;
}

#moon3.orbit {
  opacity: 1;
  display: flex;
  align-items: flex-end;
  animation: orbit 2s ease;
  width: 220px;
  height: 166px;
  margin-top: -96px;
  margin-left: -50px;
}

#moon1 .planet {
  height: 12px;
  width: 12px;
  border-radius: 50%;
}

#moon2 .planet {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  float: right;
}

#moon3 .planet {
  height: 20px;
  width: 20px;
  border-radius: 50%;
}

#jupyterlab-splash.light #moon1 .planet {
  background-color: #6f7070;
}

#jupyterlab-splash.light #moon2 .planet {
  background-color: #767677;
}

#jupyterlab-splash.light #moon3 .planet {
  background-color: #989798;
}

#jupyterlab-splash.dark #moon1 .planet,
#jupyterlab-splash.dark #moon2 .planet,
#jupyterlab-splash.dark #moon3 .planet {
  background-color: white;
}

.orbit {
  animation-iteration-count: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
}

@keyframes orbit {
  0% {
    transform: rotateZ(0deg);
  }

  100% {
    transform: rotateZ(-720deg);
  }
}

@keyframes orbit2 {
  0% {
    transform: rotateZ(0deg);
  }

  100% {
    transform: rotateZ(720deg);
  }
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fade-out {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils-extension/style/splash.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,WAAW;EACX,kBAAkB;EAClB,gBAAgB;EAChB,WAAW;EACX,YAAY;EACZ,+BAA+B;EAC/B,4BAA4B;EAC5B,sBAAsB;AACxB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,iCAAiC;AACnC;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;;AAEA;EACE,4BAA4B;EAC5B,sBAAsB;EACtB,mCAAmC;EACnC,qBAAqB;AACvB;;AAEA;EACE,UAAU;EACV,wBAAwB;EACxB,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,UAAU;EACV,wBAAwB;EACxB,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,UAAU;EACV,aAAa;EACb,qBAAqB;EACrB,wBAAwB;EACxB,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,YAAY;EACZ,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,YAAY;EACZ,WAAW;EACX,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;;;EAGE,uBAAuB;AACzB;;AAEA;EACE,4BAA4B;EAC5B,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,kBAAkB;AACpB;;AAEA;EACE;IACE,wBAAwB;EAC1B;;EAEA;IACE,2BAA2B;EAC7B;AACF;;AAEA;EACE;IACE,wBAAwB;EAC1B;;EAEA;IACE,0BAA0B;EAC5B;AACF;;AAEA;EACE;IACE,UAAU;EACZ;;EAEA;IACE,UAAU;EACZ;AACF;;AAEA;EACE;IACE,UAAU;EACZ;;EAEA;IACE,UAAU;EACZ;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n#jupyterlab-splash {\n  z-index: 10;\n  position: absolute;\n  overflow: hidden;\n  width: 100%;\n  height: 100%;\n  background-position: center 40%;\n  background-repeat: no-repeat;\n  background-size: cover;\n}\n\n#jupyterlab-splash.light {\n  background-color: white;\n}\n\n#jupyterlab-splash.dark {\n  background-color: var(--md-grey-900, #212121);\n}\n\n.splash-fade {\n  animation: 0.5s fade-out forwards;\n}\n\n#galaxy {\n  position: relative;\n  width: 100%;\n  height: 100%;\n}\n\n.planet {\n  background-repeat: no-repeat;\n  background-size: cover;\n  animation-iteration-count: infinite;\n  animation-name: orbit;\n}\n\n#moon1.orbit {\n  opacity: 1;\n  animation: orbit 2s ease;\n  width: 200px;\n  height: 140px;\n  margin-top: -53px;\n  margin-left: -54px;\n}\n\n#moon2.orbit {\n  opacity: 1;\n  animation: orbit 2s ease;\n  width: 132px;\n  height: 180px;\n  margin-top: -66px;\n  margin-left: -85px;\n}\n\n#moon3.orbit {\n  opacity: 1;\n  display: flex;\n  align-items: flex-end;\n  animation: orbit 2s ease;\n  width: 220px;\n  height: 166px;\n  margin-top: -96px;\n  margin-left: -50px;\n}\n\n#moon1 .planet {\n  height: 12px;\n  width: 12px;\n  border-radius: 50%;\n}\n\n#moon2 .planet {\n  height: 16px;\n  width: 16px;\n  border-radius: 50%;\n  float: right;\n}\n\n#moon3 .planet {\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n}\n\n#jupyterlab-splash.light #moon1 .planet {\n  background-color: #6f7070;\n}\n\n#jupyterlab-splash.light #moon2 .planet {\n  background-color: #767677;\n}\n\n#jupyterlab-splash.light #moon3 .planet {\n  background-color: #989798;\n}\n\n#jupyterlab-splash.dark #moon1 .planet,\n#jupyterlab-splash.dark #moon2 .planet,\n#jupyterlab-splash.dark #moon3 .planet {\n  background-color: white;\n}\n\n.orbit {\n  animation-iteration-count: 1;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  border-radius: 50%;\n}\n\n@keyframes orbit {\n  0% {\n    transform: rotateZ(0deg);\n  }\n\n  100% {\n    transform: rotateZ(-720deg);\n  }\n}\n\n@keyframes orbit2 {\n  0% {\n    transform: rotateZ(0deg);\n  }\n\n  100% {\n    transform: rotateZ(720deg);\n  }\n}\n\n@keyframes fade-in {\n  0% {\n    opacity: 0;\n  }\n\n  100% {\n    opacity: 1;\n  }\n}\n\n@keyframes fade-out {\n  0% {\n    opacity: 1;\n  }\n\n  100% {\n    opacity: 0;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 11997:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_commandpalette_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23396);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_dialog_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97465);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_inputdialog_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57035);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_licenses_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87134);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_mainareawidget_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(117);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_materialcolors_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(95714);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_toolbar_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(36972);
// Imports









var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_commandpalette_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_dialog_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_inputdialog_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_licenses_css__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_mainareawidget_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_materialcolors_css__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_toolbar_css__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n@import './commandpalette.css';\n@import './dialog.css';\n@import './inputdialog.css';\n@import './licenses.css';\n@import './mainareawidget.css';\n@import './materialcolors.css';\n@import './toolbar.css';\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 23396:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --jp-private-commandpalette-search-height: 28px;
}

/*-----------------------------------------------------------------------------
| Overall styles
|----------------------------------------------------------------------------*/

.lm-CommandPalette {
  padding-bottom: 0;
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);

  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
}

/*-----------------------------------------------------------------------------
| Modal variant
|----------------------------------------------------------------------------*/

.jp-ModalCommandPalette.jp-ThemedContainer {
  position: absolute;
  z-index: 10000;
  top: 38px;
  left: 30%;
  margin: 0;
  padding: 4px;
  width: 40%;
  box-shadow: var(--jp-elevation-z4);
  border-radius: 4px;
  background: var(--jp-layout-color0);
}

.jp-ModalCommandPalette .lm-CommandPalette {
  max-height: 40vh;
}

.jp-ModalCommandPalette .lm-CommandPalette .lm-close-icon::after {
  display: none;
}

.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-header {
  display: none;
}

.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-item {
  margin-left: 4px;
  margin-right: 4px;
}

.jp-ModalCommandPalette
  .lm-CommandPalette
  .lm-CommandPalette-item.lm-mod-disabled {
  display: none;
}

/*-----------------------------------------------------------------------------
| Search
|----------------------------------------------------------------------------*/

.lm-CommandPalette-search {
  padding: 4px;
  background-color: var(--jp-layout-color1);
  z-index: 2;
}

.lm-CommandPalette-wrapper {
  /* stylelint-disable-next-line csstree/validator */
  overflow: overlay;
  padding: 0 9px;
  background-color: var(--jp-input-active-background);
  height: 30px;
  box-shadow: inset 0 0 0 var(--jp-border-width) var(--jp-input-border-color);
}

.lm-CommandPalette.lm-mod-focused .lm-CommandPalette-wrapper {
  box-shadow:
    inset 0 0 0 1px var(--jp-input-active-box-shadow-color),
    inset 0 0 0 3px var(--jp-input-active-box-shadow-color);
}

.jp-SearchIconGroup {
  color: white;
  background-color: var(--jp-brand-color1);
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 5px 5px 1px;
}

.jp-SearchIconGroup svg {
  height: 20px;
  width: 20px;
}

.jp-SearchIconGroup .jp-icon3[fill] {
  fill: var(--jp-layout-color0);
}

.lm-CommandPalette-input {
  background: transparent;
  width: calc(100% - 18px);
  float: left;
  border: none;
  outline: none;
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color0);
  line-height: var(--jp-private-commandpalette-search-height);
}

.lm-CommandPalette-input::-webkit-input-placeholder,
.lm-CommandPalette-input::-moz-placeholder,
.lm-CommandPalette-input:-ms-input-placeholder {
  color: var(--jp-ui-font-color2);
  font-size: var(--jp-ui-font-size1);
}

/*-----------------------------------------------------------------------------
| Results
|----------------------------------------------------------------------------*/

.lm-CommandPalette-header:first-child {
  margin-top: 0;
}

.lm-CommandPalette-header {
  border-bottom: solid var(--jp-border-width) var(--jp-border-color2);
  color: var(--jp-ui-font-color1);
  cursor: pointer;
  display: flex;
  font-size: var(--jp-ui-font-size0);
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 8px;
  padding: 8px 0 8px 12px;
  text-transform: uppercase;
}

.lm-CommandPalette-header.lm-mod-active {
  background: var(--jp-layout-color2);
}

.lm-CommandPalette-header > mark {
  background-color: transparent;
  font-weight: bold;
  color: var(--jp-ui-font-color1);
}

.lm-CommandPalette-item {
  padding: 4px 12px 4px 4px;
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  font-weight: 400;
  display: flex;
}

.lm-CommandPalette-item.lm-mod-disabled {
  color: var(--jp-ui-font-color2);
}

.lm-CommandPalette-item.lm-mod-active {
  color: var(--jp-ui-inverse-font-color1);
  background: var(--jp-brand-color1);
}

.lm-CommandPalette-item.lm-mod-active .lm-CommandPalette-itemLabel > mark {
  color: var(--jp-ui-inverse-font-color0);
}

.lm-CommandPalette-item.lm-mod-active .jp-icon-selectable[fill] {
  fill: var(--jp-layout-color0);
}

.lm-CommandPalette-item.lm-mod-active:hover:not(.lm-mod-disabled) {
  color: var(--jp-ui-inverse-font-color1);
  background: var(--jp-brand-color1);
}

.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled) {
  background: var(--jp-layout-color2);
}

.lm-CommandPalette-itemContent {
  overflow: hidden;
}

.lm-CommandPalette-itemLabel > mark {
  color: var(--jp-ui-font-color0);
  background-color: transparent;
  font-weight: bold;
}

.lm-CommandPalette-item.lm-mod-disabled mark {
  color: var(--jp-ui-font-color2);
}

.lm-CommandPalette-item .lm-CommandPalette-itemIcon {
  margin: 0 4px 0 0;
  position: relative;
  width: 16px;
  top: 2px;
  flex: 0 0 auto;
}

.lm-CommandPalette-item.lm-mod-disabled .lm-CommandPalette-itemIcon {
  opacity: 0.6;
}

.lm-CommandPalette-item .lm-CommandPalette-itemShortcut {
  flex: 0 0 auto;
}

.lm-CommandPalette-itemCaption {
  display: none;
}

.lm-CommandPalette-content {
  background-color: var(--jp-layout-color1);
}

.lm-CommandPalette-content:empty::after {
  content: 'No results';
  margin: auto;
  margin-top: 20px;
  width: 100px;
  display: block;
  font-size: var(--jp-ui-font-size2);
  font-family: var(--jp-ui-font-family);
  font-weight: lighter;
}

.lm-CommandPalette-emptyMessage {
  text-align: center;
  margin-top: 24px;
  line-height: 1.32;
  padding: 0 8px;
  color: var(--jp-content-font-color3);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/commandpalette.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,+CAA+C;AACjD;;AAEA;;8EAE8E;;AAE9E;EACE,iBAAiB;EACjB,+BAA+B;EAC/B,mCAAmC;;EAEnC;iCAC+B;EAC/B,kCAAkC;AACpC;;AAEA;;8EAE8E;;AAE9E;EACE,kBAAkB;EAClB,cAAc;EACd,SAAS;EACT,SAAS;EACT,SAAS;EACT,YAAY;EACZ,UAAU;EACV,kCAAkC;EAClC,kBAAkB;EAClB,mCAAmC;AACrC;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;8EAE8E;;AAE9E;EACE,YAAY;EACZ,yCAAyC;EACzC,UAAU;AACZ;;AAEA;EACE,kDAAkD;EAClD,iBAAiB;EACjB,cAAc;EACd,mDAAmD;EACnD,YAAY;EACZ,2EAA2E;AAC7E;;AAEA;EACE;;2DAEyD;AAC3D;;AAEA;EACE,YAAY;EACZ,wCAAwC;EACxC,kBAAkB;EAClB,QAAQ;EACR,UAAU;EACV,oBAAoB;AACtB;;AAEA;EACE,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,uBAAuB;EACvB,wBAAwB;EACxB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kCAAkC;EAClC,+BAA+B;EAC/B,2DAA2D;AAC7D;;AAEA;;;EAGE,+BAA+B;EAC/B,kCAAkC;AACpC;;AAEA;;8EAE8E;;AAE9E;EACE,aAAa;AACf;;AAEA;EACE,mEAAmE;EACnE,+BAA+B;EAC/B,eAAe;EACf,aAAa;EACb,kCAAkC;EAClC,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;EACf,uBAAuB;EACvB,yBAAyB;AAC3B;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,6BAA6B;EAC7B,iBAAiB;EACjB,+BAA+B;AACjC;;AAEA;EACE,yBAAyB;EACzB,+BAA+B;EAC/B,kCAAkC;EAClC,gBAAgB;EAChB,aAAa;AACf;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,uCAAuC;EACvC,kCAAkC;AACpC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,uCAAuC;EACvC,kCAAkC;AACpC;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,+BAA+B;EAC/B,6BAA6B;EAC7B,iBAAiB;AACnB;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,WAAW;EACX,QAAQ;EACR,cAAc;AAChB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,qBAAqB;EACrB,YAAY;EACZ,gBAAgB;EAChB,YAAY;EACZ,cAAc;EACd,kCAAkC;EAClC,qCAAqC;EACrC,oBAAoB;AACtB;;AAEA;EACE,kBAAkB;EAClB,gBAAgB;EAChB,iBAAiB;EACjB,cAAc;EACd,oCAAoC;AACtC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-commandpalette-search-height: 28px;\n}\n\n/*-----------------------------------------------------------------------------\n| Overall styles\n|----------------------------------------------------------------------------*/\n\n.lm-CommandPalette {\n  padding-bottom: 0;\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n\n  /* This is needed so that all font sizing of children done in ems is\n   * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n}\n\n/*-----------------------------------------------------------------------------\n| Modal variant\n|----------------------------------------------------------------------------*/\n\n.jp-ModalCommandPalette.jp-ThemedContainer {\n  position: absolute;\n  z-index: 10000;\n  top: 38px;\n  left: 30%;\n  margin: 0;\n  padding: 4px;\n  width: 40%;\n  box-shadow: var(--jp-elevation-z4);\n  border-radius: 4px;\n  background: var(--jp-layout-color0);\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette {\n  max-height: 40vh;\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette .lm-close-icon::after {\n  display: none;\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-header {\n  display: none;\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-item {\n  margin-left: 4px;\n  margin-right: 4px;\n}\n\n.jp-ModalCommandPalette\n  .lm-CommandPalette\n  .lm-CommandPalette-item.lm-mod-disabled {\n  display: none;\n}\n\n/*-----------------------------------------------------------------------------\n| Search\n|----------------------------------------------------------------------------*/\n\n.lm-CommandPalette-search {\n  padding: 4px;\n  background-color: var(--jp-layout-color1);\n  z-index: 2;\n}\n\n.lm-CommandPalette-wrapper {\n  /* stylelint-disable-next-line csstree/validator */\n  overflow: overlay;\n  padding: 0 9px;\n  background-color: var(--jp-input-active-background);\n  height: 30px;\n  box-shadow: inset 0 0 0 var(--jp-border-width) var(--jp-input-border-color);\n}\n\n.lm-CommandPalette.lm-mod-focused .lm-CommandPalette-wrapper {\n  box-shadow:\n    inset 0 0 0 1px var(--jp-input-active-box-shadow-color),\n    inset 0 0 0 3px var(--jp-input-active-box-shadow-color);\n}\n\n.jp-SearchIconGroup {\n  color: white;\n  background-color: var(--jp-brand-color1);\n  position: absolute;\n  top: 4px;\n  right: 4px;\n  padding: 5px 5px 1px;\n}\n\n.jp-SearchIconGroup svg {\n  height: 20px;\n  width: 20px;\n}\n\n.jp-SearchIconGroup .jp-icon3[fill] {\n  fill: var(--jp-layout-color0);\n}\n\n.lm-CommandPalette-input {\n  background: transparent;\n  width: calc(100% - 18px);\n  float: left;\n  border: none;\n  outline: none;\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color0);\n  line-height: var(--jp-private-commandpalette-search-height);\n}\n\n.lm-CommandPalette-input::-webkit-input-placeholder,\n.lm-CommandPalette-input::-moz-placeholder,\n.lm-CommandPalette-input:-ms-input-placeholder {\n  color: var(--jp-ui-font-color2);\n  font-size: var(--jp-ui-font-size1);\n}\n\n/*-----------------------------------------------------------------------------\n| Results\n|----------------------------------------------------------------------------*/\n\n.lm-CommandPalette-header:first-child {\n  margin-top: 0;\n}\n\n.lm-CommandPalette-header {\n  border-bottom: solid var(--jp-border-width) var(--jp-border-color2);\n  color: var(--jp-ui-font-color1);\n  cursor: pointer;\n  display: flex;\n  font-size: var(--jp-ui-font-size0);\n  font-weight: 600;\n  letter-spacing: 1px;\n  margin-top: 8px;\n  padding: 8px 0 8px 12px;\n  text-transform: uppercase;\n}\n\n.lm-CommandPalette-header.lm-mod-active {\n  background: var(--jp-layout-color2);\n}\n\n.lm-CommandPalette-header > mark {\n  background-color: transparent;\n  font-weight: bold;\n  color: var(--jp-ui-font-color1);\n}\n\n.lm-CommandPalette-item {\n  padding: 4px 12px 4px 4px;\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  font-weight: 400;\n  display: flex;\n}\n\n.lm-CommandPalette-item.lm-mod-disabled {\n  color: var(--jp-ui-font-color2);\n}\n\n.lm-CommandPalette-item.lm-mod-active {\n  color: var(--jp-ui-inverse-font-color1);\n  background: var(--jp-brand-color1);\n}\n\n.lm-CommandPalette-item.lm-mod-active .lm-CommandPalette-itemLabel > mark {\n  color: var(--jp-ui-inverse-font-color0);\n}\n\n.lm-CommandPalette-item.lm-mod-active .jp-icon-selectable[fill] {\n  fill: var(--jp-layout-color0);\n}\n\n.lm-CommandPalette-item.lm-mod-active:hover:not(.lm-mod-disabled) {\n  color: var(--jp-ui-inverse-font-color1);\n  background: var(--jp-brand-color1);\n}\n\n.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled) {\n  background: var(--jp-layout-color2);\n}\n\n.lm-CommandPalette-itemContent {\n  overflow: hidden;\n}\n\n.lm-CommandPalette-itemLabel > mark {\n  color: var(--jp-ui-font-color0);\n  background-color: transparent;\n  font-weight: bold;\n}\n\n.lm-CommandPalette-item.lm-mod-disabled mark {\n  color: var(--jp-ui-font-color2);\n}\n\n.lm-CommandPalette-item .lm-CommandPalette-itemIcon {\n  margin: 0 4px 0 0;\n  position: relative;\n  width: 16px;\n  top: 2px;\n  flex: 0 0 auto;\n}\n\n.lm-CommandPalette-item.lm-mod-disabled .lm-CommandPalette-itemIcon {\n  opacity: 0.6;\n}\n\n.lm-CommandPalette-item .lm-CommandPalette-itemShortcut {\n  flex: 0 0 auto;\n}\n\n.lm-CommandPalette-itemCaption {\n  display: none;\n}\n\n.lm-CommandPalette-content {\n  background-color: var(--jp-layout-color1);\n}\n\n.lm-CommandPalette-content:empty::after {\n  content: 'No results';\n  margin: auto;\n  margin-top: 20px;\n  width: 100px;\n  display: block;\n  font-size: var(--jp-ui-font-size2);\n  font-family: var(--jp-ui-font-family);\n  font-weight: lighter;\n}\n\n.lm-CommandPalette-emptyMessage {\n  text-align: center;\n  margin-top: 24px;\n  line-height: 1.32;\n  padding: 0 8px;\n  color: var(--jp-content-font-color3);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 97465:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-Dialog.jp-ThemedContainer {
  position: absolute;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--jp-dialog-background);
  /* stylelint-disable */
  container-type: inline-size;
  /* stylelint-enable */
}

.jp-Dialog-content {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  margin-right: auto;
  background: var(--jp-layout-color1);
  padding: 24px 24px 12px;
  min-width: 300px;
  min-height: 150px;
  max-width: 1000px;
  max-height: 500px;
  box-sizing: border-box;
  box-shadow: var(--jp-elevation-z20);
  word-wrap: break-word;
  border-radius: var(--jp-border-radius);

  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color1);
  resize: both;
  overflow: hidden;
}

.jp-Dialog-content.jp-Dialog-content-small {
  max-width: 500px;
}

.jp-Dialog-button {
  overflow: visible;
}

button.jp-Dialog-button:disabled {
  opacity: 0.6;
}

button.jp-Dialog-button:focus {
  outline: 1px solid var(--jp-brand-color1);
  outline-offset: 4px;
  -moz-outline-radius: 0;
}

button.jp-Dialog-button:focus::-moz-focus-inner {
  border: 0;
}

button.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus,
button.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus,
button.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus {
  outline-offset: 4px;
  -moz-outline-radius: 0;
}

button.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus {
  outline: 1px solid var(--jp-accept-color-normal, var(--jp-brand-color1));
}

button.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus {
  outline: 1px solid var(--jp-warn-color-normal, var(--jp-error-color1));
}

button.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus {
  outline: 1px solid var(--jp-reject-color-normal, var(--md-grey-600, #757575));
}

button.jp-Dialog-close-button {
  padding: 0;
  height: 100%;
  min-width: unset;
  min-height: unset;
}

.jp-Dialog-header {
  display: flex;
  justify-content: space-between;
  flex: 0 0 auto;
  padding-bottom: 12px;
  font-size: var(--jp-ui-font-size3);
  font-weight: 400;
  color: var(--jp-ui-font-color1);
}

.jp-Dialog-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  font-size: var(--jp-ui-font-size1);
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  overflow: auto;
}

.jp-Dialog-footer {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: start;
  flex: 0 0 auto;
  gap: 5px;
  margin-left: -12px;
  margin-right: -12px;
  padding: 12px;
}

.jp-Dialog-footerButtons {
  width: 100%;
  text-align: end;
}

.jp-Dialog-checkbox {
  padding-right: 5px;
  display: flex;
  align-items: center;
}

.jp-Dialog-spacer {
  flex: 1 1 auto;
}

.jp-Dialog-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.jp-Dialog-body > .jp-select-wrapper {
  width: 100%;
}

.jp-Dialog-body > button {
  padding: 0 16px;
}

.jp-Dialog-body > label {
  line-height: 1.4;
  color: var(--jp-ui-font-color0);
}

.jp-Dialog-button.jp-mod-styled:not(:last-child) {
  margin-right: 12px;
}

/* stylelint-disable */
@container (max-width: 560px) {
  /* stylelint-enable */
  .jp-Dialog-footer {
    flex-direction: column;
    align-items: center;
    gap: 7px;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/dialog.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,kBAAkB;EAClB,cAAc;EACd,aAAa;EACb,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB;EACvB,MAAM;EACN,OAAO;EACP,SAAS;EACT,UAAU;EACV,WAAW;EACX,YAAY;EACZ,uCAAuC;EACvC,sBAAsB;EACtB,2BAA2B;EAC3B,qBAAqB;AACvB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,iBAAiB;EACjB,kBAAkB;EAClB,mCAAmC;EACnC,uBAAuB;EACvB,gBAAgB;EAChB,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,sBAAsB;EACtB,mCAAmC;EACnC,qBAAqB;EACrB,sCAAsC;;EAEtC;iCAC+B;EAC/B,kCAAkC;EAClC,+BAA+B;EAC/B,YAAY;EACZ,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,yCAAyC;EACzC,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA;EACE,SAAS;AACX;;AAEA;;;EAGE,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA;EACE,wEAAwE;AAC1E;;AAEA;EACE,sEAAsE;AACxE;;AAEA;EACE,6EAA6E;AAC/E;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,cAAc;EACd,oBAAoB;EACpB,kCAAkC;EAClC,gBAAgB;EAChB,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,cAAc;EACd,kCAAkC;EAClC,mCAAmC;EACnC,+BAA+B;EAC/B,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,yBAAyB;EACzB,kBAAkB;EAClB,cAAc;EACd,QAAQ;EACR,kBAAkB;EAClB,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,WAAW;EACX,eAAe;AACjB;;AAEA;EACE,kBAAkB;EAClB,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,+BAA+B;AACjC;;AAEA;EACE,kBAAkB;AACpB;;AAEA,sBAAsB;AACtB;EACE,qBAAqB;EACrB;IACE,sBAAsB;IACtB,mBAAmB;IACnB,QAAQ;EACV;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Dialog.jp-ThemedContainer {\n  position: absolute;\n  z-index: 10000;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  top: 0;\n  left: 0;\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: 100%;\n  background: var(--jp-dialog-background);\n  /* stylelint-disable */\n  container-type: inline-size;\n  /* stylelint-enable */\n}\n\n.jp-Dialog-content {\n  display: flex;\n  flex-direction: column;\n  margin-left: auto;\n  margin-right: auto;\n  background: var(--jp-layout-color1);\n  padding: 24px 24px 12px;\n  min-width: 300px;\n  min-height: 150px;\n  max-width: 1000px;\n  max-height: 500px;\n  box-sizing: border-box;\n  box-shadow: var(--jp-elevation-z20);\n  word-wrap: break-word;\n  border-radius: var(--jp-border-radius);\n\n  /* This is needed so that all font sizing of children done in ems is\n   * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color1);\n  resize: both;\n  overflow: hidden;\n}\n\n.jp-Dialog-content.jp-Dialog-content-small {\n  max-width: 500px;\n}\n\n.jp-Dialog-button {\n  overflow: visible;\n}\n\nbutton.jp-Dialog-button:disabled {\n  opacity: 0.6;\n}\n\nbutton.jp-Dialog-button:focus {\n  outline: 1px solid var(--jp-brand-color1);\n  outline-offset: 4px;\n  -moz-outline-radius: 0;\n}\n\nbutton.jp-Dialog-button:focus::-moz-focus-inner {\n  border: 0;\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus,\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus,\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus {\n  outline-offset: 4px;\n  -moz-outline-radius: 0;\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus {\n  outline: 1px solid var(--jp-accept-color-normal, var(--jp-brand-color1));\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus {\n  outline: 1px solid var(--jp-warn-color-normal, var(--jp-error-color1));\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus {\n  outline: 1px solid var(--jp-reject-color-normal, var(--md-grey-600, #757575));\n}\n\nbutton.jp-Dialog-close-button {\n  padding: 0;\n  height: 100%;\n  min-width: unset;\n  min-height: unset;\n}\n\n.jp-Dialog-header {\n  display: flex;\n  justify-content: space-between;\n  flex: 0 0 auto;\n  padding-bottom: 12px;\n  font-size: var(--jp-ui-font-size3);\n  font-weight: 400;\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-Dialog-body {\n  display: flex;\n  flex-direction: column;\n  flex: 1 1 auto;\n  font-size: var(--jp-ui-font-size1);\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n  overflow: auto;\n}\n\n.jp-Dialog-footer {\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  align-items: start;\n  flex: 0 0 auto;\n  gap: 5px;\n  margin-left: -12px;\n  margin-right: -12px;\n  padding: 12px;\n}\n\n.jp-Dialog-footerButtons {\n  width: 100%;\n  text-align: end;\n}\n\n.jp-Dialog-checkbox {\n  padding-right: 5px;\n  display: flex;\n  align-items: center;\n}\n\n.jp-Dialog-spacer {\n  flex: 1 1 auto;\n}\n\n.jp-Dialog-title {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\n.jp-Dialog-body > .jp-select-wrapper {\n  width: 100%;\n}\n\n.jp-Dialog-body > button {\n  padding: 0 16px;\n}\n\n.jp-Dialog-body > label {\n  line-height: 1.4;\n  color: var(--jp-ui-font-color0);\n}\n\n.jp-Dialog-button.jp-mod-styled:not(:last-child) {\n  margin-right: 12px;\n}\n\n/* stylelint-disable */\n@container (max-width: 560px) {\n  /* stylelint-enable */\n  .jp-Dialog-footer {\n    flex-direction: column;\n    align-items: center;\n    gap: 7px;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 57035:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-Input-Boolean-Dialog {
  flex-direction: row-reverse;
  align-items: end;
  width: 100%;
}

.jp-Input-Boolean-Dialog > label {
  flex: 1 1 auto;
}

.jp-InputDialog-inputWrapper {
  display: flex;
  align-items: baseline;
}

.jp-InputDialog-inputWrapper > input.jp-mod-styled:invalid {
  border-color: var(--jp-error-color0);
  background: var(--jp-error-color3);
}

.jp-InputDialog-inputWrapper
  > input[required].jp-mod-styled:invalid:placeholder-shown {
  /* Do not show invalid style when placeholder is shown */
  border-color: unset;
  background: unset;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/inputdialog.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,2BAA2B;EAC3B,gBAAgB;EAChB,WAAW;AACb;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,qBAAqB;AACvB;;AAEA;EACE,oCAAoC;EACpC,kCAAkC;AACpC;;AAEA;;EAEE,wDAAwD;EACxD,mBAAmB;EACnB,iBAAiB;AACnB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-Input-Boolean-Dialog {\n  flex-direction: row-reverse;\n  align-items: end;\n  width: 100%;\n}\n\n.jp-Input-Boolean-Dialog > label {\n  flex: 1 1 auto;\n}\n\n.jp-InputDialog-inputWrapper {\n  display: flex;\n  align-items: baseline;\n}\n\n.jp-InputDialog-inputWrapper > input.jp-mod-styled:invalid {\n  border-color: var(--jp-error-color0);\n  background: var(--jp-error-color3);\n}\n\n.jp-InputDialog-inputWrapper\n  > input[required].jp-mod-styled:invalid:placeholder-shown {\n  /* Do not show invalid style when placeholder is shown */\n  border-color: unset;\n  background: unset;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 87134:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* licenses */
.jp-Licenses {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background-color: var(--jp-layout-color0);
}

.jp-Licenses-FormArea {
  display: flex;
  flex-direction: column;
  min-width: calc(10 * var(--jp-ui-font-size1));
  width: calc(18 * var(--jp-ui-font-size1));
}

.jp-Licenses .lm-SplitPanel-handle:hover {
  background-color: var(--jp-brand-color2);
}

/* filters */
.jp-Licenses-Filters {
  padding: var(--jp-ui-font-size1) calc(var(--jp-ui-font-size1) / 2) 0
    var(--jp-ui-font-size1);
}

.jp-Licenses-Filters label {
  display: block;
}

.jp-Licenses-Filters-title {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: var(--jp-ui-font-size0);
  color: var(--jp-ui-font-color0);
}

.jp-RenderedHTMLCommon.jp-Licenses-Filters ul,
.jp-RenderedHTMLCommon.jp-Licenses-Filters li {
  list-style: none;
  color: var(--jp-ui-font-color0);
}

.jp-Licenses-Filters input {
  width: 100%;
}

.jp-RenderedHTMLCommon.jp-Licenses-Filters ul {
  padding: 0 0 var(--jp-ui-font-size1) 0;
  margin: 0;
  padding-bottom: var(--jp-ui-font-size1);
}

/* bundles */
.jp-Licenses-Bundles {
  background-color: var(--jp-layout-color2);
  overflow-y: auto;
  flex: 1;
}

.jp-Licenses-Bundles .lm-TabBar-content {
  width: 100%;
}

.jp-Licenses-Bundles .lm-TabBar-tab {
  padding: calc(var(--jp-ui-font-size1) / 2);
  background-color: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
}

.jp-Licenses-Bundles .lm-TabBar-tabLabel {
  text-overflow: ellipsis;
}

.jp-Licenses-Bundles .lm-TabBar-tab label {
  background-color: var(--jp-layout-color2);
  border-radius: var(--jp-ui-font-size1);
  width: calc(2.5 * var(--jp-ui-font-size1));
  padding: 0 calc(var(--jp-ui-font-size1) / 2);
  text-align: center;
  margin-left: calc(var(--jp-ui-font-size1) / 2);
}

.jp-Licenses-Bundles .lm-TabBar-tab.lm-mod-current {
  background-color: var(--jp-brand-color1);
  color: #fff;
}

.jp-Licenses-Bundles .lm-TabBar-tab.lm-mod-current label {
  background-color: #fff;
  color: var(--jp-brand-color1);
}

/* license grid */
.jp-Licenses-Grid.jp-RenderedHTMLCommon {
  min-width: calc(var(--jp-ui-font-size1) * 10);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.jp-Licenses-Grid.jp-RenderedHTMLCommon form {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  margin: 0;
  padding: 0;
}

.jp-RenderedHTMLCommon.jp-Licenses-Grid table {
  flex: 1;
  max-width: 100%;
  border: solid var(--jp-border-width) var(--jp-border-color2);
  border-top: 0;
  border-bottom: 0;
  margin: 0;
}

.jp-Licenses-Grid.jp-RenderedHTMLCommon td,
.jp-Licenses-Grid.jp-RenderedHTMLCommon th {
  text-align: left;
}

.jp-Licenses-Grid td:nth-child(1) {
  max-width: calc(2 * var(--jp-ui-font-size1));
}

.jp-Licenses-Grid label {
  width: 100%;
}

.jp-Licenses .jp-Licenses-Grid.jp-RenderedHTMLCommon code {
  background-color: transparent;
  padding: 0;
}

.jp-Licenses-Grid.jp-RenderedHTMLCommon tr.jp-mod-selected {
  background-color: var(--jp-brand-color1);
  color: #fff;
}

.jp-Licenses-Grid.jp-RenderedHTMLCommon .jp-mod-selected code {
  color: #fff;
}

/* license text */
.jp-Licenses-Text {
  min-width: calc(10 * var(--jp-ui-font-size1));
  padding: 0 0 0 var(--jp-ui-font-size1);
  display: flex;
  flex-direction: column;
}

.jp-Licenses-Text h1 {
  flex: initial;
  margin-bottom: 0;
}

.jp-Licenses-Text h1:empty {
  display: none;
}

.jp-Licenses-Text blockquote {
  flex: initial;
}

.jp-Licenses-Text.jp-RenderedHTMLCommon code {
  overflow-wrap: anywhere;
  overflow-y: auto;
  flex: 1;
  padding-right: var(--jp-ui-font-size1);
  margin-bottom: 0;
  padding-bottom: var(--jp-ui-font-size1);
}

.jp-Licenses-Text code:empty {
  display: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/licenses.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,aAAa;AACb;EACE,aAAa;EACb,mBAAmB;EACnB,oBAAoB;EACpB,yCAAyC;AAC3C;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,6CAA6C;EAC7C,yCAAyC;AAC3C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA,YAAY;AACZ;EACE;2BACyB;AAC3B;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,gBAAgB;EAChB,yBAAyB;EACzB,mBAAmB;EACnB,kCAAkC;EAClC,+BAA+B;AACjC;;AAEA;;EAEE,gBAAgB;EAChB,+BAA+B;AACjC;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,sCAAsC;EACtC,SAAS;EACT,uCAAuC;AACzC;;AAEA,YAAY;AACZ;EACE,yCAAyC;EACzC,gBAAgB;EAChB,OAAO;AACT;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,0CAA0C;EAC1C,yCAAyC;EACzC,+BAA+B;AACjC;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,yCAAyC;EACzC,sCAAsC;EACtC,0CAA0C;EAC1C,4CAA4C;EAC5C,kBAAkB;EAClB,8CAA8C;AAChD;;AAEA;EACE,wCAAwC;EACxC,WAAW;AACb;;AAEA;EACE,sBAAsB;EACtB,6BAA6B;AAC/B;;AAEA,iBAAiB;AACjB;EACE,6CAA6C;EAC7C,aAAa;EACb,sBAAsB;EACtB,UAAU;AACZ;;AAEA;EACE,OAAO;EACP,aAAa;EACb,sBAAsB;EACtB,kBAAkB;EAClB,SAAS;EACT,UAAU;AACZ;;AAEA;EACE,OAAO;EACP,eAAe;EACf,4DAA4D;EAC5D,aAAa;EACb,gBAAgB;EAChB,SAAS;AACX;;AAEA;;EAEE,gBAAgB;AAClB;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,6BAA6B;EAC7B,UAAU;AACZ;;AAEA;EACE,wCAAwC;EACxC,WAAW;AACb;;AAEA;EACE,WAAW;AACb;;AAEA,iBAAiB;AACjB;EACE,6CAA6C;EAC7C,sCAAsC;EACtC,aAAa;EACb,sBAAsB;AACxB;;AAEA;EACE,aAAa;EACb,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,uBAAuB;EACvB,gBAAgB;EAChB,OAAO;EACP,sCAAsC;EACtC,gBAAgB;EAChB,uCAAuC;AACzC;;AAEA;EACE,aAAa;AACf","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* licenses */\n.jp-Licenses {\n  display: flex;\n  flex-direction: row;\n  align-items: stretch;\n  background-color: var(--jp-layout-color0);\n}\n\n.jp-Licenses-FormArea {\n  display: flex;\n  flex-direction: column;\n  min-width: calc(10 * var(--jp-ui-font-size1));\n  width: calc(18 * var(--jp-ui-font-size1));\n}\n\n.jp-Licenses .lm-SplitPanel-handle:hover {\n  background-color: var(--jp-brand-color2);\n}\n\n/* filters */\n.jp-Licenses-Filters {\n  padding: var(--jp-ui-font-size1) calc(var(--jp-ui-font-size1) / 2) 0\n    var(--jp-ui-font-size1);\n}\n\n.jp-Licenses-Filters label {\n  display: block;\n}\n\n.jp-Licenses-Filters-title {\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 1px;\n  font-size: var(--jp-ui-font-size0);\n  color: var(--jp-ui-font-color0);\n}\n\n.jp-RenderedHTMLCommon.jp-Licenses-Filters ul,\n.jp-RenderedHTMLCommon.jp-Licenses-Filters li {\n  list-style: none;\n  color: var(--jp-ui-font-color0);\n}\n\n.jp-Licenses-Filters input {\n  width: 100%;\n}\n\n.jp-RenderedHTMLCommon.jp-Licenses-Filters ul {\n  padding: 0 0 var(--jp-ui-font-size1) 0;\n  margin: 0;\n  padding-bottom: var(--jp-ui-font-size1);\n}\n\n/* bundles */\n.jp-Licenses-Bundles {\n  background-color: var(--jp-layout-color2);\n  overflow-y: auto;\n  flex: 1;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-content {\n  width: 100%;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab {\n  padding: calc(var(--jp-ui-font-size1) / 2);\n  background-color: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tabLabel {\n  text-overflow: ellipsis;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab label {\n  background-color: var(--jp-layout-color2);\n  border-radius: var(--jp-ui-font-size1);\n  width: calc(2.5 * var(--jp-ui-font-size1));\n  padding: 0 calc(var(--jp-ui-font-size1) / 2);\n  text-align: center;\n  margin-left: calc(var(--jp-ui-font-size1) / 2);\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab.lm-mod-current {\n  background-color: var(--jp-brand-color1);\n  color: #fff;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab.lm-mod-current label {\n  background-color: #fff;\n  color: var(--jp-brand-color1);\n}\n\n/* license grid */\n.jp-Licenses-Grid.jp-RenderedHTMLCommon {\n  min-width: calc(var(--jp-ui-font-size1) * 10);\n  display: flex;\n  flex-direction: column;\n  padding: 0;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon form {\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n  overflow-y: scroll;\n  margin: 0;\n  padding: 0;\n}\n\n.jp-RenderedHTMLCommon.jp-Licenses-Grid table {\n  flex: 1;\n  max-width: 100%;\n  border: solid var(--jp-border-width) var(--jp-border-color2);\n  border-top: 0;\n  border-bottom: 0;\n  margin: 0;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon td,\n.jp-Licenses-Grid.jp-RenderedHTMLCommon th {\n  text-align: left;\n}\n\n.jp-Licenses-Grid td:nth-child(1) {\n  max-width: calc(2 * var(--jp-ui-font-size1));\n}\n\n.jp-Licenses-Grid label {\n  width: 100%;\n}\n\n.jp-Licenses .jp-Licenses-Grid.jp-RenderedHTMLCommon code {\n  background-color: transparent;\n  padding: 0;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon tr.jp-mod-selected {\n  background-color: var(--jp-brand-color1);\n  color: #fff;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon .jp-mod-selected code {\n  color: #fff;\n}\n\n/* license text */\n.jp-Licenses-Text {\n  min-width: calc(10 * var(--jp-ui-font-size1));\n  padding: 0 0 0 var(--jp-ui-font-size1);\n  display: flex;\n  flex-direction: column;\n}\n\n.jp-Licenses-Text h1 {\n  flex: initial;\n  margin-bottom: 0;\n}\n\n.jp-Licenses-Text h1:empty {\n  display: none;\n}\n\n.jp-Licenses-Text blockquote {\n  flex: initial;\n}\n\n.jp-Licenses-Text.jp-RenderedHTMLCommon code {\n  overflow-wrap: anywhere;\n  overflow-y: auto;\n  flex: 1;\n  padding-right: var(--jp-ui-font-size1);\n  margin-bottom: 0;\n  padding-bottom: var(--jp-ui-font-size1);\n}\n\n.jp-Licenses-Text code:empty {\n  display: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 117:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-MainAreaWidget > :focus {
  outline: none;
}

.jp-MainAreaWidget .jp-MainAreaWidget-error {
  padding: 6px;
}

.jp-MainAreaWidget .jp-MainAreaWidget-error > pre {
  width: auto;
  padding: 10px;
  background: var(--jp-error-color3);
  border: var(--jp-border-width) solid var(--jp-error-color1);
  border-radius: var(--jp-border-radius);
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  white-space: pre-wrap;
  word-wrap: break-word;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/mainareawidget.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;AACf;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,WAAW;EACX,aAAa;EACb,kCAAkC;EAClC,2DAA2D;EAC3D,sCAAsC;EACtC,+BAA+B;EAC/B,kCAAkC;EAClC,qBAAqB;EACrB,qBAAqB;AACvB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-MainAreaWidget > :focus {\n  outline: none;\n}\n\n.jp-MainAreaWidget .jp-MainAreaWidget-error {\n  padding: 6px;\n}\n\n.jp-MainAreaWidget .jp-MainAreaWidget-error > pre {\n  width: auto;\n  padding: 10px;\n  background: var(--jp-error-color3);\n  border: var(--jp-border-width) solid var(--jp-error-color1);\n  border-radius: var(--jp-border-radius);\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  white-space: pre-wrap;\n  word-wrap: break-word;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 95714:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/**
 * google-material-color v1.2.6
 * https://github.com/danlevan/google-material-color
 */
:root {
  --md-red-50: #ffebee;
  --md-red-100: #ffcdd2;
  --md-red-200: #ef9a9a;
  --md-red-300: #e57373;
  --md-red-400: #ef5350;
  --md-red-500: #f44336;
  --md-red-600: #e53935;
  --md-red-700: #d32f2f;
  --md-red-800: #c62828;
  --md-red-900: #b71c1c;
  --md-red-A100: #ff8a80;
  --md-red-A200: #ff5252;
  --md-red-A400: #ff1744;
  --md-red-A700: #d50000;
  --md-pink-50: #fce4ec;
  --md-pink-100: #f8bbd0;
  --md-pink-200: #f48fb1;
  --md-pink-300: #f06292;
  --md-pink-400: #ec407a;
  --md-pink-500: #e91e63;
  --md-pink-600: #d81b60;
  --md-pink-700: #c2185b;
  --md-pink-800: #ad1457;
  --md-pink-900: #880e4f;
  --md-pink-A100: #ff80ab;
  --md-pink-A200: #ff4081;
  --md-pink-A400: #f50057;
  --md-pink-A700: #c51162;
  --md-purple-50: #f3e5f5;
  --md-purple-100: #e1bee7;
  --md-purple-200: #ce93d8;
  --md-purple-300: #ba68c8;
  --md-purple-400: #ab47bc;
  --md-purple-500: #9c27b0;
  --md-purple-600: #8e24aa;
  --md-purple-700: #7b1fa2;
  --md-purple-800: #6a1b9a;
  --md-purple-900: #4a148c;
  --md-purple-A100: #ea80fc;
  --md-purple-A200: #e040fb;
  --md-purple-A400: #d500f9;
  --md-purple-A700: #a0f;
  --md-deep-purple-50: #ede7f6;
  --md-deep-purple-100: #d1c4e9;
  --md-deep-purple-200: #b39ddb;
  --md-deep-purple-300: #9575cd;
  --md-deep-purple-400: #7e57c2;
  --md-deep-purple-500: #673ab7;
  --md-deep-purple-600: #5e35b1;
  --md-deep-purple-700: #512da8;
  --md-deep-purple-800: #4527a0;
  --md-deep-purple-900: #311b92;
  --md-deep-purple-A100: #b388ff;
  --md-deep-purple-A200: #7c4dff;
  --md-deep-purple-A400: #651fff;
  --md-deep-purple-A700: #6200ea;
  --md-indigo-50: #e8eaf6;
  --md-indigo-100: #c5cae9;
  --md-indigo-200: #9fa8da;
  --md-indigo-300: #7986cb;
  --md-indigo-400: #5c6bc0;
  --md-indigo-500: #3f51b5;
  --md-indigo-600: #3949ab;
  --md-indigo-700: #303f9f;
  --md-indigo-800: #283593;
  --md-indigo-900: #1a237e;
  --md-indigo-A100: #8c9eff;
  --md-indigo-A200: #536dfe;
  --md-indigo-A400: #3d5afe;
  --md-indigo-A700: #304ffe;
  --md-blue-50: #e3f2fd;
  --md-blue-100: #bbdefb;
  --md-blue-200: #90caf9;
  --md-blue-300: #64b5f6;
  --md-blue-400: #42a5f5;
  --md-blue-500: #2196f3;
  --md-blue-600: #1e88e5;
  --md-blue-700: #1976d2;
  --md-blue-800: #1565c0;
  --md-blue-900: #0d47a1;
  --md-blue-A100: #82b1ff;
  --md-blue-A200: #448aff;
  --md-blue-A400: #2979ff;
  --md-blue-A700: #2962ff;
  --md-light-blue-50: #e1f5fe;
  --md-light-blue-100: #b3e5fc;
  --md-light-blue-200: #81d4fa;
  --md-light-blue-300: #4fc3f7;
  --md-light-blue-400: #29b6f6;
  --md-light-blue-500: #03a9f4;
  --md-light-blue-600: #039be5;
  --md-light-blue-700: #0288d1;
  --md-light-blue-800: #0277bd;
  --md-light-blue-900: #01579b;
  --md-light-blue-A100: #80d8ff;
  --md-light-blue-A200: #40c4ff;
  --md-light-blue-A400: #00b0ff;
  --md-light-blue-A700: #0091ea;
  --md-cyan-50: #e0f7fa;
  --md-cyan-100: #b2ebf2;
  --md-cyan-200: #80deea;
  --md-cyan-300: #4dd0e1;
  --md-cyan-400: #26c6da;
  --md-cyan-500: #00bcd4;
  --md-cyan-600: #00acc1;
  --md-cyan-700: #0097a7;
  --md-cyan-800: #00838f;
  --md-cyan-900: #006064;
  --md-cyan-A100: #84ffff;
  --md-cyan-A200: #18ffff;
  --md-cyan-A400: #00e5ff;
  --md-cyan-A700: #00b8d4;
  --md-teal-50: #e0f2f1;
  --md-teal-100: #b2dfdb;
  --md-teal-200: #80cbc4;
  --md-teal-300: #4db6ac;
  --md-teal-400: #26a69a;
  --md-teal-500: #009688;
  --md-teal-600: #00897b;
  --md-teal-700: #00796b;
  --md-teal-800: #00695c;
  --md-teal-900: #004d40;
  --md-teal-A100: #a7ffeb;
  --md-teal-A200: #64ffda;
  --md-teal-A400: #1de9b6;
  --md-teal-A700: #00bfa5;
  --md-green-50: #e8f5e9;
  --md-green-100: #c8e6c9;
  --md-green-200: #a5d6a7;
  --md-green-300: #81c784;
  --md-green-400: #66bb6a;
  --md-green-500: #4caf50;
  --md-green-600: #43a047;
  --md-green-700: #388e3c;
  --md-green-800: #2e7d32;
  --md-green-900: #1b5e20;
  --md-green-A100: #b9f6ca;
  --md-green-A200: #69f0ae;
  --md-green-A400: #00e676;
  --md-green-A700: #00c853;
  --md-light-green-50: #f1f8e9;
  --md-light-green-100: #dcedc8;
  --md-light-green-200: #c5e1a5;
  --md-light-green-300: #aed581;
  --md-light-green-400: #9ccc65;
  --md-light-green-500: #8bc34a;
  --md-light-green-600: #7cb342;
  --md-light-green-700: #689f38;
  --md-light-green-800: #558b2f;
  --md-light-green-900: #33691e;
  --md-light-green-A100: #ccff90;
  --md-light-green-A200: #b2ff59;
  --md-light-green-A400: #76ff03;
  --md-light-green-A700: #64dd17;
  --md-lime-50: #f9fbe7;
  --md-lime-100: #f0f4c3;
  --md-lime-200: #e6ee9c;
  --md-lime-300: #dce775;
  --md-lime-400: #d4e157;
  --md-lime-500: #cddc39;
  --md-lime-600: #c0ca33;
  --md-lime-700: #afb42b;
  --md-lime-800: #9e9d24;
  --md-lime-900: #827717;
  --md-lime-A100: #f4ff81;
  --md-lime-A200: #eeff41;
  --md-lime-A400: #c6ff00;
  --md-lime-A700: #aeea00;
  --md-yellow-50: #fffde7;
  --md-yellow-100: #fff9c4;
  --md-yellow-200: #fff59d;
  --md-yellow-300: #fff176;
  --md-yellow-400: #ffee58;
  --md-yellow-500: #ffeb3b;
  --md-yellow-600: #fdd835;
  --md-yellow-700: #fbc02d;
  --md-yellow-800: #f9a825;
  --md-yellow-900: #f57f17;
  --md-yellow-A100: #ffff8d;
  --md-yellow-A200: #ff0;
  --md-yellow-A400: #ffea00;
  --md-yellow-A700: #ffd600;
  --md-amber-50: #fff8e1;
  --md-amber-100: #ffecb3;
  --md-amber-200: #ffe082;
  --md-amber-300: #ffd54f;
  --md-amber-400: #ffca28;
  --md-amber-500: #ffc107;
  --md-amber-600: #ffb300;
  --md-amber-700: #ffa000;
  --md-amber-800: #ff8f00;
  --md-amber-900: #ff6f00;
  --md-amber-A100: #ffe57f;
  --md-amber-A200: #ffd740;
  --md-amber-A400: #ffc400;
  --md-amber-A700: #ffab00;
  --md-orange-50: #fff3e0;
  --md-orange-100: #ffe0b2;
  --md-orange-200: #ffcc80;
  --md-orange-300: #ffb74d;
  --md-orange-400: #ffa726;
  --md-orange-500: #ff9800;
  --md-orange-600: #fb8c00;
  --md-orange-700: #f57c00;
  --md-orange-800: #ef6c00;
  --md-orange-900: #e65100;
  --md-orange-A100: #ffd180;
  --md-orange-A200: #ffab40;
  --md-orange-A400: #ff9100;
  --md-orange-A700: #ff6d00;
  --md-deep-orange-50: #fbe9e7;
  --md-deep-orange-100: #ffccbc;
  --md-deep-orange-200: #ffab91;
  --md-deep-orange-300: #ff8a65;
  --md-deep-orange-400: #ff7043;
  --md-deep-orange-500: #ff5722;
  --md-deep-orange-600: #f4511e;
  --md-deep-orange-700: #e64a19;
  --md-deep-orange-800: #d84315;
  --md-deep-orange-900: #bf360c;
  --md-deep-orange-A100: #ff9e80;
  --md-deep-orange-A200: #ff6e40;
  --md-deep-orange-A400: #ff3d00;
  --md-deep-orange-A700: #dd2c00;
  --md-brown-50: #efebe9;
  --md-brown-100: #d7ccc8;
  --md-brown-200: #bcaaa4;
  --md-brown-300: #a1887f;
  --md-brown-400: #8d6e63;
  --md-brown-500: #795548;
  --md-brown-600: #6d4c41;
  --md-brown-700: #5d4037;
  --md-brown-800: #4e342e;
  --md-brown-900: #3e2723;
  --md-grey-50: #fafafa;
  --md-grey-100: #f5f5f5;
  --md-grey-200: #eee;
  --md-grey-300: #e0e0e0;
  --md-grey-400: #bdbdbd;
  --md-grey-500: #9e9e9e;
  --md-grey-600: #757575;
  --md-grey-700: #616161;
  --md-grey-800: #424242;
  --md-grey-900: #212121;
  --md-blue-grey-50: #eceff1;
  --md-blue-grey-100: #cfd8dc;
  --md-blue-grey-200: #b0bec5;
  --md-blue-grey-300: #90a4ae;
  --md-blue-grey-400: #78909c;
  --md-blue-grey-500: #607d8b;
  --md-blue-grey-600: #546e7a;
  --md-blue-grey-700: #455a64;
  --md-blue-grey-800: #37474f;
  --md-blue-grey-900: #263238;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/materialcolors.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;EAGE;AACF;EACE,oBAAoB;EACpB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,qBAAqB;EACrB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,yBAAyB;EACzB,yBAAyB;EACzB,yBAAyB;EACzB,sBAAsB;EACtB,4BAA4B;EAC5B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,8BAA8B;EAC9B,8BAA8B;EAC9B,8BAA8B;EAC9B,8BAA8B;EAC9B,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,yBAAyB;EACzB,yBAAyB;EACzB,yBAAyB;EACzB,yBAAyB;EACzB,qBAAqB;EACrB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,2BAA2B;EAC3B,4BAA4B;EAC5B,4BAA4B;EAC5B,4BAA4B;EAC5B,4BAA4B;EAC5B,4BAA4B;EAC5B,4BAA4B;EAC5B,4BAA4B;EAC5B,4BAA4B;EAC5B,4BAA4B;EAC5B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,qBAAqB;EACrB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,qBAAqB;EACrB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,4BAA4B;EAC5B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,8BAA8B;EAC9B,8BAA8B;EAC9B,8BAA8B;EAC9B,8BAA8B;EAC9B,qBAAqB;EACrB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,yBAAyB;EACzB,sBAAsB;EACtB,yBAAyB;EACzB,yBAAyB;EACzB,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,yBAAyB;EACzB,yBAAyB;EACzB,yBAAyB;EACzB,yBAAyB;EACzB,4BAA4B;EAC5B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,6BAA6B;EAC7B,8BAA8B;EAC9B,8BAA8B;EAC9B,8BAA8B;EAC9B,8BAA8B;EAC9B,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,qBAAqB;EACrB,sBAAsB;EACtB,mBAAmB;EACnB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB;EACtB,0BAA0B;EAC1B,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;AAC7B","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/**\n * google-material-color v1.2.6\n * https://github.com/danlevan/google-material-color\n */\n:root {\n  --md-red-50: #ffebee;\n  --md-red-100: #ffcdd2;\n  --md-red-200: #ef9a9a;\n  --md-red-300: #e57373;\n  --md-red-400: #ef5350;\n  --md-red-500: #f44336;\n  --md-red-600: #e53935;\n  --md-red-700: #d32f2f;\n  --md-red-800: #c62828;\n  --md-red-900: #b71c1c;\n  --md-red-A100: #ff8a80;\n  --md-red-A200: #ff5252;\n  --md-red-A400: #ff1744;\n  --md-red-A700: #d50000;\n  --md-pink-50: #fce4ec;\n  --md-pink-100: #f8bbd0;\n  --md-pink-200: #f48fb1;\n  --md-pink-300: #f06292;\n  --md-pink-400: #ec407a;\n  --md-pink-500: #e91e63;\n  --md-pink-600: #d81b60;\n  --md-pink-700: #c2185b;\n  --md-pink-800: #ad1457;\n  --md-pink-900: #880e4f;\n  --md-pink-A100: #ff80ab;\n  --md-pink-A200: #ff4081;\n  --md-pink-A400: #f50057;\n  --md-pink-A700: #c51162;\n  --md-purple-50: #f3e5f5;\n  --md-purple-100: #e1bee7;\n  --md-purple-200: #ce93d8;\n  --md-purple-300: #ba68c8;\n  --md-purple-400: #ab47bc;\n  --md-purple-500: #9c27b0;\n  --md-purple-600: #8e24aa;\n  --md-purple-700: #7b1fa2;\n  --md-purple-800: #6a1b9a;\n  --md-purple-900: #4a148c;\n  --md-purple-A100: #ea80fc;\n  --md-purple-A200: #e040fb;\n  --md-purple-A400: #d500f9;\n  --md-purple-A700: #a0f;\n  --md-deep-purple-50: #ede7f6;\n  --md-deep-purple-100: #d1c4e9;\n  --md-deep-purple-200: #b39ddb;\n  --md-deep-purple-300: #9575cd;\n  --md-deep-purple-400: #7e57c2;\n  --md-deep-purple-500: #673ab7;\n  --md-deep-purple-600: #5e35b1;\n  --md-deep-purple-700: #512da8;\n  --md-deep-purple-800: #4527a0;\n  --md-deep-purple-900: #311b92;\n  --md-deep-purple-A100: #b388ff;\n  --md-deep-purple-A200: #7c4dff;\n  --md-deep-purple-A400: #651fff;\n  --md-deep-purple-A700: #6200ea;\n  --md-indigo-50: #e8eaf6;\n  --md-indigo-100: #c5cae9;\n  --md-indigo-200: #9fa8da;\n  --md-indigo-300: #7986cb;\n  --md-indigo-400: #5c6bc0;\n  --md-indigo-500: #3f51b5;\n  --md-indigo-600: #3949ab;\n  --md-indigo-700: #303f9f;\n  --md-indigo-800: #283593;\n  --md-indigo-900: #1a237e;\n  --md-indigo-A100: #8c9eff;\n  --md-indigo-A200: #536dfe;\n  --md-indigo-A400: #3d5afe;\n  --md-indigo-A700: #304ffe;\n  --md-blue-50: #e3f2fd;\n  --md-blue-100: #bbdefb;\n  --md-blue-200: #90caf9;\n  --md-blue-300: #64b5f6;\n  --md-blue-400: #42a5f5;\n  --md-blue-500: #2196f3;\n  --md-blue-600: #1e88e5;\n  --md-blue-700: #1976d2;\n  --md-blue-800: #1565c0;\n  --md-blue-900: #0d47a1;\n  --md-blue-A100: #82b1ff;\n  --md-blue-A200: #448aff;\n  --md-blue-A400: #2979ff;\n  --md-blue-A700: #2962ff;\n  --md-light-blue-50: #e1f5fe;\n  --md-light-blue-100: #b3e5fc;\n  --md-light-blue-200: #81d4fa;\n  --md-light-blue-300: #4fc3f7;\n  --md-light-blue-400: #29b6f6;\n  --md-light-blue-500: #03a9f4;\n  --md-light-blue-600: #039be5;\n  --md-light-blue-700: #0288d1;\n  --md-light-blue-800: #0277bd;\n  --md-light-blue-900: #01579b;\n  --md-light-blue-A100: #80d8ff;\n  --md-light-blue-A200: #40c4ff;\n  --md-light-blue-A400: #00b0ff;\n  --md-light-blue-A700: #0091ea;\n  --md-cyan-50: #e0f7fa;\n  --md-cyan-100: #b2ebf2;\n  --md-cyan-200: #80deea;\n  --md-cyan-300: #4dd0e1;\n  --md-cyan-400: #26c6da;\n  --md-cyan-500: #00bcd4;\n  --md-cyan-600: #00acc1;\n  --md-cyan-700: #0097a7;\n  --md-cyan-800: #00838f;\n  --md-cyan-900: #006064;\n  --md-cyan-A100: #84ffff;\n  --md-cyan-A200: #18ffff;\n  --md-cyan-A400: #00e5ff;\n  --md-cyan-A700: #00b8d4;\n  --md-teal-50: #e0f2f1;\n  --md-teal-100: #b2dfdb;\n  --md-teal-200: #80cbc4;\n  --md-teal-300: #4db6ac;\n  --md-teal-400: #26a69a;\n  --md-teal-500: #009688;\n  --md-teal-600: #00897b;\n  --md-teal-700: #00796b;\n  --md-teal-800: #00695c;\n  --md-teal-900: #004d40;\n  --md-teal-A100: #a7ffeb;\n  --md-teal-A200: #64ffda;\n  --md-teal-A400: #1de9b6;\n  --md-teal-A700: #00bfa5;\n  --md-green-50: #e8f5e9;\n  --md-green-100: #c8e6c9;\n  --md-green-200: #a5d6a7;\n  --md-green-300: #81c784;\n  --md-green-400: #66bb6a;\n  --md-green-500: #4caf50;\n  --md-green-600: #43a047;\n  --md-green-700: #388e3c;\n  --md-green-800: #2e7d32;\n  --md-green-900: #1b5e20;\n  --md-green-A100: #b9f6ca;\n  --md-green-A200: #69f0ae;\n  --md-green-A400: #00e676;\n  --md-green-A700: #00c853;\n  --md-light-green-50: #f1f8e9;\n  --md-light-green-100: #dcedc8;\n  --md-light-green-200: #c5e1a5;\n  --md-light-green-300: #aed581;\n  --md-light-green-400: #9ccc65;\n  --md-light-green-500: #8bc34a;\n  --md-light-green-600: #7cb342;\n  --md-light-green-700: #689f38;\n  --md-light-green-800: #558b2f;\n  --md-light-green-900: #33691e;\n  --md-light-green-A100: #ccff90;\n  --md-light-green-A200: #b2ff59;\n  --md-light-green-A400: #76ff03;\n  --md-light-green-A700: #64dd17;\n  --md-lime-50: #f9fbe7;\n  --md-lime-100: #f0f4c3;\n  --md-lime-200: #e6ee9c;\n  --md-lime-300: #dce775;\n  --md-lime-400: #d4e157;\n  --md-lime-500: #cddc39;\n  --md-lime-600: #c0ca33;\n  --md-lime-700: #afb42b;\n  --md-lime-800: #9e9d24;\n  --md-lime-900: #827717;\n  --md-lime-A100: #f4ff81;\n  --md-lime-A200: #eeff41;\n  --md-lime-A400: #c6ff00;\n  --md-lime-A700: #aeea00;\n  --md-yellow-50: #fffde7;\n  --md-yellow-100: #fff9c4;\n  --md-yellow-200: #fff59d;\n  --md-yellow-300: #fff176;\n  --md-yellow-400: #ffee58;\n  --md-yellow-500: #ffeb3b;\n  --md-yellow-600: #fdd835;\n  --md-yellow-700: #fbc02d;\n  --md-yellow-800: #f9a825;\n  --md-yellow-900: #f57f17;\n  --md-yellow-A100: #ffff8d;\n  --md-yellow-A200: #ff0;\n  --md-yellow-A400: #ffea00;\n  --md-yellow-A700: #ffd600;\n  --md-amber-50: #fff8e1;\n  --md-amber-100: #ffecb3;\n  --md-amber-200: #ffe082;\n  --md-amber-300: #ffd54f;\n  --md-amber-400: #ffca28;\n  --md-amber-500: #ffc107;\n  --md-amber-600: #ffb300;\n  --md-amber-700: #ffa000;\n  --md-amber-800: #ff8f00;\n  --md-amber-900: #ff6f00;\n  --md-amber-A100: #ffe57f;\n  --md-amber-A200: #ffd740;\n  --md-amber-A400: #ffc400;\n  --md-amber-A700: #ffab00;\n  --md-orange-50: #fff3e0;\n  --md-orange-100: #ffe0b2;\n  --md-orange-200: #ffcc80;\n  --md-orange-300: #ffb74d;\n  --md-orange-400: #ffa726;\n  --md-orange-500: #ff9800;\n  --md-orange-600: #fb8c00;\n  --md-orange-700: #f57c00;\n  --md-orange-800: #ef6c00;\n  --md-orange-900: #e65100;\n  --md-orange-A100: #ffd180;\n  --md-orange-A200: #ffab40;\n  --md-orange-A400: #ff9100;\n  --md-orange-A700: #ff6d00;\n  --md-deep-orange-50: #fbe9e7;\n  --md-deep-orange-100: #ffccbc;\n  --md-deep-orange-200: #ffab91;\n  --md-deep-orange-300: #ff8a65;\n  --md-deep-orange-400: #ff7043;\n  --md-deep-orange-500: #ff5722;\n  --md-deep-orange-600: #f4511e;\n  --md-deep-orange-700: #e64a19;\n  --md-deep-orange-800: #d84315;\n  --md-deep-orange-900: #bf360c;\n  --md-deep-orange-A100: #ff9e80;\n  --md-deep-orange-A200: #ff6e40;\n  --md-deep-orange-A400: #ff3d00;\n  --md-deep-orange-A700: #dd2c00;\n  --md-brown-50: #efebe9;\n  --md-brown-100: #d7ccc8;\n  --md-brown-200: #bcaaa4;\n  --md-brown-300: #a1887f;\n  --md-brown-400: #8d6e63;\n  --md-brown-500: #795548;\n  --md-brown-600: #6d4c41;\n  --md-brown-700: #5d4037;\n  --md-brown-800: #4e342e;\n  --md-brown-900: #3e2723;\n  --md-grey-50: #fafafa;\n  --md-grey-100: #f5f5f5;\n  --md-grey-200: #eee;\n  --md-grey-300: #e0e0e0;\n  --md-grey-400: #bdbdbd;\n  --md-grey-500: #9e9e9e;\n  --md-grey-600: #757575;\n  --md-grey-700: #616161;\n  --md-grey-800: #424242;\n  --md-grey-900: #212121;\n  --md-blue-grey-50: #eceff1;\n  --md-blue-grey-100: #cfd8dc;\n  --md-blue-grey-200: #b0bec5;\n  --md-blue-grey-300: #90a4ae;\n  --md-blue-grey-400: #78909c;\n  --md-blue-grey-500: #607d8b;\n  --md-blue-grey-600: #546e7a;\n  --md-blue-grey-700: #455a64;\n  --md-blue-grey-800: #37474f;\n  --md-blue-grey-900: #263238;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 36972:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/* @deprecated dead code to be removed in JupyterLab 5 */
.jp-Toolbar-item.jp-Toolbar-kernelStatus {
  display: inline-block;
  width: 32px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/apputils/style/toolbar.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,wDAAwD;AACxD;EACE,qBAAqB;EACrB,WAAW;EACX,4BAA4B;EAC5B,2BAA2B;EAC3B,qBAAqB;AACvB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/* @deprecated dead code to be removed in JupyterLab 5 */\n.jp-Toolbar-item.jp-Toolbar-kernelStatus {\n  display: inline-block;\n  width: 32px;\n  background-repeat: no-repeat;\n  background-position: center;\n  background-size: 16px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 1715:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * Base styles for the audio viewer
 */

.jp-AudioViewer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.jp-AudioViewer > audio {
  width: 100%;
  object-fit: contain;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/audio-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;EAEE;;AAEF;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,sBAAsB;AACxB;;AAEA;EACE,WAAW;EACX,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/**\n * Base styles for the audio viewer\n */\n\n.jp-AudioViewer {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  width: 100%;\n  height: 100%;\n  padding: 20px;\n  box-sizing: border-box;\n}\n\n.jp-AudioViewer > audio {\n  width: 100%;\n  object-fit: contain;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 73197:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-cell-button .jp-icon3[fill] {
  fill: var(--jp-inverse-layout-color4);
}

.jp-cell-button:hover .jp-icon3[fill] {
  fill: var(--jp-inverse-layout-color2);
}

.jp-toolbar-overlap .jp-cell-toolbar {
  display: none;
}

.jp-cell-toolbar {
  display: flex;
  flex-direction: row;
  padding: 0;
  min-height: 25px;
  z-index: 6;
  position: absolute;
  right: 3px;

  /* Override .jp-Toolbar */
  background-color: transparent;
  border-bottom: inherit;
  box-shadow: none;
}

/* Overrides for mobile view hiding cell toolbar */
@media only screen and (width <= 760px) {
  .jp-cell-toolbar {
    display: none;
  }
}

.jp-cell-toolbar button.jp-ToolbarButtonComponent {
  cursor: pointer;
}

.jp-cell-toolbar .jp-ToolbarButton button {
  display: none;
}

.jp-cell-toolbar .jp-ToolbarButton .jp-cell-all,
.jp-CodeCell .jp-ToolbarButton .jp-cell-code,
.jp-MarkdownCell .jp-ToolbarButton .jp-cell-markdown,
.jp-RawCell .jp-ToolbarButton .jp-cell-raw {
  display: block;
}

.jp-cell-toolbar .jp-Toolbar-spacer {
  flex: 1 1 auto;
}

.jp-cell-mod-click {
  cursor: pointer;
}

/* Custom styling for rendered markdown cells so that cell toolbar is visible */
.jp-MarkdownOutput {
  border-width: var(--jp-border-width);
  border-color: transparent;
  border-style: solid;
}

.jp-mod-active .jp-MarkdownOutput {
  border-color: var(--jp-cell-editor-border-color);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/cell-toolbar/style/base.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,UAAU;EACV,gBAAgB;EAChB,UAAU;EACV,kBAAkB;EAClB,UAAU;;EAEV,yBAAyB;EACzB,6BAA6B;EAC7B,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA,kDAAkD;AAClD;EACE;IACE,aAAa;EACf;AACF;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,aAAa;AACf;;AAEA;;;;EAIE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,eAAe;AACjB;;AAEA,+EAA+E;AAC/E;EACE,oCAAoC;EACpC,yBAAyB;EACzB,mBAAmB;AACrB;;AAEA;EACE,gDAAgD;AAClD","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-cell-button .jp-icon3[fill] {\n  fill: var(--jp-inverse-layout-color4);\n}\n\n.jp-cell-button:hover .jp-icon3[fill] {\n  fill: var(--jp-inverse-layout-color2);\n}\n\n.jp-toolbar-overlap .jp-cell-toolbar {\n  display: none;\n}\n\n.jp-cell-toolbar {\n  display: flex;\n  flex-direction: row;\n  padding: 0;\n  min-height: 25px;\n  z-index: 6;\n  position: absolute;\n  right: 3px;\n\n  /* Override .jp-Toolbar */\n  background-color: transparent;\n  border-bottom: inherit;\n  box-shadow: none;\n}\n\n/* Overrides for mobile view hiding cell toolbar */\n@media only screen and (width <= 760px) {\n  .jp-cell-toolbar {\n    display: none;\n  }\n}\n\n.jp-cell-toolbar button.jp-ToolbarButtonComponent {\n  cursor: pointer;\n}\n\n.jp-cell-toolbar .jp-ToolbarButton button {\n  display: none;\n}\n\n.jp-cell-toolbar .jp-ToolbarButton .jp-cell-all,\n.jp-CodeCell .jp-ToolbarButton .jp-cell-code,\n.jp-MarkdownCell .jp-ToolbarButton .jp-cell-markdown,\n.jp-RawCell .jp-ToolbarButton .jp-cell-raw {\n  display: block;\n}\n\n.jp-cell-toolbar .jp-Toolbar-spacer {\n  flex: 1 1 auto;\n}\n\n.jp-cell-mod-click {\n  cursor: pointer;\n}\n\n/* Custom styling for rendered markdown cells so that cell toolbar is visible */\n.jp-MarkdownOutput {\n  border-width: var(--jp-border-width);\n  border-color: transparent;\n  border-style: solid;\n}\n\n.jp-mod-active .jp-MarkdownOutput {\n  border-color: var(--jp-cell-editor-border-color);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 81550:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_collapser_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99315);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_headerfooter_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(58776);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_inputarea_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85049);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_placeholder_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42665);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_widget_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63324);
// Imports







var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_collapser_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_headerfooter_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_inputarea_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_placeholder_css__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_widget_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/cells/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n@import './collapser.css';\n@import './headerfooter.css';\n@import './inputarea.css';\n@import './placeholder.css';\n@import './widget.css';\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 99315:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-Collapser {
  flex: 0 0 var(--jp-cell-collapser-width);
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
  border-radius: var(--jp-border-radius);
  opacity: 1;
}

.jp-Collapser-child {
  display: block;
  width: 100%;
  box-sizing: border-box;

  /* height: 100% doesn't work because the height of its parent is computed from content */
  position: absolute;
  top: 0;
  bottom: 0;
}

/*-----------------------------------------------------------------------------
| Printing
|----------------------------------------------------------------------------*/

/*
Hiding collapsers in print mode.

Note: input and output wrappers have "display: block" property in print mode.
*/

@media print {
  .jp-Collapser {
    display: none;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/cells/style/collapser.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,wCAAwC;EACxC,UAAU;EACV,SAAS;EACT,YAAY;EACZ,aAAa;EACb,uBAAuB;EACvB,sCAAsC;EACtC,UAAU;AACZ;;AAEA;EACE,cAAc;EACd,WAAW;EACX,sBAAsB;;EAEtB,wFAAwF;EACxF,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AAEA;;8EAE8E;;AAE9E;;;;CAIC;;AAED;EACE;IACE,aAAa;EACf;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Collapser {\n  flex: 0 0 var(--jp-cell-collapser-width);\n  padding: 0;\n  margin: 0;\n  border: none;\n  outline: none;\n  background: transparent;\n  border-radius: var(--jp-border-radius);\n  opacity: 1;\n}\n\n.jp-Collapser-child {\n  display: block;\n  width: 100%;\n  box-sizing: border-box;\n\n  /* height: 100% doesn't work because the height of its parent is computed from content */\n  position: absolute;\n  top: 0;\n  bottom: 0;\n}\n\n/*-----------------------------------------------------------------------------\n| Printing\n|----------------------------------------------------------------------------*/\n\n/*\nHiding collapsers in print mode.\n\nNote: input and output wrappers have \"display: block\" property in print mode.\n*/\n\n@media print {\n  .jp-Collapser {\n    display: none;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 58776:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Header/Footer
|----------------------------------------------------------------------------*/

/* Hidden by zero height by default */
.jp-CellHeader,
.jp-CellFooter {
  height: 0;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/cells/style/headerfooter.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E,qCAAqC;AACrC;;EAEE,SAAS;EACT,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,aAAa;EACb,uBAAuB;AACzB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Header/Footer\n|----------------------------------------------------------------------------*/\n\n/* Hidden by zero height by default */\n.jp-CellHeader,\n.jp-CellFooter {\n  height: 0;\n  width: 100%;\n  padding: 0;\n  margin: 0;\n  border: none;\n  outline: none;\n  background: transparent;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 85049:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Input
|----------------------------------------------------------------------------*/

/* All input areas */
.jp-InputArea {
  display: flex;
  flex-direction: row;
  width: 100%;
  overflow: hidden;
}

.jp-InputArea-editor {
  flex: 1 1 auto;
  overflow: hidden;

  /* This is the non-active, default styling */
  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);
  border-radius: 0;
  background: var(--jp-cell-editor-background);
}

.jp-InputPrompt {
  flex: 0 0 var(--jp-cell-prompt-width);
  width: var(--jp-cell-prompt-width);
  color: var(--jp-cell-inprompt-font-color);
  font-family: var(--jp-cell-prompt-font-family);
  padding: var(--jp-code-padding);
  letter-spacing: var(--jp-cell-prompt-letter-spacing);
  opacity: var(--jp-cell-prompt-opacity);
  line-height: var(--jp-code-line-height);
  font-size: var(--jp-code-font-size);
  border: var(--jp-border-width) solid transparent;

  /* Right align prompt text, don't wrap to handle large prompt numbers */
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  /* Disable text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/*-----------------------------------------------------------------------------
| Print
|----------------------------------------------------------------------------*/
@media print {
  .jp-InputArea {
    display: table;
    table-layout: fixed;
  }

  .jp-InputArea-editor {
    display: table-cell;
    vertical-align: top;
  }

  .jp-InputPrompt {
    display: table-cell;
    vertical-align: top;
  }
}

/*-----------------------------------------------------------------------------
| Mobile
|----------------------------------------------------------------------------*/
@media only screen and (width <= 760px) {
  .jp-InputArea {
    flex-direction: column;
  }

  .jp-InputArea-editor {
    margin-left: var(--jp-code-padding);
  }

  .jp-InputPrompt {
    flex: 0 0 auto;
    text-align: left;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/cells/style/inputarea.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E,oBAAoB;AACpB;EACE,aAAa;EACb,mBAAmB;EACnB,WAAW;EACX,gBAAgB;AAClB;;AAEA;EACE,cAAc;EACd,gBAAgB;;EAEhB,4CAA4C;EAC5C,uEAAuE;EACvE,gBAAgB;EAChB,4CAA4C;AAC9C;;AAEA;EACE,qCAAqC;EACrC,kCAAkC;EAClC,yCAAyC;EACzC,8CAA8C;EAC9C,+BAA+B;EAC/B,oDAAoD;EACpD,sCAAsC;EACtC,uCAAuC;EACvC,mCAAmC;EACnC,gDAAgD;;EAEhD,uEAAuE;EACvE,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;;EAEvB,2BAA2B;EAC3B,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;;8EAE8E;AAC9E;EACE;IACE,cAAc;IACd,mBAAmB;EACrB;;EAEA;IACE,mBAAmB;IACnB,mBAAmB;EACrB;;EAEA;IACE,mBAAmB;IACnB,mBAAmB;EACrB;AACF;;AAEA;;8EAE8E;AAC9E;EACE;IACE,sBAAsB;EACxB;;EAEA;IACE,mCAAmC;EACrC;;EAEA;IACE,cAAc;IACd,gBAAgB;EAClB;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Input\n|----------------------------------------------------------------------------*/\n\n/* All input areas */\n.jp-InputArea {\n  display: flex;\n  flex-direction: row;\n  width: 100%;\n  overflow: hidden;\n}\n\n.jp-InputArea-editor {\n  flex: 1 1 auto;\n  overflow: hidden;\n\n  /* This is the non-active, default styling */\n  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);\n  border-radius: 0;\n  background: var(--jp-cell-editor-background);\n}\n\n.jp-InputPrompt {\n  flex: 0 0 var(--jp-cell-prompt-width);\n  width: var(--jp-cell-prompt-width);\n  color: var(--jp-cell-inprompt-font-color);\n  font-family: var(--jp-cell-prompt-font-family);\n  padding: var(--jp-code-padding);\n  letter-spacing: var(--jp-cell-prompt-letter-spacing);\n  opacity: var(--jp-cell-prompt-opacity);\n  line-height: var(--jp-code-line-height);\n  font-size: var(--jp-code-font-size);\n  border: var(--jp-border-width) solid transparent;\n\n  /* Right align prompt text, don't wrap to handle large prompt numbers */\n  text-align: right;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n\n  /* Disable text selection */\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n/*-----------------------------------------------------------------------------\n| Print\n|----------------------------------------------------------------------------*/\n@media print {\n  .jp-InputArea {\n    display: table;\n    table-layout: fixed;\n  }\n\n  .jp-InputArea-editor {\n    display: table-cell;\n    vertical-align: top;\n  }\n\n  .jp-InputPrompt {\n    display: table-cell;\n    vertical-align: top;\n  }\n}\n\n/*-----------------------------------------------------------------------------\n| Mobile\n|----------------------------------------------------------------------------*/\n@media only screen and (width <= 760px) {\n  .jp-InputArea {\n    flex-direction: column;\n  }\n\n  .jp-InputArea-editor {\n    margin-left: var(--jp-code-padding);\n  }\n\n  .jp-InputPrompt {\n    flex: 0 0 auto;\n    text-align: left;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 42665:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Placeholder
|----------------------------------------------------------------------------*/

.jp-Placeholder {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.jp-Placeholder-prompt {
  flex: 0 0 var(--jp-cell-prompt-width);
  box-sizing: border-box;
}

.jp-Placeholder-content {
  flex: 1 1 auto;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 0;
  background: none;
  box-sizing: border-box;
  cursor: pointer;
}

.jp-Placeholder-contentContainer {
  display: flex;
}

.jp-Placeholder-content:hover,
.jp-InputPlaceholder > .jp-Placeholder-content:hover {
  border-color: var(--jp-layout-color3);
}

.jp-Placeholder-content .jp-MoreHorizIcon {
  width: 32px;
  height: 16px;
  border: 1px solid transparent;
  border-radius: var(--jp-border-radius);
}

.jp-Placeholder-content .jp-MoreHorizIcon:hover {
  border: 1px solid var(--jp-border-color1);
  box-shadow: var(--jp-toolbar-box-shadow);
  background-color: var(--jp-layout-color0);
}

.jp-PlaceholderText {
  white-space: nowrap;
  overflow-x: hidden;
  color: var(--jp-inverse-layout-color3);
  font-family: var(--jp-code-font-family);
}

.jp-InputPlaceholder > .jp-Placeholder-content {
  border-color: var(--jp-cell-editor-border-color);
  background: var(--jp-cell-editor-background);
}

/*-----------------------------------------------------------------------------
| Print
|----------------------------------------------------------------------------*/
@media print {
  .jp-Placeholder {
    display: table;
    table-layout: fixed;
  }

  .jp-Placeholder-content {
    display: table-cell;
  }

  .jp-Placeholder-prompt {
    display: table-cell;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/cells/style/placeholder.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,aAAa;EACb,mBAAmB;EACnB,WAAW;AACb;;AAEA;EACE,qCAAqC;EACrC,sBAAsB;AACxB;;AAEA;EACE,cAAc;EACd,gBAAgB;EAChB,6BAA6B;EAC7B,gBAAgB;EAChB,gBAAgB;EAChB,sBAAsB;EACtB,eAAe;AACjB;;AAEA;EACE,aAAa;AACf;;AAEA;;EAEE,qCAAqC;AACvC;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,6BAA6B;EAC7B,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;EACzC,wCAAwC;EACxC,yCAAyC;AAC3C;;AAEA;EACE,mBAAmB;EACnB,kBAAkB;EAClB,sCAAsC;EACtC,uCAAuC;AACzC;;AAEA;EACE,gDAAgD;EAChD,4CAA4C;AAC9C;;AAEA;;8EAE8E;AAC9E;EACE;IACE,cAAc;IACd,mBAAmB;EACrB;;EAEA;IACE,mBAAmB;EACrB;;EAEA;IACE,mBAAmB;EACrB;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Placeholder\n|----------------------------------------------------------------------------*/\n\n.jp-Placeholder {\n  display: flex;\n  flex-direction: row;\n  width: 100%;\n}\n\n.jp-Placeholder-prompt {\n  flex: 0 0 var(--jp-cell-prompt-width);\n  box-sizing: border-box;\n}\n\n.jp-Placeholder-content {\n  flex: 1 1 auto;\n  padding: 4px 6px;\n  border: 1px solid transparent;\n  border-radius: 0;\n  background: none;\n  box-sizing: border-box;\n  cursor: pointer;\n}\n\n.jp-Placeholder-contentContainer {\n  display: flex;\n}\n\n.jp-Placeholder-content:hover,\n.jp-InputPlaceholder > .jp-Placeholder-content:hover {\n  border-color: var(--jp-layout-color3);\n}\n\n.jp-Placeholder-content .jp-MoreHorizIcon {\n  width: 32px;\n  height: 16px;\n  border: 1px solid transparent;\n  border-radius: var(--jp-border-radius);\n}\n\n.jp-Placeholder-content .jp-MoreHorizIcon:hover {\n  border: 1px solid var(--jp-border-color1);\n  box-shadow: var(--jp-toolbar-box-shadow);\n  background-color: var(--jp-layout-color0);\n}\n\n.jp-PlaceholderText {\n  white-space: nowrap;\n  overflow-x: hidden;\n  color: var(--jp-inverse-layout-color3);\n  font-family: var(--jp-code-font-family);\n}\n\n.jp-InputPlaceholder > .jp-Placeholder-content {\n  border-color: var(--jp-cell-editor-border-color);\n  background: var(--jp-cell-editor-background);\n}\n\n/*-----------------------------------------------------------------------------\n| Print\n|----------------------------------------------------------------------------*/\n@media print {\n  .jp-Placeholder {\n    display: table;\n    table-layout: fixed;\n  }\n\n  .jp-Placeholder-content {\n    display: table-cell;\n  }\n\n  .jp-Placeholder-prompt {\n    display: table-cell;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 63324:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Private CSS variables
|----------------------------------------------------------------------------*/

:root {
  --jp-private-cell-scrolling-output-offset: 5px;
}

/*-----------------------------------------------------------------------------
| Cell
|----------------------------------------------------------------------------*/

.jp-Cell {
  padding: var(--jp-cell-padding);
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
}

/*-----------------------------------------------------------------------------
| Common input/output
|----------------------------------------------------------------------------*/

.jp-Cell-inputWrapper,
.jp-Cell-outputWrapper {
  display: flex;
  flex-direction: row;
  padding: 0;
  margin: 0;

  /* Added to reveal the box-shadow on the input and output collapsers. */
  overflow: visible;
}

/* Only input/output areas inside cells */
.jp-Cell-inputArea,
.jp-Cell-outputArea {
  flex: 1 1 auto;
}

/*-----------------------------------------------------------------------------
| Collapser
|----------------------------------------------------------------------------*/

/* Make the output collapser disappear when there is not output, but do so
 * in a manner that leaves it in the layout and preserves its width.
 */
.jp-Cell.jp-mod-noOutputs .jp-Cell-outputCollapser {
  border: none !important;
  background: transparent !important;
}

.jp-Cell:not(.jp-mod-noOutputs) .jp-Cell-outputCollapser {
  min-height: var(--jp-cell-collapser-min-height);
}

/*-----------------------------------------------------------------------------
| Output
|----------------------------------------------------------------------------*/

/* Put a space between input and output when there IS output */
.jp-Cell:not(.jp-mod-noOutputs) .jp-Cell-outputWrapper {
  margin-top: 5px;
}

.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea {
  overflow-y: auto;
  max-height: 24em;
  margin-left: var(--jp-private-cell-scrolling-output-offset);
  resize: vertical;
}

.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea[style*='height'] {
  max-height: unset;
}

.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea::after {
  content: ' ';
  box-shadow: inset 0 0 6px 2px rgb(0 0 0 / 30%);
  width: 100%;
  height: 100%;
  position: sticky;
  bottom: 0;
  top: 0;
  margin-top: -50%;
  float: left;
  display: block;
  pointer-events: none;
}

.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-child {
  padding-top: 6px;
}

.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-prompt {
  width: calc(
    var(--jp-cell-prompt-width) - var(--jp-private-cell-scrolling-output-offset)
  );
  flex: 0 0
    calc(
      var(--jp-cell-prompt-width) -
        var(--jp-private-cell-scrolling-output-offset)
    );
}

.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-promptOverlay {
  left: calc(-1 * var(--jp-private-cell-scrolling-output-offset));
}

/*-----------------------------------------------------------------------------
| CodeCell
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| MarkdownCell
|----------------------------------------------------------------------------*/

.jp-MarkdownOutput {
  flex: 1 1 auto;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: var(--jp-code-padding);
}

.jp-MarkdownOutput.jp-RenderedHTMLCommon {
  overflow: auto;
}

/* collapseHeadingButton (show always if hiddenCellsButton is _not_ shown) */
.jp-collapseHeadingButton {
  display: flex;
  min-height: var(--jp-cell-collapser-min-height);
  font-size: var(--jp-code-font-size);
  position: absolute;
  background-color: transparent;
  background-size: 25px;
  background-repeat: no-repeat;
  background-position-x: center;
  background-position-y: top;
  background-image: var(--jp-icon-caret-down);
  right: 0;
  top: 0;
  bottom: 0;
}

.jp-collapseHeadingButton.jp-mod-collapsed {
  background-image: var(--jp-icon-caret-right);
}

/*
 set the container font size to match that of content
 so that the nested collapse buttons have the right size
*/
.jp-MarkdownCell .jp-InputPrompt {
  font-size: var(--jp-content-font-size1);
}

/*
  Align collapseHeadingButton with cell top header
  The font sizes are identical to the ones in packages/rendermime/style/base.css
*/
.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='1'] {
  font-size: var(--jp-content-font-size5);
  background-position-y: calc(0.3 * var(--jp-content-font-size5));
}

.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='2'] {
  font-size: var(--jp-content-font-size4);
  background-position-y: calc(0.3 * var(--jp-content-font-size4));
}

.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='3'] {
  font-size: var(--jp-content-font-size3);
  background-position-y: calc(0.3 * var(--jp-content-font-size3));
}

.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='4'] {
  font-size: var(--jp-content-font-size2);
  background-position-y: calc(0.3 * var(--jp-content-font-size2));
}

.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='5'] {
  font-size: var(--jp-content-font-size1);
  background-position-y: top;
}

.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='6'] {
  font-size: var(--jp-content-font-size0);
  background-position-y: top;
}

/* collapseHeadingButton (show only on (hover,active) if hiddenCellsButton is shown) */
.jp-Notebook.jp-mod-showHiddenCellsButton .jp-collapseHeadingButton {
  display: none;
}

.jp-Notebook.jp-mod-showHiddenCellsButton
  :is(.jp-MarkdownCell:hover, .jp-mod-active)
  .jp-collapseHeadingButton {
  display: flex;
}

/* showHiddenCellsButton (only show if jp-mod-showHiddenCellsButton is set, which
is a consequence of the showHiddenCellsButton option in Notebook Settings)*/
.jp-Notebook.jp-mod-showHiddenCellsButton .jp-showHiddenCellsButton {
  margin-left: calc(var(--jp-cell-prompt-width) + 2 * var(--jp-code-padding));
  margin-top: var(--jp-code-padding);
  border: 1px solid var(--jp-border-color2);
  background-color: var(--jp-border-color3) !important;
  color: var(--jp-content-font-color0) !important;
  display: flex;
}

.jp-Notebook.jp-mod-showHiddenCellsButton .jp-showHiddenCellsButton:hover {
  background-color: var(--jp-border-color2) !important;
}

.jp-showHiddenCellsButton {
  display: none;
}

/*-----------------------------------------------------------------------------
| Printing
|----------------------------------------------------------------------------*/

/*
Using block instead of flex to allow the use of the break-inside CSS property for
cell outputs.
*/

@media print {
  .jp-Cell-inputWrapper,
  .jp-Cell-outputWrapper {
    display: block;
  }

  .jp-MarkdownOutput {
    display: table-cell;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/cells/style/widget.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,8CAA8C;AAChD;;AAEA;;8EAE8E;;AAE9E;EACE,+BAA+B;EAC/B,SAAS;EACT,YAAY;EACZ,aAAa;EACb,uBAAuB;AACzB;;AAEA;;8EAE8E;;AAE9E;;EAEE,aAAa;EACb,mBAAmB;EACnB,UAAU;EACV,SAAS;;EAET,uEAAuE;EACvE,iBAAiB;AACnB;;AAEA,yCAAyC;AACzC;;EAEE,cAAc;AAChB;;AAEA;;8EAE8E;;AAE9E;;EAEE;AACF;EACE,uBAAuB;EACvB,kCAAkC;AACpC;;AAEA;EACE,+CAA+C;AACjD;;AAEA;;8EAE8E;;AAE9E,8DAA8D;AAC9D;EACE,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;EAChB,2DAA2D;EAC3D,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,YAAY;EACZ,8CAA8C;EAC9C,WAAW;EACX,YAAY;EACZ,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,gBAAgB;EAChB,WAAW;EACX,cAAc;EACd,oBAAoB;AACtB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE;;GAEC;EACD;;;;KAIG;AACL;;AAEA;EACE,+DAA+D;AACjE;;AAEA;;8EAE8E;;AAE9E;;8EAE8E;;AAE9E;EACE,cAAc;EACd,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,oCAAoC;AACtC;;AAEA;EACE,cAAc;AAChB;;AAEA,4EAA4E;AAC5E;EACE,aAAa;EACb,+CAA+C;EAC/C,mCAAmC;EACnC,kBAAkB;EAClB,6BAA6B;EAC7B,qBAAqB;EACrB,4BAA4B;EAC5B,6BAA6B;EAC7B,0BAA0B;EAC1B,2CAA2C;EAC3C,QAAQ;EACR,MAAM;EACN,SAAS;AACX;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;;;CAGC;AACD;EACE,uCAAuC;AACzC;;AAEA;;;CAGC;AACD;EACE,uCAAuC;EACvC,+DAA+D;AACjE;;AAEA;EACE,uCAAuC;EACvC,+DAA+D;AACjE;;AAEA;EACE,uCAAuC;EACvC,+DAA+D;AACjE;;AAEA;EACE,uCAAuC;EACvC,+DAA+D;AACjE;;AAEA;EACE,uCAAuC;EACvC,0BAA0B;AAC5B;;AAEA;EACE,uCAAuC;EACvC,0BAA0B;AAC5B;;AAEA,sFAAsF;AACtF;EACE,aAAa;AACf;;AAEA;;;EAGE,aAAa;AACf;;AAEA;2EAC2E;AAC3E;EACE,2EAA2E;EAC3E,kCAAkC;EAClC,yCAAyC;EACzC,oDAAoD;EACpD,+CAA+C;EAC/C,aAAa;AACf;;AAEA;EACE,oDAAoD;AACtD;;AAEA;EACE,aAAa;AACf;;AAEA;;8EAE8E;;AAE9E;;;CAGC;;AAED;EACE;;IAEE,cAAc;EAChB;;EAEA;IACE,mBAAmB;EACrB;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Private CSS variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-cell-scrolling-output-offset: 5px;\n}\n\n/*-----------------------------------------------------------------------------\n| Cell\n|----------------------------------------------------------------------------*/\n\n.jp-Cell {\n  padding: var(--jp-cell-padding);\n  margin: 0;\n  border: none;\n  outline: none;\n  background: transparent;\n}\n\n/*-----------------------------------------------------------------------------\n| Common input/output\n|----------------------------------------------------------------------------*/\n\n.jp-Cell-inputWrapper,\n.jp-Cell-outputWrapper {\n  display: flex;\n  flex-direction: row;\n  padding: 0;\n  margin: 0;\n\n  /* Added to reveal the box-shadow on the input and output collapsers. */\n  overflow: visible;\n}\n\n/* Only input/output areas inside cells */\n.jp-Cell-inputArea,\n.jp-Cell-outputArea {\n  flex: 1 1 auto;\n}\n\n/*-----------------------------------------------------------------------------\n| Collapser\n|----------------------------------------------------------------------------*/\n\n/* Make the output collapser disappear when there is not output, but do so\n * in a manner that leaves it in the layout and preserves its width.\n */\n.jp-Cell.jp-mod-noOutputs .jp-Cell-outputCollapser {\n  border: none !important;\n  background: transparent !important;\n}\n\n.jp-Cell:not(.jp-mod-noOutputs) .jp-Cell-outputCollapser {\n  min-height: var(--jp-cell-collapser-min-height);\n}\n\n/*-----------------------------------------------------------------------------\n| Output\n|----------------------------------------------------------------------------*/\n\n/* Put a space between input and output when there IS output */\n.jp-Cell:not(.jp-mod-noOutputs) .jp-Cell-outputWrapper {\n  margin-top: 5px;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea {\n  overflow-y: auto;\n  max-height: 24em;\n  margin-left: var(--jp-private-cell-scrolling-output-offset);\n  resize: vertical;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea[style*='height'] {\n  max-height: unset;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea::after {\n  content: ' ';\n  box-shadow: inset 0 0 6px 2px rgb(0 0 0 / 30%);\n  width: 100%;\n  height: 100%;\n  position: sticky;\n  bottom: 0;\n  top: 0;\n  margin-top: -50%;\n  float: left;\n  display: block;\n  pointer-events: none;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-child {\n  padding-top: 6px;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-prompt {\n  width: calc(\n    var(--jp-cell-prompt-width) - var(--jp-private-cell-scrolling-output-offset)\n  );\n  flex: 0 0\n    calc(\n      var(--jp-cell-prompt-width) -\n        var(--jp-private-cell-scrolling-output-offset)\n    );\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-promptOverlay {\n  left: calc(-1 * var(--jp-private-cell-scrolling-output-offset));\n}\n\n/*-----------------------------------------------------------------------------\n| CodeCell\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| MarkdownCell\n|----------------------------------------------------------------------------*/\n\n.jp-MarkdownOutput {\n  flex: 1 1 auto;\n  width: 100%;\n  margin-top: 0;\n  margin-bottom: 0;\n  padding-left: var(--jp-code-padding);\n}\n\n.jp-MarkdownOutput.jp-RenderedHTMLCommon {\n  overflow: auto;\n}\n\n/* collapseHeadingButton (show always if hiddenCellsButton is _not_ shown) */\n.jp-collapseHeadingButton {\n  display: flex;\n  min-height: var(--jp-cell-collapser-min-height);\n  font-size: var(--jp-code-font-size);\n  position: absolute;\n  background-color: transparent;\n  background-size: 25px;\n  background-repeat: no-repeat;\n  background-position-x: center;\n  background-position-y: top;\n  background-image: var(--jp-icon-caret-down);\n  right: 0;\n  top: 0;\n  bottom: 0;\n}\n\n.jp-collapseHeadingButton.jp-mod-collapsed {\n  background-image: var(--jp-icon-caret-right);\n}\n\n/*\n set the container font size to match that of content\n so that the nested collapse buttons have the right size\n*/\n.jp-MarkdownCell .jp-InputPrompt {\n  font-size: var(--jp-content-font-size1);\n}\n\n/*\n  Align collapseHeadingButton with cell top header\n  The font sizes are identical to the ones in packages/rendermime/style/base.css\n*/\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='1'] {\n  font-size: var(--jp-content-font-size5);\n  background-position-y: calc(0.3 * var(--jp-content-font-size5));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='2'] {\n  font-size: var(--jp-content-font-size4);\n  background-position-y: calc(0.3 * var(--jp-content-font-size4));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='3'] {\n  font-size: var(--jp-content-font-size3);\n  background-position-y: calc(0.3 * var(--jp-content-font-size3));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='4'] {\n  font-size: var(--jp-content-font-size2);\n  background-position-y: calc(0.3 * var(--jp-content-font-size2));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='5'] {\n  font-size: var(--jp-content-font-size1);\n  background-position-y: top;\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='6'] {\n  font-size: var(--jp-content-font-size0);\n  background-position-y: top;\n}\n\n/* collapseHeadingButton (show only on (hover,active) if hiddenCellsButton is shown) */\n.jp-Notebook.jp-mod-showHiddenCellsButton .jp-collapseHeadingButton {\n  display: none;\n}\n\n.jp-Notebook.jp-mod-showHiddenCellsButton\n  :is(.jp-MarkdownCell:hover, .jp-mod-active)\n  .jp-collapseHeadingButton {\n  display: flex;\n}\n\n/* showHiddenCellsButton (only show if jp-mod-showHiddenCellsButton is set, which\nis a consequence of the showHiddenCellsButton option in Notebook Settings)*/\n.jp-Notebook.jp-mod-showHiddenCellsButton .jp-showHiddenCellsButton {\n  margin-left: calc(var(--jp-cell-prompt-width) + 2 * var(--jp-code-padding));\n  margin-top: var(--jp-code-padding);\n  border: 1px solid var(--jp-border-color2);\n  background-color: var(--jp-border-color3) !important;\n  color: var(--jp-content-font-color0) !important;\n  display: flex;\n}\n\n.jp-Notebook.jp-mod-showHiddenCellsButton .jp-showHiddenCellsButton:hover {\n  background-color: var(--jp-border-color2) !important;\n}\n\n.jp-showHiddenCellsButton {\n  display: none;\n}\n\n/*-----------------------------------------------------------------------------\n| Printing\n|----------------------------------------------------------------------------*/\n\n/*\nUsing block instead of flex to allow the use of the break-inside CSS property for\ncell outputs.\n*/\n\n@media print {\n  .jp-Cell-inputWrapper,\n  .jp-Cell-outputWrapper {\n    display: block;\n  }\n\n  .jp-MarkdownOutput {\n    display: table-cell;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 34188:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

:root {
  --jp-add-tag-extra-width: 8px;
}

.jp-CellTags-Tag {
  height: 20px;
  border-radius: 10px;
  margin-right: 5px;
  margin-bottom: 10px;
  padding: 0 8px;
  font-size: var(--jp-ui-font-size1);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: calc(100% - 25px);
  border: 1px solid var(--jp-border-color1);
  color: var(--jp-ui-font-color1);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.jp-CellTags-Unapplied {
  background-color: var(--jp-layout-color2);
}

.jp-CellTags-Applied {
  background-color: var(--jp-layout-color3);
}

.jp-CellTags-Add {
  white-space: nowrap;
  overflow: hidden;
  border: none;
  outline: none;
  resize: horizontal;
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color2);
}

.jp-CellTags-Holder {
  display: flex;
  justify-content: center;
  align-items: center;
}

.jp-CellTags-Empty {
  width: 4em;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/celltags-extension/style/base.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,6BAA6B;AAC/B;;AAEA;EACE,YAAY;EACZ,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,cAAc;EACd,kCAAkC;EAClC,oBAAoB;EACpB,uBAAuB;EACvB,mBAAmB;EACnB,4BAA4B;EAC5B,yCAAyC;EACzC,+BAA+B;EAC/B,2BAA2B;EAC3B,yBAAyB;EACzB,wBAAwB;EACxB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,mBAAmB;EACnB,gBAAgB;EAChB,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,kCAAkC;EAClC,+BAA+B;EAC/B,mCAAmC;AACrC;;AAEA;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,UAAU;AACZ","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n:root {\n  --jp-add-tag-extra-width: 8px;\n}\n\n.jp-CellTags-Tag {\n  height: 20px;\n  border-radius: 10px;\n  margin-right: 5px;\n  margin-bottom: 10px;\n  padding: 0 8px;\n  font-size: var(--jp-ui-font-size1);\n  display: inline-flex;\n  justify-content: center;\n  align-items: center;\n  max-width: calc(100% - 25px);\n  border: 1px solid var(--jp-border-color1);\n  color: var(--jp-ui-font-color1);\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  -khtml-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.jp-CellTags-Unapplied {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-CellTags-Applied {\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-CellTags-Add {\n  white-space: nowrap;\n  overflow: hidden;\n  border: none;\n  outline: none;\n  resize: horizontal;\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color2);\n}\n\n.jp-CellTags-Holder {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.jp-CellTags-Empty {\n  width: 4em;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 63988:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_linecol_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70139);
// Imports



var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_linecol_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-JSONEditor {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.jp-JSONEditor-host {
  flex: 1 1 auto;
  border: var(--jp-border-width) solid var(--jp-input-border-color);
  border-radius: 0;
  background: var(--jp-layout-color0);
  min-height: 50px;
  padding: 1px;
}

.jp-JSONEditor.jp-mod-error .jp-JSONEditor-host {
  border-color: red;
  outline-color: red;
}

.jp-JSONEditor-header {
  display: flex;
  flex: 1 0 auto;
  padding: 0 0 0 12px;
}

.jp-JSONEditor-header label {
  flex: 0 0 auto;
}

.jp-JSONEditor-commitButton {
  height: 16px;
  width: 16px;
  background-size: 18px;
  background-repeat: no-repeat;
  background-position: center;
}

.jp-JSONEditor-host.jp-mod-focused {
  background-color: var(--jp-input-active-background);
  border: 1px solid var(--jp-input-active-border-color);
  box-shadow: var(--jp-input-box-shadow);
}

.jp-Editor.jp-mod-dropTarget {
  border: var(--jp-border-width) solid var(--jp-input-active-border-color);
  box-shadow: var(--jp-input-box-shadow);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/codeeditor/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAG9E;EACE,aAAa;EACb,sBAAsB;EACtB,WAAW;AACb;;AAEA;EACE,cAAc;EACd,iEAAiE;EACjE,gBAAgB;EAChB,mCAAmC;EACnC,gBAAgB;EAChB,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,cAAc;EACd,mBAAmB;AACrB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,YAAY;EACZ,WAAW;EACX,qBAAqB;EACrB,4BAA4B;EAC5B,2BAA2B;AAC7B;;AAEA;EACE,mDAAmD;EACnD,qDAAqD;EACrD,sCAAsC;AACxC;;AAEA;EACE,wEAAwE;EACxE,sCAAsC;AACxC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n@import url('./linecol.css');\n\n.jp-JSONEditor {\n  display: flex;\n  flex-direction: column;\n  width: 100%;\n}\n\n.jp-JSONEditor-host {\n  flex: 1 1 auto;\n  border: var(--jp-border-width) solid var(--jp-input-border-color);\n  border-radius: 0;\n  background: var(--jp-layout-color0);\n  min-height: 50px;\n  padding: 1px;\n}\n\n.jp-JSONEditor.jp-mod-error .jp-JSONEditor-host {\n  border-color: red;\n  outline-color: red;\n}\n\n.jp-JSONEditor-header {\n  display: flex;\n  flex: 1 0 auto;\n  padding: 0 0 0 12px;\n}\n\n.jp-JSONEditor-header label {\n  flex: 0 0 auto;\n}\n\n.jp-JSONEditor-commitButton {\n  height: 16px;\n  width: 16px;\n  background-size: 18px;\n  background-repeat: no-repeat;\n  background-position: center;\n}\n\n.jp-JSONEditor-host.jp-mod-focused {\n  background-color: var(--jp-input-active-background);\n  border: 1px solid var(--jp-input-active-border-color);\n  box-shadow: var(--jp-input-box-shadow);\n}\n\n.jp-Editor.jp-mod-dropTarget {\n  border: var(--jp-border-width) solid var(--jp-input-active-border-color);\n  box-shadow: var(--jp-input-box-shadow);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 70139:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-lineFormSearch {
  padding: 4px 12px;
  background-color: var(--jp-layout-color2);
  box-shadow: var(--jp-toolbar-box-shadow);
  z-index: 2;
  font-size: var(--jp-ui-font-size1);
}

.jp-lineFormCaption {
  font-size: var(--jp-ui-font-size0);
  line-height: var(--jp-ui-font-size1);
  margin-top: 4px;
  color: var(--jp-ui-font-color0);
}

.jp-baseLineForm {
  border: none;
  border-top-right-radius: var(--jp-border-radius);
  border-bottom-right-radius: var(--jp-border-radius);
  position: absolute;
  background-size: 16px;
  background-repeat: no-repeat;
  background-position: center;
  outline: none;
}

.jp-lineFormButtonContainer {
  top: 4px;
  right: 8px;
  height: 24px;
  padding: 0 12px;
  width: 12px;
}

.jp-lineFormButtonIcon {
  top: 0;
  right: 0;
  background-color: var(--jp-brand-color1);
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
}

.jp-lineFormButton {
  top: 0;
  right: 0;
  background-color: transparent;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.jp-lineFormWrapper {
  overflow: hidden;
  padding: 0 8px;
  border: 1px solid var(--jp-border-color0);
  border-top-left-radius: var(--jp-border-radius);
  border-bottom-left-radius: var(--jp-border-radius);
  background-color: var(--jp-input-active-background);
  height: 22px;
}

.jp-lineFormWrapperFocusWithin {
  border: var(--jp-border-width) solid var(--jp-input-active-border-color);
  box-shadow: var(--jp-input-box-shadow);
}

.jp-lineFormInput {
  background: transparent;
  width: 200px;
  height: 100%;
  border: none;
  outline: none;
  color: var(--jp-ui-font-color0);
  padding: 0;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/codeeditor/style/linecol.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,iBAAiB;EACjB,yCAAyC;EACzC,wCAAwC;EACxC,UAAU;EACV,kCAAkC;AACpC;;AAEA;EACE,kCAAkC;EAClC,oCAAoC;EACpC,eAAe;EACf,+BAA+B;AACjC;;AAEA;EACE,YAAY;EACZ,gDAAgD;EAChD,mDAAmD;EACnD,kBAAkB;EAClB,qBAAqB;EACrB,4BAA4B;EAC5B,2BAA2B;EAC3B,aAAa;AACf;;AAEA;EACE,QAAQ;EACR,UAAU;EACV,YAAY;EACZ,eAAe;EACf,WAAW;AACb;;AAEA;EACE,MAAM;EACN,QAAQ;EACR,wCAAwC;EACxC,YAAY;EACZ,WAAW;EACX,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,MAAM;EACN,QAAQ;EACR,6BAA6B;EAC7B,YAAY;EACZ,WAAW;EACX,sBAAsB;AACxB;;AAEA;EACE,gBAAgB;EAChB,cAAc;EACd,yCAAyC;EACzC,+CAA+C;EAC/C,kDAAkD;EAClD,mDAAmD;EACnD,YAAY;AACd;;AAEA;EACE,wEAAwE;EACxE,sCAAsC;AACxC;;AAEA;EACE,uBAAuB;EACvB,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,+BAA+B;EAC/B,UAAU;AACZ","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-lineFormSearch {\n  padding: 4px 12px;\n  background-color: var(--jp-layout-color2);\n  box-shadow: var(--jp-toolbar-box-shadow);\n  z-index: 2;\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-lineFormCaption {\n  font-size: var(--jp-ui-font-size0);\n  line-height: var(--jp-ui-font-size1);\n  margin-top: 4px;\n  color: var(--jp-ui-font-color0);\n}\n\n.jp-baseLineForm {\n  border: none;\n  border-top-right-radius: var(--jp-border-radius);\n  border-bottom-right-radius: var(--jp-border-radius);\n  position: absolute;\n  background-size: 16px;\n  background-repeat: no-repeat;\n  background-position: center;\n  outline: none;\n}\n\n.jp-lineFormButtonContainer {\n  top: 4px;\n  right: 8px;\n  height: 24px;\n  padding: 0 12px;\n  width: 12px;\n}\n\n.jp-lineFormButtonIcon {\n  top: 0;\n  right: 0;\n  background-color: var(--jp-brand-color1);\n  height: 100%;\n  width: 100%;\n  box-sizing: border-box;\n  padding: 4px 6px;\n}\n\n.jp-lineFormButton {\n  top: 0;\n  right: 0;\n  background-color: transparent;\n  height: 100%;\n  width: 100%;\n  box-sizing: border-box;\n}\n\n.jp-lineFormWrapper {\n  overflow: hidden;\n  padding: 0 8px;\n  border: 1px solid var(--jp-border-color0);\n  border-top-left-radius: var(--jp-border-radius);\n  border-bottom-left-radius: var(--jp-border-radius);\n  background-color: var(--jp-input-active-background);\n  height: 22px;\n}\n\n.jp-lineFormWrapperFocusWithin {\n  border: var(--jp-border-width) solid var(--jp-input-active-border-color);\n  box-shadow: var(--jp-input-box-shadow);\n}\n\n.jp-lineFormInput {\n  background: transparent;\n  width: 200px;\n  height: 100%;\n  border: none;\n  outline: none;\n  color: var(--jp-ui-font-color0);\n  padding: 0;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 3492:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(878);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__);
// Imports



var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(7413), __webpack_require__.b);
var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
var ___CSS_LOADER_URL_REPLACEMENT_0___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.cm-editor {
  line-height: var(--jp-code-line-height);
  font-size: var(--jp-code-font-size);
  font-family: var(--jp-code-font-family);
  border: 0;
  border-radius: 0;
  height: auto;

  /* Changed to auto to autogrow */
}

/* Suppress automatic focus indicator outline */
.cm-editor.cm-focused {
  outline: unset;
}

.cm-editor pre {
  padding: 0 var(--jp-code-padding);
}

.jp-CodeMirrorEditor[data-type='inline'] .cm-dialog {
  background-color: var(--jp-layout-color0);
  color: var(--jp-content-font-color1);
}

.jp-CodeMirrorEditor {
  cursor: text;
}

/* When zoomed out 67% and 33% on a screen of 1440 width x 900 height */
@media screen and (width >= 2138px) and (width <= 4319px) {
  .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {
    border-left: var(--jp-code-cursor-width1) solid
      var(--jp-editor-cursor-color);
  }
}

/* When zoomed out less than 33% */
@media screen and (width >= 4320px) {
  .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {
    border-left: var(--jp-code-cursor-width2) solid
      var(--jp-editor-cursor-color);
  }
}

/* stylelint-disable selector-max-class */

/* We need all this classes for higher specificity to override CodeMirror's rule */
.cm-editor.jp-mod-readOnly > .cm-scroller > .cm-cursorLayer .cm-cursor {
  display: none;
}

/* stylelint-enable selector-max-class */

.jp-CollaboratorCursor {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: none;
  border-bottom: 3px solid;
  background-clip: content-box;
  margin-left: -5px;
  margin-right: -5px;
}

.cm-builtin {
  color: var(--jp-mirror-editor-builtin-color);
}

.cm-searching,
.cm-searching span {
  /* \`.cm-searching span\`: we need to override syntax highlighting */
  background-color: var(--jp-search-unselected-match-background-color);
  color: var(--jp-search-unselected-match-color);
}

.cm-searching::selection,
.cm-searching span::selection {
  background-color: var(--jp-search-unselected-match-background-color);
  color: var(--jp-search-unselected-match-color);
}

.jp-current-match.cm-searching,
.jp-current-match > .cm-searching,
.jp-current-match > .cm-searching span,
.cm-searching > .jp-current-match,
.cm-searching > .jp-current-match span {
  background-color: var(--jp-search-selected-match-background-color);
  color: var(--jp-search-selected-match-color);
}

.jp-current-match > .cm-searching::selection,
.jp-current-match > .cm-searching span::selection,
.cm-searching > .jp-current-match::selection,
.cm-searching > .jp-current-match span::selection {
  background-color: var(--jp-search-selected-match-background-color);
  color: var(--jp-search-selected-match-color);
}

.cm-trailingspace {
  background-image: url(${___CSS_LOADER_URL_REPLACEMENT_0___});
  background-position: center left;
  background-repeat: repeat-x;
}

.jp-CollaboratorCursor-hover {
  position: absolute;
  z-index: 1;
  transform: translateX(-50%);
  color: white;
  border-radius: 3px;
  padding-left: 4px;
  padding-right: 4px;
  padding-top: 1px;
  padding-bottom: 1px;
  text-align: center;
  font-size: var(--jp-ui-font-size1);
  white-space: nowrap;
}

.jp-CodeMirror-ruler {
  border-left: 1px dashed var(--jp-border-color2);
}

/* Styles for shared cursors (remote cursor locations and selected ranges) */
.jp-CodeMirrorEditor .cm-ySelectionCaret {
  position: relative;
  border-left: 1px solid black;
  margin-left: -1px;
  margin-right: -1px;
  box-sizing: border-box;
}

.jp-CodeMirrorEditor .cm-ySelectionCaret > .cm-ySelectionInfo {
  white-space: nowrap;
  position: absolute;
  top: -1.15em;
  padding-bottom: 0.05em;
  left: -1px;
  font-size: 0.95em;
  font-family: var(--jp-ui-font-family);
  font-weight: bold;
  line-height: normal;
  user-select: none;
  color: white;
  padding-left: 2px;
  padding-right: 2px;
  z-index: 101;
  transition: opacity 0.3s ease-in-out;
}

.jp-CodeMirrorEditor .cm-ySelectionInfo {
  transition-delay: 0.7s;
  opacity: 0;
}

.jp-CodeMirrorEditor .cm-ySelectionCaret:hover > .cm-ySelectionInfo {
  opacity: 1;
  transition-delay: 0s;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/codemirror/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,uCAAuC;EACvC,mCAAmC;EACnC,uCAAuC;EACvC,SAAS;EACT,gBAAgB;EAChB,YAAY;;EAEZ,gCAAgC;AAClC;;AAEA,+CAA+C;AAC/C;EACE,cAAc;AAChB;;AAEA;EACE,iCAAiC;AACnC;;AAEA;EACE,yCAAyC;EACzC,oCAAoC;AACtC;;AAEA;EACE,YAAY;AACd;;AAEA,uEAAuE;AACvE;EACE;IACE;mCAC+B;EACjC;AACF;;AAEA,kCAAkC;AAClC;EACE;IACE;mCAC+B;EACjC;AACF;;AAEA,yCAAyC;;AAEzC,kFAAkF;AAClF;EACE,aAAa;AACf;;AAEA,wCAAwC;;AAExC;EACE,kCAAkC;EAClC,mCAAmC;EACnC,gBAAgB;EAChB,wBAAwB;EACxB,4BAA4B;EAC5B,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;;EAEE,kEAAkE;EAClE,oEAAoE;EACpE,8CAA8C;AAChD;;AAEA;;EAEE,oEAAoE;EACpE,8CAA8C;AAChD;;AAEA;;;;;EAKE,kEAAkE;EAClE,4CAA4C;AAC9C;;AAEA;;;;EAIE,kEAAkE;EAClE,4CAA4C;AAC9C;;AAEA;EACE,yDAAqW;EACrW,gCAAgC;EAChC,2BAA2B;AAC7B;;AAEA;EACE,kBAAkB;EAClB,UAAU;EACV,2BAA2B;EAC3B,YAAY;EACZ,kBAAkB;EAClB,iBAAiB;EACjB,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,kBAAkB;EAClB,kCAAkC;EAClC,mBAAmB;AACrB;;AAEA;EACE,+CAA+C;AACjD;;AAEA,4EAA4E;AAC5E;EACE,kBAAkB;EAClB,4BAA4B;EAC5B,iBAAiB;EACjB,kBAAkB;EAClB,sBAAsB;AACxB;;AAEA;EACE,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;EACZ,sBAAsB;EACtB,UAAU;EACV,iBAAiB;EACjB,qCAAqC;EACrC,iBAAiB;EACjB,mBAAmB;EACnB,iBAAiB;EACjB,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,YAAY;EACZ,oCAAoC;AACtC;;AAEA;EACE,sBAAsB;EACtB,UAAU;AACZ;;AAEA;EACE,UAAU;EACV,oBAAoB;AACtB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.cm-editor {\n  line-height: var(--jp-code-line-height);\n  font-size: var(--jp-code-font-size);\n  font-family: var(--jp-code-font-family);\n  border: 0;\n  border-radius: 0;\n  height: auto;\n\n  /* Changed to auto to autogrow */\n}\n\n/* Suppress automatic focus indicator outline */\n.cm-editor.cm-focused {\n  outline: unset;\n}\n\n.cm-editor pre {\n  padding: 0 var(--jp-code-padding);\n}\n\n.jp-CodeMirrorEditor[data-type='inline'] .cm-dialog {\n  background-color: var(--jp-layout-color0);\n  color: var(--jp-content-font-color1);\n}\n\n.jp-CodeMirrorEditor {\n  cursor: text;\n}\n\n/* When zoomed out 67% and 33% on a screen of 1440 width x 900 height */\n@media screen and (width >= 2138px) and (width <= 4319px) {\n  .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {\n    border-left: var(--jp-code-cursor-width1) solid\n      var(--jp-editor-cursor-color);\n  }\n}\n\n/* When zoomed out less than 33% */\n@media screen and (width >= 4320px) {\n  .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {\n    border-left: var(--jp-code-cursor-width2) solid\n      var(--jp-editor-cursor-color);\n  }\n}\n\n/* stylelint-disable selector-max-class */\n\n/* We need all this classes for higher specificity to override CodeMirror's rule */\n.cm-editor.jp-mod-readOnly > .cm-scroller > .cm-cursorLayer .cm-cursor {\n  display: none;\n}\n\n/* stylelint-enable selector-max-class */\n\n.jp-CollaboratorCursor {\n  border-left: 5px solid transparent;\n  border-right: 5px solid transparent;\n  border-top: none;\n  border-bottom: 3px solid;\n  background-clip: content-box;\n  margin-left: -5px;\n  margin-right: -5px;\n}\n\n.cm-builtin {\n  color: var(--jp-mirror-editor-builtin-color);\n}\n\n.cm-searching,\n.cm-searching span {\n  /* `.cm-searching span`: we need to override syntax highlighting */\n  background-color: var(--jp-search-unselected-match-background-color);\n  color: var(--jp-search-unselected-match-color);\n}\n\n.cm-searching::selection,\n.cm-searching span::selection {\n  background-color: var(--jp-search-unselected-match-background-color);\n  color: var(--jp-search-unselected-match-color);\n}\n\n.jp-current-match.cm-searching,\n.jp-current-match > .cm-searching,\n.jp-current-match > .cm-searching span,\n.cm-searching > .jp-current-match,\n.cm-searching > .jp-current-match span {\n  background-color: var(--jp-search-selected-match-background-color);\n  color: var(--jp-search-selected-match-color);\n}\n\n.jp-current-match > .cm-searching::selection,\n.jp-current-match > .cm-searching span::selection,\n.cm-searching > .jp-current-match::selection,\n.cm-searching > .jp-current-match span::selection {\n  background-color: var(--jp-search-selected-match-background-color);\n  color: var(--jp-search-selected-match-color);\n}\n\n.cm-trailingspace {\n  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAsElEQVQIHQGlAFr/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7+r3zKmT0/+pk9P/7+r3zAAAAAAAAAAABAAAAAAAAAAA6OPzM+/q9wAAAAAA6OPzMwAAAAAAAAAAAgAAAAAAAAAAGR8NiRQaCgAZIA0AGR8NiQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQyoYJ/SY80UAAAAASUVORK5CYII=);\n  background-position: center left;\n  background-repeat: repeat-x;\n}\n\n.jp-CollaboratorCursor-hover {\n  position: absolute;\n  z-index: 1;\n  transform: translateX(-50%);\n  color: white;\n  border-radius: 3px;\n  padding-left: 4px;\n  padding-right: 4px;\n  padding-top: 1px;\n  padding-bottom: 1px;\n  text-align: center;\n  font-size: var(--jp-ui-font-size1);\n  white-space: nowrap;\n}\n\n.jp-CodeMirror-ruler {\n  border-left: 1px dashed var(--jp-border-color2);\n}\n\n/* Styles for shared cursors (remote cursor locations and selected ranges) */\n.jp-CodeMirrorEditor .cm-ySelectionCaret {\n  position: relative;\n  border-left: 1px solid black;\n  margin-left: -1px;\n  margin-right: -1px;\n  box-sizing: border-box;\n}\n\n.jp-CodeMirrorEditor .cm-ySelectionCaret > .cm-ySelectionInfo {\n  white-space: nowrap;\n  position: absolute;\n  top: -1.15em;\n  padding-bottom: 0.05em;\n  left: -1px;\n  font-size: 0.95em;\n  font-family: var(--jp-ui-font-family);\n  font-weight: bold;\n  line-height: normal;\n  user-select: none;\n  color: white;\n  padding-left: 2px;\n  padding-right: 2px;\n  z-index: 101;\n  transition: opacity 0.3s ease-in-out;\n}\n\n.jp-CodeMirrorEditor .cm-ySelectionInfo {\n  transition-delay: 0.7s;\n  opacity: 0;\n}\n\n.jp-CodeMirrorEditor .cm-ySelectionCaret:hover > .cm-ySelectionInfo {\n  opacity: 1;\n  transition-delay: 0s;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 60533:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

:root {
  --jp-private-completer-item-height: 24px;

  /* Shift the baseline of the type character to align with the match text */
  --jp-private-completer-type-offset: 2px;
}

.jp-Completer {
  box-shadow: var(--jp-elevation-z6);
  background: var(--jp-layout-color1);
  color: var(--jp-content-font-color1);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  padding: 0;
  display: flex;
  flex-direction: row;

  /* Needed to avoid scrollbar issues when using cached width. */
  box-sizing: content-box;

  /* Position the completer relative to the text editor, align the '.' */
  margin: 4px 0 0 -30px;
  z-index: 10001;
}

.jp-Completer-docpanel {
  border-left: var(--jp-border-width) solid var(--jp-border-color1);
  width: 400px;
  flex-shrink: 0;
  overflow-y: scroll;
  overflow-x: auto;
  padding: 8px;
  max-height: calc((10 * var(--jp-private-completer-item-height)) - 16px);
}

.jp-Completer-docpanel pre {
  border: none;
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
}

.jp-Completer-list {
  margin: 0;
  padding: 0;
  list-style-type: none;
  overflow-y: scroll;
  overflow-x: hidden;
  max-height: calc((10 * var(--jp-private-completer-item-height)));
  min-height: calc(var(--jp-private-completer-item-height));
  width: 100%;
}

.jp-Completer-item {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  height: var(--jp-private-completer-item-height);
  min-width: 150px;
  display: grid;
  grid-template-columns: min-content 1fr min-content;
  position: relative;
}

.jp-Completer-item .jp-Completer-match {
  box-sizing: border-box;
  margin: 0;
  padding: 0 8px 0 6px;
  height: var(--jp-private-completer-item-height);
  font-family: var(--jp-code-font-family);
  font-size: var(--jp-code-font-size);
  line-height: var(--jp-private-completer-item-height);
  white-space: nowrap;
}

.jp-Completer-deprecated .jp-Completer-match {
  text-decoration: line-through;
  color: var(--jp-content-font-color2);
}

.jp-Completer-item .jp-Completer-type {
  box-sizing: border-box;
  height: var(--jp-private-completer-item-height);
  background: transparent;
  width: var(--jp-private-completer-item-height);
}

.jp-Completer-item .jp-Completer-icon {
  /* Normal element size from LabIconStyle.ISheetOptions */
  height: 16px;
  width: 16px;
}

.jp-Completer-item .jp-Completer-monogram {
  text-align: center;
  color: white;
  width: var(--jp-private-completer-item-height);
  font-family: var(--jp-ui-font-family);
  font-size: var(--jp-ui-font-size1);
  line-height: calc(
    var(--jp-private-completer-item-height) -
      var(--jp-private-completer-type-offset)
  );
  padding-bottom: var(--jp-private-completer-type-offset);
}

.jp-Completer-item .jp-Completer-typeExtended {
  box-sizing: border-box;
  height: var(--jp-private-completer-item-height);
  text-align: right;
  background: transparent;
  color: var(--jp-ui-font-color2);
  font-family: var(--jp-code-font-family);
  font-size: var(--jp-code-font-size);
  line-height: var(--jp-private-completer-item-height);
  padding-right: 8px;
}

.jp-Completer-item:hover {
  background: var(--jp-layout-color2);
  opacity: 0.8;
}

.jp-Completer-item.jp-mod-active {
  background: var(--jp-brand-color1);
  color: white;
}

.jp-Completer-item .jp-Completer-match mark {
  font-weight: bold;
  background: inherit;
  color: inherit;
}

.jp-Completer-type[data-color-index='0'] {
  background: var(--jp-completer-type-background0, transparent);
}

.jp-Completer-type[data-color-index='1'] {
  background: var(--jp-completer-type-background1, #1f77b4);
}

.jp-Completer-type[data-color-index='2'] {
  background: var(--jp-completer-type-background2, #ff7f0e);
}

.jp-Completer-type[data-color-index='3'] {
  background: var(--jp-completer-type-background3, #2ca02c);
}

.jp-Completer-type[data-color-index='4'] {
  background: var(--jp-completer-type-background4, #d62728);
}

.jp-Completer-type[data-color-index='5'] {
  background: var(--jp-completer-type-background5, #9467bd);
}

.jp-Completer-type[data-color-index='6'] {
  background: var(--jp-completer-type-background6, #8c564b);
}

.jp-Completer-type[data-color-index='7'] {
  background: var(--jp-completer-type-background7, #e377c2);
}

.jp-Completer-type[data-color-index='8'] {
  background: var(--jp-completer-type-background8, #7f7f7f);
}

.jp-Completer-type[data-color-index='9'] {
  background: var(--jp-completer-type-background9, #bcbd22);
}

.jp-Completer-type[data-color-index='10'] {
  background: var(--jp-completer-type-background10, #17becf);
}

.jp-Completer-loading-bar-container {
  height: 2px;
  width: calc(100% - var(--jp-private-completer-item-height));
  left: var(--jp-private-completer-item-height);
  position: absolute;
  overflow: hidden;
  top: 0;
}

.jp-Completer-loading-bar {
  height: 100%;
  width: 50%;
  background-color: var(--jp-accent-color2);
  position: absolute;
  left: -50%;
  animation: jp-Completer-loading 2s ease-in 0.5s infinite;
}

@keyframes jp-Completer-loading {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(400%);
  }
}

.jp-GhostText {
  color: var(--jp-ui-font-color3);
  white-space: pre-wrap;
}

.jp-GhostText-lineSpacer,
.jp-GhostText-letterSpacer {
  opacity: 0;
  display: inline-block;
  vertical-align: top;
  /* stylelint-disable-next-line csstree/validator */
  text-wrap: none;
}

.jp-GhostText-letterSpacer {
  max-width: 0;
}

.jp-GhostText-lineSpacer {
  /* duration and delay are overwritten by inline styles */
  animation: jp-GhostText-hide 300ms 700ms ease-out forwards;
}

@keyframes jp-GhostText-hide {
  0% {
    font-size: unset;
  }

  100% {
    font-size: 0;
  }
}

.jp-GhostText-expandHidden {
  border: 1px solid var(--jp-border-color0);
  border-radius: var(--jp-border-radius);
  background: var(--jp-layout-color0);
  color: var(--jp-content-font-color3);
  padding: 0 4px;
  margin: 0 4px;
  cursor: default;
}

.jp-GhostText-hiddenWrapper:hover > .jp-GhostText-hiddenLines {
  display: inline;
}

.jp-GhostText-hiddenLines {
  display: none;
}

.jp-GhostText[data-animation='uncover'] {
  position: relative;
}

.jp-GhostText-streamedToken {
  white-space: pre;
}

.jp-GhostText[data-animation='uncover'] > .jp-GhostText-streamedToken {
  animation: jp-GhostText-typing 2s forwards;
  display: inline-flex;
  overflow: hidden;
}

@keyframes jp-GhostText-typing {
  from {
    max-width: 0;
  }

  to {
    max-width: 100%;
  }
}

.jp-GhostText-streamingIndicator::after {
  animation: jp-GhostText-streaming 2s infinite;
  animation-delay: 400ms;
  content: ' ';
  background: var(--jp-layout-color4);
  opacity: 0.2;
}

@keyframes jp-GhostText-streaming {
  0% {
    opacity: 0.2;
  }

  20% {
    opacity: 0.4;
  }

  40% {
    opacity: 0.2;
  }
}

.jp-GhostText-errorIndicator::after {
  animation: jp-GhostText-error 500ms 1;
  animation-delay: 3500ms;
  color: var(--jp-error-color1);
  font-size: 150%;
  line-height: 10px;
  margin-left: 2px;
  padding: 0 4px;
  content: '⚠';
  cursor: help;
  position: relative;
  top: 2px;
}

@keyframes jp-GhostText-error {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.jp-InlineCompleter {
  box-shadow: var(--jp-elevation-z2);
  background: var(--jp-layout-color1);
  color: var(--jp-content-font-color1);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 8px;
}

.jp-InlineCompleter-progressBar {
  height: 2px;
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--jp-accent-color2);
}

.jp-InlineCompleter[data-display='onHover'] {
  opacity: 0;
  transition:
    visibility 0s linear 0.1s,
    opacity 0.1s linear;
  visibility: hidden;
}

.jp-InlineCompleter[data-display='onHover']:hover,
.jp-InlineCompleter-hover[data-display='onHover'] {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.jp-InlineCompleter[data-display='never'] {
  display: none;
}

.jp-InlineCompleter > .jp-Toolbar {
  box-shadow: none;
  border-bottom: none;
  background: none;
}

.jp-InlineCompleter[data-show-shortcuts='false']
  .jp-ToolbarButtonComponent-label {
  display: none;
}

.jp-InlineCompleter [data-command='inline-completer:next'] > svg,
.jp-InlineCompleter [data-command='inline-completer:previous'] > svg {
  scale: 1.5;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/completer/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,wCAAwC;;EAExC,0EAA0E;EAC1E,uCAAuC;AACzC;;AAEA;EACE,kCAAkC;EAClC,mCAAmC;EACnC,oCAAoC;EACpC,4DAA4D;EAC5D,UAAU;EACV,aAAa;EACb,mBAAmB;;EAEnB,8DAA8D;EAC9D,uBAAuB;;EAEvB,sEAAsE;EACtE,qBAAqB;EACrB,cAAc;AAChB;;AAEA;EACE,iEAAiE;EACjE,YAAY;EACZ,cAAc;EACd,kBAAkB;EAClB,gBAAgB;EAChB,YAAY;EACZ,uEAAuE;AACzE;;AAEA;EACE,YAAY;EACZ,SAAS;EACT,UAAU;EACV,qBAAqB;AACvB;;AAEA;EACE,SAAS;EACT,UAAU;EACV,qBAAqB;EACrB,kBAAkB;EAClB,kBAAkB;EAClB,gEAAgE;EAChE,yDAAyD;EACzD,WAAW;AACb;;AAEA;EACE,sBAAsB;EACtB,SAAS;EACT,UAAU;EACV,+CAA+C;EAC/C,gBAAgB;EAChB,aAAa;EACb,kDAAkD;EAClD,kBAAkB;AACpB;;AAEA;EACE,sBAAsB;EACtB,SAAS;EACT,oBAAoB;EACpB,+CAA+C;EAC/C,uCAAuC;EACvC,mCAAmC;EACnC,oDAAoD;EACpD,mBAAmB;AACrB;;AAEA;EACE,6BAA6B;EAC7B,oCAAoC;AACtC;;AAEA;EACE,sBAAsB;EACtB,+CAA+C;EAC/C,uBAAuB;EACvB,8CAA8C;AAChD;;AAEA;EACE,wDAAwD;EACxD,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,YAAY;EACZ,8CAA8C;EAC9C,qCAAqC;EACrC,kCAAkC;EAClC;;;GAGC;EACD,uDAAuD;AACzD;;AAEA;EACE,sBAAsB;EACtB,+CAA+C;EAC/C,iBAAiB;EACjB,uBAAuB;EACvB,+BAA+B;EAC/B,uCAAuC;EACvC,mCAAmC;EACnC,oDAAoD;EACpD,kBAAkB;AACpB;;AAEA;EACE,mCAAmC;EACnC,YAAY;AACd;;AAEA;EACE,kCAAkC;EAClC,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,mBAAmB;EACnB,cAAc;AAChB;;AAEA;EACE,6DAA6D;AAC/D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,0DAA0D;AAC5D;;AAEA;EACE,WAAW;EACX,2DAA2D;EAC3D,6CAA6C;EAC7C,kBAAkB;EAClB,gBAAgB;EAChB,MAAM;AACR;;AAEA;EACE,YAAY;EACZ,UAAU;EACV,yCAAyC;EACzC,kBAAkB;EAClB,UAAU;EACV,wDAAwD;AAC1D;;AAEA;EACE;IACE,wBAAwB;EAC1B;;EAEA;IACE,2BAA2B;EAC7B;AACF;;AAEA;EACE,+BAA+B;EAC/B,qBAAqB;AACvB;;AAEA;;EAEE,UAAU;EACV,qBAAqB;EACrB,mBAAmB;EACnB,kDAAkD;EAClD,eAAe;AACjB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,wDAAwD;EACxD,0DAA0D;AAC5D;;AAEA;EACE;IACE,gBAAgB;EAClB;;EAEA;IACE,YAAY;EACd;AACF;;AAEA;EACE,yCAAyC;EACzC,sCAAsC;EACtC,mCAAmC;EACnC,oCAAoC;EACpC,cAAc;EACd,aAAa;EACb,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,0CAA0C;EAC1C,oBAAoB;EACpB,gBAAgB;AAClB;;AAEA;EACE;IACE,YAAY;EACd;;EAEA;IACE,eAAe;EACjB;AACF;;AAEA;EACE,6CAA6C;EAC7C,sBAAsB;EACtB,YAAY;EACZ,mCAAmC;EACnC,YAAY;AACd;;AAEA;EACE;IACE,YAAY;EACd;;EAEA;IACE,YAAY;EACd;;EAEA;IACE,YAAY;EACd;AACF;;AAEA;EACE,qCAAqC;EACrC,uBAAuB;EACvB,6BAA6B;EAC7B,eAAe;EACf,iBAAiB;EACjB,gBAAgB;EAChB,cAAc;EACd,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,QAAQ;AACV;;AAEA;EACE;IACE,UAAU;EACZ;;EAEA;IACE,UAAU;EACZ;AACF;;AAEA;EACE,kCAAkC;EAClC,mCAAmC;EACnC,oCAAoC;EACpC,4DAA4D;EAC5D,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,cAAc;AAChB;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,yCAAyC;AAC3C;;AAEA;EACE,UAAU;EACV;;uBAEqB;EACrB,kBAAkB;AACpB;;AAEA;;EAEE,UAAU;EACV,mBAAmB;EACnB,oBAAoB;AACtB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;;EAEE,aAAa;AACf;;AAEA;;EAEE,UAAU;AACZ","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-completer-item-height: 24px;\n\n  /* Shift the baseline of the type character to align with the match text */\n  --jp-private-completer-type-offset: 2px;\n}\n\n.jp-Completer {\n  box-shadow: var(--jp-elevation-z6);\n  background: var(--jp-layout-color1);\n  color: var(--jp-content-font-color1);\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  padding: 0;\n  display: flex;\n  flex-direction: row;\n\n  /* Needed to avoid scrollbar issues when using cached width. */\n  box-sizing: content-box;\n\n  /* Position the completer relative to the text editor, align the '.' */\n  margin: 4px 0 0 -30px;\n  z-index: 10001;\n}\n\n.jp-Completer-docpanel {\n  border-left: var(--jp-border-width) solid var(--jp-border-color1);\n  width: 400px;\n  flex-shrink: 0;\n  overflow-y: scroll;\n  overflow-x: auto;\n  padding: 8px;\n  max-height: calc((10 * var(--jp-private-completer-item-height)) - 16px);\n}\n\n.jp-Completer-docpanel pre {\n  border: none;\n  margin: 0;\n  padding: 0;\n  white-space: pre-wrap;\n}\n\n.jp-Completer-list {\n  margin: 0;\n  padding: 0;\n  list-style-type: none;\n  overflow-y: scroll;\n  overflow-x: hidden;\n  max-height: calc((10 * var(--jp-private-completer-item-height)));\n  min-height: calc(var(--jp-private-completer-item-height));\n  width: 100%;\n}\n\n.jp-Completer-item {\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0;\n  height: var(--jp-private-completer-item-height);\n  min-width: 150px;\n  display: grid;\n  grid-template-columns: min-content 1fr min-content;\n  position: relative;\n}\n\n.jp-Completer-item .jp-Completer-match {\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0 8px 0 6px;\n  height: var(--jp-private-completer-item-height);\n  font-family: var(--jp-code-font-family);\n  font-size: var(--jp-code-font-size);\n  line-height: var(--jp-private-completer-item-height);\n  white-space: nowrap;\n}\n\n.jp-Completer-deprecated .jp-Completer-match {\n  text-decoration: line-through;\n  color: var(--jp-content-font-color2);\n}\n\n.jp-Completer-item .jp-Completer-type {\n  box-sizing: border-box;\n  height: var(--jp-private-completer-item-height);\n  background: transparent;\n  width: var(--jp-private-completer-item-height);\n}\n\n.jp-Completer-item .jp-Completer-icon {\n  /* Normal element size from LabIconStyle.ISheetOptions */\n  height: 16px;\n  width: 16px;\n}\n\n.jp-Completer-item .jp-Completer-monogram {\n  text-align: center;\n  color: white;\n  width: var(--jp-private-completer-item-height);\n  font-family: var(--jp-ui-font-family);\n  font-size: var(--jp-ui-font-size1);\n  line-height: calc(\n    var(--jp-private-completer-item-height) -\n      var(--jp-private-completer-type-offset)\n  );\n  padding-bottom: var(--jp-private-completer-type-offset);\n}\n\n.jp-Completer-item .jp-Completer-typeExtended {\n  box-sizing: border-box;\n  height: var(--jp-private-completer-item-height);\n  text-align: right;\n  background: transparent;\n  color: var(--jp-ui-font-color2);\n  font-family: var(--jp-code-font-family);\n  font-size: var(--jp-code-font-size);\n  line-height: var(--jp-private-completer-item-height);\n  padding-right: 8px;\n}\n\n.jp-Completer-item:hover {\n  background: var(--jp-layout-color2);\n  opacity: 0.8;\n}\n\n.jp-Completer-item.jp-mod-active {\n  background: var(--jp-brand-color1);\n  color: white;\n}\n\n.jp-Completer-item .jp-Completer-match mark {\n  font-weight: bold;\n  background: inherit;\n  color: inherit;\n}\n\n.jp-Completer-type[data-color-index='0'] {\n  background: var(--jp-completer-type-background0, transparent);\n}\n\n.jp-Completer-type[data-color-index='1'] {\n  background: var(--jp-completer-type-background1, #1f77b4);\n}\n\n.jp-Completer-type[data-color-index='2'] {\n  background: var(--jp-completer-type-background2, #ff7f0e);\n}\n\n.jp-Completer-type[data-color-index='3'] {\n  background: var(--jp-completer-type-background3, #2ca02c);\n}\n\n.jp-Completer-type[data-color-index='4'] {\n  background: var(--jp-completer-type-background4, #d62728);\n}\n\n.jp-Completer-type[data-color-index='5'] {\n  background: var(--jp-completer-type-background5, #9467bd);\n}\n\n.jp-Completer-type[data-color-index='6'] {\n  background: var(--jp-completer-type-background6, #8c564b);\n}\n\n.jp-Completer-type[data-color-index='7'] {\n  background: var(--jp-completer-type-background7, #e377c2);\n}\n\n.jp-Completer-type[data-color-index='8'] {\n  background: var(--jp-completer-type-background8, #7f7f7f);\n}\n\n.jp-Completer-type[data-color-index='9'] {\n  background: var(--jp-completer-type-background9, #bcbd22);\n}\n\n.jp-Completer-type[data-color-index='10'] {\n  background: var(--jp-completer-type-background10, #17becf);\n}\n\n.jp-Completer-loading-bar-container {\n  height: 2px;\n  width: calc(100% - var(--jp-private-completer-item-height));\n  left: var(--jp-private-completer-item-height);\n  position: absolute;\n  overflow: hidden;\n  top: 0;\n}\n\n.jp-Completer-loading-bar {\n  height: 100%;\n  width: 50%;\n  background-color: var(--jp-accent-color2);\n  position: absolute;\n  left: -50%;\n  animation: jp-Completer-loading 2s ease-in 0.5s infinite;\n}\n\n@keyframes jp-Completer-loading {\n  0% {\n    transform: translateX(0);\n  }\n\n  100% {\n    transform: translateX(400%);\n  }\n}\n\n.jp-GhostText {\n  color: var(--jp-ui-font-color3);\n  white-space: pre-wrap;\n}\n\n.jp-GhostText-lineSpacer,\n.jp-GhostText-letterSpacer {\n  opacity: 0;\n  display: inline-block;\n  vertical-align: top;\n  /* stylelint-disable-next-line csstree/validator */\n  text-wrap: none;\n}\n\n.jp-GhostText-letterSpacer {\n  max-width: 0;\n}\n\n.jp-GhostText-lineSpacer {\n  /* duration and delay are overwritten by inline styles */\n  animation: jp-GhostText-hide 300ms 700ms ease-out forwards;\n}\n\n@keyframes jp-GhostText-hide {\n  0% {\n    font-size: unset;\n  }\n\n  100% {\n    font-size: 0;\n  }\n}\n\n.jp-GhostText-expandHidden {\n  border: 1px solid var(--jp-border-color0);\n  border-radius: var(--jp-border-radius);\n  background: var(--jp-layout-color0);\n  color: var(--jp-content-font-color3);\n  padding: 0 4px;\n  margin: 0 4px;\n  cursor: default;\n}\n\n.jp-GhostText-hiddenWrapper:hover > .jp-GhostText-hiddenLines {\n  display: inline;\n}\n\n.jp-GhostText-hiddenLines {\n  display: none;\n}\n\n.jp-GhostText[data-animation='uncover'] {\n  position: relative;\n}\n\n.jp-GhostText-streamedToken {\n  white-space: pre;\n}\n\n.jp-GhostText[data-animation='uncover'] > .jp-GhostText-streamedToken {\n  animation: jp-GhostText-typing 2s forwards;\n  display: inline-flex;\n  overflow: hidden;\n}\n\n@keyframes jp-GhostText-typing {\n  from {\n    max-width: 0;\n  }\n\n  to {\n    max-width: 100%;\n  }\n}\n\n.jp-GhostText-streamingIndicator::after {\n  animation: jp-GhostText-streaming 2s infinite;\n  animation-delay: 400ms;\n  content: ' ';\n  background: var(--jp-layout-color4);\n  opacity: 0.2;\n}\n\n@keyframes jp-GhostText-streaming {\n  0% {\n    opacity: 0.2;\n  }\n\n  20% {\n    opacity: 0.4;\n  }\n\n  40% {\n    opacity: 0.2;\n  }\n}\n\n.jp-GhostText-errorIndicator::after {\n  animation: jp-GhostText-error 500ms 1;\n  animation-delay: 3500ms;\n  color: var(--jp-error-color1);\n  font-size: 150%;\n  line-height: 10px;\n  margin-left: 2px;\n  padding: 0 4px;\n  content: '⚠';\n  cursor: help;\n  position: relative;\n  top: 2px;\n}\n\n@keyframes jp-GhostText-error {\n  0% {\n    opacity: 1;\n  }\n\n  100% {\n    opacity: 0;\n  }\n}\n\n.jp-InlineCompleter {\n  box-shadow: var(--jp-elevation-z2);\n  background: var(--jp-layout-color1);\n  color: var(--jp-content-font-color1);\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  padding: 0 8px;\n}\n\n.jp-InlineCompleter-progressBar {\n  height: 2px;\n  position: absolute;\n  top: 0;\n  left: 0;\n  background-color: var(--jp-accent-color2);\n}\n\n.jp-InlineCompleter[data-display='onHover'] {\n  opacity: 0;\n  transition:\n    visibility 0s linear 0.1s,\n    opacity 0.1s linear;\n  visibility: hidden;\n}\n\n.jp-InlineCompleter[data-display='onHover']:hover,\n.jp-InlineCompleter-hover[data-display='onHover'] {\n  opacity: 1;\n  visibility: visible;\n  transition-delay: 0s;\n}\n\n.jp-InlineCompleter[data-display='never'] {\n  display: none;\n}\n\n.jp-InlineCompleter > .jp-Toolbar {\n  box-shadow: none;\n  border-bottom: none;\n  background: none;\n}\n\n.jp-InlineCompleter[data-show-shortcuts='false']\n  .jp-ToolbarButtonComponent-label {\n  display: none;\n}\n\n.jp-InlineCompleter [data-command='inline-completer:next'] > svg,\n.jp-InlineCompleter [data-command='inline-completer:previous'] > svg {\n  scale: 1.5;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 61923:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* Toolbar menu to select the prompt cell position */
.jp-CodeConsolePromptMenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.jp-CodeConsolePromptMenu .lm-Menu-itemIcon > svg {
  vertical-align: sub;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/console-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,oDAAoD;AACpD;EACE,aAAa;EACb,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Toolbar menu to select the prompt cell position */\n.jp-CodeConsolePromptMenu {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n}\n\n.jp-CodeConsolePromptMenu .lm-Menu-itemIcon > svg {\n  vertical-align: sub;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 43313:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-ConsolePanel {
  display: flex;
  margin-top: -1px;
  min-width: 240px;
  min-height: 120px;
}

.jp-CodeConsole {
  height: 100%;
  padding: 0;
  display: flex;
}

.jp-CodeConsole .jp-Cell {
  padding: var(--jp-cell-padding);
}

/*-----------------------------------------------------------------------------
| Content (already run cells)
|----------------------------------------------------------------------------*/

.jp-CodeConsole-content {
  background: var(--jp-layout-color0);
  overflow: auto;
  padding: 0 var(--jp-console-padding);
  min-width: calc(10 * var(--jp-ui-font-size1));
  min-height: calc(5 * var(--jp-ui-font-size1));
}

.jp-CodeConsole-content .jp-Cell:not(.jp-mod-active) .jp-InputPrompt {
  opacity: var(--jp-cell-prompt-not-active-opacity);
  color: var(--jp-cell-inprompt-font-color);
  cursor: move;
}

.jp-CodeConsole-content .jp-Cell:not(.jp-mod-active) .jp-OutputPrompt {
  opacity: var(--jp-cell-prompt-not-active-opacity);
  color: var(--jp-cell-outprompt-font-color);
}

/* This rule is for styling cell run by another activity in this console */

/* .jp-CodeConsole-content .jp-Cell.jp-CodeConsole-foreignCell {
} */

.jp-CodeConsole-content .jp-InputArea-editor.jp-InputArea-editor {
  background: transparent;
  border: 1px solid transparent;
}

.jp-CodeConsole-content .jp-CodeConsole-banner .jp-InputPrompt {
  display: none;
}

/* collapser is hovered */
.jp-CodeConsole-content .jp-Cell .jp-Collapser:hover {
  box-shadow: var(--jp-elevation-z2);
  background: var(--jp-brand-color1);
  opacity: var(--jp-cell-collapser-not-active-hover-opacity);
}

/*-----------------------------------------------------------------------------
| Input/prompt cell
|----------------------------------------------------------------------------*/

.jp-CodeConsole-input {
  overflow: auto;
  padding: var(--jp-cell-padding) var(--jp-console-padding);

  /* This matches the box shadow on the notebook toolbar, eventually we should create
   * CSS variables for this */
  box-shadow: 0 0.4px 6px 0 rgba(0, 0, 0, 0.1);
  background: var(--jp-layout-color0);
  min-width: calc(10 * var(--jp-ui-font-size1));
  min-height: calc(4 * var(--jp-ui-font-size1));
}

.jp-CodeConsole-input .jp-CodeConsole-prompt .jp-InputArea {
  height: 100%;
  min-height: 100%;
}

.jp-CodeConsole-promptCell .jp-InputArea-editor.jp-mod-focused {
  border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);
  box-shadow: var(--jp-input-box-shadow);
  background-color: var(--jp-cell-editor-active-background);
}

/*-----------------------------------------------------------------------------
| Presentation Mode (.jp-mod-presentationMode)
|----------------------------------------------------------------------------*/

.jp-mod-presentationMode .jp-CodeConsole {
  --jp-content-font-size1: var(--jp-content-presentation-font-size1);
  --jp-code-font-size: var(--jp-code-presentation-font-size);
}

.jp-mod-presentationMode .jp-CodeConsole .jp-Cell .jp-InputPrompt,
.jp-mod-presentationMode .jp-CodeConsole .jp-Cell .jp-OutputPrompt {
  flex: 0 0 110px;
}

/*-----------------------------------------------------------------------------
| Split Panel Container
|----------------------------------------------------------------------------*/
.jp-CodeConsole-split {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.jp-CodeConsole-split.lm-SplitPanel .lm-SplitPanel-handle::after {
  background-color: var(--jp-border-color2);
  min-height: calc(2 * var(--jp-border-width));
  min-width: calc(2 * var(--jp-border-width));
}

/*-----------------------------------------------------------------------------
| Mobile
|----------------------------------------------------------------------------*/
@media only screen and (width <= 760px) {
  .jp-CodeConsole-input {
    min-height: calc(6 * var(--jp-ui-font-size1));
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/console/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,gBAAgB;EAChB,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,YAAY;EACZ,UAAU;EACV,aAAa;AACf;;AAEA;EACE,+BAA+B;AACjC;;AAEA;;8EAE8E;;AAE9E;EACE,mCAAmC;EACnC,cAAc;EACd,oCAAoC;EACpC,6CAA6C;EAC7C,6CAA6C;AAC/C;;AAEA;EACE,iDAAiD;EACjD,yCAAyC;EACzC,YAAY;AACd;;AAEA;EACE,iDAAiD;EACjD,0CAA0C;AAC5C;;AAEA,0EAA0E;;AAE1E;GACG;;AAEH;EACE,uBAAuB;EACvB,6BAA6B;AAC/B;;AAEA;EACE,aAAa;AACf;;AAEA,yBAAyB;AACzB;EACE,kCAAkC;EAClC,kCAAkC;EAClC,0DAA0D;AAC5D;;AAEA;;8EAE8E;;AAE9E;EACE,cAAc;EACd,yDAAyD;;EAEzD;6BAC2B;EAC3B,4CAA4C;EAC5C,mCAAmC;EACnC,6CAA6C;EAC7C,6CAA6C;AAC/C;;AAEA;EACE,YAAY;EACZ,gBAAgB;AAClB;;AAEA;EACE,8EAA8E;EAC9E,sCAAsC;EACtC,yDAAyD;AAC3D;;AAEA;;8EAE8E;;AAE9E;EACE,kEAAkE;EAClE,0DAA0D;AAC5D;;AAEA;;EAEE,eAAe;AACjB;;AAEA;;8EAE8E;AAC9E;EACE,aAAa;EACb,YAAY;EACZ,WAAW;EACX,gBAAgB;AAClB;;AAEA;EACE,yCAAyC;EACzC,4CAA4C;EAC5C,2CAA2C;AAC7C;;AAEA;;8EAE8E;AAC9E;EACE;IACE,6CAA6C;EAC/C;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-ConsolePanel {\n  display: flex;\n  margin-top: -1px;\n  min-width: 240px;\n  min-height: 120px;\n}\n\n.jp-CodeConsole {\n  height: 100%;\n  padding: 0;\n  display: flex;\n}\n\n.jp-CodeConsole .jp-Cell {\n  padding: var(--jp-cell-padding);\n}\n\n/*-----------------------------------------------------------------------------\n| Content (already run cells)\n|----------------------------------------------------------------------------*/\n\n.jp-CodeConsole-content {\n  background: var(--jp-layout-color0);\n  overflow: auto;\n  padding: 0 var(--jp-console-padding);\n  min-width: calc(10 * var(--jp-ui-font-size1));\n  min-height: calc(5 * var(--jp-ui-font-size1));\n}\n\n.jp-CodeConsole-content .jp-Cell:not(.jp-mod-active) .jp-InputPrompt {\n  opacity: var(--jp-cell-prompt-not-active-opacity);\n  color: var(--jp-cell-inprompt-font-color);\n  cursor: move;\n}\n\n.jp-CodeConsole-content .jp-Cell:not(.jp-mod-active) .jp-OutputPrompt {\n  opacity: var(--jp-cell-prompt-not-active-opacity);\n  color: var(--jp-cell-outprompt-font-color);\n}\n\n/* This rule is for styling cell run by another activity in this console */\n\n/* .jp-CodeConsole-content .jp-Cell.jp-CodeConsole-foreignCell {\n} */\n\n.jp-CodeConsole-content .jp-InputArea-editor.jp-InputArea-editor {\n  background: transparent;\n  border: 1px solid transparent;\n}\n\n.jp-CodeConsole-content .jp-CodeConsole-banner .jp-InputPrompt {\n  display: none;\n}\n\n/* collapser is hovered */\n.jp-CodeConsole-content .jp-Cell .jp-Collapser:hover {\n  box-shadow: var(--jp-elevation-z2);\n  background: var(--jp-brand-color1);\n  opacity: var(--jp-cell-collapser-not-active-hover-opacity);\n}\n\n/*-----------------------------------------------------------------------------\n| Input/prompt cell\n|----------------------------------------------------------------------------*/\n\n.jp-CodeConsole-input {\n  overflow: auto;\n  padding: var(--jp-cell-padding) var(--jp-console-padding);\n\n  /* This matches the box shadow on the notebook toolbar, eventually we should create\n   * CSS variables for this */\n  box-shadow: 0 0.4px 6px 0 rgba(0, 0, 0, 0.1);\n  background: var(--jp-layout-color0);\n  min-width: calc(10 * var(--jp-ui-font-size1));\n  min-height: calc(4 * var(--jp-ui-font-size1));\n}\n\n.jp-CodeConsole-input .jp-CodeConsole-prompt .jp-InputArea {\n  height: 100%;\n  min-height: 100%;\n}\n\n.jp-CodeConsole-promptCell .jp-InputArea-editor.jp-mod-focused {\n  border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);\n  box-shadow: var(--jp-input-box-shadow);\n  background-color: var(--jp-cell-editor-active-background);\n}\n\n/*-----------------------------------------------------------------------------\n| Presentation Mode (.jp-mod-presentationMode)\n|----------------------------------------------------------------------------*/\n\n.jp-mod-presentationMode .jp-CodeConsole {\n  --jp-content-font-size1: var(--jp-content-presentation-font-size1);\n  --jp-code-font-size: var(--jp-code-presentation-font-size);\n}\n\n.jp-mod-presentationMode .jp-CodeConsole .jp-Cell .jp-InputPrompt,\n.jp-mod-presentationMode .jp-CodeConsole .jp-Cell .jp-OutputPrompt {\n  flex: 0 0 110px;\n}\n\n/*-----------------------------------------------------------------------------\n| Split Panel Container\n|----------------------------------------------------------------------------*/\n.jp-CodeConsole-split {\n  display: flex;\n  height: 100%;\n  width: 100%;\n  overflow: hidden;\n}\n\n.jp-CodeConsole-split.lm-SplitPanel .lm-SplitPanel-handle::after {\n  background-color: var(--jp-border-color2);\n  min-height: calc(2 * var(--jp-border-width));\n  min-width: calc(2 * var(--jp-border-width));\n}\n\n/*-----------------------------------------------------------------------------\n| Mobile\n|----------------------------------------------------------------------------*/\n@media only screen and (width <= 760px) {\n  .jp-CodeConsole-input {\n    min-height: calc(6 * var(--jp-ui-font-size1));\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 11959:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-CSVViewer {
  display: flex;
  flex-direction: column;
  outline: none;

  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
}

.jp-CSVDelimiter {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  border: none;
  min-height: 24px;
  background: var(--jp-toolbar-background);
  z-index: 1;
}

.jp-CSVDelimiter .jp-CSVDelimiter-label {
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  padding-left: 8px;
  padding-right: 8px;
}

.jp-CSVDelimiter .jp-CSVDelimiter-dropdown {
  flex: 0 0 auto;
  vertical-align: middle;
  border-radius: 0;
  outline: none;
  height: 20px;
  margin-top: 2px;
  margin-bottom: 2px;
}

.jp-CSVDelimiter .jp-CSVDelimiter-dropdown select.jp-mod-styled {
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);
  font-size: var(--jp-ui-font-size1);
  height: 20px;
  padding-right: 20px;
}

.jp-CSVViewer-grid {
  flex: 1 1 auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/csvviewer/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,sBAAsB;EACtB,aAAa;;EAEb;iCAC+B;EAC/B,kCAAkC;AACpC;;AAEA;EACE,aAAa;EACb,cAAc;EACd,mBAAmB;EACnB,YAAY;EACZ,gBAAgB;EAChB,wCAAwC;EACxC,UAAU;AACZ;;AAEA;EACE,+BAA+B;EAC/B,kCAAkC;EAClC,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,cAAc;EACd,sBAAsB;EACtB,gBAAgB;EAChB,aAAa;EACb,YAAY;EACZ,eAAe;EACf,kBAAkB;AACpB;;AAEA;EACE,+BAA+B;EAC/B,mCAAmC;EACnC,kCAAkC;EAClC,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,cAAc;AAChB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-CSVViewer {\n  display: flex;\n  flex-direction: column;\n  outline: none;\n\n  /* This is needed so that all font sizing of children done in ems is\n   * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-CSVDelimiter {\n  display: flex;\n  flex: 0 0 auto;\n  flex-direction: row;\n  border: none;\n  min-height: 24px;\n  background: var(--jp-toolbar-background);\n  z-index: 1;\n}\n\n.jp-CSVDelimiter .jp-CSVDelimiter-label {\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  padding-left: 8px;\n  padding-right: 8px;\n}\n\n.jp-CSVDelimiter .jp-CSVDelimiter-dropdown {\n  flex: 0 0 auto;\n  vertical-align: middle;\n  border-radius: 0;\n  outline: none;\n  height: 20px;\n  margin-top: 2px;\n  margin-bottom: 2px;\n}\n\n.jp-CSVDelimiter .jp-CSVDelimiter-dropdown select.jp-mod-styled {\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n  font-size: var(--jp-ui-font-size1);\n  height: 20px;\n  padding-right: 20px;\n}\n\n.jp-CSVViewer-grid {\n  flex: 1 1 auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 34114:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_breakpoints_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75551);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_callstack_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(47507);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_editor_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14131);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_kernelSources_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77173);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_sidebar_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3742);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_sources_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(87383);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_variables_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(74328);
// Imports









var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_breakpoints_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_callstack_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_editor_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_kernelSources_css__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_sidebar_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_sources_css__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_variables_css__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-left-truncated {
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}

#jp-debugger .jp-switch-label {
  margin-right: 0;
}

.jp-DebuggerBugButton[aria-pressed='true'] {
  /* Undo default toolkit style */
  box-shadow: none;
}

.jp-DebuggerBugButton[aria-pressed='true'] path {
  fill: var(--jp-warn-color0);
}

.jp-DebuggerPausedOverlay {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--jp-border-color2);
  border-radius: 4px;
  background: var(--jp-layout-color2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color1);
}

.jp-DebuggerPausedButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.jp-DebuggerPausedButton:hover {
  background: var(--jp-layout-color3);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAU9E;EACE,gBAAgB;EAChB,uBAAuB;EACvB,cAAc;AAChB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,+BAA+B;EAC/B,gBAAgB;AAClB;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,2BAA2B;EAC3B,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,gBAAgB;EAChB,yCAAyC;EACzC,kBAAkB;EAClB,mCAAmC;EACnC,wCAAwC;EACxC,aAAa;EACb,kCAAkC;EAClC,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,uBAAuB;EACvB,eAAe;EACf,UAAU;AACZ;;AAEA;EACE,mCAAmC;AACrC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n@import './breakpoints.css';\n@import './callstack.css';\n@import './editor.css';\n@import './kernelSources.css';\n@import './sidebar.css';\n@import './sources.css';\n@import './variables.css';\n\n.jp-left-truncated {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  direction: ltr;\n}\n\n#jp-debugger .jp-switch-label {\n  margin-right: 0;\n}\n\n.jp-DebuggerBugButton[aria-pressed='true'] {\n  /* Undo default toolkit style */\n  box-shadow: none;\n}\n\n.jp-DebuggerBugButton[aria-pressed='true'] path {\n  fill: var(--jp-warn-color0);\n}\n\n.jp-DebuggerPausedOverlay {\n  position: absolute;\n  top: 8px;\n  left: 50%;\n  transform: translateX(-50%);\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  padding: 4px 8px;\n  border: 1px solid var(--jp-border-color2);\n  border-radius: 4px;\n  background: var(--jp-layout-color2);\n  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n  z-index: 1000;\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-DebuggerPausedButton {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 24px;\n  height: 24px;\n  border: none;\n  border-radius: 3px;\n  background: transparent;\n  cursor: pointer;\n  padding: 0;\n}\n\n.jp-DebuggerPausedButton:hover {\n  background: var(--jp-layout-color3);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 75551:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-DebuggerBreakpoints {
  display: flex;
  flex-direction: column;
  min-height: 50px;
  padding-top: 3px;
}

.jp-DebuggerBreakpoints-body {
  padding: 10px;
  overflow: auto;
}

.jp-DebuggerBreakpoint {
  display: flex;
  align-items: center;
  height: 24px;
}

.jp-DebuggerBreakpoint:hover {
  background: var(--jp-layout-color2);
  cursor: pointer;
}

.jp-DebuggerBreakpoint-container {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}

.jp-DebuggerBreakpoint-source {
  white-space: nowrap;
  margin-right: 5px;
}

.jp-DebuggerBreakpoint-line {
  margin-left: auto;
}

.jp-DebuggerCallstackFrame {
  display: flex;
  align-items: center;
}

.jp-DebuggerCallstackFrame-name {
  white-space: nowrap;
  margin-right: 5px;
}

.jp-DebuggerCallstackFrame-location {
  margin-left: auto;
}

[data-jp-debugger='true'] .cm-breakpoint-gutter .cm-gutterElement:empty::after {
  color: var(--jp-error-color1);
  opacity: 0;
}

.cm-gutter {
  cursor: default;
}

.cm-breakpoint-gutter .cm-gutterElement {
  padding-top: 1.1px;
  height: 18.2px;
}

[data-jp-debugger='true'].jp-Editor
  .cm-breakpoint-gutter
  .cm-gutterElement:empty:hover::after,
[data-jp-debugger='true']
  .jp-Notebook
  .jp-CodeCell.jp-mod-selected
  .cm-breakpoint-gutter:empty:hover::after,
[data-jp-debugger='true']
  .jp-Editor
  .cm-breakpoint-gutter
  .cm-gutterElement:empty:hover::after {
  opacity: 0.5;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/breakpoints.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,YAAY;AACd;;AAEA;EACE,mCAAmC;EACnC,eAAe;AACjB;;AAEA;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;AACpB;;AAEA;EACE,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,6BAA6B;EAC7B,UAAU;AACZ;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,kBAAkB;EAClB,cAAc;AAChB;;AAEA;;;;;;;;;;;EAWE,YAAY;AACd","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerBreakpoints {\n  display: flex;\n  flex-direction: column;\n  min-height: 50px;\n  padding-top: 3px;\n}\n\n.jp-DebuggerBreakpoints-body {\n  padding: 10px;\n  overflow: auto;\n}\n\n.jp-DebuggerBreakpoint {\n  display: flex;\n  align-items: center;\n  height: 24px;\n}\n\n.jp-DebuggerBreakpoint:hover {\n  background: var(--jp-layout-color2);\n  cursor: pointer;\n}\n\n.jp-DebuggerBreakpoint-container {\n  height: 24px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  margin-right: 10px;\n}\n\n.jp-DebuggerBreakpoint-source {\n  white-space: nowrap;\n  margin-right: 5px;\n}\n\n.jp-DebuggerBreakpoint-line {\n  margin-left: auto;\n}\n\n.jp-DebuggerCallstackFrame {\n  display: flex;\n  align-items: center;\n}\n\n.jp-DebuggerCallstackFrame-name {\n  white-space: nowrap;\n  margin-right: 5px;\n}\n\n.jp-DebuggerCallstackFrame-location {\n  margin-left: auto;\n}\n\n[data-jp-debugger='true'] .cm-breakpoint-gutter .cm-gutterElement:empty::after {\n  color: var(--jp-error-color1);\n  opacity: 0;\n}\n\n.cm-gutter {\n  cursor: default;\n}\n\n.cm-breakpoint-gutter .cm-gutterElement {\n  padding-top: 1.1px;\n  height: 18.2px;\n}\n\n[data-jp-debugger='true'].jp-Editor\n  .cm-breakpoint-gutter\n  .cm-gutterElement:empty:hover::after,\n[data-jp-debugger='true']\n  .jp-Notebook\n  .jp-CodeCell.jp-mod-selected\n  .cm-breakpoint-gutter:empty:hover::after,\n[data-jp-debugger='true']\n  .jp-Editor\n  .cm-breakpoint-gutter\n  .cm-gutterElement:empty:hover::after {\n  opacity: 0.5;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 47507:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-DebuggerCallstack {
  display: flex;
  flex-direction: column;
  min-height: 50px;
  padding-top: 3px;
}

.jp-DebuggerCallstack-body {
  overflow: auto;
}

.jp-DebuggerCallstack-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
}

.jp-DebuggerCallstack-body li {
  padding: 5px;
  padding-left: 8px;
}

.jp-DebuggerCallstack-body li.selected {
  color: white;
  background: var(--jp-brand-color1);
}

.jp-DebuggerCallstack .jp-ToolbarButtonComponent-label {
  display: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/callstack.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,gBAAgB;EAChB,SAAS;EACT,UAAU;EACV,mCAAmC;EACnC,+BAA+B;EAC/B,kCAAkC;AACpC;;AAEA;EACE,YAAY;EACZ,iBAAiB;AACnB;;AAEA;EACE,YAAY;EACZ,kCAAkC;AACpC;;AAEA;EACE,aAAa;AACf","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerCallstack {\n  display: flex;\n  flex-direction: column;\n  min-height: 50px;\n  padding-top: 3px;\n}\n\n.jp-DebuggerCallstack-body {\n  overflow: auto;\n}\n\n.jp-DebuggerCallstack-body ul {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-DebuggerCallstack-body li {\n  padding: 5px;\n  padding-left: 8px;\n}\n\n.jp-DebuggerCallstack-body li.selected {\n  color: white;\n  background: var(--jp-brand-color1);\n}\n\n.jp-DebuggerCallstack .jp-ToolbarButtonComponent-label {\n  display: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 14131:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-DebuggerEditor-highlight {
  text-shadow: 0 0 1px var(--jp-layout-color0);
  outline: 1px solid;
}

body[data-jp-theme-light='false'] .jp-DebuggerEditor-highlight {
  background-color: var(--md-brown-800, #4e342e);
  outline-color: var(--md-brown-600, #6d4c41);
}

body[data-jp-theme-light='true'] .jp-DebuggerEditor-highlight {
  background-color: var(--md-brown-100, #d7ccc8);
  outline-color: var(--md-brown-300, #a1887f);
}

.jp-DebuggerEditor-marker {
  position: absolute;
  left: -34px;
  top: -1px;
  color: var(--jp-error-color1);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/editor.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,4CAA4C;EAC5C,kBAAkB;AACpB;;AAEA;EACE,8CAA8C;EAC9C,2CAA2C;AAC7C;;AAEA;EACE,8CAA8C;EAC9C,2CAA2C;AAC7C;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,6BAA6B;AAC/B","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerEditor-highlight {\n  text-shadow: 0 0 1px var(--jp-layout-color0);\n  outline: 1px solid;\n}\n\nbody[data-jp-theme-light='false'] .jp-DebuggerEditor-highlight {\n  background-color: var(--md-brown-800, #4e342e);\n  outline-color: var(--md-brown-600, #6d4c41);\n}\n\nbody[data-jp-theme-light='true'] .jp-DebuggerEditor-highlight {\n  background-color: var(--md-brown-100, #d7ccc8);\n  outline-color: var(--md-brown-300, #a1887f);\n}\n\n.jp-DebuggerEditor-marker {\n  position: absolute;\n  left: -34px;\n  top: -1px;\n  color: var(--jp-error-color1);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 77173:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-DebuggerKernelSources {
  min-height: 50px;
  margin-top: 3px;
}

[data-jp-debugger='true'].jp-Editor .jp-mod-readOnly {
  background: var(--jp-layout-color2);
  height: 100%;
}

.jp-DebuggerKernelSources-body [data-jp-debugger='true'].jp-Editor {
  height: 100%;
}

.jp-DebuggerKernelSources-body {
  height: 100%;
  overflow-y: auto;
}

.jp-DebuggerKernelSource-filterBox {
  padding: 0;
  flex: 0 0 auto;
  margin: 0;
  position: sticky;
  top: 0;
  background-color: var(--jp-layout-color1);
}

.jp-DebuggerKernelSource-filterBox-hidden {
  display: none;
}

.jp-DebuggerKernelSource-source {
  display: flex;
  align-items: center;
  padding: 4px;
  cursor: pointer;
}

.jp-DebuggerKernelSource-source:hover {
  background-color: var(--jp-layout-color2);
}

.jp-DebuggerKernelSource-source > svg {
  height: 16px;
  width: 16px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/kernelSources.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,gBAAgB;EAChB,eAAe;AACjB;;AAEA;EACE,mCAAmC;EACnC,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,gBAAgB;AAClB;;AAEA;EACE,UAAU;EACV,cAAc;EACd,SAAS;EACT,gBAAgB;EAChB,MAAM;EACN,yCAAyC;AAC3C;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,YAAY;EACZ,eAAe;AACjB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,YAAY;EACZ,WAAW;AACb","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerKernelSources {\n  min-height: 50px;\n  margin-top: 3px;\n}\n\n[data-jp-debugger='true'].jp-Editor .jp-mod-readOnly {\n  background: var(--jp-layout-color2);\n  height: 100%;\n}\n\n.jp-DebuggerKernelSources-body [data-jp-debugger='true'].jp-Editor {\n  height: 100%;\n}\n\n.jp-DebuggerKernelSources-body {\n  height: 100%;\n  overflow-y: auto;\n}\n\n.jp-DebuggerKernelSource-filterBox {\n  padding: 0;\n  flex: 0 0 auto;\n  margin: 0;\n  position: sticky;\n  top: 0;\n  background-color: var(--jp-layout-color1);\n}\n\n.jp-DebuggerKernelSource-filterBox-hidden {\n  display: none;\n}\n\n.jp-DebuggerKernelSource-source {\n  display: flex;\n  align-items: center;\n  padding: 4px;\n  cursor: pointer;\n}\n\n.jp-DebuggerKernelSource-source:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-DebuggerKernelSource-source > svg {\n  height: 16px;\n  width: 16px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 3742:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-SidePanel-header > h2 {
  /* Set font-size to override default h2 sizing but keeping default --jp-ui-font-size0 */
  font-size: 100%;
  font-weight: 600;
  margin: 0 auto 0 0;
  padding: 4px 10px;
}

.jp-DebuggerSidebar-body
  .jp-AccordionPanel-title
  jp-toolbar::part(positioning-region) {
  flex-wrap: nowrap;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/sidebar.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,uFAAuF;EACvF,eAAe;EACf,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA;;;EAGE,iBAAiB;AACnB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-SidePanel-header > h2 {\n  /* Set font-size to override default h2 sizing but keeping default --jp-ui-font-size0 */\n  font-size: 100%;\n  font-weight: 600;\n  margin: 0 auto 0 0;\n  padding: 4px 10px;\n}\n\n.jp-DebuggerSidebar-body\n  .jp-AccordionPanel-title\n  jp-toolbar::part(positioning-region) {\n  flex-wrap: nowrap;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 87383:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-DebuggerSources {
  min-height: 50px;
  margin-top: 3px;
  overflow-y: scroll;
}

[data-jp-debugger='true'].jp-Editor .jp-mod-readOnly {
  background: var(--jp-layout-color2);
  height: 100%;
}

.jp-DebuggerSources-body [data-jp-debugger='true'].jp-Editor {
  height: 100%;
}

.jp-DebuggerSources-body {
  height: 100%;
}

.jp-DebuggerSources-header-path {
  overflow: hidden;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--jp-ui-font-size0);
  color: var(--jp-ui-font-color1);
  user-select: text;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/sources.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,gBAAgB;EAChB,eAAe;EACf,kBAAkB;AACpB;;AAEA;EACE,mCAAmC;EACnC,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,uBAAuB;EACvB,mBAAmB;EACnB,kCAAkC;EAClC,+BAA+B;EAC/B,iBAAiB;AACnB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerSources {\n  min-height: 50px;\n  margin-top: 3px;\n  overflow-y: scroll;\n}\n\n[data-jp-debugger='true'].jp-Editor .jp-mod-readOnly {\n  background: var(--jp-layout-color2);\n  height: 100%;\n}\n\n.jp-DebuggerSources-body [data-jp-debugger='true'].jp-Editor {\n  height: 100%;\n}\n\n.jp-DebuggerSources-body {\n  height: 100%;\n}\n\n.jp-DebuggerSources-header-path {\n  overflow: hidden;\n  cursor: pointer;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  font-size: var(--jp-ui-font-size0);\n  color: var(--jp-ui-font-color1);\n  user-select: text;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 74328:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-DebuggerVariables {
  display: flex;
  flex-direction: column;
  min-height: 50px;
  padding-top: 3px;
}

.jp-DebuggerVariables-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 24px;
  overflow: auto;

  /* For absolute positioning of jp-DebuggerVariables-buttons. */
  position: relative;
}

.jp-DebuggerVariables-name {
  color: var(--jp-mirror-editor-attribute-color);
  grid-area: name;
}

.jp-DebuggerVariables-name:last-of-type {
  flex: 1 1 auto;
}

.jp-DebuggerVariables-name::after {
  content: ':';
  margin-right: 5px;
}

.jp-DebuggerVariables-detail {
  /* detail contains value for primitive types or name of the type otherwise */
  color: var(--jp-mirror-editor-string-color);
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.jp-DebuggerVariables-grid {
  flex: 1 1 auto;
}

.jp-DebuggerVariables-grid .lm-DataGrid {
  border: none;
}

.jp-DebuggerVariables-colorPalette {
  visibility: hidden;
  z-index: -999;
  position: absolute;
  left: -999px;
  top: -999px;
}

.jp-DebuggerVariables-colorPalette .jp-mod-void {
  color: var(--jp-layout-color1);
}

.jp-DebuggerVariables-colorPalette .jp-mod-background {
  color: var(--jp-rendermime-table-row-background);
}

.jp-DebuggerVariables-colorPalette .jp-mod-header-background {
  color: var(--jp-layout-color2);
}

.jp-DebuggerVariables-colorPalette .jp-mod-grid-line {
  color: var(--jp-border-color3);
}

.jp-DebuggerVariables-colorPalette .jp-mod-header-grid-line {
  color: var(--jp-border-color3);
}

.jp-DebuggerVariables-colorPalette .jp-mod-selection {
  /* TODO: Fix JupyterLab light theme (alpha) so this can be a variable. */
  color: rgba(3, 169, 244, 0.2);
}

.jp-DebuggerVariables-colorPalette .jp-mod-text {
  color: var(--jp-content-font-color0);
}

.jp-VariableRendererPanel {
  overflow: auto;
}

.jp-VariableRendererPanel-renderer {
  overflow: auto;
  height: 100%;
}

.jp-VariableRenderer-TrustButton[aria-pressed='true'] {
  box-shadow: inset 0 var(--jp-border-width) 4px
    rgba(
      var(--jp-shadow-base-lightness),
      var(--jp-shadow-base-lightness),
      var(--jp-shadow-base-lightness),
      0.6
    );
}

.jp-DebuggerRichVariable div[data-mime-type='text/plain'] > pre {
  white-space: normal;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/debugger/style/variables.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,cAAc;EACd,gBAAgB;EAChB,cAAc;;EAEd,8DAA8D;EAC9D,kBAAkB;AACpB;;AAEA;EACE,8CAA8C;EAC9C,eAAe;AACjB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,YAAY;EACZ,iBAAiB;AACnB;;AAEA;EACE,4EAA4E;EAC5E,2CAA2C;EAC3C,cAAc;EACd,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,gDAAgD;AAClD;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,wEAAwE;EACxE,6BAA6B;AAC/B;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,YAAY;AACd;;AAEA;EACE;;;;;;KAMG;AACL;;AAEA;EACE,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerVariables {\n  display: flex;\n  flex-direction: column;\n  min-height: 50px;\n  padding-top: 3px;\n}\n\n.jp-DebuggerVariables-body {\n  display: flex;\n  flex-direction: column;\n  flex: 1 1 auto;\n  min-height: 24px;\n  overflow: auto;\n\n  /* For absolute positioning of jp-DebuggerVariables-buttons. */\n  position: relative;\n}\n\n.jp-DebuggerVariables-name {\n  color: var(--jp-mirror-editor-attribute-color);\n  grid-area: name;\n}\n\n.jp-DebuggerVariables-name:last-of-type {\n  flex: 1 1 auto;\n}\n\n.jp-DebuggerVariables-name::after {\n  content: ':';\n  margin-right: 5px;\n}\n\n.jp-DebuggerVariables-detail {\n  /* detail contains value for primitive types or name of the type otherwise */\n  color: var(--jp-mirror-editor-string-color);\n  flex: 1 1 auto;\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\n.jp-DebuggerVariables-grid {\n  flex: 1 1 auto;\n}\n\n.jp-DebuggerVariables-grid .lm-DataGrid {\n  border: none;\n}\n\n.jp-DebuggerVariables-colorPalette {\n  visibility: hidden;\n  z-index: -999;\n  position: absolute;\n  left: -999px;\n  top: -999px;\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-void {\n  color: var(--jp-layout-color1);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-background {\n  color: var(--jp-rendermime-table-row-background);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-header-background {\n  color: var(--jp-layout-color2);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-grid-line {\n  color: var(--jp-border-color3);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-header-grid-line {\n  color: var(--jp-border-color3);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-selection {\n  /* TODO: Fix JupyterLab light theme (alpha) so this can be a variable. */\n  color: rgba(3, 169, 244, 0.2);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-text {\n  color: var(--jp-content-font-color0);\n}\n\n.jp-VariableRendererPanel {\n  overflow: auto;\n}\n\n.jp-VariableRendererPanel-renderer {\n  overflow: auto;\n  height: 100%;\n}\n\n.jp-VariableRenderer-TrustButton[aria-pressed='true'] {\n  box-shadow: inset 0 var(--jp-border-width) 4px\n    rgba(\n      var(--jp-shadow-base-lightness),\n      var(--jp-shadow-base-lightness),\n      var(--jp-shadow-base-lightness),\n      0.6\n    );\n}\n\n.jp-DebuggerRichVariable div[data-mime-type='text/plain'] > pre {\n  white-space: normal;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 52847:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-MimeDocument {
  outline: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/docregistry/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;AACf","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-MimeDocument {\n  outline: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 13994:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
.jp-DocumentSearch-input {
  border: none;
  outline: none;
  color: var(--jp-ui-font-color0);
  font-size: var(--jp-ui-font-size1);
  background-color: var(--jp-layout-color0);
  font-family: var(--jp-ui-font-family);
  padding: 2px 1px;
  resize: none;
  white-space: pre;
}

.jp-DocumentSearch-overlay {
  position: absolute;
  background-color: var(--jp-toolbar-background);
  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
  border-left: var(--jp-border-width) solid var(--jp-toolbar-border-color);
  top: 0;
  right: 0;
  z-index: 7;
  min-width: 405px;
  padding: 2px;
  font-size: var(--jp-ui-font-size1);

  --jp-private-document-search-button-height: 20px;
}

.jp-DocumentSearch-overlay button {
  background-color: var(--jp-toolbar-background);
  outline: 0;
}

.jp-DocumentSearch-button-wrapper:disabled > .jp-DocumentSearch-button-content {
  opacity: 0.6;
  cursor: not-allowed;
}

.jp-DocumentSearch-overlay button:not(:disabled):hover {
  background-color: var(--jp-layout-color2);
}

.jp-DocumentSearch-overlay button:not(:disabled):active {
  background-color: var(--jp-layout-color3);
}

.jp-DocumentSearch-overlay-row {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.jp-DocumentSearch-button-content {
  display: inline-block;
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
}

.jp-DocumentSearch-button-content svg {
  width: 100%;
  height: 100%;
}

.jp-DocumentSearch-input-wrapper {
  border: var(--jp-border-width) solid var(--jp-border-color0);
  display: flex;
  background-color: var(--jp-layout-color0);
  margin: 2px;
}

.jp-DocumentSearch-input-wrapper:focus-within {
  border-color: var(--jp-cell-editor-active-border-color);
}

.jp-DocumentSearch-toggle-wrapper,
.jp-DocumentSearch-button-wrapper {
  all: initial;
  overflow: hidden;
  display: inline-block;
  border: none;
  box-sizing: border-box;
}

.jp-DocumentSearch-toggle-wrapper {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.jp-DocumentSearch-button-wrapper {
  flex-shrink: 0;
  width: var(--jp-private-document-search-button-height);
  height: var(--jp-private-document-search-button-height);
}

.jp-DocumentSearch-toggle-wrapper:focus,
.jp-DocumentSearch-button-wrapper:focus {
  outline: var(--jp-border-width) solid
    var(--jp-cell-editor-active-border-color);
  outline-offset: -1px;
}

.jp-DocumentSearch-toggle-wrapper,
.jp-DocumentSearch-button-wrapper,
.jp-DocumentSearch-button-content:focus {
  outline: none;
}

.jp-DocumentSearch-toggle-placeholder {
  width: 5px;
}

.jp-DocumentSearch-input-button::before {
  display: block;
  padding-top: 100%;
}

.jp-DocumentSearch-input-button-off {
  opacity: var(--jp-search-toggle-off-opacity);
}

.jp-DocumentSearch-input-button-off:hover {
  opacity: var(--jp-search-toggle-hover-opacity);
}

.jp-DocumentSearch-input-button-on {
  opacity: var(--jp-search-toggle-on-opacity);
}

.jp-DocumentSearch-index-counter {
  padding-left: 10px;
  padding-right: 10px;
  user-select: none;
  min-width: 35px;
  display: inline-block;
}

.jp-DocumentSearch-up-down-wrapper {
  display: inline-block;
  padding-right: 2px;
  margin-left: auto;
  white-space: nowrap;
}

.jp-DocumentSearch-spacer {
  margin-left: auto;
}

.jp-DocumentSearch-up-down-wrapper button {
  outline: 0;
  border: none;
  width: var(--jp-private-document-search-button-height);
  height: var(--jp-private-document-search-button-height);
  vertical-align: middle;
  margin: 1px 5px 2px;
}

button:not(:disabled) > .jp-DocumentSearch-up-down-button:hover {
  background-color: var(--jp-layout-color2);
}

button:not(:disabled) > .jp-DocumentSearch-up-down-button:active {
  background-color: var(--jp-layout-color3);
}

.jp-DocumentSearch-filter-button {
  border-radius: var(--jp-border-radius);
}

.jp-DocumentSearch-filter-button:hover {
  background-color: var(--jp-layout-color2);
}

.jp-DocumentSearch-filter-button-enabled {
  background-color: var(--jp-layout-color2);
}

.jp-DocumentSearch-filter-button-enabled:hover {
  background-color: var(--jp-layout-color3);
}

.jp-DocumentSearch-search-options {
  padding: 0 8px;
  margin-left: 3px;
  width: 100%;
  display: grid;
  justify-content: start;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: stretch;
}

.jp-DocumentSearch-search-filter-disabled {
  color: var(--jp-ui-font-color2);
}

.jp-DocumentSearch-search-filter {
  display: flex;
  align-items: center;
  user-select: none;
}

.jp-DocumentSearch-regex-error {
  color: var(--jp-error-color0);
}

.jp-DocumentSearch-replace-button-wrapper {
  overflow: hidden;
  display: inline-block;
  box-sizing: border-box;
  border: var(--jp-border-width) solid var(--jp-border-color0);
  margin: auto 2px;
  padding: 1px 4px;
  height: calc(var(--jp-private-document-search-button-height) + 2px);
  flex-shrink: 0;
}

.jp-DocumentSearch-replace-button-wrapper:focus {
  border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);
}

.jp-DocumentSearch-replace-button {
  display: inline-block;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  color: var(--jp-ui-font-color1);

  /* height - 2 * (padding of wrapper) */
  line-height: calc(var(--jp-private-document-search-button-height) - 2px);
  width: 100%;
  height: 100%;
}

.jp-DocumentSearch-replace-button:focus {
  outline: none;
}

.jp-DocumentSearch-replace-wrapper-class {
  margin-left: 14px;
  display: flex;
}

.jp-DocumentSearch-replace-toggle {
  border: none;
  background-color: var(--jp-toolbar-background);
  border-radius: var(--jp-border-radius);
}

.jp-DocumentSearch-replace-toggle:hover {
  background-color: var(--jp-layout-color2);
}

/*
  The following few rules allow the search box to expand horizontally,
  as the text within it grows. This is done by using putting
  the text within a wrapper element and using that wrapper for sizing,
  as <textarea> and <input> tags do not grow automatically.
  This is the underlying technique:
  https://til.simonwillison.net/css/resizing-textarea
*/
.jp-DocumentSearch-input-label::after {
  content: attr(data-value) ' ';
  visibility: hidden;
  white-space: pre;
}

.jp-DocumentSearch-input-label {
  display: inline-grid;
  align-items: stretch;
}

.jp-DocumentSearch-input-label::after,
.jp-DocumentSearch-input-label > .jp-DocumentSearch-input {
  width: auto;
  min-width: 1em;
  grid-area: 1/2;
  font: inherit;
  padding: 2px 3px;
  margin: 0;
  resize: none;
  background: none;
  appearance: none;
  border: none;
  overflow: hidden;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/documentsearch/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;AAC9E;EACE,YAAY;EACZ,aAAa;EACb,+BAA+B;EAC/B,kCAAkC;EAClC,yCAAyC;EACzC,qCAAqC;EACrC,gBAAgB;EAChB,YAAY;EACZ,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,8CAA8C;EAC9C,0EAA0E;EAC1E,wEAAwE;EACxE,MAAM;EACN,QAAQ;EACR,UAAU;EACV,gBAAgB;EAChB,YAAY;EACZ,kCAAkC;;EAElC,gDAAgD;AAClD;;AAEA;EACE,8CAA8C;EAC9C,UAAU;AACZ;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,qBAAqB;EACrB,eAAe;EACf,sBAAsB;EACtB,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,4DAA4D;EAC5D,aAAa;EACb,yCAAyC;EACzC,WAAW;AACb;;AAEA;EACE,uDAAuD;AACzD;;AAEA;;EAEE,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,YAAY;EACZ,sBAAsB;AACxB;;AAEA;EACE,cAAc;EACd,WAAW;EACX,YAAY;AACd;;AAEA;EACE,cAAc;EACd,sDAAsD;EACtD,uDAAuD;AACzD;;AAEA;;EAEE;6CAC2C;EAC3C,oBAAoB;AACtB;;AAEA;;;EAGE,aAAa;AACf;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,cAAc;EACd,iBAAiB;AACnB;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,8CAA8C;AAChD;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,qBAAqB;AACvB;;AAEA;EACE,qBAAqB;EACrB,kBAAkB;EAClB,iBAAiB;EACjB,mBAAmB;AACrB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,sDAAsD;EACtD,uDAAuD;EACvD,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,cAAc;EACd,gBAAgB;EAChB,WAAW;EACX,aAAa;EACb,sBAAsB;EACtB,8BAA8B;EAC9B,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,gBAAgB;EAChB,qBAAqB;EACrB,sBAAsB;EACtB,4DAA4D;EAC5D,gBAAgB;EAChB,gBAAgB;EAChB,mEAAmE;EACnE,cAAc;AAChB;;AAEA;EACE,8EAA8E;AAChF;;AAEA;EACE,qBAAqB;EACrB,kBAAkB;EAClB,eAAe;EACf,sBAAsB;EACtB,+BAA+B;;EAE/B,sCAAsC;EACtC,wEAAwE;EACxE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,iBAAiB;EACjB,aAAa;AACf;;AAEA;EACE,YAAY;EACZ,8CAA8C;EAC9C,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;;;;;;;CAOC;AACD;EACE,6BAA6B;EAC7B,kBAAkB;EAClB,gBAAgB;AAClB;;AAEA;EACE,oBAAoB;EACpB,oBAAoB;AACtB;;AAEA;;EAEE,WAAW;EACX,cAAc;EACd,cAAc;EACd,aAAa;EACb,gBAAgB;EAChB,SAAS;EACT,YAAY;EACZ,gBAAgB;EAChB,gBAAgB;EAChB,YAAY;EACZ,gBAAgB;AAClB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n.jp-DocumentSearch-input {\n  border: none;\n  outline: none;\n  color: var(--jp-ui-font-color0);\n  font-size: var(--jp-ui-font-size1);\n  background-color: var(--jp-layout-color0);\n  font-family: var(--jp-ui-font-family);\n  padding: 2px 1px;\n  resize: none;\n  white-space: pre;\n}\n\n.jp-DocumentSearch-overlay {\n  position: absolute;\n  background-color: var(--jp-toolbar-background);\n  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);\n  border-left: var(--jp-border-width) solid var(--jp-toolbar-border-color);\n  top: 0;\n  right: 0;\n  z-index: 7;\n  min-width: 405px;\n  padding: 2px;\n  font-size: var(--jp-ui-font-size1);\n\n  --jp-private-document-search-button-height: 20px;\n}\n\n.jp-DocumentSearch-overlay button {\n  background-color: var(--jp-toolbar-background);\n  outline: 0;\n}\n\n.jp-DocumentSearch-button-wrapper:disabled > .jp-DocumentSearch-button-content {\n  opacity: 0.6;\n  cursor: not-allowed;\n}\n\n.jp-DocumentSearch-overlay button:not(:disabled):hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-DocumentSearch-overlay button:not(:disabled):active {\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-DocumentSearch-overlay-row {\n  display: flex;\n  align-items: center;\n  margin-bottom: 2px;\n}\n\n.jp-DocumentSearch-button-content {\n  display: inline-block;\n  cursor: pointer;\n  box-sizing: border-box;\n  width: 100%;\n  height: 100%;\n}\n\n.jp-DocumentSearch-button-content svg {\n  width: 100%;\n  height: 100%;\n}\n\n.jp-DocumentSearch-input-wrapper {\n  border: var(--jp-border-width) solid var(--jp-border-color0);\n  display: flex;\n  background-color: var(--jp-layout-color0);\n  margin: 2px;\n}\n\n.jp-DocumentSearch-input-wrapper:focus-within {\n  border-color: var(--jp-cell-editor-active-border-color);\n}\n\n.jp-DocumentSearch-toggle-wrapper,\n.jp-DocumentSearch-button-wrapper {\n  all: initial;\n  overflow: hidden;\n  display: inline-block;\n  border: none;\n  box-sizing: border-box;\n}\n\n.jp-DocumentSearch-toggle-wrapper {\n  flex-shrink: 0;\n  width: 14px;\n  height: 14px;\n}\n\n.jp-DocumentSearch-button-wrapper {\n  flex-shrink: 0;\n  width: var(--jp-private-document-search-button-height);\n  height: var(--jp-private-document-search-button-height);\n}\n\n.jp-DocumentSearch-toggle-wrapper:focus,\n.jp-DocumentSearch-button-wrapper:focus {\n  outline: var(--jp-border-width) solid\n    var(--jp-cell-editor-active-border-color);\n  outline-offset: -1px;\n}\n\n.jp-DocumentSearch-toggle-wrapper,\n.jp-DocumentSearch-button-wrapper,\n.jp-DocumentSearch-button-content:focus {\n  outline: none;\n}\n\n.jp-DocumentSearch-toggle-placeholder {\n  width: 5px;\n}\n\n.jp-DocumentSearch-input-button::before {\n  display: block;\n  padding-top: 100%;\n}\n\n.jp-DocumentSearch-input-button-off {\n  opacity: var(--jp-search-toggle-off-opacity);\n}\n\n.jp-DocumentSearch-input-button-off:hover {\n  opacity: var(--jp-search-toggle-hover-opacity);\n}\n\n.jp-DocumentSearch-input-button-on {\n  opacity: var(--jp-search-toggle-on-opacity);\n}\n\n.jp-DocumentSearch-index-counter {\n  padding-left: 10px;\n  padding-right: 10px;\n  user-select: none;\n  min-width: 35px;\n  display: inline-block;\n}\n\n.jp-DocumentSearch-up-down-wrapper {\n  display: inline-block;\n  padding-right: 2px;\n  margin-left: auto;\n  white-space: nowrap;\n}\n\n.jp-DocumentSearch-spacer {\n  margin-left: auto;\n}\n\n.jp-DocumentSearch-up-down-wrapper button {\n  outline: 0;\n  border: none;\n  width: var(--jp-private-document-search-button-height);\n  height: var(--jp-private-document-search-button-height);\n  vertical-align: middle;\n  margin: 1px 5px 2px;\n}\n\nbutton:not(:disabled) > .jp-DocumentSearch-up-down-button:hover {\n  background-color: var(--jp-layout-color2);\n}\n\nbutton:not(:disabled) > .jp-DocumentSearch-up-down-button:active {\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-DocumentSearch-filter-button {\n  border-radius: var(--jp-border-radius);\n}\n\n.jp-DocumentSearch-filter-button:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-DocumentSearch-filter-button-enabled {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-DocumentSearch-filter-button-enabled:hover {\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-DocumentSearch-search-options {\n  padding: 0 8px;\n  margin-left: 3px;\n  width: 100%;\n  display: grid;\n  justify-content: start;\n  grid-template-columns: 1fr 1fr;\n  align-items: center;\n  justify-items: stretch;\n}\n\n.jp-DocumentSearch-search-filter-disabled {\n  color: var(--jp-ui-font-color2);\n}\n\n.jp-DocumentSearch-search-filter {\n  display: flex;\n  align-items: center;\n  user-select: none;\n}\n\n.jp-DocumentSearch-regex-error {\n  color: var(--jp-error-color0);\n}\n\n.jp-DocumentSearch-replace-button-wrapper {\n  overflow: hidden;\n  display: inline-block;\n  box-sizing: border-box;\n  border: var(--jp-border-width) solid var(--jp-border-color0);\n  margin: auto 2px;\n  padding: 1px 4px;\n  height: calc(var(--jp-private-document-search-button-height) + 2px);\n  flex-shrink: 0;\n}\n\n.jp-DocumentSearch-replace-button-wrapper:focus {\n  border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);\n}\n\n.jp-DocumentSearch-replace-button {\n  display: inline-block;\n  text-align: center;\n  cursor: pointer;\n  box-sizing: border-box;\n  color: var(--jp-ui-font-color1);\n\n  /* height - 2 * (padding of wrapper) */\n  line-height: calc(var(--jp-private-document-search-button-height) - 2px);\n  width: 100%;\n  height: 100%;\n}\n\n.jp-DocumentSearch-replace-button:focus {\n  outline: none;\n}\n\n.jp-DocumentSearch-replace-wrapper-class {\n  margin-left: 14px;\n  display: flex;\n}\n\n.jp-DocumentSearch-replace-toggle {\n  border: none;\n  background-color: var(--jp-toolbar-background);\n  border-radius: var(--jp-border-radius);\n}\n\n.jp-DocumentSearch-replace-toggle:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n/*\n  The following few rules allow the search box to expand horizontally,\n  as the text within it grows. This is done by using putting\n  the text within a wrapper element and using that wrapper for sizing,\n  as <textarea> and <input> tags do not grow automatically.\n  This is the underlying technique:\n  https://til.simonwillison.net/css/resizing-textarea\n*/\n.jp-DocumentSearch-input-label::after {\n  content: attr(data-value) ' ';\n  visibility: hidden;\n  white-space: pre;\n}\n\n.jp-DocumentSearch-input-label {\n  display: inline-grid;\n  align-items: stretch;\n}\n\n.jp-DocumentSearch-input-label::after,\n.jp-DocumentSearch-input-label > .jp-DocumentSearch-input {\n  width: auto;\n  min-width: 1em;\n  grid-area: 1/2;\n  font: inherit;\n  padding: 2px 3px;\n  margin: 0;\n  resize: none;\n  background: none;\n  appearance: none;\n  border: none;\n  overflow: hidden;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 36559:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*
  Main widget layout and styling
*/

.jp-extensionmanager-view .lm-SplitPanel-child {
  overflow-y: auto;
}

.jp-extensionmanager-header {
  width: 100%;
}

.jp-extensionmanager-title {
  display: flex;
  margin: 4px 10px 0;
}

.jp-extensionmanager-title svg {
  width: 14px;
}

.jp-extensionmanager-title .jp-icon3[fill] {
  fill: currentcolor;
}

.jp-extensionmanager-path {
  display: inline flex;
  padding-left: 4px;
}

.jp-extensionmanager-header .jp-FilterBox {
  margin: 4px 10px 0;
  width: calc(100% - 20px);
  font-weight: normal;
}

.jp-extensionmanager-disclaimer {
  padding: 0 8px;
  min-height: 160px;
}

.jp-extensionmanager-disclaimer a {
  color: var(--jp-content-link-color);
  text-decoration: none;
}

.jp-extensionmanager-disclaimer a:hover {
  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));
  text-decoration: underline;
}

.jp-extensionmanager-disclaimer .jp-Button {
  margin: 0 5px;
}

/*
  List view layout and styling
*/

.jp-extensionmanager-listview-wrapper {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.jp-extensionmanager-listview {
  list-style-type: none;
  margin: 0;
  padding: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

/*
  Section headers
*/

.jp-extensionmanager-view .jp-SidePanel-header .jp-extensionmanager-error {
  text-transform: none;
  font-size: var(--jp-ui-font-size1);
  font-weight: 400;
}

/*
  Error messages
*/

.jp-extensionmanager-view .jp-extensionmanager-error pre {
  white-space: pre-wrap;
}

/*
  List view pagination styling
*/

.jp-extensionmanager-view ul.pagination {
  display: flex;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.jp-extensionmanager-pagination li {
  display: inline-block;
}

/* stylelint-disable selector-max-type */
.jp-extensionmanager-pagination li > a {
  padding: 0 5px;
  cursor: pointer;
}
/* stylelint-enable selector-max-type */

.jp-extensionmanager-pagination li.active > a {
  background: var(--jp-brand-color1);
  color: var(--jp-layout-color1);
}

.jp-extensionmanager-pagination li > a:hover {
  background-color: var(--jp-layout-color2);
}

.jp-extensionmanager-pagination .break > a {
  cursor: default;
}

.jp-extensionmanager-installedlist,
.jp-extensionmanager-searchresults {
  min-height: 100px;
}

/*
  Entry layout and styling
*/

.jp-extensionmanager-entry {
  padding: 8px;
  border-bottom: solid var(--jp-border-width) var(--jp-border-color2);
}

.jp-extensionmanager-entry-description {
  min-width: 0;
  flex-grow: 1;
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color2);
  font-weight: 400;
}

.jp-extensionmanager-entry-title {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.jp-extensionmanager-entry.jp-extensionmanager-entry-should-be-uninstalled {
  background-color: var(--jp-error-color3);
}

/* Precedence order update/error/warning matters! */

.jp-extensionmanager-entry.jp-extensionmanager-entry-update {
  border-left: solid 8px var(--jp-brand-color2);
  padding-left: 4px;
}

.jp-extensionmanager-entry.jp-extensionmanager-entry-error {
  border-left: solid 8px var(--jp-error-color2);
  padding-left: 4px;
}

.jp-extensionmanager-entry-name {
  font-size: var(--jp-ui-font-size1);
  font-weight: 600;
  padding: 0 8px 0 0;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.jp-extensionmanager-entry-name a:link {
  color: var(--jp-content-link-color);
  text-decoration: none;
}

.jp-extensionmanager-entry-name a:visited {
  color: var(--jp-content-link-visited-color, var(--jp-content-link-color));
  text-decoration: none;
}

.jp-extensionmanager-entry-name a:hover {
  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));
  text-decoration: underline;
}

.jp-extensionmanager-loader,
.jp-extensionmanager-error,
.jp-extensionmanager-listview-message {
  padding: 4px 12px;
}

.jp-extensionmanager-listview-message {
  font-size: var(--jp-ui-font-size1);
}

.jp-extensionmanager-entry-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/*
  Pending entry progress indicator
*/

.jp-extensionmanager-pending {
  height: 4px;
  width: 100%;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  background-color: var(--jp-layout-color1);
}

.jp-extensionmanager-pending.jp-mod-hasPending::before {
  display: block;
  position: absolute;
  content: '';
  left: -200px;
  width: 200px;
  height: 4px;
  border-radius: 4px;
  background-color: var(--jp-brand-color1);
  animation: loading 2s linear infinite;
}

@keyframes loading {
  0% {
    left: -200px;
    width: 30%;
  }

  50% {
    width: 30%;
  }

  70% {
    width: 70%;
  }

  80% {
    left: 50%;
  }

  95% {
    left: 120%;
  }

  100% {
    left: 100%;
  }
}

/*
  Disclaimer buttons
*/

.jp-extensionmanager-disclaimer-disable {
  background-color: var(--jp-reject-color-normal) !important;
  color: white !important;
  border: 0;
  background-image: none !important;
}

.jp-extensionmanager-disclaimer-enable {
  background-color: var(--jp-error-color1) !important;
  color: white !important;
  border: 0;
  background-image: none !important;
}

/*
  Entry buttons layout and styling
*/

.jp-extensionmanager-entry-buttons {
  display: flex;
  flex-direction: row;
  padding-block-start: 4px;
  justify-content: flex-end;
}

/*
  Rebuild prompt dialog
*/

.jp-extensionmanager-buildprompt {
  background-color: var(--jp-brand-color1);
  color: var(--jp-ui-inverse-font-color1);
  padding: 4px 8px;
  font-size: var(--jp-ui-font-size1);
  font-weight: 400;
}

.jp-extensionmanager-buildprompt button {
  border: none;
  background-color: transparent;
  color: var(--jp-ui-inverse-font-color1);
  font-size: var(--jp-ui-font-size1);
  font-weight: 600;
  float: right;
  margin: 4px;
}

/*
  Generic dialog
*/

.jp-extensionmanager-dialog .jp-extensionmanager-dialog-subheader {
  font-size: var(--jp-ui-font-size1);
  font-weight: 600;
  color: var(--jp-ui-font-color0);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/extensionmanager/style/base.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;CAEC;;AAED;EACE,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,kBAAkB;AACpB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,oBAAoB;EACpB,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;EAClB,wBAAwB;EACxB,mBAAmB;AACrB;;AAEA;EACE,cAAc;EACd,iBAAiB;AACnB;;AAEA;EACE,mCAAmC;EACnC,qBAAqB;AACvB;;AAEA;EACE,uEAAuE;EACvE,0BAA0B;AAC5B;;AAEA;EACE,aAAa;AACf;;AAEA;;CAEC;;AAED;EACE,SAAS;EACT,UAAU;EACV,aAAa;EACb,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,qBAAqB;EACrB,SAAS;EACT,UAAU;EACV,aAAa;EACb,cAAc;EACd,cAAc;AAChB;;AAEA;;CAEC;;AAED;EACE,oBAAoB;EACpB,kCAAkC;EAClC,gBAAgB;AAClB;;AAEA;;CAEC;;AAED;EACE,qBAAqB;AACvB;;AAEA;;CAEC;;AAED;EACE,aAAa;EACb,uBAAuB;EACvB,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,qBAAqB;AACvB;;AAEA,wCAAwC;AACxC;EACE,cAAc;EACd,eAAe;AACjB;AACA,uCAAuC;;AAEvC;EACE,kCAAkC;EAClC,8BAA8B;AAChC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,eAAe;AACjB;;AAEA;;EAEE,iBAAiB;AACnB;;AAEA;;CAEC;;AAED;EACE,YAAY;EACZ,mEAAmE;AACrE;;AAEA;EACE,YAAY;EACZ,YAAY;EACZ,kCAAkC;EAClC,+BAA+B;EAC/B,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,mBAAmB;AACrB;;AAEA;EACE,wCAAwC;AAC1C;;AAEA,mDAAmD;;AAEnD;EACE,6CAA6C;EAC7C,iBAAiB;AACnB;;AAEA;EACE,6CAA6C;EAC7C,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;EAClC,gBAAgB;EAChB,kBAAkB;EAClB,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,mCAAmC;EACnC,qBAAqB;AACvB;;AAEA;EACE,yEAAyE;EACzE,qBAAqB;AACvB;;AAEA;EACE,uEAAuE;EACvE,0BAA0B;AAC5B;;AAEA;;;EAGE,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,8BAA8B;AAChC;;AAEA;;CAEC;;AAED;EACE,WAAW;EACX,WAAW;EACX,kBAAkB;EAClB,gBAAgB;EAChB,cAAc;EACd,yCAAyC;AAC3C;;AAEA;EACE,cAAc;EACd,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,kBAAkB;EAClB,wCAAwC;EACxC,qCAAqC;AACvC;;AAEA;EACE;IACE,YAAY;IACZ,UAAU;EACZ;;EAEA;IACE,UAAU;EACZ;;EAEA;IACE,UAAU;EACZ;;EAEA;IACE,SAAS;EACX;;EAEA;IACE,UAAU;EACZ;;EAEA;IACE,UAAU;EACZ;AACF;;AAEA;;CAEC;;AAED;EACE,0DAA0D;EAC1D,uBAAuB;EACvB,SAAS;EACT,iCAAiC;AACnC;;AAEA;EACE,mDAAmD;EACnD,uBAAuB;EACvB,SAAS;EACT,iCAAiC;AACnC;;AAEA;;CAEC;;AAED;EACE,aAAa;EACb,mBAAmB;EACnB,wBAAwB;EACxB,yBAAyB;AAC3B;;AAEA;;CAEC;;AAED;EACE,wCAAwC;EACxC,uCAAuC;EACvC,gBAAgB;EAChB,kCAAkC;EAClC,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,6BAA6B;EAC7B,uCAAuC;EACvC,kCAAkC;EAClC,gBAAgB;EAChB,YAAY;EACZ,WAAW;AACb;;AAEA;;CAEC;;AAED;EACE,kCAAkC;EAClC,gBAAgB;EAChB,+BAA+B;AACjC","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n  Main widget layout and styling\n*/\n\n.jp-extensionmanager-view .lm-SplitPanel-child {\n  overflow-y: auto;\n}\n\n.jp-extensionmanager-header {\n  width: 100%;\n}\n\n.jp-extensionmanager-title {\n  display: flex;\n  margin: 4px 10px 0;\n}\n\n.jp-extensionmanager-title svg {\n  width: 14px;\n}\n\n.jp-extensionmanager-title .jp-icon3[fill] {\n  fill: currentcolor;\n}\n\n.jp-extensionmanager-path {\n  display: inline flex;\n  padding-left: 4px;\n}\n\n.jp-extensionmanager-header .jp-FilterBox {\n  margin: 4px 10px 0;\n  width: calc(100% - 20px);\n  font-weight: normal;\n}\n\n.jp-extensionmanager-disclaimer {\n  padding: 0 8px;\n  min-height: 160px;\n}\n\n.jp-extensionmanager-disclaimer a {\n  color: var(--jp-content-link-color);\n  text-decoration: none;\n}\n\n.jp-extensionmanager-disclaimer a:hover {\n  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));\n  text-decoration: underline;\n}\n\n.jp-extensionmanager-disclaimer .jp-Button {\n  margin: 0 5px;\n}\n\n/*\n  List view layout and styling\n*/\n\n.jp-extensionmanager-listview-wrapper {\n  margin: 0;\n  padding: 0;\n  display: flex;\n  flex-direction: column;\n  height: 100%;\n}\n\n.jp-extensionmanager-listview {\n  list-style-type: none;\n  margin: 0;\n  padding: 0;\n  min-height: 0;\n  flex: 1 1 auto;\n  overflow: auto;\n}\n\n/*\n  Section headers\n*/\n\n.jp-extensionmanager-view .jp-SidePanel-header .jp-extensionmanager-error {\n  text-transform: none;\n  font-size: var(--jp-ui-font-size1);\n  font-weight: 400;\n}\n\n/*\n  Error messages\n*/\n\n.jp-extensionmanager-view .jp-extensionmanager-error pre {\n  white-space: pre-wrap;\n}\n\n/*\n  List view pagination styling\n*/\n\n.jp-extensionmanager-view ul.pagination {\n  display: flex;\n  justify-content: center;\n  padding-left: 0;\n  padding-right: 0;\n}\n\n.jp-extensionmanager-pagination li {\n  display: inline-block;\n}\n\n/* stylelint-disable selector-max-type */\n.jp-extensionmanager-pagination li > a {\n  padding: 0 5px;\n  cursor: pointer;\n}\n/* stylelint-enable selector-max-type */\n\n.jp-extensionmanager-pagination li.active > a {\n  background: var(--jp-brand-color1);\n  color: var(--jp-layout-color1);\n}\n\n.jp-extensionmanager-pagination li > a:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-extensionmanager-pagination .break > a {\n  cursor: default;\n}\n\n.jp-extensionmanager-installedlist,\n.jp-extensionmanager-searchresults {\n  min-height: 100px;\n}\n\n/*\n  Entry layout and styling\n*/\n\n.jp-extensionmanager-entry {\n  padding: 8px;\n  border-bottom: solid var(--jp-border-width) var(--jp-border-color2);\n}\n\n.jp-extensionmanager-entry-description {\n  min-width: 0;\n  flex-grow: 1;\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color2);\n  font-weight: 400;\n}\n\n.jp-extensionmanager-entry-title {\n  display: flex;\n  flex-direction: row;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.jp-extensionmanager-entry.jp-extensionmanager-entry-should-be-uninstalled {\n  background-color: var(--jp-error-color3);\n}\n\n/* Precedence order update/error/warning matters! */\n\n.jp-extensionmanager-entry.jp-extensionmanager-entry-update {\n  border-left: solid 8px var(--jp-brand-color2);\n  padding-left: 4px;\n}\n\n.jp-extensionmanager-entry.jp-extensionmanager-entry-error {\n  border-left: solid 8px var(--jp-error-color2);\n  padding-left: 4px;\n}\n\n.jp-extensionmanager-entry-name {\n  font-size: var(--jp-ui-font-size1);\n  font-weight: 600;\n  padding: 0 8px 0 0;\n  margin-bottom: 4px;\n  overflow-wrap: anywhere;\n}\n\n.jp-extensionmanager-entry-name a:link {\n  color: var(--jp-content-link-color);\n  text-decoration: none;\n}\n\n.jp-extensionmanager-entry-name a:visited {\n  color: var(--jp-content-link-visited-color, var(--jp-content-link-color));\n  text-decoration: none;\n}\n\n.jp-extensionmanager-entry-name a:hover {\n  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));\n  text-decoration: underline;\n}\n\n.jp-extensionmanager-loader,\n.jp-extensionmanager-error,\n.jp-extensionmanager-listview-message {\n  padding: 4px 12px;\n}\n\n.jp-extensionmanager-listview-message {\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-extensionmanager-entry-content {\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n/*\n  Pending entry progress indicator\n*/\n\n.jp-extensionmanager-pending {\n  height: 4px;\n  width: 100%;\n  position: relative;\n  overflow: hidden;\n  flex: 0 0 auto;\n  background-color: var(--jp-layout-color1);\n}\n\n.jp-extensionmanager-pending.jp-mod-hasPending::before {\n  display: block;\n  position: absolute;\n  content: '';\n  left: -200px;\n  width: 200px;\n  height: 4px;\n  border-radius: 4px;\n  background-color: var(--jp-brand-color1);\n  animation: loading 2s linear infinite;\n}\n\n@keyframes loading {\n  0% {\n    left: -200px;\n    width: 30%;\n  }\n\n  50% {\n    width: 30%;\n  }\n\n  70% {\n    width: 70%;\n  }\n\n  80% {\n    left: 50%;\n  }\n\n  95% {\n    left: 120%;\n  }\n\n  100% {\n    left: 100%;\n  }\n}\n\n/*\n  Disclaimer buttons\n*/\n\n.jp-extensionmanager-disclaimer-disable {\n  background-color: var(--jp-reject-color-normal) !important;\n  color: white !important;\n  border: 0;\n  background-image: none !important;\n}\n\n.jp-extensionmanager-disclaimer-enable {\n  background-color: var(--jp-error-color1) !important;\n  color: white !important;\n  border: 0;\n  background-image: none !important;\n}\n\n/*\n  Entry buttons layout and styling\n*/\n\n.jp-extensionmanager-entry-buttons {\n  display: flex;\n  flex-direction: row;\n  padding-block-start: 4px;\n  justify-content: flex-end;\n}\n\n/*\n  Rebuild prompt dialog\n*/\n\n.jp-extensionmanager-buildprompt {\n  background-color: var(--jp-brand-color1);\n  color: var(--jp-ui-inverse-font-color1);\n  padding: 4px 8px;\n  font-size: var(--jp-ui-font-size1);\n  font-weight: 400;\n}\n\n.jp-extensionmanager-buildprompt button {\n  border: none;\n  background-color: transparent;\n  color: var(--jp-ui-inverse-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  font-weight: 600;\n  float: right;\n  margin: 4px;\n}\n\n/*\n  Generic dialog\n*/\n\n.jp-extensionmanager-dialog .jp-extensionmanager-dialog-subheader {\n  font-size: var(--jp-ui-font-size1);\n  font-weight: 600;\n  color: var(--jp-ui-font-color0);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 15272:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

#filebrowser.jp-mod-restoring .jp-DirListing-content {
  display: none;
}

.jp-FileBrowser-filterBox {
  padding: 0;
  flex: 0 0 auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/filebrowser-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;AACf;;AAEA;EACE,UAAU;EACV,cAAc;AAChB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n#filebrowser.jp-mod-restoring .jp-DirListing-content {\n  display: none;\n}\n\n.jp-FileBrowser-filterBox {\n  padding: 0;\n  flex: 0 0 auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 34893:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --jp-private-filebrowser-button-height: 28px;
  --jp-private-filebrowser-button-width: 48px;
}

.jp-FileBrowser .jp-SidePanel-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.jp-FileBrowser-toolbar.jp-Toolbar {
  border-bottom: none;
  height: auto;
  margin: 8px 12px 0;
  box-shadow: none;
  padding: 0;
}

.jp-FileBrowser-toolbar.jp-Toolbar::part(positioning-region) {
  row-gap: 12px;
}

.jp-FileBrowser-filterToolbar {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
}

.jp-FileBrowser-filterToolbar.jp-Toolbar {
  border-bottom: none;
  height: auto;
  margin: 0 12px 6px;
  box-shadow: none;
  padding: 0;
}

.jp-FileBrowser-Panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.jp-BreadCrumbs {
  flex: 0 0 auto;
  margin: 8px 12px;
}

.jp-BreadCrumbs-item {
  margin: 0 2px;
  padding: 0 2px;
  border-radius: var(--jp-border-radius);
  cursor: pointer;
}

.jp-BreadCrumbs-item:hover {
  background-color: var(--jp-layout-color2);
}

.jp-BreadCrumbs-item:first-child {
  margin-left: 0;
}

.jp-BreadCrumbs-item.jp-mod-dropTarget {
  background-color: var(--jp-brand-color2);
  opacity: 0.7;
}

/*-----------------------------------------------------------------------------
| Buttons
|----------------------------------------------------------------------------*/

.jp-FileBrowser-toolbar > .jp-Toolbar-item,
.jp-FileBrowser-filterToolbar > .jp-Toolbar-item {
  flex: 0 0 auto;
  padding-left: 0;
  align-items: center;
  height: unset;
}

.jp-FileBrowser-toolbar > .jp-Toolbar-item .jp-ToolbarButtonComponent {
  width: 28px;
}

/*-----------------------------------------------------------------------------
| Other styles
|----------------------------------------------------------------------------*/

.jp-FileDialog.jp-mod-conflict input {
  color: var(--jp-error-color1);
}

.jp-FileDialog .jp-new-name-title {
  margin-top: 12px;
}

.jp-FileBrowser .lm-AccordionPanel > h3:first-child {
  display: none;
}

.jp-FileBrowser-filterToolbar > .jp-FileBrowser-filterBox {
  width: 100%;
}

.jp-FileBrowser-filterBox > .jp-FilterBox {
  width: 100%;
}

.jp-Open-Dialog > .jp-FileBrowser {
  min-height: 200px;
}

.jp-Open-Dialog-label {
  overflow: visible;
}

/*-----------------------------------------------------------------------------
| DirListing
|----------------------------------------------------------------------------*/

.jp-DirListing {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  outline: 0;
  overflow: hidden;

  --jp-dirlisting-padding-width: 12px;
}

.jp-DirListing-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow: hidden;
  border-top: var(--jp-border-width) solid var(--jp-border-color2);
  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
  box-shadow: var(--jp-toolbar-box-shadow);
  z-index: 2;
  user-select: none;
}

.jp-DirListing-headerItem {
  padding: 4px 12px 2px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  box-sizing: border-box;
  display: flex;
}

.jp-DirListing-headerItemText {
  flex-grow: 1;
  text-overflow: ellipsis;
  overflow: hidden;
}

.jp-DirListing-headerItem:hover {
  background: var(--jp-layout-color2);
}

.jp-DirListing-headerItem.jp-id-name:not([style*='width']) {
  /* default width before user resizes this column */
  flex: 1 1 126px;
}

.jp-DirListing-headerItem.jp-id-modified:not([style*='width']) {
  /* default width before user resizes this column */
  flex: 1 0 70px;
}

.jp-DirListing-headerItem.jp-id-filesize:not([style*='width']) {
  /* default width before user resizes this column */
  flex: 0 0 75px;
}

.jp-DirListing-headerItem.jp-id-modified,
.jp-DirListing-headerItem.jp-id-filesize {
  text-align: right;
  /* stylelint-disable */
  container-type: inline-size;
  /* stylelint-enable */
}

/**
 * Use container queries (not yet supported by our version of stylelint)
 * to display either a small or large header for the last-modified column.
 */
/* stylelint-disable */
@container (max-width: 300px) {
  /* stylelint-enable */
  .jp-DirListing-headerItem.jp-id-modified
    > .jp-DirListing-headerItemText-small,
  .jp-DirListing-headerItem.jp-id-filesize
    > .jp-DirListing-headerItemText-small {
    display: inline;
  }

  .jp-DirListing-headerItem.jp-id-modified
    > .jp-DirListing-headerItemText-large,
  .jp-DirListing-headerItem.jp-id-filesize
    > .jp-DirListing-headerItemText-large {
    display: none;
  }
}

/* stylelint-disable */
@container (min-width: 300px) {
  /* stylelint-enable */
  .jp-DirListing-headerItem.jp-id-modified
    > .jp-DirListing-headerItemText-small {
    display: none;
  }

  .jp-DirListing-headerItem.jp-id-modified
    > .jp-DirListing-headerItemText-large {
    display: inline;
  }
}

/* stylelint-disable */
@container (max-width: 100px) {
  /* stylelint-enable */
  .jp-DirListing-headerItem.jp-id-filesize
    > .jp-DirListing-headerItemText-small {
    display: inline;
  }

  .jp-DirListing-headerItem.jp-id-filesize
    > .jp-DirListing-headerItemText-large {
    display: none;
  }
}

/* stylelint-disable */
@container (min-width: 100px) {
  /* stylelint-enable */
  .jp-DirListing-headerItem.jp-id-filesize
    > .jp-DirListing-headerItemText-small {
    display: none;
  }

  .jp-DirListing-headerItem.jp-id-filesize
    > .jp-DirListing-headerItemText-large {
    display: inline;
  }
}

.jp-DirListing-headerItem.jp-mod-selected {
  font-weight: 600;
}

/* increase specificity to override bundled default */
.jp-DirListing-content {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  list-style-type: none;
  overflow: auto;
  background-color: var(--jp-layout-color1);
  overflow-x: hidden;
}

.jp-DirListing-content mark {
  color: var(--jp-ui-font-color0);
  background-color: transparent;
  font-weight: bold;
}

.jp-DirListing-content .jp-DirListing-item.jp-mod-selected mark {
  color: var(--jp-ui-inverse-font-color0);
}

/* Style the directory listing content when a user drops a file to upload */
.jp-DirListing.jp-mod-native-drop .jp-DirListing-content {
  outline: 5px dashed rgba(128, 128, 128, 0.5);
  outline-offset: -10px;
  cursor: copy;
}

.jp-DirListing-item {
  align-items: center;
  padding: 4px var(--jp-dirlisting-padding-width);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  display: inline-grid;
  grid-auto-columns: max-content;
  width: 100%;
  box-sizing: border-box;
  grid-auto-flow: column;
}

.jp-DirListing-checkboxWrapper {
  /* Increases hit area of checkbox. */
  padding: 4px;
}

.jp-DirListing-content .jp-DirListing-checkboxWrapper {
  position: relative;
  left: -4px;
  margin: -4px 0 -4px -8px;
}

.jp-DirListing-checkboxWrapper.jp-mod-visible {
  visibility: visible;
}

/* For devices that support hovering, hide checkboxes until hovered, selected...
*/
@media (hover: hover) {
  .jp-DirListing-checkboxWrapper {
    visibility: hidden;
  }

  .jp-DirListing-item:hover .jp-DirListing-checkboxWrapper,
  .jp-DirListing-item.jp-mod-selected .jp-DirListing-checkboxWrapper {
    visibility: visible;
  }
}

.jp-DirListing-resizeHandle {
  min-width: var(--jp-border-width);
  background: var(--jp-border-color2);
  height: calc(100% - 4px);

  /* border increases the area where handle can be grabbed */
  border: 2px solid var(--jp-layout-color1);
}

.jp-DirListing-resizeHandle.jp-mod-active {
  background: var(--jp-brand-color1);
  border-color: var(--jp-brand-color1);
}

.jp-DirListing-resizeHandle.jp-mod-active:hover {
  border-color: var(--jp-brand-color1);
}

.jp-DirListing-resizeHandle:hover {
  cursor: col-resize;
  border-color: var(--jp-border-color2);
}

.jp-DirListing-itemName {
  display: flex;
}

.jp-DirListing-item[data-is-dot] {
  opacity: 75%;
}

.jp-DirListing-item.jp-mod-selected {
  color: var(--jp-ui-inverse-font-color1);
  background: var(--jp-brand-color1);
}

.jp-DirListing-item.jp-mod-dropTarget {
  background: var(--jp-brand-color3);
}

.jp-DirListing-item:hover:not(.jp-mod-selected) {
  background: var(--jp-layout-color2);
}

.jp-DirListing-itemIcon {
  flex: 0 0 20px;
  margin-right: 4px;
}

.jp-DirListing-itemText,
.jp-DirListing-itemModified,
.jp-DirListing-itemFileSize {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-DirListing-itemName:not([style*='width']) > .jp-DirListing-itemText {
  flex: 1 1 106px;
}

.jp-DirListing-item:has(.jp-DirListing-itemText:focus-visible) {
  /* Targeting \`.jp-DirListing-itemText\` specifically to avoid an extra outline
  when it gets replaced with \`jp-DirListing-editor\` when editing the file name */
  outline-width: 2px;
  outline-color: var(--jp-inverse-layout-color1);
  outline-style: solid;
  outline-offset: -4px;
}

.jp-DirListing-item.jp-mod-selected:focus-within {
  outline-color: var(--jp-layout-color1);
}

.jp-DirListing-item > .jp-DirListing-itemName > .jp-DirListing-itemText:focus {
  outline: 0;
}

.jp-DirListing-itemModified {
  text-align: right;
}

.jp-DirListing-itemFileSize {
  text-align: right;
}

.jp-DirListing-editor {
  flex: 1 0 64px;
  outline: none;
  border: none;
  color: var(--jp-ui-font-color1);
  background-color: var(--jp-layout-color1);
  z-index: 0;
}

.jp-DirListing-item.jp-mod-running .jp-DirListing-itemIcon::before {
  color: var(--jp-success-color1);
  content: '\\25CF';
  font-size: 8px;
  position: absolute;
  left: -8px;
}

.jp-DirListing-item.jp-mod-running.jp-mod-selected
  .jp-DirListing-itemIcon::before {
  color: var(--jp-ui-inverse-font-color1);
}

.jp-DirListing-item.lm-mod-drag-image,
.jp-DirListing-item.jp-mod-selected.lm-mod-drag-image {
  font-size: var(--jp-ui-font-size1);
  padding-left: 4px;
  margin-left: 4px;
  width: 160px;
  background-color: var(--jp-ui-inverse-font-color2);
  box-shadow: var(--jp-elevation-z2);
  border-radius: 0;
  color: var(--jp-ui-font-color1);
  transform: translateX(-40%) translateY(-58%);
}

.jp-Document {
  min-width: 120px;
  min-height: 120px;
  outline: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/filebrowser/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,4CAA4C;EAC5C,2CAA2C;AAC7C;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;EACnB,YAAY;EACZ,kBAAkB;EAClB,gBAAgB;EAChB,UAAU;AACZ;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;EACb,cAAc;EACd,sBAAsB;AACxB;;AAEA;EACE,mBAAmB;EACnB,YAAY;EACZ,kBAAkB;EAClB,gBAAgB;EAChB,UAAU;AACZ;;AAEA;EACE,cAAc;EACd,aAAa;EACb,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,cAAc;EACd,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,cAAc;EACd,sCAAsC;EACtC,eAAe;AACjB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,wCAAwC;EACxC,YAAY;AACd;;AAEA;;8EAE8E;;AAE9E;;EAEE,cAAc;EACd,eAAe;EACf,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,WAAW;AACb;;AAEA;;8EAE8E;;AAE9E;EACE,6BAA6B;AAC/B;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;8EAE8E;;AAE9E;EACE,cAAc;EACd,aAAa;EACb,sBAAsB;EACtB,UAAU;EACV,gBAAgB;;EAEhB,mCAAmC;AACrC;;AAEA;EACE,cAAc;EACd,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,gEAAgE;EAChE,mEAAmE;EACnE,wCAAwC;EACxC,UAAU;EACV,iBAAiB;AACnB;;AAEA;EACE,qBAAqB;EACrB,gBAAgB;EAChB,gBAAgB;EAChB,mBAAmB;EACnB,sBAAsB;EACtB,aAAa;AACf;;AAEA;EACE,YAAY;EACZ,uBAAuB;EACvB,gBAAgB;AAClB;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,kDAAkD;EAClD,eAAe;AACjB;;AAEA;EACE,kDAAkD;EAClD,cAAc;AAChB;;AAEA;EACE,kDAAkD;EAClD,cAAc;AAChB;;AAEA;;EAEE,iBAAiB;EACjB,sBAAsB;EACtB,2BAA2B;EAC3B,qBAAqB;AACvB;;AAEA;;;EAGE;AACF,sBAAsB;AACtB;EACE,qBAAqB;EACrB;;;;IAIE,eAAe;EACjB;;EAEA;;;;IAIE,aAAa;EACf;AACF;;AAEA,sBAAsB;AACtB;EACE,qBAAqB;EACrB;;IAEE,aAAa;EACf;;EAEA;;IAEE,eAAe;EACjB;AACF;;AAEA,sBAAsB;AACtB;EACE,qBAAqB;EACrB;;IAEE,eAAe;EACjB;;EAEA;;IAEE,aAAa;EACf;AACF;;AAEA,sBAAsB;AACtB;EACE,qBAAqB;EACrB;;IAEE,aAAa;EACf;;EAEA;;IAEE,eAAe;EACjB;AACF;;AAEA;EACE,gBAAgB;AAClB;;AAEA,qDAAqD;AACrD;EACE,cAAc;EACd,SAAS;EACT,UAAU;EACV,qBAAqB;EACrB,cAAc;EACd,yCAAyC;EACzC,kBAAkB;AACpB;;AAEA;EACE,+BAA+B;EAC/B,6BAA6B;EAC7B,iBAAiB;AACnB;;AAEA;EACE,uCAAuC;AACzC;;AAEA,2EAA2E;AAC3E;EACE,4CAA4C;EAC5C,qBAAqB;EACrB,YAAY;AACd;;AAEA;EACE,mBAAmB;EACnB,+CAA+C;EAC/C,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;EACjB,oBAAoB;EACpB,8BAA8B;EAC9B,WAAW;EACX,sBAAsB;EACtB,sBAAsB;AACxB;;AAEA;EACE,oCAAoC;EACpC,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,UAAU;EACV,wBAAwB;AAC1B;;AAEA;EACE,mBAAmB;AACrB;;AAEA;CACC;AACD;EACE;IACE,kBAAkB;EACpB;;EAEA;;IAEE,mBAAmB;EACrB;AACF;;AAEA;EACE,iCAAiC;EACjC,mCAAmC;EACnC,wBAAwB;;EAExB,0DAA0D;EAC1D,yCAAyC;AAC3C;;AAEA;EACE,kCAAkC;EAClC,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,kBAAkB;EAClB,qCAAqC;AACvC;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,uCAAuC;EACvC,kCAAkC;AACpC;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,cAAc;EACd,iBAAiB;AACnB;;AAEA;;;EAGE,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE;gFAC8E;EAC9E,kBAAkB;EAClB,8CAA8C;EAC9C,oBAAoB;EACpB,oBAAoB;AACtB;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,cAAc;EACd,aAAa;EACb,YAAY;EACZ,+BAA+B;EAC/B,yCAAyC;EACzC,UAAU;AACZ;;AAEA;EACE,+BAA+B;EAC/B,gBAAgB;EAChB,cAAc;EACd,kBAAkB;EAClB,UAAU;AACZ;;AAEA;;EAEE,uCAAuC;AACzC;;AAEA;;EAEE,kCAAkC;EAClC,iBAAiB;EACjB,gBAAgB;EAChB,YAAY;EACZ,kDAAkD;EAClD,kCAAkC;EAClC,gBAAgB;EAChB,+BAA+B;EAC/B,4CAA4C;AAC9C;;AAEA;EACE,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;AACf","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-filebrowser-button-height: 28px;\n  --jp-private-filebrowser-button-width: 48px;\n}\n\n.jp-FileBrowser .jp-SidePanel-content {\n  display: flex;\n  flex-direction: column;\n  overflow: hidden;\n}\n\n.jp-FileBrowser-toolbar.jp-Toolbar {\n  border-bottom: none;\n  height: auto;\n  margin: 8px 12px 0;\n  box-shadow: none;\n  padding: 0;\n}\n\n.jp-FileBrowser-toolbar.jp-Toolbar::part(positioning-region) {\n  row-gap: 12px;\n}\n\n.jp-FileBrowser-filterToolbar {\n  display: flex;\n  flex: 0 0 auto;\n  flex-direction: column;\n}\n\n.jp-FileBrowser-filterToolbar.jp-Toolbar {\n  border-bottom: none;\n  height: auto;\n  margin: 0 12px 6px;\n  box-shadow: none;\n  padding: 0;\n}\n\n.jp-FileBrowser-Panel {\n  flex: 1 1 auto;\n  display: flex;\n  flex-direction: column;\n  overflow: hidden;\n}\n\n.jp-BreadCrumbs {\n  flex: 0 0 auto;\n  margin: 8px 12px;\n}\n\n.jp-BreadCrumbs-item {\n  margin: 0 2px;\n  padding: 0 2px;\n  border-radius: var(--jp-border-radius);\n  cursor: pointer;\n}\n\n.jp-BreadCrumbs-item:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-BreadCrumbs-item:first-child {\n  margin-left: 0;\n}\n\n.jp-BreadCrumbs-item.jp-mod-dropTarget {\n  background-color: var(--jp-brand-color2);\n  opacity: 0.7;\n}\n\n/*-----------------------------------------------------------------------------\n| Buttons\n|----------------------------------------------------------------------------*/\n\n.jp-FileBrowser-toolbar > .jp-Toolbar-item,\n.jp-FileBrowser-filterToolbar > .jp-Toolbar-item {\n  flex: 0 0 auto;\n  padding-left: 0;\n  align-items: center;\n  height: unset;\n}\n\n.jp-FileBrowser-toolbar > .jp-Toolbar-item .jp-ToolbarButtonComponent {\n  width: 28px;\n}\n\n/*-----------------------------------------------------------------------------\n| Other styles\n|----------------------------------------------------------------------------*/\n\n.jp-FileDialog.jp-mod-conflict input {\n  color: var(--jp-error-color1);\n}\n\n.jp-FileDialog .jp-new-name-title {\n  margin-top: 12px;\n}\n\n.jp-FileBrowser .lm-AccordionPanel > h3:first-child {\n  display: none;\n}\n\n.jp-FileBrowser-filterToolbar > .jp-FileBrowser-filterBox {\n  width: 100%;\n}\n\n.jp-FileBrowser-filterBox > .jp-FilterBox {\n  width: 100%;\n}\n\n.jp-Open-Dialog > .jp-FileBrowser {\n  min-height: 200px;\n}\n\n.jp-Open-Dialog-label {\n  overflow: visible;\n}\n\n/*-----------------------------------------------------------------------------\n| DirListing\n|----------------------------------------------------------------------------*/\n\n.jp-DirListing {\n  flex: 1 1 auto;\n  display: flex;\n  flex-direction: column;\n  outline: 0;\n  overflow: hidden;\n\n  --jp-dirlisting-padding-width: 12px;\n}\n\n.jp-DirListing-header {\n  flex: 0 0 auto;\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  overflow: hidden;\n  border-top: var(--jp-border-width) solid var(--jp-border-color2);\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n  box-shadow: var(--jp-toolbar-box-shadow);\n  z-index: 2;\n  user-select: none;\n}\n\n.jp-DirListing-headerItem {\n  padding: 4px 12px 2px;\n  font-weight: 500;\n  overflow: hidden;\n  white-space: nowrap;\n  box-sizing: border-box;\n  display: flex;\n}\n\n.jp-DirListing-headerItemText {\n  flex-grow: 1;\n  text-overflow: ellipsis;\n  overflow: hidden;\n}\n\n.jp-DirListing-headerItem:hover {\n  background: var(--jp-layout-color2);\n}\n\n.jp-DirListing-headerItem.jp-id-name:not([style*='width']) {\n  /* default width before user resizes this column */\n  flex: 1 1 126px;\n}\n\n.jp-DirListing-headerItem.jp-id-modified:not([style*='width']) {\n  /* default width before user resizes this column */\n  flex: 1 0 70px;\n}\n\n.jp-DirListing-headerItem.jp-id-filesize:not([style*='width']) {\n  /* default width before user resizes this column */\n  flex: 0 0 75px;\n}\n\n.jp-DirListing-headerItem.jp-id-modified,\n.jp-DirListing-headerItem.jp-id-filesize {\n  text-align: right;\n  /* stylelint-disable */\n  container-type: inline-size;\n  /* stylelint-enable */\n}\n\n/**\n * Use container queries (not yet supported by our version of stylelint)\n * to display either a small or large header for the last-modified column.\n */\n/* stylelint-disable */\n@container (max-width: 300px) {\n  /* stylelint-enable */\n  .jp-DirListing-headerItem.jp-id-modified\n    > .jp-DirListing-headerItemText-small,\n  .jp-DirListing-headerItem.jp-id-filesize\n    > .jp-DirListing-headerItemText-small {\n    display: inline;\n  }\n\n  .jp-DirListing-headerItem.jp-id-modified\n    > .jp-DirListing-headerItemText-large,\n  .jp-DirListing-headerItem.jp-id-filesize\n    > .jp-DirListing-headerItemText-large {\n    display: none;\n  }\n}\n\n/* stylelint-disable */\n@container (min-width: 300px) {\n  /* stylelint-enable */\n  .jp-DirListing-headerItem.jp-id-modified\n    > .jp-DirListing-headerItemText-small {\n    display: none;\n  }\n\n  .jp-DirListing-headerItem.jp-id-modified\n    > .jp-DirListing-headerItemText-large {\n    display: inline;\n  }\n}\n\n/* stylelint-disable */\n@container (max-width: 100px) {\n  /* stylelint-enable */\n  .jp-DirListing-headerItem.jp-id-filesize\n    > .jp-DirListing-headerItemText-small {\n    display: inline;\n  }\n\n  .jp-DirListing-headerItem.jp-id-filesize\n    > .jp-DirListing-headerItemText-large {\n    display: none;\n  }\n}\n\n/* stylelint-disable */\n@container (min-width: 100px) {\n  /* stylelint-enable */\n  .jp-DirListing-headerItem.jp-id-filesize\n    > .jp-DirListing-headerItemText-small {\n    display: none;\n  }\n\n  .jp-DirListing-headerItem.jp-id-filesize\n    > .jp-DirListing-headerItemText-large {\n    display: inline;\n  }\n}\n\n.jp-DirListing-headerItem.jp-mod-selected {\n  font-weight: 600;\n}\n\n/* increase specificity to override bundled default */\n.jp-DirListing-content {\n  flex: 1 1 auto;\n  margin: 0;\n  padding: 0;\n  list-style-type: none;\n  overflow: auto;\n  background-color: var(--jp-layout-color1);\n  overflow-x: hidden;\n}\n\n.jp-DirListing-content mark {\n  color: var(--jp-ui-font-color0);\n  background-color: transparent;\n  font-weight: bold;\n}\n\n.jp-DirListing-content .jp-DirListing-item.jp-mod-selected mark {\n  color: var(--jp-ui-inverse-font-color0);\n}\n\n/* Style the directory listing content when a user drops a file to upload */\n.jp-DirListing.jp-mod-native-drop .jp-DirListing-content {\n  outline: 5px dashed rgba(128, 128, 128, 0.5);\n  outline-offset: -10px;\n  cursor: copy;\n}\n\n.jp-DirListing-item {\n  align-items: center;\n  padding: 4px var(--jp-dirlisting-padding-width);\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  display: inline-grid;\n  grid-auto-columns: max-content;\n  width: 100%;\n  box-sizing: border-box;\n  grid-auto-flow: column;\n}\n\n.jp-DirListing-checkboxWrapper {\n  /* Increases hit area of checkbox. */\n  padding: 4px;\n}\n\n.jp-DirListing-content .jp-DirListing-checkboxWrapper {\n  position: relative;\n  left: -4px;\n  margin: -4px 0 -4px -8px;\n}\n\n.jp-DirListing-checkboxWrapper.jp-mod-visible {\n  visibility: visible;\n}\n\n/* For devices that support hovering, hide checkboxes until hovered, selected...\n*/\n@media (hover: hover) {\n  .jp-DirListing-checkboxWrapper {\n    visibility: hidden;\n  }\n\n  .jp-DirListing-item:hover .jp-DirListing-checkboxWrapper,\n  .jp-DirListing-item.jp-mod-selected .jp-DirListing-checkboxWrapper {\n    visibility: visible;\n  }\n}\n\n.jp-DirListing-resizeHandle {\n  min-width: var(--jp-border-width);\n  background: var(--jp-border-color2);\n  height: calc(100% - 4px);\n\n  /* border increases the area where handle can be grabbed */\n  border: 2px solid var(--jp-layout-color1);\n}\n\n.jp-DirListing-resizeHandle.jp-mod-active {\n  background: var(--jp-brand-color1);\n  border-color: var(--jp-brand-color1);\n}\n\n.jp-DirListing-resizeHandle.jp-mod-active:hover {\n  border-color: var(--jp-brand-color1);\n}\n\n.jp-DirListing-resizeHandle:hover {\n  cursor: col-resize;\n  border-color: var(--jp-border-color2);\n}\n\n.jp-DirListing-itemName {\n  display: flex;\n}\n\n.jp-DirListing-item[data-is-dot] {\n  opacity: 75%;\n}\n\n.jp-DirListing-item.jp-mod-selected {\n  color: var(--jp-ui-inverse-font-color1);\n  background: var(--jp-brand-color1);\n}\n\n.jp-DirListing-item.jp-mod-dropTarget {\n  background: var(--jp-brand-color3);\n}\n\n.jp-DirListing-item:hover:not(.jp-mod-selected) {\n  background: var(--jp-layout-color2);\n}\n\n.jp-DirListing-itemIcon {\n  flex: 0 0 20px;\n  margin-right: 4px;\n}\n\n.jp-DirListing-itemText,\n.jp-DirListing-itemModified,\n.jp-DirListing-itemFileSize {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.jp-DirListing-itemName:not([style*='width']) > .jp-DirListing-itemText {\n  flex: 1 1 106px;\n}\n\n.jp-DirListing-item:has(.jp-DirListing-itemText:focus-visible) {\n  /* Targeting `.jp-DirListing-itemText` specifically to avoid an extra outline\n  when it gets replaced with `jp-DirListing-editor` when editing the file name */\n  outline-width: 2px;\n  outline-color: var(--jp-inverse-layout-color1);\n  outline-style: solid;\n  outline-offset: -4px;\n}\n\n.jp-DirListing-item.jp-mod-selected:focus-within {\n  outline-color: var(--jp-layout-color1);\n}\n\n.jp-DirListing-item > .jp-DirListing-itemName > .jp-DirListing-itemText:focus {\n  outline: 0;\n}\n\n.jp-DirListing-itemModified {\n  text-align: right;\n}\n\n.jp-DirListing-itemFileSize {\n  text-align: right;\n}\n\n.jp-DirListing-editor {\n  flex: 1 0 64px;\n  outline: none;\n  border: none;\n  color: var(--jp-ui-font-color1);\n  background-color: var(--jp-layout-color1);\n  z-index: 0;\n}\n\n.jp-DirListing-item.jp-mod-running .jp-DirListing-itemIcon::before {\n  color: var(--jp-success-color1);\n  content: '\\25CF';\n  font-size: 8px;\n  position: absolute;\n  left: -8px;\n}\n\n.jp-DirListing-item.jp-mod-running.jp-mod-selected\n  .jp-DirListing-itemIcon::before {\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-DirListing-item.lm-mod-drag-image,\n.jp-DirListing-item.jp-mod-selected.lm-mod-drag-image {\n  font-size: var(--jp-ui-font-size1);\n  padding-left: 4px;\n  margin-left: 4px;\n  width: 160px;\n  background-color: var(--jp-ui-inverse-font-color2);\n  box-shadow: var(--jp-elevation-z2);\n  border-radius: 0;\n  color: var(--jp-ui-font-color1);\n  transform: translateX(-40%) translateY(-58%);\n}\n\n.jp-Document {\n  min-width: 120px;\n  min-height: 120px;\n  outline: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 58765:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Presentation Mode (.jp-mod-presentationMode)
|----------------------------------------------------------------------------*/

.jp-mod-presentationMode .jp-FileEditor {
  --jp-code-font-size: var(--jp-code-presentation-font-size);
}

.jp-FileEditorCodeWrapper {
  overflow: auto;
}

.jp-FileEditorCodeWrapper .cm-editor {
  height: 100%;
}

/* Add extra space at the bottom when scrollPastEnd is enabled */
.jp-FileEditor.jp-mod-scrollPastEnd .cm-content {
  padding-bottom: var(--jp-editor-scroll-padding);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/fileeditor/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,0DAA0D;AAC5D;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,YAAY;AACd;;AAEA,gEAAgE;AAChE;EACE,+CAA+C;AACjD","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Presentation Mode (.jp-mod-presentationMode)\n|----------------------------------------------------------------------------*/\n\n.jp-mod-presentationMode .jp-FileEditor {\n  --jp-code-font-size: var(--jp-code-presentation-font-size);\n}\n\n.jp-FileEditorCodeWrapper {\n  overflow: auto;\n}\n\n.jp-FileEditorCodeWrapper .cm-editor {\n  height: 100%;\n}\n\n/* Add extra space at the bottom when scrollPastEnd is enabled */\n.jp-FileEditor.jp-mod-scrollPastEnd .cm-content {\n  padding-bottom: var(--jp-editor-scroll-padding);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 9378:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-Help {
  min-width: 240px;
  min-height: 240px;
  background: var(--jp-layout-color0);
  outline: none;
}

.jp-Help > iframe {
  border: none;

  /* Forcing white color to avoid contrast issues see issue #11320 */
  background: white;
}

.jp-About-body {
  display: flex;
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color1);
  text-align: left;
  flex-direction: column;
  width: 100%;
  min-width: 360px;
  overflow: visible;
}

.jp-About-version-info {
  color: var(--jp-ui-font-color1);

  /* Dialog-header sets the font size to 3, we reset to 1 */
  font-size: var(--jp-ui-font-size1);
  width: 200px;
  font-weight: 400;
  letter-spacing: 0.4px;
  text-align: left;
  line-height: 1.12;
}

.jp-About-version {
  display: block;
  padding-top: 8px;
}

.jp-About-externalLinks {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 12px;
}

.jp-About-externalLinks > .jp-Button-flat {
  text-decoration: none;
}

.jp-About-externalLinks > .jp-Button-flat:hover {
  color: var(--jp-content-link-color);
  text-decoration: underline;
}

.jp-About-copyright {
  padding-top: 25px;
}

.jp-About-header {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.jp-About-body pre {
  white-space: pre-wrap;
}

.jp-About-header-info {
  display: flex;
  flex-direction: column;
  margin-left: 16px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/help-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,gBAAgB;EAChB,iBAAiB;EACjB,mCAAmC;EACnC,aAAa;AACf;;AAEA;EACE,YAAY;;EAEZ,kEAAkE;EAClE,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,kCAAkC;EAClC,+BAA+B;EAC/B,gBAAgB;EAChB,sBAAsB;EACtB,WAAW;EACX,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,+BAA+B;;EAE/B,yDAAyD;EACzD,kCAAkC;EAClC,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,cAAc;EACd,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,2BAA2B;EAC3B,uBAAuB;EACvB,iBAAiB;AACnB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,mCAAmC;EACnC,0BAA0B;AAC5B;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,iBAAiB;AACnB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Help {\n  min-width: 240px;\n  min-height: 240px;\n  background: var(--jp-layout-color0);\n  outline: none;\n}\n\n.jp-Help > iframe {\n  border: none;\n\n  /* Forcing white color to avoid contrast issues see issue #11320 */\n  background: white;\n}\n\n.jp-About-body {\n  display: flex;\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color1);\n  text-align: left;\n  flex-direction: column;\n  width: 100%;\n  min-width: 360px;\n  overflow: visible;\n}\n\n.jp-About-version-info {\n  color: var(--jp-ui-font-color1);\n\n  /* Dialog-header sets the font size to 3, we reset to 1 */\n  font-size: var(--jp-ui-font-size1);\n  width: 200px;\n  font-weight: 400;\n  letter-spacing: 0.4px;\n  text-align: left;\n  line-height: 1.12;\n}\n\n.jp-About-version {\n  display: block;\n  padding-top: 8px;\n}\n\n.jp-About-externalLinks {\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-start;\n  align-items: flex-start;\n  padding-top: 12px;\n}\n\n.jp-About-externalLinks > .jp-Button-flat {\n  text-decoration: none;\n}\n\n.jp-About-externalLinks > .jp-Button-flat:hover {\n  color: var(--jp-content-link-color);\n  text-decoration: underline;\n}\n\n.jp-About-copyright {\n  padding-top: 25px;\n}\n\n.jp-About-header {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n}\n\n.jp-About-body pre {\n  white-space: pre-wrap;\n}\n\n.jp-About-header-info {\n  display: flex;\n  flex-direction: column;\n  margin-left: 16px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 35440:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* Document styles */
.jp-HTMLViewer {
  overflow: hidden;
  min-width: 100px;
  min-height: 100px;
  width: 100%;
  height: 100%;
}

.jp-HTMLViewer > iframe {
  border: none;
}

/*
When drag events occur, \`lm-mod-override-cursor\` is added to the body.
Because iframes steal all cursor events, the following two rules are necessary
to suppress pointer events while resize drags are occurring. There may be a
better solution to this problem.
*/
body.lm-mod-override-cursor .jp-HTMLViewer {
  position: relative;
}

body.lm-mod-override-cursor .jp-HTMLViewer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/htmlviewer/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,oBAAoB;AACpB;EACE,gBAAgB;EAChB,gBAAgB;EAChB,iBAAiB;EACjB,WAAW;EACX,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;;;;;CAKC;AACD;EACE,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,QAAQ;EACR,SAAS;EACT,uBAAuB;AACzB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Document styles */\n.jp-HTMLViewer {\n  overflow: hidden;\n  min-width: 100px;\n  min-height: 100px;\n  width: 100%;\n  height: 100%;\n}\n\n.jp-HTMLViewer > iframe {\n  border: none;\n}\n\n/*\nWhen drag events occur, `lm-mod-override-cursor` is added to the body.\nBecause iframes steal all cursor events, the following two rules are necessary\nto suppress pointer events while resize drags are occurring. There may be a\nbetter solution to this problem.\n*/\nbody.lm-mod-override-cursor .jp-HTMLViewer {\n  position: relative;\n}\n\nbody.lm-mod-override-cursor .jp-HTMLViewer::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background: transparent;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 86134:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-ImageViewer {
  overflow: auto;
}

.jp-ImageViewer > img {
  box-sizing: border-box;
  transform-origin: top left;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/imageviewer/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,cAAc;AAChB;;AAEA;EACE,sBAAsB;EACtB,0BAA0B;AAC5B","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-ImageViewer {\n  overflow: auto;\n}\n\n.jp-ImageViewer > img {\n  box-sizing: border-box;\n  transform-origin: top left;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 96967:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --jp-private-inspector-tab-height: 24px;
  --jp-private-inspector-tab-width: 60px;
}

/*-----------------------------------------------------------------------------
| Inspector
|----------------------------------------------------------------------------*/

.jp-Inspector {
  outline: none;
  min-width: 120px;
  min-height: 120px;
}

.jp-Inspector-content {
  background: var(--jp-layout-color1);
  border: none;
  padding: 8px;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.jp-ThemedContainer .jp-Inspector-content pre {
  font-size: var(--jp-code-font-size);
  line-height: var(--jp-code-line-height);
  margin: 0;
  white-space: pre-wrap;
}

.jp-Inspector-placeholderContent {
  text-align: center;
  color: var(--jp-content-font-color2);
}

.jp-Inspector-placeholderContent > h3 {
  margin-bottom: var(--jp-content-heading-margin-bottom);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/inspector/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,uCAAuC;EACvC,sCAAsC;AACxC;;AAEA;;8EAE8E;;AAE9E;EACE,aAAa;EACb,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,mCAAmC;EACnC,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,cAAc;AAChB;;AAEA;EACE,mCAAmC;EACnC,uCAAuC;EACvC,SAAS;EACT,qBAAqB;AACvB;;AAEA;EACE,kBAAkB;EAClB,oCAAoC;AACtC;;AAEA;EACE,sDAAsD;AACxD","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-inspector-tab-height: 24px;\n  --jp-private-inspector-tab-width: 60px;\n}\n\n/*-----------------------------------------------------------------------------\n| Inspector\n|----------------------------------------------------------------------------*/\n\n.jp-Inspector {\n  outline: none;\n  min-width: 120px;\n  min-height: 120px;\n}\n\n.jp-Inspector-content {\n  background: var(--jp-layout-color1);\n  border: none;\n  padding: 8px;\n  width: 100%;\n  height: 100%;\n  overflow: auto;\n}\n\n.jp-ThemedContainer .jp-Inspector-content pre {\n  font-size: var(--jp-code-font-size);\n  line-height: var(--jp-code-line-height);\n  margin: 0;\n  white-space: pre-wrap;\n}\n\n.jp-Inspector-placeholderContent {\n  text-align: center;\n  color: var(--jp-content-font-color2);\n}\n\n.jp-Inspector-placeholderContent > h3 {\n  margin-bottom: var(--jp-content-heading-margin-bottom);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 95602:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/* Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License. */

.jp-RenderedJavaScript {
  padding: var(--jp-code-padding);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/javascript-extension/style/base.css"],"names":[],"mappings":"AAAA;0DAC0D;;AAE1D;EACE,+BAA+B;AACjC","sourcesContent":["/* Copyright (c) Jupyter Development Team.\nDistributed under the terms of the Modified BSD License. */\n\n.jp-RenderedJavaScript {\n  padding: var(--jp-code-padding);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 20946:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/**
  Copyright (c) Jupyter Development Team.
  Distributed under the terms of the Modified BSD License.
*/

/* Base styles */
.jp-RenderedJSON {
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

/* Override react-json-tree inline styles */
.jp-RenderedJSON *:not(mark) {
  background-color: transparent !important;
}

.jp-RenderedJSON ul {
  margin: 0 !important;
}

.jp-RenderedJSON .container {
  position: relative;
  width: 100%;
  min-height: 30px;
}

.jp-RenderedJSON .filter {
  position: absolute;
  top: 0;
  right: 0;
  width: 33%;
  max-width: 150px;
  z-index: 10;
}

/* Document styles */
.jp-MimeDocument .jp-RenderedJSON {
  padding: 5px 5px 5px 20px;
  overflow-y: auto;
}

.jp-RenderedJSON mark.jp-mod-selected {
  background-color: var(--jp-search-unselected-match-background-color);
  color: var(--jp-search-unselected-match-color);
}

/* Output styles */

/* .jp-OutputArea .jp-RenderedJSON {

} */
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/json-extension/style/base.css"],"names":[],"mappings":"AAAA;;;CAGC;;AAED,gBAAgB;AAChB;EACE,WAAW;EACX,YAAY;EACZ,UAAU;EACV,gBAAgB;AAClB;;AAEA,2CAA2C;AAC3C;EACE,wCAAwC;AAC1C;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,UAAU;EACV,gBAAgB;EAChB,WAAW;AACb;;AAEA,oBAAoB;AACpB;EACE,yBAAyB;EACzB,gBAAgB;AAClB;;AAEA;EACE,oEAAoE;EACpE,8CAA8C;AAChD;;AAEA,kBAAkB;;AAElB;;GAEG","sourcesContent":["/**\n  Copyright (c) Jupyter Development Team.\n  Distributed under the terms of the Modified BSD License.\n*/\n\n/* Base styles */\n.jp-RenderedJSON {\n  width: 100%;\n  height: 100%;\n  padding: 0;\n  overflow: hidden;\n}\n\n/* Override react-json-tree inline styles */\n.jp-RenderedJSON *:not(mark) {\n  background-color: transparent !important;\n}\n\n.jp-RenderedJSON ul {\n  margin: 0 !important;\n}\n\n.jp-RenderedJSON .container {\n  position: relative;\n  width: 100%;\n  min-height: 30px;\n}\n\n.jp-RenderedJSON .filter {\n  position: absolute;\n  top: 0;\n  right: 0;\n  width: 33%;\n  max-width: 150px;\n  z-index: 10;\n}\n\n/* Document styles */\n.jp-MimeDocument .jp-RenderedJSON {\n  padding: 5px 5px 5px 20px;\n  overflow-y: auto;\n}\n\n.jp-RenderedJSON mark.jp-mod-selected {\n  background-color: var(--jp-search-unselected-match-background-color);\n  color: var(--jp-search-unselected-match-color);\n}\n\n/* Output styles */\n\n/* .jp-OutputArea .jp-RenderedJSON {\n\n} */\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 97750:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* Private CSS variables */

:root {
  --jp-private-launcher-top-padding: 1.231em;
  --jp-private-launcher-side-padding: 2.462em;
  --jp-private-launcher-card-size: 7.692em;
  --jp-private-launcher-card-label-height: 2.462em;
  --jp-private-launcher-card-icon-height: 5.231em;
  --jp-private-launcher-large-icon-size: 4em;
  --jp-private-launcher-small-icon-size: 2.462em;
}

/* Launcher */

.jp-Launcher {
  margin: 0;
  padding: 0;
  outline: none;
  background: var(--jp-layout-color0);
  box-sizing: border-box;
  min-width: 120px;
  min-height: 120px;

  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
}

.jp-Launcher-body {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
  display: flex;
  justify-content: center;
}

.jp-Launcher-cwd h3 {
  font-size: var(--jp-ui-font-size2);
  font-weight: normal;
  color: var(--jp-ui-font-color1);
  margin: 1em 0;
}

.jp-Launcher-content {
  width: 85%;
  height: 100%;
  padding-top: var(--jp-private-launcher-top-padding);
  padding-left: var(--jp-private-launcher-side-padding);
  padding-right: var(--jp-private-launcher-side-padding);
  box-sizing: border-box;
}

/* Launcher section */

.jp-Launcher-section {
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 12px;
}

.jp-Launcher-sectionHeader {
  display: flex;
  flex-direction: row;
  align-items: center;
  box-sizing: border-box;

  /* This is custom tuned to get the section header to align with the cards */
  margin-left: 5px;
  border-bottom: 1px solid var(--jp-border-color2);
  padding-bottom: 0;
  margin-bottom: 8px;
}

.jp-Launcher-sectionTitle {
  font-size: var(--jp-ui-font-size2);
  font-weight: normal;
  color: var(--jp-ui-font-color0);
  box-sizing: border-box;
}

/* Launcher cards */

.jp-Launcher-cardContainer {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

.jp-LauncherCard {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  width: var(--jp-private-launcher-card-size);
  min-height: var(--jp-private-launcher-card-size);
  margin: 8px;
  padding: 0;
  border: 1px solid var(--jp-border-color2);
  background: var(--jp-layout-color0);
  box-shadow: var(--jp-elevation-z2);
  transition: 0.2s box-shadow;
  border-radius: var(--jp-border-radius);
}

.jp-LauncherCard:focus:not(:active) {
  border: 1px solid var(--jp-brand-color1);
  box-shadow: var(--jp-elevation-z6);
  outline: unset; /* if outline is not unset, then depending on which browser you use, the
    border change is either hidden behind the outline or visually combined with it */
}

.jp-LauncherCard:hover {
  box-shadow: var(--jp-elevation-z6);
  background: var(--jp-layout-color1);
}

.jp-LauncherCard:active {
  box-shadow: var(--jp-elevation-z4);
}

.jp-LauncherCard-icon {
  width: 100%;
  height: var(--jp-private-launcher-card-icon-height);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.jp-LauncherCard-noKernelIcon {
  font-weight: normal;
  font-size: var(--jp-private-launcher-large-icon-size);
}

.jp-LauncherCard[data-category='Notebook'] .jp-LauncherCard-noKernelIcon {
  /* This color is copied from the notebook icon. */
  color: var(--jp-jupyter-icon-color);
}

.jp-LauncherCard[data-category='Console'] .jp-LauncherCard-noKernelIcon {
  /* This color is copied from the console icon. */
  color: #0288d1;
}

.jp-LauncherCard-label {
  width: 100%;
  min-height: var(--jp-private-launcher-card-label-height);
  padding: 0 4px 4px;
  box-sizing: border-box;
  overflow: hidden;
}

.jp-LauncherCard-label p {
  min-height: 2.154em;
  word-break: break-word;
  text-align: center;
  color: var(--jp-ui-font-color1);
  line-height: 1.077em;
  font-size: calc(var(--jp-ui-font-size1) * 0.923);
  overflow: hidden;
  margin: auto;
}

/* kernel icons */

.jp-Launcher-kernelIcon {
  width: var(--jp-private-launcher-large-icon-size);
  height: var(--jp-private-launcher-large-icon-size);
  margin: 0;
  padding: 0;

  /* Preserve image aspect ratio */
  object-fit: contain;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/launcher/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,0BAA0B;;AAE1B;EACE,0CAA0C;EAC1C,2CAA2C;EAC3C,wCAAwC;EACxC,gDAAgD;EAChD,+CAA+C;EAC/C,0CAA0C;EAC1C,8CAA8C;AAChD;;AAEA,aAAa;;AAEb;EACE,SAAS;EACT,UAAU;EACV,aAAa;EACb,mCAAmC;EACnC,sBAAsB;EACtB,gBAAgB;EAChB,iBAAiB;;EAEjB;iCAC+B;EAC/B,kCAAkC;AACpC;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,sBAAsB;EACtB,cAAc;EACd,aAAa;EACb,uBAAuB;AACzB;;AAEA;EACE,kCAAkC;EAClC,mBAAmB;EACnB,+BAA+B;EAC/B,aAAa;AACf;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,mDAAmD;EACnD,qDAAqD;EACrD,sDAAsD;EACtD,sBAAsB;AACxB;;AAEA,qBAAqB;;AAErB;EACE,WAAW;EACX,sBAAsB;EACtB,oBAAoB;AACtB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,sBAAsB;;EAEtB,2EAA2E;EAC3E,gBAAgB;EAChB,gDAAgD;EAChD,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,kCAAkC;EAClC,mBAAmB;EACnB,+BAA+B;EAC/B,sBAAsB;AACxB;;AAEA,mBAAmB;;AAEnB;EACE,SAAS;EACT,UAAU;EACV,sBAAsB;EACtB,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,eAAe;EACf,2CAA2C;EAC3C,gDAAgD;EAChD,WAAW;EACX,UAAU;EACV,yCAAyC;EACzC,mCAAmC;EACnC,kCAAkC;EAClC,2BAA2B;EAC3B,sCAAsC;AACxC;;AAEA;EACE,wCAAwC;EACxC,kCAAkC;EAClC,cAAc,EAAE;oFACkE;AACpF;;AAEA;EACE,kCAAkC;EAClC,mCAAmC;AACrC;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,WAAW;EACX,mDAAmD;EACnD,sBAAsB;EACtB,SAAS;EACT,UAAU;EACV,aAAa;EACb,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;EACnB,qDAAqD;AACvD;;AAEA;EACE,iDAAiD;EACjD,mCAAmC;AACrC;;AAEA;EACE,gDAAgD;EAChD,cAAc;AAChB;;AAEA;EACE,WAAW;EACX,wDAAwD;EACxD,kBAAkB;EAClB,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;EACnB,sBAAsB;EACtB,kBAAkB;EAClB,+BAA+B;EAC/B,oBAAoB;EACpB,gDAAgD;EAChD,gBAAgB;EAChB,YAAY;AACd;;AAEA,iBAAiB;;AAEjB;EACE,iDAAiD;EACjD,kDAAkD;EAClD,SAAS;EACT,UAAU;;EAEV,gCAAgC;EAChC,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Private CSS variables */\n\n:root {\n  --jp-private-launcher-top-padding: 1.231em;\n  --jp-private-launcher-side-padding: 2.462em;\n  --jp-private-launcher-card-size: 7.692em;\n  --jp-private-launcher-card-label-height: 2.462em;\n  --jp-private-launcher-card-icon-height: 5.231em;\n  --jp-private-launcher-large-icon-size: 4em;\n  --jp-private-launcher-small-icon-size: 2.462em;\n}\n\n/* Launcher */\n\n.jp-Launcher {\n  margin: 0;\n  padding: 0;\n  outline: none;\n  background: var(--jp-layout-color0);\n  box-sizing: border-box;\n  min-width: 120px;\n  min-height: 120px;\n\n  /* This is needed so that all font sizing of children done in ems is\n   * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-Launcher-body {\n  width: 100%;\n  height: 100%;\n  box-sizing: border-box;\n  overflow: auto;\n  display: flex;\n  justify-content: center;\n}\n\n.jp-Launcher-cwd h3 {\n  font-size: var(--jp-ui-font-size2);\n  font-weight: normal;\n  color: var(--jp-ui-font-color1);\n  margin: 1em 0;\n}\n\n.jp-Launcher-content {\n  width: 85%;\n  height: 100%;\n  padding-top: var(--jp-private-launcher-top-padding);\n  padding-left: var(--jp-private-launcher-side-padding);\n  padding-right: var(--jp-private-launcher-side-padding);\n  box-sizing: border-box;\n}\n\n/* Launcher section */\n\n.jp-Launcher-section {\n  width: 100%;\n  box-sizing: border-box;\n  padding-bottom: 12px;\n}\n\n.jp-Launcher-sectionHeader {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  box-sizing: border-box;\n\n  /* This is custom tuned to get the section header to align with the cards */\n  margin-left: 5px;\n  border-bottom: 1px solid var(--jp-border-color2);\n  padding-bottom: 0;\n  margin-bottom: 8px;\n}\n\n.jp-Launcher-sectionTitle {\n  font-size: var(--jp-ui-font-size2);\n  font-weight: normal;\n  color: var(--jp-ui-font-color0);\n  box-sizing: border-box;\n}\n\n/* Launcher cards */\n\n.jp-Launcher-cardContainer {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n}\n\n.jp-LauncherCard {\n  display: flex;\n  flex-direction: column;\n  cursor: pointer;\n  width: var(--jp-private-launcher-card-size);\n  min-height: var(--jp-private-launcher-card-size);\n  margin: 8px;\n  padding: 0;\n  border: 1px solid var(--jp-border-color2);\n  background: var(--jp-layout-color0);\n  box-shadow: var(--jp-elevation-z2);\n  transition: 0.2s box-shadow;\n  border-radius: var(--jp-border-radius);\n}\n\n.jp-LauncherCard:focus:not(:active) {\n  border: 1px solid var(--jp-brand-color1);\n  box-shadow: var(--jp-elevation-z6);\n  outline: unset; /* if outline is not unset, then depending on which browser you use, the\n    border change is either hidden behind the outline or visually combined with it */\n}\n\n.jp-LauncherCard:hover {\n  box-shadow: var(--jp-elevation-z6);\n  background: var(--jp-layout-color1);\n}\n\n.jp-LauncherCard:active {\n  box-shadow: var(--jp-elevation-z4);\n}\n\n.jp-LauncherCard-icon {\n  width: 100%;\n  height: var(--jp-private-launcher-card-icon-height);\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.jp-LauncherCard-noKernelIcon {\n  font-weight: normal;\n  font-size: var(--jp-private-launcher-large-icon-size);\n}\n\n.jp-LauncherCard[data-category='Notebook'] .jp-LauncherCard-noKernelIcon {\n  /* This color is copied from the notebook icon. */\n  color: var(--jp-jupyter-icon-color);\n}\n\n.jp-LauncherCard[data-category='Console'] .jp-LauncherCard-noKernelIcon {\n  /* This color is copied from the console icon. */\n  color: #0288d1;\n}\n\n.jp-LauncherCard-label {\n  width: 100%;\n  min-height: var(--jp-private-launcher-card-label-height);\n  padding: 0 4px 4px;\n  box-sizing: border-box;\n  overflow: hidden;\n}\n\n.jp-LauncherCard-label p {\n  min-height: 2.154em;\n  word-break: break-word;\n  text-align: center;\n  color: var(--jp-ui-font-color1);\n  line-height: 1.077em;\n  font-size: calc(var(--jp-ui-font-size1) * 0.923);\n  overflow: hidden;\n  margin: auto;\n}\n\n/* kernel icons */\n\n.jp-Launcher-kernelIcon {\n  width: var(--jp-private-launcher-large-icon-size);\n  height: var(--jp-private-launcher-large-icon-size);\n  margin: 0;\n  padding: 0;\n\n  /* Preserve image aspect ratio */\n  object-fit: contain;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 40151:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

@keyframes flash {
  0% {
    background-color: var(--jp-brand-color1);
  }

  50% {
    color: unset;
    background-color: unset;
  }

  100% {
    background-color: var(--jp-brand-color1);
  }
}

.jp-LogConsoleStatusItem.jp-LogConsole-flash {
  animation: flash 300ms both;
}

.jp-LogConsoleStatusItem.jp-mod-selected {
  background-color: var(--jp-brand-color1);
}

/* Override semi-transparent white with opaque white for higher contrast */
.jp-LogConsoleStatusItem.jp-mod-selected,
.jp-LogConsoleStatusItem.jp-mod-selected .jp-StatusBar-TextItem {
  color: white;
}

.jp-LogConsole .jp-ClearIcon {
  transform: rotate(90deg);
  margin-top: -1px;
  padding: 0 8px;
}

.jp-Toolbar-item.jp-LogConsole-toolbarLogLevel {
  align-items: center;
  padding: 0 6px;
}

/* Matches the disabled style elsewhere in JupyterLab */
.jp-LogConsole-toolbarLogLevel-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Copied from the notebook cell type dropdown styling */
.jp-LogConsole-toolbarLogLevelDropdown select {
  height: 24px;
  font-size: var(--jp-ui-font-size1);
  line-height: 14px;
  border-radius: 0;
  display: block;
}

/* Copied from the notebook cell type dropdown styling */
.jp-LogConsole-toolbarLogLevelDropdown span {
  top: 5px !important;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/logconsole-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE;IACE,wCAAwC;EAC1C;;EAEA;IACE,YAAY;IACZ,uBAAuB;EACzB;;EAEA;IACE,wCAAwC;EAC1C;AACF;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,wCAAwC;AAC1C;;AAEA,0EAA0E;AAC1E;;EAEE,YAAY;AACd;;AAEA;EACE,wBAAwB;EACxB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,mBAAmB;EACnB,cAAc;AAChB;;AAEA,uDAAuD;AACvD;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA,wDAAwD;AACxD;EACE,YAAY;EACZ,kCAAkC;EAClC,iBAAiB;EACjB,gBAAgB;EAChB,cAAc;AAChB;;AAEA,wDAAwD;AACxD;EACE,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n@keyframes flash {\n  0% {\n    background-color: var(--jp-brand-color1);\n  }\n\n  50% {\n    color: unset;\n    background-color: unset;\n  }\n\n  100% {\n    background-color: var(--jp-brand-color1);\n  }\n}\n\n.jp-LogConsoleStatusItem.jp-LogConsole-flash {\n  animation: flash 300ms both;\n}\n\n.jp-LogConsoleStatusItem.jp-mod-selected {\n  background-color: var(--jp-brand-color1);\n}\n\n/* Override semi-transparent white with opaque white for higher contrast */\n.jp-LogConsoleStatusItem.jp-mod-selected,\n.jp-LogConsoleStatusItem.jp-mod-selected .jp-StatusBar-TextItem {\n  color: white;\n}\n\n.jp-LogConsole .jp-ClearIcon {\n  transform: rotate(90deg);\n  margin-top: -1px;\n  padding: 0 8px;\n}\n\n.jp-Toolbar-item.jp-LogConsole-toolbarLogLevel {\n  align-items: center;\n  padding: 0 6px;\n}\n\n/* Matches the disabled style elsewhere in JupyterLab */\n.jp-LogConsole-toolbarLogLevel-disabled {\n  opacity: 0.4;\n  cursor: not-allowed;\n}\n\n/* Copied from the notebook cell type dropdown styling */\n.jp-LogConsole-toolbarLogLevelDropdown select {\n  height: 24px;\n  font-size: var(--jp-ui-font-size1);\n  line-height: 14px;\n  border-radius: 0;\n  display: block;\n}\n\n/* Copied from the notebook cell type dropdown styling */\n.jp-LogConsole-toolbarLogLevelDropdown span {\n  top: 5px !important;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 56728:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-LogConsolePanel {
  overflow-y: auto;
}

.jp-LogConsolePanel .jp-OutputArea-child {
  border-bottom: 1px solid var(--jp-border-color3);
}

.jp-LogConsolePanel .jp-OutputArea-prompt {
  width: 85px;
  color: var(--jp-ui-font-color2);
  font-size: 13px;
  padding: 2px;
}

.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='info'] {
  background-color: var(--jp-info-color1);
  color: var(--jp-ui-inverse-font-color1);
}

.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='warning'] {
  background-color: var(--jp-warn-color1);
  color: var(--jp-ui-inverse-font-color1);
}

.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='error'] {
  background-color: var(--jp-error-color1);
  color: var(--jp-ui-inverse-font-color1);
}

.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='critical'] {
  background-color: var(--jp-error-color0);
  color: var(--jp-ui-inverse-font-color0);
}

.jp-LogConsoleListPlaceholder {
  padding: 5px;
  font-size: 13px;
  color: var(--jp-ui-font-color3);
}

.jp-Scrolling {
  overflow-y: auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/logconsole/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,gBAAgB;AAClB;;AAEA;EACE,gDAAgD;AAClD;;AAEA;EACE,WAAW;EACX,+BAA+B;EAC/B,eAAe;EACf,YAAY;AACd;;AAEA;EACE,uCAAuC;EACvC,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;EACvC,uCAAuC;AACzC;;AAEA;EACE,wCAAwC;EACxC,uCAAuC;AACzC;;AAEA;EACE,wCAAwC;EACxC,uCAAuC;AACzC;;AAEA;EACE,YAAY;EACZ,eAAe;EACf,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;AAClB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-LogConsolePanel {\n  overflow-y: auto;\n}\n\n.jp-LogConsolePanel .jp-OutputArea-child {\n  border-bottom: 1px solid var(--jp-border-color3);\n}\n\n.jp-LogConsolePanel .jp-OutputArea-prompt {\n  width: 85px;\n  color: var(--jp-ui-font-color2);\n  font-size: 13px;\n  padding: 2px;\n}\n\n.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='info'] {\n  background-color: var(--jp-info-color1);\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='warning'] {\n  background-color: var(--jp-warn-color1);\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='error'] {\n  background-color: var(--jp-error-color1);\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-LogConsolePanel .jp-OutputArea-prompt[data-log-level='critical'] {\n  background-color: var(--jp-error-color0);\n  color: var(--jp-ui-inverse-font-color0);\n}\n\n.jp-LogConsoleListPlaceholder {\n  padding: 5px;\n  font-size: 13px;\n  color: var(--jp-ui-font-color3);\n}\n\n.jp-Scrolling {\n  overflow-y: auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 32037:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-LSPExtension-FormGroup-content > select {
  margin: 0 12px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/lsp-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,cAAc;AAChB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-LSPExtension-FormGroup-content > select {\n  margin: 0 12px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 48298:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

:root {
  --jp-private-markdownviewer-padding: 32px;
}

.jp-Document .jp-MarkdownViewer .jp-RenderedMarkdown {
  padding-top: var(--jp-private-markdownviewer-padding);
  padding-right: var(--jp-private-markdownviewer-padding);
  padding-bottom: var(--jp-private-markdownviewer-padding);
  padding-left: var(--jp-private-markdownviewer-padding);
  overflow: auto;
}

/*-----------------------------------------------------------------------------
| Presentation Mode (.jp-mod-presentationMode)
|----------------------------------------------------------------------------*/

.jp-mod-presentationMode .jp-MarkdownViewer .jp-RenderedHTMLCommon {
  --jp-content-font-size1: var(--jp-content-presentation-font-size1);
  --jp-code-font-size: var(--jp-code-presentation-font-size);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/markdownviewer/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,yCAAyC;AAC3C;;AAEA;EACE,qDAAqD;EACrD,uDAAuD;EACvD,wDAAwD;EACxD,sDAAsD;EACtD,cAAc;AAChB;;AAEA;;8EAE8E;;AAE9E;EACE,kEAAkE;EAClE,0DAA0D;AAC5D","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-markdownviewer-padding: 32px;\n}\n\n.jp-Document .jp-MarkdownViewer .jp-RenderedMarkdown {\n  padding-top: var(--jp-private-markdownviewer-padding);\n  padding-right: var(--jp-private-markdownviewer-padding);\n  padding-bottom: var(--jp-private-markdownviewer-padding);\n  padding-left: var(--jp-private-markdownviewer-padding);\n  overflow: auto;\n}\n\n/*-----------------------------------------------------------------------------\n| Presentation Mode (.jp-mod-presentationMode)\n|----------------------------------------------------------------------------*/\n\n.jp-mod-presentationMode .jp-MarkdownViewer .jp-RenderedHTMLCommon {\n  --jp-content-font-size1: var(--jp-content-presentation-font-size1);\n  --jp-code-font-size: var(--jp-code-presentation-font-size);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 50644:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/markedparser-extension/style/base.css"],"names":[],"mappings":"AAAA;;;EAGE","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 57730:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_fonts_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15869);
// Imports



var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_fonts_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This can be removed after upgrading to MathJax 4, as the issue will be fixed in the new version */
mjx-assistive-mml {
  bottom: 0;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/mathjax-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAI9E,oGAAoG;AACpG;EACE,SAAS;AACX","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n@import './fonts.css';\n\n/* This can be removed after upgrading to MathJax 4, as the issue will be fixed in the new version */\nmjx-assistive-mml {\n  bottom: 0;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 15869:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(878);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__);
// Imports



var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(71347), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_1___ = new URL(/* asset import */ __webpack_require__(31372), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_2___ = new URL(/* asset import */ __webpack_require__(49725), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_3___ = new URL(/* asset import */ __webpack_require__(84481), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_4___ = new URL(/* asset import */ __webpack_require__(89866), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_5___ = new URL(/* asset import */ __webpack_require__(70536), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_6___ = new URL(/* asset import */ __webpack_require__(35282), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_7___ = new URL(/* asset import */ __webpack_require__(8262), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_8___ = new URL(/* asset import */ __webpack_require__(33744), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_9___ = new URL(/* asset import */ __webpack_require__(34551), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_10___ = new URL(/* asset import */ __webpack_require__(93694), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_11___ = new URL(/* asset import */ __webpack_require__(85561), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_12___ = new URL(/* asset import */ __webpack_require__(83723), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_13___ = new URL(/* asset import */ __webpack_require__(91202), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_14___ = new URL(/* asset import */ __webpack_require__(3565), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_15___ = new URL(/* asset import */ __webpack_require__(32330), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_16___ = new URL(/* asset import */ __webpack_require__(61670), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_17___ = new URL(/* asset import */ __webpack_require__(57402), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_18___ = new URL(/* asset import */ __webpack_require__(79267), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_19___ = new URL(/* asset import */ __webpack_require__(54356), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_20___ = new URL(/* asset import */ __webpack_require__(27554), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_21___ = new URL(/* asset import */ __webpack_require__(43293), __webpack_require__.b);
var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
var ___CSS_LOADER_URL_REPLACEMENT_0___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
var ___CSS_LOADER_URL_REPLACEMENT_1___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_1___);
var ___CSS_LOADER_URL_REPLACEMENT_2___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_2___);
var ___CSS_LOADER_URL_REPLACEMENT_3___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_3___);
var ___CSS_LOADER_URL_REPLACEMENT_4___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_4___);
var ___CSS_LOADER_URL_REPLACEMENT_5___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_5___);
var ___CSS_LOADER_URL_REPLACEMENT_6___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_6___);
var ___CSS_LOADER_URL_REPLACEMENT_7___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_7___);
var ___CSS_LOADER_URL_REPLACEMENT_8___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_8___);
var ___CSS_LOADER_URL_REPLACEMENT_9___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_9___);
var ___CSS_LOADER_URL_REPLACEMENT_10___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_10___);
var ___CSS_LOADER_URL_REPLACEMENT_11___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_11___);
var ___CSS_LOADER_URL_REPLACEMENT_12___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_12___);
var ___CSS_LOADER_URL_REPLACEMENT_13___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_13___);
var ___CSS_LOADER_URL_REPLACEMENT_14___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_14___);
var ___CSS_LOADER_URL_REPLACEMENT_15___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_15___);
var ___CSS_LOADER_URL_REPLACEMENT_16___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_16___);
var ___CSS_LOADER_URL_REPLACEMENT_17___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_17___);
var ___CSS_LOADER_URL_REPLACEMENT_18___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_18___);
var ___CSS_LOADER_URL_REPLACEMENT_19___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_19___);
var ___CSS_LOADER_URL_REPLACEMENT_20___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_20___);
var ___CSS_LOADER_URL_REPLACEMENT_21___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_21___);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

@font-face /* 0 */ {
  font-display: swap;
  font-family: MJXZERO;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_0___})
    format('woff');
}

@font-face /* 1 */ {
  font-display: swap;
  font-family: MJXTEX;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_1___})
    format('woff');
}

@font-face /* 2 */ {
  font-display: swap;
  font-family: MJXTEX-B;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_2___})
    format('woff');
}

@font-face /* 3 */ {
  font-display: swap;
  font-family: MJXTEX-I;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_3___})
    format('woff');
}

@font-face /* 4 */ {
  font-display: swap;
  font-family: MJXTEX-MI;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_4___})
    format('woff');
}

@font-face /* 5 */ {
  font-display: swap;
  font-family: MJXTEX-BI;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_5___})
    format('woff');
}

@font-face /* 6 */ {
  font-display: swap;
  font-family: 'MJXTEX-S1';
  src: url(${___CSS_LOADER_URL_REPLACEMENT_6___})
    format('woff');
}

@font-face /* 7 */ {
  font-display: swap;
  font-family: 'MJXTEX-S2';
  src: url(${___CSS_LOADER_URL_REPLACEMENT_7___})
    format('woff');
}

@font-face /* 8 */ {
  font-display: swap;
  font-family: 'MJXTEX-S3';
  src: url(${___CSS_LOADER_URL_REPLACEMENT_8___})
    format('woff');
}

@font-face /* 9 */ {
  font-display: swap;
  font-family: 'MJXTEX-S4';
  src: url(${___CSS_LOADER_URL_REPLACEMENT_9___})
    format('woff');
}

@font-face /* 10 */ {
  font-display: swap;
  font-family: MJXTEX-A;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_10___})
    format('woff');
}

@font-face /* 11 */ {
  font-display: swap;
  font-family: MJXTEX-C;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_11___})
    format('woff');
}

@font-face /* 12 */ {
  font-display: swap;
  font-family: MJXTEX-CB;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_12___})
    format('woff');
}

@font-face /* 13 */ {
  font-display: swap;
  font-family: MJXTEX-FR;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_13___})
    format('woff');
}

@font-face /* 14 */ {
  font-display: swap;
  font-family: MJXTEX-FRB;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_14___})
    format('woff');
}

@font-face /* 15 */ {
  font-display: swap;
  font-family: MJXTEX-SS;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_15___})
    format('woff');
}

@font-face /* 16 */ {
  font-display: swap;
  font-family: MJXTEX-SSB;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_16___})
    format('woff');
}

@font-face /* 17 */ {
  font-family: MJXTEX-SSI;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_17___})
    format('woff');
}

@font-face /* 18 */ {
  font-display: swap;
  font-family: MJXTEX-SC;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_18___})
    format('woff');
}

@font-face /* 19 */ {
  font-display: swap;
  font-family: MJXTEX-T;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_19___})
    format('woff');
}

@font-face /* 20 */ {
  font-display: swap;
  font-family: MJXTEX-V;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_20___})
    format('woff');
}

@font-face /* 21 */ {
  font-display: swap;
  font-family: MJXTEX-VB;
  src: url(${___CSS_LOADER_URL_REPLACEMENT_21___})
    format('woff');
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/mathjax-extension/style/fonts.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,kBAAkB;EAClB,oBAAoB;EACpB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;EACnB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,wBAAwB;EACxB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,wBAAwB;EACxB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,wBAAwB;EACxB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,wBAAwB;EACxB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,uBAAuB;EACvB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,uBAAuB;EACvB;kBACgB;AAClB;;AAEA;EACE,uBAAuB;EACvB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB;kBACgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB;kBACgB;AAClB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n@font-face /* 0 */ {\n  font-display: swap;\n  font-family: MJXZERO;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Zero.woff')\n    format('woff');\n}\n\n@font-face /* 1 */ {\n  font-display: swap;\n  font-family: MJXTEX;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 2 */ {\n  font-display: swap;\n  font-family: MJXTEX-B;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff')\n    format('woff');\n}\n\n@font-face /* 3 */ {\n  font-display: swap;\n  font-family: MJXTEX-I;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff')\n    format('woff');\n}\n\n@font-face /* 4 */ {\n  font-display: swap;\n  font-family: MJXTEX-MI;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff')\n    format('woff');\n}\n\n@font-face /* 5 */ {\n  font-display: swap;\n  font-family: MJXTEX-BI;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff')\n    format('woff');\n}\n\n@font-face /* 6 */ {\n  font-display: swap;\n  font-family: 'MJXTEX-S1';\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 7 */ {\n  font-display: swap;\n  font-family: 'MJXTEX-S2';\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 8 */ {\n  font-display: swap;\n  font-family: 'MJXTEX-S3';\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 9 */ {\n  font-display: swap;\n  font-family: 'MJXTEX-S4';\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 10 */ {\n  font-display: swap;\n  font-family: MJXTEX-A;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 11 */ {\n  font-display: swap;\n  font-family: MJXTEX-C;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 12 */ {\n  font-display: swap;\n  font-family: MJXTEX-CB;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff')\n    format('woff');\n}\n\n@font-face /* 13 */ {\n  font-display: swap;\n  font-family: MJXTEX-FR;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 14 */ {\n  font-display: swap;\n  font-family: MJXTEX-FRB;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff')\n    format('woff');\n}\n\n@font-face /* 15 */ {\n  font-display: swap;\n  font-family: MJXTEX-SS;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 16 */ {\n  font-display: swap;\n  font-family: MJXTEX-SSB;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff')\n    format('woff');\n}\n\n@font-face /* 17 */ {\n  font-family: MJXTEX-SSI;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff')\n    format('woff');\n}\n\n@font-face /* 18 */ {\n  font-display: swap;\n  font-family: MJXTEX-SC;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 19 */ {\n  font-display: swap;\n  font-family: MJXTEX-T;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 20 */ {\n  font-display: swap;\n  font-family: MJXTEX-V;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff')\n    format('woff');\n}\n\n@font-face /* 21 */ {\n  font-display: swap;\n  font-family: MJXTEX-VB;\n  src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff')\n    format('woff');\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 5238:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/mermaid-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 26751:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
.jp-RenderedMermaid {
  overflow: auto;
  display: flex;
}

.jp-RenderedMermaid.jp-mod-warning {
  width: auto;
  padding: 0.5em;
  margin-top: 0.5em;
  border: var(--jp-border-width) solid var(--jp-warn-color2);
  border-radius: var(--jp-border-radius);
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.jp-RenderedMermaid figure {
  margin: 0;
  overflow: auto;
  max-width: 100%;
}

.jp-RenderedMermaid img {
  max-width: 100%;
}

.jp-RenderedMermaid-Details > pre {
  margin-top: 1em;
}

.jp-RenderedMermaid-Summary {
  color: var(--jp-warn-color2);
}

.jp-RenderedMermaid:not(.jp-mod-warning) pre {
  display: none;
}

.jp-RenderedMermaid-Summary > pre {
  display: inline-block;
  white-space: normal;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/mermaid/style/base.css"],"names":[],"mappings":"AAAA;;;EAGE;AACF;EACE,cAAc;EACd,aAAa;AACf;;AAEA;EACE,WAAW;EACX,cAAc;EACd,iBAAiB;EACjB,0DAA0D;EAC1D,sCAAsC;EACtC,+BAA+B;EAC/B,kCAAkC;EAClC,qBAAqB;EACrB,qBAAqB;AACvB;;AAEA;EACE,SAAS;EACT,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,qBAAqB;EACrB,mBAAmB;AACrB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n.jp-RenderedMermaid {\n  overflow: auto;\n  display: flex;\n}\n\n.jp-RenderedMermaid.jp-mod-warning {\n  width: auto;\n  padding: 0.5em;\n  margin-top: 0.5em;\n  border: var(--jp-border-width) solid var(--jp-warn-color2);\n  border-radius: var(--jp-border-radius);\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  white-space: pre-wrap;\n  word-wrap: break-word;\n}\n\n.jp-RenderedMermaid figure {\n  margin: 0;\n  overflow: auto;\n  max-width: 100%;\n}\n\n.jp-RenderedMermaid img {\n  max-width: 100%;\n}\n\n.jp-RenderedMermaid-Details > pre {\n  margin-top: 1em;\n}\n\n.jp-RenderedMermaid-Summary {\n  color: var(--jp-warn-color2);\n}\n\n.jp-RenderedMermaid:not(.jp-mod-warning) pre {\n  display: none;\n}\n\n.jp-RenderedMermaid-Summary > pre {\n  display: inline-block;\n  white-space: normal;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 33894:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-MetadataForm {
  width: 100%;
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);
}

.jp-MetadataForm-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.jp-MetadataForm-placeholderContent {
  padding: 8px;
}

.jp-MetadataForm .panel-danger.errors {
  display: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/metadataform/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,WAAW;EACX,+BAA+B;EAC/B,mCAAmC;AACrC;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,aAAa;AACf","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-MetadataForm {\n  width: 100%;\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n}\n\n.jp-MetadataForm-placeholder {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.jp-MetadataForm-placeholderContent {\n  padding: 8px;\n}\n\n.jp-MetadataForm .panel-danger.errors {\n  display: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 39678:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_toolbar_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55864);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_executionindicator_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(46517);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_toc_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86047);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_notebookfooter_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(48101);
// Imports






var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_toolbar_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_executionindicator_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_toc_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_notebookfooter_css__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Imports
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| CSS variables
|----------------------------------------------------------------------------*/

:root {
  --jp-side-by-side-output-size: 1fr;
  --jp-side-by-side-resized-cell: var(--jp-side-by-side-output-size);
  --jp-private-notebook-dragImage-width: 304px;
  --jp-private-notebook-dragImage-height: 36px;
  --jp-private-notebook-selected-color: var(--md-blue-400, #42a5f5);
  --jp-private-notebook-active-color: var(--md-green-400, #66bb6a);
}

/*-----------------------------------------------------------------------------
| Notebook
|----------------------------------------------------------------------------*/

/* stylelint-disable selector-max-class */

.jp-NotebookPanel {
  display: block;
  height: 100%;
}

.jp-NotebookPanel.jp-Document {
  min-width: 240px;
  min-height: 120px;
}

.jp-Notebook {
  outline: none;
  background: var(--jp-layout-color0);
}

.jp-Notebook .jp-WindowedPanel-viewport {
  padding: var(--jp-notebook-padding);
}

.jp-Notebook.jp-mod-scrollPastEnd > .jp-WindowedPanel-outer::after {
  display: block;
  content: '';
  min-height: var(--jp-notebook-scroll-padding);
}

.jp-MainAreaWidget-ContainStrict .jp-Notebook * {
  contain: strict;
}

.jp-Notebook .jp-Cell {
  overflow: visible;

  /* Prevent scroll anchoring to inactive cells */
  overflow-anchor: none;
}

.jp-Notebook .jp-Cell.jp-mod-active {
  overflow-anchor: auto;
}

.jp-Notebook .jp-Cell .jp-InputPrompt {
  cursor: move;
  float: left;
}

/*-----------------------------------------------------------------------------
| Notebook state related styling
|
| The notebook and cells each have states, here are the possibilities:
|
| - Notebook
|   - Command
|   - Edit
| - Cell
|   - None
|   - Active (only one can be active)
|   - Selected (the cells actions are applied to)
|   - Multiselected (when multiple selected, the cursor)
|   - No outputs
|----------------------------------------------------------------------------*/

/* Command or edit modes */

.jp-Notebook .jp-Cell:not(.jp-mod-active) .jp-InputPrompt {
  opacity: var(--jp-cell-prompt-not-active-opacity);
  color: var(--jp-cell-prompt-not-active-font-color);
}

.jp-Notebook .jp-Cell:not(.jp-mod-active) .jp-OutputPrompt {
  opacity: var(--jp-cell-prompt-not-active-opacity);
  color: var(--jp-cell-prompt-not-active-font-color);
}

/* cell is active */
.jp-Notebook .jp-Cell.jp-mod-active .jp-Collapser {
  background: var(--jp-brand-color1);
}

/* cell is dirty */
.jp-Notebook .jp-Cell.jp-mod-dirty .jp-InputPrompt {
  color: var(--jp-warn-color1);
}

.jp-Notebook .jp-Cell.jp-mod-dirty .jp-InputPrompt::before {
  color: var(--jp-warn-color1);
  content: '•';
}

.jp-Notebook .jp-Cell.jp-mod-active.jp-mod-dirty .jp-Collapser {
  background: var(--jp-warn-color1);
}

/* collapser is hovered */
.jp-Notebook .jp-Cell .jp-Collapser:hover {
  box-shadow: var(--jp-elevation-z2);
  background: var(--jp-brand-color1);
  opacity: var(--jp-cell-collapser-not-active-hover-opacity);
}

/* cell is active and collapser is hovered */
.jp-Notebook .jp-Cell.jp-mod-active .jp-Collapser:hover {
  background: var(--jp-brand-color0);
  opacity: 1;
}

/* Command mode */

.jp-Notebook.jp-mod-commandMode .jp-Cell.jp-mod-selected {
  background: var(--jp-notebook-multiselected-color);
}

.jp-Notebook.jp-mod-commandMode
  .jp-Cell.jp-mod-active.jp-mod-selected:not(.jp-mod-multiSelected) {
  background: transparent;
}

.jp-Notebook.jp-mod-commandMode .jp-Cell.jp-mod-active:focus-visible {
  outline: none;
  border: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--jp-brand-color1);
  z-index: 1;
}

/* Edit mode */

.jp-Notebook.jp-mod-editMode .jp-Cell.jp-mod-active .jp-InputArea-editor {
  border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);
  box-shadow: var(--jp-cell-editor-box-shadow);
  background-color: var(--jp-cell-editor-active-background);
}

/*-----------------------------------------------------------------------------
| Notebook drag and drop
|----------------------------------------------------------------------------*/

.jp-Notebook-cell.jp-mod-dropSource {
  opacity: 0.5;
}

.jp-Notebook-cell.jp-mod-dropTarget,
.jp-Notebook.jp-mod-commandMode
  .jp-Notebook-cell.jp-mod-active.jp-mod-selected.jp-mod-dropTarget {
  border-top-color: var(--jp-private-notebook-selected-color);
  border-top-style: solid;
  border-top-width: 2px;
}

.jp-dragImage {
  display: flex;
  flex-direction: row;
  width: var(--jp-private-notebook-dragImage-width);
  height: var(--jp-private-notebook-dragImage-height);
  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);
  background: var(--jp-cell-editor-background);
  overflow: visible;
}

.jp-dragImage-singlePrompt {
  box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.12);
}

.jp-dragImage .jp-dragImage-content {
  flex: 1 1 auto;
  z-index: 2;
  font-size: var(--jp-code-font-size);
  font-family: var(--jp-code-font-family);
  line-height: var(--jp-code-line-height);
  padding: var(--jp-code-padding);
  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);
  background: var(--jp-cell-editor-background-color);
  color: var(--jp-content-font-color3);
  text-align: left;
  margin: 4px 4px 4px 0;
}

.jp-dragImage .jp-dragImage-prompt {
  flex: 0 0 auto;
  min-width: 36px;
  color: var(--jp-cell-inprompt-font-color);
  opacity: 0.5;
  padding: var(--jp-code-padding);
  padding-left: 12px;
  font-family: var(--jp-cell-prompt-font-family);
  letter-spacing: var(--jp-cell-prompt-letter-spacing);
  line-height: 1.9;
  font-size: var(--jp-code-font-size);
  border: var(--jp-border-width) solid transparent;
}

.jp-dragImage-multipleBack {
  z-index: -1;
  position: absolute;
  height: 32px;
  width: 300px;
  top: 8px;
  left: 8px;
  background: var(--jp-layout-color2);
  border-width: var(--jp-border-width);
  border-style: solid;
  border-color: color-mix(
    in srgb,
    var(--jp-input-border-color) 20%,
    transparent
  );
  box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.12);
}

/*-----------------------------------------------------------------------------
| Cell toolbar
|----------------------------------------------------------------------------*/

.jp-NotebookTools {
  display: block;
  min-width: var(--jp-sidebar-min-width);
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);

  /* This is needed so that all font sizing of children done in ems is
    * relative to this base size */
  font-size: var(--jp-ui-font-size1);
  overflow: auto;
}

.jp-ActiveCellTool {
  padding: 12px 0;
  display: flex;
}

.jp-ActiveCellTool-Content {
  flex: 1 1 auto;
}

.jp-ActiveCellTool .jp-ActiveCellTool-CellContent {
  background: var(--jp-cell-editor-background);
  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);
  border-radius: 0;
  min-height: 29px;
}

.jp-ActiveCellTool .jp-InputPrompt {
  min-width: calc(var(--jp-cell-prompt-width) * 0.75);
}

.jp-ActiveCellTool-CellContent > pre {
  padding: 5px 4px;
  margin: 0;
  white-space: normal;
}

.jp-MetadataEditorTool {
  flex-direction: column;
  padding: 12px 0;
}

.jp-RankedPanel > :not(:first-child) {
  margin-top: 12px;
}

.jp-KeySelector select.jp-mod-styled {
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color0);
  border: var(--jp-border-width) solid var(--jp-border-color1);
}

.jp-KeySelector label,
.jp-MetadataEditorTool label,
.jp-NumberSetter label {
  line-height: 1.4;
}

.jp-NumberSetter input {
  width: 100%;
  margin-top: 4px;
}

.jp-NotebookTools .jp-Collapse {
  margin-top: 16px;
}

/*-----------------------------------------------------------------------------
| Presentation Mode (.jp-mod-presentationMode)
|----------------------------------------------------------------------------*/

.jp-mod-presentationMode .jp-Notebook {
  --jp-content-font-size1: var(--jp-content-presentation-font-size1);
  --jp-code-font-size: var(--jp-code-presentation-font-size);
}

.jp-mod-presentationMode .jp-Notebook .jp-Cell .jp-InputPrompt,
.jp-mod-presentationMode .jp-Notebook .jp-Cell .jp-OutputPrompt {
  flex: 0 0 110px;
}

/*-----------------------------------------------------------------------------
| Side-by-side Mode (.jp-mod-sideBySide)
|----------------------------------------------------------------------------*/
.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {
  margin-top: 3em;
  margin-bottom: 3em;
  margin-left: 5%;
  margin-right: 5%;
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) min-content minmax(
      70px,
      var(--jp-side-by-side-output-size)
    );
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'header header header'
    'input handle output'
    'footer footer footer';
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell.jp-mod-resizedCell {
  grid-template-columns: minmax(70px, 1fr) min-content minmax(
      70px,
      var(--jp-side-by-side-resized-cell)
    );
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellHeader {
  grid-area: header;
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-Cell-inputWrapper {
  grid-area: input;
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-Cell-outputWrapper {
  /* overwrite the default margin (no vertical separation needed in side by side move */
  margin-top: 0;
  grid-area: output;
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellFooter {
  grid-area: footer;
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellResizeHandle {
  grid-area: handle;
  user-select: none;
  display: block;
  height: 100%;
  cursor: ew-resize;
  padding: 0 var(--jp-cell-padding);
}

.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellResizeHandle::after {
  content: '';
  display: block;
  background: var(--jp-border-color2);
  height: 100%;
  width: 5px;
}

.jp-mod-sideBySide.jp-Notebook
  .jp-CodeCell.jp-mod-resizedCell
  .jp-CellResizeHandle::after {
  background: var(--jp-border-color0);
}

.jp-CellResizeHandle {
  display: none;
}

/*-----------------------------------------------------------------------------
| Placeholder
|----------------------------------------------------------------------------*/

.jp-Cell-Placeholder {
  padding-left: 55px;
}

.jp-Cell-Placeholder-wrapper {
  background: #fff;
  border: 1px solid;
  border-color: #e5e6e9 #dfe0e4 #d0d1d5;
  border-radius: 4px;
  -webkit-border-radius: 4px;
  margin: 10px 15px;
}

.jp-Cell-Placeholder-wrapper-inner {
  padding: 15px;
  position: relative;
}

.jp-Cell-Placeholder-wrapper-body {
  background-repeat: repeat;
  background-size: 50% auto;
}

.jp-Cell-Placeholder-wrapper-body div {
  background: #f6f7f8;
  background-image: -webkit-linear-gradient(
    left,
    #f6f7f8 0%,
    #edeef1 20%,
    #f6f7f8 40%,
    #f6f7f8 100%
  );
  background-repeat: no-repeat;
  background-size: 800px 104px;
  height: 104px;
  position: absolute;
  right: 15px;
  left: 15px;
  top: 15px;
}

div.jp-Cell-Placeholder-h1 {
  top: 20px;
  height: 20px;
  left: 15px;
  width: 150px;
}

div.jp-Cell-Placeholder-h2 {
  left: 15px;
  top: 50px;
  height: 10px;
  width: 100px;
}

div.jp-Cell-Placeholder-content-1,
div.jp-Cell-Placeholder-content-2,
div.jp-Cell-Placeholder-content-3 {
  left: 15px;
  right: 15px;
  height: 10px;
}

div.jp-Cell-Placeholder-content-1 {
  top: 100px;
}

div.jp-Cell-Placeholder-content-2 {
  top: 120px;
}

div.jp-Cell-Placeholder-content-3 {
  top: 140px;
}

/*-----------------------------------------------------------------------------
| Virtual scrollbar
|----------------------------------------------------------------------------*/

.jp-Notebook .jp-WindowedPanel-scrollbar-item[data-output='error'] {
  background: var(--jp-error-color3);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-item[data-output='error']:hover {
  background: var(--jp-error-color2);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-dirty {
  background: var(--jp-warn-color3);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-dirty:hover {
  background: var(--jp-warn-color2);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-selected {
  background: var(--jp-brand-color2);
  color: var(--jp-ui-inverse-font-color2);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-selected:hover {
  background: var(--jp-brand-color1);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-active {
  background: var(--jp-brand-color1);
  color: var(--jp-ui-inverse-font-color1);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-active:hover {
  background: var(--jp-brand-color0);
}

.jp-Notebook .jp-WindowedPanel-scrollbar-item {
  max-width: 60px;
  display: flex;
}

.jp-Notebook .jp-scrollbarItem-executionIndicator {
  display: inline-block;
  font-family: monospace;
  font-size: 80%;
  line-height: 100%;
  margin-left: -1px;
  padding-right: 1px;
  text-wrap: nowrap; /* stylelint-disable-line csstree/validator */
}

.jp-Notebook .jp-scrollbarItem-source {
  display: inline-block;
  font-size: 3px;
  vertical-align: middle;
  max-height: 10em;
  overflow: hidden;
}

.jp-Notebook
  .jp-WindowedPanel-scrollbar-item[data-type='code']
  > .jp-scrollbarItem-source {
  white-space: pre;
}

.jp-Notebook
  .jp-WindowedPanel-scrollbar-item[data-type='markdown']
  > .jp-scrollbarItem-source {
  white-space: pre-line;
}

/* Lazy rendering to notebook cells: content outside viewport won't be rendered until scrolled into view */
.jp-content-visibility-mode > .jp-Notebook-cell {
  content-visibility: auto;
  contain: layout style paint; /* Isolates layout, style, and paint for this element */
}

/*-----------------------------------------------------------------------------
| Printing
|----------------------------------------------------------------------------*/
@media print {
  .jp-Notebook .jp-Cell .jp-InputPrompt {
    float: none;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/notebook/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAO9E;;8EAE8E;;AAE9E;EACE,kCAAkC;EAClC,kEAAkE;EAClE,4CAA4C;EAC5C,4CAA4C;EAC5C,iEAAiE;EACjE,gEAAgE;AAClE;;AAEA;;8EAE8E;;AAE9E,yCAAyC;;AAEzC;EACE,cAAc;EACd,YAAY;AACd;;AAEA;EACE,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,mCAAmC;AACrC;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,cAAc;EACd,WAAW;EACX,6CAA6C;AAC/C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,iBAAiB;;EAEjB,+CAA+C;EAC/C,qBAAqB;AACvB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,YAAY;EACZ,WAAW;AACb;;AAEA;;;;;;;;;;;;;;8EAc8E;;AAE9E,0BAA0B;;AAE1B;EACE,iDAAiD;EACjD,kDAAkD;AACpD;;AAEA;EACE,iDAAiD;EACjD,kDAAkD;AACpD;;AAEA,mBAAmB;AACnB;EACE,kCAAkC;AACpC;;AAEA,kBAAkB;AAClB;EACE,4BAA4B;AAC9B;;AAEA;EACE,4BAA4B;EAC5B,YAAY;AACd;;AAEA;EACE,iCAAiC;AACnC;;AAEA,yBAAyB;AACzB;EACE,kCAAkC;EAClC,kCAAkC;EAClC,0DAA0D;AAC5D;;AAEA,4CAA4C;AAC5C;EACE,kCAAkC;EAClC,UAAU;AACZ;;AAEA,iBAAiB;;AAEjB;EACE,kDAAkD;AACpD;;AAEA;;EAEE,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,kBAAkB;EAClB,4CAA4C;EAC5C,UAAU;AACZ;;AAEA,cAAc;;AAEd;EACE,8EAA8E;EAC9E,4CAA4C;EAC5C,yDAAyD;AAC3D;;AAEA;;8EAE8E;;AAE9E;EACE,YAAY;AACd;;AAEA;;;EAGE,2DAA2D;EAC3D,uBAAuB;EACvB,qBAAqB;AACvB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,iDAAiD;EACjD,mDAAmD;EACnD,uEAAuE;EACvE,4CAA4C;EAC5C,iBAAiB;AACnB;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,cAAc;EACd,UAAU;EACV,mCAAmC;EACnC,uCAAuC;EACvC,uCAAuC;EACvC,+BAA+B;EAC/B,uEAAuE;EACvE,kDAAkD;EAClD,oCAAoC;EACpC,gBAAgB;EAChB,qBAAqB;AACvB;;AAEA;EACE,cAAc;EACd,eAAe;EACf,yCAAyC;EACzC,YAAY;EACZ,+BAA+B;EAC/B,kBAAkB;EAClB,8CAA8C;EAC9C,oDAAoD;EACpD,gBAAgB;EAChB,mCAAmC;EACnC,gDAAgD;AAClD;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,YAAY;EACZ,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,mCAAmC;EACnC,oCAAoC;EACpC,mBAAmB;EACnB;;;;GAIC;EACD,6CAA6C;AAC/C;;AAEA;;8EAE8E;;AAE9E;EACE,cAAc;EACd,sCAAsC;EACtC,+BAA+B;EAC/B,mCAAmC;;EAEnC;kCACgC;EAChC,kCAAkC;EAClC,cAAc;AAChB;;AAEA;EACE,eAAe;EACf,aAAa;AACf;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,4CAA4C;EAC5C,uEAAuE;EACvE,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,mDAAmD;AACrD;;AAEA;EACE,gBAAgB;EAChB,SAAS;EACT,mBAAmB;AACrB;;AAEA;EACE,sBAAsB;EACtB,eAAe;AACjB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,kCAAkC;EAClC,+BAA+B;EAC/B,4DAA4D;AAC9D;;AAEA;;;EAGE,gBAAgB;AAClB;;AAEA;EACE,WAAW;EACX,eAAe;AACjB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;;8EAE8E;;AAE9E;EACE,kEAAkE;EAClE,0DAA0D;AAC5D;;AAEA;;EAEE,eAAe;AACjB;;AAEA;;8EAE8E;AAC9E;EACE,eAAe;EACf,kBAAkB;EAClB,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb;;;KAGG;EACH,4CAA4C;EAC5C;;;0BAGwB;AAC1B;;AAEA;EACE;;;KAGG;AACL;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,qFAAqF;EACrF,aAAa;EACb,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,YAAY;EACZ,iBAAiB;EACjB,iCAAiC;AACnC;;AAEA;EACE,WAAW;EACX,cAAc;EACd,mCAAmC;EACnC,YAAY;EACZ,UAAU;AACZ;;AAEA;;;EAGE,mCAAmC;AACrC;;AAEA;EACE,aAAa;AACf;;AAEA;;8EAE8E;;AAE9E;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,iBAAiB;EACjB,qCAAqC;EACrC,kBAAkB;EAClB,0BAA0B;EAC1B,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,kBAAkB;AACpB;;AAEA;EACE,yBAAyB;EACzB,yBAAyB;AAC3B;;AAEA;EACE,mBAAmB;EACnB;;;;;;GAMC;EACD,4BAA4B;EAC5B,4BAA4B;EAC5B,aAAa;EACb,kBAAkB;EAClB,WAAW;EACX,UAAU;EACV,SAAS;AACX;;AAEA;EACE,SAAS;EACT,YAAY;EACZ,UAAU;EACV,YAAY;AACd;;AAEA;EACE,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YAAY;AACd;;AAEA;;;EAGE,UAAU;EACV,WAAW;EACX,YAAY;AACd;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;;8EAE8E;;AAE9E;EACE,kCAAkC;AACpC;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,iCAAiC;AACnC;;AAEA;EACE,iCAAiC;AACnC;;AAEA;EACE,kCAAkC;EAClC,uCAAuC;AACzC;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,kCAAkC;EAClC,uCAAuC;AACzC;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,eAAe;EACf,aAAa;AACf;;AAEA;EACE,qBAAqB;EACrB,sBAAsB;EACtB,cAAc;EACd,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,iBAAiB,EAAE,6CAA6C;AAClE;;AAEA;EACE,qBAAqB;EACrB,cAAc;EACd,sBAAsB;EACtB,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;;;EAGE,gBAAgB;AAClB;;AAEA;;;EAGE,qBAAqB;AACvB;;AAEA,0GAA0G;AAC1G;EACE,wBAAwB;EACxB,2BAA2B,EAAE,uDAAuD;AACtF;;AAEA;;8EAE8E;AAC9E;EACE;IACE,WAAW;EACb;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Imports\n|----------------------------------------------------------------------------*/\n\n@import './toolbar.css';\n@import './executionindicator.css';\n@import './toc.css';\n@import './notebookfooter.css';\n\n/*-----------------------------------------------------------------------------\n| CSS variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-side-by-side-output-size: 1fr;\n  --jp-side-by-side-resized-cell: var(--jp-side-by-side-output-size);\n  --jp-private-notebook-dragImage-width: 304px;\n  --jp-private-notebook-dragImage-height: 36px;\n  --jp-private-notebook-selected-color: var(--md-blue-400, #42a5f5);\n  --jp-private-notebook-active-color: var(--md-green-400, #66bb6a);\n}\n\n/*-----------------------------------------------------------------------------\n| Notebook\n|----------------------------------------------------------------------------*/\n\n/* stylelint-disable selector-max-class */\n\n.jp-NotebookPanel {\n  display: block;\n  height: 100%;\n}\n\n.jp-NotebookPanel.jp-Document {\n  min-width: 240px;\n  min-height: 120px;\n}\n\n.jp-Notebook {\n  outline: none;\n  background: var(--jp-layout-color0);\n}\n\n.jp-Notebook .jp-WindowedPanel-viewport {\n  padding: var(--jp-notebook-padding);\n}\n\n.jp-Notebook.jp-mod-scrollPastEnd > .jp-WindowedPanel-outer::after {\n  display: block;\n  content: '';\n  min-height: var(--jp-notebook-scroll-padding);\n}\n\n.jp-MainAreaWidget-ContainStrict .jp-Notebook * {\n  contain: strict;\n}\n\n.jp-Notebook .jp-Cell {\n  overflow: visible;\n\n  /* Prevent scroll anchoring to inactive cells */\n  overflow-anchor: none;\n}\n\n.jp-Notebook .jp-Cell.jp-mod-active {\n  overflow-anchor: auto;\n}\n\n.jp-Notebook .jp-Cell .jp-InputPrompt {\n  cursor: move;\n  float: left;\n}\n\n/*-----------------------------------------------------------------------------\n| Notebook state related styling\n|\n| The notebook and cells each have states, here are the possibilities:\n|\n| - Notebook\n|   - Command\n|   - Edit\n| - Cell\n|   - None\n|   - Active (only one can be active)\n|   - Selected (the cells actions are applied to)\n|   - Multiselected (when multiple selected, the cursor)\n|   - No outputs\n|----------------------------------------------------------------------------*/\n\n/* Command or edit modes */\n\n.jp-Notebook .jp-Cell:not(.jp-mod-active) .jp-InputPrompt {\n  opacity: var(--jp-cell-prompt-not-active-opacity);\n  color: var(--jp-cell-prompt-not-active-font-color);\n}\n\n.jp-Notebook .jp-Cell:not(.jp-mod-active) .jp-OutputPrompt {\n  opacity: var(--jp-cell-prompt-not-active-opacity);\n  color: var(--jp-cell-prompt-not-active-font-color);\n}\n\n/* cell is active */\n.jp-Notebook .jp-Cell.jp-mod-active .jp-Collapser {\n  background: var(--jp-brand-color1);\n}\n\n/* cell is dirty */\n.jp-Notebook .jp-Cell.jp-mod-dirty .jp-InputPrompt {\n  color: var(--jp-warn-color1);\n}\n\n.jp-Notebook .jp-Cell.jp-mod-dirty .jp-InputPrompt::before {\n  color: var(--jp-warn-color1);\n  content: '•';\n}\n\n.jp-Notebook .jp-Cell.jp-mod-active.jp-mod-dirty .jp-Collapser {\n  background: var(--jp-warn-color1);\n}\n\n/* collapser is hovered */\n.jp-Notebook .jp-Cell .jp-Collapser:hover {\n  box-shadow: var(--jp-elevation-z2);\n  background: var(--jp-brand-color1);\n  opacity: var(--jp-cell-collapser-not-active-hover-opacity);\n}\n\n/* cell is active and collapser is hovered */\n.jp-Notebook .jp-Cell.jp-mod-active .jp-Collapser:hover {\n  background: var(--jp-brand-color0);\n  opacity: 1;\n}\n\n/* Command mode */\n\n.jp-Notebook.jp-mod-commandMode .jp-Cell.jp-mod-selected {\n  background: var(--jp-notebook-multiselected-color);\n}\n\n.jp-Notebook.jp-mod-commandMode\n  .jp-Cell.jp-mod-active.jp-mod-selected:not(.jp-mod-multiSelected) {\n  background: transparent;\n}\n\n.jp-Notebook.jp-mod-commandMode .jp-Cell.jp-mod-active:focus-visible {\n  outline: none;\n  border: none;\n  border-radius: 2px;\n  box-shadow: 0 0 0 1px var(--jp-brand-color1);\n  z-index: 1;\n}\n\n/* Edit mode */\n\n.jp-Notebook.jp-mod-editMode .jp-Cell.jp-mod-active .jp-InputArea-editor {\n  border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);\n  box-shadow: var(--jp-cell-editor-box-shadow);\n  background-color: var(--jp-cell-editor-active-background);\n}\n\n/*-----------------------------------------------------------------------------\n| Notebook drag and drop\n|----------------------------------------------------------------------------*/\n\n.jp-Notebook-cell.jp-mod-dropSource {\n  opacity: 0.5;\n}\n\n.jp-Notebook-cell.jp-mod-dropTarget,\n.jp-Notebook.jp-mod-commandMode\n  .jp-Notebook-cell.jp-mod-active.jp-mod-selected.jp-mod-dropTarget {\n  border-top-color: var(--jp-private-notebook-selected-color);\n  border-top-style: solid;\n  border-top-width: 2px;\n}\n\n.jp-dragImage {\n  display: flex;\n  flex-direction: row;\n  width: var(--jp-private-notebook-dragImage-width);\n  height: var(--jp-private-notebook-dragImage-height);\n  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);\n  background: var(--jp-cell-editor-background);\n  overflow: visible;\n}\n\n.jp-dragImage-singlePrompt {\n  box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.12);\n}\n\n.jp-dragImage .jp-dragImage-content {\n  flex: 1 1 auto;\n  z-index: 2;\n  font-size: var(--jp-code-font-size);\n  font-family: var(--jp-code-font-family);\n  line-height: var(--jp-code-line-height);\n  padding: var(--jp-code-padding);\n  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);\n  background: var(--jp-cell-editor-background-color);\n  color: var(--jp-content-font-color3);\n  text-align: left;\n  margin: 4px 4px 4px 0;\n}\n\n.jp-dragImage .jp-dragImage-prompt {\n  flex: 0 0 auto;\n  min-width: 36px;\n  color: var(--jp-cell-inprompt-font-color);\n  opacity: 0.5;\n  padding: var(--jp-code-padding);\n  padding-left: 12px;\n  font-family: var(--jp-cell-prompt-font-family);\n  letter-spacing: var(--jp-cell-prompt-letter-spacing);\n  line-height: 1.9;\n  font-size: var(--jp-code-font-size);\n  border: var(--jp-border-width) solid transparent;\n}\n\n.jp-dragImage-multipleBack {\n  z-index: -1;\n  position: absolute;\n  height: 32px;\n  width: 300px;\n  top: 8px;\n  left: 8px;\n  background: var(--jp-layout-color2);\n  border-width: var(--jp-border-width);\n  border-style: solid;\n  border-color: color-mix(\n    in srgb,\n    var(--jp-input-border-color) 20%,\n    transparent\n  );\n  box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.12);\n}\n\n/*-----------------------------------------------------------------------------\n| Cell toolbar\n|----------------------------------------------------------------------------*/\n\n.jp-NotebookTools {\n  display: block;\n  min-width: var(--jp-sidebar-min-width);\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n\n  /* This is needed so that all font sizing of children done in ems is\n    * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n  overflow: auto;\n}\n\n.jp-ActiveCellTool {\n  padding: 12px 0;\n  display: flex;\n}\n\n.jp-ActiveCellTool-Content {\n  flex: 1 1 auto;\n}\n\n.jp-ActiveCellTool .jp-ActiveCellTool-CellContent {\n  background: var(--jp-cell-editor-background);\n  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);\n  border-radius: 0;\n  min-height: 29px;\n}\n\n.jp-ActiveCellTool .jp-InputPrompt {\n  min-width: calc(var(--jp-cell-prompt-width) * 0.75);\n}\n\n.jp-ActiveCellTool-CellContent > pre {\n  padding: 5px 4px;\n  margin: 0;\n  white-space: normal;\n}\n\n.jp-MetadataEditorTool {\n  flex-direction: column;\n  padding: 12px 0;\n}\n\n.jp-RankedPanel > :not(:first-child) {\n  margin-top: 12px;\n}\n\n.jp-KeySelector select.jp-mod-styled {\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color0);\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.jp-KeySelector label,\n.jp-MetadataEditorTool label,\n.jp-NumberSetter label {\n  line-height: 1.4;\n}\n\n.jp-NumberSetter input {\n  width: 100%;\n  margin-top: 4px;\n}\n\n.jp-NotebookTools .jp-Collapse {\n  margin-top: 16px;\n}\n\n/*-----------------------------------------------------------------------------\n| Presentation Mode (.jp-mod-presentationMode)\n|----------------------------------------------------------------------------*/\n\n.jp-mod-presentationMode .jp-Notebook {\n  --jp-content-font-size1: var(--jp-content-presentation-font-size1);\n  --jp-code-font-size: var(--jp-code-presentation-font-size);\n}\n\n.jp-mod-presentationMode .jp-Notebook .jp-Cell .jp-InputPrompt,\n.jp-mod-presentationMode .jp-Notebook .jp-Cell .jp-OutputPrompt {\n  flex: 0 0 110px;\n}\n\n/*-----------------------------------------------------------------------------\n| Side-by-side Mode (.jp-mod-sideBySide)\n|----------------------------------------------------------------------------*/\n.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {\n  margin-top: 3em;\n  margin-bottom: 3em;\n  margin-left: 5%;\n  margin-right: 5%;\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell {\n  display: grid;\n  grid-template-columns: minmax(70px, 1fr) min-content minmax(\n      70px,\n      var(--jp-side-by-side-output-size)\n    );\n  grid-template-rows: auto minmax(0, 1fr) auto;\n  grid-template-areas:\n    'header header header'\n    'input handle output'\n    'footer footer footer';\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell.jp-mod-resizedCell {\n  grid-template-columns: minmax(70px, 1fr) min-content minmax(\n      70px,\n      var(--jp-side-by-side-resized-cell)\n    );\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellHeader {\n  grid-area: header;\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-Cell-inputWrapper {\n  grid-area: input;\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-Cell-outputWrapper {\n  /* overwrite the default margin (no vertical separation needed in side by side move */\n  margin-top: 0;\n  grid-area: output;\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellFooter {\n  grid-area: footer;\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellResizeHandle {\n  grid-area: handle;\n  user-select: none;\n  display: block;\n  height: 100%;\n  cursor: ew-resize;\n  padding: 0 var(--jp-cell-padding);\n}\n\n.jp-mod-sideBySide.jp-Notebook .jp-CodeCell .jp-CellResizeHandle::after {\n  content: '';\n  display: block;\n  background: var(--jp-border-color2);\n  height: 100%;\n  width: 5px;\n}\n\n.jp-mod-sideBySide.jp-Notebook\n  .jp-CodeCell.jp-mod-resizedCell\n  .jp-CellResizeHandle::after {\n  background: var(--jp-border-color0);\n}\n\n.jp-CellResizeHandle {\n  display: none;\n}\n\n/*-----------------------------------------------------------------------------\n| Placeholder\n|----------------------------------------------------------------------------*/\n\n.jp-Cell-Placeholder {\n  padding-left: 55px;\n}\n\n.jp-Cell-Placeholder-wrapper {\n  background: #fff;\n  border: 1px solid;\n  border-color: #e5e6e9 #dfe0e4 #d0d1d5;\n  border-radius: 4px;\n  -webkit-border-radius: 4px;\n  margin: 10px 15px;\n}\n\n.jp-Cell-Placeholder-wrapper-inner {\n  padding: 15px;\n  position: relative;\n}\n\n.jp-Cell-Placeholder-wrapper-body {\n  background-repeat: repeat;\n  background-size: 50% auto;\n}\n\n.jp-Cell-Placeholder-wrapper-body div {\n  background: #f6f7f8;\n  background-image: -webkit-linear-gradient(\n    left,\n    #f6f7f8 0%,\n    #edeef1 20%,\n    #f6f7f8 40%,\n    #f6f7f8 100%\n  );\n  background-repeat: no-repeat;\n  background-size: 800px 104px;\n  height: 104px;\n  position: absolute;\n  right: 15px;\n  left: 15px;\n  top: 15px;\n}\n\ndiv.jp-Cell-Placeholder-h1 {\n  top: 20px;\n  height: 20px;\n  left: 15px;\n  width: 150px;\n}\n\ndiv.jp-Cell-Placeholder-h2 {\n  left: 15px;\n  top: 50px;\n  height: 10px;\n  width: 100px;\n}\n\ndiv.jp-Cell-Placeholder-content-1,\ndiv.jp-Cell-Placeholder-content-2,\ndiv.jp-Cell-Placeholder-content-3 {\n  left: 15px;\n  right: 15px;\n  height: 10px;\n}\n\ndiv.jp-Cell-Placeholder-content-1 {\n  top: 100px;\n}\n\ndiv.jp-Cell-Placeholder-content-2 {\n  top: 120px;\n}\n\ndiv.jp-Cell-Placeholder-content-3 {\n  top: 140px;\n}\n\n/*-----------------------------------------------------------------------------\n| Virtual scrollbar\n|----------------------------------------------------------------------------*/\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-item[data-output='error'] {\n  background: var(--jp-error-color3);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-item[data-output='error']:hover {\n  background: var(--jp-error-color2);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-dirty {\n  background: var(--jp-warn-color3);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-dirty:hover {\n  background: var(--jp-warn-color2);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-selected {\n  background: var(--jp-brand-color2);\n  color: var(--jp-ui-inverse-font-color2);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-selected:hover {\n  background: var(--jp-brand-color1);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-active {\n  background: var(--jp-brand-color1);\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-content > .jp-mod-active:hover {\n  background: var(--jp-brand-color0);\n}\n\n.jp-Notebook .jp-WindowedPanel-scrollbar-item {\n  max-width: 60px;\n  display: flex;\n}\n\n.jp-Notebook .jp-scrollbarItem-executionIndicator {\n  display: inline-block;\n  font-family: monospace;\n  font-size: 80%;\n  line-height: 100%;\n  margin-left: -1px;\n  padding-right: 1px;\n  text-wrap: nowrap; /* stylelint-disable-line csstree/validator */\n}\n\n.jp-Notebook .jp-scrollbarItem-source {\n  display: inline-block;\n  font-size: 3px;\n  vertical-align: middle;\n  max-height: 10em;\n  overflow: hidden;\n}\n\n.jp-Notebook\n  .jp-WindowedPanel-scrollbar-item[data-type='code']\n  > .jp-scrollbarItem-source {\n  white-space: pre;\n}\n\n.jp-Notebook\n  .jp-WindowedPanel-scrollbar-item[data-type='markdown']\n  > .jp-scrollbarItem-source {\n  white-space: pre-line;\n}\n\n/* Lazy rendering to notebook cells: content outside viewport won't be rendered until scrolled into view */\n.jp-content-visibility-mode > .jp-Notebook-cell {\n  content-visibility: auto;\n  contain: layout style paint; /* Isolates layout, style, and paint for this element */\n}\n\n/*-----------------------------------------------------------------------------\n| Printing\n|----------------------------------------------------------------------------*/\n@media print {\n  .jp-Notebook .jp-Cell .jp-InputPrompt {\n    float: none;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 46517:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------

/*-----------------------------------------------------------------------------
| Styles
|----------------------------------------------------------------------------*/

.jp-Notebook-ExecutionIndicator {
  position: relative;
  display: inline-block;
  z-index: 9997;
  padding-top: 1px;
}

.jp-Notebook-ExecutionIndicator-tooltip {
  visibility: hidden;
  height: auto;
  width: max-content;
  width: -moz-max-content;
  background-color: var(--jp-layout-color2);
  color: var(--jp-ui-font-color1);
  text-align: justify;
  border-radius: 6px;
  padding: 0 5px;
  position: fixed;
  display: table;
  transition: visibility 0s linear 0.1s;
}

.jp-Notebook-ExecutionIndicator-tooltip.up {
  transform: translateX(-50%) translateY(-100%) translateY(-32px);
}

.jp-Notebook-ExecutionIndicator-tooltip.down {
  transform: translateX(calc(-100% + 16px)) translateY(5px);
}

.jp-Notebook-ExecutionIndicator-tooltip.hidden {
  display: none;
}

.jp-Notebook-ExecutionIndicator:hover .jp-Notebook-ExecutionIndicator-tooltip,
.jp-Notebook-ExecutionIndicator-tooltip:hover {
  visibility: visible;
  transition-delay: 0s;
}

.jp-Notebook-ExecutionIndicator span {
  font-size: var(--jp-ui-font-size1);
  font-family: var(--jp-ui-font-family);
  color: var(--jp-ui-font-color1);
  line-height: 24px;
  display: block;
}

.jp-Notebook-ExecutionIndicator-progress-bar {
  display: flex;
  justify-content: center;
  height: 100%;
}

.jp-Notebook-ExecutionIndicator-jumpButton {
  margin-top: 4px;
  margin-bottom: 3px;
  width: 100%;
  font-size: var(--jp-ui-font-size1);
  border: 1px solid var(--jp-border-color2);
  color: var(--jp-ui-font-color0);
  transition: all 0.1s ease;
}

.jp-Notebook-ExecutionIndicator-jumpButton:hover {
  background-color: var(--jp-layout-color3) !important;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/notebook/style/executionindicator.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;;;;8EAI8E;;AAE9E;EACE,kBAAkB;EAClB,qBAAqB;EACrB,aAAa;EACb,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,YAAY;EACZ,kBAAkB;EAClB,uBAAuB;EACvB,yCAAyC;EACzC,+BAA+B;EAC/B,mBAAmB;EACnB,kBAAkB;EAClB,cAAc;EACd,eAAe;EACf,cAAc;EACd,qCAAqC;AACvC;;AAEA;EACE,+DAA+D;AACjE;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,aAAa;AACf;;AAEA;;EAEE,mBAAmB;EACnB,oBAAoB;AACtB;;AAEA;EACE,kCAAkC;EAClC,qCAAqC;EACrC,+BAA+B;EAC/B,iBAAiB;EACjB,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,uBAAuB;EACvB,YAAY;AACd;;AAEA;EACE,eAAe;EACf,kBAAkB;EAClB,WAAW;EACX,kCAAkC;EAClC,yCAAyC;EACzC,+BAA+B;EAC/B,yBAAyB;AAC3B;;AAEA;EACE,oDAAoD;AACtD","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n\n/*-----------------------------------------------------------------------------\n| Styles\n|----------------------------------------------------------------------------*/\n\n.jp-Notebook-ExecutionIndicator {\n  position: relative;\n  display: inline-block;\n  z-index: 9997;\n  padding-top: 1px;\n}\n\n.jp-Notebook-ExecutionIndicator-tooltip {\n  visibility: hidden;\n  height: auto;\n  width: max-content;\n  width: -moz-max-content;\n  background-color: var(--jp-layout-color2);\n  color: var(--jp-ui-font-color1);\n  text-align: justify;\n  border-radius: 6px;\n  padding: 0 5px;\n  position: fixed;\n  display: table;\n  transition: visibility 0s linear 0.1s;\n}\n\n.jp-Notebook-ExecutionIndicator-tooltip.up {\n  transform: translateX(-50%) translateY(-100%) translateY(-32px);\n}\n\n.jp-Notebook-ExecutionIndicator-tooltip.down {\n  transform: translateX(calc(-100% + 16px)) translateY(5px);\n}\n\n.jp-Notebook-ExecutionIndicator-tooltip.hidden {\n  display: none;\n}\n\n.jp-Notebook-ExecutionIndicator:hover .jp-Notebook-ExecutionIndicator-tooltip,\n.jp-Notebook-ExecutionIndicator-tooltip:hover {\n  visibility: visible;\n  transition-delay: 0s;\n}\n\n.jp-Notebook-ExecutionIndicator span {\n  font-size: var(--jp-ui-font-size1);\n  font-family: var(--jp-ui-font-family);\n  color: var(--jp-ui-font-color1);\n  line-height: 24px;\n  display: block;\n}\n\n.jp-Notebook-ExecutionIndicator-progress-bar {\n  display: flex;\n  justify-content: center;\n  height: 100%;\n}\n\n.jp-Notebook-ExecutionIndicator-jumpButton {\n  margin-top: 4px;\n  margin-bottom: 3px;\n  width: 100%;\n  font-size: var(--jp-ui-font-size1);\n  border: 1px solid var(--jp-border-color2);\n  color: var(--jp-ui-font-color0);\n  transition: all 0.1s ease;\n}\n\n.jp-Notebook-ExecutionIndicator-jumpButton:hover {\n  background-color: var(--jp-layout-color3) !important;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 48101:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-Notebook-footer {
  height: 27px;
  margin-left: calc(
    var(--jp-cell-prompt-width) + var(--jp-cell-collapser-width) +
      var(--jp-cell-padding) + var(--jp-notebook-padding)
  );
  width: calc(
    100% -
      (
        var(--jp-cell-prompt-width) + var(--jp-cell-collapser-width) + 2 *
          var(--jp-cell-padding) + 2 * var(--jp-notebook-padding)
      )
  );
  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);
  color: var(--jp-ui-font-color3);
  background: none;
  cursor: pointer;
}

.jp-Notebook-footer:focus {
  border-color: var(--jp-cell-editor-active-border-color);
}

/* For devices that support hovering, hide footer until hover */
@media (hover: hover) {
  .jp-Notebook-footer {
    opacity: 0;
  }

  .jp-Notebook-footer:focus,
  .jp-Notebook-footer:hover {
    opacity: 1;
  }
}

/* For all the screens smaller than 760px */
@media (width <= 760px) {
  .jp-Notebook-footer {
    margin-left: calc(
      var(--jp-cell-collapser-width) + var(--jp-code-padding) +
        var(--jp-cell-padding) + var(--jp-notebook-padding)
    );
    width: calc(
      100% -
        (
          var(--jp-cell-collapser-width) + 2 * var(--jp-cell-padding) + 2 *
            var(--jp-notebook-padding) + var(--jp-code-padding)
        )
    );
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/notebook/style/notebookfooter.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,YAAY;EACZ;;;GAGC;EACD;;;;;;GAMC;EACD,uEAAuE;EACvE,+BAA+B;EAC/B,gBAAgB;EAChB,eAAe;AACjB;;AAEA;EACE,uDAAuD;AACzD;;AAEA,+DAA+D;AAC/D;EACE;IACE,UAAU;EACZ;;EAEA;;IAEE,UAAU;EACZ;AACF;;AAEA,2CAA2C;AAC3C;EACE;IACE;;;KAGC;IACD;;;;;;KAMC;EACH;AACF","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-Notebook-footer {\n  height: 27px;\n  margin-left: calc(\n    var(--jp-cell-prompt-width) + var(--jp-cell-collapser-width) +\n      var(--jp-cell-padding) + var(--jp-notebook-padding)\n  );\n  width: calc(\n    100% -\n      (\n        var(--jp-cell-prompt-width) + var(--jp-cell-collapser-width) + 2 *\n          var(--jp-cell-padding) + 2 * var(--jp-notebook-padding)\n      )\n  );\n  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);\n  color: var(--jp-ui-font-color3);\n  background: none;\n  cursor: pointer;\n}\n\n.jp-Notebook-footer:focus {\n  border-color: var(--jp-cell-editor-active-border-color);\n}\n\n/* For devices that support hovering, hide footer until hover */\n@media (hover: hover) {\n  .jp-Notebook-footer {\n    opacity: 0;\n  }\n\n  .jp-Notebook-footer:focus,\n  .jp-Notebook-footer:hover {\n    opacity: 1;\n  }\n}\n\n/* For all the screens smaller than 760px */\n@media (width <= 760px) {\n  .jp-Notebook-footer {\n    margin-left: calc(\n      var(--jp-cell-collapser-width) + var(--jp-code-padding) +\n        var(--jp-cell-padding) + var(--jp-notebook-padding)\n    );\n    width: calc(\n      100% -\n        (\n          var(--jp-cell-collapser-width) + 2 * var(--jp-cell-padding) + 2 *\n            var(--jp-notebook-padding) + var(--jp-code-padding)\n        )\n    );\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 86047:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*
 * Execution indicator
 */
.jp-tocItem-content::after {
  content: '';

  /* Must be identical to form a circle */
  width: 12px;
  height: 12px;
  background: none;
  border: none;
  position: absolute;
  right: 0;
}

.jp-tocItem-content[data-running='0']::after {
  border-radius: 50%;
  border: var(--jp-border-width) solid var(--jp-inverse-layout-color3);
  background: none;
}

.jp-tocItem-content[data-running='1']::after {
  border-radius: 50%;
  border: var(--jp-border-width) solid var(--jp-inverse-layout-color3);
  background-color: var(--jp-inverse-layout-color3);
}

.jp-tocItem-content[data-running='-0.5']::after {
  /* \\FE0E forces the preceding unicode to be rendered as text */
  content: '\\26A0 \\FE0E';
  color: var(--jp-error-color1);
}

.jp-tocItem-content[data-running='0'],
.jp-tocItem-content[data-running='1'],
.jp-tocItem-content[data-running='-0.5'] {
  margin-right: 12px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/notebook/style/toc.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;EAEE;AACF;EACE,WAAW;;EAEX,uCAAuC;EACvC,WAAW;EACX,YAAY;EACZ,gBAAgB;EAChB,YAAY;EACZ,kBAAkB;EAClB,QAAQ;AACV;;AAEA;EACE,kBAAkB;EAClB,oEAAoE;EACpE,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,oEAAoE;EACpE,iDAAiD;AACnD;;AAEA;EACE,8DAA8D;EAC9D,sBAAsB;EACtB,6BAA6B;AAC/B;;AAEA;;;EAGE,kBAAkB;AACpB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n * Execution indicator\n */\n.jp-tocItem-content::after {\n  content: '';\n\n  /* Must be identical to form a circle */\n  width: 12px;\n  height: 12px;\n  background: none;\n  border: none;\n  position: absolute;\n  right: 0;\n}\n\n.jp-tocItem-content[data-running='0']::after {\n  border-radius: 50%;\n  border: var(--jp-border-width) solid var(--jp-inverse-layout-color3);\n  background: none;\n}\n\n.jp-tocItem-content[data-running='1']::after {\n  border-radius: 50%;\n  border: var(--jp-border-width) solid var(--jp-inverse-layout-color3);\n  background-color: var(--jp-inverse-layout-color3);\n}\n\n.jp-tocItem-content[data-running='-0.5']::after {\n  /* \\FE0E forces the preceding unicode to be rendered as text */\n  content: '\\26A0 \\FE0E';\n  color: var(--jp-error-color1);\n}\n\n.jp-tocItem-content[data-running='0'],\n.jp-tocItem-content[data-running='1'],\n.jp-tocItem-content[data-running='-0.5'] {\n  margin-right: 12px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 55864:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --jp-notebook-toolbar-padding: 0 5px 0 2px;
}

/*-----------------------------------------------------------------------------

/*-----------------------------------------------------------------------------
| Styles
|----------------------------------------------------------------------------*/

.jp-NotebookPanel-toolbar {
  padding: var(--jp-notebook-toolbar-padding);

  /* disable paint containment from lumino 2.0 default strict CSS containment */
  contain: style size !important;
}

.jp-Toolbar > .jp-Toolbar-responsive-opener {
  margin-left: auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/notebook/style/toolbar.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,0CAA0C;AAC5C;;AAEA;;;;8EAI8E;;AAE9E;EACE,2CAA2C;;EAE3C,6EAA6E;EAC7E,8BAA8B;AAChC;;AAEA;EACE,iBAAiB;AACnB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-notebook-toolbar-padding: 0 5px 0 2px;\n}\n\n/*-----------------------------------------------------------------------------\n\n/*-----------------------------------------------------------------------------\n| Styles\n|----------------------------------------------------------------------------*/\n\n.jp-NotebookPanel-toolbar {\n  padding: var(--jp-notebook-toolbar-padding);\n\n  /* disable paint containment from lumino 2.0 default strict CSS containment */\n  contain: style size !important;\n}\n\n.jp-Toolbar > .jp-Toolbar-responsive-opener {\n  margin-left: auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 5416:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Main OutputArea
| OutputArea has a list of Outputs
|----------------------------------------------------------------------------*/

.jp-OutputArea {
  overflow-y: auto;
}

.jp-OutputArea-child {
  display: flex;
  flex-direction: row;
  width: 100%;
  overflow: hidden;
}

.jp-OutputPrompt {
  width: var(--jp-cell-prompt-width);
  flex: 0 0 var(--jp-cell-prompt-width);
  color: var(--jp-cell-outprompt-font-color);
  font-family: var(--jp-cell-prompt-font-family);
  padding: var(--jp-code-padding);
  letter-spacing: var(--jp-cell-prompt-letter-spacing);
  line-height: var(--jp-code-line-height);
  font-size: var(--jp-code-font-size);
  border: var(--jp-border-width) solid transparent;
  opacity: var(--jp-cell-prompt-opacity);

  /* Right align prompt text, don't wrap to handle large prompt numbers */
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  /* Disable text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.jp-OutputArea-output {
  width: 100%;
  height: auto;
  overflow: auto;
  user-select: text;
  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
}

.jp-OutputArea .jp-RenderedText {
  padding-left: 1ch;
}

/**
 * Prompt overlay.
 */

.jp-OutputArea-promptOverlay {
  position: absolute;
  top: 0;
  width: var(--jp-cell-prompt-width);
  height: 100%;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jp-OutputArea-promptOverlay .jp-icon-output {
  display: none;
}

.jp-OutputArea-promptOverlay:hover .jp-icon-output {
  display: initial;
}

.jp-OutputArea-promptOverlay:hover {
  background: var(--jp-layout-color2);
  box-shadow: inset 0 0 1px var(--jp-inverse-layout-color0);
}

.jp-OutputArea-child .jp-OutputArea-output {
  flex-grow: 1;
  flex-shrink: 1;
}

/**
 * Isolated output.
 */
.jp-OutputArea-output.jp-mod-isolated {
  width: 100%;
  display: block;
}

/*
When drag events occur, \`lm-mod-override-cursor\` is added to the body.
Because iframes steal all cursor events, the following two rules are necessary
to suppress pointer events while resize drags are occurring. There may be a
better solution to this problem.
*/
body.lm-mod-override-cursor .jp-OutputArea-output.jp-mod-isolated {
  position: relative;
}

body.lm-mod-override-cursor .jp-OutputArea-output.jp-mod-isolated::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

/* pre */

.jp-OutputArea-output pre {
  border: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: auto;
  word-break: break-all;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* tables */

.jp-OutputArea-output.jp-RenderedHTMLCommon table {
  margin-left: 0;
  margin-right: 0;
}

/* description lists */

.jp-OutputArea-output dl,
.jp-OutputArea-output dt,
.jp-OutputArea-output dd {
  display: block;
}

.jp-OutputArea-output dl {
  width: 100%;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

.jp-OutputArea-output dt {
  font-weight: bold;
  float: left;
  width: 20%;
  padding: 0;
  margin: 0;
}

.jp-OutputArea-output dd {
  float: left;
  width: 80%;
  padding: 0;
  margin: 0;
}

.jp-TrimmedOutputs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--jp-flat-button-padding);
  margin: 8px 0;
  min-height: var(--jp-flat-button-height);
  font-size: var(--jp-ui-font-size1);
  font-family: var(--jp-ui-font-family);
  background-color: var(--jp-layout-color1);
  border: 1px solid var(--jp-border-color2);
  color: var(--jp-ui-font-color1);
  cursor: pointer;
}

.jp-TrimmedOutputs-button:hover {
  background-color: var(--jp-layout-color2);
  border-color: var(--jp-border-color1);
}

.jp-TrimmedOutputs-button:active {
  background-color: var(--jp-layout-color3);
  border-color: var(--jp-border-color1);
}

.jp-TrimmedOutputs-button:focus-visible {
  outline: 1px solid var(--jp-brand-color1);
  outline-offset: -1px;
}

/* Hide the gutter in case of
 *  - nested output areas (e.g. in the case of output widgets)
 *  - mirrored output areas
 */
.jp-OutputArea .jp-OutputArea .jp-OutputArea-prompt {
  display: none;
}

/* Hide empty lines in the output area, for instance due to cleared widgets */
.jp-OutputArea-prompt:empty {
  padding: 0;
  border: 0;
}

/*-----------------------------------------------------------------------------
| executeResult is added to any Output-result for the display of the object
| returned by a cell
|----------------------------------------------------------------------------*/

.jp-OutputArea-output.jp-OutputArea-executeResult {
  margin-left: 0;
  width: 100%;
  flex: 1 1 auto;
}

/* Text output with the Out[] prompt needs a top padding to match the
 * alignment of the Out[] prompt itself.
 */
.jp-OutputArea-executeResult .jp-RenderedText.jp-OutputArea-output {
  padding-top: var(--jp-code-padding);
  border-top: var(--jp-border-width) solid transparent;
}

/*-----------------------------------------------------------------------------
| The Stdin output
|----------------------------------------------------------------------------*/

.jp-Stdin-prompt {
  color: var(--jp-content-font-color0);
  padding-right: var(--jp-code-padding);
  vertical-align: baseline;
  flex: 0 0 auto;
}

.jp-Stdin-input {
  font-family: var(--jp-code-font-family);
  font-size: inherit;
  color: inherit;
  background-color: inherit;
  width: 42%;
  min-width: 200px;

  /* make sure input baseline aligns with prompt */
  vertical-align: baseline;

  /* padding + margin = 0.5em between prompt and cursor */
  padding: 0 0.25em;
  margin: 0 0.25em;
  flex: 0 0 70%;
}

.jp-Stdin-input::placeholder {
  opacity: 0;
}

.jp-Stdin-input:focus {
  box-shadow: none;
}

.jp-Stdin-input:focus::placeholder {
  opacity: 1;
}

.jp-OutputArea-stdin-hiding {
  /* soft-hide the output, preserving focus */
  opacity: 0;
  height: 0;
}

/*-----------------------------------------------------------------------------
| Output Area View
|----------------------------------------------------------------------------*/

.jp-LinkedOutputView .jp-OutputArea {
  height: 100%;
  display: block;
}

.jp-LinkedOutputView .jp-OutputArea-child:only-child {
  height: 100%;
}

.jp-LinkedOutputView .jp-OutputArea-output:only-child {
  height: 100%;
}

/*-----------------------------------------------------------------------------
| Printing
|----------------------------------------------------------------------------*/

@media print {
  .jp-OutputArea-child {
    display: table;
    table-layout: fixed;
    break-inside: avoid-page;
  }

  .jp-OutputArea-prompt {
    display: table-cell;
    vertical-align: top;
  }

  .jp-OutputArea-output {
    display: table-cell;
  }
}

/*-----------------------------------------------------------------------------
| Mobile
|----------------------------------------------------------------------------*/
@media only screen and (width <= 760px) {
  .jp-OutputArea-child {
    flex-direction: column;
  }

  .jp-OutputPrompt {
    flex: 0 0 auto;
    text-align: left;
  }

  .jp-OutputArea-promptOverlay {
    display: none;
  }
}

/* Trimmed outputs container */
.jp-TrimmedOutputs {
  /* Left-align the button within the output area */
  text-align: left;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/outputarea/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;;8EAG8E;;AAE9E;EACE,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,WAAW;EACX,gBAAgB;AAClB;;AAEA;EACE,kCAAkC;EAClC,qCAAqC;EACrC,0CAA0C;EAC1C,8CAA8C;EAC9C,+BAA+B;EAC/B,oDAAoD;EACpD,uCAAuC;EACvC,mCAAmC;EACnC,gDAAgD;EAChD,sCAAsC;;EAEtC,uEAAuE;EACvE,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;;EAEvB,2BAA2B;EAC3B,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,cAAc;EACd,iBAAiB;EACjB,sBAAsB;EACtB,yBAAyB;EACzB,qBAAqB;AACvB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;EAEE;;AAEF;EACE,kBAAkB;EAClB,MAAM;EACN,kCAAkC;EAClC,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,mCAAmC;EACnC,yDAAyD;AAC3D;;AAEA;EACE,YAAY;EACZ,cAAc;AAChB;;AAEA;;EAEE;AACF;EACE,WAAW;EACX,cAAc;AAChB;;AAEA;;;;;CAKC;AACD;EACE,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,QAAQ;EACR,SAAS;EACT,uBAAuB;AACzB;;AAEA,QAAQ;;AAER;EACE,YAAY;EACZ,SAAS;EACT,UAAU;EACV,gBAAgB;EAChB,gBAAgB;EAChB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;AACvB;;AAEA,WAAW;;AAEX;EACE,cAAc;EACd,eAAe;AACjB;;AAEA,sBAAsB;;AAEtB;;;EAGE,cAAc;AAChB;;AAEA;EACE,WAAW;EACX,gBAAgB;EAChB,UAAU;EACV,SAAS;AACX;;AAEA;EACE,iBAAiB;EACjB,WAAW;EACX,UAAU;EACV,UAAU;EACV,SAAS;AACX;;AAEA;EACE,WAAW;EACX,UAAU;EACV,UAAU;EACV,SAAS;AACX;;AAEA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;EACvB,WAAW;EACX,sCAAsC;EACtC,aAAa;EACb,wCAAwC;EACxC,kCAAkC;EAClC,qCAAqC;EACrC,yCAAyC;EACzC,yCAAyC;EACzC,+BAA+B;EAC/B,eAAe;AACjB;;AAEA;EACE,yCAAyC;EACzC,qCAAqC;AACvC;;AAEA;EACE,yCAAyC;EACzC,qCAAqC;AACvC;;AAEA;EACE,yCAAyC;EACzC,oBAAoB;AACtB;;AAEA;;;EAGE;AACF;EACE,aAAa;AACf;;AAEA,6EAA6E;AAC7E;EACE,UAAU;EACV,SAAS;AACX;;AAEA;;;8EAG8E;;AAE9E;EACE,cAAc;EACd,WAAW;EACX,cAAc;AAChB;;AAEA;;EAEE;AACF;EACE,mCAAmC;EACnC,oDAAoD;AACtD;;AAEA;;8EAE8E;;AAE9E;EACE,oCAAoC;EACpC,qCAAqC;EACrC,wBAAwB;EACxB,cAAc;AAChB;;AAEA;EACE,uCAAuC;EACvC,kBAAkB;EAClB,cAAc;EACd,yBAAyB;EACzB,UAAU;EACV,gBAAgB;;EAEhB,gDAAgD;EAChD,wBAAwB;;EAExB,uDAAuD;EACvD,iBAAiB;EACjB,gBAAgB;EAChB,aAAa;AACf;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,2CAA2C;EAC3C,UAAU;EACV,SAAS;AACX;;AAEA;;8EAE8E;;AAE9E;EACE,YAAY;EACZ,cAAc;AAChB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;;8EAE8E;;AAE9E;EACE;IACE,cAAc;IACd,mBAAmB;IACnB,wBAAwB;EAC1B;;EAEA;IACE,mBAAmB;IACnB,mBAAmB;EACrB;;EAEA;IACE,mBAAmB;EACrB;AACF;;AAEA;;8EAE8E;AAC9E;EACE;IACE,sBAAsB;EACxB;;EAEA;IACE,cAAc;IACd,gBAAgB;EAClB;;EAEA;IACE,aAAa;EACf;AACF;;AAEA,8BAA8B;AAC9B;EACE,iDAAiD;EACjD,gBAAgB;AAClB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Main OutputArea\n| OutputArea has a list of Outputs\n|----------------------------------------------------------------------------*/\n\n.jp-OutputArea {\n  overflow-y: auto;\n}\n\n.jp-OutputArea-child {\n  display: flex;\n  flex-direction: row;\n  width: 100%;\n  overflow: hidden;\n}\n\n.jp-OutputPrompt {\n  width: var(--jp-cell-prompt-width);\n  flex: 0 0 var(--jp-cell-prompt-width);\n  color: var(--jp-cell-outprompt-font-color);\n  font-family: var(--jp-cell-prompt-font-family);\n  padding: var(--jp-code-padding);\n  letter-spacing: var(--jp-cell-prompt-letter-spacing);\n  line-height: var(--jp-code-line-height);\n  font-size: var(--jp-code-font-size);\n  border: var(--jp-border-width) solid transparent;\n  opacity: var(--jp-cell-prompt-opacity);\n\n  /* Right align prompt text, don't wrap to handle large prompt numbers */\n  text-align: right;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n\n  /* Disable text selection */\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.jp-OutputArea-output {\n  width: 100%;\n  height: auto;\n  overflow: auto;\n  user-select: text;\n  -moz-user-select: text;\n  -webkit-user-select: text;\n  -ms-user-select: text;\n}\n\n.jp-OutputArea .jp-RenderedText {\n  padding-left: 1ch;\n}\n\n/**\n * Prompt overlay.\n */\n\n.jp-OutputArea-promptOverlay {\n  position: absolute;\n  top: 0;\n  width: var(--jp-cell-prompt-width);\n  height: 100%;\n  opacity: 0.5;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.jp-OutputArea-promptOverlay .jp-icon-output {\n  display: none;\n}\n\n.jp-OutputArea-promptOverlay:hover .jp-icon-output {\n  display: initial;\n}\n\n.jp-OutputArea-promptOverlay:hover {\n  background: var(--jp-layout-color2);\n  box-shadow: inset 0 0 1px var(--jp-inverse-layout-color0);\n}\n\n.jp-OutputArea-child .jp-OutputArea-output {\n  flex-grow: 1;\n  flex-shrink: 1;\n}\n\n/**\n * Isolated output.\n */\n.jp-OutputArea-output.jp-mod-isolated {\n  width: 100%;\n  display: block;\n}\n\n/*\nWhen drag events occur, `lm-mod-override-cursor` is added to the body.\nBecause iframes steal all cursor events, the following two rules are necessary\nto suppress pointer events while resize drags are occurring. There may be a\nbetter solution to this problem.\n*/\nbody.lm-mod-override-cursor .jp-OutputArea-output.jp-mod-isolated {\n  position: relative;\n}\n\nbody.lm-mod-override-cursor .jp-OutputArea-output.jp-mod-isolated::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background: transparent;\n}\n\n/* pre */\n\n.jp-OutputArea-output pre {\n  border: none;\n  margin: 0;\n  padding: 0;\n  overflow-x: auto;\n  overflow-y: auto;\n  word-break: break-all;\n  word-wrap: break-word;\n  white-space: pre-wrap;\n}\n\n/* tables */\n\n.jp-OutputArea-output.jp-RenderedHTMLCommon table {\n  margin-left: 0;\n  margin-right: 0;\n}\n\n/* description lists */\n\n.jp-OutputArea-output dl,\n.jp-OutputArea-output dt,\n.jp-OutputArea-output dd {\n  display: block;\n}\n\n.jp-OutputArea-output dl {\n  width: 100%;\n  overflow: hidden;\n  padding: 0;\n  margin: 0;\n}\n\n.jp-OutputArea-output dt {\n  font-weight: bold;\n  float: left;\n  width: 20%;\n  padding: 0;\n  margin: 0;\n}\n\n.jp-OutputArea-output dd {\n  float: left;\n  width: 80%;\n  padding: 0;\n  margin: 0;\n}\n\n.jp-TrimmedOutputs-button {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  width: 100%;\n  padding: var(--jp-flat-button-padding);\n  margin: 8px 0;\n  min-height: var(--jp-flat-button-height);\n  font-size: var(--jp-ui-font-size1);\n  font-family: var(--jp-ui-font-family);\n  background-color: var(--jp-layout-color1);\n  border: 1px solid var(--jp-border-color2);\n  color: var(--jp-ui-font-color1);\n  cursor: pointer;\n}\n\n.jp-TrimmedOutputs-button:hover {\n  background-color: var(--jp-layout-color2);\n  border-color: var(--jp-border-color1);\n}\n\n.jp-TrimmedOutputs-button:active {\n  background-color: var(--jp-layout-color3);\n  border-color: var(--jp-border-color1);\n}\n\n.jp-TrimmedOutputs-button:focus-visible {\n  outline: 1px solid var(--jp-brand-color1);\n  outline-offset: -1px;\n}\n\n/* Hide the gutter in case of\n *  - nested output areas (e.g. in the case of output widgets)\n *  - mirrored output areas\n */\n.jp-OutputArea .jp-OutputArea .jp-OutputArea-prompt {\n  display: none;\n}\n\n/* Hide empty lines in the output area, for instance due to cleared widgets */\n.jp-OutputArea-prompt:empty {\n  padding: 0;\n  border: 0;\n}\n\n/*-----------------------------------------------------------------------------\n| executeResult is added to any Output-result for the display of the object\n| returned by a cell\n|----------------------------------------------------------------------------*/\n\n.jp-OutputArea-output.jp-OutputArea-executeResult {\n  margin-left: 0;\n  width: 100%;\n  flex: 1 1 auto;\n}\n\n/* Text output with the Out[] prompt needs a top padding to match the\n * alignment of the Out[] prompt itself.\n */\n.jp-OutputArea-executeResult .jp-RenderedText.jp-OutputArea-output {\n  padding-top: var(--jp-code-padding);\n  border-top: var(--jp-border-width) solid transparent;\n}\n\n/*-----------------------------------------------------------------------------\n| The Stdin output\n|----------------------------------------------------------------------------*/\n\n.jp-Stdin-prompt {\n  color: var(--jp-content-font-color0);\n  padding-right: var(--jp-code-padding);\n  vertical-align: baseline;\n  flex: 0 0 auto;\n}\n\n.jp-Stdin-input {\n  font-family: var(--jp-code-font-family);\n  font-size: inherit;\n  color: inherit;\n  background-color: inherit;\n  width: 42%;\n  min-width: 200px;\n\n  /* make sure input baseline aligns with prompt */\n  vertical-align: baseline;\n\n  /* padding + margin = 0.5em between prompt and cursor */\n  padding: 0 0.25em;\n  margin: 0 0.25em;\n  flex: 0 0 70%;\n}\n\n.jp-Stdin-input::placeholder {\n  opacity: 0;\n}\n\n.jp-Stdin-input:focus {\n  box-shadow: none;\n}\n\n.jp-Stdin-input:focus::placeholder {\n  opacity: 1;\n}\n\n.jp-OutputArea-stdin-hiding {\n  /* soft-hide the output, preserving focus */\n  opacity: 0;\n  height: 0;\n}\n\n/*-----------------------------------------------------------------------------\n| Output Area View\n|----------------------------------------------------------------------------*/\n\n.jp-LinkedOutputView .jp-OutputArea {\n  height: 100%;\n  display: block;\n}\n\n.jp-LinkedOutputView .jp-OutputArea-child:only-child {\n  height: 100%;\n}\n\n.jp-LinkedOutputView .jp-OutputArea-output:only-child {\n  height: 100%;\n}\n\n/*-----------------------------------------------------------------------------\n| Printing\n|----------------------------------------------------------------------------*/\n\n@media print {\n  .jp-OutputArea-child {\n    display: table;\n    table-layout: fixed;\n    break-inside: avoid-page;\n  }\n\n  .jp-OutputArea-prompt {\n    display: table-cell;\n    vertical-align: top;\n  }\n\n  .jp-OutputArea-output {\n    display: table-cell;\n  }\n}\n\n/*-----------------------------------------------------------------------------\n| Mobile\n|----------------------------------------------------------------------------*/\n@media only screen and (width <= 760px) {\n  .jp-OutputArea-child {\n    flex-direction: column;\n  }\n\n  .jp-OutputPrompt {\n    flex: 0 0 auto;\n    text-align: left;\n  }\n\n  .jp-OutputArea-promptOverlay {\n    display: none;\n  }\n}\n\n/* Trimmed outputs container */\n.jp-TrimmedOutputs {\n  /* Left-align the button within the output area */\n  text-align: left;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 83970:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-PDFContainer iframe {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
}

.jp-OutputArea .jp-PDFContainer {
  min-height: 512px;
}

/*
When drag events occur, \`lm-mod-override-cursor\` is added to the body.
This reuses the same CSS selector logic as jp-IFrame to prevent embedded
PDFs from swallowing cursor events.
*/
body.lm-mod-override-cursor .jp-PDFContainer {
  position: relative;
}

body.lm-mod-override-cursor .jp-PDFContainer::before {
  content: '';
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/pdf-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,kBAAkB;EAClB,UAAU;EACV,MAAM;EACN,QAAQ;EACR,WAAW;EACX,YAAY;AACd;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;;;CAIC;AACD;EACE,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,WAAW;EACX,MAAM;EACN,OAAO;EACP,QAAQ;EACR,SAAS;EACT,uBAAuB;AACzB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-PDFContainer iframe {\n  position: absolute;\n  z-index: 0;\n  top: 0;\n  right: 0;\n  width: 100%;\n  height: 100%;\n}\n\n.jp-OutputArea .jp-PDFContainer {\n  min-height: 512px;\n}\n\n/*\nWhen drag events occur, `lm-mod-override-cursor` is added to the body.\nThis reuses the same CSS selector logic as jp-IFrame to prevent embedded\nPDFs from swallowing cursor events.\n*/\nbody.lm-mod-override-cursor .jp-PDFContainer {\n  position: relative;\n}\n\nbody.lm-mod-override-cursor .jp-PDFContainer::before {\n  content: '';\n  position: absolute;\n  z-index: 10;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background: transparent;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 40141:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-pluginmanager {
  display: grid;
  grid-template-rows: min-content min-content 1fr;
}

.jp-pluginmanager-Header,
.jp-pluginmanager-Disclaimer {
  padding: 8px;
}

.jp-pluginmanager-Disclaimer-checkbox {
  position: relative;
  top: 2px;
}

.jp-pluginmanager-AvailableList {
  overflow: auto;
}

.jp-pluginmanager-AvailableList > .jp-sortable-table > thead {
  position: sticky;
}

.jp-pluginmanager-PluginInUseMessage {
  max-width: 550px;
}

.jp-pluginmanager-Header > .jp-FilterBox {
  width: 100%;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/pluginmanager/style/base.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,+CAA+C;AACjD;;AAEA;;EAEE,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,QAAQ;AACV;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-pluginmanager {\n  display: grid;\n  grid-template-rows: min-content min-content 1fr;\n}\n\n.jp-pluginmanager-Header,\n.jp-pluginmanager-Disclaimer {\n  padding: 8px;\n}\n\n.jp-pluginmanager-Disclaimer-checkbox {\n  position: relative;\n  top: 2px;\n}\n\n.jp-pluginmanager-AvailableList {\n  overflow: auto;\n}\n\n.jp-pluginmanager-AvailableList > .jp-sortable-table > thead {\n  position: sticky;\n}\n\n.jp-pluginmanager-PluginInUseMessage {\n  max-width: 550px;\n}\n\n.jp-pluginmanager-Header > .jp-FilterBox {\n  width: 100%;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 22794:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-PropertyInspector {
  display: flex;
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);
}

.jp-PropertyInspector-content {
  flex-grow: 1;
}

.jp-PropertyInspector-placeholder {
  text-align: center;
}

.jp-PropertyInspector-placeholderContent {
  color: var(--jp-content-font-color2);
  padding: 8px;
}

.jp-PropertyInspector-placeholderContent > h3 {
  margin-bottom: var(--jp-content-heading-margin-bottom);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/property-inspector/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,+BAA+B;EAC/B,mCAAmC;AACrC;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,oCAAoC;EACpC,YAAY;AACd;;AAEA;EACE,sDAAsD;AACxD","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-PropertyInspector {\n  display: flex;\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n}\n\n.jp-PropertyInspector-content {\n  flex-grow: 1;\n}\n\n.jp-PropertyInspector-placeholder {\n  text-align: center;\n}\n\n.jp-PropertyInspector-placeholderContent {\n  color: var(--jp-content-font-color2);\n  padding: 8px;\n}\n\n.jp-PropertyInspector-placeholderContent > h3 {\n  margin-bottom: var(--jp-content-heading-margin-bottom);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 96414:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| RenderedText
|----------------------------------------------------------------------------*/

:root {
  /* This is the padding value to fill the gaps between lines containing spans with background color. */
  --jp-private-code-span-padding: calc(
    (var(--jp-code-line-height) - 1) * var(--jp-code-font-size) / 2
  );
}

.jp-RenderedText {
  text-align: left;
  padding-left: var(--jp-code-padding);
  line-height: var(--jp-code-line-height);
  font-family: var(--jp-code-font-family);
}

.jp-ThemedContainer .jp-RenderedText pre,
.jp-ThemedContainer .jp-RenderedJavaScript pre,
.jp-ThemedContainer .jp-RenderedHTMLCommon pre {
  color: var(--jp-content-font-color1);
  font-size: var(--jp-code-font-size);
  border: none;
  margin: 0;
  padding: 0;
}

.jp-RenderedText pre a[href]:link {
  text-decoration: none;
  color: var(--jp-content-link-color);
}

.jp-RenderedText pre a[href]:hover {
  text-decoration: underline;
  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));
}

.jp-RenderedText pre a[href]:visited {
  text-decoration: none;
  color: var(--jp-content-link-visited-color, var(--jp-content-link-color));
}

/* console foregrounds and backgrounds */
.jp-RenderedText pre .ansi-black-fg {
  color: #3e424d;
}

.jp-RenderedText pre .ansi-red-fg {
  color: #e75c58;
}

.jp-RenderedText pre .ansi-green-fg {
  color: #00a250;
}

.jp-RenderedText pre .ansi-yellow-fg {
  color: #ddb62b;
}

.jp-RenderedText pre .ansi-blue-fg {
  color: #208ffb;
}

.jp-RenderedText pre .ansi-magenta-fg {
  color: #d160c4;
}

.jp-RenderedText pre .ansi-cyan-fg {
  color: #60c6c8;
}

.jp-RenderedText pre .ansi-white-fg {
  color: #c5c1b4;
}

.jp-RenderedText pre .ansi-black-bg {
  background-color: #3e424d;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-red-bg {
  background-color: #e75c58;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-green-bg {
  background-color: #00a250;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-yellow-bg {
  background-color: #ddb62b;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-blue-bg {
  background-color: #208ffb;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-magenta-bg {
  background-color: #d160c4;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-cyan-bg {
  background-color: #60c6c8;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-white-bg {
  background-color: #c5c1b4;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-black-intense-fg {
  color: #282c36;
}

.jp-RenderedText pre .ansi-red-intense-fg {
  color: #b22b31;
}

.jp-RenderedText pre .ansi-green-intense-fg {
  color: #007427;
}

.jp-RenderedText pre .ansi-yellow-intense-fg {
  color: #b27d12;
}

.jp-RenderedText pre .ansi-blue-intense-fg {
  color: #0065ca;
}

.jp-RenderedText pre .ansi-magenta-intense-fg {
  color: #a03196;
}

.jp-RenderedText pre .ansi-cyan-intense-fg {
  color: #258f8f;
}

.jp-RenderedText pre .ansi-white-intense-fg {
  color: #a1a6b2;
}

.jp-RenderedText pre .ansi-black-intense-bg {
  background-color: #282c36;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-red-intense-bg {
  background-color: #b22b31;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-green-intense-bg {
  background-color: #007427;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-yellow-intense-bg {
  background-color: #b27d12;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-blue-intense-bg {
  background-color: #0065ca;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-magenta-intense-bg {
  background-color: #a03196;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-cyan-intense-bg {
  background-color: #258f8f;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-white-intense-bg {
  background-color: #a1a6b2;
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-default-inverse-fg {
  color: var(--jp-ui-inverse-font-color0);
}

.jp-RenderedText pre .ansi-default-inverse-bg {
  background-color: var(--jp-inverse-layout-color0);
  padding: var(--jp-private-code-span-padding) 0;
}

.jp-RenderedText pre .ansi-bold {
  font-weight: bold;
}

.jp-RenderedText pre .ansi-underline {
  text-decoration: underline;
}

.jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr'] {
  background: var(--jp-rendermime-error-background);
  padding-top: var(--jp-code-padding);
}

/* fix illegible yellow text with yellow background in exception stacktrace */
.jp-RenderedText pre .ansi-yellow-bg.ansi-yellow-fg {
  color: black;
}

/*-----------------------------------------------------------------------------
| RenderedLatex
|----------------------------------------------------------------------------*/

.jp-RenderedLatex {
  color: var(--jp-content-font-color1);
  font-size: var(--jp-content-font-size1);
  line-height: var(--jp-content-line-height);
}

/* Left-justify outputs.*/
.jp-OutputArea-output.jp-RenderedLatex {
  padding: var(--jp-code-padding);
  text-align: left;
}

/*-----------------------------------------------------------------------------
| RenderedHTML
|----------------------------------------------------------------------------*/

.jp-RenderedHTMLCommon {
  color: var(--jp-content-font-color1);
  font-family: var(--jp-content-font-family);
  font-size: var(--jp-content-font-size1);
  line-height: var(--jp-content-line-height);

  /* Give a bit more R padding on Markdown text to keep line lengths reasonable */
  padding-right: 20px;
}

.jp-RenderedHTMLCommon em {
  font-style: italic;
}

.jp-RenderedHTMLCommon strong {
  font-weight: bold;
}

.jp-RenderedHTMLCommon u {
  text-decoration: underline;
}

.jp-RenderedHTMLCommon a:link {
  text-decoration: none;
  color: var(--jp-content-link-color);
}

.jp-RenderedHTMLCommon a:hover {
  text-decoration: underline;
  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));
}

.jp-RenderedHTMLCommon a:visited {
  text-decoration: none;
  color: var(--jp-content-link-visited-color, var(--jp-content-link-color));
}

/* Headings */

.jp-RenderedHTMLCommon h1,
.jp-RenderedHTMLCommon h2,
.jp-RenderedHTMLCommon h3,
.jp-RenderedHTMLCommon h4,
.jp-RenderedHTMLCommon h5,
.jp-RenderedHTMLCommon h6 {
  line-height: var(--jp-content-heading-line-height);
  font-weight: var(--jp-content-heading-font-weight);
  font-style: normal;
  margin: var(--jp-content-heading-margin-top) 0
    var(--jp-content-heading-margin-bottom) 0;
  scroll-margin-top: var(--jp-content-heading-margin-top);
}

.jp-RenderedHTMLCommon h1:first-child,
.jp-RenderedHTMLCommon h2:first-child,
.jp-RenderedHTMLCommon h3:first-child,
.jp-RenderedHTMLCommon h4:first-child,
.jp-RenderedHTMLCommon h5:first-child,
.jp-RenderedHTMLCommon h6:first-child {
  margin-top: calc(0.5 * var(--jp-content-heading-margin-top));
  scroll-margin-top: calc(0.5 * var(--jp-content-heading-margin-top));
}

.jp-RenderedHTMLCommon h1:last-child,
.jp-RenderedHTMLCommon h2:last-child,
.jp-RenderedHTMLCommon h3:last-child,
.jp-RenderedHTMLCommon h4:last-child,
.jp-RenderedHTMLCommon h5:last-child,
.jp-RenderedHTMLCommon h6:last-child {
  margin-bottom: calc(0.5 * var(--jp-content-heading-margin-bottom));
}

.jp-RenderedHTMLCommon h1 {
  font-size: var(--jp-content-font-size5);
}

.jp-RenderedHTMLCommon h2 {
  font-size: var(--jp-content-font-size4);
}

.jp-RenderedHTMLCommon h3 {
  font-size: var(--jp-content-font-size3);
}

.jp-RenderedHTMLCommon h4 {
  font-size: var(--jp-content-font-size2);
}

.jp-RenderedHTMLCommon h5 {
  font-size: var(--jp-content-font-size1);
}

.jp-RenderedHTMLCommon h6 {
  font-size: var(--jp-content-font-size0);
}

/* Lists */

/* stylelint-disable selector-max-type, selector-max-compound-selectors */

.jp-RenderedHTMLCommon ul:not(.list-inline),
.jp-RenderedHTMLCommon ol:not(.list-inline) {
  padding-left: 2em;
}

.jp-RenderedHTMLCommon ul {
  list-style: disc;
}

.jp-RenderedHTMLCommon ul ul {
  list-style: square;
}

.jp-RenderedHTMLCommon ul ul ul {
  list-style: circle;
}

.jp-RenderedHTMLCommon ol {
  list-style: decimal;
}

.jp-RenderedHTMLCommon ol ol {
  list-style: upper-alpha;
}

.jp-RenderedHTMLCommon ol ol ol {
  list-style: lower-alpha;
}

.jp-RenderedHTMLCommon ol ol ol ol {
  list-style: lower-roman;
}

.jp-RenderedHTMLCommon ol ol ol ol ol {
  list-style: decimal;
}

.jp-RenderedHTMLCommon ol,
.jp-RenderedHTMLCommon ul {
  margin-bottom: 1em;
}

.jp-RenderedHTMLCommon ul ul,
.jp-RenderedHTMLCommon ul ol,
.jp-RenderedHTMLCommon ol ul,
.jp-RenderedHTMLCommon ol ol {
  margin-bottom: 0;
}

/* stylelint-enable selector-max-type, selector-max-compound-selectors */

.jp-RenderedHTMLCommon hr {
  color: var(--jp-border-color2);
  background-color: var(--jp-border-color1);
  margin-top: 1em;
  margin-bottom: 1em;
}

.jp-ThemedContainer .jp-RenderedHTMLCommon > pre {
  margin: 1.5em 2em;
}

.jp-ThemedContainer .jp-RenderedHTMLCommon pre,
.jp-ThemedContainer .jp-RenderedHTMLCommon code {
  border: 0;
  background-color: var(--jp-layout-color0);
  color: var(--jp-content-font-color1);
  font-family: var(--jp-code-font-family);
  font-size: inherit;
  line-height: var(--jp-code-line-height);
  padding: 0;
  white-space: pre-wrap;
}

.jp-ThemedContainer .jp-RenderedHTMLCommon :not(pre) > code {
  background-color: var(--jp-layout-color2);
  padding: 1px 5px;
}

/* Tables */

.jp-RenderedHTMLCommon table {
  border-collapse: collapse;
  border-spacing: 0;
  border: none;
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  table-layout: fixed;
  margin-left: auto;
  margin-bottom: 1em;
  margin-right: auto;
}

.jp-RenderedHTMLCommon thead {
  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
  vertical-align: bottom;
}

.jp-RenderedHTMLCommon td,
.jp-RenderedHTMLCommon th,
.jp-RenderedHTMLCommon tr {
  vertical-align: middle;
  padding: 0.5em;
  line-height: normal;
  white-space: normal;
  max-width: none;
  border: none;
}

.jp-RenderedMarkdown.jp-RenderedHTMLCommon td,
.jp-RenderedMarkdown.jp-RenderedHTMLCommon th {
  max-width: none;
}

:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon td,
:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon th,
:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon tr {
  text-align: right;
}

.jp-RenderedHTMLCommon th {
  font-weight: bold;
}

.jp-RenderedHTMLCommon tbody tr:nth-child(odd) {
  background: var(--jp-layout-color0);
}

.jp-RenderedHTMLCommon tbody tr:nth-child(even) {
  background: var(--jp-rendermime-table-row-background);
}

.jp-RenderedHTMLCommon tbody tr:hover {
  background: var(--jp-rendermime-table-row-hover-background);
}

.jp-RenderedHTMLCommon p {
  text-align: left;
  margin: 0;
  margin-bottom: 1em;
}

.jp-RenderedHTMLCommon img {
  -moz-force-broken-image-icon: 1;
}

/* Restrict to direct children as other images could be nested in other content. */
.jp-RenderedHTMLCommon > img {
  display: block;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 1em;
}

/* Change color behind transparent images if they need it... */
[data-jp-theme-light='false'] .jp-RenderedImage img.jp-needs-light-background {
  background-color: var(--jp-inverse-layout-color1);
}

[data-jp-theme-light='true'] .jp-RenderedImage img.jp-needs-dark-background {
  background-color: var(--jp-inverse-layout-color1);
}

.jp-RenderedHTMLCommon img,
.jp-RenderedImage img,
.jp-RenderedHTMLCommon svg,
.jp-RenderedSVG svg {
  max-width: 100%;
  height: auto;
}

.jp-RenderedHTMLCommon img.jp-mod-unconfined,
.jp-RenderedImage img.jp-mod-unconfined,
.jp-RenderedHTMLCommon svg.jp-mod-unconfined,
.jp-RenderedSVG svg.jp-mod-unconfined {
  max-width: none;
}

.jp-RenderedHTMLCommon .alert {
  padding: var(--jp-notebook-padding);
  border: var(--jp-border-width) solid transparent;
  border-radius: var(--jp-border-radius);
  margin-bottom: 1em;
}

.jp-RenderedHTMLCommon .alert-info {
  color: var(--jp-info-color0);
  background-color: var(--jp-info-color3);
  border-color: var(--jp-info-color2);
}

.jp-RenderedHTMLCommon .alert-info hr {
  border-color: var(--jp-info-color3);
}

.jp-RenderedHTMLCommon .alert-info > p:last-child,
.jp-RenderedHTMLCommon .alert-info > ul:last-child {
  margin-bottom: 0;
}

.jp-RenderedHTMLCommon .alert-warning {
  color: var(--jp-warn-color0);
  background-color: var(--jp-warn-color3);
  border-color: var(--jp-warn-color2);
}

.jp-RenderedHTMLCommon .alert-warning hr {
  border-color: var(--jp-warn-color3);
}

.jp-RenderedHTMLCommon .alert-warning > p:last-child,
.jp-RenderedHTMLCommon .alert-warning > ul:last-child {
  margin-bottom: 0;
}

.jp-RenderedHTMLCommon .alert-success {
  color: var(--jp-success-color0);
  background-color: var(--jp-success-color3);
  border-color: var(--jp-success-color2);
}

.jp-RenderedHTMLCommon .alert-success hr {
  border-color: var(--jp-success-color3);
}

.jp-RenderedHTMLCommon .alert-success > p:last-child,
.jp-RenderedHTMLCommon .alert-success > ul:last-child {
  margin-bottom: 0;
}

.jp-RenderedHTMLCommon .alert-danger {
  color: var(--jp-error-color0);
  background-color: var(--jp-error-color3);
  border-color: var(--jp-error-color2);
}

.jp-RenderedHTMLCommon .alert-danger hr {
  border-color: var(--jp-error-color3);
}

.jp-RenderedHTMLCommon .alert-danger > p:last-child,
.jp-RenderedHTMLCommon .alert-danger > ul:last-child {
  margin-bottom: 0;
}

.jp-RenderedHTMLCommon blockquote {
  margin: 1em 2em;
  padding: 0 1em;
  border-left: 5px solid var(--jp-border-color2);
}

a.jp-InternalAnchorLink {
  visibility: hidden;
  margin-left: 8px;
  color: var(--md-blue-800, #1565c0);
}

h1:hover .jp-InternalAnchorLink,
h2:hover .jp-InternalAnchorLink,
h3:hover .jp-InternalAnchorLink,
h4:hover .jp-InternalAnchorLink,
h5:hover .jp-InternalAnchorLink,
h6:hover .jp-InternalAnchorLink {
  visibility: visible;
}

.jp-ThemedContainer .jp-RenderedHTMLCommon kbd {
  background-color: var(--jp-rendermime-table-row-background);
  border: 1px solid var(--jp-border-color0);
  border-bottom-color: var(--jp-border-color2);
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  display: inline-block;
  font-size: var(--jp-ui-font-size0);
  line-height: 1em;
  padding: 0.2em 0.5em;
}

/* Most direct children of .jp-RenderedHTMLCommon have a margin-bottom of 1.0.
 * At the bottom of cells this is a bit too much as there is also spacing
 * between cells. Going all the way to 0 gets too tight between markdown and
 * code cells.
 */
.jp-RenderedHTMLCommon > *:last-child {
  margin-bottom: 0.5em;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/rendermime/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,qGAAqG;EACrG;;GAEC;AACH;;AAEA;EACE,gBAAgB;EAChB,oCAAoC;EACpC,uCAAuC;EACvC,uCAAuC;AACzC;;AAEA;;;EAGE,oCAAoC;EACpC,mCAAmC;EACnC,YAAY;EACZ,SAAS;EACT,UAAU;AACZ;;AAEA;EACE,qBAAqB;EACrB,mCAAmC;AACrC;;AAEA;EACE,0BAA0B;EAC1B,uEAAuE;AACzE;;AAEA;EACE,qBAAqB;EACrB,yEAAyE;AAC3E;;AAEA,wCAAwC;AACxC;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;AAChD;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,iDAAiD;EACjD,8CAA8C;AAChD;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,0BAA0B;AAC5B;;AAEA;EACE,iDAAiD;EACjD,mCAAmC;AACrC;;AAEA,6EAA6E;AAC7E;EACE,YAAY;AACd;;AAEA;;8EAE8E;;AAE9E;EACE,oCAAoC;EACpC,uCAAuC;EACvC,0CAA0C;AAC5C;;AAEA,yBAAyB;AACzB;EACE,+BAA+B;EAC/B,gBAAgB;AAClB;;AAEA;;8EAE8E;;AAE9E;EACE,oCAAoC;EACpC,0CAA0C;EAC1C,uCAAuC;EACvC,0CAA0C;;EAE1C,+EAA+E;EAC/E,mBAAmB;AACrB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,0BAA0B;AAC5B;;AAEA;EACE,qBAAqB;EACrB,mCAAmC;AACrC;;AAEA;EACE,0BAA0B;EAC1B,uEAAuE;AACzE;;AAEA;EACE,qBAAqB;EACrB,yEAAyE;AAC3E;;AAEA,aAAa;;AAEb;;;;;;EAME,kDAAkD;EAClD,kDAAkD;EAClD,kBAAkB;EAClB;6CAC2C;EAC3C,uDAAuD;AACzD;;AAEA;;;;;;EAME,4DAA4D;EAC5D,mEAAmE;AACrE;;AAEA;;;;;;EAME,kEAAkE;AACpE;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA,UAAU;;AAEV,yEAAyE;;AAEzE;;EAEE,iBAAiB;AACnB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;;EAEE,kBAAkB;AACpB;;AAEA;;;;EAIE,gBAAgB;AAClB;;AAEA,wEAAwE;;AAExE;EACE,8BAA8B;EAC9B,yCAAyC;EACzC,eAAe;EACf,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;EAEE,SAAS;EACT,yCAAyC;EACzC,oCAAoC;EACpC,uCAAuC;EACvC,kBAAkB;EAClB,uCAAuC;EACvC,UAAU;EACV,qBAAqB;AACvB;;AAEA;EACE,yCAAyC;EACzC,gBAAgB;AAClB;;AAEA,WAAW;;AAEX;EACE,yBAAyB;EACzB,iBAAiB;EACjB,YAAY;EACZ,+BAA+B;EAC/B,kCAAkC;EAClC,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,kBAAkB;AACpB;;AAEA;EACE,mEAAmE;EACnE,sBAAsB;AACxB;;AAEA;;;EAGE,sBAAsB;EACtB,cAAc;EACd,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,YAAY;AACd;;AAEA;;EAEE,eAAe;AACjB;;AAEA;;;EAGE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,qDAAqD;AACvD;;AAEA;EACE,2DAA2D;AAC7D;;AAEA;EACE,gBAAgB;EAChB,SAAS;EACT,kBAAkB;AACpB;;AAEA;EACE,+BAA+B;AACjC;;AAEA,kFAAkF;AAClF;EACE,cAAc;EACd,cAAc;EACd,eAAe;EACf,kBAAkB;AACpB;;AAEA,8DAA8D;AAC9D;EACE,iDAAiD;AACnD;;AAEA;EACE,iDAAiD;AACnD;;AAEA;;;;EAIE,eAAe;EACf,YAAY;AACd;;AAEA;;;;EAIE,eAAe;AACjB;;AAEA;EACE,mCAAmC;EACnC,gDAAgD;EAChD,sCAAsC;EACtC,kBAAkB;AACpB;;AAEA;EACE,4BAA4B;EAC5B,uCAAuC;EACvC,mCAAmC;AACrC;;AAEA;EACE,mCAAmC;AACrC;;AAEA;;EAEE,gBAAgB;AAClB;;AAEA;EACE,4BAA4B;EAC5B,uCAAuC;EACvC,mCAAmC;AACrC;;AAEA;EACE,mCAAmC;AACrC;;AAEA;;EAEE,gBAAgB;AAClB;;AAEA;EACE,+BAA+B;EAC/B,0CAA0C;EAC1C,sCAAsC;AACxC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;;EAEE,gBAAgB;AAClB;;AAEA;EACE,6BAA6B;EAC7B,wCAAwC;EACxC,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;;EAEE,gBAAgB;AAClB;;AAEA;EACE,eAAe;EACf,cAAc;EACd,8CAA8C;AAChD;;AAEA;EACE,kBAAkB;EAClB,gBAAgB;EAChB,kCAAkC;AACpC;;AAEA;;;;;;EAME,mBAAmB;AACrB;;AAEA;EACE,2DAA2D;EAC3D,yCAAyC;EACzC,4CAA4C;EAC5C,kBAAkB;EAClB,8CAA8C;EAC9C,qBAAqB;EACrB,kCAAkC;EAClC,gBAAgB;EAChB,oBAAoB;AACtB;;AAEA;;;;EAIE;AACF;EACE,oBAAoB;AACtB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| RenderedText\n|----------------------------------------------------------------------------*/\n\n:root {\n  /* This is the padding value to fill the gaps between lines containing spans with background color. */\n  --jp-private-code-span-padding: calc(\n    (var(--jp-code-line-height) - 1) * var(--jp-code-font-size) / 2\n  );\n}\n\n.jp-RenderedText {\n  text-align: left;\n  padding-left: var(--jp-code-padding);\n  line-height: var(--jp-code-line-height);\n  font-family: var(--jp-code-font-family);\n}\n\n.jp-ThemedContainer .jp-RenderedText pre,\n.jp-ThemedContainer .jp-RenderedJavaScript pre,\n.jp-ThemedContainer .jp-RenderedHTMLCommon pre {\n  color: var(--jp-content-font-color1);\n  font-size: var(--jp-code-font-size);\n  border: none;\n  margin: 0;\n  padding: 0;\n}\n\n.jp-RenderedText pre a[href]:link {\n  text-decoration: none;\n  color: var(--jp-content-link-color);\n}\n\n.jp-RenderedText pre a[href]:hover {\n  text-decoration: underline;\n  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));\n}\n\n.jp-RenderedText pre a[href]:visited {\n  text-decoration: none;\n  color: var(--jp-content-link-visited-color, var(--jp-content-link-color));\n}\n\n/* console foregrounds and backgrounds */\n.jp-RenderedText pre .ansi-black-fg {\n  color: #3e424d;\n}\n\n.jp-RenderedText pre .ansi-red-fg {\n  color: #e75c58;\n}\n\n.jp-RenderedText pre .ansi-green-fg {\n  color: #00a250;\n}\n\n.jp-RenderedText pre .ansi-yellow-fg {\n  color: #ddb62b;\n}\n\n.jp-RenderedText pre .ansi-blue-fg {\n  color: #208ffb;\n}\n\n.jp-RenderedText pre .ansi-magenta-fg {\n  color: #d160c4;\n}\n\n.jp-RenderedText pre .ansi-cyan-fg {\n  color: #60c6c8;\n}\n\n.jp-RenderedText pre .ansi-white-fg {\n  color: #c5c1b4;\n}\n\n.jp-RenderedText pre .ansi-black-bg {\n  background-color: #3e424d;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-red-bg {\n  background-color: #e75c58;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-green-bg {\n  background-color: #00a250;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-yellow-bg {\n  background-color: #ddb62b;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-blue-bg {\n  background-color: #208ffb;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-magenta-bg {\n  background-color: #d160c4;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-cyan-bg {\n  background-color: #60c6c8;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-white-bg {\n  background-color: #c5c1b4;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-black-intense-fg {\n  color: #282c36;\n}\n\n.jp-RenderedText pre .ansi-red-intense-fg {\n  color: #b22b31;\n}\n\n.jp-RenderedText pre .ansi-green-intense-fg {\n  color: #007427;\n}\n\n.jp-RenderedText pre .ansi-yellow-intense-fg {\n  color: #b27d12;\n}\n\n.jp-RenderedText pre .ansi-blue-intense-fg {\n  color: #0065ca;\n}\n\n.jp-RenderedText pre .ansi-magenta-intense-fg {\n  color: #a03196;\n}\n\n.jp-RenderedText pre .ansi-cyan-intense-fg {\n  color: #258f8f;\n}\n\n.jp-RenderedText pre .ansi-white-intense-fg {\n  color: #a1a6b2;\n}\n\n.jp-RenderedText pre .ansi-black-intense-bg {\n  background-color: #282c36;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-red-intense-bg {\n  background-color: #b22b31;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-green-intense-bg {\n  background-color: #007427;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-yellow-intense-bg {\n  background-color: #b27d12;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-blue-intense-bg {\n  background-color: #0065ca;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-magenta-intense-bg {\n  background-color: #a03196;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-cyan-intense-bg {\n  background-color: #258f8f;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-white-intense-bg {\n  background-color: #a1a6b2;\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-default-inverse-fg {\n  color: var(--jp-ui-inverse-font-color0);\n}\n\n.jp-RenderedText pre .ansi-default-inverse-bg {\n  background-color: var(--jp-inverse-layout-color0);\n  padding: var(--jp-private-code-span-padding) 0;\n}\n\n.jp-RenderedText pre .ansi-bold {\n  font-weight: bold;\n}\n\n.jp-RenderedText pre .ansi-underline {\n  text-decoration: underline;\n}\n\n.jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr'] {\n  background: var(--jp-rendermime-error-background);\n  padding-top: var(--jp-code-padding);\n}\n\n/* fix illegible yellow text with yellow background in exception stacktrace */\n.jp-RenderedText pre .ansi-yellow-bg.ansi-yellow-fg {\n  color: black;\n}\n\n/*-----------------------------------------------------------------------------\n| RenderedLatex\n|----------------------------------------------------------------------------*/\n\n.jp-RenderedLatex {\n  color: var(--jp-content-font-color1);\n  font-size: var(--jp-content-font-size1);\n  line-height: var(--jp-content-line-height);\n}\n\n/* Left-justify outputs.*/\n.jp-OutputArea-output.jp-RenderedLatex {\n  padding: var(--jp-code-padding);\n  text-align: left;\n}\n\n/*-----------------------------------------------------------------------------\n| RenderedHTML\n|----------------------------------------------------------------------------*/\n\n.jp-RenderedHTMLCommon {\n  color: var(--jp-content-font-color1);\n  font-family: var(--jp-content-font-family);\n  font-size: var(--jp-content-font-size1);\n  line-height: var(--jp-content-line-height);\n\n  /* Give a bit more R padding on Markdown text to keep line lengths reasonable */\n  padding-right: 20px;\n}\n\n.jp-RenderedHTMLCommon em {\n  font-style: italic;\n}\n\n.jp-RenderedHTMLCommon strong {\n  font-weight: bold;\n}\n\n.jp-RenderedHTMLCommon u {\n  text-decoration: underline;\n}\n\n.jp-RenderedHTMLCommon a:link {\n  text-decoration: none;\n  color: var(--jp-content-link-color);\n}\n\n.jp-RenderedHTMLCommon a:hover {\n  text-decoration: underline;\n  color: var(--jp-content-link-hover-color, var(--jp-content-link-color));\n}\n\n.jp-RenderedHTMLCommon a:visited {\n  text-decoration: none;\n  color: var(--jp-content-link-visited-color, var(--jp-content-link-color));\n}\n\n/* Headings */\n\n.jp-RenderedHTMLCommon h1,\n.jp-RenderedHTMLCommon h2,\n.jp-RenderedHTMLCommon h3,\n.jp-RenderedHTMLCommon h4,\n.jp-RenderedHTMLCommon h5,\n.jp-RenderedHTMLCommon h6 {\n  line-height: var(--jp-content-heading-line-height);\n  font-weight: var(--jp-content-heading-font-weight);\n  font-style: normal;\n  margin: var(--jp-content-heading-margin-top) 0\n    var(--jp-content-heading-margin-bottom) 0;\n  scroll-margin-top: var(--jp-content-heading-margin-top);\n}\n\n.jp-RenderedHTMLCommon h1:first-child,\n.jp-RenderedHTMLCommon h2:first-child,\n.jp-RenderedHTMLCommon h3:first-child,\n.jp-RenderedHTMLCommon h4:first-child,\n.jp-RenderedHTMLCommon h5:first-child,\n.jp-RenderedHTMLCommon h6:first-child {\n  margin-top: calc(0.5 * var(--jp-content-heading-margin-top));\n  scroll-margin-top: calc(0.5 * var(--jp-content-heading-margin-top));\n}\n\n.jp-RenderedHTMLCommon h1:last-child,\n.jp-RenderedHTMLCommon h2:last-child,\n.jp-RenderedHTMLCommon h3:last-child,\n.jp-RenderedHTMLCommon h4:last-child,\n.jp-RenderedHTMLCommon h5:last-child,\n.jp-RenderedHTMLCommon h6:last-child {\n  margin-bottom: calc(0.5 * var(--jp-content-heading-margin-bottom));\n}\n\n.jp-RenderedHTMLCommon h1 {\n  font-size: var(--jp-content-font-size5);\n}\n\n.jp-RenderedHTMLCommon h2 {\n  font-size: var(--jp-content-font-size4);\n}\n\n.jp-RenderedHTMLCommon h3 {\n  font-size: var(--jp-content-font-size3);\n}\n\n.jp-RenderedHTMLCommon h4 {\n  font-size: var(--jp-content-font-size2);\n}\n\n.jp-RenderedHTMLCommon h5 {\n  font-size: var(--jp-content-font-size1);\n}\n\n.jp-RenderedHTMLCommon h6 {\n  font-size: var(--jp-content-font-size0);\n}\n\n/* Lists */\n\n/* stylelint-disable selector-max-type, selector-max-compound-selectors */\n\n.jp-RenderedHTMLCommon ul:not(.list-inline),\n.jp-RenderedHTMLCommon ol:not(.list-inline) {\n  padding-left: 2em;\n}\n\n.jp-RenderedHTMLCommon ul {\n  list-style: disc;\n}\n\n.jp-RenderedHTMLCommon ul ul {\n  list-style: square;\n}\n\n.jp-RenderedHTMLCommon ul ul ul {\n  list-style: circle;\n}\n\n.jp-RenderedHTMLCommon ol {\n  list-style: decimal;\n}\n\n.jp-RenderedHTMLCommon ol ol {\n  list-style: upper-alpha;\n}\n\n.jp-RenderedHTMLCommon ol ol ol {\n  list-style: lower-alpha;\n}\n\n.jp-RenderedHTMLCommon ol ol ol ol {\n  list-style: lower-roman;\n}\n\n.jp-RenderedHTMLCommon ol ol ol ol ol {\n  list-style: decimal;\n}\n\n.jp-RenderedHTMLCommon ol,\n.jp-RenderedHTMLCommon ul {\n  margin-bottom: 1em;\n}\n\n.jp-RenderedHTMLCommon ul ul,\n.jp-RenderedHTMLCommon ul ol,\n.jp-RenderedHTMLCommon ol ul,\n.jp-RenderedHTMLCommon ol ol {\n  margin-bottom: 0;\n}\n\n/* stylelint-enable selector-max-type, selector-max-compound-selectors */\n\n.jp-RenderedHTMLCommon hr {\n  color: var(--jp-border-color2);\n  background-color: var(--jp-border-color1);\n  margin-top: 1em;\n  margin-bottom: 1em;\n}\n\n.jp-ThemedContainer .jp-RenderedHTMLCommon > pre {\n  margin: 1.5em 2em;\n}\n\n.jp-ThemedContainer .jp-RenderedHTMLCommon pre,\n.jp-ThemedContainer .jp-RenderedHTMLCommon code {\n  border: 0;\n  background-color: var(--jp-layout-color0);\n  color: var(--jp-content-font-color1);\n  font-family: var(--jp-code-font-family);\n  font-size: inherit;\n  line-height: var(--jp-code-line-height);\n  padding: 0;\n  white-space: pre-wrap;\n}\n\n.jp-ThemedContainer .jp-RenderedHTMLCommon :not(pre) > code {\n  background-color: var(--jp-layout-color2);\n  padding: 1px 5px;\n}\n\n/* Tables */\n\n.jp-RenderedHTMLCommon table {\n  border-collapse: collapse;\n  border-spacing: 0;\n  border: none;\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  table-layout: fixed;\n  margin-left: auto;\n  margin-bottom: 1em;\n  margin-right: auto;\n}\n\n.jp-RenderedHTMLCommon thead {\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n  vertical-align: bottom;\n}\n\n.jp-RenderedHTMLCommon td,\n.jp-RenderedHTMLCommon th,\n.jp-RenderedHTMLCommon tr {\n  vertical-align: middle;\n  padding: 0.5em;\n  line-height: normal;\n  white-space: normal;\n  max-width: none;\n  border: none;\n}\n\n.jp-RenderedMarkdown.jp-RenderedHTMLCommon td,\n.jp-RenderedMarkdown.jp-RenderedHTMLCommon th {\n  max-width: none;\n}\n\n:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon td,\n:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon th,\n:not(.jp-RenderedMarkdown).jp-RenderedHTMLCommon tr {\n  text-align: right;\n}\n\n.jp-RenderedHTMLCommon th {\n  font-weight: bold;\n}\n\n.jp-RenderedHTMLCommon tbody tr:nth-child(odd) {\n  background: var(--jp-layout-color0);\n}\n\n.jp-RenderedHTMLCommon tbody tr:nth-child(even) {\n  background: var(--jp-rendermime-table-row-background);\n}\n\n.jp-RenderedHTMLCommon tbody tr:hover {\n  background: var(--jp-rendermime-table-row-hover-background);\n}\n\n.jp-RenderedHTMLCommon p {\n  text-align: left;\n  margin: 0;\n  margin-bottom: 1em;\n}\n\n.jp-RenderedHTMLCommon img {\n  -moz-force-broken-image-icon: 1;\n}\n\n/* Restrict to direct children as other images could be nested in other content. */\n.jp-RenderedHTMLCommon > img {\n  display: block;\n  margin-left: 0;\n  margin-right: 0;\n  margin-bottom: 1em;\n}\n\n/* Change color behind transparent images if they need it... */\n[data-jp-theme-light='false'] .jp-RenderedImage img.jp-needs-light-background {\n  background-color: var(--jp-inverse-layout-color1);\n}\n\n[data-jp-theme-light='true'] .jp-RenderedImage img.jp-needs-dark-background {\n  background-color: var(--jp-inverse-layout-color1);\n}\n\n.jp-RenderedHTMLCommon img,\n.jp-RenderedImage img,\n.jp-RenderedHTMLCommon svg,\n.jp-RenderedSVG svg {\n  max-width: 100%;\n  height: auto;\n}\n\n.jp-RenderedHTMLCommon img.jp-mod-unconfined,\n.jp-RenderedImage img.jp-mod-unconfined,\n.jp-RenderedHTMLCommon svg.jp-mod-unconfined,\n.jp-RenderedSVG svg.jp-mod-unconfined {\n  max-width: none;\n}\n\n.jp-RenderedHTMLCommon .alert {\n  padding: var(--jp-notebook-padding);\n  border: var(--jp-border-width) solid transparent;\n  border-radius: var(--jp-border-radius);\n  margin-bottom: 1em;\n}\n\n.jp-RenderedHTMLCommon .alert-info {\n  color: var(--jp-info-color0);\n  background-color: var(--jp-info-color3);\n  border-color: var(--jp-info-color2);\n}\n\n.jp-RenderedHTMLCommon .alert-info hr {\n  border-color: var(--jp-info-color3);\n}\n\n.jp-RenderedHTMLCommon .alert-info > p:last-child,\n.jp-RenderedHTMLCommon .alert-info > ul:last-child {\n  margin-bottom: 0;\n}\n\n.jp-RenderedHTMLCommon .alert-warning {\n  color: var(--jp-warn-color0);\n  background-color: var(--jp-warn-color3);\n  border-color: var(--jp-warn-color2);\n}\n\n.jp-RenderedHTMLCommon .alert-warning hr {\n  border-color: var(--jp-warn-color3);\n}\n\n.jp-RenderedHTMLCommon .alert-warning > p:last-child,\n.jp-RenderedHTMLCommon .alert-warning > ul:last-child {\n  margin-bottom: 0;\n}\n\n.jp-RenderedHTMLCommon .alert-success {\n  color: var(--jp-success-color0);\n  background-color: var(--jp-success-color3);\n  border-color: var(--jp-success-color2);\n}\n\n.jp-RenderedHTMLCommon .alert-success hr {\n  border-color: var(--jp-success-color3);\n}\n\n.jp-RenderedHTMLCommon .alert-success > p:last-child,\n.jp-RenderedHTMLCommon .alert-success > ul:last-child {\n  margin-bottom: 0;\n}\n\n.jp-RenderedHTMLCommon .alert-danger {\n  color: var(--jp-error-color0);\n  background-color: var(--jp-error-color3);\n  border-color: var(--jp-error-color2);\n}\n\n.jp-RenderedHTMLCommon .alert-danger hr {\n  border-color: var(--jp-error-color3);\n}\n\n.jp-RenderedHTMLCommon .alert-danger > p:last-child,\n.jp-RenderedHTMLCommon .alert-danger > ul:last-child {\n  margin-bottom: 0;\n}\n\n.jp-RenderedHTMLCommon blockquote {\n  margin: 1em 2em;\n  padding: 0 1em;\n  border-left: 5px solid var(--jp-border-color2);\n}\n\na.jp-InternalAnchorLink {\n  visibility: hidden;\n  margin-left: 8px;\n  color: var(--md-blue-800, #1565c0);\n}\n\nh1:hover .jp-InternalAnchorLink,\nh2:hover .jp-InternalAnchorLink,\nh3:hover .jp-InternalAnchorLink,\nh4:hover .jp-InternalAnchorLink,\nh5:hover .jp-InternalAnchorLink,\nh6:hover .jp-InternalAnchorLink {\n  visibility: visible;\n}\n\n.jp-ThemedContainer .jp-RenderedHTMLCommon kbd {\n  background-color: var(--jp-rendermime-table-row-background);\n  border: 1px solid var(--jp-border-color0);\n  border-bottom-color: var(--jp-border-color2);\n  border-radius: 3px;\n  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);\n  display: inline-block;\n  font-size: var(--jp-ui-font-size0);\n  line-height: 1em;\n  padding: 0.2em 0.5em;\n}\n\n/* Most direct children of .jp-RenderedHTMLCommon have a margin-bottom of 1.0.\n * At the bottom of cells this is a bit too much as there is also spacing\n * between cells. Going all the way to 0 gets too tight between markdown and\n * code cells.\n */\n.jp-RenderedHTMLCommon > *:last-child {\n  margin-bottom: 0.5em;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 21230:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-RunningSessions {
  display: flex;
  flex-direction: column;
  min-width: var(--jp-sidebar-min-width);
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);

  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
}

.jp-RunningSessions > .jp-SidePanel-toolbar::part(positioning-region) {
  justify-content: flex-end;
}

.jp-RunningSessions-section {
  min-height: 50px;
  overflow: auto;
}

.jp-RunningSessions-sectionContainer {
  margin: 0;
  padding: 0;
}

.jp-RunningSessions-sectionList {
  display: block;
  margin: 0;
  padding: 0;
  list-style-type: none;
  padding-left: 14px;
}

.jp-RunningSessions-viewButton[aria-pressed='true'] {
  box-shadow: none;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view .jp-RunningSessions-sectionList {
  padding-left: 0;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view .jp-mod-running-leaf {
  margin-left: 0;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view
  .jp-RunningSessions-item.jp-mod-kernelspec::part(positioning-region),
.jp-mod-running-list-view
  .jp-RunningSessions-item.jp-mod-kernel::part(positioning-region) {
  display: none;
}

/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */
.jp-mod-running-list-view
  .jp-RunningSessions-item.jp-mod-kernel-widget::part(content-region) {
  margin-inline-start: -2.6em;
}

.jp-RunningSessions-item.jp-mod-kernelspec,
.jp-RunningSessions-item.jp-mod-kernel {
  user-select: none;
}

.jp-RunningSessions-item-label-kernel-id {
  color: var(--jp-ui-font-color3);
}

.jp-RunningSessions-collapseButton[aria-pressed='true'] {
  box-shadow: none;
}

.jp-RunningSessions-toolbar {
  min-width: max-content;
}

img.jp-RunningSessions-icon,
span.jp-RunningSessions-icon > svg {
  width: 16px;
  height: 16px;
}

img.jp-RunningSessions-icon {
  margin-top: 4px;
  object-fit: contain;
}

span.jp-RunningSessions-icon {
  align-items: center;
  display: flex;
}

span.jp-RunningSessions-icon > svg {
  display: block;
  margin: 0 auto;
}

.jp-RunningSessions-itemLabel {
  font-size: var(--jp-ui-font-size1);
  flex: 1 1 55%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.jp-RunningSessions-itemDetail {
  font-size: var(--jp-ui-font-size1);
  flex: 1 1 45%;
  padding: 0 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.jp-RunningSessions-itemShutdown {
  visibility: hidden;
}

.jp-RunningSessions-item:focus-visible > .jp-RunningSessions-itemShutdown,
.jp-RunningSessions-item:hover > .jp-RunningSessions-itemShutdown {
  visibility: visible;
}

.jp-RunningSessions-shutdownAll.jp-ToolbarButtonComponent {
  color: var(--jp-warn-color1);
}

.jp-RunningSessions-shutdownAll.jp-ToolbarButtonComponent[disabled] {
  color: var(--jp-ui-font-color2);
}

/*-----------------------------------------------------------------------------
| SearchableSessions
|----------------------------------------------------------------------------*/

.jp-RunningSessions-item.jp-mod-active {
  background-color: var(--jp-layout-color2);
  outline: 1px solid var(--jp-brand-color1);
  outline-offset: -2px;
}

.jp-RunningSessions-item.jp-mod-active.jp-TreeItem::part(positioning-region) {
  background-color: transparent;
}

.jp-SearchableSessions-list > .jp-RunningSessions-section {
  min-height: auto;
}

.jp-SearchableSessions-title {
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size0);
  margin: 0;
  padding: 4px 0;
}

.jp-SearchableSessions-titleLabel {
  text-transform: uppercase;
}

.jp-SearchableSessions-acceptButton {
  display: none;
}

.jp-SearchableSessions-list > .jp-RunningSessions-section.jp-mod-empty {
  display: none;
}

.jp-SearchableSessions-filter {
  overflow: visible;

  /* Required to display correctly the filter box and its focus highlight */
  padding: 0 2px;
}

.jp-SearchableSessions-filter > .jp-FilterBox {
  width: 100%;
}

.jp-SearchableSessions-list {
  overflow: auto;
}

.jp-SearchableSessions.jp-Dialog-body {
  display: flex;
}

.jp-SearchableSessions-modal .jp-Dialog-content {
  padding: 16px;
  box-shadow: var(--jp-elevation-z4);
  border-radius: 4px;
  min-height: 100px;
  max-height: 95%;
}

.jp-SearchableSessions-modal .jp-Dialog-footer {
  display: none;
}

.jp-SearchableSessions-modal .jp-Dialog-header {
  font-size: var(--jp-ui-font-size2);
}

.jp-SearchableSessions-modal.jp-Dialog {
  background: transparent;
  justify-content: start;
  padding-top: 38px;
  border: 0;
}

.jp-SearchableSessions-emptyIndicator {
  color: var(--jp-ui-font-color2);
  padding: 16px;
  text-align: center;
  padding-bottom: 8px;
}

.jp-RunningSessions-section:not(.jp-mod-empty)
  ~ .jp-SearchableSessions-emptyIndicator {
  display: none;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/running/style/base.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,sBAAsB;EACtB,sCAAsC;EACtC,+BAA+B;EAC/B,mCAAmC;;EAEnC;iCAC+B;EAC/B,kCAAkC;AACpC;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,SAAS;EACT,UAAU;AACZ;;AAEA;EACE,cAAc;EACd,SAAS;EACT,UAAU;EACV,qBAAqB;EACrB,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;AAClB;;AAEA,wGAAwG;AACxG;EACE,eAAe;AACjB;;AAEA,wGAAwG;AACxG;EACE,cAAc;AAChB;;AAEA,wGAAwG;AACxG;;;;EAIE,aAAa;AACf;;AAEA,wGAAwG;AACxG;;EAEE,2BAA2B;AAC7B;;AAEA;;EAEE,iBAAiB;AACnB;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,sBAAsB;AACxB;;AAEA;;EAEE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,eAAe;EACf,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,cAAc;EACd,cAAc;AAChB;;AAEA;EACE,kCAAkC;EAClC,aAAa;EACb,uBAAuB;EACvB,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,kCAAkC;EAClC,aAAa;EACb,cAAc;EACd,uBAAuB;EACvB,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;;EAEE,mBAAmB;AACrB;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;;8EAE8E;;AAE9E;EACE,yCAAyC;EACzC,yCAAyC;EACzC,oBAAoB;AACtB;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,+BAA+B;EAC/B,kCAAkC;EAClC,SAAS;EACT,cAAc;AAChB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,iBAAiB;;EAEjB,yEAAyE;EACzE,cAAc;AAChB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;EACb,kCAAkC;EAClC,kBAAkB;EAClB,iBAAiB;EACjB,eAAe;AACjB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,uBAAuB;EACvB,sBAAsB;EACtB,iBAAiB;EACjB,SAAS;AACX;;AAEA;EACE,+BAA+B;EAC/B,aAAa;EACb,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;;EAEE,aAAa;AACf","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-RunningSessions {\n  display: flex;\n  flex-direction: column;\n  min-width: var(--jp-sidebar-min-width);\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n\n  /* This is needed so that all font sizing of children done in ems is\n   * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-RunningSessions > .jp-SidePanel-toolbar::part(positioning-region) {\n  justify-content: flex-end;\n}\n\n.jp-RunningSessions-section {\n  min-height: 50px;\n  overflow: auto;\n}\n\n.jp-RunningSessions-sectionContainer {\n  margin: 0;\n  padding: 0;\n}\n\n.jp-RunningSessions-sectionList {\n  display: block;\n  margin: 0;\n  padding: 0;\n  list-style-type: none;\n  padding-left: 14px;\n}\n\n.jp-RunningSessions-viewButton[aria-pressed='true'] {\n  box-shadow: none;\n}\n\n/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */\n.jp-mod-running-list-view .jp-RunningSessions-sectionList {\n  padding-left: 0;\n}\n\n/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */\n.jp-mod-running-list-view .jp-mod-running-leaf {\n  margin-left: 0;\n}\n\n/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */\n.jp-mod-running-list-view\n  .jp-RunningSessions-item.jp-mod-kernelspec::part(positioning-region),\n.jp-mod-running-list-view\n  .jp-RunningSessions-item.jp-mod-kernel::part(positioning-region) {\n  display: none;\n}\n\n/* @deprecated For backward compatibility when sessions manager does not specify supportsMultipleViews */\n.jp-mod-running-list-view\n  .jp-RunningSessions-item.jp-mod-kernel-widget::part(content-region) {\n  margin-inline-start: -2.6em;\n}\n\n.jp-RunningSessions-item.jp-mod-kernelspec,\n.jp-RunningSessions-item.jp-mod-kernel {\n  user-select: none;\n}\n\n.jp-RunningSessions-item-label-kernel-id {\n  color: var(--jp-ui-font-color3);\n}\n\n.jp-RunningSessions-collapseButton[aria-pressed='true'] {\n  box-shadow: none;\n}\n\n.jp-RunningSessions-toolbar {\n  min-width: max-content;\n}\n\nimg.jp-RunningSessions-icon,\nspan.jp-RunningSessions-icon > svg {\n  width: 16px;\n  height: 16px;\n}\n\nimg.jp-RunningSessions-icon {\n  margin-top: 4px;\n  object-fit: contain;\n}\n\nspan.jp-RunningSessions-icon {\n  align-items: center;\n  display: flex;\n}\n\nspan.jp-RunningSessions-icon > svg {\n  display: block;\n  margin: 0 auto;\n}\n\n.jp-RunningSessions-itemLabel {\n  font-size: var(--jp-ui-font-size1);\n  flex: 1 1 55%;\n  text-overflow: ellipsis;\n  overflow: hidden;\n  white-space: nowrap;\n}\n\n.jp-RunningSessions-itemDetail {\n  font-size: var(--jp-ui-font-size1);\n  flex: 1 1 45%;\n  padding: 0 4px;\n  text-overflow: ellipsis;\n  overflow: hidden;\n  white-space: nowrap;\n}\n\n.jp-RunningSessions-itemShutdown {\n  visibility: hidden;\n}\n\n.jp-RunningSessions-item:focus-visible > .jp-RunningSessions-itemShutdown,\n.jp-RunningSessions-item:hover > .jp-RunningSessions-itemShutdown {\n  visibility: visible;\n}\n\n.jp-RunningSessions-shutdownAll.jp-ToolbarButtonComponent {\n  color: var(--jp-warn-color1);\n}\n\n.jp-RunningSessions-shutdownAll.jp-ToolbarButtonComponent[disabled] {\n  color: var(--jp-ui-font-color2);\n}\n\n/*-----------------------------------------------------------------------------\n| SearchableSessions\n|----------------------------------------------------------------------------*/\n\n.jp-RunningSessions-item.jp-mod-active {\n  background-color: var(--jp-layout-color2);\n  outline: 1px solid var(--jp-brand-color1);\n  outline-offset: -2px;\n}\n\n.jp-RunningSessions-item.jp-mod-active.jp-TreeItem::part(positioning-region) {\n  background-color: transparent;\n}\n\n.jp-SearchableSessions-list > .jp-RunningSessions-section {\n  min-height: auto;\n}\n\n.jp-SearchableSessions-title {\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size0);\n  margin: 0;\n  padding: 4px 0;\n}\n\n.jp-SearchableSessions-titleLabel {\n  text-transform: uppercase;\n}\n\n.jp-SearchableSessions-acceptButton {\n  display: none;\n}\n\n.jp-SearchableSessions-list > .jp-RunningSessions-section.jp-mod-empty {\n  display: none;\n}\n\n.jp-SearchableSessions-filter {\n  overflow: visible;\n\n  /* Required to display correctly the filter box and its focus highlight */\n  padding: 0 2px;\n}\n\n.jp-SearchableSessions-filter > .jp-FilterBox {\n  width: 100%;\n}\n\n.jp-SearchableSessions-list {\n  overflow: auto;\n}\n\n.jp-SearchableSessions.jp-Dialog-body {\n  display: flex;\n}\n\n.jp-SearchableSessions-modal .jp-Dialog-content {\n  padding: 16px;\n  box-shadow: var(--jp-elevation-z4);\n  border-radius: 4px;\n  min-height: 100px;\n  max-height: 95%;\n}\n\n.jp-SearchableSessions-modal .jp-Dialog-footer {\n  display: none;\n}\n\n.jp-SearchableSessions-modal .jp-Dialog-header {\n  font-size: var(--jp-ui-font-size2);\n}\n\n.jp-SearchableSessions-modal.jp-Dialog {\n  background: transparent;\n  justify-content: start;\n  padding-top: 38px;\n  border: 0;\n}\n\n.jp-SearchableSessions-emptyIndicator {\n  color: var(--jp-ui-font-color2);\n  padding: 16px;\n  text-align: center;\n  padding-bottom: 8px;\n}\n\n.jp-RunningSessions-section:not(.jp-mod-empty)\n  ~ .jp-SearchableSessions-emptyIndicator {\n  display: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 30313:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

:root {
  --jp-private-settingeditor-debug-height: 28px;
  --jp-private-settingeditor-key-width: 150px;
  --jp-private-settingeditor-legend-height: 16px;
  --jp-private-settingeditor-row-height: 16px;
  --jp-private-settingeditor-toolbar-height: 28px;
  --jp-private-settingeditor-type-width: 75px;
  --jp-private-settingeditor-modifier-indent: 5px;
  --jp-private-settingeditor-header-spacing: 8px;
}

.jp-SettingsPanel,
#json-setting-editor {
  min-width: 360px;
  min-height: 240px;
  background-color: var(--jp-layout-color0);
  color: var(--jp-ui-font-color0);
  margin-top: -1px;
  outline: none;

  /* This is needed so that all font sizing of children done in ems is
   * relative to this base size */
  font-size: var(--jp-ui-font-size1);
}

#setting-editor > .lm-Widget,
#json-setting-editor > .lm-Widget {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

#setting-editor .lm-SplitPanel-handle,
#json-setting-editor .lm-SplitPanel-handle {
  background-color: var(--jp-border-color2);
}

/** Plugin list **/

.jp-PluginList {
  min-width: 175px;
  max-width: 275px;
}

.jp-PluginList-wrapper {
  overflow-y: auto;
  height: 100%;
}

.jp-PluginList ul {
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  position: relative;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.jp-PluginList .jp-PluginList-header {
  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
  border-top: var(--jp-border-width) solid var(--jp-border-color2);
  color: var(--jp-ui-font-color1);
}

.jp-PluginList .jp-PluginList-noResults,
.jp-PluginList .jp-PluginList-header {
  flex: 0 0 auto;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: var(--jp-ui-font-size0);
  padding: 8px 8px 8px 12px;
  margin: 10px;
  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
  border-top: var(--jp-border-width) solid var(--jp-border-color2);
  color: var(--jp-ui-font-color1);
}

.jp-PluginList .jp-SelectedIndicator {
  width: 3px;
  background-color: var(--jp-brand-color1);
  height: var(--jp-cell-collapser-min-height);
  visibility: hidden;
}

.jp-PluginList .jp-mod-selected .jp-SelectedIndicator {
  visibility: inherit;
}

.jp-PluginList .jp-ErrorPlugin .jp-SelectedIndicator {
  background-color: var(--jp-error-color0);
}

.jp-PluginList-icon {
  display: flex;
  height: 20px;
  width: 20px;
  margin-right: 3px;
  position: relative;
}

.jp-PluginList-wrapper > .jp-FilterBox {
  margin: 8px 12px 0;
}

.jp-PluginList mark {
  background-color: transparent;
  font-weight: bold;
  color: var(--jp-ui-font-color1);
}

.jp-PluginList-entry {
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  background: transparent;
  overflow: hidden;
  padding: 4px 0 4px 4px;
  white-space: nowrap;
  cursor: pointer;
}

.jp-PluginList-entry:hover {
  background: var(--jp-layout-color2);
}

.jp-PluginList-entry li {
  margin-left: 27px;
  margin-top: 5px;
  color: var(--jp-ui-font-color1);
  overflow-x: hidden;
  text-overflow: ellipsis;
}

.jp-PluginList-entry-label {
  display: flex;
}

.jp-PluginList-entry-label-text {
  text-overflow: ellipsis;
  overflow-x: hidden;
  white-space: nowrap;
  color: var(--jp-ui-font-color1);
  line-height: var(--jp-cell-collapser-min-height);
}

/** Raw editor **/

.jp-SettingsRawEditor .jp-Toolbar {
  color: var(--jp-ui-font-color0);
  font-size: var(--jp-ui-font-size1);
  height: var(--jp-private-settingeditor-toolbar-height);
  max-height: var(--jp-private-settingeditor-toolbar-height);
}

.jp-SettingsRawEditor .jp-Toolbar .jp-ToolbarButtonComponent-label {
  display: none;
}

.jp-SettingsRawEditor .jp-Toolbar-item {
  margin-top: 1px;
  align-items: center;
}

.jp-SettingsRawEditor .jp-Inspector {
  border-top: 2px solid var(--jp-layout-color2);
  min-height: var(--jp-private-settingeditor-debug-height);
  max-height: var(--jp-private-settingeditor-debug-height);
}

.jp-SettingsRawEditor .jp-Inspector.jp-SettingsDebug .jp-RenderedHTMLCommon {
  padding: 2px 5px 2px 0;
  width: 100%;
}

.jp-SettingsRawEditor .jp-Inspector.jp-SettingsDebug .jp-RenderedHTMLCommon p {
  text-align: right;
}

.jp-SettingsRawEditor .cm-editor {
  height: 100%;
}

/** Panel **/

.jp-SettingsPanel .checkbox p {
  font-size: var(--jp-content-font-size1);
}

.jp-SettingsPanel .checkbox {
  display: flex;
  flex-direction: column-reverse;
}

.jp-SettingsPanel .form-group {
  display: flex;
  padding: 4px 8px 4px var(--jp-private-settingeditor-modifier-indent);
  margin-top: 5px;
}

.jp-SettingsPanel .jp-SettingsEditor {
  padding: 20px;
}

.jp-SettingsPanel {
  overflow-y: auto;
  height: 100%;
}

.jp-SettingsForm {
  position: relative;
}

.jp-SettingsForm > .rjsf > .form-group {
  padding-top: 0;
  margin-top: 0;
}

/** Settings header **/

.jp-SettingsHeader {
  display: grid;
  grid-template:
    'title buttonbar'
    'description buttonbar';
  grid-template-columns: 1fr max-content;
  padding: 0 var(--jp-private-settingeditor-header-spacing);
  border-bottom: 1px solid var(--jp-border-color2);
}

.jp-SettingsHeader-title {
  font-size: var(--jp-content-font-size3);
  color: var(--jp-ui-font-color0);
  font-weight: 400;
  grid-area: title;
  padding: 0;
  margin-top: calc(var(--jp-private-settingeditor-header-spacing) * 2);
  margin-bottom: calc(var(--jp-private-settingeditor-header-spacing) / 2);
}

.jp-SettingsHeader-description {
  grid-area: description;
  padding-bottom: var(--jp-private-settingeditor-header-spacing);
  color: var(--jp-ui-font-color1);
}

.jp-SettingsHeader-buttonbar {
  margin: auto var(--jp-private-settingeditor-header-spacing);
  grid-row: span 2;
}

.jp-SettingsHeader-buttonbar > .jp-RestoreButton {
  background-color: var(--jp-warn-color-normal);
  border: 0;
  color: var(--jp-ui-inverse-font-color0);
}

.jp-PluginEditor {
  overflow: auto;
}

/** Placeholder **/

.jp-SettingsEditor-placeholder {
  text-align: center;
}

.jp-SettingsEditor-placeholderContent {
  color: var(--jp-content-font-color2);
  padding: 8px;
}

.jp-SettingsEditor-placeholderContent > h3 {
  margin-bottom: var(--jp-content-heading-margin-bottom);
}

/** Import Settings Widget **/
.jp-SettingsImport-container {
  padding: 20px;
}

.jp-SettingsImport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jp-SettingsImport-title {
  font-size: 1rem;
  font-weight: bold;
  padding: 10px 15px;
}

.jp-SettingsImport-list {
  margin-top: 30px;
  max-height: 400px; /* Limit height for scrollable list */
  overflow-y: auto;
}

.jp-SettingsImport-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--jp-border-color2);
  padding: 10px 15px;
  cursor: pointer;
}

.jp-SettingsImport-itemKey {
  flex: 1;
}

.jp-SettingsImport-checkbox {
  flex-shrink: 0;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/settingeditor/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,6CAA6C;EAC7C,2CAA2C;EAC3C,8CAA8C;EAC9C,2CAA2C;EAC3C,+CAA+C;EAC/C,2CAA2C;EAC3C,+CAA+C;EAC/C,8CAA8C;AAChD;;AAEA;;EAEE,gBAAgB;EAChB,iBAAiB;EACjB,yCAAyC;EACzC,+BAA+B;EAC/B,gBAAgB;EAChB,aAAa;;EAEb;iCAC+B;EAC/B,kCAAkC;AACpC;;AAEA;;EAEE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAEA;;EAEE,yCAAyC;AAC3C;;AAEA,kBAAkB;;AAElB;EACE,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;EAChB,YAAY;AACd;;AAEA;EACE,+BAA+B;EAC/B,kCAAkC;EAClC,qBAAqB;EACrB,SAAS;EACT,UAAU;EACV,gBAAgB;EAChB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAEA;EACE,mEAAmE;EACnE,gEAAgE;EAChE,+BAA+B;AACjC;;AAEA;;EAEE,cAAc;EACd,gBAAgB;EAChB,yBAAyB;EACzB,mBAAmB;EACnB,kCAAkC;EAClC,yBAAyB;EACzB,YAAY;EACZ,mEAAmE;EACnE,gEAAgE;EAChE,+BAA+B;AACjC;;AAEA;EACE,UAAU;EACV,wCAAwC;EACxC,2CAA2C;EAC3C,kBAAkB;AACpB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,WAAW;EACX,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,6BAA6B;EAC7B,iBAAiB;EACjB,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,6BAA6B;EAC7B,uBAAuB;EACvB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,iBAAiB;EACjB,eAAe;EACf,+BAA+B;EAC/B,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,uBAAuB;EACvB,kBAAkB;EAClB,mBAAmB;EACnB,+BAA+B;EAC/B,gDAAgD;AAClD;;AAEA,iBAAiB;;AAEjB;EACE,+BAA+B;EAC/B,kCAAkC;EAClC,sDAAsD;EACtD,0DAA0D;AAC5D;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,eAAe;EACf,mBAAmB;AACrB;;AAEA;EACE,6CAA6C;EAC7C,wDAAwD;EACxD,wDAAwD;AAC1D;;AAEA;EACE,sBAAsB;EACtB,WAAW;AACb;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA,YAAY;;AAEZ;EACE,uCAAuC;AACzC;;AAEA;EACE,aAAa;EACb,8BAA8B;AAChC;;AAEA;EACE,aAAa;EACb,oEAAoE;EACpE,eAAe;AACjB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,gBAAgB;EAChB,YAAY;AACd;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,cAAc;EACd,aAAa;AACf;;AAEA,sBAAsB;;AAEtB;EACE,aAAa;EACb;;2BAEyB;EACzB,sCAAsC;EACtC,yDAAyD;EACzD,gDAAgD;AAClD;;AAEA;EACE,uCAAuC;EACvC,+BAA+B;EAC/B,gBAAgB;EAChB,gBAAgB;EAChB,UAAU;EACV,oEAAoE;EACpE,uEAAuE;AACzE;;AAEA;EACE,sBAAsB;EACtB,8DAA8D;EAC9D,+BAA+B;AACjC;;AAEA;EACE,2DAA2D;EAC3D,gBAAgB;AAClB;;AAEA;EACE,6CAA6C;EAC7C,SAAS;EACT,uCAAuC;AACzC;;AAEA;EACE,cAAc;AAChB;;AAEA,kBAAkB;;AAElB;EACE,kBAAkB;AACpB;;AAEA;EACE,oCAAoC;EACpC,YAAY;AACd;;AAEA;EACE,sDAAsD;AACxD;;AAEA,6BAA6B;AAC7B;EACE,aAAa;AACf;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,mBAAmB;AACrB;;AAEA;EACE,eAAe;EACf,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,iBAAiB,EAAE,qCAAqC;EACxD,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,mBAAmB;EACnB,mBAAmB;EACnB,gDAAgD;EAChD,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,OAAO;AACT;;AAEA;EACE,cAAc;AAChB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-settingeditor-debug-height: 28px;\n  --jp-private-settingeditor-key-width: 150px;\n  --jp-private-settingeditor-legend-height: 16px;\n  --jp-private-settingeditor-row-height: 16px;\n  --jp-private-settingeditor-toolbar-height: 28px;\n  --jp-private-settingeditor-type-width: 75px;\n  --jp-private-settingeditor-modifier-indent: 5px;\n  --jp-private-settingeditor-header-spacing: 8px;\n}\n\n.jp-SettingsPanel,\n#json-setting-editor {\n  min-width: 360px;\n  min-height: 240px;\n  background-color: var(--jp-layout-color0);\n  color: var(--jp-ui-font-color0);\n  margin-top: -1px;\n  outline: none;\n\n  /* This is needed so that all font sizing of children done in ems is\n   * relative to this base size */\n  font-size: var(--jp-ui-font-size1);\n}\n\n#setting-editor > .lm-Widget,\n#json-setting-editor > .lm-Widget {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n\n#setting-editor .lm-SplitPanel-handle,\n#json-setting-editor .lm-SplitPanel-handle {\n  background-color: var(--jp-border-color2);\n}\n\n/** Plugin list **/\n\n.jp-PluginList {\n  min-width: 175px;\n  max-width: 275px;\n}\n\n.jp-PluginList-wrapper {\n  overflow-y: auto;\n  height: 100%;\n}\n\n.jp-PluginList ul {\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  list-style-type: none;\n  margin: 0;\n  padding: 0;\n  overflow-y: auto;\n  position: relative;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n\n.jp-PluginList .jp-PluginList-header {\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);\n  border-top: var(--jp-border-width) solid var(--jp-border-color2);\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-PluginList .jp-PluginList-noResults,\n.jp-PluginList .jp-PluginList-header {\n  flex: 0 0 auto;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 1px;\n  font-size: var(--jp-ui-font-size0);\n  padding: 8px 8px 8px 12px;\n  margin: 10px;\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);\n  border-top: var(--jp-border-width) solid var(--jp-border-color2);\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-PluginList .jp-SelectedIndicator {\n  width: 3px;\n  background-color: var(--jp-brand-color1);\n  height: var(--jp-cell-collapser-min-height);\n  visibility: hidden;\n}\n\n.jp-PluginList .jp-mod-selected .jp-SelectedIndicator {\n  visibility: inherit;\n}\n\n.jp-PluginList .jp-ErrorPlugin .jp-SelectedIndicator {\n  background-color: var(--jp-error-color0);\n}\n\n.jp-PluginList-icon {\n  display: flex;\n  height: 20px;\n  width: 20px;\n  margin-right: 3px;\n  position: relative;\n}\n\n.jp-PluginList-wrapper > .jp-FilterBox {\n  margin: 8px 12px 0;\n}\n\n.jp-PluginList mark {\n  background-color: transparent;\n  font-weight: bold;\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-PluginList-entry {\n  display: flex;\n  flex-direction: column;\n  border: 1px solid transparent;\n  background: transparent;\n  overflow: hidden;\n  padding: 4px 0 4px 4px;\n  white-space: nowrap;\n  cursor: pointer;\n}\n\n.jp-PluginList-entry:hover {\n  background: var(--jp-layout-color2);\n}\n\n.jp-PluginList-entry li {\n  margin-left: 27px;\n  margin-top: 5px;\n  color: var(--jp-ui-font-color1);\n  overflow-x: hidden;\n  text-overflow: ellipsis;\n}\n\n.jp-PluginList-entry-label {\n  display: flex;\n}\n\n.jp-PluginList-entry-label-text {\n  text-overflow: ellipsis;\n  overflow-x: hidden;\n  white-space: nowrap;\n  color: var(--jp-ui-font-color1);\n  line-height: var(--jp-cell-collapser-min-height);\n}\n\n/** Raw editor **/\n\n.jp-SettingsRawEditor .jp-Toolbar {\n  color: var(--jp-ui-font-color0);\n  font-size: var(--jp-ui-font-size1);\n  height: var(--jp-private-settingeditor-toolbar-height);\n  max-height: var(--jp-private-settingeditor-toolbar-height);\n}\n\n.jp-SettingsRawEditor .jp-Toolbar .jp-ToolbarButtonComponent-label {\n  display: none;\n}\n\n.jp-SettingsRawEditor .jp-Toolbar-item {\n  margin-top: 1px;\n  align-items: center;\n}\n\n.jp-SettingsRawEditor .jp-Inspector {\n  border-top: 2px solid var(--jp-layout-color2);\n  min-height: var(--jp-private-settingeditor-debug-height);\n  max-height: var(--jp-private-settingeditor-debug-height);\n}\n\n.jp-SettingsRawEditor .jp-Inspector.jp-SettingsDebug .jp-RenderedHTMLCommon {\n  padding: 2px 5px 2px 0;\n  width: 100%;\n}\n\n.jp-SettingsRawEditor .jp-Inspector.jp-SettingsDebug .jp-RenderedHTMLCommon p {\n  text-align: right;\n}\n\n.jp-SettingsRawEditor .cm-editor {\n  height: 100%;\n}\n\n/** Panel **/\n\n.jp-SettingsPanel .checkbox p {\n  font-size: var(--jp-content-font-size1);\n}\n\n.jp-SettingsPanel .checkbox {\n  display: flex;\n  flex-direction: column-reverse;\n}\n\n.jp-SettingsPanel .form-group {\n  display: flex;\n  padding: 4px 8px 4px var(--jp-private-settingeditor-modifier-indent);\n  margin-top: 5px;\n}\n\n.jp-SettingsPanel .jp-SettingsEditor {\n  padding: 20px;\n}\n\n.jp-SettingsPanel {\n  overflow-y: auto;\n  height: 100%;\n}\n\n.jp-SettingsForm {\n  position: relative;\n}\n\n.jp-SettingsForm > .rjsf > .form-group {\n  padding-top: 0;\n  margin-top: 0;\n}\n\n/** Settings header **/\n\n.jp-SettingsHeader {\n  display: grid;\n  grid-template:\n    'title buttonbar'\n    'description buttonbar';\n  grid-template-columns: 1fr max-content;\n  padding: 0 var(--jp-private-settingeditor-header-spacing);\n  border-bottom: 1px solid var(--jp-border-color2);\n}\n\n.jp-SettingsHeader-title {\n  font-size: var(--jp-content-font-size3);\n  color: var(--jp-ui-font-color0);\n  font-weight: 400;\n  grid-area: title;\n  padding: 0;\n  margin-top: calc(var(--jp-private-settingeditor-header-spacing) * 2);\n  margin-bottom: calc(var(--jp-private-settingeditor-header-spacing) / 2);\n}\n\n.jp-SettingsHeader-description {\n  grid-area: description;\n  padding-bottom: var(--jp-private-settingeditor-header-spacing);\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-SettingsHeader-buttonbar {\n  margin: auto var(--jp-private-settingeditor-header-spacing);\n  grid-row: span 2;\n}\n\n.jp-SettingsHeader-buttonbar > .jp-RestoreButton {\n  background-color: var(--jp-warn-color-normal);\n  border: 0;\n  color: var(--jp-ui-inverse-font-color0);\n}\n\n.jp-PluginEditor {\n  overflow: auto;\n}\n\n/** Placeholder **/\n\n.jp-SettingsEditor-placeholder {\n  text-align: center;\n}\n\n.jp-SettingsEditor-placeholderContent {\n  color: var(--jp-content-font-color2);\n  padding: 8px;\n}\n\n.jp-SettingsEditor-placeholderContent > h3 {\n  margin-bottom: var(--jp-content-heading-margin-bottom);\n}\n\n/** Import Settings Widget **/\n.jp-SettingsImport-container {\n  padding: 20px;\n}\n\n.jp-SettingsImport-header {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.jp-SettingsImport-title {\n  font-size: 1rem;\n  font-weight: bold;\n  padding: 10px 15px;\n}\n\n.jp-SettingsImport-list {\n  margin-top: 30px;\n  max-height: 400px; /* Limit height for scrollable list */\n  overflow-y: auto;\n}\n\n.jp-SettingsImport-item {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin-bottom: 10px;\n  border-bottom: 1px solid var(--jp-border-color2);\n  padding: 10px 15px;\n  cursor: pointer;\n}\n\n.jp-SettingsImport-itemKey {\n  flex: 1;\n}\n\n.jp-SettingsImport-checkbox {\n  flex-shrink: 0;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 23729:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* Shortcut Input Style */

.jp-Shortcuts-InputBox {
  display: inline-flex;
  padding-top: 2px;
}

.jp-Shortcuts-InputBoxNew {
  margin-left: 10px;
}

.jp-mod-hidden {
  display: none;
}

@keyframes slide-animation {
  from {
    width: 0;
    left: 0;
  }

  to {
    width: 120px;
    left: 0;
  }
}

.jp-Shortcuts-Input {
  animation-duration: 0.3s;
  animation-timing-function: ease-out;
  animation-name: slide-animation;
  border-width: var(--jp-border-width);
  border-color: var(--jp-border-color3);
  border-style: solid;
  background-color: var(--jp-layout-color0);
  margin-left: auto;
  padding-left: 10px;
  width: 120px;
  height: 25px;
  line-height: 25px;
  display: block;
}

.jp-Shortcuts-Input:focus {
  outline: none;
  color: var(--jp-content-font-color1);
  border-color: var(--jp-brand-color2);
}

.jp-mod-unavailable-Input:focus {
  border-color: var(--jp-error-color2);
}

.jp-Shortcuts-InputText {
  overflow-x: hidden;
  overflow-y: hidden;
  margin: 0;
  margin-top: 4px;
  padding: 0 5px;
  height: 17px;
  line-height: 17px;
  width: fit-content;
}

.jp-mod-selected-InputText {
  background-color: var(--jp-shortcuts-button-background);
  overflow: hidden;
}

.jp-mod-waiting-InputText {
  color: var(--jp-content-font-color3);
}

.jp-Shortcuts-Submit {
  background-color: var(--jp-brand-color2);
  border-radius: 0;
  border: none;
  color: var(--jp-layout-color0);
  font-family: var(--jp-ui-font-family);
  display: block;
  height: 27px;
  width: 26px;
  cursor: pointer;
}

.jp-Shortcuts-Submit:focus {
  outline: none;
}

.jp-Shortcuts-Submit .jp-icon3[fill] {
  fill: var(--jp-layout-color1);
}

.jp-Shortcuts-Submit.jp-mod-defunc-Submit {
  background-color: var(--jp-layout-color3);
}

.jp-Shortcuts-Submit.jp-mod-defunc-Submit .jp-icon3[fill] {
  fill: var(--jp-inverse-layout-color1);
}

.jp-Shortcuts-Submit.jp-mod-conflict-Submit {
  background-color: var(--jp-error-color1);
}

/* Shortcut Item Style */
.jp-Shortcuts-Cell {
  padding: 6px 12px;
  display: table-cell;
  width: 20%;
  vertical-align: middle;
}

.jp-Shortcuts-ShortcutCell {
  display: flex;
  min-width: max-content;
  flex-wrap: wrap;
}

.jp-Shortcuts-EmptyCell {
  height: 32px;
}

.jp-Shortcuts-Row {
  padding: 10px;
  width: 100%;
  display: table-row;
  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
  vertical-align: middle;
  background-color: var(--jp-layout-color0);
}

.jp-Shortcuts-Row:hover .jp-Shortcuts-ShortcutKeys {
  border-color: var(--jp-border-color1);
  background: var(--jp-layout-color2);
}

.jp-Shortcuts-Row:hover .jp-Shortcuts-Plus,
.jp-Shortcuts-Row:hover .jp-Shortcuts-Or {
  opacity: 1;
}

.jp-Shortcuts-ErrorMessage {
  color: var(--jp-error-color1);
  align-self: center;
}

.jp-Shortcuts-RowWithConflict {
  height: 45px;
  position: relative;
}

.jp-Shortcuts-ErrorButton {
  margin-left: 12px;
  white-space: nowrap;
}

.jp-Shortcuts-ErrorButton > button {
  margin-right: 12px;
}

.jp-Shortcuts-ShortcutContainer {
  display: flex;
  flex-wrap: wrap;
}

.jp-Shortcuts-ShortcutContainer:hover .jp-Shortcuts-ShortcutKeys {
  border-color: var(--jp-border-color3);
  background: var(--jp-layout-color3);
}

.jp-Shortcuts-ShortcutKeysContainer {
  font-size: var(--jp-code-font-size);
  font-family: var(--jp-ui-font-family);
  display: flex;
}

.jp-Shortcuts-ConflictContainer {
  display: block;
  padding: 6px 12px;
  position: absolute;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.jp-Shortcuts-Conflict {
  display: flex;
  flex-wrap: nowrap;
}

.jp-Shortcuts-ShortcutKeys {
  border-width: var(--jp-border-width);
  border-color: var(--jp-layout-color0);
  border-radius: var(--jp-border-radius);
  padding: 5px 6px;
  margin: 3px 0;
  cursor: pointer;
}

.jp-Shortcuts-Or {
  margin-right: 12px;
  margin-left: 12px;
  margin-top: 8px;
  color: var(--jp-content-font-color3);
  opacity: 0;
}

.jp-Shortcuts-Or:hover {
  opacity: 1;
}

.jp-Shortcuts-Or-Forced {
  opacity: 1;
}

.jp-Shortcuts-Comma {
  margin-top: 10px;
  margin-right: 2px;
  margin-left: 2px;
}

.jp-Shortcuts-Plus {
  opacity: 0;
  background: var(--jp-shortcuts-button-background);
  border-color: var(--jp-layout-color0);
  border-radius: var(--jp-border-radius);
  border-width: var(--jp-border-width);
  margin: 3px 0;
  padding: 5px 6px;
  color: var(--jp-ui-inverse-font-color1);
  cursor: pointer;
}

.jp-Shortcuts-Plus:hover {
  background: var(--jp-shortcuts-button-hover-background);
}

.jp-Shortcuts-Plus:active {
  background-color: var(--jp-brand-color2);
}

.jp-Shortcuts-Reset {
  color: var(--jp-brand-color2);
  padding-left: 10px;
  cursor: pointer;
}

.jp-Shortcuts-Reset:hover {
  color: var(--jp-brand-color1);
}

.jp-Shortcuts-SourceCell {
  display: inline-block;
}

/* Shortcut List Style */
.jp-Shortcuts-ShortcutList {
  width: 100%;
  display: table;
  border-collapse: collapse;
}

.jp-Shortcuts-ShortcutListContainer {
  overflow-y: scroll;
  border: var(--jp-border-width) solid var(--jp-border-color1);
}

/* Shortcut Title Item Style */
.jp-Shortcuts-Header {
  display: flex;
  cursor: pointer;
}

.jp-Shortcuts-Header:hover .jp-ShortcutTitleItem-sortButton .jp-icon3[fill],
.jp-Shortcuts-Header:focus .jp-ShortcutTitleItem-sortButton .jp-icon3[fill] {
  fill: var(--jp-ui-font-color0);
}

.jp-Shortcuts-Header:active .jp-ShortcutTitleItem-sortButton {
  outline: none;
}

.jp-Shortcuts-CurrentHeader .jp-icon3[fill] {
  fill: var(--jp-ui-font-color0);
}

/* Shortcut UI Style */

.jp-Shortcuts-ShortcutUI {
  display: flex;
  flex-direction: column;
  font-size: var(--jp-ui-font-size1);
  font-family: var(--jp-ui-font-family);
  color: var(--jp-content-font-color1);
  min-width: 450px;
  width: 100%;
}

/* TopNav Style */
.jp-Shortcuts-Top {
  display: block;
}

.jp-Shortcuts-TopNav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  font-size: var(--jp-ui-font-size1);
  background-color: var(--jp-layout-color0);
}

.jp-Shortcuts-Symbols {
  padding: 0 12px;
}

.jp-Shortcuts-Symbols td:nth-child(2) {
  padding-right: 10px;
}

.jp-Shortcuts-AdvancedOptions {
  padding-left: 12px;
}

.jp-Shortcuts-AdvancedOptionsLink {
  color: var(--jp-content-link-color);
  margin-right: 15px;
  display: inline-block;
  cursor: pointer;
}

.jp-Shortcuts-AdvancedOptionsLink:hover {
  color: var(--jp-brand-color0);
  text-decoration: underline;
}

.jp-Shortcuts-AdvancedOptionsLink:active {
  color: var(--jp-brand-color0);
  text-decoration: underline;
}

.jp-Shortcuts-HeaderRowContainer {
  padding-right: 14px;
}

.jp-Shortcuts-HeaderRow {
  font-weight: bold;
  font-size: var(--jp-ui-font-size1);
  background-color: var(--jp-layout-color0);
  width: 100%;
  z-index: 1;
  display: table;
  padding: 10px 0;
}

.jp-Shortcuts-commandIcon {
  margin-right: 13px;
}

.jp-Shortcuts-altIcon {
  margin-right: 14px;
}

.jp-Shortcuts-controlIcon {
  margin-left: 8px;
  margin-right: 16px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/shortcuts-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,yBAAyB;;AAEzB;EACE,oBAAoB;EACpB,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE;IACE,QAAQ;IACR,OAAO;EACT;;EAEA;IACE,YAAY;IACZ,OAAO;EACT;AACF;;AAEA;EACE,wBAAwB;EACxB,mCAAmC;EACnC,+BAA+B;EAC/B,oCAAoC;EACpC,qCAAqC;EACrC,mBAAmB;EACnB,yCAAyC;EACzC,iBAAiB;EACjB,kBAAkB;EAClB,YAAY;EACZ,YAAY;EACZ,iBAAiB;EACjB,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,oCAAoC;EACpC,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,SAAS;EACT,eAAe;EACf,cAAc;EACd,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,uDAAuD;EACvD,gBAAgB;AAClB;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,wCAAwC;EACxC,gBAAgB;EAChB,YAAY;EACZ,8BAA8B;EAC9B,qCAAqC;EACrC,cAAc;EACd,YAAY;EACZ,WAAW;EACX,eAAe;AACjB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,wCAAwC;AAC1C;;AAEA,wBAAwB;AACxB;EACE,iBAAiB;EACjB,mBAAmB;EACnB,UAAU;EACV,sBAAsB;AACxB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,eAAe;AACjB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,aAAa;EACb,WAAW;EACX,kBAAkB;EAClB,mEAAmE;EACnE,sBAAsB;EACtB,yCAAyC;AAC3C;;AAEA;EACE,qCAAqC;EACrC,mCAAmC;AACrC;;AAEA;;EAEE,UAAU;AACZ;;AAEA;EACE,6BAA6B;EAC7B,kBAAkB;AACpB;;AAEA;EACE,YAAY;EACZ,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;EACjB,mBAAmB;AACrB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,eAAe;AACjB;;AAEA;EACE,qCAAqC;EACrC,mCAAmC;AACrC;;AAEA;EACE,mCAAmC;EACnC,qCAAqC;EACrC,aAAa;AACf;;AAEA;EACE,cAAc;EACd,iBAAiB;EACjB,kBAAkB;EAClB,YAAY;EACZ,WAAW;EACX,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,iBAAiB;AACnB;;AAEA;EACE,oCAAoC;EACpC,qCAAqC;EACrC,sCAAsC;EACtC,gBAAgB;EAChB,aAAa;EACb,eAAe;AACjB;;AAEA;EACE,kBAAkB;EAClB,iBAAiB;EACjB,eAAe;EACf,oCAAoC;EACpC,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,gBAAgB;EAChB,iBAAiB;EACjB,gBAAgB;AAClB;;AAEA;EACE,UAAU;EACV,iDAAiD;EACjD,qCAAqC;EACrC,sCAAsC;EACtC,oCAAoC;EACpC,aAAa;EACb,gBAAgB;EAChB,uCAAuC;EACvC,eAAe;AACjB;;AAEA;EACE,uDAAuD;AACzD;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,6BAA6B;EAC7B,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,qBAAqB;AACvB;;AAEA,wBAAwB;AACxB;EACE,WAAW;EACX,cAAc;EACd,yBAAyB;AAC3B;;AAEA;EACE,kBAAkB;EAClB,4DAA4D;AAC9D;;AAEA,8BAA8B;AAC9B;EACE,aAAa;EACb,eAAe;AACjB;;AAEA;;EAEE,8BAA8B;AAChC;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,8BAA8B;AAChC;;AAEA,sBAAsB;;AAEtB;EACE,aAAa;EACb,sBAAsB;EACtB,kCAAkC;EAClC,qCAAqC;EACrC,oCAAoC;EACpC,gBAAgB;EAChB,WAAW;AACb;;AAEA,iBAAiB;AACjB;EACE,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,sBAAsB;EACtB,kCAAkC;EAClC,yCAAyC;AAC3C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,mCAAmC;EACnC,kBAAkB;EAClB,qBAAqB;EACrB,eAAe;AACjB;;AAEA;EACE,6BAA6B;EAC7B,0BAA0B;AAC5B;;AAEA;EACE,6BAA6B;EAC7B,0BAA0B;AAC5B;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,iBAAiB;EACjB,kCAAkC;EAClC,yCAAyC;EACzC,WAAW;EACX,UAAU;EACV,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;AACpB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Shortcut Input Style */\n\n.jp-Shortcuts-InputBox {\n  display: inline-flex;\n  padding-top: 2px;\n}\n\n.jp-Shortcuts-InputBoxNew {\n  margin-left: 10px;\n}\n\n.jp-mod-hidden {\n  display: none;\n}\n\n@keyframes slide-animation {\n  from {\n    width: 0;\n    left: 0;\n  }\n\n  to {\n    width: 120px;\n    left: 0;\n  }\n}\n\n.jp-Shortcuts-Input {\n  animation-duration: 0.3s;\n  animation-timing-function: ease-out;\n  animation-name: slide-animation;\n  border-width: var(--jp-border-width);\n  border-color: var(--jp-border-color3);\n  border-style: solid;\n  background-color: var(--jp-layout-color0);\n  margin-left: auto;\n  padding-left: 10px;\n  width: 120px;\n  height: 25px;\n  line-height: 25px;\n  display: block;\n}\n\n.jp-Shortcuts-Input:focus {\n  outline: none;\n  color: var(--jp-content-font-color1);\n  border-color: var(--jp-brand-color2);\n}\n\n.jp-mod-unavailable-Input:focus {\n  border-color: var(--jp-error-color2);\n}\n\n.jp-Shortcuts-InputText {\n  overflow-x: hidden;\n  overflow-y: hidden;\n  margin: 0;\n  margin-top: 4px;\n  padding: 0 5px;\n  height: 17px;\n  line-height: 17px;\n  width: fit-content;\n}\n\n.jp-mod-selected-InputText {\n  background-color: var(--jp-shortcuts-button-background);\n  overflow: hidden;\n}\n\n.jp-mod-waiting-InputText {\n  color: var(--jp-content-font-color3);\n}\n\n.jp-Shortcuts-Submit {\n  background-color: var(--jp-brand-color2);\n  border-radius: 0;\n  border: none;\n  color: var(--jp-layout-color0);\n  font-family: var(--jp-ui-font-family);\n  display: block;\n  height: 27px;\n  width: 26px;\n  cursor: pointer;\n}\n\n.jp-Shortcuts-Submit:focus {\n  outline: none;\n}\n\n.jp-Shortcuts-Submit .jp-icon3[fill] {\n  fill: var(--jp-layout-color1);\n}\n\n.jp-Shortcuts-Submit.jp-mod-defunc-Submit {\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-Shortcuts-Submit.jp-mod-defunc-Submit .jp-icon3[fill] {\n  fill: var(--jp-inverse-layout-color1);\n}\n\n.jp-Shortcuts-Submit.jp-mod-conflict-Submit {\n  background-color: var(--jp-error-color1);\n}\n\n/* Shortcut Item Style */\n.jp-Shortcuts-Cell {\n  padding: 6px 12px;\n  display: table-cell;\n  width: 20%;\n  vertical-align: middle;\n}\n\n.jp-Shortcuts-ShortcutCell {\n  display: flex;\n  min-width: max-content;\n  flex-wrap: wrap;\n}\n\n.jp-Shortcuts-EmptyCell {\n  height: 32px;\n}\n\n.jp-Shortcuts-Row {\n  padding: 10px;\n  width: 100%;\n  display: table-row;\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n  vertical-align: middle;\n  background-color: var(--jp-layout-color0);\n}\n\n.jp-Shortcuts-Row:hover .jp-Shortcuts-ShortcutKeys {\n  border-color: var(--jp-border-color1);\n  background: var(--jp-layout-color2);\n}\n\n.jp-Shortcuts-Row:hover .jp-Shortcuts-Plus,\n.jp-Shortcuts-Row:hover .jp-Shortcuts-Or {\n  opacity: 1;\n}\n\n.jp-Shortcuts-ErrorMessage {\n  color: var(--jp-error-color1);\n  align-self: center;\n}\n\n.jp-Shortcuts-RowWithConflict {\n  height: 45px;\n  position: relative;\n}\n\n.jp-Shortcuts-ErrorButton {\n  margin-left: 12px;\n  white-space: nowrap;\n}\n\n.jp-Shortcuts-ErrorButton > button {\n  margin-right: 12px;\n}\n\n.jp-Shortcuts-ShortcutContainer {\n  display: flex;\n  flex-wrap: wrap;\n}\n\n.jp-Shortcuts-ShortcutContainer:hover .jp-Shortcuts-ShortcutKeys {\n  border-color: var(--jp-border-color3);\n  background: var(--jp-layout-color3);\n}\n\n.jp-Shortcuts-ShortcutKeysContainer {\n  font-size: var(--jp-code-font-size);\n  font-family: var(--jp-ui-font-family);\n  display: flex;\n}\n\n.jp-Shortcuts-ConflictContainer {\n  display: block;\n  padding: 6px 12px;\n  position: absolute;\n  height: 100%;\n  width: 100%;\n  box-sizing: border-box;\n  overflow: hidden;\n}\n\n.jp-Shortcuts-Conflict {\n  display: flex;\n  flex-wrap: nowrap;\n}\n\n.jp-Shortcuts-ShortcutKeys {\n  border-width: var(--jp-border-width);\n  border-color: var(--jp-layout-color0);\n  border-radius: var(--jp-border-radius);\n  padding: 5px 6px;\n  margin: 3px 0;\n  cursor: pointer;\n}\n\n.jp-Shortcuts-Or {\n  margin-right: 12px;\n  margin-left: 12px;\n  margin-top: 8px;\n  color: var(--jp-content-font-color3);\n  opacity: 0;\n}\n\n.jp-Shortcuts-Or:hover {\n  opacity: 1;\n}\n\n.jp-Shortcuts-Or-Forced {\n  opacity: 1;\n}\n\n.jp-Shortcuts-Comma {\n  margin-top: 10px;\n  margin-right: 2px;\n  margin-left: 2px;\n}\n\n.jp-Shortcuts-Plus {\n  opacity: 0;\n  background: var(--jp-shortcuts-button-background);\n  border-color: var(--jp-layout-color0);\n  border-radius: var(--jp-border-radius);\n  border-width: var(--jp-border-width);\n  margin: 3px 0;\n  padding: 5px 6px;\n  color: var(--jp-ui-inverse-font-color1);\n  cursor: pointer;\n}\n\n.jp-Shortcuts-Plus:hover {\n  background: var(--jp-shortcuts-button-hover-background);\n}\n\n.jp-Shortcuts-Plus:active {\n  background-color: var(--jp-brand-color2);\n}\n\n.jp-Shortcuts-Reset {\n  color: var(--jp-brand-color2);\n  padding-left: 10px;\n  cursor: pointer;\n}\n\n.jp-Shortcuts-Reset:hover {\n  color: var(--jp-brand-color1);\n}\n\n.jp-Shortcuts-SourceCell {\n  display: inline-block;\n}\n\n/* Shortcut List Style */\n.jp-Shortcuts-ShortcutList {\n  width: 100%;\n  display: table;\n  border-collapse: collapse;\n}\n\n.jp-Shortcuts-ShortcutListContainer {\n  overflow-y: scroll;\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n/* Shortcut Title Item Style */\n.jp-Shortcuts-Header {\n  display: flex;\n  cursor: pointer;\n}\n\n.jp-Shortcuts-Header:hover .jp-ShortcutTitleItem-sortButton .jp-icon3[fill],\n.jp-Shortcuts-Header:focus .jp-ShortcutTitleItem-sortButton .jp-icon3[fill] {\n  fill: var(--jp-ui-font-color0);\n}\n\n.jp-Shortcuts-Header:active .jp-ShortcutTitleItem-sortButton {\n  outline: none;\n}\n\n.jp-Shortcuts-CurrentHeader .jp-icon3[fill] {\n  fill: var(--jp-ui-font-color0);\n}\n\n/* Shortcut UI Style */\n\n.jp-Shortcuts-ShortcutUI {\n  display: flex;\n  flex-direction: column;\n  font-size: var(--jp-ui-font-size1);\n  font-family: var(--jp-ui-font-family);\n  color: var(--jp-content-font-color1);\n  min-width: 450px;\n  width: 100%;\n}\n\n/* TopNav Style */\n.jp-Shortcuts-Top {\n  display: block;\n}\n\n.jp-Shortcuts-TopNav {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  box-sizing: border-box;\n  font-size: var(--jp-ui-font-size1);\n  background-color: var(--jp-layout-color0);\n}\n\n.jp-Shortcuts-Symbols {\n  padding: 0 12px;\n}\n\n.jp-Shortcuts-Symbols td:nth-child(2) {\n  padding-right: 10px;\n}\n\n.jp-Shortcuts-AdvancedOptions {\n  padding-left: 12px;\n}\n\n.jp-Shortcuts-AdvancedOptionsLink {\n  color: var(--jp-content-link-color);\n  margin-right: 15px;\n  display: inline-block;\n  cursor: pointer;\n}\n\n.jp-Shortcuts-AdvancedOptionsLink:hover {\n  color: var(--jp-brand-color0);\n  text-decoration: underline;\n}\n\n.jp-Shortcuts-AdvancedOptionsLink:active {\n  color: var(--jp-brand-color0);\n  text-decoration: underline;\n}\n\n.jp-Shortcuts-HeaderRowContainer {\n  padding-right: 14px;\n}\n\n.jp-Shortcuts-HeaderRow {\n  font-weight: bold;\n  font-size: var(--jp-ui-font-size1);\n  background-color: var(--jp-layout-color0);\n  width: 100%;\n  z-index: 1;\n  display: table;\n  padding: 10px 0;\n}\n\n.jp-Shortcuts-commandIcon {\n  margin-right: 13px;\n}\n\n.jp-Shortcuts-altIcon {\n  margin-right: 14px;\n}\n\n.jp-Shortcuts-controlIcon {\n  margin-left: 8px;\n  margin-right: 16px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 81435:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Styles
|----------------------------------------------------------------------------*/

.jp-StatusBar-Widget {
  display: flex;
  align-items: center;
  background: var(--jp-layout-color2);
  min-height: var(--jp-statusbar-height);
  justify-content: space-between;
  padding: 0 10px;
}

.jp-StatusBar-Left {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.jp-StatusBar-Middle {
  display: flex;
  align-items: center;
}

.jp-StatusBar-Right {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
}

.jp-StatusBar-Item {
  max-height: var(--jp-statusbar-height);
  margin: 0 2px;
  height: var(--jp-statusbar-height);
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--jp-ui-font-color1);
  padding: 0 6px;
}

.jp-mod-highlighted:hover {
  background-color: var(--jp-layout-color3);
}

.jp-mod-clicked {
  background-color: var(--jp-brand-color1);
}

.jp-mod-clicked:hover {
  background-color: var(--jp-brand-color0);
}

.jp-mod-clicked .jp-StatusBar-TextItem {
  color: var(--jp-ui-inverse-font-color1);
}

.jp-StatusBar-HoverItem {
  border: var(--jp-border-width) solid var(--jp-border-color1);
  border-radius: var(--jp-border-radius);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.jp-StatusBar-TextItem {
  font-size: var(--jp-ui-font-size1);
  font-family: var(--jp-ui-font-family);
  line-height: 24px;
  color: var(--jp-ui-font-color1);
}

.jp-StatusBar-GroupItem {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.jp-StatusBar-GroupItem:focus-visible {
  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));
  outline-offset: -1px;
}

.jp-Statusbar-ProgressCircle > svg {
  display: block;
  margin: 0 auto;
  width: 16px;
  align-self: normal;
}

.jp-Statusbar-ProgressCircle .jp-Statusbar-ProgressCirclePath {
  fill: var(--jp-inverse-layout-color3);
}

.jp-Statusbar-ProgressBar-progress-bar {
  height: 10px;
  width: 100px;
  border: solid 0.25px var(--jp-brand-color2);
  border-radius: 3px;
  overflow: hidden;
  align-self: center;
}

.jp-Statusbar-ProgressBar-progress-bar > div {
  background-color: var(--jp-brand-color2);
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  float: left;
  width: 0%;
  height: 100%;
  font-size: 12px;
  line-height: 14px;
  color: #fff;
  text-align: center;
  animation: jp-Statusbar-ExecutionTime-progress-bar 2s linear infinite;
}

.jp-Statusbar-ProgressBar-progress-bar p {
  color: var(--jp-ui-font-color1);
  font-family: var(--jp-ui-font-family);
  font-size: var(--jp-ui-font-size1);
  line-height: 10px;
  width: 100px;
}

@keyframes jp-Statusbar-ExecutionTime-progress-bar {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 40px 40px;
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/statusbar/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,aAAa;EACb,mBAAmB;EACnB,mCAAmC;EACnC,sCAAsC;EACtC,8BAA8B;EAC9B,eAAe;AACjB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,2BAA2B;AAC7B;;AAEA;EACE,sCAAsC;EACtC,aAAa;EACb,kCAAkC;EAClC,mBAAmB;EACnB,uBAAuB;EACvB,+BAA+B;EAC/B,cAAc;AAChB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,4DAA4D;EAC5D,sCAAsC;EACtC,yCAAyC;AAC3C;;AAEA;EACE,kCAAkC;EAClC,qCAAqC;EACrC,iBAAiB;EACjB,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;AACrB;;AAEA;EACE,mEAAmE;EACnE,oBAAoB;AACtB;;AAEA;EACE,cAAc;EACd,cAAc;EACd,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,YAAY;EACZ,YAAY;EACZ,2CAA2C;EAC3C,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;AACpB;;AAEA;EACE,wCAAwC;EACxC;;;;;;;;;GASC;EACD,0BAA0B;EAC1B,WAAW;EACX,SAAS;EACT,YAAY;EACZ,eAAe;EACf,iBAAiB;EACjB,WAAW;EACX,kBAAkB;EAClB,qEAAqE;AACvE;;AAEA;EACE,+BAA+B;EAC/B,qCAAqC;EACrC,kCAAkC;EAClC,iBAAiB;EACjB,YAAY;AACd;;AAEA;EACE;IACE,wBAAwB;EAC1B;;EAEA;IACE,8BAA8B;EAChC;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Styles\n|----------------------------------------------------------------------------*/\n\n.jp-StatusBar-Widget {\n  display: flex;\n  align-items: center;\n  background: var(--jp-layout-color2);\n  min-height: var(--jp-statusbar-height);\n  justify-content: space-between;\n  padding: 0 10px;\n}\n\n.jp-StatusBar-Left {\n  display: flex;\n  align-items: center;\n  flex-direction: row;\n}\n\n.jp-StatusBar-Middle {\n  display: flex;\n  align-items: center;\n}\n\n.jp-StatusBar-Right {\n  display: flex;\n  align-items: center;\n  flex-direction: row-reverse;\n}\n\n.jp-StatusBar-Item {\n  max-height: var(--jp-statusbar-height);\n  margin: 0 2px;\n  height: var(--jp-statusbar-height);\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  color: var(--jp-ui-font-color1);\n  padding: 0 6px;\n}\n\n.jp-mod-highlighted:hover {\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-mod-clicked {\n  background-color: var(--jp-brand-color1);\n}\n\n.jp-mod-clicked:hover {\n  background-color: var(--jp-brand-color0);\n}\n\n.jp-mod-clicked .jp-StatusBar-TextItem {\n  color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-StatusBar-HoverItem {\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  border-radius: var(--jp-border-radius);\n  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);\n}\n\n.jp-StatusBar-TextItem {\n  font-size: var(--jp-ui-font-size1);\n  font-family: var(--jp-ui-font-family);\n  line-height: 24px;\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-StatusBar-GroupItem {\n  display: flex;\n  align-items: center;\n  flex-direction: row;\n}\n\n.jp-StatusBar-GroupItem:focus-visible {\n  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));\n  outline-offset: -1px;\n}\n\n.jp-Statusbar-ProgressCircle > svg {\n  display: block;\n  margin: 0 auto;\n  width: 16px;\n  align-self: normal;\n}\n\n.jp-Statusbar-ProgressCircle .jp-Statusbar-ProgressCirclePath {\n  fill: var(--jp-inverse-layout-color3);\n}\n\n.jp-Statusbar-ProgressBar-progress-bar {\n  height: 10px;\n  width: 100px;\n  border: solid 0.25px var(--jp-brand-color2);\n  border-radius: 3px;\n  overflow: hidden;\n  align-self: center;\n}\n\n.jp-Statusbar-ProgressBar-progress-bar > div {\n  background-color: var(--jp-brand-color2);\n  background-image: linear-gradient(\n    -45deg,\n    rgba(255, 255, 255, 0.2) 25%,\n    transparent 25%,\n    transparent 50%,\n    rgba(255, 255, 255, 0.2) 50%,\n    rgba(255, 255, 255, 0.2) 75%,\n    transparent 75%,\n    transparent\n  );\n  background-size: 40px 40px;\n  float: left;\n  width: 0%;\n  height: 100%;\n  font-size: 12px;\n  line-height: 14px;\n  color: #fff;\n  text-align: center;\n  animation: jp-Statusbar-ExecutionTime-progress-bar 2s linear infinite;\n}\n\n.jp-Statusbar-ProgressBar-progress-bar p {\n  color: var(--jp-ui-font-color1);\n  font-family: var(--jp-ui-font-family);\n  font-size: var(--jp-ui-font-size1);\n  line-height: 10px;\n  width: 100px;\n}\n\n@keyframes jp-Statusbar-ExecutionTime-progress-bar {\n  0% {\n    background-position: 0 0;\n  }\n\n  100% {\n    background-position: 40px 40px;\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 81835:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-Terminal {
  min-width: 240px;
  min-height: 120px;
}

.jp-Terminal-body {
  padding: 8px;
}

[data-term-theme='inherit'] .xterm .xterm-screen canvas {
  border: 1px solid var(--jp-layout-color0);
}

[data-term-theme='light'] .xterm .xterm-screen canvas {
  border: 1px solid #fff;
}

[data-term-theme='dark'] .xterm .xterm-screen canvas {
  border: 1px solid #000;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/terminal/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,sBAAsB;AACxB;;AAEA;EACE,sBAAsB;AACxB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Terminal {\n  min-width: 240px;\n  min-height: 120px;\n}\n\n.jp-Terminal-body {\n  padding: 8px;\n}\n\n[data-term-theme='inherit'] .xterm .xterm-screen canvas {\n  border: 1px solid var(--jp-layout-color0);\n}\n\n[data-term-theme='light'] .xterm .xterm-screen canvas {\n  border: 1px solid #fff;\n}\n\n[data-term-theme='dark'] .xterm .xterm-screen canvas {\n  border: 1px solid #000;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 96384:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/toc-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 34037:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
| Table of Contents
|----------------------------------------------------------------------------*/

.jp-TableOfContents {
  display: flex;
  flex-direction: column;
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  height: 100%;
}

.jp-TableOfContents-placeholder {
  text-align: center;
}

.jp-TableOfContents-placeholderContent {
  color: var(--jp-content-font-color2);
  padding: 8px;
}

.jp-TableOfContents-placeholderContent > h3 {
  margin-bottom: var(--jp-content-heading-margin-bottom);
}

.jp-TableOfContents .jp-SidePanel-content {
  overflow-y: auto;
}

.jp-TableOfContents-tree {
  margin: 4px;
}

.jp-TableOfContents-content {
  padding: 0;
  background-color: var(--jp-layout-color1);
}

.jp-tocItem {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.jp-tocItem-heading {
  display: flex;
  cursor: pointer;
  width: 100%;
}

.jp-tocItem-content {
  display: block;
  padding: 4px 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-x: hidden;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/toc/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;8EAE8E;;AAE9E;EACE,aAAa;EACb,sBAAsB;EACtB,mCAAmC;EACnC,+BAA+B;EAC/B,kCAAkC;EAClC,YAAY;AACd;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,oCAAoC;EACpC,YAAY;AACd;;AAEA;EACE,sDAAsD;AACxD;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,UAAU;EACV,yCAAyC;AAC3C;;AAEA;EACE,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,eAAe;EACf,WAAW;AACb;;AAEA;EACE,cAAc;EACd,cAAc;EACd,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;AACpB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Table of Contents\n|----------------------------------------------------------------------------*/\n\n.jp-TableOfContents {\n  display: flex;\n  flex-direction: column;\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n  height: 100%;\n}\n\n.jp-TableOfContents-placeholder {\n  text-align: center;\n}\n\n.jp-TableOfContents-placeholderContent {\n  color: var(--jp-content-font-color2);\n  padding: 8px;\n}\n\n.jp-TableOfContents-placeholderContent > h3 {\n  margin-bottom: var(--jp-content-heading-margin-bottom);\n}\n\n.jp-TableOfContents .jp-SidePanel-content {\n  overflow-y: auto;\n}\n\n.jp-TableOfContents-tree {\n  margin: 4px;\n}\n\n.jp-TableOfContents-content {\n  padding: 0;\n  background-color: var(--jp-layout-color1);\n}\n\n.jp-tocItem {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.jp-tocItem-heading {\n  display: flex;\n  cursor: pointer;\n  width: 100%;\n}\n\n.jp-tocItem-content {\n  display: block;\n  padding: 4px 0;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  overflow-x: hidden;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 10398:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-Tooltip {
  background: var(--jp-layout-color1);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  font-size: var(--jp-ui-font-size0);
  box-shadow: var(--jp-elevation-z6);
  max-width: 750px;
  max-height: 350px;
  z-index: 10001;
  padding: 4px;
  display: flex;
}

.jp-Tooltip-content {
  overflow: auto;
}

.jp-Tooltip:focus {
  outline: 0;
}

.jp-Tooltip pre {
  white-space: pre-wrap;
  margin: 0;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/tooltip/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,mCAAmC;EACnC,4DAA4D;EAC5D,kCAAkC;EAClC,kCAAkC;EAClC,gBAAgB;EAChB,iBAAiB;EACjB,cAAc;EACd,YAAY;EACZ,aAAa;AACf;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,qBAAqB;EACrB,SAAS;AACX","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Tooltip {\n  background: var(--jp-layout-color1);\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  font-size: var(--jp-ui-font-size0);\n  box-shadow: var(--jp-elevation-z6);\n  max-width: 750px;\n  max-height: 350px;\n  z-index: 10001;\n  padding: 4px;\n  display: flex;\n}\n\n.jp-Tooltip-content {\n  overflow: auto;\n}\n\n.jp-Tooltip:focus {\n  outline: 0;\n}\n\n.jp-Tooltip pre {\n  white-space: pre-wrap;\n  margin: 0;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 56620:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_collapse_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28613);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_deprecated_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89692);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_deprecatedExtra_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13220);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_tabbar_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35971);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_icons_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(52309);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_iconsalt_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(20426);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_iconshover_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(71892);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_iframe_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(55986);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_hoverbox_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(82663);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_rjsfTemplates_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(83101);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_sidepanel_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(38177);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_spinner_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(47974);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_styling_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(4366);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_switch_css__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(10576);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_table_css__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(83838);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_toolbar_css__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(55386);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_toolkit_css__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(94579);
/* harmony import */ var _builder_node_modules_css_loader_dist_cjs_js_windowedlist_css__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(54061);
// Imports




















var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_collapse_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_deprecated_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_deprecatedExtra_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_tabbar_css__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_icons_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_iconsalt_css__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_iconshover_css__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_iframe_css__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_hoverbox_css__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_rjsfTemplates_css__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_sidepanel_css__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_spinner_css__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_styling_css__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_switch_css__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_table_css__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_toolbar_css__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_toolkit_css__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_builder_node_modules_css_loader_dist_cjs_js_windowedlist_css__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* Sibling imports */

.jp-ThemedContainer {
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
}

/* Disable native link decoration styles everywhere outside of dialog boxes */
.jp-ThemedContainer a {
  text-decoration: unset;
  color: unset;
}

.jp-ThemedContainer a:hover {
  text-decoration: unset;
  color: unset;
}

/* Accessibility for links inside dialog box text */
.jp-Dialog-content a {
  text-decoration: revert;
  color: var(--jp-content-link-color);
}

.jp-Dialog-content a:hover {
  text-decoration: revert;
}

/* Styles for ui-components */
.jp-FilterBox {
  --design-unit: 3;
  --density: 0;
}

.jp-Button {
  color: var(--jp-ui-font-color2);
  border-radius: var(--jp-border-radius);
  padding: 0 12px;
  font-size: var(--jp-ui-font-size1);

  /* Copy from blueprint 3 */
  display: inline-flex;
  flex-direction: row;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  text-align: left;
  vertical-align: middle;
  min-height: 30px;
  min-width: 30px;
}

.jp-Button:disabled {
  cursor: not-allowed;
}

.jp-Button:empty {
  padding: 0 !important;
}

.jp-Button.jp-mod-small {
  min-height: 24px;
  min-width: 24px;
  font-size: 12px;
  padding: 0 7px;
}

/* Use our own theme for hover styles */
.jp-Button.jp-mod-minimal:hover {
  background-color: var(--jp-layout-color2);
}

.jp-Button.jp-mod-minimal {
  background: none;
}

.jp-InputGroup {
  display: block;
  position: relative;
}

.jp-InputGroup input {
  box-sizing: border-box;
  border: none;
  border-radius: var(--jp-border-radius);
  background-color: transparent;
  color: var(--jp-ui-font-color0);
  box-shadow: inset 0 0 0 var(--jp-border-width) var(--jp-input-border-color);
  padding-bottom: 0;
  padding-top: 0;
  padding-left: 10px;
  padding-right: 28px;
  position: relative;
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 14px;
  font-weight: 400;
  height: 30px;
  line-height: 30px;
  outline: none;
  vertical-align: middle;
}

.jp-InputGroup input:focus {
  box-shadow:
    inset 0 0 0 var(--jp-border-width) var(--jp-input-active-box-shadow-color),
    inset 0 0 0 3px var(--jp-input-active-box-shadow-color);
}

.jp-InputGroup input:disabled {
  cursor: not-allowed;
  resize: block;
  background-color: var(--jp-layout-color2);
  color: var(--jp-ui-font-color2);
}

.jp-InputGroup input:disabled ~ span {
  cursor: not-allowed;
  color: var(--jp-ui-font-color2);
}

.jp-InputGroup input::placeholder,
.jp-ThemedContainer input::placeholder {
  color: var(--jp-ui-font-color2);
}

.jp-InputGroupAction {
  position: absolute;
  bottom: 1px;
  right: 0;
  padding: 6px;
}

.jp-HTMLSelect.jp-DefaultStyle {
  /* Leave space for the focus outline */
  padding: 0 2px;
}

.jp-HTMLSelect.jp-DefaultStyle select {
  background-color: initial;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--jp-ui-font-color0);
  display: block;
  font-size: var(--jp-ui-font-size1);
  font-family: var(--jp-ui-font-family);
  height: 24px;
  line-height: 14px;
  padding: 0 25px 0 10px;
  text-align: left;
  -moz-appearance: none;
  -webkit-appearance: none;
}

.jp-HTMLSelect.jp-DefaultStyle select:disabled {
  background-color: var(--jp-layout-color2);
  color: var(--jp-ui-font-color2);
  cursor: not-allowed;
  resize: block;
}

.jp-HTMLSelect.jp-DefaultStyle select:disabled ~ span {
  cursor: not-allowed;
}

.jp-HTMLSelect.jp-DefaultStyle select:focus-visible {
  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));
}

/* Use our own theme for hover and option styles */
/* stylelint-disable-next-line selector-max-type */
.jp-HTMLSelect.jp-DefaultStyle select:hover,
.jp-HTMLSelect.jp-DefaultStyle select > option {
  background-color: var(--jp-layout-color2);
  color: var(--jp-ui-font-color0);
}

.jp-ThemedContainer select {
  box-sizing: border-box;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,oBAAoB;;AAoBpB;EACE,+BAA+B;EAC/B,kCAAkC;AACpC;;AAEA,6EAA6E;AAC7E;EACE,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,sBAAsB;EACtB,YAAY;AACd;;AAEA,mDAAmD;AACnD;EACE,uBAAuB;EACvB,mCAAmC;AACrC;;AAEA;EACE,uBAAuB;AACzB;;AAEA,6BAA6B;AAC7B;EACE,gBAAgB;EAChB,YAAY;AACd;;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,eAAe;EACf,kCAAkC;;EAElC,0BAA0B;EAC1B,oBAAoB;EACpB,mBAAmB;EACnB,YAAY;EACZ,eAAe;EACf,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;EAChB,sBAAsB;EACtB,gBAAgB;EAChB,eAAe;AACjB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,eAAe;EACf,cAAc;AAChB;;AAEA,uCAAuC;AACvC;EACE,yCAAyC;AAC3C;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,cAAc;EACd,kBAAkB;AACpB;;AAEA;EACE,sBAAsB;EACtB,YAAY;EACZ,sCAAsC;EACtC,6BAA6B;EAC7B,+BAA+B;EAC/B,2EAA2E;EAC3E,iBAAiB;EACjB,cAAc;EACd,kBAAkB;EAClB,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;EACX,wBAAwB;EACxB,qBAAqB;EACrB,gBAAgB;EAChB,eAAe;EACf,gBAAgB;EAChB,YAAY;EACZ,iBAAiB;EACjB,aAAa;EACb,sBAAsB;AACxB;;AAEA;EACE;;2DAEyD;AAC3D;;AAEA;EACE,mBAAmB;EACnB,aAAa;EACb,yCAAyC;EACzC,+BAA+B;AACjC;;AAEA;EACE,mBAAmB;EACnB,+BAA+B;AACjC;;AAEA;;EAEE,+BAA+B;AACjC;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,QAAQ;EACR,YAAY;AACd;;AAEA;EACE,sCAAsC;EACtC,cAAc;AAChB;;AAEA;EACE,yBAAyB;EACzB,YAAY;EACZ,gBAAgB;EAChB,gBAAgB;EAChB,+BAA+B;EAC/B,cAAc;EACd,kCAAkC;EAClC,qCAAqC;EACrC,YAAY;EACZ,iBAAiB;EACjB,sBAAsB;EACtB,gBAAgB;EAChB,qBAAqB;EACrB,wBAAwB;AAC1B;;AAEA;EACE,yCAAyC;EACzC,+BAA+B;EAC/B,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,mEAAmE;AACrE;;AAEA,kDAAkD;AAClD,kDAAkD;AAClD;;EAEE,yCAAyC;EACzC,+BAA+B;AACjC;;AAEA;EACE,sBAAsB;AACxB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Sibling imports */\n@import './collapse.css';\n@import './deprecated.css';\n@import './deprecatedExtra.css';\n@import './tabbar.css';\n@import './icons.css';\n@import './iconsalt.css';\n@import './iconshover.css';\n@import './iframe.css';\n@import './hoverbox.css';\n@import './rjsfTemplates.css';\n@import './sidepanel.css';\n@import './spinner.css';\n@import './styling.css';\n@import './switch.css';\n@import './table.css';\n@import './toolbar.css';\n@import './toolkit.css';\n@import './windowedlist.css';\n\n.jp-ThemedContainer {\n  color: var(--jp-ui-font-color1);\n  font-size: var(--jp-ui-font-size1);\n}\n\n/* Disable native link decoration styles everywhere outside of dialog boxes */\n.jp-ThemedContainer a {\n  text-decoration: unset;\n  color: unset;\n}\n\n.jp-ThemedContainer a:hover {\n  text-decoration: unset;\n  color: unset;\n}\n\n/* Accessibility for links inside dialog box text */\n.jp-Dialog-content a {\n  text-decoration: revert;\n  color: var(--jp-content-link-color);\n}\n\n.jp-Dialog-content a:hover {\n  text-decoration: revert;\n}\n\n/* Styles for ui-components */\n.jp-FilterBox {\n  --design-unit: 3;\n  --density: 0;\n}\n\n.jp-Button {\n  color: var(--jp-ui-font-color2);\n  border-radius: var(--jp-border-radius);\n  padding: 0 12px;\n  font-size: var(--jp-ui-font-size1);\n\n  /* Copy from blueprint 3 */\n  display: inline-flex;\n  flex-direction: row;\n  border: none;\n  cursor: pointer;\n  align-items: center;\n  justify-content: center;\n  text-align: left;\n  vertical-align: middle;\n  min-height: 30px;\n  min-width: 30px;\n}\n\n.jp-Button:disabled {\n  cursor: not-allowed;\n}\n\n.jp-Button:empty {\n  padding: 0 !important;\n}\n\n.jp-Button.jp-mod-small {\n  min-height: 24px;\n  min-width: 24px;\n  font-size: 12px;\n  padding: 0 7px;\n}\n\n/* Use our own theme for hover styles */\n.jp-Button.jp-mod-minimal:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-Button.jp-mod-minimal {\n  background: none;\n}\n\n.jp-InputGroup {\n  display: block;\n  position: relative;\n}\n\n.jp-InputGroup input {\n  box-sizing: border-box;\n  border: none;\n  border-radius: var(--jp-border-radius);\n  background-color: transparent;\n  color: var(--jp-ui-font-color0);\n  box-shadow: inset 0 0 0 var(--jp-border-width) var(--jp-input-border-color);\n  padding-bottom: 0;\n  padding-top: 0;\n  padding-left: 10px;\n  padding-right: 28px;\n  position: relative;\n  width: 100%;\n  -webkit-appearance: none;\n  -moz-appearance: none;\n  appearance: none;\n  font-size: 14px;\n  font-weight: 400;\n  height: 30px;\n  line-height: 30px;\n  outline: none;\n  vertical-align: middle;\n}\n\n.jp-InputGroup input:focus {\n  box-shadow:\n    inset 0 0 0 var(--jp-border-width) var(--jp-input-active-box-shadow-color),\n    inset 0 0 0 3px var(--jp-input-active-box-shadow-color);\n}\n\n.jp-InputGroup input:disabled {\n  cursor: not-allowed;\n  resize: block;\n  background-color: var(--jp-layout-color2);\n  color: var(--jp-ui-font-color2);\n}\n\n.jp-InputGroup input:disabled ~ span {\n  cursor: not-allowed;\n  color: var(--jp-ui-font-color2);\n}\n\n.jp-InputGroup input::placeholder,\n.jp-ThemedContainer input::placeholder {\n  color: var(--jp-ui-font-color2);\n}\n\n.jp-InputGroupAction {\n  position: absolute;\n  bottom: 1px;\n  right: 0;\n  padding: 6px;\n}\n\n.jp-HTMLSelect.jp-DefaultStyle {\n  /* Leave space for the focus outline */\n  padding: 0 2px;\n}\n\n.jp-HTMLSelect.jp-DefaultStyle select {\n  background-color: initial;\n  border: none;\n  border-radius: 0;\n  box-shadow: none;\n  color: var(--jp-ui-font-color0);\n  display: block;\n  font-size: var(--jp-ui-font-size1);\n  font-family: var(--jp-ui-font-family);\n  height: 24px;\n  line-height: 14px;\n  padding: 0 25px 0 10px;\n  text-align: left;\n  -moz-appearance: none;\n  -webkit-appearance: none;\n}\n\n.jp-HTMLSelect.jp-DefaultStyle select:disabled {\n  background-color: var(--jp-layout-color2);\n  color: var(--jp-ui-font-color2);\n  cursor: not-allowed;\n  resize: block;\n}\n\n.jp-HTMLSelect.jp-DefaultStyle select:disabled ~ span {\n  cursor: not-allowed;\n}\n\n.jp-HTMLSelect.jp-DefaultStyle select:focus-visible {\n  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));\n}\n\n/* Use our own theme for hover and option styles */\n/* stylelint-disable-next-line selector-max-type */\n.jp-HTMLSelect.jp-DefaultStyle select:hover,\n.jp-HTMLSelect.jp-DefaultStyle select > option {\n  background-color: var(--jp-layout-color2);\n  color: var(--jp-ui-font-color0);\n}\n\n.jp-ThemedContainer select {\n  box-sizing: border-box;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 28613:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-Collapse {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.jp-Collapse-header {
  padding: 1px 12px;
  background-color: var(--jp-layout-color1);
  border-bottom: solid var(--jp-border-width) var(--jp-border-color2);
  color: var(--jp-ui-font-color1);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: var(--jp-ui-font-size0);
  font-weight: 600;
  text-transform: uppercase;
  user-select: none;
}

.jp-Collapser-icon {
  height: 16px;
}

.jp-Collapse-header-collapsed .jp-Collapser-icon {
  transform: rotate(-90deg);
  margin: auto 0;
}

.jp-Collapser-title {
  line-height: 25px;
}

.jp-Collapse-contents {
  padding: 0 12px;
  background-color: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  overflow: auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/collapse.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,sBAAsB;EACtB,oBAAoB;AACtB;;AAEA;EACE,iBAAiB;EACjB,yCAAyC;EACzC,mEAAmE;EACnE,+BAA+B;EAC/B,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,kCAAkC;EAClC,gBAAgB;EAChB,yBAAyB;EACzB,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,yBAAyB;EACzB,cAAc;AAChB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,eAAe;EACf,yCAAyC;EACzC,+BAA+B;EAC/B,cAAc;AAChB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Collapse {\n  display: flex;\n  flex-direction: column;\n  align-items: stretch;\n}\n\n.jp-Collapse-header {\n  padding: 1px 12px;\n  background-color: var(--jp-layout-color1);\n  border-bottom: solid var(--jp-border-width) var(--jp-border-color2);\n  color: var(--jp-ui-font-color1);\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  font-size: var(--jp-ui-font-size0);\n  font-weight: 600;\n  text-transform: uppercase;\n  user-select: none;\n}\n\n.jp-Collapser-icon {\n  height: 16px;\n}\n\n.jp-Collapse-header-collapsed .jp-Collapser-icon {\n  transform: rotate(-90deg);\n  margin: auto 0;\n}\n\n.jp-Collapser-title {\n  line-height: 25px;\n}\n\n.jp-Collapse-contents {\n  padding: 0 12px;\n  background-color: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n  overflow: auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 89692:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(878);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__);
// Imports



var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(92700), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_1___ = new URL(/* asset import */ __webpack_require__(15716), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_2___ = new URL(/* asset import */ __webpack_require__(25979), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_3___ = new URL(/* asset import */ __webpack_require__(18203), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_4___ = new URL(/* asset import */ __webpack_require__(61681), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_5___ = new URL(/* asset import */ __webpack_require__(87770), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_6___ = new URL(/* asset import */ __webpack_require__(93275), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_7___ = new URL(/* asset import */ __webpack_require__(67945), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_8___ = new URL(/* asset import */ __webpack_require__(15156), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_9___ = new URL(/* asset import */ __webpack_require__(34580), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_10___ = new URL(/* asset import */ __webpack_require__(79279), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_11___ = new URL(/* asset import */ __webpack_require__(27646), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_12___ = new URL(/* asset import */ __webpack_require__(89446), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_13___ = new URL(/* asset import */ __webpack_require__(63793), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_14___ = new URL(/* asset import */ __webpack_require__(92650), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_15___ = new URL(/* asset import */ __webpack_require__(25853), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_16___ = new URL(/* asset import */ __webpack_require__(16084), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_17___ = new URL(/* asset import */ __webpack_require__(17641), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_18___ = new URL(/* asset import */ __webpack_require__(27449), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_19___ = new URL(/* asset import */ __webpack_require__(28072), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_20___ = new URL(/* asset import */ __webpack_require__(71179), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_21___ = new URL(/* asset import */ __webpack_require__(31075), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_22___ = new URL(/* asset import */ __webpack_require__(65230), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_23___ = new URL(/* asset import */ __webpack_require__(37004), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_24___ = new URL(/* asset import */ __webpack_require__(16932), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_25___ = new URL(/* asset import */ __webpack_require__(89630), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_26___ = new URL(/* asset import */ __webpack_require__(98689), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_27___ = new URL(/* asset import */ __webpack_require__(15768), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_28___ = new URL(/* asset import */ __webpack_require__(85349), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_29___ = new URL(/* asset import */ __webpack_require__(60435), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_30___ = new URL(/* asset import */ __webpack_require__(26702), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_31___ = new URL(/* asset import */ __webpack_require__(47162), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_32___ = new URL(/* asset import */ __webpack_require__(75136), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_33___ = new URL(/* asset import */ __webpack_require__(42081), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_34___ = new URL(/* asset import */ __webpack_require__(28052), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_35___ = new URL(/* asset import */ __webpack_require__(65886), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_36___ = new URL(/* asset import */ __webpack_require__(47252), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_37___ = new URL(/* asset import */ __webpack_require__(91609), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_38___ = new URL(/* asset import */ __webpack_require__(68781), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_39___ = new URL(/* asset import */ __webpack_require__(74161), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_40___ = new URL(/* asset import */ __webpack_require__(81338), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_41___ = new URL(/* asset import */ __webpack_require__(24364), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_42___ = new URL(/* asset import */ __webpack_require__(26774), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_43___ = new URL(/* asset import */ __webpack_require__(70880), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_44___ = new URL(/* asset import */ __webpack_require__(63704), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_45___ = new URL(/* asset import */ __webpack_require__(11893), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_46___ = new URL(/* asset import */ __webpack_require__(23326), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_47___ = new URL(/* asset import */ __webpack_require__(65110), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_48___ = new URL(/* asset import */ __webpack_require__(1357), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_49___ = new URL(/* asset import */ __webpack_require__(17779), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_50___ = new URL(/* asset import */ __webpack_require__(32174), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_51___ = new URL(/* asset import */ __webpack_require__(44540), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_52___ = new URL(/* asset import */ __webpack_require__(43237), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_53___ = new URL(/* asset import */ __webpack_require__(13593), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_54___ = new URL(/* asset import */ __webpack_require__(75517), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_55___ = new URL(/* asset import */ __webpack_require__(98311), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_56___ = new URL(/* asset import */ __webpack_require__(90717), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_57___ = new URL(/* asset import */ __webpack_require__(25075), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_58___ = new URL(/* asset import */ __webpack_require__(81856), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_59___ = new URL(/* asset import */ __webpack_require__(52101), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_60___ = new URL(/* asset import */ __webpack_require__(42048), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_61___ = new URL(/* asset import */ __webpack_require__(70941), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_62___ = new URL(/* asset import */ __webpack_require__(70063), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_63___ = new URL(/* asset import */ __webpack_require__(91474), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_64___ = new URL(/* asset import */ __webpack_require__(74835), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_65___ = new URL(/* asset import */ __webpack_require__(31179), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_66___ = new URL(/* asset import */ __webpack_require__(93107), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_67___ = new URL(/* asset import */ __webpack_require__(71349), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_68___ = new URL(/* asset import */ __webpack_require__(27807), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_69___ = new URL(/* asset import */ __webpack_require__(27346), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_70___ = new URL(/* asset import */ __webpack_require__(47699), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_71___ = new URL(/* asset import */ __webpack_require__(2599), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_72___ = new URL(/* asset import */ __webpack_require__(19804), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_73___ = new URL(/* asset import */ __webpack_require__(56555), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_74___ = new URL(/* asset import */ __webpack_require__(57220), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_75___ = new URL(/* asset import */ __webpack_require__(73428), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_76___ = new URL(/* asset import */ __webpack_require__(10729), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_77___ = new URL(/* asset import */ __webpack_require__(25665), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_78___ = new URL(/* asset import */ __webpack_require__(78563), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_79___ = new URL(/* asset import */ __webpack_require__(88449), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_80___ = new URL(/* asset import */ __webpack_require__(33168), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_81___ = new URL(/* asset import */ __webpack_require__(94051), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_82___ = new URL(/* asset import */ __webpack_require__(21936), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_83___ = new URL(/* asset import */ __webpack_require__(22978), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_84___ = new URL(/* asset import */ __webpack_require__(8477), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_85___ = new URL(/* asset import */ __webpack_require__(16580), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_86___ = new URL(/* asset import */ __webpack_require__(60682), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_87___ = new URL(/* asset import */ __webpack_require__(58441), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_88___ = new URL(/* asset import */ __webpack_require__(33003), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_89___ = new URL(/* asset import */ __webpack_require__(16460), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_90___ = new URL(/* asset import */ __webpack_require__(86352), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_91___ = new URL(/* asset import */ __webpack_require__(50110), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_92___ = new URL(/* asset import */ __webpack_require__(99947), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_93___ = new URL(/* asset import */ __webpack_require__(24213), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_94___ = new URL(/* asset import */ __webpack_require__(88959), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_95___ = new URL(/* asset import */ __webpack_require__(3512), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_96___ = new URL(/* asset import */ __webpack_require__(36911), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_97___ = new URL(/* asset import */ __webpack_require__(33109), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_98___ = new URL(/* asset import */ __webpack_require__(80687), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_99___ = new URL(/* asset import */ __webpack_require__(32167), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_100___ = new URL(/* asset import */ __webpack_require__(38457), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_101___ = new URL(/* asset import */ __webpack_require__(60056), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_102___ = new URL(/* asset import */ __webpack_require__(29012), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_103___ = new URL(/* asset import */ __webpack_require__(42882), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_104___ = new URL(/* asset import */ __webpack_require__(82371), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_105___ = new URL(/* asset import */ __webpack_require__(73621), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_106___ = new URL(/* asset import */ __webpack_require__(98413), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_107___ = new URL(/* asset import */ __webpack_require__(53217), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_108___ = new URL(/* asset import */ __webpack_require__(707), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_109___ = new URL(/* asset import */ __webpack_require__(51824), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_110___ = new URL(/* asset import */ __webpack_require__(87521), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_111___ = new URL(/* asset import */ __webpack_require__(89131), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_112___ = new URL(/* asset import */ __webpack_require__(89423), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_113___ = new URL(/* asset import */ __webpack_require__(16168), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_114___ = new URL(/* asset import */ __webpack_require__(67092), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_115___ = new URL(/* asset import */ __webpack_require__(91106), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_116___ = new URL(/* asset import */ __webpack_require__(19444), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_117___ = new URL(/* asset import */ __webpack_require__(62892), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_118___ = new URL(/* asset import */ __webpack_require__(7898), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_119___ = new URL(/* asset import */ __webpack_require__(87157), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_120___ = new URL(/* asset import */ __webpack_require__(24502), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_121___ = new URL(/* asset import */ __webpack_require__(63879), __webpack_require__.b);
var ___CSS_LOADER_URL_IMPORT_122___ = new URL(/* asset import */ __webpack_require__(85272), __webpack_require__.b);
var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
var ___CSS_LOADER_URL_REPLACEMENT_0___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
var ___CSS_LOADER_URL_REPLACEMENT_1___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_1___);
var ___CSS_LOADER_URL_REPLACEMENT_2___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_2___);
var ___CSS_LOADER_URL_REPLACEMENT_3___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_3___);
var ___CSS_LOADER_URL_REPLACEMENT_4___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_4___);
var ___CSS_LOADER_URL_REPLACEMENT_5___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_5___);
var ___CSS_LOADER_URL_REPLACEMENT_6___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_6___);
var ___CSS_LOADER_URL_REPLACEMENT_7___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_7___);
var ___CSS_LOADER_URL_REPLACEMENT_8___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_8___);
var ___CSS_LOADER_URL_REPLACEMENT_9___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_9___);
var ___CSS_LOADER_URL_REPLACEMENT_10___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_10___);
var ___CSS_LOADER_URL_REPLACEMENT_11___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_11___);
var ___CSS_LOADER_URL_REPLACEMENT_12___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_12___);
var ___CSS_LOADER_URL_REPLACEMENT_13___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_13___);
var ___CSS_LOADER_URL_REPLACEMENT_14___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_14___);
var ___CSS_LOADER_URL_REPLACEMENT_15___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_15___);
var ___CSS_LOADER_URL_REPLACEMENT_16___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_16___);
var ___CSS_LOADER_URL_REPLACEMENT_17___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_17___);
var ___CSS_LOADER_URL_REPLACEMENT_18___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_18___);
var ___CSS_LOADER_URL_REPLACEMENT_19___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_19___);
var ___CSS_LOADER_URL_REPLACEMENT_20___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_20___);
var ___CSS_LOADER_URL_REPLACEMENT_21___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_21___);
var ___CSS_LOADER_URL_REPLACEMENT_22___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_22___);
var ___CSS_LOADER_URL_REPLACEMENT_23___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_23___);
var ___CSS_LOADER_URL_REPLACEMENT_24___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_24___);
var ___CSS_LOADER_URL_REPLACEMENT_25___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_25___);
var ___CSS_LOADER_URL_REPLACEMENT_26___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_26___);
var ___CSS_LOADER_URL_REPLACEMENT_27___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_27___);
var ___CSS_LOADER_URL_REPLACEMENT_28___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_28___);
var ___CSS_LOADER_URL_REPLACEMENT_29___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_29___);
var ___CSS_LOADER_URL_REPLACEMENT_30___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_30___);
var ___CSS_LOADER_URL_REPLACEMENT_31___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_31___);
var ___CSS_LOADER_URL_REPLACEMENT_32___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_32___);
var ___CSS_LOADER_URL_REPLACEMENT_33___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_33___);
var ___CSS_LOADER_URL_REPLACEMENT_34___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_34___);
var ___CSS_LOADER_URL_REPLACEMENT_35___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_35___);
var ___CSS_LOADER_URL_REPLACEMENT_36___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_36___);
var ___CSS_LOADER_URL_REPLACEMENT_37___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_37___);
var ___CSS_LOADER_URL_REPLACEMENT_38___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_38___);
var ___CSS_LOADER_URL_REPLACEMENT_39___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_39___);
var ___CSS_LOADER_URL_REPLACEMENT_40___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_40___);
var ___CSS_LOADER_URL_REPLACEMENT_41___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_41___);
var ___CSS_LOADER_URL_REPLACEMENT_42___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_42___);
var ___CSS_LOADER_URL_REPLACEMENT_43___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_43___);
var ___CSS_LOADER_URL_REPLACEMENT_44___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_44___);
var ___CSS_LOADER_URL_REPLACEMENT_45___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_45___);
var ___CSS_LOADER_URL_REPLACEMENT_46___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_46___);
var ___CSS_LOADER_URL_REPLACEMENT_47___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_47___);
var ___CSS_LOADER_URL_REPLACEMENT_48___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_48___);
var ___CSS_LOADER_URL_REPLACEMENT_49___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_49___);
var ___CSS_LOADER_URL_REPLACEMENT_50___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_50___);
var ___CSS_LOADER_URL_REPLACEMENT_51___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_51___);
var ___CSS_LOADER_URL_REPLACEMENT_52___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_52___);
var ___CSS_LOADER_URL_REPLACEMENT_53___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_53___);
var ___CSS_LOADER_URL_REPLACEMENT_54___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_54___);
var ___CSS_LOADER_URL_REPLACEMENT_55___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_55___);
var ___CSS_LOADER_URL_REPLACEMENT_56___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_56___);
var ___CSS_LOADER_URL_REPLACEMENT_57___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_57___);
var ___CSS_LOADER_URL_REPLACEMENT_58___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_58___);
var ___CSS_LOADER_URL_REPLACEMENT_59___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_59___);
var ___CSS_LOADER_URL_REPLACEMENT_60___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_60___);
var ___CSS_LOADER_URL_REPLACEMENT_61___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_61___);
var ___CSS_LOADER_URL_REPLACEMENT_62___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_62___);
var ___CSS_LOADER_URL_REPLACEMENT_63___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_63___);
var ___CSS_LOADER_URL_REPLACEMENT_64___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_64___);
var ___CSS_LOADER_URL_REPLACEMENT_65___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_65___);
var ___CSS_LOADER_URL_REPLACEMENT_66___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_66___);
var ___CSS_LOADER_URL_REPLACEMENT_67___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_67___);
var ___CSS_LOADER_URL_REPLACEMENT_68___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_68___);
var ___CSS_LOADER_URL_REPLACEMENT_69___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_69___);
var ___CSS_LOADER_URL_REPLACEMENT_70___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_70___);
var ___CSS_LOADER_URL_REPLACEMENT_71___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_71___);
var ___CSS_LOADER_URL_REPLACEMENT_72___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_72___);
var ___CSS_LOADER_URL_REPLACEMENT_73___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_73___);
var ___CSS_LOADER_URL_REPLACEMENT_74___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_74___);
var ___CSS_LOADER_URL_REPLACEMENT_75___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_75___);
var ___CSS_LOADER_URL_REPLACEMENT_76___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_76___);
var ___CSS_LOADER_URL_REPLACEMENT_77___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_77___);
var ___CSS_LOADER_URL_REPLACEMENT_78___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_78___);
var ___CSS_LOADER_URL_REPLACEMENT_79___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_79___);
var ___CSS_LOADER_URL_REPLACEMENT_80___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_80___);
var ___CSS_LOADER_URL_REPLACEMENT_81___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_81___);
var ___CSS_LOADER_URL_REPLACEMENT_82___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_82___);
var ___CSS_LOADER_URL_REPLACEMENT_83___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_83___);
var ___CSS_LOADER_URL_REPLACEMENT_84___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_84___);
var ___CSS_LOADER_URL_REPLACEMENT_85___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_85___);
var ___CSS_LOADER_URL_REPLACEMENT_86___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_86___);
var ___CSS_LOADER_URL_REPLACEMENT_87___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_87___);
var ___CSS_LOADER_URL_REPLACEMENT_88___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_88___);
var ___CSS_LOADER_URL_REPLACEMENT_89___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_89___);
var ___CSS_LOADER_URL_REPLACEMENT_90___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_90___);
var ___CSS_LOADER_URL_REPLACEMENT_91___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_91___);
var ___CSS_LOADER_URL_REPLACEMENT_92___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_92___);
var ___CSS_LOADER_URL_REPLACEMENT_93___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_93___);
var ___CSS_LOADER_URL_REPLACEMENT_94___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_94___);
var ___CSS_LOADER_URL_REPLACEMENT_95___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_95___);
var ___CSS_LOADER_URL_REPLACEMENT_96___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_96___);
var ___CSS_LOADER_URL_REPLACEMENT_97___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_97___);
var ___CSS_LOADER_URL_REPLACEMENT_98___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_98___);
var ___CSS_LOADER_URL_REPLACEMENT_99___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_99___);
var ___CSS_LOADER_URL_REPLACEMENT_100___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_100___);
var ___CSS_LOADER_URL_REPLACEMENT_101___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_101___);
var ___CSS_LOADER_URL_REPLACEMENT_102___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_102___);
var ___CSS_LOADER_URL_REPLACEMENT_103___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_103___);
var ___CSS_LOADER_URL_REPLACEMENT_104___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_104___);
var ___CSS_LOADER_URL_REPLACEMENT_105___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_105___);
var ___CSS_LOADER_URL_REPLACEMENT_106___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_106___);
var ___CSS_LOADER_URL_REPLACEMENT_107___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_107___);
var ___CSS_LOADER_URL_REPLACEMENT_108___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_108___);
var ___CSS_LOADER_URL_REPLACEMENT_109___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_109___);
var ___CSS_LOADER_URL_REPLACEMENT_110___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_110___);
var ___CSS_LOADER_URL_REPLACEMENT_111___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_111___);
var ___CSS_LOADER_URL_REPLACEMENT_112___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_112___);
var ___CSS_LOADER_URL_REPLACEMENT_113___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_113___);
var ___CSS_LOADER_URL_REPLACEMENT_114___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_114___);
var ___CSS_LOADER_URL_REPLACEMENT_115___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_115___);
var ___CSS_LOADER_URL_REPLACEMENT_116___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_116___);
var ___CSS_LOADER_URL_REPLACEMENT_117___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_117___);
var ___CSS_LOADER_URL_REPLACEMENT_118___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_118___);
var ___CSS_LOADER_URL_REPLACEMENT_119___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_119___);
var ___CSS_LOADER_URL_REPLACEMENT_120___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_120___);
var ___CSS_LOADER_URL_REPLACEMENT_121___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_121___);
var ___CSS_LOADER_URL_REPLACEMENT_122___ = _builder_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_122___);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensureUiComponents() in @jupyterlab/buildutils */

/**
 * (DEPRECATED) Support for consuming icons as CSS background images
 */

/* Icons urls */

:root {
  --jp-icon-add-above: url(${___CSS_LOADER_URL_REPLACEMENT_0___});
  --jp-icon-add-below: url(${___CSS_LOADER_URL_REPLACEMENT_1___});
  --jp-icon-add: url(${___CSS_LOADER_URL_REPLACEMENT_2___});
  --jp-icon-audio: url(${___CSS_LOADER_URL_REPLACEMENT_3___});
  --jp-icon-bell: url(${___CSS_LOADER_URL_REPLACEMENT_4___});
  --jp-icon-breakpoint: url(${___CSS_LOADER_URL_REPLACEMENT_5___});
  --jp-icon-bug-dot: url(${___CSS_LOADER_URL_REPLACEMENT_6___});
  --jp-icon-bug: url(${___CSS_LOADER_URL_REPLACEMENT_7___});
  --jp-icon-build: url(${___CSS_LOADER_URL_REPLACEMENT_8___});
  --jp-icon-caret-down-empty-thin: url(${___CSS_LOADER_URL_REPLACEMENT_9___});
  --jp-icon-caret-down-empty: url(${___CSS_LOADER_URL_REPLACEMENT_10___});
  --jp-icon-caret-down: url(${___CSS_LOADER_URL_REPLACEMENT_11___});
  --jp-icon-caret-left: url(${___CSS_LOADER_URL_REPLACEMENT_12___});
  --jp-icon-caret-right: url(${___CSS_LOADER_URL_REPLACEMENT_13___});
  --jp-icon-caret-up-empty-thin: url(${___CSS_LOADER_URL_REPLACEMENT_14___});
  --jp-icon-caret-up: url(${___CSS_LOADER_URL_REPLACEMENT_15___});
  --jp-icon-case-sensitive: url(${___CSS_LOADER_URL_REPLACEMENT_16___});
  --jp-icon-check: url(${___CSS_LOADER_URL_REPLACEMENT_17___});
  --jp-icon-circle-empty: url(${___CSS_LOADER_URL_REPLACEMENT_18___});
  --jp-icon-circle: url(${___CSS_LOADER_URL_REPLACEMENT_19___});
  --jp-icon-cleaning: url(${___CSS_LOADER_URL_REPLACEMENT_20___});
  --jp-icon-clear: url(${___CSS_LOADER_URL_REPLACEMENT_21___});
  --jp-icon-close-all: url(${___CSS_LOADER_URL_REPLACEMENT_22___});
  --jp-icon-close: url(${___CSS_LOADER_URL_REPLACEMENT_23___});
  --jp-icon-code-check: url(${___CSS_LOADER_URL_REPLACEMENT_24___});
  --jp-icon-code: url(${___CSS_LOADER_URL_REPLACEMENT_25___});
  --jp-icon-collapse-all: url(${___CSS_LOADER_URL_REPLACEMENT_26___});
  --jp-icon-collapse: url(${___CSS_LOADER_URL_REPLACEMENT_27___});
  --jp-icon-console: url(${___CSS_LOADER_URL_REPLACEMENT_28___});
  --jp-icon-copy: url(${___CSS_LOADER_URL_REPLACEMENT_29___});
  --jp-icon-copyright: url(${___CSS_LOADER_URL_REPLACEMENT_30___});
  --jp-icon-cut: url(${___CSS_LOADER_URL_REPLACEMENT_31___});
  --jp-icon-delete: url(${___CSS_LOADER_URL_REPLACEMENT_32___});
  --jp-icon-dock-bottom: url(${___CSS_LOADER_URL_REPLACEMENT_33___});
  --jp-icon-dock-left: url(${___CSS_LOADER_URL_REPLACEMENT_34___});
  --jp-icon-dock-right: url(${___CSS_LOADER_URL_REPLACEMENT_35___});
  --jp-icon-dock-top: url(${___CSS_LOADER_URL_REPLACEMENT_36___});
  --jp-icon-dots: url(${___CSS_LOADER_URL_REPLACEMENT_37___});
  --jp-icon-download: url(${___CSS_LOADER_URL_REPLACEMENT_38___});
  --jp-icon-duplicate: url(${___CSS_LOADER_URL_REPLACEMENT_39___});
  --jp-icon-edit: url(${___CSS_LOADER_URL_REPLACEMENT_40___});
  --jp-icon-ellipses: url(${___CSS_LOADER_URL_REPLACEMENT_41___});
  --jp-icon-error: url(${___CSS_LOADER_URL_REPLACEMENT_42___});
  --jp-icon-exceptions: url(${___CSS_LOADER_URL_REPLACEMENT_43___});
  --jp-icon-expand-all: url(${___CSS_LOADER_URL_REPLACEMENT_44___});
  --jp-icon-expand: url(${___CSS_LOADER_URL_REPLACEMENT_45___});
  --jp-icon-extension: url(${___CSS_LOADER_URL_REPLACEMENT_46___});
  --jp-icon-fast-forward: url(${___CSS_LOADER_URL_REPLACEMENT_47___});
  --jp-icon-file-upload: url(${___CSS_LOADER_URL_REPLACEMENT_48___});
  --jp-icon-file: url(${___CSS_LOADER_URL_REPLACEMENT_49___});
  --jp-icon-filter-dot: url(${___CSS_LOADER_URL_REPLACEMENT_50___});
  --jp-icon-filter-list: url(${___CSS_LOADER_URL_REPLACEMENT_51___});
  --jp-icon-filter: url(${___CSS_LOADER_URL_REPLACEMENT_52___});
  --jp-icon-folder-favorite: url(${___CSS_LOADER_URL_REPLACEMENT_53___});
  --jp-icon-folder: url(${___CSS_LOADER_URL_REPLACEMENT_54___});
  --jp-icon-history: url(${___CSS_LOADER_URL_REPLACEMENT_55___});
  --jp-icon-home: url(${___CSS_LOADER_URL_REPLACEMENT_56___});
  --jp-icon-html5: url(${___CSS_LOADER_URL_REPLACEMENT_57___});
  --jp-icon-image: url(${___CSS_LOADER_URL_REPLACEMENT_58___});
  --jp-icon-info: url(${___CSS_LOADER_URL_REPLACEMENT_59___});
  --jp-icon-inspector: url(${___CSS_LOADER_URL_REPLACEMENT_60___});
  --jp-icon-json: url(${___CSS_LOADER_URL_REPLACEMENT_61___});
  --jp-icon-julia: url(${___CSS_LOADER_URL_REPLACEMENT_62___});
  --jp-icon-jupyter-favicon: url(${___CSS_LOADER_URL_REPLACEMENT_63___});
  --jp-icon-jupyter: url(${___CSS_LOADER_URL_REPLACEMENT_64___});
  --jp-icon-jupyterlab-wordmark: url(${___CSS_LOADER_URL_REPLACEMENT_65___});
  --jp-icon-kernel: url(${___CSS_LOADER_URL_REPLACEMENT_66___});
  --jp-icon-keyboard: url(${___CSS_LOADER_URL_REPLACEMENT_67___});
  --jp-icon-launch: url(${___CSS_LOADER_URL_REPLACEMENT_68___});
  --jp-icon-launcher: url(${___CSS_LOADER_URL_REPLACEMENT_69___});
  --jp-icon-line-form: url(${___CSS_LOADER_URL_REPLACEMENT_70___});
  --jp-icon-link: url(${___CSS_LOADER_URL_REPLACEMENT_71___});
  --jp-icon-list: url(${___CSS_LOADER_URL_REPLACEMENT_72___});
  --jp-icon-lock: url(${___CSS_LOADER_URL_REPLACEMENT_73___});
  --jp-icon-markdown: url(${___CSS_LOADER_URL_REPLACEMENT_74___});
  --jp-icon-mermaid: url(${___CSS_LOADER_URL_REPLACEMENT_75___});
  --jp-icon-move-down: url(${___CSS_LOADER_URL_REPLACEMENT_76___});
  --jp-icon-move-up: url(${___CSS_LOADER_URL_REPLACEMENT_77___});
  --jp-icon-new-folder: url(${___CSS_LOADER_URL_REPLACEMENT_78___});
  --jp-icon-not-trusted: url(${___CSS_LOADER_URL_REPLACEMENT_79___});
  --jp-icon-notebook: url(${___CSS_LOADER_URL_REPLACEMENT_80___});
  --jp-icon-numbering: url(${___CSS_LOADER_URL_REPLACEMENT_81___});
  --jp-icon-offline-bolt: url(${___CSS_LOADER_URL_REPLACEMENT_82___});
  --jp-icon-open-kernel-source: url(${___CSS_LOADER_URL_REPLACEMENT_83___});
  --jp-icon-palette: url(${___CSS_LOADER_URL_REPLACEMENT_84___});
  --jp-icon-paste: url(${___CSS_LOADER_URL_REPLACEMENT_85___});
  --jp-icon-pause: url(${___CSS_LOADER_URL_REPLACEMENT_86___});
  --jp-icon-pdf: url(${___CSS_LOADER_URL_REPLACEMENT_87___});
  --jp-icon-python: url(${___CSS_LOADER_URL_REPLACEMENT_88___});
  --jp-icon-r-kernel: url(${___CSS_LOADER_URL_REPLACEMENT_89___});
  --jp-icon-react: url(${___CSS_LOADER_URL_REPLACEMENT_90___});
  --jp-icon-redo: url(${___CSS_LOADER_URL_REPLACEMENT_91___});
  --jp-icon-refresh: url(${___CSS_LOADER_URL_REPLACEMENT_92___});
  --jp-icon-regex: url(${___CSS_LOADER_URL_REPLACEMENT_93___});
  --jp-icon-run: url(${___CSS_LOADER_URL_REPLACEMENT_94___});
  --jp-icon-running: url(${___CSS_LOADER_URL_REPLACEMENT_95___});
  --jp-icon-save: url(${___CSS_LOADER_URL_REPLACEMENT_96___});
  --jp-icon-search: url(${___CSS_LOADER_URL_REPLACEMENT_97___});
  --jp-icon-selected-breakpoint: url(${___CSS_LOADER_URL_REPLACEMENT_98___});
  --jp-icon-settings: url(${___CSS_LOADER_URL_REPLACEMENT_99___});
  --jp-icon-share: url(${___CSS_LOADER_URL_REPLACEMENT_100___});
  --jp-icon-spreadsheet: url(${___CSS_LOADER_URL_REPLACEMENT_101___});
  --jp-icon-step-into: url(${___CSS_LOADER_URL_REPLACEMENT_102___});
  --jp-icon-step-out: url(${___CSS_LOADER_URL_REPLACEMENT_103___});
  --jp-icon-step-over: url(${___CSS_LOADER_URL_REPLACEMENT_104___});
  --jp-icon-stop: url(${___CSS_LOADER_URL_REPLACEMENT_105___});
  --jp-icon-tab: url(${___CSS_LOADER_URL_REPLACEMENT_106___});
  --jp-icon-table-rows: url(${___CSS_LOADER_URL_REPLACEMENT_107___});
  --jp-icon-tag: url(${___CSS_LOADER_URL_REPLACEMENT_108___});
  --jp-icon-terminal: url(${___CSS_LOADER_URL_REPLACEMENT_109___});
  --jp-icon-text-editor: url(${___CSS_LOADER_URL_REPLACEMENT_110___});
  --jp-icon-toc: url(${___CSS_LOADER_URL_REPLACEMENT_111___});
  --jp-icon-tree-view: url(${___CSS_LOADER_URL_REPLACEMENT_112___});
  --jp-icon-trusted: url(${___CSS_LOADER_URL_REPLACEMENT_113___});
  --jp-icon-undo: url(${___CSS_LOADER_URL_REPLACEMENT_114___});
  --jp-icon-user: url(${___CSS_LOADER_URL_REPLACEMENT_115___});
  --jp-icon-users: url(${___CSS_LOADER_URL_REPLACEMENT_116___});
  --jp-icon-variable: url(${___CSS_LOADER_URL_REPLACEMENT_117___});
  --jp-icon-vega: url(${___CSS_LOADER_URL_REPLACEMENT_118___});
  --jp-icon-video: url(${___CSS_LOADER_URL_REPLACEMENT_119___});
  --jp-icon-view-breakpoint: url(${___CSS_LOADER_URL_REPLACEMENT_120___});
  --jp-icon-word: url(${___CSS_LOADER_URL_REPLACEMENT_121___});
  --jp-icon-yaml: url(${___CSS_LOADER_URL_REPLACEMENT_122___});
}

/* Icon CSS class declarations */

.jp-AddAboveIcon {
  background-image: var(--jp-icon-add-above);
}

.jp-AddBelowIcon {
  background-image: var(--jp-icon-add-below);
}

.jp-AddIcon {
  background-image: var(--jp-icon-add);
}

.jp-AudioIcon {
  background-image: var(--jp-icon-audio);
}

.jp-BellIcon {
  background-image: var(--jp-icon-bell);
}

.jp-BreakpointIcon {
  background-image: var(--jp-icon-breakpoint);
}

.jp-BugDotIcon {
  background-image: var(--jp-icon-bug-dot);
}

.jp-BugIcon {
  background-image: var(--jp-icon-bug);
}

.jp-BuildIcon {
  background-image: var(--jp-icon-build);
}

.jp-CaretDownEmptyIcon {
  background-image: var(--jp-icon-caret-down-empty);
}

.jp-CaretDownEmptyThinIcon {
  background-image: var(--jp-icon-caret-down-empty-thin);
}

.jp-CaretDownIcon {
  background-image: var(--jp-icon-caret-down);
}

.jp-CaretLeftIcon {
  background-image: var(--jp-icon-caret-left);
}

.jp-CaretRightIcon {
  background-image: var(--jp-icon-caret-right);
}

.jp-CaretUpEmptyThinIcon {
  background-image: var(--jp-icon-caret-up-empty-thin);
}

.jp-CaretUpIcon {
  background-image: var(--jp-icon-caret-up);
}

.jp-CaseSensitiveIcon {
  background-image: var(--jp-icon-case-sensitive);
}

.jp-CheckIcon {
  background-image: var(--jp-icon-check);
}

.jp-CircleEmptyIcon {
  background-image: var(--jp-icon-circle-empty);
}

.jp-CircleIcon {
  background-image: var(--jp-icon-circle);
}

.jp-CleaningIcon {
  background-image: var(--jp-icon-cleaning);
}

.jp-ClearIcon {
  background-image: var(--jp-icon-clear);
}

.jp-CloseAllIcon {
  background-image: var(--jp-icon-close-all);
}

.jp-CloseIcon {
  background-image: var(--jp-icon-close);
}

.jp-CodeCheckIcon {
  background-image: var(--jp-icon-code-check);
}

.jp-CodeIcon {
  background-image: var(--jp-icon-code);
}

.jp-CollapseAllIcon {
  background-image: var(--jp-icon-collapse-all);
}

.jp-CollapseIcon {
  background-image: var(--jp-icon-collapse);
}

.jp-ConsoleIcon {
  background-image: var(--jp-icon-console);
}

.jp-CopyIcon {
  background-image: var(--jp-icon-copy);
}

.jp-CopyrightIcon {
  background-image: var(--jp-icon-copyright);
}

.jp-CutIcon {
  background-image: var(--jp-icon-cut);
}

.jp-DeleteIcon {
  background-image: var(--jp-icon-delete);
}

.jp-DockBottomIcon {
  background-image: var(--jp-icon-dock-bottom);
}

.jp-DockLeftIcon {
  background-image: var(--jp-icon-dock-left);
}

.jp-DockRightIcon {
  background-image: var(--jp-icon-dock-right);
}

.jp-DockTopIcon {
  background-image: var(--jp-icon-dock-top);
}

.jp-DotsIcon {
  background-image: var(--jp-icon-dots);
}

.jp-DownloadIcon {
  background-image: var(--jp-icon-download);
}

.jp-DuplicateIcon {
  background-image: var(--jp-icon-duplicate);
}

.jp-EditIcon {
  background-image: var(--jp-icon-edit);
}

.jp-EllipsesIcon {
  background-image: var(--jp-icon-ellipses);
}

.jp-ErrorIcon {
  background-image: var(--jp-icon-error);
}

.jp-ExceptionsIcon {
  background-image: var(--jp-icon-exceptions);
}

.jp-ExpandAllIcon {
  background-image: var(--jp-icon-expand-all);
}

.jp-ExpandIcon {
  background-image: var(--jp-icon-expand);
}

.jp-ExtensionIcon {
  background-image: var(--jp-icon-extension);
}

.jp-FastForwardIcon {
  background-image: var(--jp-icon-fast-forward);
}

.jp-FileIcon {
  background-image: var(--jp-icon-file);
}

.jp-FileUploadIcon {
  background-image: var(--jp-icon-file-upload);
}

.jp-FilterDotIcon {
  background-image: var(--jp-icon-filter-dot);
}

.jp-FilterIcon {
  background-image: var(--jp-icon-filter);
}

.jp-FilterListIcon {
  background-image: var(--jp-icon-filter-list);
}

.jp-FolderFavoriteIcon {
  background-image: var(--jp-icon-folder-favorite);
}

.jp-FolderIcon {
  background-image: var(--jp-icon-folder);
}

.jp-HistoryIcon {
  background-image: var(--jp-icon-history);
}

.jp-HomeIcon {
  background-image: var(--jp-icon-home);
}

.jp-Html5Icon {
  background-image: var(--jp-icon-html5);
}

.jp-ImageIcon {
  background-image: var(--jp-icon-image);
}

.jp-InfoIcon {
  background-image: var(--jp-icon-info);
}

.jp-InspectorIcon {
  background-image: var(--jp-icon-inspector);
}

.jp-JsonIcon {
  background-image: var(--jp-icon-json);
}

.jp-JuliaIcon {
  background-image: var(--jp-icon-julia);
}

.jp-JupyterFaviconIcon {
  background-image: var(--jp-icon-jupyter-favicon);
}

.jp-JupyterIcon {
  background-image: var(--jp-icon-jupyter);
}

.jp-JupyterlabWordmarkIcon {
  background-image: var(--jp-icon-jupyterlab-wordmark);
}

.jp-KernelIcon {
  background-image: var(--jp-icon-kernel);
}

.jp-KeyboardIcon {
  background-image: var(--jp-icon-keyboard);
}

.jp-LaunchIcon {
  background-image: var(--jp-icon-launch);
}

.jp-LauncherIcon {
  background-image: var(--jp-icon-launcher);
}

.jp-LineFormIcon {
  background-image: var(--jp-icon-line-form);
}

.jp-LinkIcon {
  background-image: var(--jp-icon-link);
}

.jp-ListIcon {
  background-image: var(--jp-icon-list);
}

.jp-LockIcon {
  background-image: var(--jp-icon-lock);
}

.jp-MarkdownIcon {
  background-image: var(--jp-icon-markdown);
}

.jp-MermaidIcon {
  background-image: var(--jp-icon-mermaid);
}

.jp-MoveDownIcon {
  background-image: var(--jp-icon-move-down);
}

.jp-MoveUpIcon {
  background-image: var(--jp-icon-move-up);
}

.jp-NewFolderIcon {
  background-image: var(--jp-icon-new-folder);
}

.jp-NotTrustedIcon {
  background-image: var(--jp-icon-not-trusted);
}

.jp-NotebookIcon {
  background-image: var(--jp-icon-notebook);
}

.jp-NumberingIcon {
  background-image: var(--jp-icon-numbering);
}

.jp-OfflineBoltIcon {
  background-image: var(--jp-icon-offline-bolt);
}

.jp-OpenKernelSourceIcon {
  background-image: var(--jp-icon-open-kernel-source);
}

.jp-PaletteIcon {
  background-image: var(--jp-icon-palette);
}

.jp-PasteIcon {
  background-image: var(--jp-icon-paste);
}

.jp-PauseIcon {
  background-image: var(--jp-icon-pause);
}

.jp-PdfIcon {
  background-image: var(--jp-icon-pdf);
}

.jp-PythonIcon {
  background-image: var(--jp-icon-python);
}

.jp-RKernelIcon {
  background-image: var(--jp-icon-r-kernel);
}

.jp-ReactIcon {
  background-image: var(--jp-icon-react);
}

.jp-RedoIcon {
  background-image: var(--jp-icon-redo);
}

.jp-RefreshIcon {
  background-image: var(--jp-icon-refresh);
}

.jp-RegexIcon {
  background-image: var(--jp-icon-regex);
}

.jp-RunIcon {
  background-image: var(--jp-icon-run);
}

.jp-RunningIcon {
  background-image: var(--jp-icon-running);
}

.jp-SaveIcon {
  background-image: var(--jp-icon-save);
}

.jp-SearchIcon {
  background-image: var(--jp-icon-search);
}

.jp-SelectedBreakpointIcon {
  background-image: var(--jp-icon-selected-breakpoint);
}

.jp-SettingsIcon {
  background-image: var(--jp-icon-settings);
}

.jp-ShareIcon {
  background-image: var(--jp-icon-share);
}

.jp-SpreadsheetIcon {
  background-image: var(--jp-icon-spreadsheet);
}

.jp-StepIntoIcon {
  background-image: var(--jp-icon-step-into);
}

.jp-StepOutIcon {
  background-image: var(--jp-icon-step-out);
}

.jp-StepOverIcon {
  background-image: var(--jp-icon-step-over);
}

.jp-StopIcon {
  background-image: var(--jp-icon-stop);
}

.jp-TabIcon {
  background-image: var(--jp-icon-tab);
}

.jp-TableRowsIcon {
  background-image: var(--jp-icon-table-rows);
}

.jp-TagIcon {
  background-image: var(--jp-icon-tag);
}

.jp-TerminalIcon {
  background-image: var(--jp-icon-terminal);
}

.jp-TextEditorIcon {
  background-image: var(--jp-icon-text-editor);
}

.jp-TocIcon {
  background-image: var(--jp-icon-toc);
}

.jp-TreeViewIcon {
  background-image: var(--jp-icon-tree-view);
}

.jp-TrustedIcon {
  background-image: var(--jp-icon-trusted);
}

.jp-UndoIcon {
  background-image: var(--jp-icon-undo);
}

.jp-UserIcon {
  background-image: var(--jp-icon-user);
}

.jp-UsersIcon {
  background-image: var(--jp-icon-users);
}

.jp-VariableIcon {
  background-image: var(--jp-icon-variable);
}

.jp-VegaIcon {
  background-image: var(--jp-icon-vega);
}

.jp-VideoIcon {
  background-image: var(--jp-icon-video);
}

.jp-ViewBreakpointIcon {
  background-image: var(--jp-icon-view-breakpoint);
}

.jp-WordIcon {
  background-image: var(--jp-icon-word);
}

.jp-YamlIcon {
  background-image: var(--jp-icon-yaml);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/deprecated.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E,mFAAmF;;AAEnF;;EAEE;;AAEF,eAAe;;AAEf;EACE,4DAAuD;EACvD,4DAAuD;EACvD,sDAA2C;EAC3C,wDAAgD;EAChD,uDAA+C;EAC/C,6DAA0D;EAC1D,0DAAmD;EACnD,sDAA2C;EAC3C,wDAA+C;EAC/C,wEAA6E;EAC7E,oEAAmE;EACnE,8DAAuD;EACvD,8DAAuD;EACvD,+DAAyD;EACzD,uEAAyE;EACzE,4DAAmD;EACnD,kEAAgE;EAChE,yDAA+C;EAC/C,gEAA6D;EAC7D,0DAAiD;EACjD,4DAAqD;EACrD,yDAA+C;EAC/C,6DAAwD;EACxD,yDAA+C;EAC/C,8DAAqD;EACrD,wDAA6C;EAC7C,gEAA6D;EAC7D,4DAAoD;EACpD,2DAAoD;EACpD,wDAA6C;EAC7C,6DAAwD;EACxD,uDAA2C;EAC3C,0DAAiD;EACjD,+DAA2D;EAC3D,6DAAuD;EACvD,8DAAyD;EACzD,4DAAqD;EACrD,wDAA6C;EAC7C,4DAAqD;EACrD,6DAAuD;EACvD,wDAA6C;EAC7C,4DAAqD;EACrD,yDAAuC;EACvC,8DAA0D;EAC1D,8DAAyD;EACzD,0DAAgD;EAChD,6DAAuD;EACvD,gEAA6D;EAC7D,+DAA2D;EAC3D,wDAA8C;EAC9C,8DAAwD;EACxD,+DAA2D;EAC3D,0DAAgD;EAChD,mEAAoE;EACpE,0DAAkD;EAClD,2DAA2C;EAC3C,wDAA8C;EAC9C,yDAAgD;EAChD,yDAAgD;EAChD,wDAAqC;EACrC,6DAAwD;EACxD,wDAA8C;EAC9C,yDAAgD;EAChD,mEAAmE;EACnE,2DAAmD;EACnD,uEAA2E;EAC3E,0DAAmD;EACnD,4DAAsD;EACtD,0DAAiD;EACjD,4DAAsD;EACtD,6DAAyD;EACzD,wDAA6C;EAC7C,wDAA+C;EAC/C,wDAAqC;EACrC,4DAAsD;EACtD,2DAAoD;EACpD,6DAAuD;EACvD,2DAAmD;EACnD,8DAAyD;EACzD,+DAA6D;EAC7D,4DAAsD;EACtD,6DAAuD;EACvD,gEAA6D;EAC7D,sEAA0E;EAC1E,2DAAmD;EACnD,yDAA+C;EAC/C,yDAAgD;EAChD,uDAA4C;EAC5C,0DAAkD;EAClD,4DAAsD;EACtD,yDAAgD;EAChD,wDAA6C;EAC7C,2DAAmD;EACnD,yDAA8C;EAC9C,uDAA2C;EAC3C,2DAAmD;EACnD,wDAA6C;EAC7C,0DAAiD;EACjD,uEAA4E;EAC5E,4DAAsD;EACtD,0DAA+C;EAC/C,gEAA4D;EAC5D,8DAAwD;EACxD,6DAAsD;EACtD,8DAAwD;EACxD,yDAA6C;EAC7C,wDAA2C;EAC3C,+DAAyD;EACzD,wDAA2C;EAC3C,6DAAuD;EACvD,gEAA4D;EAC5D,wDAA2C;EAC3C,8DAAuD;EACvD,4DAAqD;EACrD,yDAA6C;EAC7C,yDAA6C;EAC7C,0DAA+C;EAC/C,6DAAsD;EACtD,yDAA8C;EAC9C,0DAAgD;EAChD,oEAAoE;EACpE,yDAA4C;EAC5C,yDAA8C;AAChD;;AAEA,gCAAgC;;AAEhC;EACE,0CAA0C;AAC5C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,iDAAiD;AACnD;;AAEA;EACE,sDAAsD;AACxD;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,oDAAoD;AACtD;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,+CAA+C;AACjD;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,gDAAgD;AAClD;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,gDAAgD;AAClD;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,oDAAoD;AACtD;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,mDAAmD;AACrD;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,oDAAoD;AACtD;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,2CAA2C;AAC7C;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,gDAAgD;AAClD;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* This file was auto-generated by ensureUiComponents() in @jupyterlab/buildutils */\n\n/**\n * (DEPRECATED) Support for consuming icons as CSS background images\n */\n\n/* Icons urls */\n\n:root {\n  --jp-icon-add-above: url('icons/toolbar/add-above.svg');\n  --jp-icon-add-below: url('icons/toolbar/add-below.svg');\n  --jp-icon-add: url('icons/toolbar/add.svg');\n  --jp-icon-audio: url('icons/filetype/audio.svg');\n  --jp-icon-bell: url('icons/statusbar/bell.svg');\n  --jp-icon-breakpoint: url('icons/debugger/breakpoint.svg');\n  --jp-icon-bug-dot: url('icons/toolbar/bug-dot.svg');\n  --jp-icon-bug: url('icons/toolbar/bug.svg');\n  --jp-icon-build: url('icons/sidebar/build.svg');\n  --jp-icon-caret-down-empty-thin: url('icons/arrow/caret-down-empty-thin.svg');\n  --jp-icon-caret-down-empty: url('icons/arrow/caret-down-empty.svg');\n  --jp-icon-caret-down: url('icons/arrow/caret-down.svg');\n  --jp-icon-caret-left: url('icons/arrow/caret-left.svg');\n  --jp-icon-caret-right: url('icons/arrow/caret-right.svg');\n  --jp-icon-caret-up-empty-thin: url('icons/arrow/caret-up-empty-thin.svg');\n  --jp-icon-caret-up: url('icons/arrow/caret-up.svg');\n  --jp-icon-case-sensitive: url('icons/search/case-sensitive.svg');\n  --jp-icon-check: url('icons/toolbar/check.svg');\n  --jp-icon-circle-empty: url('icons/toolbar/circle-empty.svg');\n  --jp-icon-circle: url('icons/toolbar/circle.svg');\n  --jp-icon-cleaning: url('icons/toolbar/cleaning.svg');\n  --jp-icon-clear: url('icons/toolbar/clear.svg');\n  --jp-icon-close-all: url('icons/debugger/close-all.svg');\n  --jp-icon-close: url('icons/toolbar/close.svg');\n  --jp-icon-code-check: url('icons/lsp/code-check.svg');\n  --jp-icon-code: url('icons/toolbar/code.svg');\n  --jp-icon-collapse-all: url('icons/toolbar/collapse-all.svg');\n  --jp-icon-collapse: url('icons/output/collapse.svg');\n  --jp-icon-console: url('icons/filetype/console.svg');\n  --jp-icon-copy: url('icons/toolbar/copy.svg');\n  --jp-icon-copyright: url('icons/licenses/copyright.svg');\n  --jp-icon-cut: url('icons/toolbar/cut.svg');\n  --jp-icon-delete: url('icons/toolbar/delete.svg');\n  --jp-icon-dock-bottom: url('icons/toolbar/dock-bottom.svg');\n  --jp-icon-dock-left: url('icons/toolbar/dock-left.svg');\n  --jp-icon-dock-right: url('icons/toolbar/dock-right.svg');\n  --jp-icon-dock-top: url('icons/toolbar/dock-top.svg');\n  --jp-icon-dots: url('icons/toolbar/dots.svg');\n  --jp-icon-download: url('icons/toolbar/download.svg');\n  --jp-icon-duplicate: url('icons/toolbar/duplicate.svg');\n  --jp-icon-edit: url('icons/toolbar/edit.svg');\n  --jp-icon-ellipses: url('icons/toolbar/ellipses.svg');\n  --jp-icon-error: url('icons/error.svg');\n  --jp-icon-exceptions: url('icons/debugger/exceptions.svg');\n  --jp-icon-expand-all: url('icons/toolbar/expand-all.svg');\n  --jp-icon-expand: url('icons/output/expand.svg');\n  --jp-icon-extension: url('icons/sidebar/extension.svg');\n  --jp-icon-fast-forward: url('icons/toolbar/fast-forward.svg');\n  --jp-icon-file-upload: url('icons/toolbar/file-upload.svg');\n  --jp-icon-file: url('icons/filetype/file.svg');\n  --jp-icon-filter-dot: url('icons/search/filter-dot.svg');\n  --jp-icon-filter-list: url('icons/toolbar/filter-list.svg');\n  --jp-icon-filter: url('icons/search/filter.svg');\n  --jp-icon-folder-favorite: url('icons/filetype/folder-favorite.svg');\n  --jp-icon-folder: url('icons/filetype/folder.svg');\n  --jp-icon-history: url('icons/history.svg');\n  --jp-icon-home: url('icons/filetype/home.svg');\n  --jp-icon-html5: url('icons/filetype/html5.svg');\n  --jp-icon-image: url('icons/filetype/image.svg');\n  --jp-icon-info: url('icons/info.svg');\n  --jp-icon-inspector: url('icons/filetype/inspector.svg');\n  --jp-icon-json: url('icons/filetype/json.svg');\n  --jp-icon-julia: url('icons/filetype/julia.svg');\n  --jp-icon-jupyter-favicon: url('icons/jupyter/jupyter-favicon.svg');\n  --jp-icon-jupyter: url('icons/jupyter/jupyter.svg');\n  --jp-icon-jupyterlab-wordmark: url('icons/jupyter/jupyterlab-wordmark.svg');\n  --jp-icon-kernel: url('icons/statusbar/kernel.svg');\n  --jp-icon-keyboard: url('icons/filetype/keyboard.svg');\n  --jp-icon-launch: url('icons/toolbar/launch.svg');\n  --jp-icon-launcher: url('icons/filetype/launcher.svg');\n  --jp-icon-line-form: url('icons/statusbar/line-form.svg');\n  --jp-icon-link: url('icons/toolbar/link.svg');\n  --jp-icon-list: url('icons/statusbar/list.svg');\n  --jp-icon-lock: url('icons/lock.svg');\n  --jp-icon-markdown: url('icons/filetype/markdown.svg');\n  --jp-icon-mermaid: url('icons/filetype/mermaid.svg');\n  --jp-icon-move-down: url('icons/toolbar/move-down.svg');\n  --jp-icon-move-up: url('icons/toolbar/move-up.svg');\n  --jp-icon-new-folder: url('icons/toolbar/new-folder.svg');\n  --jp-icon-not-trusted: url('icons/statusbar/not-trusted.svg');\n  --jp-icon-notebook: url('icons/filetype/notebook.svg');\n  --jp-icon-numbering: url('icons/toolbar/numbering.svg');\n  --jp-icon-offline-bolt: url('icons/toolbar/offline-bolt.svg');\n  --jp-icon-open-kernel-source: url('icons/debugger/open-kernel-source.svg');\n  --jp-icon-palette: url('icons/sidebar/palette.svg');\n  --jp-icon-paste: url('icons/toolbar/paste.svg');\n  --jp-icon-pause: url('icons/debugger/pause.svg');\n  --jp-icon-pdf: url('icons/filetype/pdf.svg');\n  --jp-icon-python: url('icons/filetype/python.svg');\n  --jp-icon-r-kernel: url('icons/filetype/r-kernel.svg');\n  --jp-icon-react: url('icons/filetype/react.svg');\n  --jp-icon-redo: url('icons/toolbar/redo.svg');\n  --jp-icon-refresh: url('icons/toolbar/refresh.svg');\n  --jp-icon-regex: url('icons/search/regex.svg');\n  --jp-icon-run: url('icons/toolbar/run.svg');\n  --jp-icon-running: url('icons/sidebar/running.svg');\n  --jp-icon-save: url('icons/toolbar/save.svg');\n  --jp-icon-search: url('icons/toolbar/search.svg');\n  --jp-icon-selected-breakpoint: url('icons/debugger/selected-breakpoint.svg');\n  --jp-icon-settings: url('icons/filetype/settings.svg');\n  --jp-icon-share: url('icons/sidebar/share.svg');\n  --jp-icon-spreadsheet: url('icons/filetype/spreadsheet.svg');\n  --jp-icon-step-into: url('icons/debugger/step-into.svg');\n  --jp-icon-step-out: url('icons/debugger/step-out.svg');\n  --jp-icon-step-over: url('icons/debugger/step-over.svg');\n  --jp-icon-stop: url('icons/toolbar/stop.svg');\n  --jp-icon-tab: url('icons/sidebar/tab.svg');\n  --jp-icon-table-rows: url('icons/toolbar/table-rows.svg');\n  --jp-icon-tag: url('icons/toolbar/tag.svg');\n  --jp-icon-terminal: url('icons/statusbar/terminal.svg');\n  --jp-icon-text-editor: url('icons/filetype/text-editor.svg');\n  --jp-icon-toc: url('icons/sidebar/toc.svg');\n  --jp-icon-tree-view: url('icons/toolbar/tree-view.svg');\n  --jp-icon-trusted: url('icons/statusbar/trusted.svg');\n  --jp-icon-undo: url('icons/toolbar/undo.svg');\n  --jp-icon-user: url('icons/sidebar/user.svg');\n  --jp-icon-users: url('icons/sidebar/users.svg');\n  --jp-icon-variable: url('icons/debugger/variable.svg');\n  --jp-icon-vega: url('icons/filetype/vega.svg');\n  --jp-icon-video: url('icons/filetype/video.svg');\n  --jp-icon-view-breakpoint: url('icons/debugger/view-breakpoint.svg');\n  --jp-icon-word: url('icons/search/word.svg');\n  --jp-icon-yaml: url('icons/filetype/yaml.svg');\n}\n\n/* Icon CSS class declarations */\n\n.jp-AddAboveIcon {\n  background-image: var(--jp-icon-add-above);\n}\n\n.jp-AddBelowIcon {\n  background-image: var(--jp-icon-add-below);\n}\n\n.jp-AddIcon {\n  background-image: var(--jp-icon-add);\n}\n\n.jp-AudioIcon {\n  background-image: var(--jp-icon-audio);\n}\n\n.jp-BellIcon {\n  background-image: var(--jp-icon-bell);\n}\n\n.jp-BreakpointIcon {\n  background-image: var(--jp-icon-breakpoint);\n}\n\n.jp-BugDotIcon {\n  background-image: var(--jp-icon-bug-dot);\n}\n\n.jp-BugIcon {\n  background-image: var(--jp-icon-bug);\n}\n\n.jp-BuildIcon {\n  background-image: var(--jp-icon-build);\n}\n\n.jp-CaretDownEmptyIcon {\n  background-image: var(--jp-icon-caret-down-empty);\n}\n\n.jp-CaretDownEmptyThinIcon {\n  background-image: var(--jp-icon-caret-down-empty-thin);\n}\n\n.jp-CaretDownIcon {\n  background-image: var(--jp-icon-caret-down);\n}\n\n.jp-CaretLeftIcon {\n  background-image: var(--jp-icon-caret-left);\n}\n\n.jp-CaretRightIcon {\n  background-image: var(--jp-icon-caret-right);\n}\n\n.jp-CaretUpEmptyThinIcon {\n  background-image: var(--jp-icon-caret-up-empty-thin);\n}\n\n.jp-CaretUpIcon {\n  background-image: var(--jp-icon-caret-up);\n}\n\n.jp-CaseSensitiveIcon {\n  background-image: var(--jp-icon-case-sensitive);\n}\n\n.jp-CheckIcon {\n  background-image: var(--jp-icon-check);\n}\n\n.jp-CircleEmptyIcon {\n  background-image: var(--jp-icon-circle-empty);\n}\n\n.jp-CircleIcon {\n  background-image: var(--jp-icon-circle);\n}\n\n.jp-CleaningIcon {\n  background-image: var(--jp-icon-cleaning);\n}\n\n.jp-ClearIcon {\n  background-image: var(--jp-icon-clear);\n}\n\n.jp-CloseAllIcon {\n  background-image: var(--jp-icon-close-all);\n}\n\n.jp-CloseIcon {\n  background-image: var(--jp-icon-close);\n}\n\n.jp-CodeCheckIcon {\n  background-image: var(--jp-icon-code-check);\n}\n\n.jp-CodeIcon {\n  background-image: var(--jp-icon-code);\n}\n\n.jp-CollapseAllIcon {\n  background-image: var(--jp-icon-collapse-all);\n}\n\n.jp-CollapseIcon {\n  background-image: var(--jp-icon-collapse);\n}\n\n.jp-ConsoleIcon {\n  background-image: var(--jp-icon-console);\n}\n\n.jp-CopyIcon {\n  background-image: var(--jp-icon-copy);\n}\n\n.jp-CopyrightIcon {\n  background-image: var(--jp-icon-copyright);\n}\n\n.jp-CutIcon {\n  background-image: var(--jp-icon-cut);\n}\n\n.jp-DeleteIcon {\n  background-image: var(--jp-icon-delete);\n}\n\n.jp-DockBottomIcon {\n  background-image: var(--jp-icon-dock-bottom);\n}\n\n.jp-DockLeftIcon {\n  background-image: var(--jp-icon-dock-left);\n}\n\n.jp-DockRightIcon {\n  background-image: var(--jp-icon-dock-right);\n}\n\n.jp-DockTopIcon {\n  background-image: var(--jp-icon-dock-top);\n}\n\n.jp-DotsIcon {\n  background-image: var(--jp-icon-dots);\n}\n\n.jp-DownloadIcon {\n  background-image: var(--jp-icon-download);\n}\n\n.jp-DuplicateIcon {\n  background-image: var(--jp-icon-duplicate);\n}\n\n.jp-EditIcon {\n  background-image: var(--jp-icon-edit);\n}\n\n.jp-EllipsesIcon {\n  background-image: var(--jp-icon-ellipses);\n}\n\n.jp-ErrorIcon {\n  background-image: var(--jp-icon-error);\n}\n\n.jp-ExceptionsIcon {\n  background-image: var(--jp-icon-exceptions);\n}\n\n.jp-ExpandAllIcon {\n  background-image: var(--jp-icon-expand-all);\n}\n\n.jp-ExpandIcon {\n  background-image: var(--jp-icon-expand);\n}\n\n.jp-ExtensionIcon {\n  background-image: var(--jp-icon-extension);\n}\n\n.jp-FastForwardIcon {\n  background-image: var(--jp-icon-fast-forward);\n}\n\n.jp-FileIcon {\n  background-image: var(--jp-icon-file);\n}\n\n.jp-FileUploadIcon {\n  background-image: var(--jp-icon-file-upload);\n}\n\n.jp-FilterDotIcon {\n  background-image: var(--jp-icon-filter-dot);\n}\n\n.jp-FilterIcon {\n  background-image: var(--jp-icon-filter);\n}\n\n.jp-FilterListIcon {\n  background-image: var(--jp-icon-filter-list);\n}\n\n.jp-FolderFavoriteIcon {\n  background-image: var(--jp-icon-folder-favorite);\n}\n\n.jp-FolderIcon {\n  background-image: var(--jp-icon-folder);\n}\n\n.jp-HistoryIcon {\n  background-image: var(--jp-icon-history);\n}\n\n.jp-HomeIcon {\n  background-image: var(--jp-icon-home);\n}\n\n.jp-Html5Icon {\n  background-image: var(--jp-icon-html5);\n}\n\n.jp-ImageIcon {\n  background-image: var(--jp-icon-image);\n}\n\n.jp-InfoIcon {\n  background-image: var(--jp-icon-info);\n}\n\n.jp-InspectorIcon {\n  background-image: var(--jp-icon-inspector);\n}\n\n.jp-JsonIcon {\n  background-image: var(--jp-icon-json);\n}\n\n.jp-JuliaIcon {\n  background-image: var(--jp-icon-julia);\n}\n\n.jp-JupyterFaviconIcon {\n  background-image: var(--jp-icon-jupyter-favicon);\n}\n\n.jp-JupyterIcon {\n  background-image: var(--jp-icon-jupyter);\n}\n\n.jp-JupyterlabWordmarkIcon {\n  background-image: var(--jp-icon-jupyterlab-wordmark);\n}\n\n.jp-KernelIcon {\n  background-image: var(--jp-icon-kernel);\n}\n\n.jp-KeyboardIcon {\n  background-image: var(--jp-icon-keyboard);\n}\n\n.jp-LaunchIcon {\n  background-image: var(--jp-icon-launch);\n}\n\n.jp-LauncherIcon {\n  background-image: var(--jp-icon-launcher);\n}\n\n.jp-LineFormIcon {\n  background-image: var(--jp-icon-line-form);\n}\n\n.jp-LinkIcon {\n  background-image: var(--jp-icon-link);\n}\n\n.jp-ListIcon {\n  background-image: var(--jp-icon-list);\n}\n\n.jp-LockIcon {\n  background-image: var(--jp-icon-lock);\n}\n\n.jp-MarkdownIcon {\n  background-image: var(--jp-icon-markdown);\n}\n\n.jp-MermaidIcon {\n  background-image: var(--jp-icon-mermaid);\n}\n\n.jp-MoveDownIcon {\n  background-image: var(--jp-icon-move-down);\n}\n\n.jp-MoveUpIcon {\n  background-image: var(--jp-icon-move-up);\n}\n\n.jp-NewFolderIcon {\n  background-image: var(--jp-icon-new-folder);\n}\n\n.jp-NotTrustedIcon {\n  background-image: var(--jp-icon-not-trusted);\n}\n\n.jp-NotebookIcon {\n  background-image: var(--jp-icon-notebook);\n}\n\n.jp-NumberingIcon {\n  background-image: var(--jp-icon-numbering);\n}\n\n.jp-OfflineBoltIcon {\n  background-image: var(--jp-icon-offline-bolt);\n}\n\n.jp-OpenKernelSourceIcon {\n  background-image: var(--jp-icon-open-kernel-source);\n}\n\n.jp-PaletteIcon {\n  background-image: var(--jp-icon-palette);\n}\n\n.jp-PasteIcon {\n  background-image: var(--jp-icon-paste);\n}\n\n.jp-PauseIcon {\n  background-image: var(--jp-icon-pause);\n}\n\n.jp-PdfIcon {\n  background-image: var(--jp-icon-pdf);\n}\n\n.jp-PythonIcon {\n  background-image: var(--jp-icon-python);\n}\n\n.jp-RKernelIcon {\n  background-image: var(--jp-icon-r-kernel);\n}\n\n.jp-ReactIcon {\n  background-image: var(--jp-icon-react);\n}\n\n.jp-RedoIcon {\n  background-image: var(--jp-icon-redo);\n}\n\n.jp-RefreshIcon {\n  background-image: var(--jp-icon-refresh);\n}\n\n.jp-RegexIcon {\n  background-image: var(--jp-icon-regex);\n}\n\n.jp-RunIcon {\n  background-image: var(--jp-icon-run);\n}\n\n.jp-RunningIcon {\n  background-image: var(--jp-icon-running);\n}\n\n.jp-SaveIcon {\n  background-image: var(--jp-icon-save);\n}\n\n.jp-SearchIcon {\n  background-image: var(--jp-icon-search);\n}\n\n.jp-SelectedBreakpointIcon {\n  background-image: var(--jp-icon-selected-breakpoint);\n}\n\n.jp-SettingsIcon {\n  background-image: var(--jp-icon-settings);\n}\n\n.jp-ShareIcon {\n  background-image: var(--jp-icon-share);\n}\n\n.jp-SpreadsheetIcon {\n  background-image: var(--jp-icon-spreadsheet);\n}\n\n.jp-StepIntoIcon {\n  background-image: var(--jp-icon-step-into);\n}\n\n.jp-StepOutIcon {\n  background-image: var(--jp-icon-step-out);\n}\n\n.jp-StepOverIcon {\n  background-image: var(--jp-icon-step-over);\n}\n\n.jp-StopIcon {\n  background-image: var(--jp-icon-stop);\n}\n\n.jp-TabIcon {\n  background-image: var(--jp-icon-tab);\n}\n\n.jp-TableRowsIcon {\n  background-image: var(--jp-icon-table-rows);\n}\n\n.jp-TagIcon {\n  background-image: var(--jp-icon-tag);\n}\n\n.jp-TerminalIcon {\n  background-image: var(--jp-icon-terminal);\n}\n\n.jp-TextEditorIcon {\n  background-image: var(--jp-icon-text-editor);\n}\n\n.jp-TocIcon {\n  background-image: var(--jp-icon-toc);\n}\n\n.jp-TreeViewIcon {\n  background-image: var(--jp-icon-tree-view);\n}\n\n.jp-TrustedIcon {\n  background-image: var(--jp-icon-trusted);\n}\n\n.jp-UndoIcon {\n  background-image: var(--jp-icon-undo);\n}\n\n.jp-UserIcon {\n  background-image: var(--jp-icon-user);\n}\n\n.jp-UsersIcon {\n  background-image: var(--jp-icon-users);\n}\n\n.jp-VariableIcon {\n  background-image: var(--jp-icon-variable);\n}\n\n.jp-VegaIcon {\n  background-image: var(--jp-icon-vega);\n}\n\n.jp-VideoIcon {\n  background-image: var(--jp-icon-video);\n}\n\n.jp-ViewBreakpointIcon {\n  background-image: var(--jp-icon-view-breakpoint);\n}\n\n.jp-WordIcon {\n  background-image: var(--jp-icon-word);\n}\n\n.jp-YamlIcon {\n  background-image: var(--jp-icon-yaml);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 13220:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * (DEPRECATED) Support for consuming icons as CSS background images
 */

.jp-Icon,
.jp-MaterialIcon {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px;
  min-width: 16px;
  min-height: 16px;
}

.jp-Icon-cover {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/**
 * (DEPRECATED) Support for specific CSS icon sizes
 */

.jp-Icon-16 {
  background-size: 16px;
  min-width: 16px;
  min-height: 16px;
}

.jp-Icon-18 {
  background-size: 18px;
  min-width: 18px;
  min-height: 18px;
}

.jp-Icon-20 {
  background-size: 20px;
  min-width: 20px;
  min-height: 20px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/deprecatedExtra.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;EAEE;;AAEF;;EAEE,2BAA2B;EAC3B,4BAA4B;EAC5B,qBAAqB;EACrB,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,2BAA2B;EAC3B,4BAA4B;EAC5B,sBAAsB;AACxB;;AAEA;;EAEE;;AAEF;EACE,qBAAqB;EACrB,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,qBAAqB;EACrB,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,qBAAqB;EACrB,eAAe;EACf,gBAAgB;AAClB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/**\n * (DEPRECATED) Support for consuming icons as CSS background images\n */\n\n.jp-Icon,\n.jp-MaterialIcon {\n  background-position: center;\n  background-repeat: no-repeat;\n  background-size: 16px;\n  min-width: 16px;\n  min-height: 16px;\n}\n\n.jp-Icon-cover {\n  background-position: center;\n  background-repeat: no-repeat;\n  background-size: cover;\n}\n\n/**\n * (DEPRECATED) Support for specific CSS icon sizes\n */\n\n.jp-Icon-16 {\n  background-size: 16px;\n  min-width: 16px;\n  min-height: 16px;\n}\n\n.jp-Icon-18 {\n  background-size: 18px;\n  min-width: 18px;\n  min-height: 18px;\n}\n\n.jp-Icon-20 {\n  background-size: 20px;\n  min-width: 20px;\n  min-height: 20px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 82663:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-HoverBox {
  position: fixed;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/hoverbox.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,eAAe;AACjB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-HoverBox {\n  position: fixed;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 52309:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * Support for icons as inline SVG HTMLElements
 */

/* recolor the primary elements of an icon */
.jp-icon0[fill] {
  fill: var(--jp-inverse-layout-color0);
}

.jp-icon1[fill] {
  fill: var(--jp-inverse-layout-color1);
}

.jp-icon2[fill] {
  fill: var(--jp-inverse-layout-color2);
}

.jp-icon3[fill] {
  fill: var(--jp-inverse-layout-color3);
}

.jp-icon4[fill] {
  fill: var(--jp-inverse-layout-color4);
}

.jp-icon0[stroke] {
  stroke: var(--jp-inverse-layout-color0);
}

.jp-icon1[stroke] {
  stroke: var(--jp-inverse-layout-color1);
}

.jp-icon2[stroke] {
  stroke: var(--jp-inverse-layout-color2);
}

.jp-icon3[stroke] {
  stroke: var(--jp-inverse-layout-color3);
}

.jp-icon4[stroke] {
  stroke: var(--jp-inverse-layout-color4);
}

/* recolor the accent elements of an icon */
.jp-icon-accent0[fill] {
  fill: var(--jp-layout-color0);
}

.jp-icon-accent1[fill] {
  fill: var(--jp-layout-color1);
}

.jp-icon-accent2[fill] {
  fill: var(--jp-layout-color2);
}

.jp-icon-accent3[fill] {
  fill: var(--jp-layout-color3);
}

.jp-icon-accent4[fill] {
  fill: var(--jp-layout-color4);
}

.jp-icon-accent0[stroke] {
  stroke: var(--jp-layout-color0);
}

.jp-icon-accent1[stroke] {
  stroke: var(--jp-layout-color1);
}

.jp-icon-accent2[stroke] {
  stroke: var(--jp-layout-color2);
}

.jp-icon-accent3[stroke] {
  stroke: var(--jp-layout-color3);
}

.jp-icon-accent4[stroke] {
  stroke: var(--jp-layout-color4);
}

/* set the color of an icon to transparent */
.jp-icon-none[fill] {
  fill: none;
}

.jp-icon-none[stroke] {
  stroke: none;
}

/* brand icon colors. Same for light and dark */
.jp-icon-brand0[fill] {
  fill: var(--jp-brand-color0);
}

.jp-icon-brand1[fill] {
  fill: var(--jp-brand-color1);
}

.jp-icon-brand2[fill] {
  fill: var(--jp-brand-color2);
}

.jp-icon-brand3[fill] {
  fill: var(--jp-brand-color3);
}

.jp-icon-brand4[fill] {
  fill: var(--jp-brand-color4);
}

.jp-icon-brand0[stroke] {
  stroke: var(--jp-brand-color0);
}

.jp-icon-brand1[stroke] {
  stroke: var(--jp-brand-color1);
}

.jp-icon-brand2[stroke] {
  stroke: var(--jp-brand-color2);
}

.jp-icon-brand3[stroke] {
  stroke: var(--jp-brand-color3);
}

.jp-icon-brand4[stroke] {
  stroke: var(--jp-brand-color4);
}

/* warn icon colors. Same for light and dark */
.jp-icon-warn0[fill] {
  fill: var(--jp-warn-color0);
}

.jp-icon-warn1[fill] {
  fill: var(--jp-warn-color1);
}

.jp-icon-warn2[fill] {
  fill: var(--jp-warn-color2);
}

.jp-icon-warn3[fill] {
  fill: var(--jp-warn-color3);
}

.jp-icon-warn0[stroke] {
  stroke: var(--jp-warn-color0);
}

.jp-icon-warn1[stroke] {
  stroke: var(--jp-warn-color1);
}

.jp-icon-warn2[stroke] {
  stroke: var(--jp-warn-color2);
}

.jp-icon-warn3[stroke] {
  stroke: var(--jp-warn-color3);
}

/* icon colors that contrast well with each other and most backgrounds */
.jp-icon-contrast0[fill] {
  fill: var(--jp-icon-contrast-color0);
}

.jp-icon-contrast1[fill] {
  fill: var(--jp-icon-contrast-color1);
}

.jp-icon-contrast2[fill] {
  fill: var(--jp-icon-contrast-color2);
}

.jp-icon-contrast3[fill] {
  fill: var(--jp-icon-contrast-color3);
}

.jp-icon-contrast0[stroke] {
  stroke: var(--jp-icon-contrast-color0);
}

.jp-icon-contrast1[stroke] {
  stroke: var(--jp-icon-contrast-color1);
}

.jp-icon-contrast2[stroke] {
  stroke: var(--jp-icon-contrast-color2);
}

.jp-icon-contrast3[stroke] {
  stroke: var(--jp-icon-contrast-color3);
}

.jp-icon-dot[fill] {
  fill: var(--jp-warn-color0);
}

.jp-jupyter-icon-color[fill] {
  fill: var(--jp-jupyter-icon-color, var(--jp-warn-color0));
}

.jp-notebook-icon-color[fill] {
  fill: var(--jp-notebook-icon-color, var(--jp-warn-color0));
}

.jp-json-icon-color[fill] {
  fill: var(--jp-json-icon-color, var(--jp-warn-color1));
}

.jp-console-icon-color[fill] {
  fill: var(--jp-console-icon-color, white);
}

.jp-console-icon-background-color[fill] {
  fill: var(--jp-console-icon-background-color, var(--jp-brand-color1));
}

.jp-terminal-icon-color[fill] {
  fill: var(--jp-terminal-icon-color, var(--jp-layout-color2));
}

.jp-terminal-icon-background-color[fill] {
  fill: var(
    --jp-terminal-icon-background-color,
    var(--jp-inverse-layout-color2)
  );
}

.jp-text-editor-icon-color[fill] {
  fill: var(--jp-text-editor-icon-color, var(--jp-inverse-layout-color3));
}

.jp-inspector-icon-color[fill] {
  fill: var(--jp-inspector-icon-color, var(--jp-inverse-layout-color3));
}

/* CSS for icons in selected filebrowser listing items */
.jp-DirListing-item.jp-mod-selected .jp-icon-selectable[fill] {
  fill: #fff;
}

.jp-DirListing-item.jp-mod-selected .jp-icon-selectable-inverse[fill] {
  fill: var(--jp-brand-color1);
}

/* stylelint-disable selector-max-class, selector-max-compound-selectors */

/**
* TODO: come up with non css-hack solution for showing the busy icon on top
*  of the close icon
* CSS for complex behavior of close icon of tabs in the main area tabbar
*/
.lm-DockPanel-tabBar
  .lm-TabBar-tab.lm-mod-closable.jp-mod-dirty
  > .lm-TabBar-tabCloseIcon
  > :not(:hover)
  > .jp-icon3[fill] {
  fill: none;
}

.lm-DockPanel-tabBar
  .lm-TabBar-tab.lm-mod-closable.jp-mod-dirty
  > .lm-TabBar-tabCloseIcon
  > :not(:hover)
  > .jp-icon-busy[fill] {
  fill: var(--jp-inverse-layout-color3);
}

/* stylelint-enable selector-max-class, selector-max-compound-selectors */

/* CSS for icons in status bar */
#jp-main-statusbar .jp-mod-selected .jp-icon-selectable[fill] {
  fill: #fff;
}

#jp-main-statusbar .jp-mod-selected .jp-icon-selectable-inverse[fill] {
  fill: var(--jp-brand-color1);
}

/* special handling for splash icon CSS. While the theme CSS reloads during
   splash, the splash icon can loose theming. To prevent that, we set a
   default for its color variable */
:root {
  --jp-warn-color0: var(--md-orange-700, #f57c00);
}

/* not sure what to do with this one, used in filebrowser listing */
.jp-DragIcon {
  margin-right: 4px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/icons.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;EAEE;;AAEF,4CAA4C;AAC5C;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA,2CAA2C;AAC3C;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA,4CAA4C;AAC5C;EACE,UAAU;AACZ;;AAEA;EACE,YAAY;AACd;;AAEA,+CAA+C;AAC/C;EACE,4BAA4B;AAC9B;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,8BAA8B;AAChC;;AAEA,8CAA8C;AAC9C;EACE,2BAA2B;AAC7B;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA,wEAAwE;AACxE;EACE,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,0DAA0D;AAC5D;;AAEA;EACE,sDAAsD;AACxD;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,qEAAqE;AACvE;;AAEA;EACE,4DAA4D;AAC9D;;AAEA;EACE;;;GAGC;AACH;;AAEA;EACE,uEAAuE;AACzE;;AAEA;EACE,qEAAqE;AACvE;;AAEA,wDAAwD;AACxD;EACE,UAAU;AACZ;;AAEA;EACE,4BAA4B;AAC9B;;AAEA,0EAA0E;;AAE1E;;;;CAIC;AACD;;;;;EAKE,UAAU;AACZ;;AAEA;;;;;EAKE,qCAAqC;AACvC;;AAEA,yEAAyE;;AAEzE,gCAAgC;AAChC;EACE,UAAU;AACZ;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;;mCAEmC;AACnC;EACE,+CAA+C;AACjD;;AAEA,mEAAmE;AACnE;EACE,iBAAiB;AACnB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/**\n * Support for icons as inline SVG HTMLElements\n */\n\n/* recolor the primary elements of an icon */\n.jp-icon0[fill] {\n  fill: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon1[fill] {\n  fill: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon2[fill] {\n  fill: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon3[fill] {\n  fill: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon4[fill] {\n  fill: var(--jp-inverse-layout-color4);\n}\n\n.jp-icon0[stroke] {\n  stroke: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon1[stroke] {\n  stroke: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon2[stroke] {\n  stroke: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon3[stroke] {\n  stroke: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon4[stroke] {\n  stroke: var(--jp-inverse-layout-color4);\n}\n\n/* recolor the accent elements of an icon */\n.jp-icon-accent0[fill] {\n  fill: var(--jp-layout-color0);\n}\n\n.jp-icon-accent1[fill] {\n  fill: var(--jp-layout-color1);\n}\n\n.jp-icon-accent2[fill] {\n  fill: var(--jp-layout-color2);\n}\n\n.jp-icon-accent3[fill] {\n  fill: var(--jp-layout-color3);\n}\n\n.jp-icon-accent4[fill] {\n  fill: var(--jp-layout-color4);\n}\n\n.jp-icon-accent0[stroke] {\n  stroke: var(--jp-layout-color0);\n}\n\n.jp-icon-accent1[stroke] {\n  stroke: var(--jp-layout-color1);\n}\n\n.jp-icon-accent2[stroke] {\n  stroke: var(--jp-layout-color2);\n}\n\n.jp-icon-accent3[stroke] {\n  stroke: var(--jp-layout-color3);\n}\n\n.jp-icon-accent4[stroke] {\n  stroke: var(--jp-layout-color4);\n}\n\n/* set the color of an icon to transparent */\n.jp-icon-none[fill] {\n  fill: none;\n}\n\n.jp-icon-none[stroke] {\n  stroke: none;\n}\n\n/* brand icon colors. Same for light and dark */\n.jp-icon-brand0[fill] {\n  fill: var(--jp-brand-color0);\n}\n\n.jp-icon-brand1[fill] {\n  fill: var(--jp-brand-color1);\n}\n\n.jp-icon-brand2[fill] {\n  fill: var(--jp-brand-color2);\n}\n\n.jp-icon-brand3[fill] {\n  fill: var(--jp-brand-color3);\n}\n\n.jp-icon-brand4[fill] {\n  fill: var(--jp-brand-color4);\n}\n\n.jp-icon-brand0[stroke] {\n  stroke: var(--jp-brand-color0);\n}\n\n.jp-icon-brand1[stroke] {\n  stroke: var(--jp-brand-color1);\n}\n\n.jp-icon-brand2[stroke] {\n  stroke: var(--jp-brand-color2);\n}\n\n.jp-icon-brand3[stroke] {\n  stroke: var(--jp-brand-color3);\n}\n\n.jp-icon-brand4[stroke] {\n  stroke: var(--jp-brand-color4);\n}\n\n/* warn icon colors. Same for light and dark */\n.jp-icon-warn0[fill] {\n  fill: var(--jp-warn-color0);\n}\n\n.jp-icon-warn1[fill] {\n  fill: var(--jp-warn-color1);\n}\n\n.jp-icon-warn2[fill] {\n  fill: var(--jp-warn-color2);\n}\n\n.jp-icon-warn3[fill] {\n  fill: var(--jp-warn-color3);\n}\n\n.jp-icon-warn0[stroke] {\n  stroke: var(--jp-warn-color0);\n}\n\n.jp-icon-warn1[stroke] {\n  stroke: var(--jp-warn-color1);\n}\n\n.jp-icon-warn2[stroke] {\n  stroke: var(--jp-warn-color2);\n}\n\n.jp-icon-warn3[stroke] {\n  stroke: var(--jp-warn-color3);\n}\n\n/* icon colors that contrast well with each other and most backgrounds */\n.jp-icon-contrast0[fill] {\n  fill: var(--jp-icon-contrast-color0);\n}\n\n.jp-icon-contrast1[fill] {\n  fill: var(--jp-icon-contrast-color1);\n}\n\n.jp-icon-contrast2[fill] {\n  fill: var(--jp-icon-contrast-color2);\n}\n\n.jp-icon-contrast3[fill] {\n  fill: var(--jp-icon-contrast-color3);\n}\n\n.jp-icon-contrast0[stroke] {\n  stroke: var(--jp-icon-contrast-color0);\n}\n\n.jp-icon-contrast1[stroke] {\n  stroke: var(--jp-icon-contrast-color1);\n}\n\n.jp-icon-contrast2[stroke] {\n  stroke: var(--jp-icon-contrast-color2);\n}\n\n.jp-icon-contrast3[stroke] {\n  stroke: var(--jp-icon-contrast-color3);\n}\n\n.jp-icon-dot[fill] {\n  fill: var(--jp-warn-color0);\n}\n\n.jp-jupyter-icon-color[fill] {\n  fill: var(--jp-jupyter-icon-color, var(--jp-warn-color0));\n}\n\n.jp-notebook-icon-color[fill] {\n  fill: var(--jp-notebook-icon-color, var(--jp-warn-color0));\n}\n\n.jp-json-icon-color[fill] {\n  fill: var(--jp-json-icon-color, var(--jp-warn-color1));\n}\n\n.jp-console-icon-color[fill] {\n  fill: var(--jp-console-icon-color, white);\n}\n\n.jp-console-icon-background-color[fill] {\n  fill: var(--jp-console-icon-background-color, var(--jp-brand-color1));\n}\n\n.jp-terminal-icon-color[fill] {\n  fill: var(--jp-terminal-icon-color, var(--jp-layout-color2));\n}\n\n.jp-terminal-icon-background-color[fill] {\n  fill: var(\n    --jp-terminal-icon-background-color,\n    var(--jp-inverse-layout-color2)\n  );\n}\n\n.jp-text-editor-icon-color[fill] {\n  fill: var(--jp-text-editor-icon-color, var(--jp-inverse-layout-color3));\n}\n\n.jp-inspector-icon-color[fill] {\n  fill: var(--jp-inspector-icon-color, var(--jp-inverse-layout-color3));\n}\n\n/* CSS for icons in selected filebrowser listing items */\n.jp-DirListing-item.jp-mod-selected .jp-icon-selectable[fill] {\n  fill: #fff;\n}\n\n.jp-DirListing-item.jp-mod-selected .jp-icon-selectable-inverse[fill] {\n  fill: var(--jp-brand-color1);\n}\n\n/* stylelint-disable selector-max-class, selector-max-compound-selectors */\n\n/**\n* TODO: come up with non css-hack solution for showing the busy icon on top\n*  of the close icon\n* CSS for complex behavior of close icon of tabs in the main area tabbar\n*/\n.lm-DockPanel-tabBar\n  .lm-TabBar-tab.lm-mod-closable.jp-mod-dirty\n  > .lm-TabBar-tabCloseIcon\n  > :not(:hover)\n  > .jp-icon3[fill] {\n  fill: none;\n}\n\n.lm-DockPanel-tabBar\n  .lm-TabBar-tab.lm-mod-closable.jp-mod-dirty\n  > .lm-TabBar-tabCloseIcon\n  > :not(:hover)\n  > .jp-icon-busy[fill] {\n  fill: var(--jp-inverse-layout-color3);\n}\n\n/* stylelint-enable selector-max-class, selector-max-compound-selectors */\n\n/* CSS for icons in status bar */\n#jp-main-statusbar .jp-mod-selected .jp-icon-selectable[fill] {\n  fill: #fff;\n}\n\n#jp-main-statusbar .jp-mod-selected .jp-icon-selectable-inverse[fill] {\n  fill: var(--jp-brand-color1);\n}\n\n/* special handling for splash icon CSS. While the theme CSS reloads during\n   splash, the splash icon can loose theming. To prevent that, we set a\n   default for its color variable */\n:root {\n  --jp-warn-color0: var(--md-orange-700, #f57c00);\n}\n\n/* not sure what to do with this one, used in filebrowser listing */\n.jp-DragIcon {\n  margin-right: 4px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 20426:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * Support for alt colors for icons as inline SVG HTMLElements
 */

/* alt recolor the primary elements of an icon */
.jp-icon-alt .jp-icon0[fill] {
  fill: var(--jp-layout-color0);
}

.jp-icon-alt .jp-icon1[fill] {
  fill: var(--jp-layout-color1);
}

.jp-icon-alt .jp-icon2[fill] {
  fill: var(--jp-layout-color2);
}

.jp-icon-alt .jp-icon3[fill] {
  fill: var(--jp-layout-color3);
}

.jp-icon-alt .jp-icon4[fill] {
  fill: var(--jp-layout-color4);
}

.jp-icon-alt .jp-icon0[stroke] {
  stroke: var(--jp-layout-color0);
}

.jp-icon-alt .jp-icon1[stroke] {
  stroke: var(--jp-layout-color1);
}

.jp-icon-alt .jp-icon2[stroke] {
  stroke: var(--jp-layout-color2);
}

.jp-icon-alt .jp-icon3[stroke] {
  stroke: var(--jp-layout-color3);
}

.jp-icon-alt .jp-icon4[stroke] {
  stroke: var(--jp-layout-color4);
}

/* alt recolor the accent elements of an icon */
.jp-icon-alt .jp-icon-accent0[fill] {
  fill: var(--jp-inverse-layout-color0);
}

.jp-icon-alt .jp-icon-accent1[fill] {
  fill: var(--jp-inverse-layout-color1);
}

.jp-icon-alt .jp-icon-accent2[fill] {
  fill: var(--jp-inverse-layout-color2);
}

.jp-icon-alt .jp-icon-accent3[fill] {
  fill: var(--jp-inverse-layout-color3);
}

.jp-icon-alt .jp-icon-accent4[fill] {
  fill: var(--jp-inverse-layout-color4);
}

.jp-icon-alt .jp-icon-accent0[stroke] {
  stroke: var(--jp-inverse-layout-color0);
}

.jp-icon-alt .jp-icon-accent1[stroke] {
  stroke: var(--jp-inverse-layout-color1);
}

.jp-icon-alt .jp-icon-accent2[stroke] {
  stroke: var(--jp-inverse-layout-color2);
}

.jp-icon-alt .jp-icon-accent3[stroke] {
  stroke: var(--jp-inverse-layout-color3);
}

.jp-icon-alt .jp-icon-accent4[stroke] {
  stroke: var(--jp-inverse-layout-color4);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/iconsalt.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;EAEE;;AAEF,gDAAgD;AAChD;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA,+CAA+C;AAC/C;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/**\n * Support for alt colors for icons as inline SVG HTMLElements\n */\n\n/* alt recolor the primary elements of an icon */\n.jp-icon-alt .jp-icon0[fill] {\n  fill: var(--jp-layout-color0);\n}\n\n.jp-icon-alt .jp-icon1[fill] {\n  fill: var(--jp-layout-color1);\n}\n\n.jp-icon-alt .jp-icon2[fill] {\n  fill: var(--jp-layout-color2);\n}\n\n.jp-icon-alt .jp-icon3[fill] {\n  fill: var(--jp-layout-color3);\n}\n\n.jp-icon-alt .jp-icon4[fill] {\n  fill: var(--jp-layout-color4);\n}\n\n.jp-icon-alt .jp-icon0[stroke] {\n  stroke: var(--jp-layout-color0);\n}\n\n.jp-icon-alt .jp-icon1[stroke] {\n  stroke: var(--jp-layout-color1);\n}\n\n.jp-icon-alt .jp-icon2[stroke] {\n  stroke: var(--jp-layout-color2);\n}\n\n.jp-icon-alt .jp-icon3[stroke] {\n  stroke: var(--jp-layout-color3);\n}\n\n.jp-icon-alt .jp-icon4[stroke] {\n  stroke: var(--jp-layout-color4);\n}\n\n/* alt recolor the accent elements of an icon */\n.jp-icon-alt .jp-icon-accent0[fill] {\n  fill: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon-alt .jp-icon-accent1[fill] {\n  fill: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon-alt .jp-icon-accent2[fill] {\n  fill: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon-alt .jp-icon-accent3[fill] {\n  fill: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon-alt .jp-icon-accent4[fill] {\n  fill: var(--jp-inverse-layout-color4);\n}\n\n.jp-icon-alt .jp-icon-accent0[stroke] {\n  stroke: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon-alt .jp-icon-accent1[stroke] {\n  stroke: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon-alt .jp-icon-accent2[stroke] {\n  stroke: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon-alt .jp-icon-accent3[stroke] {\n  stroke: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon-alt .jp-icon-accent4[stroke] {\n  stroke: var(--jp-inverse-layout-color4);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 71892:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-icon-hoverShow:not(:hover) .jp-icon-hoverShow-content {
  display: none !important;
}

/**
 * Support for hover colors for icons as inline SVG HTMLElements
 */

/**
 * regular colors
 */

/* recolor the primary elements of an icon */
.jp-icon-hover :hover .jp-icon0-hover[fill] {
  fill: var(--jp-inverse-layout-color0);
}

.jp-icon-hover :hover .jp-icon1-hover[fill] {
  fill: var(--jp-inverse-layout-color1);
}

.jp-icon-hover :hover .jp-icon2-hover[fill] {
  fill: var(--jp-inverse-layout-color2);
}

.jp-icon-hover :hover .jp-icon3-hover[fill] {
  fill: var(--jp-inverse-layout-color3);
}

.jp-icon-hover :hover .jp-icon4-hover[fill] {
  fill: var(--jp-inverse-layout-color4);
}

.jp-icon-hover :hover .jp-icon0-hover[stroke] {
  stroke: var(--jp-inverse-layout-color0);
}

.jp-icon-hover :hover .jp-icon1-hover[stroke] {
  stroke: var(--jp-inverse-layout-color1);
}

.jp-icon-hover :hover .jp-icon2-hover[stroke] {
  stroke: var(--jp-inverse-layout-color2);
}

.jp-icon-hover :hover .jp-icon3-hover[stroke] {
  stroke: var(--jp-inverse-layout-color3);
}

.jp-icon-hover :hover .jp-icon4-hover[stroke] {
  stroke: var(--jp-inverse-layout-color4);
}

/* recolor the accent elements of an icon */
.jp-icon-hover :hover .jp-icon-accent0-hover[fill] {
  fill: var(--jp-layout-color0);
}

.jp-icon-hover :hover .jp-icon-accent1-hover[fill] {
  fill: var(--jp-layout-color1);
}

.jp-icon-hover :hover .jp-icon-accent2-hover[fill] {
  fill: var(--jp-layout-color2);
}

.jp-icon-hover :hover .jp-icon-accent3-hover[fill] {
  fill: var(--jp-layout-color3);
}

.jp-icon-hover :hover .jp-icon-accent4-hover[fill] {
  fill: var(--jp-layout-color4);
}

.jp-icon-hover :hover .jp-icon-accent0-hover[stroke] {
  stroke: var(--jp-layout-color0);
}

.jp-icon-hover :hover .jp-icon-accent1-hover[stroke] {
  stroke: var(--jp-layout-color1);
}

.jp-icon-hover :hover .jp-icon-accent2-hover[stroke] {
  stroke: var(--jp-layout-color2);
}

.jp-icon-hover :hover .jp-icon-accent3-hover[stroke] {
  stroke: var(--jp-layout-color3);
}

.jp-icon-hover :hover .jp-icon-accent4-hover[stroke] {
  stroke: var(--jp-layout-color4);
}

/* set the color of an icon to transparent */
.jp-icon-hover :hover .jp-icon-none-hover[fill] {
  fill: none;
}

.jp-icon-hover :hover .jp-icon-none-hover[stroke] {
  stroke: none;
}

/**
 * inverse colors
 */

/* inverse recolor the primary elements of an icon */
.jp-icon-hover.jp-icon-alt :hover .jp-icon0-hover[fill] {
  fill: var(--jp-layout-color0);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon1-hover[fill] {
  fill: var(--jp-layout-color1);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon2-hover[fill] {
  fill: var(--jp-layout-color2);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon3-hover[fill] {
  fill: var(--jp-layout-color3);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon4-hover[fill] {
  fill: var(--jp-layout-color4);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon0-hover[stroke] {
  stroke: var(--jp-layout-color0);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon1-hover[stroke] {
  stroke: var(--jp-layout-color1);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon2-hover[stroke] {
  stroke: var(--jp-layout-color2);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon3-hover[stroke] {
  stroke: var(--jp-layout-color3);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon4-hover[stroke] {
  stroke: var(--jp-layout-color4);
}

/* inverse recolor the accent elements of an icon */
.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent0-hover[fill] {
  fill: var(--jp-inverse-layout-color0);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent1-hover[fill] {
  fill: var(--jp-inverse-layout-color1);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent2-hover[fill] {
  fill: var(--jp-inverse-layout-color2);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent3-hover[fill] {
  fill: var(--jp-inverse-layout-color3);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent4-hover[fill] {
  fill: var(--jp-inverse-layout-color4);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent0-hover[stroke] {
  stroke: var(--jp-inverse-layout-color0);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent1-hover[stroke] {
  stroke: var(--jp-inverse-layout-color1);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent2-hover[stroke] {
  stroke: var(--jp-inverse-layout-color2);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent3-hover[stroke] {
  stroke: var(--jp-inverse-layout-color3);
}

.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent4-hover[stroke] {
  stroke: var(--jp-inverse-layout-color4);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/iconshover.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,wBAAwB;AAC1B;;AAEA;;EAEE;;AAEF;;EAEE;;AAEF,4CAA4C;AAC5C;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA,2CAA2C;AAC3C;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA,4CAA4C;AAC5C;EACE,UAAU;AACZ;;AAEA;EACE,YAAY;AACd;;AAEA;;EAEE;;AAEF,oDAAoD;AACpD;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA,mDAAmD;AACnD;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;AACzC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-icon-hoverShow:not(:hover) .jp-icon-hoverShow-content {\n  display: none !important;\n}\n\n/**\n * Support for hover colors for icons as inline SVG HTMLElements\n */\n\n/**\n * regular colors\n */\n\n/* recolor the primary elements of an icon */\n.jp-icon-hover :hover .jp-icon0-hover[fill] {\n  fill: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon-hover :hover .jp-icon1-hover[fill] {\n  fill: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon-hover :hover .jp-icon2-hover[fill] {\n  fill: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon-hover :hover .jp-icon3-hover[fill] {\n  fill: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon-hover :hover .jp-icon4-hover[fill] {\n  fill: var(--jp-inverse-layout-color4);\n}\n\n.jp-icon-hover :hover .jp-icon0-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon-hover :hover .jp-icon1-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon-hover :hover .jp-icon2-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon-hover :hover .jp-icon3-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon-hover :hover .jp-icon4-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color4);\n}\n\n/* recolor the accent elements of an icon */\n.jp-icon-hover :hover .jp-icon-accent0-hover[fill] {\n  fill: var(--jp-layout-color0);\n}\n\n.jp-icon-hover :hover .jp-icon-accent1-hover[fill] {\n  fill: var(--jp-layout-color1);\n}\n\n.jp-icon-hover :hover .jp-icon-accent2-hover[fill] {\n  fill: var(--jp-layout-color2);\n}\n\n.jp-icon-hover :hover .jp-icon-accent3-hover[fill] {\n  fill: var(--jp-layout-color3);\n}\n\n.jp-icon-hover :hover .jp-icon-accent4-hover[fill] {\n  fill: var(--jp-layout-color4);\n}\n\n.jp-icon-hover :hover .jp-icon-accent0-hover[stroke] {\n  stroke: var(--jp-layout-color0);\n}\n\n.jp-icon-hover :hover .jp-icon-accent1-hover[stroke] {\n  stroke: var(--jp-layout-color1);\n}\n\n.jp-icon-hover :hover .jp-icon-accent2-hover[stroke] {\n  stroke: var(--jp-layout-color2);\n}\n\n.jp-icon-hover :hover .jp-icon-accent3-hover[stroke] {\n  stroke: var(--jp-layout-color3);\n}\n\n.jp-icon-hover :hover .jp-icon-accent4-hover[stroke] {\n  stroke: var(--jp-layout-color4);\n}\n\n/* set the color of an icon to transparent */\n.jp-icon-hover :hover .jp-icon-none-hover[fill] {\n  fill: none;\n}\n\n.jp-icon-hover :hover .jp-icon-none-hover[stroke] {\n  stroke: none;\n}\n\n/**\n * inverse colors\n */\n\n/* inverse recolor the primary elements of an icon */\n.jp-icon-hover.jp-icon-alt :hover .jp-icon0-hover[fill] {\n  fill: var(--jp-layout-color0);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon1-hover[fill] {\n  fill: var(--jp-layout-color1);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon2-hover[fill] {\n  fill: var(--jp-layout-color2);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon3-hover[fill] {\n  fill: var(--jp-layout-color3);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon4-hover[fill] {\n  fill: var(--jp-layout-color4);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon0-hover[stroke] {\n  stroke: var(--jp-layout-color0);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon1-hover[stroke] {\n  stroke: var(--jp-layout-color1);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon2-hover[stroke] {\n  stroke: var(--jp-layout-color2);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon3-hover[stroke] {\n  stroke: var(--jp-layout-color3);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon4-hover[stroke] {\n  stroke: var(--jp-layout-color4);\n}\n\n/* inverse recolor the accent elements of an icon */\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent0-hover[fill] {\n  fill: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent1-hover[fill] {\n  fill: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent2-hover[fill] {\n  fill: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent3-hover[fill] {\n  fill: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent4-hover[fill] {\n  fill: var(--jp-inverse-layout-color4);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent0-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color0);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent1-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color1);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent2-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color2);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent3-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color3);\n}\n\n.jp-icon-hover.jp-icon-alt :hover .jp-icon-accent4-hover[stroke] {\n  stroke: var(--jp-inverse-layout-color4);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 55986:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-IFrame {
  width: 100%;
  height: 100%;
}

.jp-IFrame > iframe {
  border: none;
}

/*
When drag events occur, \`lm-mod-override-cursor\` is added to the body.
Because iframes steal all cursor events, the following two rules are necessary
to suppress pointer events while resize drags are occurring. There may be a
better solution to this problem.
*/
body.lm-mod-override-cursor .jp-IFrame {
  position: relative;
}

body.lm-mod-override-cursor .jp-IFrame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/iframe.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;;;;;CAKC;AACD;EACE,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,QAAQ;EACR,SAAS;EACT,uBAAuB;AACzB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-IFrame {\n  width: 100%;\n  height: 100%;\n}\n\n.jp-IFrame > iframe {\n  border: none;\n}\n\n/*\nWhen drag events occur, `lm-mod-override-cursor` is added to the body.\nBecause iframes steal all cursor events, the following two rules are necessary\nto suppress pointer events while resize drags are occurring. There may be a\nbetter solution to this problem.\n*/\nbody.lm-mod-override-cursor .jp-IFrame {\n  position: relative;\n}\n\nbody.lm-mod-override-cursor .jp-IFrame::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background: transparent;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 83101:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-FormGroup-content fieldset {
  border: none;
  padding: 0;
  min-width: 0;
  width: 100%;
}

/* stylelint-disable selector-max-type */

.jp-FormGroup-content fieldset .jp-inputFieldWrapper > input,
.jp-FormGroup-content fieldset .jp-inputFieldWrapper > select,
.jp-FormGroup-content fieldset .jp-inputFieldWrapper > textarea {
  font-size: var(--jp-content-font-size2);
  border-color: var(--jp-input-border-color);
  border-style: solid;
  border-radius: var(--jp-border-radius);
  border-width: 1px;
  padding: 6px 8px;
  background: none;
  color: var(--jp-ui-font-color0);
  height: inherit;
}

.jp-FormGroup-content .jp-inputFieldWrapper > select > option {
  background-color: var(--jp-layout-color1);
}

.jp-FormGroup-content fieldset input[type='checkbox'] {
  position: relative;
  top: 2px;
  margin-left: 0;
}

.jp-FormGroup-content button.jp-mod-styled {
  cursor: pointer;
}

.jp-FormGroup-content .checkbox label {
  cursor: pointer;
  font-size: var(--jp-content-font-size1);
}

.jp-FormGroup-content .jp-root > fieldset > legend {
  display: none;
}

.jp-FormGroup-content .jp-root > fieldset > p {
  display: none;
}

/** copy of \`input.jp-mod-styled:focus\` style */
.jp-FormGroup-content fieldset input:focus,
.jp-FormGroup-content fieldset select:focus {
  -moz-outline-radius: unset;
  outline: var(--jp-border-width) solid var(--jp-input-active-border-color);
  outline-offset: -1px;
  box-shadow: var(--jp-input-box-shadow);
}

.jp-FormGroup-content fieldset input:hover:not(:focus),
.jp-FormGroup-content fieldset select:hover:not(:focus) {
  background-color: var(--jp-border-color2);
}

/* stylelint-enable selector-max-type */

.jp-FormGroup-content .checkbox .field-description {
  /* Disable default description field for checkbox:
   because other widgets do not have description fields,
   we add descriptions to each widget on the field level.
  */
  display: none;
}

.jp-FormGroup-content #root__description {
  display: none;
}

.jp-FormGroup-content .jp-modifiedIndicator {
  width: 5px;
  background-color: var(--jp-brand-color2);
  margin-top: 0;
  margin-left: calc(var(--jp-private-settingeditor-modifier-indent) * -1);
  flex-shrink: 0;
}

.jp-FormGroup-content .jp-modifiedIndicator.jp-errorIndicator {
  background-color: var(--jp-error-color0);
  margin-right: 0.5em;
}

/* RJSF ARRAY style */

.jp-arrayFieldWrapper legend {
  font-size: var(--jp-content-font-size2);
  color: var(--jp-ui-font-color0);
  flex-basis: 100%;
  padding: 4px 0;
  font-weight: var(--jp-content-heading-font-weight);
  border-bottom: 1px solid var(--jp-border-color2);
}

.jp-arrayFieldWrapper .field-description {
  padding: 4px 0;
  white-space: pre-wrap;
}

.jp-arrayFieldWrapper .array-item {
  width: 100%;
  border: 1px solid var(--jp-border-color2);
  border-radius: 4px;
  margin: 4px;
}

.jp-ArrayOperations {
  display: flex;
  margin-left: 8px;
}

.jp-ArrayOperationsButton {
  margin: 2px;
}

.jp-ArrayOperationsButton .jp-icon3[fill] {
  fill: var(--jp-ui-font-color0);
}

button.jp-ArrayOperationsButton.jp-mod-styled:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* RJSF form validation error */

.jp-FormGroup-content .validationErrors {
  color: var(--jp-error-color0);
}

/* Hide panel level error as duplicated the field level error */
.jp-FormGroup-content .panel.errors {
  display: none;
}

/* RJSF normal content (settings-editor) */

.jp-FormGroup-contentNormal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.jp-FormGroup-contentNormal .jp-FormGroup-contentItem {
  margin-left: 7px;
  color: var(--jp-ui-font-color0);
}

.jp-FormGroup-contentNormal .jp-FormGroup-description {
  flex-basis: 100%;
  padding: 4px 7px;
  white-space: pre-wrap;
}

.jp-FormGroup-contentNormal .jp-FormGroup-default {
  flex-basis: 100%;
  padding: 4px 7px;
}

.jp-FormGroup-contentNormal .jp-FormGroup-fieldLabel {
  font-size: var(--jp-content-font-size1);
  font-weight: normal;
  min-width: 120px;
}

.jp-FormGroup-contentNormal fieldset:not(:first-child) {
  margin-left: 7px;
}

.jp-FormGroup-contentNormal .field-array-of-string .array-item {
  /* Display \`jp-ArrayOperations\` buttons side-by-side with content except
    for small screens where flex-wrap will place them one below the other.
  */
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.jp-FormGroup-contentNormal .jp-objectFieldWrapper .form-group {
  padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);
  margin-top: 2px;
}

/* RJSF compact content (metadata-form) */

.jp-FormGroup-content.jp-FormGroup-contentCompact {
  width: 100%;
}

.jp-FormGroup-contentCompact .form-group {
  display: flex;
  padding: 0.5em 0.2em 0.5em 0;
}

.jp-FormGroup-contentCompact
  .jp-FormGroup-compactTitle
  .jp-FormGroup-description {
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color2);
}

.jp-FormGroup-contentCompact .jp-FormGroup-fieldLabel {
  padding-bottom: 0.3em;
}

.jp-FormGroup-contentCompact .jp-inputFieldWrapper .form-control {
  width: 100%;
  box-sizing: border-box;
}

.jp-FormGroup-contentCompact .jp-arrayFieldWrapper .jp-FormGroup-compactTitle {
  padding-bottom: 7px;
}

.jp-FormGroup-contentCompact
  .jp-objectFieldWrapper
  .jp-objectFieldWrapper
  .form-group {
  padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);
  margin-top: 2px;
}

.jp-FormGroup-contentCompact ul.error-detail {
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
  padding-inline-start: 1em;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/rjsfTemplates.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,WAAW;AACb;;AAEA,wCAAwC;;AAExC;;;EAGE,uCAAuC;EACvC,0CAA0C;EAC1C,mBAAmB;EACnB,sCAAsC;EACtC,iBAAiB;EACjB,gBAAgB;EAChB,gBAAgB;EAChB,+BAA+B;EAC/B,eAAe;AACjB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,kBAAkB;EAClB,QAAQ;EACR,cAAc;AAChB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;EACf,uCAAuC;AACzC;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;AACf;;AAEA,+CAA+C;AAC/C;;EAEE,0BAA0B;EAC1B,yEAAyE;EACzE,oBAAoB;EACpB,sCAAsC;AACxC;;AAEA;;EAEE,yCAAyC;AAC3C;;AAEA,uCAAuC;;AAEvC;EACE;;;GAGC;EACD,aAAa;AACf;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,UAAU;EACV,wCAAwC;EACxC,aAAa;EACb,uEAAuE;EACvE,cAAc;AAChB;;AAEA;EACE,wCAAwC;EACxC,mBAAmB;AACrB;;AAEA,qBAAqB;;AAErB;EACE,uCAAuC;EACvC,+BAA+B;EAC/B,gBAAgB;EAChB,cAAc;EACd,kDAAkD;EAClD,gDAAgD;AAClD;;AAEA;EACE,cAAc;EACd,qBAAqB;AACvB;;AAEA;EACE,WAAW;EACX,yCAAyC;EACzC,kBAAkB;EAClB,WAAW;AACb;;AAEA;EACE,aAAa;EACb,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,mBAAmB;EACnB,YAAY;AACd;;AAEA,+BAA+B;;AAE/B;EACE,6BAA6B;AAC/B;;AAEA,+DAA+D;AAC/D;EACE,aAAa;AACf;;AAEA,0CAA0C;;AAE1C;EACE,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;EAChB,qBAAqB;AACvB;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,uCAAuC;EACvC,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE;;GAEC;EACD,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,oEAAoE;EACpE,eAAe;AACjB;;AAEA,yCAAyC;;AAEzC;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,4BAA4B;AAC9B;;AAEA;;;EAGE,kCAAkC;EAClC,+BAA+B;AACjC;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,WAAW;EACX,sBAAsB;AACxB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;;;;EAIE,oEAAoE;EACpE,eAAe;AACjB;;AAEA;EACE,yBAAyB;EACzB,uBAAuB;EACvB,yBAAyB;AAC3B","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-FormGroup-content fieldset {\n  border: none;\n  padding: 0;\n  min-width: 0;\n  width: 100%;\n}\n\n/* stylelint-disable selector-max-type */\n\n.jp-FormGroup-content fieldset .jp-inputFieldWrapper > input,\n.jp-FormGroup-content fieldset .jp-inputFieldWrapper > select,\n.jp-FormGroup-content fieldset .jp-inputFieldWrapper > textarea {\n  font-size: var(--jp-content-font-size2);\n  border-color: var(--jp-input-border-color);\n  border-style: solid;\n  border-radius: var(--jp-border-radius);\n  border-width: 1px;\n  padding: 6px 8px;\n  background: none;\n  color: var(--jp-ui-font-color0);\n  height: inherit;\n}\n\n.jp-FormGroup-content .jp-inputFieldWrapper > select > option {\n  background-color: var(--jp-layout-color1);\n}\n\n.jp-FormGroup-content fieldset input[type='checkbox'] {\n  position: relative;\n  top: 2px;\n  margin-left: 0;\n}\n\n.jp-FormGroup-content button.jp-mod-styled {\n  cursor: pointer;\n}\n\n.jp-FormGroup-content .checkbox label {\n  cursor: pointer;\n  font-size: var(--jp-content-font-size1);\n}\n\n.jp-FormGroup-content .jp-root > fieldset > legend {\n  display: none;\n}\n\n.jp-FormGroup-content .jp-root > fieldset > p {\n  display: none;\n}\n\n/** copy of `input.jp-mod-styled:focus` style */\n.jp-FormGroup-content fieldset input:focus,\n.jp-FormGroup-content fieldset select:focus {\n  -moz-outline-radius: unset;\n  outline: var(--jp-border-width) solid var(--jp-input-active-border-color);\n  outline-offset: -1px;\n  box-shadow: var(--jp-input-box-shadow);\n}\n\n.jp-FormGroup-content fieldset input:hover:not(:focus),\n.jp-FormGroup-content fieldset select:hover:not(:focus) {\n  background-color: var(--jp-border-color2);\n}\n\n/* stylelint-enable selector-max-type */\n\n.jp-FormGroup-content .checkbox .field-description {\n  /* Disable default description field for checkbox:\n   because other widgets do not have description fields,\n   we add descriptions to each widget on the field level.\n  */\n  display: none;\n}\n\n.jp-FormGroup-content #root__description {\n  display: none;\n}\n\n.jp-FormGroup-content .jp-modifiedIndicator {\n  width: 5px;\n  background-color: var(--jp-brand-color2);\n  margin-top: 0;\n  margin-left: calc(var(--jp-private-settingeditor-modifier-indent) * -1);\n  flex-shrink: 0;\n}\n\n.jp-FormGroup-content .jp-modifiedIndicator.jp-errorIndicator {\n  background-color: var(--jp-error-color0);\n  margin-right: 0.5em;\n}\n\n/* RJSF ARRAY style */\n\n.jp-arrayFieldWrapper legend {\n  font-size: var(--jp-content-font-size2);\n  color: var(--jp-ui-font-color0);\n  flex-basis: 100%;\n  padding: 4px 0;\n  font-weight: var(--jp-content-heading-font-weight);\n  border-bottom: 1px solid var(--jp-border-color2);\n}\n\n.jp-arrayFieldWrapper .field-description {\n  padding: 4px 0;\n  white-space: pre-wrap;\n}\n\n.jp-arrayFieldWrapper .array-item {\n  width: 100%;\n  border: 1px solid var(--jp-border-color2);\n  border-radius: 4px;\n  margin: 4px;\n}\n\n.jp-ArrayOperations {\n  display: flex;\n  margin-left: 8px;\n}\n\n.jp-ArrayOperationsButton {\n  margin: 2px;\n}\n\n.jp-ArrayOperationsButton .jp-icon3[fill] {\n  fill: var(--jp-ui-font-color0);\n}\n\nbutton.jp-ArrayOperationsButton.jp-mod-styled:disabled {\n  cursor: not-allowed;\n  opacity: 0.5;\n}\n\n/* RJSF form validation error */\n\n.jp-FormGroup-content .validationErrors {\n  color: var(--jp-error-color0);\n}\n\n/* Hide panel level error as duplicated the field level error */\n.jp-FormGroup-content .panel.errors {\n  display: none;\n}\n\n/* RJSF normal content (settings-editor) */\n\n.jp-FormGroup-contentNormal {\n  display: flex;\n  align-items: center;\n  flex-wrap: wrap;\n}\n\n.jp-FormGroup-contentNormal .jp-FormGroup-contentItem {\n  margin-left: 7px;\n  color: var(--jp-ui-font-color0);\n}\n\n.jp-FormGroup-contentNormal .jp-FormGroup-description {\n  flex-basis: 100%;\n  padding: 4px 7px;\n  white-space: pre-wrap;\n}\n\n.jp-FormGroup-contentNormal .jp-FormGroup-default {\n  flex-basis: 100%;\n  padding: 4px 7px;\n}\n\n.jp-FormGroup-contentNormal .jp-FormGroup-fieldLabel {\n  font-size: var(--jp-content-font-size1);\n  font-weight: normal;\n  min-width: 120px;\n}\n\n.jp-FormGroup-contentNormal fieldset:not(:first-child) {\n  margin-left: 7px;\n}\n\n.jp-FormGroup-contentNormal .field-array-of-string .array-item {\n  /* Display `jp-ArrayOperations` buttons side-by-side with content except\n    for small screens where flex-wrap will place them one below the other.\n  */\n  display: flex;\n  align-items: center;\n  flex-wrap: wrap;\n}\n\n.jp-FormGroup-contentNormal .jp-objectFieldWrapper .form-group {\n  padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);\n  margin-top: 2px;\n}\n\n/* RJSF compact content (metadata-form) */\n\n.jp-FormGroup-content.jp-FormGroup-contentCompact {\n  width: 100%;\n}\n\n.jp-FormGroup-contentCompact .form-group {\n  display: flex;\n  padding: 0.5em 0.2em 0.5em 0;\n}\n\n.jp-FormGroup-contentCompact\n  .jp-FormGroup-compactTitle\n  .jp-FormGroup-description {\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color2);\n}\n\n.jp-FormGroup-contentCompact .jp-FormGroup-fieldLabel {\n  padding-bottom: 0.3em;\n}\n\n.jp-FormGroup-contentCompact .jp-inputFieldWrapper .form-control {\n  width: 100%;\n  box-sizing: border-box;\n}\n\n.jp-FormGroup-contentCompact .jp-arrayFieldWrapper .jp-FormGroup-compactTitle {\n  padding-bottom: 7px;\n}\n\n.jp-FormGroup-contentCompact\n  .jp-objectFieldWrapper\n  .jp-objectFieldWrapper\n  .form-group {\n  padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);\n  margin-top: 2px;\n}\n\n.jp-FormGroup-contentCompact ul.error-detail {\n  margin-block-start: 0.5em;\n  margin-block-end: 0.5em;\n  padding-inline-start: 1em;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 38177:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-SidePanel {
  display: flex;
  flex-direction: column;
  min-width: var(--jp-sidebar-min-width);
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);
  font-size: var(--jp-ui-font-size1);
}

.jp-SidePanel-header {
  flex: 0 0 auto;
  display: flex;
  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
  font-size: var(--jp-ui-font-size0);
  font-weight: 600;
  letter-spacing: 1px;
  margin: 0;
  padding: 2px;
  text-transform: uppercase;
}

.jp-SidePanel-toolbar {
  flex: 0 0 auto;
}

.jp-SidePanel-content {
  flex: 1 1 auto;
}

.jp-SidePanel-toolbar,
.jp-AccordionPanel-toolbar {
  height: var(--jp-private-toolbar-height);
}

.jp-SidePanel-toolbar.jp-Toolbar-micro {
  display: none;
}

.lm-AccordionPanel .jp-AccordionPanel-title {
  box-sizing: border-box;
  line-height: 25px;
  margin: 0;

  /* padding to allow for focus outline */
  padding: 2px;
  display: flex;
  align-items: center;
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color1);
  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
  box-shadow: var(--jp-toolbar-box-shadow);
  font-size: var(--jp-ui-font-size0);
}

.lm-AccordionPanel .jp-AccordionPanel-title:focus-visible {
  /* --accent-fill-focus is computed by the jp toolkit to ensure accessibility */
  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));
  outline-offset: -2px;
}

.jp-AccordionPanel-title {
  cursor: pointer;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  text-transform: uppercase;
}

.lm-AccordionPanel[data-orientation='horizontal'] > .jp-AccordionPanel-title {
  /* Title is rotated for horizontal accordion panel using CSS */
  display: block;
  transform-origin: top left;
  transform: rotate(-90deg) translate(-100%);
}

.jp-AccordionPanel-title .lm-AccordionPanel-titleLabel {
  user-select: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.jp-AccordionPanel-title .lm-AccordionPanel-titleCollapser {
  transform: rotate(-90deg);
  margin: auto 0;
  height: 16px;
}

.jp-AccordionPanel-title.lm-mod-expanded .lm-AccordionPanel-titleCollapser {
  transform: rotate(0deg);
}

.lm-AccordionPanel .jp-AccordionPanel-toolbar {
  background: none;
  box-shadow: none;
  border: none;
  margin-left: auto;
}

.lm-AccordionPanel .lm-SplitPanel-handle:hover {
  background: var(--jp-layout-color3);
}

.jp-text-truncated {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/sidepanel.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,aAAa;EACb,sBAAsB;EACtB,sCAAsC;EACtC,+BAA+B;EAC/B,mCAAmC;EACnC,kCAAkC;AACpC;;AAEA;EACE,cAAc;EACd,aAAa;EACb,mEAAmE;EACnE,kCAAkC;EAClC,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;EACT,YAAY;EACZ,yBAAyB;AAC3B;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;AAChB;;AAEA;;EAEE,wCAAwC;AAC1C;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,sBAAsB;EACtB,iBAAiB;EACjB,SAAS;;EAET,uCAAuC;EACvC,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,mCAAmC;EACnC,+BAA+B;EAC/B,0EAA0E;EAC1E,wCAAwC;EACxC,kCAAkC;AACpC;;AAEA;EACE,8EAA8E;EAC9E,mEAAmE;EACnE,oBAAoB;AACtB;;AAEA;EACE,eAAe;EACf,iBAAiB;EACjB,sBAAsB;EACtB,yBAAyB;EACzB,yBAAyB;AAC3B;;AAEA;EACE,8DAA8D;EAC9D,cAAc;EACd,0BAA0B;EAC1B,0CAA0C;AAC5C;;AAEA;EACE,iBAAiB;EACjB,uBAAuB;EACvB,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,yBAAyB;EACzB,cAAc;EACd,YAAY;AACd;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;EAChB,YAAY;EACZ,iBAAiB;AACnB;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-SidePanel {\n  display: flex;\n  flex-direction: column;\n  min-width: var(--jp-sidebar-min-width);\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n  font-size: var(--jp-ui-font-size1);\n}\n\n.jp-SidePanel-header {\n  flex: 0 0 auto;\n  display: flex;\n  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);\n  font-size: var(--jp-ui-font-size0);\n  font-weight: 600;\n  letter-spacing: 1px;\n  margin: 0;\n  padding: 2px;\n  text-transform: uppercase;\n}\n\n.jp-SidePanel-toolbar {\n  flex: 0 0 auto;\n}\n\n.jp-SidePanel-content {\n  flex: 1 1 auto;\n}\n\n.jp-SidePanel-toolbar,\n.jp-AccordionPanel-toolbar {\n  height: var(--jp-private-toolbar-height);\n}\n\n.jp-SidePanel-toolbar.jp-Toolbar-micro {\n  display: none;\n}\n\n.lm-AccordionPanel .jp-AccordionPanel-title {\n  box-sizing: border-box;\n  line-height: 25px;\n  margin: 0;\n\n  /* padding to allow for focus outline */\n  padding: 2px;\n  display: flex;\n  align-items: center;\n  background: var(--jp-layout-color1);\n  color: var(--jp-ui-font-color1);\n  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);\n  box-shadow: var(--jp-toolbar-box-shadow);\n  font-size: var(--jp-ui-font-size0);\n}\n\n.lm-AccordionPanel .jp-AccordionPanel-title:focus-visible {\n  /* --accent-fill-focus is computed by the jp toolkit to ensure accessibility */\n  outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));\n  outline-offset: -2px;\n}\n\n.jp-AccordionPanel-title {\n  cursor: pointer;\n  user-select: none;\n  -moz-user-select: none;\n  -webkit-user-select: none;\n  text-transform: uppercase;\n}\n\n.lm-AccordionPanel[data-orientation='horizontal'] > .jp-AccordionPanel-title {\n  /* Title is rotated for horizontal accordion panel using CSS */\n  display: block;\n  transform-origin: top left;\n  transform: rotate(-90deg) translate(-100%);\n}\n\n.jp-AccordionPanel-title .lm-AccordionPanel-titleLabel {\n  user-select: none;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  overflow: hidden;\n}\n\n.jp-AccordionPanel-title .lm-AccordionPanel-titleCollapser {\n  transform: rotate(-90deg);\n  margin: auto 0;\n  height: 16px;\n}\n\n.jp-AccordionPanel-title.lm-mod-expanded .lm-AccordionPanel-titleCollapser {\n  transform: rotate(0deg);\n}\n\n.lm-AccordionPanel .jp-AccordionPanel-toolbar {\n  background: none;\n  box-shadow: none;\n  border: none;\n  margin-left: auto;\n}\n\n.lm-AccordionPanel .lm-SplitPanel-handle:hover {\n  background: var(--jp-layout-color3);\n}\n\n.jp-text-truncated {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 47974:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-Spinner {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--jp-layout-color0);
  outline: none;
}

.jp-SpinnerContent {
  font-size: 10px;
  margin: 50px auto;
  text-indent: -9999em;
  width: 3em;
  height: 3em;
  border-radius: 50%;
  background: var(--jp-brand-color3);
  background: linear-gradient(
    to right,
    #f37626 10%,
    rgba(255, 255, 255, 0) 42%
  );
  position: relative;
  animation:
    load3 1s infinite linear,
    fadeIn 1s;
}

.jp-SpinnerContent::before {
  width: 50%;
  height: 50%;
  background: #f37626;
  border-radius: 100% 0 0;
  position: absolute;
  top: 0;
  left: 0;
  content: '';
}

.jp-SpinnerContent::after {
  background: var(--jp-layout-color0);
  width: 75%;
  height: 75%;
  border-radius: 50%;
  content: '';
  margin: auto;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes load3 {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/spinner.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,kBAAkB;EAClB,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,OAAO;EACP,MAAM;EACN,WAAW;EACX,YAAY;EACZ,mCAAmC;EACnC,aAAa;AACf;;AAEA;EACE,eAAe;EACf,iBAAiB;EACjB,oBAAoB;EACpB,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,kCAAkC;EAClC;;;;GAIC;EACD,kBAAkB;EAClB;;aAEW;AACb;;AAEA;EACE,UAAU;EACV,WAAW;EACX,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;AACb;;AAEA;EACE,mCAAmC;EACnC,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,SAAS;EACT,QAAQ;AACV;;AAEA;EACE;IACE,UAAU;EACZ;;EAEA;IACE,UAAU;EACZ;AACF;;AAEA;EACE;IACE,uBAAuB;EACzB;;EAEA;IACE,yBAAyB;EAC3B;AACF","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Spinner {\n  position: absolute;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  z-index: 10;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  background: var(--jp-layout-color0);\n  outline: none;\n}\n\n.jp-SpinnerContent {\n  font-size: 10px;\n  margin: 50px auto;\n  text-indent: -9999em;\n  width: 3em;\n  height: 3em;\n  border-radius: 50%;\n  background: var(--jp-brand-color3);\n  background: linear-gradient(\n    to right,\n    #f37626 10%,\n    rgba(255, 255, 255, 0) 42%\n  );\n  position: relative;\n  animation:\n    load3 1s infinite linear,\n    fadeIn 1s;\n}\n\n.jp-SpinnerContent::before {\n  width: 50%;\n  height: 50%;\n  background: #f37626;\n  border-radius: 100% 0 0;\n  position: absolute;\n  top: 0;\n  left: 0;\n  content: '';\n}\n\n.jp-SpinnerContent::after {\n  background: var(--jp-layout-color0);\n  width: 75%;\n  height: 75%;\n  border-radius: 50%;\n  content: '';\n  margin: auto;\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n}\n\n@keyframes fadeIn {\n  0% {\n    opacity: 0;\n  }\n\n  100% {\n    opacity: 1;\n  }\n}\n\n@keyframes load3 {\n  0% {\n    transform: rotate(0deg);\n  }\n\n  100% {\n    transform: rotate(360deg);\n  }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 4366:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

button.jp-mod-styled {
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color0);
  border: none;
  box-sizing: border-box;
  text-align: center;
  line-height: 32px;
  height: 32px;
  padding: 0 12px;
  letter-spacing: 0.8px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input.jp-mod-styled {
  background: var(--jp-input-background);
  height: 28px;
  box-sizing: border-box;
  border: var(--jp-border-width) solid var(--jp-border-color1);
  border-radius: var(--jp-border-radius);
  padding-left: 7px;
  padding-right: 7px;
  font-size: var(--jp-ui-font-size2);
  color: var(--jp-ui-font-color0);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input[type='checkbox'].jp-mod-styled {
  appearance: checkbox;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  height: auto;
}

input.jp-mod-styled:focus {
  border: var(--jp-border-width) solid var(--jp-input-active-border-color);
  box-shadow: var(--jp-input-box-shadow);
}

input[type='checkbox'].jp-mod-styled:focus-visible {
  outline: var(--jp-border-width) solid var(--jp-input-active-border-color);
  outline-offset: 1px;
}

.jp-select-wrapper {
  display: flex;
  position: relative;
  flex-direction: column;
  padding: 1px;
  background-color: var(--jp-layout-color1);
  box-sizing: border-box;
  margin-bottom: 12px;
}

.jp-select-wrapper:not(.multiple) {
  height: 28px;
}

.jp-select-wrapper.jp-mod-focused select.jp-mod-styled {
  border: var(--jp-border-width) solid var(--jp-input-active-border-color);
  box-shadow: var(--jp-input-box-shadow);
  background-color: var(--jp-input-active-background);
}

select.jp-mod-styled:hover {
  cursor: pointer;
  color: var(--jp-ui-font-color0);
  background-color: var(--jp-input-hover-background);
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.5);
}

select.jp-mod-styled {
  flex: 1 1 auto;
  width: 100%;
  font-size: var(--jp-ui-font-size2);
  background: var(--jp-input-background);
  color: var(--jp-ui-font-color0);
  padding: 0 25px 0 8px;
  border: var(--jp-border-width) solid var(--jp-input-border-color);
  border-radius: var(--jp-border-radius);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

select.jp-mod-styled:not([multiple]) {
  height: 32px;
}

select.jp-mod-styled[multiple] {
  max-height: 200px;
  overflow-y: auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/styling.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,kCAAkC;EAClC,+BAA+B;EAC/B,YAAY;EACZ,sBAAsB;EACtB,kBAAkB;EAClB,iBAAiB;EACjB,YAAY;EACZ,eAAe;EACf,qBAAqB;EACrB,aAAa;EACb,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;AACvB;;AAEA;EACE,sCAAsC;EACtC,YAAY;EACZ,sBAAsB;EACtB,4DAA4D;EAC5D,sCAAsC;EACtC,iBAAiB;EACjB,kBAAkB;EAClB,kCAAkC;EAClC,+BAA+B;EAC/B,aAAa;EACb,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;AACvB;;AAEA;EACE,oBAAoB;EACpB,4BAA4B;EAC5B,yBAAyB;EACzB,YAAY;AACd;;AAEA;EACE,wEAAwE;EACxE,sCAAsC;AACxC;;AAEA;EACE,yEAAyE;EACzE,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,kBAAkB;EAClB,sBAAsB;EACtB,YAAY;EACZ,yCAAyC;EACzC,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,wEAAwE;EACxE,sCAAsC;EACtC,mDAAmD;AACrD;;AAEA;EACE,eAAe;EACf,+BAA+B;EAC/B,kDAAkD;EAClD,4CAA4C;AAC9C;;AAEA;EACE,cAAc;EACd,WAAW;EACX,kCAAkC;EAClC,sCAAsC;EACtC,+BAA+B;EAC/B,qBAAqB;EACrB,iEAAiE;EACjE,sCAAsC;EACtC,aAAa;EACb,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;AACvB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;AAClB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\nbutton.jp-mod-styled {\n  font-size: var(--jp-ui-font-size1);\n  color: var(--jp-ui-font-color0);\n  border: none;\n  box-sizing: border-box;\n  text-align: center;\n  line-height: 32px;\n  height: 32px;\n  padding: 0 12px;\n  letter-spacing: 0.8px;\n  outline: none;\n  appearance: none;\n  -webkit-appearance: none;\n  -moz-appearance: none;\n}\n\ninput.jp-mod-styled {\n  background: var(--jp-input-background);\n  height: 28px;\n  box-sizing: border-box;\n  border: var(--jp-border-width) solid var(--jp-border-color1);\n  border-radius: var(--jp-border-radius);\n  padding-left: 7px;\n  padding-right: 7px;\n  font-size: var(--jp-ui-font-size2);\n  color: var(--jp-ui-font-color0);\n  outline: none;\n  appearance: none;\n  -webkit-appearance: none;\n  -moz-appearance: none;\n}\n\ninput[type='checkbox'].jp-mod-styled {\n  appearance: checkbox;\n  -webkit-appearance: checkbox;\n  -moz-appearance: checkbox;\n  height: auto;\n}\n\ninput.jp-mod-styled:focus {\n  border: var(--jp-border-width) solid var(--jp-input-active-border-color);\n  box-shadow: var(--jp-input-box-shadow);\n}\n\ninput[type='checkbox'].jp-mod-styled:focus-visible {\n  outline: var(--jp-border-width) solid var(--jp-input-active-border-color);\n  outline-offset: 1px;\n}\n\n.jp-select-wrapper {\n  display: flex;\n  position: relative;\n  flex-direction: column;\n  padding: 1px;\n  background-color: var(--jp-layout-color1);\n  box-sizing: border-box;\n  margin-bottom: 12px;\n}\n\n.jp-select-wrapper:not(.multiple) {\n  height: 28px;\n}\n\n.jp-select-wrapper.jp-mod-focused select.jp-mod-styled {\n  border: var(--jp-border-width) solid var(--jp-input-active-border-color);\n  box-shadow: var(--jp-input-box-shadow);\n  background-color: var(--jp-input-active-background);\n}\n\nselect.jp-mod-styled:hover {\n  cursor: pointer;\n  color: var(--jp-ui-font-color0);\n  background-color: var(--jp-input-hover-background);\n  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.5);\n}\n\nselect.jp-mod-styled {\n  flex: 1 1 auto;\n  width: 100%;\n  font-size: var(--jp-ui-font-size2);\n  background: var(--jp-input-background);\n  color: var(--jp-ui-font-color0);\n  padding: 0 25px 0 8px;\n  border: var(--jp-border-width) solid var(--jp-input-border-color);\n  border-radius: var(--jp-border-radius);\n  outline: none;\n  appearance: none;\n  -webkit-appearance: none;\n  -moz-appearance: none;\n}\n\nselect.jp-mod-styled:not([multiple]) {\n  height: 32px;\n}\n\nselect.jp-mod-styled[multiple] {\n  max-height: 200px;\n  overflow-y: auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 10576:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-switch {
  display: flex;
  align-items: center;
  padding-left: 4px;
  padding-right: 4px;
  font-size: var(--jp-ui-font-size1);
  background-color: transparent;
  color: var(--jp-ui-font-color1);
  border: none;
  height: 20px;
}

.jp-switch:hover {
  background-color: var(--jp-layout-color2);
}

.jp-switch-label {
  margin-right: 5px;
  font-family: var(--jp-ui-font-family);
}

.jp-switch-track {
  cursor: pointer;
  background-color: var(--jp-switch-color, var(--jp-border-color1));
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 34px;
  height: 16px;
  width: 35px;
  position: relative;
}

.jp-switch-track::before {
  content: '';
  position: absolute;
  height: 10px;
  width: 10px;
  margin: 3px;
  left: 0;
  background-color: var(--jp-ui-inverse-font-color1);
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 50%;
}

.jp-switch[aria-checked='true'] .jp-switch-track {
  background-color: var(--jp-switch-true-position-color, var(--jp-warn-color0));
}

.jp-switch[aria-checked='true'] .jp-switch-track::before {
  /* track width (35) - margins (3 + 3) - thumb width (10) */
  left: 19px;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/switch.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,aAAa;EACb,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,kCAAkC;EAClC,6BAA6B;EAC7B,+BAA+B;EAC/B,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,iBAAiB;EACjB,qCAAqC;AACvC;;AAEA;EACE,eAAe;EACf,iEAAiE;EACjE,wBAAwB;EACxB,gBAAgB;EAChB,mBAAmB;EACnB,YAAY;EACZ,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,YAAY;EACZ,WAAW;EACX,WAAW;EACX,OAAO;EACP,kDAAkD;EAClD,wBAAwB;EACxB,gBAAgB;EAChB,kBAAkB;AACpB;;AAEA;EACE,6EAA6E;AAC/E;;AAEA;EACE,0DAA0D;EAC1D,UAAU;AACZ","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-switch {\n  display: flex;\n  align-items: center;\n  padding-left: 4px;\n  padding-right: 4px;\n  font-size: var(--jp-ui-font-size1);\n  background-color: transparent;\n  color: var(--jp-ui-font-color1);\n  border: none;\n  height: 20px;\n}\n\n.jp-switch:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.jp-switch-label {\n  margin-right: 5px;\n  font-family: var(--jp-ui-font-family);\n}\n\n.jp-switch-track {\n  cursor: pointer;\n  background-color: var(--jp-switch-color, var(--jp-border-color1));\n  -webkit-transition: 0.4s;\n  transition: 0.4s;\n  border-radius: 34px;\n  height: 16px;\n  width: 35px;\n  position: relative;\n}\n\n.jp-switch-track::before {\n  content: '';\n  position: absolute;\n  height: 10px;\n  width: 10px;\n  margin: 3px;\n  left: 0;\n  background-color: var(--jp-ui-inverse-font-color1);\n  -webkit-transition: 0.4s;\n  transition: 0.4s;\n  border-radius: 50%;\n}\n\n.jp-switch[aria-checked='true'] .jp-switch-track {\n  background-color: var(--jp-switch-true-position-color, var(--jp-warn-color0));\n}\n\n.jp-switch[aria-checked='true'] .jp-switch-track::before {\n  /* track width (35) - margins (3 + 3) - thumb width (10) */\n  left: 19px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 35971:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.lm-TabBar .lm-TabBar-addButton {
  align-items: center;
  display: flex;
  padding: 4px;
  padding-bottom: 5px;
  margin-right: 1px;
  background-color: var(--jp-layout-color2);
}

.lm-TabBar .lm-TabBar-addButton:hover {
  background-color: var(--jp-layout-color1);
}

.lm-DockPanel-tabBar .lm-TabBar-tab {
  width: var(--jp-private-horizontal-tab-width);
}

.lm-DockPanel-tabBar .lm-TabBar-content {
  flex: unset;
}

.lm-DockPanel-tabBar[data-orientation='horizontal'] {
  flex: 1 1 auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/tabbar.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,mBAAmB;EACnB,aAAa;EACb,YAAY;EACZ,mBAAmB;EACnB,iBAAiB;EACjB,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,cAAc;AAChB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.lm-TabBar .lm-TabBar-addButton {\n  align-items: center;\n  display: flex;\n  padding: 4px;\n  padding-bottom: 5px;\n  margin-right: 1px;\n  background-color: var(--jp-layout-color2);\n}\n\n.lm-TabBar .lm-TabBar-addButton:hover {\n  background-color: var(--jp-layout-color1);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab {\n  width: var(--jp-private-horizontal-tab-width);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-content {\n  flex: unset;\n}\n\n.lm-DockPanel-tabBar[data-orientation='horizontal'] {\n  flex: 1 1 auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 83838:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-sortable-table {
  color: var(--jp-ui-font-color1);
  background: var(--jp-layout-color1);
  font-size: var(--jp-ui-font-size1);
  border-spacing: 0;

  /* required to preserve borders of \`<th>\` when using position:sticky */
  border-collapse: separate;
  width: 100%;
  overflow-wrap: break-word;
}

.jp-sortable-table > thead {
  box-shadow: var(--jp-toolbar-box-shadow);

  /* move to a new stacking context to exclude from \`mix-blend-mode\` */
  z-index: 1;
}

.jp-sortable-table > tbody {
  overflow-y: auto;
  overflow-x: hidden;
}

.jp-sortable-table-tr > th,
.jp-sortable-table-tr > td {
  position: relative;
  padding: 4px 12px 2px;
  height: 18px;
}

.jp-sortable-table-tr > td::before,
.jp-sortable-table-tr > th::before {
  border-left: var(--jp-border-width) solid var(--jp-border-color3);

  /* border is implemented via pseudo-element to enable selective blending */
  content: '';
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;

  /* this serves to boost border color when background changes on hover */
  mix-blend-mode: multiply;
}

.jp-sortable-table-tr > th {
  font-weight: 500;
  text-align: left;
  border-width: var(--jp-border-width) 0;
  margin-top: calc(var(--jp-border-width) * -1);
  border-style: solid;
  border-color: var(--jp-border-color1);
  background: var(--jp-layout-color1);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  user-select: none;
}

.jp-sortable-table-tr > th:not(:first-child) {
  border-left-color: var(--jp-border-color2);
}

.jp-sortable-table-tr > th:hover {
  background: var(--jp-layout-color2);
}

.jp-sortable-table-tr:hover {
  background: var(--jp-layout-color2);
}

.jp-sortable-table-th-wrapper {
  flex-direction: row;
  display: flex;
}

.jp-sortable-table-th-wrapper > label {
  flex: 1;
  text-overflow: ellipsis;
}

.jp-sort-icon {
  flex: 0;
  height: var(--jp-ui-font-size1);
  width: var(--jp-ui-font-size1);
}

.jp-sort-icon > svg {
  display: inline;
  height: auto;
}

.jp-sortable-table-tr > th:not(.jp-sorted-header) .jp-sort-icon {
  opacity: 0;
}

.jp-sortable-table-tr > th:not(.jp-sorted-header):hover .jp-sort-icon {
  opacity: 0.5;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/table.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,+BAA+B;EAC/B,mCAAmC;EACnC,kCAAkC;EAClC,iBAAiB;;EAEjB,sEAAsE;EACtE,yBAAyB;EACzB,WAAW;EACX,yBAAyB;AAC3B;;AAEA;EACE,wCAAwC;;EAExC,oEAAoE;EACpE,UAAU;AACZ;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;AACpB;;AAEA;;EAEE,kBAAkB;EAClB,qBAAqB;EACrB,YAAY;AACd;;AAEA;;EAEE,iEAAiE;;EAEjE,0EAA0E;EAC1E,WAAW;EACX,cAAc;EACd,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;;EAEP,uEAAuE;EACvE,wBAAwB;AAC1B;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;EAChB,sCAAsC;EACtC,6CAA6C;EAC7C,mBAAmB;EACnB,qCAAqC;EACrC,mCAAmC;EACnC,gBAAgB;EAChB,MAAM;EACN,UAAU;EACV,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,OAAO;EACP,uBAAuB;AACzB;;AAEA;EACE,OAAO;EACP,+BAA+B;EAC/B,8BAA8B;AAChC;;AAEA;EACE,eAAe;EACf,YAAY;AACd;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,YAAY;AACd","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-sortable-table {\n  color: var(--jp-ui-font-color1);\n  background: var(--jp-layout-color1);\n  font-size: var(--jp-ui-font-size1);\n  border-spacing: 0;\n\n  /* required to preserve borders of `<th>` when using position:sticky */\n  border-collapse: separate;\n  width: 100%;\n  overflow-wrap: break-word;\n}\n\n.jp-sortable-table > thead {\n  box-shadow: var(--jp-toolbar-box-shadow);\n\n  /* move to a new stacking context to exclude from `mix-blend-mode` */\n  z-index: 1;\n}\n\n.jp-sortable-table > tbody {\n  overflow-y: auto;\n  overflow-x: hidden;\n}\n\n.jp-sortable-table-tr > th,\n.jp-sortable-table-tr > td {\n  position: relative;\n  padding: 4px 12px 2px;\n  height: 18px;\n}\n\n.jp-sortable-table-tr > td::before,\n.jp-sortable-table-tr > th::before {\n  border-left: var(--jp-border-width) solid var(--jp-border-color3);\n\n  /* border is implemented via pseudo-element to enable selective blending */\n  content: '';\n  display: block;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n\n  /* this serves to boost border color when background changes on hover */\n  mix-blend-mode: multiply;\n}\n\n.jp-sortable-table-tr > th {\n  font-weight: 500;\n  text-align: left;\n  border-width: var(--jp-border-width) 0;\n  margin-top: calc(var(--jp-border-width) * -1);\n  border-style: solid;\n  border-color: var(--jp-border-color1);\n  background: var(--jp-layout-color1);\n  position: sticky;\n  top: 0;\n  z-index: 2;\n  white-space: nowrap;\n  user-select: none;\n}\n\n.jp-sortable-table-tr > th:not(:first-child) {\n  border-left-color: var(--jp-border-color2);\n}\n\n.jp-sortable-table-tr > th:hover {\n  background: var(--jp-layout-color2);\n}\n\n.jp-sortable-table-tr:hover {\n  background: var(--jp-layout-color2);\n}\n\n.jp-sortable-table-th-wrapper {\n  flex-direction: row;\n  display: flex;\n}\n\n.jp-sortable-table-th-wrapper > label {\n  flex: 1;\n  text-overflow: ellipsis;\n}\n\n.jp-sort-icon {\n  flex: 0;\n  height: var(--jp-ui-font-size1);\n  width: var(--jp-ui-font-size1);\n}\n\n.jp-sort-icon > svg {\n  display: inline;\n  height: auto;\n}\n\n.jp-sortable-table-tr > th:not(.jp-sorted-header) .jp-sort-icon {\n  opacity: 0;\n}\n\n.jp-sortable-table-tr > th:not(.jp-sorted-header):hover .jp-sort-icon {\n  opacity: 0.5;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 55386:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

:root {
  --jp-private-toolbar-height: calc(
    31px + var(--jp-border-width)
  ); /* leave 28px for content */
}

.jp-MainAreaWidget > .jp-Toolbar {
  border-radius: 0;
}

.jp-Toolbar {
  /* Increase density for toolbar */
  --design-unit: 3.5;
  --toolbar-item-gap: 0;

  color: var(--jp-ui-font-color1);
  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
  box-shadow: var(--jp-toolbar-box-shadow);
  background: var(--jp-toolbar-background);
  min-height: var(--jp-toolbar-micro-height);
  padding: 0 2px;
  z-index: 8;
}

/* Toolbar items */

.jp-Toolbar > .jp-Toolbar-item {
  /* Center the items in toolbar */
  height: 100%;
  display: flex;
  align-items: center;
}

.jp-Toolbar::part(positioning-region) {
  align-items: center;
}

.jp-ToolbarLabelComponent {
  background: var(--jp-layout-color1);
  background-color: var(--jp-brand-color1);
  color: var(--jp-ui-inverse-font-color1);
  border: none;
  box-sizing: border-box;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0 6px;
  margin: 0;
  height: 24px;
  border-radius: var(--jp-border-radius);
  display: flex;
  align-items: center;
  text-align: center;
  font-size: var(--jp-ui-font-size0);
  min-width: unset;
  min-height: unset;
  user-select: none;
}

button.jp-ToolbarButtonComponent .jp-ToolbarButtonComponent-label {
  font-size: var(--jp-ui-font-size1);
  line-height: 100%;
  padding-left: 2px;
  color: var(--jp-ui-font-color1);
  font-family: var(--jp-ui-font-family);
}

.jp-Toolbar .jp-ToolbarButtonComponent {
  color: var(--jp-ui-font-color1);
}

.jp-ToolbarButtonComponent::part(content) {
  display: flex;
  align-items: center;
}

.jp-Toolbar > .jp-Toolbar-item.jp-Toolbar-spacer {
  flex-grow: 1;
  flex-shrink: 1;
}

.jp-Toolbar-responsive-popup.jp-ThemedContainer {
  position: absolute;
  height: fit-content;
  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
  box-shadow: var(--jp-toolbar-box-shadow);
  background: var(--jp-toolbar-background);
  z-index: 1;
  right: 0;
  top: 0;
}

#jp-main-dock-panel[data-mode='single-document']
  .jp-MainAreaWidget
  > .jp-Toolbar.jp-Toolbar-micro {
  padding: 0;
  min-height: 0;
}

#jp-main-dock-panel[data-mode='single-document']
  .jp-MainAreaWidget
  > .jp-Toolbar {
  border: none;
  box-shadow: none;
}

/* @deprecated dead code to be removed in JupyterLab 5
  Button in toolbar should use the ui-toolkit
  https://github.com/jupyterlab-contrib/jupyter-ui-toolkit.
*/
button.jp-ToolbarButtonComponent {
  background: var(--jp-layout-color1);
  border: none;
  box-sizing: border-box;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0 6px;
  margin: 0;
  height: 24px;
  border-radius: var(--jp-border-radius);
  display: flex;
  align-items: center;
  text-align: center;
  font-size: var(--jp-ui-font-size0);
  min-width: unset;
  min-height: unset;
}

button.jp-ToolbarButtonComponent:disabled {
  opacity: 0.4;
}

button.jp-ToolbarButtonComponent > span {
  padding: 0;
  flex: 0 0 auto;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/toolbar.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE;;GAEC,EAAE,2BAA2B;AAChC;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,iCAAiC;EACjC,kBAAkB;EAClB,qBAAqB;;EAErB,+BAA+B;EAC/B,0EAA0E;EAC1E,wCAAwC;EACxC,wCAAwC;EACxC,0CAA0C;EAC1C,cAAc;EACd,UAAU;AACZ;;AAEA,kBAAkB;;AAElB;EACE,gCAAgC;EAChC,YAAY;EACZ,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,mCAAmC;EACnC,wCAAwC;EACxC,uCAAuC;EACvC,YAAY;EACZ,sBAAsB;EACtB,aAAa;EACb,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;EACrB,cAAc;EACd,SAAS;EACT,YAAY;EACZ,sCAAsC;EACtC,aAAa;EACb,mBAAmB;EACnB,kBAAkB;EAClB,kCAAkC;EAClC,gBAAgB;EAChB,iBAAiB;EACjB,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;EAClC,iBAAiB;EACjB,iBAAiB;EACjB,+BAA+B;EAC/B,qCAAqC;AACvC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,YAAY;EACZ,cAAc;AAChB;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;EACnB,0EAA0E;EAC1E,wCAAwC;EACxC,wCAAwC;EACxC,UAAU;EACV,QAAQ;EACR,MAAM;AACR;;AAEA;;;EAGE,UAAU;EACV,aAAa;AACf;;AAEA;;;EAGE,YAAY;EACZ,gBAAgB;AAClB;;AAEA;;;CAGC;AACD;EACE,mCAAmC;EACnC,YAAY;EACZ,sBAAsB;EACtB,aAAa;EACb,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;EACrB,cAAc;EACd,SAAS;EACT,YAAY;EACZ,sCAAsC;EACtC,aAAa;EACb,mBAAmB;EACnB,kBAAkB;EAClB,kCAAkC;EAClC,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,UAAU;EACV,cAAc;AAChB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n  --jp-private-toolbar-height: calc(\n    31px + var(--jp-border-width)\n  ); /* leave 28px for content */\n}\n\n.jp-MainAreaWidget > .jp-Toolbar {\n  border-radius: 0;\n}\n\n.jp-Toolbar {\n  /* Increase density for toolbar */\n  --design-unit: 3.5;\n  --toolbar-item-gap: 0;\n\n  color: var(--jp-ui-font-color1);\n  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);\n  box-shadow: var(--jp-toolbar-box-shadow);\n  background: var(--jp-toolbar-background);\n  min-height: var(--jp-toolbar-micro-height);\n  padding: 0 2px;\n  z-index: 8;\n}\n\n/* Toolbar items */\n\n.jp-Toolbar > .jp-Toolbar-item {\n  /* Center the items in toolbar */\n  height: 100%;\n  display: flex;\n  align-items: center;\n}\n\n.jp-Toolbar::part(positioning-region) {\n  align-items: center;\n}\n\n.jp-ToolbarLabelComponent {\n  background: var(--jp-layout-color1);\n  background-color: var(--jp-brand-color1);\n  color: var(--jp-ui-inverse-font-color1);\n  border: none;\n  box-sizing: border-box;\n  outline: none;\n  appearance: none;\n  -webkit-appearance: none;\n  -moz-appearance: none;\n  padding: 0 6px;\n  margin: 0;\n  height: 24px;\n  border-radius: var(--jp-border-radius);\n  display: flex;\n  align-items: center;\n  text-align: center;\n  font-size: var(--jp-ui-font-size0);\n  min-width: unset;\n  min-height: unset;\n  user-select: none;\n}\n\nbutton.jp-ToolbarButtonComponent .jp-ToolbarButtonComponent-label {\n  font-size: var(--jp-ui-font-size1);\n  line-height: 100%;\n  padding-left: 2px;\n  color: var(--jp-ui-font-color1);\n  font-family: var(--jp-ui-font-family);\n}\n\n.jp-Toolbar .jp-ToolbarButtonComponent {\n  color: var(--jp-ui-font-color1);\n}\n\n.jp-ToolbarButtonComponent::part(content) {\n  display: flex;\n  align-items: center;\n}\n\n.jp-Toolbar > .jp-Toolbar-item.jp-Toolbar-spacer {\n  flex-grow: 1;\n  flex-shrink: 1;\n}\n\n.jp-Toolbar-responsive-popup.jp-ThemedContainer {\n  position: absolute;\n  height: fit-content;\n  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);\n  box-shadow: var(--jp-toolbar-box-shadow);\n  background: var(--jp-toolbar-background);\n  z-index: 1;\n  right: 0;\n  top: 0;\n}\n\n#jp-main-dock-panel[data-mode='single-document']\n  .jp-MainAreaWidget\n  > .jp-Toolbar.jp-Toolbar-micro {\n  padding: 0;\n  min-height: 0;\n}\n\n#jp-main-dock-panel[data-mode='single-document']\n  .jp-MainAreaWidget\n  > .jp-Toolbar {\n  border: none;\n  box-shadow: none;\n}\n\n/* @deprecated dead code to be removed in JupyterLab 5\n  Button in toolbar should use the ui-toolkit\n  https://github.com/jupyterlab-contrib/jupyter-ui-toolkit.\n*/\nbutton.jp-ToolbarButtonComponent {\n  background: var(--jp-layout-color1);\n  border: none;\n  box-sizing: border-box;\n  outline: none;\n  appearance: none;\n  -webkit-appearance: none;\n  -moz-appearance: none;\n  padding: 0 6px;\n  margin: 0;\n  height: 24px;\n  border-radius: var(--jp-border-radius);\n  display: flex;\n  align-items: center;\n  text-align: center;\n  font-size: var(--jp-ui-font-size0);\n  min-width: unset;\n  min-height: unset;\n}\n\nbutton.jp-ToolbarButtonComponent:disabled {\n  opacity: 0.4;\n}\n\nbutton.jp-ToolbarButtonComponent > span {\n  padding: 0;\n  flex: 0 0 auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 94579:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-ThemedContainer {
  /* Decrease default density for Jupyter toolkit components */
  --density: -4;
}

/* Styles for tree view */
.jp-TreeView {
  min-width: auto;
}

.jp-TreeView.jp-mod-flat > .jp-TreeItem::part(content-region) {
  margin-inline-start: calc(var(--design-unit) * 2px);
}

/* Styles for tree item */
.jp-TreeItem::part(expand-collapse-button) {
  color: var(--jp-inverse-layout-color3);
}

/* Tune hover for stealth buttons otherwise they won't stand out */
.jp-TreeItem jp-button[appearance='stealth']:hover {
  background: var(--tree-item-expand-collapse-hover);
}

.jp-TreeItem[selected] jp-button[appearance='stealth']:hover {
  background: var(--tree-item-expand-collapse-selected-hover);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/toolkit.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,4DAA4D;EAC5D,aAAa;AACf;;AAEA,yBAAyB;AACzB;EACE,eAAe;AACjB;;AAEA;EACE,mDAAmD;AACrD;;AAEA,yBAAyB;AACzB;EACE,sCAAsC;AACxC;;AAEA,kEAAkE;AAClE;EACE,kDAAkD;AACpD;;AAEA;EACE,2DAA2D;AAC7D","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-ThemedContainer {\n  /* Decrease default density for Jupyter toolkit components */\n  --density: -4;\n}\n\n/* Styles for tree view */\n.jp-TreeView {\n  min-width: auto;\n}\n\n.jp-TreeView.jp-mod-flat > .jp-TreeItem::part(content-region) {\n  margin-inline-start: calc(var(--design-unit) * 2px);\n}\n\n/* Styles for tree item */\n.jp-TreeItem::part(expand-collapse-button) {\n  color: var(--jp-inverse-layout-color3);\n}\n\n/* Tune hover for stealth buttons otherwise they won't stand out */\n.jp-TreeItem jp-button[appearance='stealth']:hover {\n  background: var(--tree-item-expand-collapse-hover);\n}\n\n.jp-TreeItem[selected] jp-button[appearance='stealth']:hover {\n  background: var(--tree-item-expand-collapse-selected-hover);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 54061:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.jp-WindowedPanel-outer {
  height: 100%;
  position: relative;
  overflow: auto;
}

.jp-WindowedPanel-inner {
  position: relative;
}

.jp-WindowedPanel-viewport {
  position: absolute;
  left: 0;
  right: 0;
  overflow: visible;
}

.jp-WindowedPanel-scrollbar {
  display: none;
  position: relative;
  user-select: none;
}

.jp-WindowedPanel.jp-mod-virtual-scrollbar > .jp-WindowedPanel-scrollbar {
  background-color: inherit;
  border-left: 1px solid var(--jp-layout-color3);
  display: block;
  position: fixed;
  overflow-y: auto;
  overflow-x: hidden;
  top: 0;
  bottom: 0;
  right: 0;
  min-width: 35px;
  z-index: 1;
}

.jp-WindowedPanel-scrollbar-content {
  background-color: transparent;
  list-style-type: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 3;
}

.jp-WindowedPanel-scrollbar-content > .jp-WindowedPanel-scrollbar-item {
  border-bottom: 1px solid var(--jp-layout-color3);
  background-color: rgb(from var(--jp-layout-color1) r g b / 50%);
  padding: 2px;
  text-align: left;
  margin: 0 2px;
}

.jp-WindowedPanel-scrollbar-content > .jp-WindowedPanel-scrollbar-item:hover {
  cursor: pointer;
  background-color: var(--jp-layout-color3);
}

.jp-WindowedPanel-scrollbar-viewportIndicator {
  position: absolute;
  background: var(--jp-layout-color2);
  border: 1px solid var(--jp-layout-color4);
  width: 100%;
  z-index: 2;
  border-radius: 2px;
  box-sizing: border-box;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/ui-components/style/windowedlist.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,YAAY;EACZ,kBAAkB;EAClB,cAAc;AAChB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;EAClB,OAAO;EACP,QAAQ;EACR,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA;EACE,yBAAyB;EACzB,8CAA8C;EAC9C,cAAc;EACd,eAAe;EACf,gBAAgB;EAChB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,QAAQ;EACR,eAAe;EACf,UAAU;AACZ;;AAEA;EACE,6BAA6B;EAC7B,qBAAqB;EACrB,SAAS;EACT,UAAU;EACV,kBAAkB;EAClB,UAAU;AACZ;;AAEA;EACE,gDAAgD;EAChD,+DAA+D;EAC/D,YAAY;EACZ,gBAAgB;EAChB,aAAa;AACf;;AAEA;EACE,eAAe;EACf,yCAAyC;AAC3C;;AAEA;EACE,kBAAkB;EAClB,mCAAmC;EACnC,yCAAyC;EACzC,WAAW;EACX,UAAU;EACV,kBAAkB;EAClB,sBAAsB;AACxB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-WindowedPanel-outer {\n  height: 100%;\n  position: relative;\n  overflow: auto;\n}\n\n.jp-WindowedPanel-inner {\n  position: relative;\n}\n\n.jp-WindowedPanel-viewport {\n  position: absolute;\n  left: 0;\n  right: 0;\n  overflow: visible;\n}\n\n.jp-WindowedPanel-scrollbar {\n  display: none;\n  position: relative;\n  user-select: none;\n}\n\n.jp-WindowedPanel.jp-mod-virtual-scrollbar > .jp-WindowedPanel-scrollbar {\n  background-color: inherit;\n  border-left: 1px solid var(--jp-layout-color3);\n  display: block;\n  position: fixed;\n  overflow-y: auto;\n  overflow-x: hidden;\n  top: 0;\n  bottom: 0;\n  right: 0;\n  min-width: 35px;\n  z-index: 1;\n}\n\n.jp-WindowedPanel-scrollbar-content {\n  background-color: transparent;\n  list-style-type: none;\n  margin: 0;\n  padding: 0;\n  position: relative;\n  z-index: 3;\n}\n\n.jp-WindowedPanel-scrollbar-content > .jp-WindowedPanel-scrollbar-item {\n  border-bottom: 1px solid var(--jp-layout-color3);\n  background-color: rgb(from var(--jp-layout-color1) r g b / 50%);\n  padding: 2px;\n  text-align: left;\n  margin: 0 2px;\n}\n\n.jp-WindowedPanel-scrollbar-content > .jp-WindowedPanel-scrollbar-item:hover {\n  cursor: pointer;\n  background-color: var(--jp-layout-color3);\n}\n\n.jp-WindowedPanel-scrollbar-viewportIndicator {\n  position: absolute;\n  background: var(--jp-layout-color2);\n  border: 1px solid var(--jp-layout-color4);\n  width: 100%;\n  z-index: 2;\n  border-radius: 2px;\n  box-sizing: border-box;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 47611:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-RenderedVegaCommon5 {
  margin-left: 8px;
  margin-top: 8px;
}

.jp-MimeDocument .jp-RenderedVegaCommon5 {
  padding: 16px;
}

.vega canvas {
  background: var(--jp-vega-background);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/vega5-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;EACE,gBAAgB;EAChB,eAAe;AACjB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,qCAAqC;AACvC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-RenderedVegaCommon5 {\n  margin-left: 8px;\n  margin-top: 8px;\n}\n\n.jp-MimeDocument .jp-RenderedVegaCommon5 {\n  padding: 16px;\n}\n\n.vega canvas {\n  background: var(--jp-vega-background);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 61163:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * Base styles for video viewer
 */

.jp-RenderedVideo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.jp-RenderedVideo > video {
  width: 100%;
  height: auto;
  object-fit: contain;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@jupyterlab/video-extension/style/base.css"],"names":[],"mappings":"AAAA;;;8EAG8E;;AAE9E;;EAEE;;AAEF;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,mBAAmB;AACrB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/**\n * Base styles for video viewer\n */\n\n.jp-RenderedVideo {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  width: 100%;\n  height: 100%;\n}\n\n.jp-RenderedVideo > video {\n  width: 100%;\n  height: auto;\n  object-fit: contain;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 71971:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-cursor-backdrop {
  top: 0px;
  left: 0px;
  position: fixed;
  width: 200px;
  height: 200px;
  margin-top: -100px;
  margin-left: -100px;
  will-change: transform;
  z-index: 100;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow: scroll;
}

.lm-cursor-backdrop::after {
  content: '';
  height: 1200px;
  width: 1200px;
  display: block;
}

.lm-cursor-backdrop::-webkit-scrollbar {
  display: none;
}

.lm-mod-drag-image {
  top: 0px;
  left: 0px;
  will-change: transform;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/dragdrop/style/index.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,QAAQ;EACR,SAAS;EACT,eAAe;EACf,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,mBAAmB;EACnB,sBAAsB;EACtB,YAAY;EACZ,qBAAqB;EACrB,wBAAwB;EACxB,gBAAgB;AAClB;;AAEA;EACE,WAAW;EACX,cAAc;EACd,aAAa;EACb,cAAc;AAChB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,QAAQ;EACR,SAAS;EACT,sBAAsB;AACxB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-cursor-backdrop {\n  top: 0px;\n  left: 0px;\n  position: fixed;\n  width: 200px;\n  height: 200px;\n  margin-top: -100px;\n  margin-left: -100px;\n  will-change: transform;\n  z-index: 100;\n  scrollbar-width: none;\n  -ms-overflow-style: none;\n  overflow: scroll;\n}\n\n.lm-cursor-backdrop::after {\n  content: '';\n  height: 1200px;\n  width: 1200px;\n  display: block;\n}\n\n.lm-cursor-backdrop::-webkit-scrollbar {\n  display: none;\n}\n\n.lm-mod-drag-image {\n  top: 0px;\n  left: 0px;\n  will-change: transform;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 36383:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

.lm-AccordionPanel[data-orientation='horizontal'] > .lm-AccordionPanel-title {
  /* Title is rotated for horizontal accordion panel using CSS */
  display: block;
  transform-origin: top left;
  transform: rotate(-90deg) translate(-100%);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/accordionpanel.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,8DAA8D;EAC9D,cAAc;EACd,0BAA0B;EAC1B,0CAA0C;AAC5C","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.lm-AccordionPanel[data-orientation='horizontal'] > .lm-AccordionPanel-title {\n  /* Title is rotated for horizontal accordion panel using CSS */\n  display: block;\n  transform-origin: top left;\n  transform: rotate(-90deg) translate(-100%);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 27410:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-CommandPalette {
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.lm-CommandPalette-search {
  flex: 0 0 auto;
}

.lm-CommandPalette-content {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow: auto;
  list-style-type: none;
}

.lm-CommandPalette-header {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lm-CommandPalette-item {
  display: flex;
  flex-direction: row;
}

.lm-CommandPalette-itemIcon {
  flex: 0 0 auto;
}

.lm-CommandPalette-itemContent {
  flex: 1 1 auto;
  overflow: hidden;
}

.lm-CommandPalette-itemShortcut {
  flex: 0 0 auto;
}

.lm-CommandPalette-itemLabel {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lm-close-icon {
  border: 1px solid transparent;
  background-color: transparent;
  position: absolute;
  z-index: 1;
  right: 3%;
  top: 0;
  bottom: 0;
  margin: auto;
  padding: 7px 0;
  display: none;
  vertical-align: middle;
  outline: 0;
  cursor: pointer;
}
.lm-close-icon:after {
  content: 'X';
  display: block;
  width: 15px;
  height: 15px;
  text-align: center;
  color: #000;
  font-weight: normal;
  font-size: 12px;
  cursor: pointer;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/commandpalette.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,aAAa;EACb,sBAAsB;EACtB,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,SAAS;EACT,UAAU;EACV,aAAa;EACb,cAAc;EACd,qBAAqB;AACvB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,gBAAgB;AAClB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,6BAA6B;EAC7B,6BAA6B;EAC7B,kBAAkB;EAClB,UAAU;EACV,SAAS;EACT,MAAM;EACN,SAAS;EACT,YAAY;EACZ,cAAc;EACd,aAAa;EACb,sBAAsB;EACtB,UAAU;EACV,eAAe;AACjB;AACA;EACE,YAAY;EACZ,cAAc;EACd,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,WAAW;EACX,mBAAmB;EACnB,eAAe;EACf,eAAe;AACjB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-CommandPalette {\n  display: flex;\n  flex-direction: column;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.lm-CommandPalette-search {\n  flex: 0 0 auto;\n}\n\n.lm-CommandPalette-content {\n  flex: 1 1 auto;\n  margin: 0;\n  padding: 0;\n  min-height: 0;\n  overflow: auto;\n  list-style-type: none;\n}\n\n.lm-CommandPalette-header {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\n.lm-CommandPalette-item {\n  display: flex;\n  flex-direction: row;\n}\n\n.lm-CommandPalette-itemIcon {\n  flex: 0 0 auto;\n}\n\n.lm-CommandPalette-itemContent {\n  flex: 1 1 auto;\n  overflow: hidden;\n}\n\n.lm-CommandPalette-itemShortcut {\n  flex: 0 0 auto;\n}\n\n.lm-CommandPalette-itemLabel {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\n.lm-close-icon {\n  border: 1px solid transparent;\n  background-color: transparent;\n  position: absolute;\n  z-index: 1;\n  right: 3%;\n  top: 0;\n  bottom: 0;\n  margin: auto;\n  padding: 7px 0;\n  display: none;\n  vertical-align: middle;\n  outline: 0;\n  cursor: pointer;\n}\n.lm-close-icon:after {\n  content: 'X';\n  display: block;\n  width: 15px;\n  height: 15px;\n  text-align: center;\n  color: #000;\n  font-weight: normal;\n  font-size: 12px;\n  cursor: pointer;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 85863:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-DockPanel {
  z-index: 0;
}

.lm-DockPanel-widget {
  z-index: 0;
}

.lm-DockPanel-tabBar {
  z-index: 1;
}

.lm-DockPanel-handle {
  z-index: 2;
}

.lm-DockPanel-handle.lm-mod-hidden {
  display: none !important;
}

.lm-DockPanel-handle:after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: '';
}

.lm-DockPanel-handle[data-orientation='horizontal'] {
  cursor: ew-resize;
}

.lm-DockPanel-handle[data-orientation='vertical'] {
  cursor: ns-resize;
}

.lm-DockPanel-handle[data-orientation='horizontal']:after {
  left: 50%;
  min-width: 8px;
  transform: translateX(-50%);
}

.lm-DockPanel-handle[data-orientation='vertical']:after {
  top: 50%;
  min-height: 8px;
  transform: translateY(-50%);
}

.lm-DockPanel-overlay {
  z-index: 3;
  box-sizing: border-box;
  pointer-events: none;
}

.lm-DockPanel-overlay.lm-mod-hidden {
  display: none !important;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/dockpanel.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,SAAS;EACT,cAAc;EACd,2BAA2B;AAC7B;;AAEA;EACE,QAAQ;EACR,eAAe;EACf,2BAA2B;AAC7B;;AAEA;EACE,UAAU;EACV,sBAAsB;EACtB,oBAAoB;AACtB;;AAEA;EACE,wBAAwB;AAC1B","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-DockPanel {\n  z-index: 0;\n}\n\n.lm-DockPanel-widget {\n  z-index: 0;\n}\n\n.lm-DockPanel-tabBar {\n  z-index: 1;\n}\n\n.lm-DockPanel-handle {\n  z-index: 2;\n}\n\n.lm-DockPanel-handle.lm-mod-hidden {\n  display: none !important;\n}\n\n.lm-DockPanel-handle:after {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  content: '';\n}\n\n.lm-DockPanel-handle[data-orientation='horizontal'] {\n  cursor: ew-resize;\n}\n\n.lm-DockPanel-handle[data-orientation='vertical'] {\n  cursor: ns-resize;\n}\n\n.lm-DockPanel-handle[data-orientation='horizontal']:after {\n  left: 50%;\n  min-width: 8px;\n  transform: translateX(-50%);\n}\n\n.lm-DockPanel-handle[data-orientation='vertical']:after {\n  top: 50%;\n  min-height: 8px;\n  transform: translateY(-50%);\n}\n\n.lm-DockPanel-overlay {\n  z-index: 3;\n  box-sizing: border-box;\n  pointer-events: none;\n}\n\n.lm-DockPanel-overlay.lm-mod-hidden {\n  display: none !important;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 79387:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_widget_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94933);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_accordionpanel_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36383);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_commandpalette_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27410);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_dockpanel_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85863);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_menu_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68150);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_menubar_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13306);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_scrollbar_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(66756);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_splitpanel_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(47372);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_tabbar_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(45650);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_cjs_js_tabpanel_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80127);
// Imports












var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_widget_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_accordionpanel_css__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_commandpalette_css__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_dockpanel_css__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_menu_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_menubar_css__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_scrollbar_css__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_splitpanel_css__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_tabbar_css__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z);
___CSS_LOADER_EXPORT___.i(_jupyterlab_builder_node_modules_css_loader_dist_cjs_js_tabpanel_css__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/index.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n@import './widget.css';\n@import './accordionpanel.css';\n@import './commandpalette.css';\n@import './dockpanel.css';\n@import './menu.css';\n@import './menubar.css';\n@import './scrollbar.css';\n@import './splitpanel.css';\n@import './tabbar.css';\n@import './tabpanel.css';\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 68150:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-Menu {
  z-index: 10000;
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: auto;
  outline: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.lm-Menu-content {
  margin: 0;
  padding: 0;
  display: table;
  list-style-type: none;
}

.lm-Menu-item {
  display: table-row;
}

.lm-Menu-item.lm-mod-hidden,
.lm-Menu-item.lm-mod-collapsed {
  display: none !important;
}

.lm-Menu-itemIcon,
.lm-Menu-itemSubmenuIcon {
  display: table-cell;
  text-align: center;
}

.lm-Menu-itemLabel {
  display: table-cell;
  text-align: left;
}

.lm-Menu-itemShortcut {
  display: table-cell;
  text-align: right;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/menu.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,cAAc;EACd,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,mBAAmB;EACnB,kBAAkB;EAClB,gBAAgB;EAChB,aAAa;EACb,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,SAAS;EACT,UAAU;EACV,cAAc;EACd,qBAAqB;AACvB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;;EAEE,wBAAwB;AAC1B;;AAEA;;EAEE,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;EACnB,iBAAiB;AACnB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-Menu {\n  z-index: 10000;\n  position: absolute;\n  top: 0;\n  left: 0;\n  white-space: nowrap;\n  overflow-x: hidden;\n  overflow-y: auto;\n  outline: none;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.lm-Menu-content {\n  margin: 0;\n  padding: 0;\n  display: table;\n  list-style-type: none;\n}\n\n.lm-Menu-item {\n  display: table-row;\n}\n\n.lm-Menu-item.lm-mod-hidden,\n.lm-Menu-item.lm-mod-collapsed {\n  display: none !important;\n}\n\n.lm-Menu-itemIcon,\n.lm-Menu-itemSubmenuIcon {\n  display: table-cell;\n  text-align: center;\n}\n\n.lm-Menu-itemLabel {\n  display: table-cell;\n  text-align: left;\n}\n\n.lm-Menu-itemShortcut {\n  display: table-cell;\n  text-align: right;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 13306:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-MenuBar {
  outline: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.lm-MenuBar-content {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  list-style-type: none;
}

.lm-MenuBar-item {
  box-sizing: border-box;
}

.lm-MenuBar-itemIcon,
.lm-MenuBar-itemLabel {
  display: inline-block;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/menubar.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,aAAa;EACb,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,SAAS;EACT,UAAU;EACV,aAAa;EACb,mBAAmB;EACnB,qBAAqB;AACvB;;AAEA;EACE,sBAAsB;AACxB;;AAEA;;EAEE,qBAAqB;AACvB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-MenuBar {\n  outline: none;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.lm-MenuBar-content {\n  margin: 0;\n  padding: 0;\n  display: flex;\n  flex-direction: row;\n  list-style-type: none;\n}\n\n.lm-MenuBar-item {\n  box-sizing: border-box;\n}\n\n.lm-MenuBar-itemIcon,\n.lm-MenuBar-itemLabel {\n  display: inline-block;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 66756:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-ScrollBar {
  display: flex;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.lm-ScrollBar[data-orientation='horizontal'] {
  flex-direction: row;
}

.lm-ScrollBar[data-orientation='vertical'] {
  flex-direction: column;
}

.lm-ScrollBar-button {
  box-sizing: border-box;
  flex: 0 0 auto;
}

.lm-ScrollBar-track {
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
}

.lm-ScrollBar-thumb {
  box-sizing: border-box;
  position: absolute;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/scrollbar.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,aAAa;EACb,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,sBAAsB;AACxB;;AAEA;EACE,sBAAsB;EACtB,cAAc;AAChB;;AAEA;EACE,sBAAsB;EACtB,kBAAkB;EAClB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,sBAAsB;EACtB,kBAAkB;AACpB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-ScrollBar {\n  display: flex;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.lm-ScrollBar[data-orientation='horizontal'] {\n  flex-direction: row;\n}\n\n.lm-ScrollBar[data-orientation='vertical'] {\n  flex-direction: column;\n}\n\n.lm-ScrollBar-button {\n  box-sizing: border-box;\n  flex: 0 0 auto;\n}\n\n.lm-ScrollBar-track {\n  box-sizing: border-box;\n  position: relative;\n  overflow: hidden;\n  flex: 1 1 auto;\n}\n\n.lm-ScrollBar-thumb {\n  box-sizing: border-box;\n  position: absolute;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 47372:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-SplitPanel-child {
  z-index: 0;
}

.lm-SplitPanel-handle {
  z-index: 1;
}

.lm-SplitPanel-handle.lm-mod-hidden {
  display: none !important;
}

.lm-SplitPanel-handle:after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: '';
}

.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle {
  cursor: ew-resize;
}

.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle {
  cursor: ns-resize;
}

.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle:after {
  left: 50%;
  min-width: 8px;
  transform: translateX(-50%);
}

.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle:after {
  top: 50%;
  min-height: 8px;
  transform: translateY(-50%);
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/splitpanel.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,SAAS;EACT,cAAc;EACd,2BAA2B;AAC7B;;AAEA;EACE,QAAQ;EACR,eAAe;EACf,2BAA2B;AAC7B","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-SplitPanel-child {\n  z-index: 0;\n}\n\n.lm-SplitPanel-handle {\n  z-index: 1;\n}\n\n.lm-SplitPanel-handle.lm-mod-hidden {\n  display: none !important;\n}\n\n.lm-SplitPanel-handle:after {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  content: '';\n}\n\n.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle {\n  cursor: ew-resize;\n}\n\n.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle {\n  cursor: ns-resize;\n}\n\n.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle:after {\n  left: 50%;\n  min-width: 8px;\n  transform: translateX(-50%);\n}\n\n.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle:after {\n  top: 50%;\n  min-height: 8px;\n  transform: translateY(-50%);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 45650:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-TabBar {
  display: flex;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.lm-TabBar[data-orientation='horizontal'] {
  flex-direction: row;
  align-items: flex-end;
}

.lm-TabBar[data-orientation='vertical'] {
  flex-direction: column;
  align-items: flex-end;
}

.lm-TabBar-content {
  margin: 0;
  padding: 0;
  display: flex;
  flex: 1 1 auto;
  list-style-type: none;
}

.lm-TabBar[data-orientation='horizontal'] > .lm-TabBar-content {
  flex-direction: row;
}

.lm-TabBar[data-orientation='vertical'] > .lm-TabBar-content {
  flex-direction: column;
}

.lm-TabBar-tab {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: none; /* Disable native Drag/Drop */
}

.lm-TabBar-tabIcon,
.lm-TabBar-tabCloseIcon {
  flex: 0 0 auto;
}

.lm-TabBar-tabLabel {
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
}

.lm-TabBar-tabInput {
  user-select: all;
  width: 100%;
  box-sizing: border-box;
}

.lm-TabBar-tab.lm-mod-hidden {
  display: none !important;
}

.lm-TabBar-addButton.lm-mod-hidden {
  display: none !important;
}

.lm-TabBar.lm-mod-dragging .lm-TabBar-tab {
  position: relative;
}

.lm-TabBar.lm-mod-dragging[data-orientation='horizontal'] .lm-TabBar-tab {
  left: 0;
  transition: left 150ms ease;
}

.lm-TabBar.lm-mod-dragging[data-orientation='vertical'] .lm-TabBar-tab {
  top: 0;
  transition: top 150ms ease;
}

.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging {
  transition: none;
}

.lm-TabBar-tabLabel .lm-TabBar-tabInput {
  user-select: all;
  width: 100%;
  box-sizing: border-box;
  background: inherit;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/tabbar.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,aAAa;EACb,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;AACnB;;AAEA;EACE,mBAAmB;EACnB,qBAAqB;AACvB;;AAEA;EACE,sBAAsB;EACtB,qBAAqB;AACvB;;AAEA;EACE,SAAS;EACT,UAAU;EACV,aAAa;EACb,cAAc;EACd,qBAAqB;AACvB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,sBAAsB;AACxB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,sBAAsB;EACtB,gBAAgB;EAChB,kBAAkB,EAAE,6BAA6B;AACnD;;AAEA;;EAEE,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,WAAW;EACX,sBAAsB;AACxB;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,OAAO;EACP,2BAA2B;AAC7B;;AAEA;EACE,MAAM;EACN,0BAA0B;AAC5B;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;EAChB,WAAW;EACX,sBAAsB;EACtB,mBAAmB;AACrB","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-TabBar {\n  display: flex;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.lm-TabBar[data-orientation='horizontal'] {\n  flex-direction: row;\n  align-items: flex-end;\n}\n\n.lm-TabBar[data-orientation='vertical'] {\n  flex-direction: column;\n  align-items: flex-end;\n}\n\n.lm-TabBar-content {\n  margin: 0;\n  padding: 0;\n  display: flex;\n  flex: 1 1 auto;\n  list-style-type: none;\n}\n\n.lm-TabBar[data-orientation='horizontal'] > .lm-TabBar-content {\n  flex-direction: row;\n}\n\n.lm-TabBar[data-orientation='vertical'] > .lm-TabBar-content {\n  flex-direction: column;\n}\n\n.lm-TabBar-tab {\n  display: flex;\n  flex-direction: row;\n  box-sizing: border-box;\n  overflow: hidden;\n  touch-action: none; /* Disable native Drag/Drop */\n}\n\n.lm-TabBar-tabIcon,\n.lm-TabBar-tabCloseIcon {\n  flex: 0 0 auto;\n}\n\n.lm-TabBar-tabLabel {\n  flex: 1 1 auto;\n  overflow: hidden;\n  white-space: nowrap;\n}\n\n.lm-TabBar-tabInput {\n  user-select: all;\n  width: 100%;\n  box-sizing: border-box;\n}\n\n.lm-TabBar-tab.lm-mod-hidden {\n  display: none !important;\n}\n\n.lm-TabBar-addButton.lm-mod-hidden {\n  display: none !important;\n}\n\n.lm-TabBar.lm-mod-dragging .lm-TabBar-tab {\n  position: relative;\n}\n\n.lm-TabBar.lm-mod-dragging[data-orientation='horizontal'] .lm-TabBar-tab {\n  left: 0;\n  transition: left 150ms ease;\n}\n\n.lm-TabBar.lm-mod-dragging[data-orientation='vertical'] .lm-TabBar-tab {\n  top: 0;\n  transition: top 150ms ease;\n}\n\n.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging {\n  transition: none;\n}\n\n.lm-TabBar-tabLabel .lm-TabBar-tabInput {\n  user-select: all;\n  width: 100%;\n  box-sizing: border-box;\n  background: inherit;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 80127:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-TabPanel-tabBar {
  z-index: 1;
}

.lm-TabPanel-stackedPanel {
  z-index: 0;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/tabpanel.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,UAAU;AACZ;;AAEA;EACE,UAAU;AACZ","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-TabPanel-tabBar {\n  z-index: 1;\n}\n\n.lm-TabPanel-stackedPanel {\n  z-index: 0;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 94933:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82971);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11368);
/* harmony import */ var _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _jupyterlab_builder_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_jupyterlab_builder_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/

.lm-Widget {
  box-sizing: border-box;
  position: relative;
}

.lm-Widget.lm-mod-hidden {
  display: none !important;
}
`, "",{"version":3,"sources":["webpack://./../node_modules/@lumino/widgets/style/widget.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;;;;;;;8EAO8E;;AAE9E;EACE,sBAAsB;EACtB,kBAAkB;AACpB;;AAEA;EACE,wBAAwB;AAC1B","sourcesContent":["/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n.lm-Widget {\n  box-sizing: border-box;\n  position: relative;\n}\n\n.lm-Widget.lm-mod-hidden {\n  display: none !important;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 11368:
/***/ ((module) => {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ 878:
/***/ ((module) => {

"use strict";


module.exports = function (url, options) {
  if (!options) {
    options = {};
  }
  if (!url) {
    return url;
  }
  url = String(url.__esModule ? url.default : url);

  // If url is already wrapped in quotes, remove them
  if (/^['"].*['"]$/.test(url)) {
    url = url.slice(1, -1);
  }
  if (options.hash) {
    url += options.hash;
  }

  // Should url be wrapped?
  // See https://drafts.csswg.org/css-values-3/#urls
  if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
    return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
  }
  return url;
};

/***/ }),

/***/ 82971:
/***/ ((module) => {

"use strict";


module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ }),

/***/ 94830:
/***/ ((module) => {

"use strict";


var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),

/***/ 99763:
/***/ ((module) => {

"use strict";


var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ }),

/***/ 80366:
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ }),

/***/ 28915:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =  true ? __webpack_require__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ }),

/***/ 80592:
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ }),

/***/ 17352:
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ }),

/***/ 92122:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_cell_toolbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81793);
/* harmony import */ var _jupyterlab_cell_toolbar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_cell_toolbar__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module cell-toolbar-extension
 */




const PLUGIN_ID = '@jupyterlab/cell-toolbar-extension:plugin';
const cellToolbar = {
    id: PLUGIN_ID,
    description: 'Add the cells toolbar.',
    autoStart: true,
    activate: async (app, settingRegistry, toolbarRegistry, translator) => {
        /**
         * Load the settings for this extension
         *
         * @param setting Extension settings
         */
        function loadSetting(setting) {
            // Read the setting and convert to the correct type
            const showCellToolbar = setting === null
                ? true
                : setting.get('showToolbar').composite;
            extension.enabled = showCellToolbar;
        }
        const toolbarItems = settingRegistry && toolbarRegistry
            ? (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.createToolbarFactory)(toolbarRegistry, settingRegistry, _jupyterlab_cell_toolbar__WEBPACK_IMPORTED_MODULE_1__.CellBarExtension.FACTORY_NAME, cellToolbar.id, translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator)
            : undefined;
        const extension = new _jupyterlab_cell_toolbar__WEBPACK_IMPORTED_MODULE_1__.CellBarExtension(app.commands, toolbarItems);
        // Wait for the application to be restored and
        // for the settings for this plugin to be loaded
        if (settingRegistry !== null) {
            void Promise.all([app.restored, settingRegistry.load(PLUGIN_ID)]).then(([, setting]) => {
                // Read the settings
                loadSetting(setting);
                // Listen for your plugin setting changes using Signal
                setting.changed.connect(loadSetting);
            });
        }
        app.docRegistry.addWidgetExtension('Notebook', extension);
    },
    optional: [_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_0__.ISettingRegistry, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.IToolbarWidgetRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator]
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cellToolbar);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 15491:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var widgets_style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/cells/style/index.js + 2 modules
var cells_style = __webpack_require__(33230);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/notebook/style/index.js + 1 modules
var notebook_style = __webpack_require__(47456);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/cell-toolbar/style/base.css
var base = __webpack_require__(73197);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cell-toolbar/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cell-toolbar/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cell-toolbar-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 37386:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CellBarExtension: () => (/* reexport */ CellBarExtension),
  CellToolbarTracker: () => (/* reexport */ CellToolbarTracker)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var lib_index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cell-toolbar/lib/celltoolbartracker.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/






/*
 * Text mime types
 */
const TEXT_MIME_TYPES = [
    'text/plain',
    'application/vnd.jupyter.stdout',
    'application/vnd.jupyter.stderr'
];
/**
 * Widget cell toolbar classes
 */
const CELL_TOOLBAR_CLASS = 'jp-cell-toolbar';
// @deprecated to be removed
const CELL_MENU_CLASS = 'jp-cell-menu';
/**
 * Class for a cell whose contents overlap with the cell toolbar
 */
const TOOLBAR_OVERLAP_CLASS = 'jp-toolbar-overlap';
/**
 * Watch a notebook so that a cell toolbar appears on the active cell
 */
class CellToolbarTracker {
    /**
     * CellToolbarTracker constructor
     *
     * @param panel The notebook panel
     * @param toolbar The toolbar; deprecated use {@link toolbarFactory} instead
     * @param toolbarFactory The toolbar factory
     */
    constructor(panel, toolbar, toolbarFactory, translator) {
        this._isDisposed = false;
        this._toolbar = null;
        this._toolbarItems = null;
        this._toolbarFactory = null;
        this._panel = panel;
        this._previousActiveCell = this._panel.content.activeCell;
        this._toolbarItems = toolbar !== null && toolbar !== void 0 ? toolbar : null;
        this._toolbarFactory = toolbarFactory !== null && toolbarFactory !== void 0 ? toolbarFactory : null;
        this._enabled = true; // If this has been set to false, it will be modified after settings are available
        this._trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        if (this._toolbarItems === null && this._toolbarFactory === null) {
            throw Error('You must provide the toolbarFactory or the toolbar items.');
        }
        // deprecated to be removed when we remove toolbar from input arguments
        if (!this._toolbarFactory && this._toolbarItems) {
            this._onToolbarChanged();
            this._toolbarItems.changed.connect(this._onToolbarChanged, this);
        }
        // Only add the toolbar to the notebook's active cell (if any) once it has fully rendered and been revealed.
        void panel.revealed.then(() => {
            requestAnimationFrame(() => {
                const notebook = panel.content;
                this._onActiveCellChanged(notebook);
                // Handle subsequent changes of active cell.
                notebook.activeCellChanged.connect(this._onActiveCellChanged, this);
                // Check whether the toolbar should be rendered upon a layout change
                notebook.renderingLayoutChanged.connect(this._onActiveCellChanged, this);
                notebook.disposed.connect(() => {
                    notebook.activeCellChanged.disconnect(this._onActiveCellChanged);
                });
            });
        });
    }
    /**
     * @deprecated Will become protected in JupyterLab 5
     */
    _onMetadataChanged(model, args) {
        if (args.key === 'jupyter') {
            if (typeof args.newValue === 'object' &&
                args.newValue.source_hidden === true &&
                (args.type === 'add' || args.type === 'change')) {
                // Cell just became hidden; remove toolbar
                this._removeToolbar(model);
            }
            // Check whether input visibility changed
            else if (typeof args.oldValue === 'object' &&
                args.oldValue.source_hidden === true) {
                // Cell just became visible; add toolbar
                this._addToolbar(model);
            }
        }
    }
    /**
     * @deprecated Will become protected in JupyterLab 5
     */
    _onActiveCellChanged(notebook) {
        if (this._previousActiveCell && !this._previousActiveCell.isDisposed) {
            // Disposed cells do not have a model anymore.
            this._removeToolbar(this._previousActiveCell.model);
            this._previousActiveCell.model.metadataChanged.disconnect(this._onMetadataChanged);
        }
        const activeCell = notebook.activeCell;
        // Change previously active cell.
        this._previousActiveCell = activeCell;
        if (activeCell === null || activeCell.inputHidden) {
            return;
        }
        activeCell.model.metadataChanged.connect(this._onMetadataChanged, this);
        this._addToolbar(activeCell.model);
    }
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Whether the cell toolbar is shown, if there is enough room
     */
    get enabled() {
        return this._enabled;
    }
    /**
     * Sets whether the cell toolbar is shown, if there is enough room
     */
    set enabled(value) {
        this._enabled = value;
        this._onToolbarChanged();
    }
    dispose() {
        var _a, _b;
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        (_a = this._toolbarItems) === null || _a === void 0 ? void 0 : _a.changed.disconnect(this._onToolbarChanged, this);
        (_b = this._toolbar) === null || _b === void 0 ? void 0 : _b.dispose();
        this._panel = null;
        dist_index_es6_js_.Signal.clearData(this);
    }
    _addToolbar(model) {
        // Do nothing if the toolbar shouldn't be visible.
        if (!this.enabled) {
            return;
        }
        const cell = this._getCell(model);
        if (cell && !cell.isDisposed) {
            const toolbarWidget = (this._toolbar = new ui_components_lib_index_js_.Toolbar());
            // Note: CELL_MENU_CLASS is deprecated.
            toolbarWidget.addClass(CELL_MENU_CLASS);
            toolbarWidget.addClass(CELL_TOOLBAR_CLASS);
            toolbarWidget.node.setAttribute('aria-label', this._trans.__('Cell toolbar'));
            const promises = [cell.ready];
            if (this._toolbarFactory) {
                // Use our custom factory directly instead of setToolbar
                const toolbarItems = this._toolbarFactory(cell);
                for (const { name, widget } of toolbarItems) {
                    toolbarWidget.addItem(name, widget);
                    if (widget instanceof ui_components_lib_index_js_.ReactWidget &&
                        widget.renderPromise !== undefined) {
                        widget.update();
                        promises.push(widget.renderPromise);
                    }
                }
            }
            else {
                for (const { name, widget } of this._toolbarItems) {
                    toolbarWidget.addItem(name, widget);
                    if (widget instanceof ui_components_lib_index_js_.ReactWidget &&
                        widget.renderPromise !== undefined) {
                        widget.update();
                        promises.push(widget.renderPromise);
                    }
                }
            }
            promises.push(cell.ready);
            // Wait for all the buttons to be rendered before attaching the toolbar.
            Promise.all(promises)
                .then(() => {
                var _a;
                if (cell.isDisposed || ((_a = this._panel) === null || _a === void 0 ? void 0 : _a.content.activeCell) !== cell) {
                    toolbarWidget.dispose();
                    return;
                }
                // Hide the toolbar by default, to avoid temporary overlapping.
                cell.node.classList.add(TOOLBAR_OVERLAP_CLASS);
                cell.inputArea.layout.insertWidget(0, toolbarWidget);
                // For rendered markdown, watch for resize events.
                cell.displayChanged.connect(this._resizeEventCallback, this);
                // Watch for changes in the cell's contents.
                cell.model.contentChanged.connect(this._changedEventCallback, this);
                // Hide the cell toolbar if it overlaps with cell contents
                this._updateCellForToolbarOverlap(cell);
            })
                .catch(e => {
                console.error('Error rendering buttons of the cell toolbar: ', e);
            });
        }
    }
    _getCell(model) {
        var _a;
        return (_a = this._panel) === null || _a === void 0 ? void 0 : _a.content.widgets.find(widget => widget.model === model);
    }
    _removeToolbar(model) {
        var _a, _b;
        const cell = this._getCell(model);
        if (cell && !cell.isDisposed) {
            // Attempt to remove the resize and changed event handlers.
            cell.displayChanged.disconnect(this._resizeEventCallback, this);
        }
        model.contentChanged.disconnect(this._changedEventCallback, this);
        if (((_a = this._toolbar) === null || _a === void 0 ? void 0 : _a.parent) === (cell === null || cell === void 0 ? void 0 : cell.inputArea) &&
            ((_b = this._toolbar) === null || _b === void 0 ? void 0 : _b.isDisposed) === false) {
            this._toolbar.dispose();
        }
    }
    /**
     * Call back on settings changes
     *
     * @deprecated To remove when toolbar can not be provided directly to the tracker
     */
    _onToolbarChanged() {
        var _a;
        // Reset toolbar when settings changes
        const activeCell = (_a = this._panel) === null || _a === void 0 ? void 0 : _a.content.activeCell;
        if (activeCell) {
            this._removeToolbar(activeCell.model);
            this._addToolbar(activeCell.model);
        }
    }
    _changedEventCallback() {
        var _a;
        const activeCell = (_a = this._panel) === null || _a === void 0 ? void 0 : _a.content.activeCell;
        if (activeCell === null || activeCell === undefined) {
            return;
        }
        this._updateCellForToolbarOverlap(activeCell);
    }
    _resizeEventCallback() {
        var _a;
        const activeCell = (_a = this._panel) === null || _a === void 0 ? void 0 : _a.content.activeCell;
        if (activeCell === null || activeCell === undefined) {
            return;
        }
        this._updateCellForToolbarOverlap(activeCell);
    }
    _updateCellForToolbarOverlap(activeCell) {
        // When we do change in cell, the browser might not have completed the layout
        // update if we don't wait, resulting in the previous width being returned
        // using `getBoundingClientRect().width` in later functions. This also wait for
        // the toolbar to be rendered the first time (on page reload), allowing us to
        // retrieve the right widgets width.
        requestIdleCallback(() => {
            // Remove the "toolbar overlap" class from the cell, rendering the cell's toolbar
            const activeCellElement = activeCell.node;
            activeCellElement.classList.remove(TOOLBAR_OVERLAP_CLASS);
            if (this._cellToolbarOverlapsContents(activeCell)) {
                // Add the "toolbar overlap" class to the cell, completely concealing the toolbar,
                // if the first line of the content overlaps with it at all
                activeCellElement.classList.add(TOOLBAR_OVERLAP_CLASS);
            }
        });
    }
    _cellToolbarOverlapsContents(activeCell) {
        var _a, _b, _c, _d;
        // Fail safe when the active cell is not ready yet
        if (!activeCell.model) {
            return false;
        }
        const cellType = activeCell.model.type;
        // If the toolbar is too large for the current cell, hide it.
        const editorRect = (_a = activeCell.editorWidget) === null || _a === void 0 ? void 0 : _a.node.getBoundingClientRect();
        const cellLeft = (_b = editorRect === null || editorRect === void 0 ? void 0 : editorRect.left) !== null && _b !== void 0 ? _b : 0;
        const cellRight = (_c = editorRect === null || editorRect === void 0 ? void 0 : editorRect.right) !== null && _c !== void 0 ? _c : 0;
        const toolbarLeft = this._cellToolbarLeft(activeCell);
        if (toolbarLeft === null) {
            return false;
        }
        // The toolbar should not take up more than 50% of the cell.
        if ((cellLeft + cellRight) / 2 > toolbarLeft) {
            return true;
        }
        if (cellType === 'markdown' && activeCell.rendered) {
            // Check for overlap in rendered markdown content
            return this._markdownOverlapsToolbar(activeCell);
        }
        // Check for overlap in code content
        if (((_d = this._panel) === null || _d === void 0 ? void 0 : _d.content.renderingLayout) === 'default') {
            return this._codeOverlapsToolbar(activeCell);
        }
        else {
            return this._outputOverlapsToolbar(activeCell);
        }
    }
    /**
     * Check for overlap between rendered Markdown and the cell toolbar
     *
     * @param activeCell A rendered MarkdownCell
     * @returns `true` if the first line of the output overlaps with the cell toolbar, `false` otherwise
     */
    _markdownOverlapsToolbar(activeCell) {
        const markdownOutput = activeCell.inputArea; // Rendered markdown appears in the input area
        if (!markdownOutput) {
            return false;
        }
        // Get the rendered markdown as a widget.
        const markdownOutputWidget = markdownOutput.renderedInput;
        const markdownOutputElement = markdownOutputWidget.node;
        const firstOutputElementChild = markdownOutputElement.firstElementChild;
        if (firstOutputElementChild === null) {
            return false;
        }
        // Temporarily set the element's max width so that the bounding client rectangle only encompasses the content.
        const oldMaxWidth = firstOutputElementChild.style.maxWidth;
        firstOutputElementChild.style.maxWidth = 'max-content';
        const lineRight = firstOutputElementChild.getBoundingClientRect().right;
        // Reinstate the old max width.
        firstOutputElementChild.style.maxWidth = oldMaxWidth;
        const toolbarLeft = this._cellToolbarLeft(activeCell);
        return toolbarLeft === null ? false : lineRight > toolbarLeft;
    }
    _outputOverlapsToolbar(activeCell) {
        const outputArea = activeCell.outputArea.node;
        if (outputArea) {
            const outputs = outputArea.querySelectorAll('[data-mime-type]');
            const toolbarRect = this._cellToolbarRect(activeCell);
            if (toolbarRect) {
                const { left: toolbarLeft, bottom: toolbarBottom } = toolbarRect;
                return (0,index_es6_js_.some)(outputs, output => {
                    const node = output.firstElementChild;
                    if (node) {
                        const range = new Range();
                        if (TEXT_MIME_TYPES.includes(output.getAttribute('data-mime-type') || '')) {
                            // If the node is plain text, it's in a <pre>. To get the true bounding box of the
                            // text, the node contents need to be selected.
                            range.selectNodeContents(node);
                        }
                        else {
                            range.selectNode(node);
                        }
                        const { right: nodeRight, top: nodeTop } = range.getBoundingClientRect();
                        // Note: y-coordinate increases toward the bottom of page
                        return nodeRight > toolbarLeft && nodeTop < toolbarBottom;
                    }
                    return false;
                });
            }
        }
        return false;
    }
    _codeOverlapsToolbar(activeCell) {
        const editorWidget = activeCell.editorWidget;
        const editor = activeCell.editor;
        if (!editorWidget || !editor) {
            return false;
        }
        if (editor.lineCount < 1) {
            return false; // Nothing in the editor
        }
        const codeMirrorLines = editorWidget.node.getElementsByClassName('cm-line');
        if (codeMirrorLines.length < 1) {
            return false; // No lines present
        }
        let lineRight = codeMirrorLines[0].getBoundingClientRect().left;
        const range = document.createRange();
        range.selectNodeContents(codeMirrorLines[0]);
        lineRight += range.getBoundingClientRect().width;
        const toolbarLeft = this._cellToolbarLeft(activeCell);
        return toolbarLeft === null ? false : lineRight > toolbarLeft;
    }
    _cellToolbarRect(activeCell) {
        var _a;
        if (((_a = this._toolbar) === null || _a === void 0 ? void 0 : _a.parent) !== activeCell.inputArea) {
            return null;
        }
        const activeCellToolbar = this._toolbar.node;
        return activeCellToolbar.getBoundingClientRect();
    }
    _cellToolbarLeft(activeCell) {
        var _a;
        return ((_a = this._cellToolbarRect(activeCell)) === null || _a === void 0 ? void 0 : _a.left) || null;
    }
}
const defaultToolbarItems = [
    {
        command: 'notebook:duplicate-below',
        name: 'duplicate-cell'
    },
    {
        command: 'notebook:move-cell-up',
        name: 'move-cell-up'
    },
    {
        command: 'notebook:move-cell-down',
        name: 'move-cell-down'
    },
    {
        command: 'notebook:insert-cell-above',
        name: 'insert-cell-above'
    },
    {
        command: 'notebook:insert-cell-below',
        name: 'insert-cell-below'
    },
    {
        command: 'notebook:delete-cell',
        name: 'delete-cell'
    }
];
/**
 * Widget extension that creates a CellToolbarTracker each time a notebook is
 * created.
 */
class CellBarExtension {
    constructor(commands, toolbarFactory) {
        this._commands = commands;
        this._toolbarFactory = toolbarFactory !== null && toolbarFactory !== void 0 ? toolbarFactory : this.defaultToolbarFactory;
    }
    createItemFactory(commands) {
        return (0,index_js_.createDefaultFactory)(commands);
    }
    get defaultToolbarFactory() {
        const itemFactory = this.createItemFactory(this._commands);
        return (widget, commandArgs) => new lib_index_js_.ObservableList({
            values: defaultToolbarItems.map(item => {
                const itemWithArgs = commandArgs
                    ? {
                        ...item,
                        args: { ...item.args, ...commandArgs }
                    }
                    : item;
                return {
                    name: item.name,
                    widget: itemFactory(CellBarExtension.FACTORY_NAME, widget, itemWithArgs)
                };
            })
        });
    }
    createNew(panel) {
        // Create a factory that passes the widget ID to the toolbar factory
        const factoryWithWidgetId = (widget) => {
            return this._toolbarFactory(widget, {
                [CellBarExtension.WIDGET_ID_ARG]: panel.id
            });
        };
        return (this._tracker = new CellToolbarTracker(panel, undefined, factoryWithWidgetId));
    }
    /**
     * Whether the cell toolbar is displayed, if there is enough room for it
     */
    get enabled() {
        return this._tracker.enabled;
    }
    /**
     * Sets whether the cell toolbar is displayed, if there is enough room for it
     */
    set enabled(value) {
        if (this._tracker) {
            this._tracker.enabled = value;
        }
    }
}
CellBarExtension.FACTORY_NAME = 'Cell';
CellBarExtension.WIDGET_ID_ARG = 'widgetId';
//# sourceMappingURL=celltoolbartracker.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cell-toolbar/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module cell-toolbar
 */

//# sourceMappingURL=index.js.map

/***/ }),

/***/ 72479:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  AttachmentsCell: () => (/* reexport */ AttachmentsCell),
  AttachmentsCellModel: () => (/* reexport */ AttachmentsCellModel),
  Cell: () => (/* reexport */ Cell),
  CellDragUtils: () => (/* reexport */ CellDragUtils),
  CellFooter: () => (/* reexport */ CellFooter),
  CellHeader: () => (/* reexport */ CellHeader),
  CellModel: () => (/* reexport */ CellModel),
  CellSearchProvider: () => (/* reexport */ CellSearchProvider),
  CodeCell: () => (/* reexport */ CodeCell),
  CodeCellLayout: () => (/* reexport */ CodeCellLayout),
  CodeCellModel: () => (/* reexport */ CodeCellModel),
  Collapser: () => (/* reexport */ Collapser),
  InputArea: () => (/* reexport */ InputArea),
  InputCollapser: () => (/* reexport */ InputCollapser),
  InputPlaceholder: () => (/* reexport */ InputPlaceholder),
  InputPrompt: () => (/* reexport */ InputPrompt),
  MarkdownCell: () => (/* reexport */ MarkdownCell),
  MarkdownCellModel: () => (/* reexport */ MarkdownCellModel),
  OutputCollapser: () => (/* reexport */ OutputCollapser),
  OutputPlaceholder: () => (/* reexport */ OutputPlaceholder),
  Placeholder: () => (/* reexport */ Placeholder),
  RawCell: () => (/* reexport */ RawCell),
  RawCellModel: () => (/* reexport */ RawCellModel),
  SELECTED_HIGHLIGHT_CLASS: () => (/* reexport */ SELECTED_HIGHLIGHT_CLASS),
  createCellSearchProvider: () => (/* reexport */ createCellSearchProvider),
  isCodeCellModel: () => (/* reexport */ isCodeCellModel),
  isMarkdownCellModel: () => (/* reexport */ isMarkdownCellModel),
  isRawCellModel: () => (/* reexport */ isRawCellModel)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/virtualdom@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/virtualdom/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(17197);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/celldragutils.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * Constants for drag
 */
/**
 * The threshold in pixels to start a drag event.
 */
const DRAG_THRESHOLD = 5;
/**
 * The class name added to drag images.
 */
const DRAG_IMAGE_CLASS = 'jp-dragImage';
/**
 * The class name added to singular drag images
 */
const SINGLE_DRAG_IMAGE_CLASS = 'jp-dragImage-singlePrompt';
/**
 * The class name added to the drag image cell content.
 */
const CELL_DRAG_CONTENT_CLASS = 'jp-dragImage-content';
/**
 * The class name added to the drag image cell content.
 */
const CELL_DRAG_PROMPT_CLASS = 'jp-dragImage-prompt';
/**
 * The class name added to the drag image cell content.
 */
const CELL_DRAG_MULTIPLE_BACK = 'jp-dragImage-multipleBack';
var CellDragUtils;
(function (CellDragUtils) {
    /**
     * Find the cell index containing the target html element.
     * This function traces up the DOM hierarchy to find the root cell
     * node. Then find the corresponding child and select it.
     *
     * @param node - the cell node or a child of the cell node.
     * @param cells - an iterable of Cells
     * @param isCellNode - a function that takes in a node and checks if
     * it is a cell node.
     *
     * @returns index of the cell we're looking for. Returns -1 if
     * the cell is not founds
     */
    function findCell(node, cells, isCellNode) {
        let cellIndex = -1;
        while (node && node.parentElement) {
            if (isCellNode(node)) {
                let index = -1;
                for (const cell of cells) {
                    if (cell.node === node) {
                        cellIndex = ++index;
                        break;
                    }
                }
                break;
            }
            node = node.parentElement;
        }
        return cellIndex;
    }
    CellDragUtils.findCell = findCell;
    /**
     * Detect which part of the cell triggered the MouseEvent
     *
     * @param cell - The cell which contains the MouseEvent's target
     * @param target - The DOM node which triggered the MouseEvent
     */
    function detectTargetArea(cell, target) {
        var _a, _b;
        let targetArea;
        if (cell) {
            if ((_a = cell.editorWidget) === null || _a === void 0 ? void 0 : _a.node.contains(target)) {
                targetArea = 'input';
            }
            else if ((_b = cell.promptNode) === null || _b === void 0 ? void 0 : _b.contains(target)) {
                targetArea = 'prompt';
            }
            else {
                targetArea = 'cell';
            }
        }
        else {
            targetArea = 'unknown';
        }
        return targetArea;
    }
    CellDragUtils.detectTargetArea = detectTargetArea;
    /**
     * Detect if a drag event should be started. This is down if the
     * mouse is moved beyond a certain distance (DRAG_THRESHOLD).
     *
     * @param prevX - X Coordinate of the mouse pointer during the mousedown event
     * @param prevY - Y Coordinate of the mouse pointer during the mousedown event
     * @param nextX - Current X Coordinate of the mouse pointer
     * @param nextY - Current Y Coordinate of the mouse pointer
     */
    function shouldStartDrag(prevX, prevY, nextX, nextY) {
        const dx = Math.abs(nextX - prevX);
        const dy = Math.abs(nextY - prevY);
        return dx >= DRAG_THRESHOLD || dy >= DRAG_THRESHOLD;
    }
    CellDragUtils.shouldStartDrag = shouldStartDrag;
    /**
     * Create an image for the cell(s) to be dragged
     *
     * @param activeCell - The cell from where the drag event is triggered
     * @param selectedCells - The cells to be dragged
     */
    function createCellDragImage(activeCell, selectedCells) {
        const count = selectedCells.length;
        let promptNumber;
        if (activeCell.model.type === 'code') {
            const executionCount = activeCell.model
                .executionCount;
            promptNumber = ' ';
            if (executionCount) {
                promptNumber = executionCount.toString();
            }
        }
        else {
            promptNumber = '';
        }
        const cellContent = activeCell.model.sharedModel
            .getSource()
            .split('\n')[0]
            .slice(0, 26);
        if (count > 1) {
            if (promptNumber !== '') {
                return index_es6_js_.VirtualDOM.realize(index_es6_js_.h.div(index_es6_js_.h.div({ className: DRAG_IMAGE_CLASS }, index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }, '[' + promptNumber + ']:'), index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent)), index_es6_js_.h.div({ className: CELL_DRAG_MULTIPLE_BACK }, '')));
            }
            else {
                return index_es6_js_.VirtualDOM.realize(index_es6_js_.h.div(index_es6_js_.h.div({ className: DRAG_IMAGE_CLASS }, index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }), index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent)), index_es6_js_.h.div({ className: CELL_DRAG_MULTIPLE_BACK }, '')));
            }
        }
        else {
            if (promptNumber !== '') {
                return index_es6_js_.VirtualDOM.realize(index_es6_js_.h.div(index_es6_js_.h.div({ className: `${DRAG_IMAGE_CLASS} ${SINGLE_DRAG_IMAGE_CLASS}` }, index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }, '[' + promptNumber + ']:'), index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent))));
            }
            else {
                return index_es6_js_.VirtualDOM.realize(index_es6_js_.h.div(index_es6_js_.h.div({ className: `${DRAG_IMAGE_CLASS} ${SINGLE_DRAG_IMAGE_CLASS}` }, index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }), index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent))));
            }
        }
    }
    CellDragUtils.createCellDragImage = createCellDragImage;
})(CellDragUtils || (CellDragUtils = {}));
//# sourceMappingURL=celldragutils.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(19451);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/collapser.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/



/**
 * The CSS class added to all collapsers.
 */
const COLLAPSER_CLASS = 'jp-Collapser';
/**
 * The CSS class added to the collapser child.
 */
const COLLAPSER_CHILD_CLASS = 'jp-Collapser-child';
/**
 * The CSS class added to input collapsers.
 */
const INPUT_COLLAPSER = 'jp-InputCollapser';
/**
 * The CSS class added to output collapsers.
 */
const OUTPUT_COLLAPSER = 'jp-OutputCollapser';
/**
 * Abstract collapser base class.
 *
 * ### Notes
 * A collapser is a visible div to the left of a cell's
 * input/output that a user can click on to collapse the
 * input/output.
 */
class Collapser extends index_js_.ReactWidget {
    /**
     * Construct a new collapser.
     */
    constructor() {
        super();
        this.addClass(COLLAPSER_CLASS);
    }
    /**
     * Is the input/output of the parent collapsed.
     */
    get collapsed() {
        return false;
    }
    /**
     * Render the collapser with the virtual DOM.
     */
    render() {
        const childClass = COLLAPSER_CHILD_CLASS;
        return react_index_js_.createElement("div", { className: childClass, onClick: e => this.handleClick(e) });
    }
}
/**
 * A collapser subclass to collapse a cell's input area.
 */
class InputCollapser extends Collapser {
    /**
     * Construct a new input collapser.
     */
    constructor() {
        super();
        this.addClass(INPUT_COLLAPSER);
    }
    /**
     * Is the cell's input collapsed?
     */
    get collapsed() {
        var _a;
        const cell = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent;
        if (cell) {
            return cell.inputHidden;
        }
        else {
            return false;
        }
    }
    /**
     * Handle a click event for the user to collapse the cell's input.
     */
    handleClick(e) {
        var _a;
        const cell = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent;
        if (cell) {
            cell.inputHidden = !cell.inputHidden;
        }
        /* We need this until we watch the cell state */
        this.update();
    }
}
/**
 * A collapser subclass to collapse a cell's output area.
 */
class OutputCollapser extends Collapser {
    /**
     * Construct a new output collapser.
     */
    constructor() {
        super();
        this.addClass(OUTPUT_COLLAPSER);
    }
    /**
     * Is the cell's output collapsed?
     */
    get collapsed() {
        var _a;
        const cell = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent;
        if (cell) {
            return cell.outputHidden;
        }
        else {
            return false;
        }
    }
    /**
     * Handle a click event for the user to collapse the cell's output.
     */
    handleClick(e) {
        var _a, _b;
        const cell = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent;
        if (cell) {
            cell.outputHidden = !cell.outputHidden;
            /* Scroll cell into view after output collapse */
            if (cell.outputHidden) {
                let area = (_b = cell.parent) === null || _b === void 0 ? void 0 : _b.node;
                if (area) {
                    dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(area, cell.node);
                }
            }
        }
        /* We need this until we watch the cell state */
        this.update();
    }
}
//# sourceMappingURL=collapser.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/headerfooter.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * The CSS class added to the cell header.
 */
const CELL_HEADER_CLASS = 'jp-CellHeader';
/**
 * The CSS class added to the cell footer.
 */
const CELL_FOOTER_CLASS = 'jp-CellFooter';
/**
 * Default implementation of a cell header.
 */
class CellHeader extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new cell header.
     */
    constructor() {
        super();
        this.addClass(CELL_HEADER_CLASS);
    }
}
/**
 * Default implementation of a cell footer.
 */
class CellFooter extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new cell footer.
     */
    constructor() {
        super();
        this.addClass(CELL_FOOTER_CLASS);
    }
}
//# sourceMappingURL=headerfooter.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var lib_index_js_ = __webpack_require__(67458);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/inputarea.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/



/**
 * The class name added to input area widgets.
 */
const INPUT_AREA_CLASS = 'jp-InputArea';
/**
 * The class name added to the prompt area of cell.
 */
const INPUT_AREA_PROMPT_CLASS = 'jp-InputArea-prompt';
/**
 * The class name added to OutputPrompt.
 */
const INPUT_PROMPT_CLASS = 'jp-InputPrompt';
/**
 * The class name added to the editor area of the cell.
 */
const INPUT_AREA_EDITOR_CLASS = 'jp-InputArea-editor';
/** ****************************************************************************
 * InputArea
 ******************************************************************************/
/**
 * An input area widget, which hosts a prompt and an editor widget.
 */
class InputArea extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct an input area widget.
     */
    constructor(options) {
        super();
        this.addClass(INPUT_AREA_CLASS);
        const { contentFactory, editorOptions, model } = options;
        this.model = model;
        this.contentFactory = contentFactory;
        // Prompt
        const prompt = (this._prompt = contentFactory.createInputPrompt());
        prompt.addClass(INPUT_AREA_PROMPT_CLASS);
        // Editor
        const editor = (this._editor = new lib_index_js_.CodeEditorWrapper({
            factory: contentFactory.editorFactory,
            model,
            editorOptions
        }));
        editor.addClass(INPUT_AREA_EDITOR_CLASS);
        const layout = (this.layout = new widgets_dist_index_es6_js_.PanelLayout());
        layout.addWidget(prompt);
        layout.addWidget(editor);
    }
    /**
     * Get the CodeEditorWrapper used by the cell.
     */
    get editorWidget() {
        return this._editor;
    }
    /**
     * Get the CodeEditor used by the cell.
     */
    get editor() {
        return this._editor.editor;
    }
    /**
     * Get the prompt node used by the cell.
     */
    get promptNode() {
        return this._prompt.node;
    }
    /**
     * Get the rendered input area widget, if any.
     */
    get renderedInput() {
        return this._rendered;
    }
    /**
     * Render an input instead of the text editor.
     */
    renderInput(widget) {
        const layout = this.layout;
        if (this._rendered) {
            this._rendered.parent = null;
        }
        this._editor.hide();
        this._rendered = widget;
        layout.addWidget(widget);
    }
    /**
     * Show the text editor.
     */
    showEditor() {
        if (this._rendered) {
            this._rendered.parent = null;
        }
        this._editor.show();
    }
    /**
     * Set the prompt of the input area.
     */
    setPrompt(value) {
        this._prompt.executionCount = value;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        // Do nothing if already disposed.
        if (this.isDisposed) {
            return;
        }
        this._prompt = null;
        this._editor = null;
        this._rendered = null;
        super.dispose();
    }
}
/**
 * A namespace for `InputArea` statics.
 */
(function (InputArea) {
    /**
     * Default implementation of `IContentFactory`.
     *
     * This defaults to using an `editorFactory` based on CodeMirror.
     */
    class ContentFactory {
        /**
         * Construct a `ContentFactory`.
         */
        constructor(options) {
            this._editor = options.editorFactory;
        }
        /**
         * Return the `CodeEditor.Factory` being used.
         */
        get editorFactory() {
            return this._editor;
        }
        /**
         * Create an input prompt.
         */
        createInputPrompt() {
            return new InputPrompt();
        }
    }
    InputArea.ContentFactory = ContentFactory;
})(InputArea || (InputArea = {}));
/**
 * The default input prompt implementation.
 */
class InputPrompt extends widgets_dist_index_es6_js_.Widget {
    /*
     * Create an output prompt widget.
     */
    constructor() {
        super();
        this._executionCount = null;
        this.addClass(INPUT_PROMPT_CLASS);
    }
    /**
     * The execution count for the prompt.
     */
    get executionCount() {
        return this._executionCount;
    }
    set executionCount(value) {
        this._executionCount = value;
        if (value === null) {
            this.node.textContent = ' ';
        }
        else {
            this.node.textContent = `[${value || ' '}]:`;
        }
    }
}
//# sourceMappingURL=inputarea.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var signaling_dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/attachments@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/attachments/lib/index.js)
var attachments_lib_index_js_ = __webpack_require__(90914);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/outputarea@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/outputarea/lib/index.js)
var outputarea_lib_index_js_ = __webpack_require__(70315);
// EXTERNAL MODULE: consume shared module (default) @jupyter/ydoc@~3.1.0 (singleton) (fallback: ../node_modules/@jupyter/ydoc/lib/index.js)
var ydoc_lib_index_js_ = __webpack_require__(88162);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/model.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/





const globalModelDBMutex = (0,ydoc_lib_index_js_.createMutex)();
function isCodeCellModel(model) {
    return model.type === 'code';
}
function isMarkdownCellModel(model) {
    return model.type === 'markdown';
}
function isRawCellModel(model) {
    return model.type === 'raw';
}
/**
 * An implementation of the cell model.
 */
class CellModel extends lib_index_js_.CodeEditor.Model {
    constructor(options = {}) {
        const { cell_type, sharedModel, ...others } = options;
        super({
            sharedModel: sharedModel !== null && sharedModel !== void 0 ? sharedModel : (0,ydoc_lib_index_js_.createStandaloneCell)({
                cell_type: cell_type !== null && cell_type !== void 0 ? cell_type : 'raw',
                id: options.id
            }),
            ...others
        });
        /**
         * A signal emitted when the state of the model changes.
         */
        this.contentChanged = new signaling_dist_index_es6_js_.Signal(this);
        /**
         * A signal emitted when a model state changes.
         */
        this.stateChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._metadataChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._trusted = false;
        this.standaloneModel = typeof options.sharedModel === 'undefined';
        this.trusted = !!this.getMetadata('trusted') || !!options.trusted;
        this.sharedModel.changed.connect(this.onGenericChange, this);
        this.sharedModel.metadataChanged.connect(this._onMetadataChanged, this);
    }
    /**
     * Signal emitted when cell metadata changes.
     */
    get metadataChanged() {
        return this._metadataChanged;
    }
    /**
     * The id for the cell.
     */
    get id() {
        return this.sharedModel.getId();
    }
    /**
     * The metadata associated with the cell.
     */
    get metadata() {
        return this.sharedModel.metadata;
    }
    /**
     * The trusted state of the model.
     */
    get trusted() {
        return this._trusted;
    }
    set trusted(newValue) {
        const oldValue = this.trusted;
        if (oldValue !== newValue) {
            this._trusted = newValue;
            this.onTrustedChanged(this, { newValue, oldValue });
        }
    }
    /**
     * Dispose of the resources held by the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.sharedModel.changed.disconnect(this.onGenericChange, this);
        this.sharedModel.metadataChanged.disconnect(this._onMetadataChanged, this);
        super.dispose();
    }
    /**
     * Handle a change to the trusted state.
     *
     * The default implementation is a no-op.
     */
    onTrustedChanged(trusted, args) {
        /* no-op */
    }
    /**
     * Delete a metadata
     *
     * @param key Metadata key
     */
    deleteMetadata(key) {
        return this.sharedModel.deleteMetadata(key);
    }
    /**
     * Get a metadata
     *
     * ### Notes
     * This returns a copy of the key value.
     *
     * @param key Metadata key
     */
    getMetadata(key) {
        return this.sharedModel.getMetadata(key);
    }
    /**
     * Set a metadata
     *
     * @param key Metadata key
     * @param value Metadata value
     */
    setMetadata(key, value) {
        if (typeof value === 'undefined') {
            this.sharedModel.deleteMetadata(key);
        }
        else {
            this.sharedModel.setMetadata(key, value);
        }
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        return this.sharedModel.toJSON();
    }
    /**
     * Handle a change to the observable value.
     */
    onGenericChange() {
        this.contentChanged.emit(void 0);
    }
    _onMetadataChanged(sender, change) {
        this._metadataChanged.emit(change);
    }
}
/**
 * A base implementation for cell models with attachments.
 */
class AttachmentsCellModel extends CellModel {
    /**
     * Construct a new cell with optional attachments.
     */
    constructor(options) {
        var _a;
        super(options);
        const factory = (_a = options.contentFactory) !== null && _a !== void 0 ? _a : AttachmentsCellModel.defaultContentFactory;
        const values = this.sharedModel.getAttachments();
        this._attachments = factory.createAttachmentsModel({ values });
        this._attachments.stateChanged.connect(this.onGenericChange, this);
        this._attachments.changed.connect(this._onAttachmentsChange, this);
        this.sharedModel.changed.connect(this._onSharedModelChanged, this);
    }
    /**
     * Get the attachments of the model.
     */
    get attachments() {
        return this._attachments;
    }
    /**
     * Dispose of the resources held by the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._attachments.stateChanged.disconnect(this.onGenericChange, this);
        this._attachments.changed.disconnect(this._onAttachmentsChange, this);
        this._attachments.dispose();
        this.sharedModel.changed.disconnect(this._onSharedModelChanged, this);
        super.dispose();
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        return super.toJSON();
    }
    /**
     * Handle a change to the cell outputs modelDB and reflect it in the shared model.
     */
    _onAttachmentsChange(sender, event) {
        const cell = this.sharedModel;
        globalModelDBMutex(() => cell.setAttachments(sender.toJSON()));
    }
    /**
     * Handle a change to the code cell value.
     */
    _onSharedModelChanged(slot, change) {
        if (change.attachmentsChange) {
            const cell = this.sharedModel;
            globalModelDBMutex(() => { var _a; return this._attachments.fromJSON((_a = cell.getAttachments()) !== null && _a !== void 0 ? _a : {}); });
        }
    }
}
/**
 * The namespace for `AttachmentsCellModel` statics.
 */
(function (AttachmentsCellModel) {
    /**
     * The default implementation of an `IContentFactory`.
     */
    class ContentFactory {
        /**
         * Create an attachments model.
         */
        createAttachmentsModel(options) {
            return new attachments_lib_index_js_.AttachmentsModel(options);
        }
    }
    AttachmentsCellModel.ContentFactory = ContentFactory;
    /**
     * The shared `ContentFactory` instance.
     */
    AttachmentsCellModel.defaultContentFactory = new ContentFactory();
})(AttachmentsCellModel || (AttachmentsCellModel = {}));
/**
 * An implementation of a raw cell model.
 */
class RawCellModel extends AttachmentsCellModel {
    /**
     * Construct a raw cell model from optional shared model.
     */
    constructor(options = {}) {
        super({
            cell_type: 'raw',
            ...options
        });
    }
    /**
     * The type of the cell.
     */
    get type() {
        return 'raw';
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        return super.toJSON();
    }
}
/**
 * An implementation of a markdown cell model.
 */
class MarkdownCellModel extends AttachmentsCellModel {
    /**
     * Construct a markdown cell model from optional shared model.
     */
    constructor(options = {}) {
        super({
            cell_type: 'markdown',
            ...options
        });
        // Use the Github-flavored markdown mode.
        this.mimeType = 'text/x-ipythongfm';
    }
    /**
     * The type of the cell.
     */
    get type() {
        return 'markdown';
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        return super.toJSON();
    }
}
/**
 * An implementation of a code cell Model.
 */
class CodeCellModel extends CellModel {
    /**
     * Construct a new code cell with optional original cell content.
     */
    constructor(options = {}) {
        var _a;
        super({
            cell_type: 'code',
            ...options
        });
        this._executedCode = '';
        this._isDirty = false;
        const factory = (_a = options === null || options === void 0 ? void 0 : options.contentFactory) !== null && _a !== void 0 ? _a : CodeCellModel.defaultContentFactory;
        const trusted = this.trusted;
        const outputs = this.sharedModel.getOutputs();
        this._outputs = factory.createOutputArea({ trusted, values: outputs });
        this.sharedModel.changed.connect(this._onSharedModelChanged, this);
        this._outputs.changed.connect(this.onGenericChange, this);
        this._outputs.changed.connect(this.onOutputsChange, this);
    }
    /**
     * The type of the cell.
     */
    get type() {
        return 'code';
    }
    /**
     * The execution count of the cell.
     */
    get executionCount() {
        return this.sharedModel.execution_count || null;
    }
    set executionCount(newValue) {
        this.sharedModel.execution_count = newValue || null;
    }
    /**
     * The execution state of the cell.
     */
    get executionState() {
        return this.sharedModel.executionState;
    }
    set executionState(newValue) {
        this.sharedModel.executionState = newValue;
    }
    /**
     * Whether the cell is dirty or not.
     *
     * A cell is dirty if it is output is not empty and does not
     * result of the input code execution.
     */
    get isDirty() {
        // Test could be done dynamically with this._executedCode
        // but for performance reason, the diff status is stored in a boolean.
        return this._isDirty;
    }
    /**
     * Public Set whether the cell is dirty or not.
     */
    set isDirty(dirty) {
        this._setDirty(dirty);
    }
    /**
     * The cell outputs.
     */
    get outputs() {
        return this._outputs;
    }
    clearExecution() {
        this.outputs.clear();
        this.executionCount = null;
        this.executionState = 'idle';
        this._setDirty(false);
        this.sharedModel.deleteMetadata('execution');
        // We trust this cell as it no longer has any outputs.
        this.trusted = true;
    }
    /**
     * Dispose of the resources held by the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.sharedModel.changed.disconnect(this._onSharedModelChanged, this);
        this._outputs.changed.disconnect(this.onGenericChange, this);
        this._outputs.changed.disconnect(this.onOutputsChange, this);
        this._outputs.dispose();
        this._outputs = null;
        super.dispose();
    }
    /**
     * Handle a change to the trusted state.
     */
    onTrustedChanged(trusted, args) {
        const newTrusted = args.newValue;
        if (this._outputs) {
            this._outputs.trusted = newTrusted;
        }
        if (newTrusted) {
            const codeCell = this.sharedModel;
            const metadata = codeCell.getMetadata();
            metadata.trusted = true;
            codeCell.setMetadata(metadata);
        }
        this.stateChanged.emit({
            name: 'trusted',
            oldValue: args.oldValue,
            newValue: newTrusted
        });
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        return super.toJSON();
    }
    /**
     * Handle a change to the cell outputs modelDB and reflect it in the shared model.
     */
    onOutputsChange(sender, event) {
        const codeCell = this.sharedModel;
        globalModelDBMutex(() => {
            switch (event.type) {
                case 'add': {
                    for (const output of event.newValues) {
                        if (output.type === 'stream') {
                            output.streamText.changed.connect((sender, textEvent) => {
                                if (textEvent.options !== undefined &&
                                    textEvent.options['silent']) {
                                    return;
                                }
                                const codeCell = this.sharedModel;
                                if (textEvent.type === 'remove') {
                                    codeCell.removeStreamOutput(event.newIndex, textEvent.start, 'silent-change');
                                }
                                else {
                                    codeCell.appendStreamOutput(event.newIndex, textEvent.value, 'silent-change');
                                }
                            }, this);
                        }
                    }
                    const outputs = event.newValues.map(output => output.toJSON());
                    codeCell.updateOutputs(event.newIndex, event.newIndex, outputs, 'silent-change');
                    break;
                }
                case 'set': {
                    const newValues = event.newValues.map(output => output.toJSON());
                    codeCell.updateOutputs(event.oldIndex, event.oldIndex + newValues.length, newValues, 'silent-change');
                    break;
                }
                case 'remove':
                    codeCell.updateOutputs(event.oldIndex, event.oldValues.length, [], 'silent-change');
                    break;
                case 'clear':
                    codeCell.clearOutputs();
                    break;
                default:
                    throw new Error(`Invalid event type: ${event.type}`);
            }
        });
    }
    /**
     * Handle a change to the code cell value.
     */
    _onSharedModelChanged(slot, change) {
        if (change.streamOutputChange) {
            globalModelDBMutex(() => {
                for (const streamOutputChange of change.streamOutputChange) {
                    if ('delete' in streamOutputChange) {
                        this._outputs.removeStreamOutput(streamOutputChange.delete);
                    }
                    if ('insert' in streamOutputChange) {
                        this._outputs.appendStreamOutput(streamOutputChange.insert.toString());
                    }
                }
            });
        }
        if (change.outputsChange) {
            globalModelDBMutex(() => {
                let retain = 0;
                for (const outputsChange of change.outputsChange) {
                    if ('retain' in outputsChange) {
                        retain += outputsChange.retain;
                    }
                    if ('delete' in outputsChange) {
                        for (let i = 0; i < outputsChange.delete; i++) {
                            this._outputs.remove(retain);
                        }
                    }
                    if ('insert' in outputsChange) {
                        // Inserting an output always results in appending it.
                        for (const output of outputsChange.insert) {
                            // For compatibility with older ydoc where a plain object,
                            // (rather than a Map instance) could be provided.
                            // In a future major release the use of Map will be required.
                            this._outputs.add('toJSON' in output ? output.toJSON() : output);
                        }
                    }
                }
            });
        }
        if (change.executionCountChange) {
            this.stateChanged.emit({
                name: 'executionCount',
                oldValue: change.executionCountChange.oldValue,
                newValue: change.executionCountChange.newValue
            });
        }
        if (change.executionStateChange) {
            if (change.executionStateChange.newValue === 'running') {
                this._setDirty(false);
            }
            this.stateChanged.emit({
                name: 'executionState',
                oldValue: change.executionStateChange.oldValue,
                newValue: change.executionStateChange.newValue
            });
        }
        if (change.sourceChange &&
            (this.executionCount !== null || this.executionState === 'running')) {
            this._setDirty(this._executedCode !== this.sharedModel.getSource().trim());
        }
    }
    /**
     * Set whether the cell is dirty or not.
     */
    _setDirty(v) {
        if (!v) {
            this._executedCode = this.sharedModel.getSource().trim();
        }
        if (v !== this._isDirty) {
            this._isDirty = v;
            this.stateChanged.emit({
                name: 'isDirty',
                oldValue: !v,
                newValue: v
            });
        }
    }
}
/**
 * The namespace for `CodeCellModel` statics.
 */
(function (CodeCellModel) {
    /**
     * The default implementation of an `IContentFactory`.
     */
    class ContentFactory {
        /**
         * Create an output area.
         */
        createOutputArea(options) {
            return new outputarea_lib_index_js_.OutputAreaModel(options);
        }
    }
    CodeCellModel.ContentFactory = ContentFactory;
    /**
     * The shared `ContentFactory` instance.
     */
    CodeCellModel.defaultContentFactory = new ContentFactory();
})(CodeCellModel || (CodeCellModel = {}));
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/placeholder.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/



/**
 * The CSS class added to placeholders.
 */
const PLACEHOLDER_CLASS = 'jp-Placeholder';
/**
 * The CSS classes added to input placeholder prompts.
 */
const placeholder_INPUT_PROMPT_CLASS = 'jp-Placeholder-prompt jp-InputPrompt';
/**
 * The CSS classes added to output placeholder prompts.
 */
const OUTPUT_PROMPT_CLASS = 'jp-Placeholder-prompt jp-OutputPrompt';
/**
 * The CSS class added to placeholder content.
 */
const CONTENT_CLASS = 'jp-Placeholder-content';
/**
 * The CSS class added to input placeholders.
 */
const INPUT_PLACEHOLDER_CLASS = 'jp-InputPlaceholder';
/**
 * The CSS class added to output placeholders.
 */
const OUTPUT_PLACEHOLDER_CLASS = 'jp-OutputPlaceholder';
/**
 * An base class for placeholders
 *
 * ### Notes
 * A placeholder is the element that is shown when input/output
 * is hidden.
 */
class Placeholder extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new placeholder.
     */
    constructor(options) {
        var _a, _b, _c;
        const node = document.createElement('div');
        super({ node });
        const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const innerNode = document.createElement('div');
        innerNode.className = (_b = options.promptClass) !== null && _b !== void 0 ? _b : '';
        node.insertAdjacentHTML('afterbegin', innerNode.outerHTML);
        this._cell = document.createElement('div');
        this._cell.classList.add(CONTENT_CLASS);
        this._cell.title = trans.__('Click to expand');
        const container = this._cell.appendChild(document.createElement('div'));
        container.classList.add('jp-Placeholder-contentContainer');
        this._textContent = container.appendChild(document.createElement('span'));
        this._textContent.className = 'jp-PlaceholderText';
        this._textContent.innerText = (_c = options.text) !== null && _c !== void 0 ? _c : '';
        node.appendChild(this._cell);
        index_js_.ellipsesIcon.element({
            container: container.appendChild(document.createElement('span')),
            className: 'jp-MoreHorizIcon',
            elementPosition: 'center',
            height: 'auto',
            width: '32px'
        });
        this.addClass(PLACEHOLDER_CLASS);
        this._callback = options.callback;
    }
    /**
     * The text displayed in the placeholder.
     */
    set text(t) {
        this._textContent.innerText = t;
    }
    get text() {
        return this._textContent.innerText;
    }
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        this.node.addEventListener('click', this._callback);
    }
    onBeforeDetach(msg) {
        this.node.removeEventListener('click', this._callback);
        super.onBeforeDetach(msg);
    }
}
/**
 * The input placeholder class.
 */
class InputPlaceholder extends Placeholder {
    /**
     * Construct a new input placeholder.
     */
    constructor(options) {
        super({ ...options, promptClass: placeholder_INPUT_PROMPT_CLASS });
        this.addClass(INPUT_PLACEHOLDER_CLASS);
    }
}
/**
 * The output placeholder class.
 */
class OutputPlaceholder extends Placeholder {
    /**
     * Construct a new output placeholder.
     */
    constructor(options) {
        super({ ...options, promptClass: OUTPUT_PROMPT_CLASS });
        this.addClass(OUTPUT_PLACEHOLDER_CLASS);
    }
}
//# sourceMappingURL=placeholder.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codemirror@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codemirror/lib/index.js)
var codemirror_lib_index_js_ = __webpack_require__(84088);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/documentsearch@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/documentsearch/lib/index.js)
var documentsearch_lib_index_js_ = __webpack_require__(3894);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/searchprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Class applied on highlighted search matches
 */
const SELECTED_HIGHLIGHT_CLASS = 'jp-mod-selected';
/**
 * Search provider for cells.
 */
class CellSearchProvider extends codemirror_lib_index_js_.EditorSearchProvider {
    constructor(cell) {
        super();
        this.cell = cell;
        if (!this.cell.inViewport && !this.cell.editor) {
            void (0,coreutils_lib_index_js_.signalToPromise)(cell.inViewportChanged).then(([, inViewport]) => {
                if (inViewport) {
                    this.cmHandler.setEditor(this.editor);
                }
            });
        }
    }
    /**
     * Text editor
     */
    get editor() {
        return this.cell.editor;
    }
    /**
     * Editor content model
     */
    get model() {
        return this.cell.model;
    }
}
/**
 * Code cell search provider
 */
class CodeCellSearchProvider extends CellSearchProvider {
    /**
     * Constructor
     *
     * @param cell Cell widget
     */
    constructor(cell) {
        super(cell);
        this.currentProviderIndex = -1;
        this.outputsProvider = [];
        const outputs = this.cell.outputArea;
        this._onOutputsChanged(outputs, outputs.widgets.length).catch(reason => {
            console.error(`Failed to initialize search on cell outputs.`, reason);
        });
        outputs.outputLengthChanged.connect(this._onOutputsChanged, this);
        outputs.disposed.connect(() => {
            outputs.outputLengthChanged.disconnect(this._onOutputsChanged);
        }, this);
    }
    /**
     * Number of matches in the cell.
     */
    get matchesCount() {
        if (!this.isActive) {
            return 0;
        }
        return (super.matchesCount +
            this.outputsProvider.reduce((sum, provider) => { var _a; return sum + ((_a = provider.matchesCount) !== null && _a !== void 0 ? _a : 0); }, 0));
    }
    /**
     * Clear currently highlighted match.
     */
    async clearHighlight() {
        await super.clearHighlight();
        await Promise.all(this.outputsProvider.map(provider => provider.clearHighlight()));
    }
    /**
     * Dispose the search provider
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
        this.outputsProvider.map(provider => {
            provider.dispose();
        });
        this.outputsProvider.length = 0;
    }
    getCurrentMatch() {
        var _a;
        if (this.currentProviderIndex === -1) {
            return super.getCurrentMatch();
        }
        else if (this.currentProviderIndex < this.outputsProvider.length) {
            const provider = this.outputsProvider[this.currentProviderIndex];
            return (_a = provider.currentMatch) !== null && _a !== void 0 ? _a : undefined;
        }
    }
    /**
     * Highlight the next match.
     *
     * @returns The next match if there is one.
     */
    async highlightNext(loop, options) {
        var _a;
        // If we're scanning from the previous match, test whether we're
        // at the end of the matches list.
        const from = (_a = options === null || options === void 0 ? void 0 : options.from) !== null && _a !== void 0 ? _a : '';
        if (this.matchesCount === 0 ||
            (from === 'previous-match' &&
                this.currentIndex !== null &&
                this.currentIndex + 1 >= this.cmHandler.matches.length) ||
            !this.isActive) {
            this.currentIndex = null;
        }
        else {
            if (this.currentProviderIndex === -1) {
                const match = await super.highlightNext(loop, options);
                if (match) {
                    this.currentIndex = this.cmHandler.currentIndex;
                    return match;
                }
                else {
                    this.currentProviderIndex = 0;
                }
            }
            while (this.currentProviderIndex < this.outputsProvider.length) {
                const provider = this.outputsProvider[this.currentProviderIndex];
                const match = await provider.highlightNext(false);
                if (match) {
                    this.currentIndex =
                        super.matchesCount +
                            this.outputsProvider
                                .slice(0, this.currentProviderIndex)
                                .reduce((sum, provider) => { var _a; return (sum += (_a = provider.matchesCount) !== null && _a !== void 0 ? _a : 0); }, 0) +
                            provider.currentMatchIndex;
                    return match;
                }
                else {
                    this.currentProviderIndex += 1;
                }
            }
            this.currentProviderIndex = -1;
            this.currentIndex = null;
            return undefined;
        }
    }
    /**
     * Highlight the previous match.
     *
     * @returns The previous match if there is one.
     */
    async highlightPrevious() {
        if (this.matchesCount === 0 || !this.isActive) {
            this.currentIndex = null;
        }
        else {
            if (this.currentIndex === null) {
                this.currentProviderIndex = this.outputsProvider.length - 1;
            }
            while (this.currentProviderIndex >= 0) {
                const provider = this.outputsProvider[this.currentProviderIndex];
                const match = await provider.highlightPrevious(false);
                if (match) {
                    this.currentIndex =
                        super.matchesCount +
                            this.outputsProvider
                                .slice(0, this.currentProviderIndex)
                                .reduce((sum, provider) => { var _a; return (sum += (_a = provider.matchesCount) !== null && _a !== void 0 ? _a : 0); }, 0) +
                            provider.currentMatchIndex;
                    return match;
                }
                else {
                    this.currentProviderIndex -= 1;
                }
            }
            const match = await super.highlightPrevious();
            if (match) {
                this.currentIndex = this.cmHandler.currentIndex;
                return match;
            }
            else {
                this.currentIndex = null;
                return undefined;
            }
        }
    }
    /**
     * Initialize the search using the provided options. Should update the UI to highlight
     * all matches and "select" the first match.
     *
     * @param query A RegExp to be use to perform the search
     * @param filters Filter parameters to pass to provider
     */
    async startQuery(query, filters) {
        await super.startQuery(query, filters);
        // Search outputs
        if ((filters === null || filters === void 0 ? void 0 : filters.output) !== false && this.isActive) {
            await Promise.all(this.outputsProvider.map(provider => provider.startQuery(query)));
        }
    }
    async endQuery() {
        var _a;
        await super.endQuery();
        if (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.output) !== false && this.isActive) {
            await Promise.all(this.outputsProvider.map(provider => provider.endQuery()));
        }
    }
    /**
     * Replace all matches in the cell source with the provided text
     *
     * @param newText The replacement text.
     * @returns Whether a replace occurred.
     */
    async replaceAllMatches(newText, options) {
        if (this.model.getMetadata('editable') === false)
            return Promise.resolve(false);
        const result = await super.replaceAllMatches(newText, options);
        return result;
    }
    /**
     * Replace the currently selected match with the provided text.
     * If no match is selected, it won't do anything.
     *
     * @param newText The replacement text.
     * @returns Whether a replace occurred.
     */
    async replaceCurrentMatch(newText, loop, options) {
        if (this.model.getMetadata('editable') === false)
            return Promise.resolve(false);
        const result = await super.replaceCurrentMatch(newText, loop, options);
        return result;
    }
    async _onOutputsChanged(outputArea, changes) {
        var _a;
        this.outputsProvider.forEach(provider => {
            provider.dispose();
        });
        this.outputsProvider.length = 0;
        this.currentProviderIndex = -1;
        this.outputsProvider = this.cell.outputArea.widgets.map(output => new documentsearch_lib_index_js_.GenericSearchProvider(output));
        if (this.isActive && this.query && ((_a = this.filters) === null || _a === void 0 ? void 0 : _a.output) !== false) {
            await Promise.all([
                this.outputsProvider.map(provider => {
                    void provider.startQuery(this.query);
                })
            ]);
        }
        this._stateChanged.emit();
    }
}
/**
 * Markdown cell search provider
 */
class MarkdownCellSearchProvider extends CellSearchProvider {
    /**
     * Constructor
     *
     * @param cell Cell widget
     */
    constructor(cell) {
        super(cell);
        this._unrenderedByHighlight = false;
        this.renderedProvider = new documentsearch_lib_index_js_.GenericSearchProvider(cell.renderer);
    }
    /**
     * Clear currently highlighted match
     */
    async clearHighlight() {
        await super.clearHighlight();
        await this.renderedProvider.clearHighlight();
    }
    /**
     * Dispose the search provider
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
        this.renderedProvider.dispose();
    }
    /**
     * Stop the search and clean any UI elements.
     */
    async endQuery() {
        await super.endQuery();
        await this.renderedProvider.endQuery();
    }
    /**
     * Highlight the next match.
     *
     * @returns The next match if there is one.
     */
    async highlightNext(loop = true, options) {
        let match = undefined;
        if (!this.isActive) {
            return match;
        }
        const cell = this.cell;
        if (cell.rendered && this.matchesCount > 0) {
            // Unrender the cell
            this._unrenderedByHighlight = true;
            const waitForRendered = (0,coreutils_lib_index_js_.signalToPromise)(cell.renderedChanged);
            cell.rendered = false;
            await waitForRendered;
        }
        match = await super.highlightNext(loop, options);
        return match;
    }
    /**
     * Highlight the previous match.
     *
     * @returns The previous match if there is one.
     */
    async highlightPrevious() {
        let match = undefined;
        const cell = this.cell;
        if (cell.rendered && this.matchesCount > 0) {
            // Unrender the cell if there are matches within the cell
            this._unrenderedByHighlight = true;
            const waitForRendered = (0,coreutils_lib_index_js_.signalToPromise)(cell.renderedChanged);
            cell.rendered = false;
            await waitForRendered;
        }
        match = await super.highlightPrevious();
        return match;
    }
    /**
     * Initialize the search using the provided options. Should update the UI
     * to highlight all matches and "select" the first match.
     *
     * @param query A RegExp to be use to perform the search
     * @param filters Filter parameters to pass to provider
     */
    async startQuery(query, filters) {
        await super.startQuery(query, filters);
        const cell = this.cell;
        if (cell.rendered) {
            this.onRenderedChanged(cell, cell.rendered);
        }
        cell.renderedChanged.connect(this.onRenderedChanged, this);
    }
    /**
     * Replace all matches in the cell source with the provided text
     *
     * @param newText The replacement text.
     * @returns Whether a replace occurred.
     */
    async replaceAllMatches(newText, options) {
        if (this.model.getMetadata('editable') === false)
            return Promise.resolve(false);
        const result = await super.replaceAllMatches(newText, options);
        // if the cell is rendered force update
        if (this.cell.rendered) {
            this.cell.update();
        }
        return result;
    }
    /**
     * Replace the currently selected match with the provided text.
     * If no match is selected, it won't do anything.
     *
     * @param newText The replacement text.
     * @returns Whether a replace occurred.
     */
    async replaceCurrentMatch(newText, loop, options) {
        if (this.model.getMetadata('editable') === false)
            return Promise.resolve(false);
        const result = await super.replaceCurrentMatch(newText, loop, options);
        return result;
    }
    /**
     * Callback on rendered state change
     *
     * @param cell Cell that emitted the change
     * @param rendered New rendered value
     */
    onRenderedChanged(cell, rendered) {
        var _a;
        if (!this._unrenderedByHighlight) {
            this.currentIndex = null;
        }
        this._unrenderedByHighlight = false;
        if (this.isActive) {
            if (rendered) {
                void this.renderedProvider.startQuery(this.query);
            }
            else {
                // Force cursor position to ensure reverse search is working as expected
                (_a = cell.editor) === null || _a === void 0 ? void 0 : _a.setCursorPosition({ column: 0, line: 0 });
                void this.renderedProvider.endQuery();
            }
        }
    }
}
/**
 * Factory to create a cell search provider
 *
 * @param cell Cell widget
 * @returns Cell search provider
 */
function createCellSearchProvider(cell) {
    if (cell.isPlaceholder()) {
        return new CellSearchProvider(cell);
    }
    switch (cell.model.type) {
        case 'code':
            return new CodeCellSearchProvider(cell);
        case 'markdown':
            return new MarkdownCellSearchProvider(cell);
        default:
            return new CellSearchProvider(cell);
    }
}
//# sourceMappingURL=searchprovider.js.map
// EXTERNAL MODULE: consume shared module (default) @codemirror/view@~6.39.15 (singleton) (fallback: ../node_modules/@codemirror/view/dist/index.js)
var dist_index_js_ = __webpack_require__(1164);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/toc@^6.5.6 (strict) (fallback: ../node_modules/@jupyterlab/toc/lib/index.js)
var toc_lib_index_js_ = __webpack_require__(74853);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var coreutils_dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/resizeHandle.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



const RESIZE_HANDLE_CLASS = 'jp-CellResizeHandle';
const CELL_RESIZED_CLASS = 'jp-mod-resizedCell';
/**
 * A handle that allows to change input/output proportions in side-by-side mode.
 */
class ResizeHandle extends widgets_dist_index_es6_js_.Widget {
    constructor(targetNode) {
        super();
        this.targetNode = targetNode;
        this._isActive = false;
        this._isDragging = false;
        /**
         * A public signal used to indicate the size of the cell and output has changed.
         */
        this.sizeChanged = new signaling_dist_index_es6_js_.Signal(this);
        this.addClass(RESIZE_HANDLE_CLASS);
        this._resizer = new polling_dist_index_es6_js_.Throttler(event => this._resize(event), 50);
    }
    /**
     * Dispose the resizer handle.
     */
    dispose() {
        this._resizer.dispose();
        super.dispose();
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     */
    handleEvent(event) {
        var _a, _b;
        switch (event.type) {
            case 'dblclick':
                (_a = this.targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.childNodes.forEach(node => {
                    node.classList.remove(CELL_RESIZED_CLASS);
                });
                document.documentElement.style.setProperty('--jp-side-by-side-output-size', `1fr`);
                this._isActive = false;
                break;
            case 'mousedown':
                this._isDragging = true;
                if (!this._isActive) {
                    (_b = this.targetNode.parentNode) === null || _b === void 0 ? void 0 : _b.childNodes.forEach(node => {
                        node.classList.add(CELL_RESIZED_CLASS);
                    });
                    this._isActive = true;
                }
                window.addEventListener('mousemove', this);
                window.addEventListener('mouseup', this);
                break;
            case 'mousemove': {
                if (this._isActive && this._isDragging) {
                    void this._resizer.invoke(event);
                }
                break;
            }
            case 'mouseup':
                this._isDragging = false;
                window.removeEventListener('mousemove', this);
                window.removeEventListener('mouseup', this);
                break;
            default:
                break;
        }
    }
    /**
     * Handle `after-attach` messages.
     */
    onAfterAttach(msg) {
        this.node.addEventListener('dblclick', this);
        this.node.addEventListener('mousedown', this);
        super.onAfterAttach(msg);
    }
    /**
     * Handle `before-detach` messages.
     */
    onBeforeDetach(msg) {
        this.node.removeEventListener('dblclick', this);
        this.node.removeEventListener('mousedown', this);
        super.onBeforeDetach(msg);
    }
    _resize(event) {
        // Gate the output size ratio between {0.05, 50} as sensible defaults.
        const { width, x } = this.targetNode.getBoundingClientRect();
        const position = event.clientX - x;
        const ratio = width / position - 1;
        if (0 < ratio) {
            const normalized = Math.max(Math.min(Math.abs(ratio), 50), 0.05);
            document.documentElement.style.setProperty('--jp-side-by-side-output-size', `${normalized}fr`);
            this.sizeChanged.emit(normalized);
        }
    }
}
//# sourceMappingURL=resizeHandle.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/widget.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/





















/**
 * The CSS class added to cell widgets.
 */
const CELL_CLASS = 'jp-Cell';
/**
 * The CSS class added to the cell header.
 */
const widget_CELL_HEADER_CLASS = 'jp-Cell-header';
/**
 * The CSS class added to the cell footer.
 */
const widget_CELL_FOOTER_CLASS = 'jp-Cell-footer';
/**
 * The CSS class added to the cell input wrapper.
 */
const CELL_INPUT_WRAPPER_CLASS = 'jp-Cell-inputWrapper';
/**
 * The CSS class added to the cell output wrapper.
 */
const CELL_OUTPUT_WRAPPER_CLASS = 'jp-Cell-outputWrapper';
/**
 * The CSS class added to the cell input area.
 */
const CELL_INPUT_AREA_CLASS = 'jp-Cell-inputArea';
/**
 * The CSS class added to the cell output area.
 */
const CELL_OUTPUT_AREA_CLASS = 'jp-Cell-outputArea';
/**
 * The CSS class added to the cell input collapser.
 */
const CELL_INPUT_COLLAPSER_CLASS = 'jp-Cell-inputCollapser';
/**
 * The CSS class added to the cell output collapser.
 */
const CELL_OUTPUT_COLLAPSER_CLASS = 'jp-Cell-outputCollapser';
/**
 * The class name added to the cell when dirty.
 */
const DIRTY_CLASS = 'jp-mod-dirty';
/**
 * The class name added to code cells.
 */
const CODE_CELL_CLASS = 'jp-CodeCell';
/**
 * The class name added to markdown cells.
 */
const MARKDOWN_CELL_CLASS = 'jp-MarkdownCell';
/**
 * The class name added to rendered markdown output widgets.
 */
const MARKDOWN_OUTPUT_CLASS = 'jp-MarkdownOutput';
const MARKDOWN_HEADING_COLLAPSED = 'jp-MarkdownHeadingCollapsed';
const HEADING_COLLAPSER_CLASS = 'jp-collapseHeadingButton';
const SHOW_HIDDEN_CELLS_CLASS = 'jp-showHiddenCellsButton';
/**
 * The class name added to raw cells.
 */
const RAW_CELL_CLASS = 'jp-RawCell';
/**
 * The class name added to a rendered input area.
 */
const RENDERED_CLASS = 'jp-mod-rendered';
const NO_OUTPUTS_CLASS = 'jp-mod-noOutputs';
/**
 * The timeout to wait for change activity to have ceased before rendering.
 */
const RENDER_TIMEOUT = 1000;
/**
 * The mime type for a rich contents drag object.
 */
const CONTENTS_MIME_RICH = 'application/x-jupyter-icontentsrich';
/** ****************************************************************************
 * Cell
 ******************************************************************************/
/**
 * A base cell widget.
 */
class Cell extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new base cell widget.
     */
    constructor(options) {
        var _a, _b, _c, _d;
        super();
        this.prompt = '';
        this._displayChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._scrollRequested = new signaling_dist_index_es6_js_.Signal(this);
        /**
         * Editor extension emitting `scrollRequested` signal on scroll.
         *
         * Scrolling within editor will be prevented when a cell is out out viewport.
         * Windowed containers including cells should listen to the scroll request
         * signal and invoke the `scrollWithinCell()` callback after scrolling the cell
         * back into the view (and after updating the `inViewport` property).
         */
        this._scrollHandlerExtension = dist_index_js_.EditorView.scrollHandler.of((view, range, options) => {
            // When cell is in the viewport we can scroll within the editor immediately.
            // When cell is out of viewport, the windowed container needs to first
            // scroll the cell into the viewport (otherwise CodeMirror is unable to
            // calculate the correct scroll delta) before invoking scrolling in editor.
            const inWindowedContainer = this._inViewport !== null;
            const preventDefault = inWindowedContainer && !this._inViewport;
            this._scrollRequested.emit({
                defaultPrevented: preventDefault,
                scrollWithinCell: () => {
                    view.dispatch({
                        effects: dist_index_js_.EditorView.scrollIntoView(range, options)
                    });
                }
            });
            return preventDefault;
        });
        this._editorConfig = {};
        this._editorExtensions = [];
        this._inputHidden = false;
        this._inViewportChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._readOnly = false;
        this._ready = new coreutils_dist_index_js_.PromiseDelegate();
        this._resizeDebouncer = new polling_dist_index_es6_js_.Debouncer(() => {
            this._displayChanged.emit();
        }, 0);
        this._syncCollapse = false;
        this._syncEditable = false;
        this.addClass(CELL_CLASS);
        const model = (this._model = options.model);
        this.contentFactory = options.contentFactory;
        this.layout = (_a = options.layout) !== null && _a !== void 0 ? _a : new widgets_dist_index_es6_js_.PanelLayout();
        // Set up translator for aria labels
        this.translator = (_b = options.translator) !== null && _b !== void 0 ? _b : translation_lib_index_js_.nullTranslator;
        // For cells disable searching with CodeMirror search panel.
        this._editorConfig = { searchWithCM: false, ...options.editorConfig };
        this._editorExtensions = (_c = options.editorExtensions) !== null && _c !== void 0 ? _c : [];
        this._editorExtensions.push(this._scrollHandlerExtension);
        this._placeholder = true;
        this._inViewport = null;
        this.placeholder = (_d = options.placeholder) !== null && _d !== void 0 ? _d : true;
        model.metadataChanged.connect(this.onMetadataChanged, this);
    }
    /**
     * Initialize view state from model.
     *
     * #### Notes
     * Should be called after construction. For convenience, returns this, so it
     * can be chained in the construction, like `new Foo().initializeState();`
     */
    initializeState() {
        this.loadCollapseState();
        this.loadEditableState();
        return this;
    }
    /**
     * Signal to indicate that widget has changed visibly (in size, in type, etc)
     */
    get displayChanged() {
        return this._displayChanged;
    }
    /**
     * Whether the cell is in viewport or not.
     *
     * #### Notes
     * This property is managed by the windowed container which holds the cell.
     * When a cell is not in a windowed container, it always returns `false`,
     * but this may change in the future major version.
     */
    get inViewport() {
        var _a;
        return (_a = this._inViewport) !== null && _a !== void 0 ? _a : false;
    }
    set inViewport(v) {
        if (this._inViewport !== v) {
            this._inViewport = v;
            this._inViewportChanged.emit(this._inViewport);
        }
    }
    /**
     * Will emit true just after the node is attached to the DOM
     * Will emit false just before the node is detached of the DOM
     */
    get inViewportChanged() {
        return this._inViewportChanged;
    }
    /**
     * Whether the cell is a placeholder not yet fully rendered or not.
     */
    get placeholder() {
        return this._placeholder;
    }
    set placeholder(v) {
        if (this._placeholder !== v && v === false) {
            this.initializeDOM();
            this._placeholder = v;
            this._ready.resolve();
        }
    }
    /**
     * Get the prompt node used by the cell.
     */
    get promptNode() {
        if (this.placeholder) {
            return null;
        }
        if (!this._inputHidden) {
            return this._input.promptNode;
        }
        else {
            return this._inputPlaceholder.node
                .firstElementChild;
        }
    }
    /**
     * Get the CodeEditorWrapper used by the cell.
     */
    get editorWidget() {
        var _a, _b;
        return (_b = (_a = this._input) === null || _a === void 0 ? void 0 : _a.editorWidget) !== null && _b !== void 0 ? _b : null;
    }
    /**
     * Get the CodeEditor used by the cell.
     */
    get editor() {
        var _a, _b;
        return (_b = (_a = this._input) === null || _a === void 0 ? void 0 : _a.editor) !== null && _b !== void 0 ? _b : null;
    }
    /**
     * Editor configuration
     */
    get editorConfig() {
        return this._editorConfig;
    }
    /**
     * Cell headings
     *
     * @deprecated Use the asynchronous {@link getHeadings} method instead.
     * This getter only returns the last cached value.
     */
    get headings() {
        return new Array();
    }
    /**
     * Async Cell headings
     *
     */
    async getHeadings() {
        return [];
    }
    /**
     * Get the model used by the cell.
     */
    get model() {
        return this._model;
    }
    /**
     * Get the input area for the cell.
     */
    get inputArea() {
        return this._input;
    }
    /**
     * The read only state of the cell.
     */
    get readOnly() {
        return this._readOnly;
    }
    set readOnly(value) {
        if (value === this._readOnly) {
            return;
        }
        this._readOnly = value;
        if (this.syncEditable) {
            this.saveEditableState();
        }
        this.update();
    }
    /**
     * Whether the cell is a placeholder that defer rendering
     *
     * #### Notes
     * You can wait for the promise `Cell.ready` to wait for the
     * cell to be rendered.
     */
    isPlaceholder() {
        return this.placeholder;
    }
    /**
     * Save view editable state to model
     */
    saveEditableState() {
        const { sharedModel } = this.model;
        const current = sharedModel.getMetadata('editable');
        if ((this.readOnly && current === false) ||
            (!this.readOnly && current === undefined)) {
            return;
        }
        if (this.readOnly) {
            sharedModel.setMetadata('editable', false);
        }
        else {
            sharedModel.deleteMetadata('editable');
        }
    }
    /**
     * Load view editable state from model.
     */
    loadEditableState() {
        this.readOnly =
            this.model.sharedModel.getMetadata('editable') ===
                false;
    }
    /**
     * A promise that resolves when the widget renders for the first time.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Set the prompt for the widget.
     * @deprecated - set the `executionState` on the model instead.
     */
    setPrompt(value) {
        return this._setPrompt(value);
    }
    /**
     * Set the prompt for the widget.
     *
     * Note: this method is protected because it is needed in the CodeCell subclass,
     * but it cannot be defined there because input is private to Cell class.
     */
    _setPrompt(value) {
        var _a;
        this.prompt = value;
        (_a = this._input) === null || _a === void 0 ? void 0 : _a.setPrompt(value);
    }
    /**
     * The view state of input being hidden.
     */
    get inputHidden() {
        return this._inputHidden;
    }
    set inputHidden(value) {
        var _a;
        if (this._inputHidden === value) {
            return;
        }
        if (!this.placeholder) {
            const layout = this._inputWrapper.layout;
            if (value) {
                this._input.parent = null;
                if (this._inputPlaceholder) {
                    this._inputPlaceholder.text = (_a = this.model.sharedModel
                        .getSource()
                        .split('\n')) === null || _a === void 0 ? void 0 : _a[0];
                }
                layout.addWidget(this._inputPlaceholder);
            }
            else {
                this._inputPlaceholder.parent = null;
                layout.addWidget(this._input);
            }
        }
        this._inputHidden = value;
        if (this.syncCollapse) {
            this.saveCollapseState();
        }
        this.handleInputHidden(value);
    }
    /**
     * Save view collapse state to model
     */
    saveCollapseState() {
        const jupyter = { ...this.model.getMetadata('jupyter') };
        if ((this.inputHidden && jupyter.source_hidden === true) ||
            (!this.inputHidden && jupyter.source_hidden === undefined)) {
            return;
        }
        if (this.inputHidden) {
            jupyter.source_hidden = true;
        }
        else {
            delete jupyter.source_hidden;
        }
        if (Object.keys(jupyter).length === 0) {
            this.model.deleteMetadata('jupyter');
        }
        else {
            this.model.setMetadata('jupyter', jupyter);
        }
    }
    /**
     * Revert view collapse state from model.
     */
    loadCollapseState() {
        var _a;
        const jupyter = (_a = this.model.getMetadata('jupyter')) !== null && _a !== void 0 ? _a : {};
        this.inputHidden = !!jupyter.source_hidden;
    }
    /**
     * Handle the input being hidden.
     *
     * #### Notes
     * This is called by the `inputHidden` setter so that subclasses
     * can perform actions upon the input being hidden without accessing
     * private state.
     */
    handleInputHidden(value) {
        return;
    }
    /**
     * Whether to sync the collapse state to the cell model.
     */
    get syncCollapse() {
        return this._syncCollapse;
    }
    set syncCollapse(value) {
        if (this._syncCollapse === value) {
            return;
        }
        this._syncCollapse = value;
        if (value) {
            this.loadCollapseState();
        }
    }
    /**
     * Whether to sync the editable state to the cell model.
     */
    get syncEditable() {
        return this._syncEditable;
    }
    set syncEditable(value) {
        if (this._syncEditable === value) {
            return;
        }
        this._syncEditable = value;
        if (value) {
            this.loadEditableState();
        }
    }
    /**
     * Clone the cell, using the same model.
     */
    clone() {
        const constructor = this.constructor;
        return new constructor({
            model: this.model,
            contentFactory: this.contentFactory,
            placeholder: false,
            translator: this.translator
        });
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        // Do nothing if already disposed.
        if (this.isDisposed) {
            return;
        }
        this._resizeDebouncer.dispose();
        this._input = null;
        this._model = null;
        this._inputWrapper = null;
        this._inputPlaceholder = null;
        super.dispose();
    }
    /**
     * Update the editor configuration with the partial provided dictionary.
     *
     * @param v Partial editor configuration
     */
    updateEditorConfig(v) {
        this._editorConfig = { ...this._editorConfig, ...v };
        if (this.editor) {
            this.editor.setBaseOptions(this._editorConfig);
        }
    }
    /**
     * Signal emitted when cell requests scrolling to its element.
     */
    get scrollRequested() {
        return this._scrollRequested;
    }
    /**
     * Create children widgets.
     */
    initializeDOM() {
        if (!this.placeholder) {
            return;
        }
        const contentFactory = this.contentFactory;
        const model = this._model;
        // Header
        const header = contentFactory.createCellHeader();
        header.addClass(widget_CELL_HEADER_CLASS);
        this.layout.addWidget(header);
        // Input
        const inputWrapper = (this._inputWrapper = new widgets_dist_index_es6_js_.Panel());
        inputWrapper.addClass(CELL_INPUT_WRAPPER_CLASS);
        const inputCollapser = new InputCollapser();
        inputCollapser.addClass(CELL_INPUT_COLLAPSER_CLASS);
        const input = (this._input = new InputArea({
            model,
            contentFactory,
            editorOptions: this.getEditorOptions()
        }));
        input.addClass(CELL_INPUT_AREA_CLASS);
        inputWrapper.addWidget(inputCollapser);
        inputWrapper.addWidget(input);
        this.layout.addWidget(inputWrapper);
        this._inputPlaceholder = new InputPlaceholder({
            callback: () => {
                this.inputHidden = !this.inputHidden;
            },
            text: input.model.sharedModel.getSource().split('\n')[0],
            translator: this.translator
        });
        input.model.contentChanged.connect((sender, args) => {
            var _a;
            if (this._inputPlaceholder && this.inputHidden) {
                this._inputPlaceholder.text = (_a = sender.sharedModel
                    .getSource()
                    .split('\n')) === null || _a === void 0 ? void 0 : _a[0];
            }
        });
        if (this.inputHidden) {
            input.parent = null;
            inputWrapper.layout.addWidget(this._inputPlaceholder);
        }
        // Footer
        const footer = this.contentFactory.createCellFooter();
        footer.addClass(widget_CELL_FOOTER_CLASS);
        this.layout.addWidget(footer);
    }
    /**
     * Get the editor options at initialization.
     *
     * @returns Editor options
     */
    getEditorOptions() {
        return { config: this.editorConfig, extensions: this._editorExtensions };
    }
    /**
     * Handle `before-attach` messages.
     */
    onBeforeAttach(msg) {
        if (this.placeholder) {
            this.placeholder = false;
        }
    }
    /**
     * Handle `after-attach` messages.
     */
    onAfterAttach(msg) {
        this.update();
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        var _a;
        (_a = this.editor) === null || _a === void 0 ? void 0 : _a.focus();
    }
    /**
     * Handle `resize` messages.
     */
    onResize(msg) {
        void this._resizeDebouncer.invoke();
    }
    /**
     * Handle `update-request` messages.
     */
    onUpdateRequest(msg) {
        var _a, _b;
        if (!this._model) {
            return;
        }
        // Handle read only state.
        if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.getOption('readOnly')) !== this._readOnly) {
            (_b = this.editor) === null || _b === void 0 ? void 0 : _b.setOption('readOnly', this._readOnly);
        }
    }
    onContentChanged() {
        var _a;
        if (this.inputHidden && this._inputPlaceholder) {
            this._inputPlaceholder.text = (_a = this.model.sharedModel
                .getSource()
                .split('\n')) === null || _a === void 0 ? void 0 : _a[0];
        }
    }
    /**
     * Handle changes in the metadata.
     */
    onMetadataChanged(model, args) {
        switch (args.key) {
            case 'jupyter':
                if (this.syncCollapse) {
                    this.loadCollapseState();
                }
                break;
            case 'editable':
                if (this.syncEditable) {
                    this.loadEditableState();
                }
                break;
            default:
                break;
        }
    }
}
/**
 * The namespace for the `Cell` class statics.
 */
(function (Cell) {
    /**
     * Type of headings
     */
    let HeadingType;
    (function (HeadingType) {
        /**
         * Heading from HTML output
         */
        HeadingType[HeadingType["HTML"] = 0] = "HTML";
        /**
         * Heading from Markdown cell or Markdown output
         */
        HeadingType[HeadingType["Markdown"] = 1] = "Markdown";
    })(HeadingType = Cell.HeadingType || (Cell.HeadingType = {}));
    /**
     * The default implementation of an `IContentFactory`.
     *
     * This includes a CodeMirror editor factory to make it easy to use out of the box.
     */
    class ContentFactory {
        /**
         * Create a content factory for a cell.
         */
        constructor(options) {
            this._editorFactory = options.editorFactory;
        }
        /**
         * The readonly editor factory that create code editors
         */
        get editorFactory() {
            return this._editorFactory;
        }
        /**
         * Create a new cell header for the parent widget.
         */
        createCellHeader() {
            return new CellHeader();
        }
        /**
         * Create a new cell footer for the parent widget.
         */
        createCellFooter() {
            return new CellFooter();
        }
        /**
         * Create an input prompt.
         */
        createInputPrompt() {
            return new InputPrompt();
        }
        /**
         * Create the output prompt for the widget.
         */
        createOutputPrompt() {
            return new outputarea_lib_index_js_.OutputPrompt();
        }
        /**
         * Create an stdin widget.
         */
        createStdin(options) {
            return new outputarea_lib_index_js_.Stdin(options);
        }
    }
    Cell.ContentFactory = ContentFactory;
})(Cell || (Cell = {}));
/** ****************************************************************************
 * CodeCell
 ******************************************************************************/
/**
 * Code cell layout
 *
 * It will not detached the output area when the cell is detached.
 */
class CodeCellLayout extends widgets_dist_index_es6_js_.PanelLayout {
    /**
     * A message handler invoked on a `'before-attach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onBeforeAttach(msg) {
        let beforeOutputArea = true;
        const outputAreaWrapper = this.parent.node.firstElementChild;
        for (const widget of this) {
            if (outputAreaWrapper) {
                if (widget.node === outputAreaWrapper) {
                    beforeOutputArea = false;
                }
                else {
                    messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, msg);
                    if (beforeOutputArea) {
                        this.parent.node.insertBefore(widget.node, outputAreaWrapper);
                    }
                    else {
                        this.parent.node.appendChild(widget.node);
                    }
                    // Force setting isVisible to true as it requires the parent widget to be
                    // visible. But that flag will be set only during the `onAfterAttach` call.
                    if (!this.parent.isHidden) {
                        widget.setFlag(widgets_dist_index_es6_js_.Widget.Flag.IsVisible);
                    }
                    // Not called in NotebookWindowedLayout to avoid outputArea
                    // widgets unwanted update or reset.
                    messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, widgets_dist_index_es6_js_.Widget.Msg.AfterAttach);
                }
            }
        }
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onAfterDetach(msg) {
        for (const widget of this) {
            // TODO we could improve this further by removing outputs based
            // on their mime type (for example plain/text or markdown could safely be detached)
            // If the cell is out of the view port, its children are already detached -> skip detaching
            if (!widget.hasClass(CELL_OUTPUT_WRAPPER_CLASS) &&
                widget.node.isConnected) {
                // Not called in NotebookWindowedLayout for windowed notebook
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, widgets_dist_index_es6_js_.Widget.Msg.BeforeDetach);
                this.parent.node.removeChild(widget.node);
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, msg);
            }
        }
    }
}
/**
 * A widget for a code cell.
 */
class CodeCell extends Cell {
    /**
     * Construct a code cell widget.
     */
    constructor(options) {
        var _a;
        super({ layout: new CodeCellLayout(), ...options, placeholder: true });
        /**
         * Detect the movement of the caret in the output area.
         *
         * Emits scroll request if the caret moved.
         */
        this._detectCaretMovementInOuput = (e) => {
            const inWindowedContainer = this._inViewport !== null;
            const defaultPrevented = inWindowedContainer && !this._inViewport;
            // Because we do not want to scroll on any key, but only on keys which
            // move the caret (this on keys which cause input and on keys like left,
            // right, top, bottom arrow, home, end, page down/up - but only if the
            // cursor is not at the respective end of the input) we need to listen
            // to the `selectionchange` event on target inputs/textareas, etc.
            const target = e.target;
            if (!target || !(target instanceof HTMLElement)) {
                return;
            }
            // Make sure the previous listener gets disconnected
            if (this._lastTarget) {
                this._lastTarget.removeEventListener('selectionchange', this._lastOnCaretMovedHandler);
                document.removeEventListener('selectionchange', this._lastOnCaretMovedHandler);
            }
            const onCaretMoved = () => {
                this._scrollRequested.emit({
                    scrollWithinCell: ({ scroller }) => {
                        dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(scroller, target);
                    },
                    defaultPrevented
                });
            };
            // Remember the most recent target/handler to disconnect them next time.
            this._lastTarget = target;
            this._lastOnCaretMovedHandler = onCaretMoved;
            // Firefox only supports `selectionchange` on the actual input element,
            // all other browsers only support it on the top-level document.
            target.addEventListener('selectionchange', onCaretMoved, { once: true });
            document.addEventListener('selectionchange', onCaretMoved, {
                once: true
            });
            // Schedule removal of the listener.
            setTimeout(() => {
                target.removeEventListener('selectionchange', onCaretMoved);
                document.removeEventListener('selectionchange', onCaretMoved);
            }, 250);
        };
        this._headingsCache = null;
        this._outputHidden = false;
        this._outputWrapper = null;
        this._outputPlaceholder = null;
        this._syncScrolled = false;
        this._lastTarget = null;
        this._lastOutputHeight = '';
        this.addClass(CODE_CELL_CLASS);
        const trans = this.translator.load('jupyterlab');
        // Only save options not handled by parent constructor.
        const rendermime = (this._rendermime = options.rendermime);
        const contentFactory = this.contentFactory;
        const model = this.model;
        this.maxNumberOutputs = options.maxNumberOutputs;
        // Note that modifying the below label warrants one to also modify
        // the same in this._outputLengthHandler. Ideally, this label must
        // have been a constant and used in both places but it is not done
        // so because of limitations in the translation manager.
        const ariaLabel = model.outputs.length === 0
            ? trans.__('Code Cell Content')
            : trans.__('Code Cell Content with Output');
        this.node.setAttribute('aria-label', ariaLabel);
        const output = (this._output = new outputarea_lib_index_js_.OutputArea({
            model: this.model.outputs,
            rendermime,
            contentFactory: contentFactory,
            maxNumberOutputs: this.maxNumberOutputs,
            translator: this.translator,
            promptOverlay: true,
            inputHistoryScope: options.inputHistoryScope,
            showInputPlaceholder: options.showInputPlaceholder
        }));
        output.node.addEventListener('keydown', this._detectCaretMovementInOuput);
        output.addClass(CELL_OUTPUT_AREA_CLASS);
        output.toggleScrolling.connect(() => {
            this.outputsScrolled = !this.outputsScrolled;
        });
        output.initialize.connect(() => {
            this.updatePromptOverlayIcon();
        });
        // Defer setting placeholder as OutputArea must be instantiated before initializing the DOM
        this.placeholder = (_a = options.placeholder) !== null && _a !== void 0 ? _a : true;
        model.outputs.changed.connect(this.onOutputChanged, this);
        model.outputs.stateChanged.connect(this.onOutputChanged, this);
        model.stateChanged.connect(this.onStateChanged, this);
    }
    /**
     * Create children widgets.
     */
    initializeDOM() {
        if (!this.placeholder) {
            return;
        }
        super.initializeDOM();
        this._updatePrompt();
        // Insert the output before the cell footer.
        const outputWrapper = (this._outputWrapper = new widgets_dist_index_es6_js_.Panel());
        outputWrapper.addClass(CELL_OUTPUT_WRAPPER_CLASS);
        const outputCollapser = new OutputCollapser();
        outputCollapser.addClass(CELL_OUTPUT_COLLAPSER_CLASS);
        outputWrapper.addWidget(outputCollapser);
        // Set a CSS if there are no outputs, and connect a signal for future
        // changes to the number of outputs. This is for conditional styling
        // if there are no outputs.
        if (this.model.outputs.length === 0) {
            this.addClass(NO_OUTPUTS_CLASS);
        }
        this._output.outputLengthChanged.connect(this._outputLengthHandler, this);
        outputWrapper.addWidget(this._output);
        const layout = this.layout;
        const resizeHandle = new ResizeHandle(this.node);
        resizeHandle.sizeChanged.connect(this._sizeChangedHandler, this);
        layout.insertWidget(layout.widgets.length - 1, resizeHandle);
        layout.insertWidget(layout.widgets.length - 1, outputWrapper);
        if (this.model.isDirty) {
            this.addClass(DIRTY_CLASS);
        }
        this._outputPlaceholder = new OutputPlaceholder({
            callback: () => {
                this.outputHidden = !this.outputHidden;
            },
            text: this.getOutputPlaceholderText(),
            translator: this.translator
        });
        const layoutWrapper = outputWrapper.layout;
        if (this.outputHidden) {
            layoutWrapper.removeWidget(this._output);
            layoutWrapper.addWidget(this._outputPlaceholder);
            if (this.inputHidden && !outputWrapper.isHidden) {
                this._outputWrapper.hide();
            }
        }
        const trans = this.translator.load('jupyterlab');
        const ariaLabel = this.model.outputs.length === 0
            ? trans.__('Code Cell Content')
            : trans.__('Code Cell Content with Output');
        this.node.setAttribute('aria-label', ariaLabel);
    }
    getOutputPlaceholderText() {
        var _a;
        const firstOutput = this.model.outputs.get(0);
        const outputData = firstOutput === null || firstOutput === void 0 ? void 0 : firstOutput.data;
        if (!outputData) {
            return undefined;
        }
        const supportedOutputTypes = [
            'text/html',
            'image/svg+xml',
            'application/pdf',
            'text/markdown',
            'text/plain',
            'application/vnd.jupyter.stderr',
            'application/vnd.jupyter.stdout',
            'text'
        ];
        const preferredOutput = supportedOutputTypes.find(mt => {
            const data = firstOutput.data[mt];
            return (Array.isArray(data) ? typeof data[0] : typeof data) === 'string';
        });
        const dataToDisplay = firstOutput.data[preferredOutput !== null && preferredOutput !== void 0 ? preferredOutput : ''];
        if (dataToDisplay !== undefined) {
            return (_a = (Array.isArray(dataToDisplay)
                ? dataToDisplay
                : dataToDisplay === null || dataToDisplay === void 0 ? void 0 : dataToDisplay.split('\n'))) === null || _a === void 0 ? void 0 : _a.find(part => part !== '');
        }
        return undefined;
    }
    /**
     * Initialize view state from model.
     *
     * #### Notes
     * Should be called after construction. For convenience, returns this, so it
     * can be chained in the construction, like `new Foo().initializeState();`
     */
    initializeState() {
        super.initializeState();
        this.loadScrolledState();
        this._updatePrompt();
        return this;
    }
    get headings() {
        var _a;
        return (_a = this._headingsCache) !== null && _a !== void 0 ? _a : [];
    }
    async getHeadings() {
        if (!this._headingsCache) {
            const headings = [];
            // Iterate over the code cell outputs to check for Markdown or HTML from which we can generate ToC headings...
            const outputs = this.model.outputs;
            for (let j = 0; j < outputs.length; j++) {
                const m = outputs.get(j);
                let htmlType = null;
                let mdType = null;
                Object.keys(m.data).forEach(t => {
                    if (!mdType && toc_lib_index_js_.TableOfContentsUtils.Markdown.isMarkdown(t)) {
                        mdType = t;
                    }
                    else if (!htmlType && toc_lib_index_js_.TableOfContentsUtils.isHTML(t)) {
                        htmlType = t;
                    }
                });
                // Parse HTML output
                if (htmlType) {
                    let htmlData = m.data[htmlType];
                    if (typeof htmlData !== 'string') {
                        htmlData = htmlData.join('\n');
                    }
                    headings.push(...toc_lib_index_js_.TableOfContentsUtils.getHTMLHeadings(this._rendermime.sanitizer.sanitize(htmlData)).map(heading => {
                        return {
                            ...heading,
                            outputIndex: j,
                            type: Cell.HeadingType.HTML
                        };
                    }));
                }
                else if (mdType) {
                    const mdHeading = await toc_lib_index_js_.TableOfContentsUtils.Markdown.parseHeadings(m.data[mdType], this._rendermime.markdownParser);
                    headings.push(...mdHeading.map(heading => {
                        return {
                            ...heading,
                            outputIndex: j,
                            type: Cell.HeadingType.Markdown
                        };
                    }));
                }
            }
            this._headingsCache = headings;
        }
        return [...this._headingsCache];
    }
    /**
     * Get the output area for the cell.
     */
    get outputArea() {
        return this._output;
    }
    /**
     * The view state of output being collapsed.
     */
    get outputHidden() {
        return this._outputHidden;
    }
    set outputHidden(value) {
        var _a;
        if (this._outputHidden === value) {
            return;
        }
        if (!this.placeholder) {
            const layout = this._outputWrapper.layout;
            if (value) {
                layout.removeWidget(this._output);
                layout.addWidget(this._outputPlaceholder);
                if (this.inputHidden && !this._outputWrapper.isHidden) {
                    this._outputWrapper.hide();
                }
                if (this._outputPlaceholder) {
                    this._outputPlaceholder.text = (_a = this.getOutputPlaceholderText()) !== null && _a !== void 0 ? _a : '';
                }
            }
            else {
                if (this._outputWrapper.isHidden) {
                    this._outputWrapper.show();
                }
                layout.removeWidget(this._outputPlaceholder);
                layout.addWidget(this._output);
            }
        }
        this._outputHidden = value;
        if (this.syncCollapse) {
            this.saveCollapseState();
        }
    }
    /**
     * Save view collapse state to model
     */
    saveCollapseState() {
        // Because collapse state for a code cell involves two different pieces of
        // metadata (the `collapsed` and `jupyter` metadata keys), we block reacting
        // to changes in metadata until we have fully committed our changes.
        // Otherwise setting one key can trigger a write to the other key to
        // maintain the synced consistency.
        this.model.sharedModel.transact(() => {
            super.saveCollapseState();
            const collapsed = this.model.getMetadata('collapsed');
            if ((this.outputHidden && collapsed === true) ||
                (!this.outputHidden && collapsed === undefined)) {
                return;
            }
            // Do not set jupyter.outputs_hidden since it is redundant. See
            // and https://github.com/jupyter/nbformat/issues/137
            if (this.outputHidden) {
                this.model.setMetadata('collapsed', true);
            }
            else {
                this.model.deleteMetadata('collapsed');
            }
        }, false, 'silent-change');
    }
    /**
     * Revert view collapse state from model.
     *
     * We consider the `collapsed` metadata key as the source of truth for outputs
     * being hidden.
     */
    loadCollapseState() {
        super.loadCollapseState();
        this.outputHidden = !!this.model.getMetadata('collapsed');
    }
    /**
     * Whether the output is in a scrolled state?
     */
    get outputsScrolled() {
        return this._outputsScrolled;
    }
    set outputsScrolled(value) {
        this.toggleClass('jp-mod-outputsScrolled', value);
        this._outputsScrolled = value;
        if (this.syncScrolled) {
            this.saveScrolledState();
        }
        this.updatePromptOverlayIcon();
    }
    /**
     * Update the Prompt Overlay Icon
     */
    updatePromptOverlayIcon() {
        var _a;
        const overlay = apputils_lib_index_js_.DOMUtils.findElement(this.node, 'jp-OutputArea-promptOverlay');
        if (!overlay) {
            return;
        }
        // If you are changing this, don't forget about svg.
        const ICON_HEIGHT = 16 + 4 + 4; // 4px for padding
        if (overlay.clientHeight <= ICON_HEIGHT) {
            (_a = overlay.firstChild) === null || _a === void 0 ? void 0 : _a.remove();
            return;
        }
        let overlayTitle;
        if (this._outputsScrolled) {
            index_js_.expandIcon.element({
                container: overlay
            });
            overlayTitle = 'Expand Output';
        }
        else {
            index_js_.collapseIcon.element({
                container: overlay
            });
            overlayTitle = 'Collapse Output';
        }
        const trans = this.translator.load('jupyterlab');
        overlay.title = trans.__(overlayTitle);
    }
    /**
     * Save view collapse state to model
     */
    saveScrolledState() {
        const current = this.model.getMetadata('scrolled');
        if ((this.outputsScrolled && current === true) ||
            (!this.outputsScrolled && current === undefined)) {
            return;
        }
        if (this.outputsScrolled) {
            this.model.setMetadata('scrolled', true);
        }
        else {
            this.outputArea.node.style.height = '';
            this.model.deleteMetadata('scrolled');
        }
    }
    /**
     * Revert view collapse state from model.
     */
    loadScrolledState() {
        // We don't have the notion of 'auto' scrolled, so we make it false.
        if (this.model.getMetadata('scrolled') === 'auto') {
            this.outputsScrolled = false;
        }
        else {
            this.outputsScrolled = !!this.model.getMetadata('scrolled');
        }
    }
    /**
     * Whether to sync the scrolled state to the cell model.
     */
    get syncScrolled() {
        return this._syncScrolled;
    }
    set syncScrolled(value) {
        if (this._syncScrolled === value) {
            return;
        }
        this._syncScrolled = value;
        if (value) {
            this.loadScrolledState();
        }
    }
    /**
     * Handle the input being hidden.
     *
     * #### Notes
     * This method is called by the case cell implementation and is
     * subclasses here so the code cell can watch to see when input
     * is hidden without accessing private state.
     */
    handleInputHidden(value) {
        if (this.placeholder) {
            return;
        }
        if (!value && this._outputWrapper.isHidden) {
            this._outputWrapper.show();
        }
        else if (value && !this._outputWrapper.isHidden && this._outputHidden) {
            this._outputWrapper.hide();
        }
    }
    /**
     * Clone the cell, using the same model.
     */
    clone() {
        const constructor = this.constructor;
        return new constructor({
            model: this.model,
            contentFactory: this.contentFactory,
            rendermime: this._rendermime,
            placeholder: false,
            translator: this.translator
        });
    }
    /**
     * Clone the OutputArea alone, returning a simplified output area, using the same model.
     */
    cloneOutputArea() {
        return new outputarea_lib_index_js_.SimplifiedOutputArea({
            model: this.model.outputs,
            contentFactory: this.contentFactory,
            rendermime: this._rendermime
        });
    }
    /**
     * Dispose of the resources used by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._output.outputLengthChanged.disconnect(this._outputLengthHandler, this);
        this._output.node.removeEventListener('keydown', this._detectCaretMovementInOuput);
        this._rendermime = null;
        this._output = null;
        this._outputWrapper = null;
        this._outputPlaceholder = null;
        super.dispose();
    }
    /**
     * Handle changes in the model.
     */
    onStateChanged(model, args) {
        switch (args.name) {
            case 'executionCount':
                if (args.newValue !== null) {
                    // Mark execution state if execution count was set.
                    this.model.executionState = 'idle';
                }
                this._updatePrompt();
                break;
            case 'executionState':
                this._updatePrompt();
                break;
            case 'isDirty':
                if (model.isDirty) {
                    this.addClass(DIRTY_CLASS);
                }
                else {
                    this.removeClass(DIRTY_CLASS);
                }
                break;
            default:
                break;
        }
    }
    /**
     * Callback on output changes
     */
    onOutputChanged() {
        var _a;
        this._headingsCache = null;
        if (this._outputPlaceholder && this.outputHidden) {
            this._outputPlaceholder.text = (_a = this.getOutputPlaceholderText()) !== null && _a !== void 0 ? _a : '';
        }
        // This is to hide/show icon on single line output.
        this.updatePromptOverlayIcon();
        // Clear output area when empty
        const height = this.outputArea.node.style.height;
        if (this.model.outputs.length === 0 && height !== '') {
            this._lastOutputHeight = height;
            this.outputArea.node.style.height = '';
        }
        else if (this.model.outputs.length > 0 && height === '') {
            this.outputArea.node.style.height = this._lastOutputHeight;
        }
    }
    /**
     * Handle changes in the metadata.
     */
    onMetadataChanged(model, args) {
        switch (args.key) {
            case 'scrolled':
                if (this.syncScrolled) {
                    this.loadScrolledState();
                }
                break;
            case 'collapsed':
                if (this.syncCollapse) {
                    this.loadCollapseState();
                }
                break;
            default:
                break;
        }
        super.onMetadataChanged(model, args);
    }
    _updatePrompt() {
        let prompt;
        if (this.model.executionState == 'running') {
            prompt = '*';
        }
        else {
            prompt = `${this.model.executionCount || ''}`;
        }
        this._setPrompt(prompt);
    }
    /**
     * Handle changes in the number of outputs in the output area.
     */
    _outputLengthHandler(sender, args) {
        const force = args === 0 ? true : false;
        this.toggleClass(NO_OUTPUTS_CLASS, force);
        const trans = this.translator.load('jupyterlab');
        const ariaLabel = force
            ? trans.__('Code Cell Content')
            : trans.__('Code Cell Content with Output');
        this.node.setAttribute('aria-label', ariaLabel);
    }
    /**
     * Handle changes in input/output proportions in side-by-side mode.
     */
    _sizeChangedHandler(sender) {
        this._displayChanged.emit();
    }
}
/**
 * The namespace for the `CodeCell` class statics.
 */
(function (CodeCell) {
    /**
     * Execute a cell given a client session.
     */
    async function execute(cell, sessionContext, metadata) {
        var _a;
        const model = cell.model;
        const code = model.sharedModel.getSource();
        if (!code.trim() || !((_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel)) {
            model.sharedModel.transact(() => {
                model.clearExecution();
            }, false);
            return;
        }
        const cellId = { cellId: model.sharedModel.getId() };
        metadata = {
            ...model.metadata,
            ...metadata,
            ...cellId
        };
        const { recordTiming } = metadata;
        model.sharedModel.transact(() => {
            model.clearExecution();
            cell.outputHidden = false;
        }, false, 'silent-change');
        // note: in future we would like to distinguish running from scheduled
        model.executionState = 'running';
        model.trusted = true;
        let future;
        try {
            const msgPromise = outputarea_lib_index_js_.OutputArea.execute(code, cell.outputArea, sessionContext, metadata);
            // cell.outputArea.future assigned synchronously in `execute`
            if (recordTiming) {
                const recordTimingHook = (msg) => {
                    let label;
                    switch (msg.header.msg_type) {
                        case 'status':
                            label = `status.${msg.content.execution_state}`;
                            break;
                        case 'execute_input':
                            label = 'execute_input';
                            break;
                        default:
                            return true;
                    }
                    // If the data is missing, estimate it to now
                    // Date was added in 5.1: https://jupyter-client.readthedocs.io/en/stable/messaging.html#message-header
                    const value = msg.header.date || new Date().toISOString();
                    const timingInfo = Object.assign({}, model.getMetadata('execution'));
                    timingInfo[`iopub.${label}`] = value;
                    model.setMetadata('execution', timingInfo);
                    return true;
                };
                cell.outputArea.future.registerMessageHook(recordTimingHook);
            }
            else {
                model.deleteMetadata('execution');
            }
            // Save this execution's future so we can compare in the catch below.
            future = cell.outputArea.future;
            const msg = (await msgPromise);
            model.executionCount = msg.content.execution_count;
            if (recordTiming) {
                const timingInfo = Object.assign({}, model.getMetadata('execution'));
                const started = msg.metadata.started;
                // Started is not in the API, but metadata IPyKernel sends
                if (started) {
                    timingInfo['shell.execute_reply.started'] = started;
                }
                // Per above, the 5.0 spec does not assume date, so we estimate is required
                const finished = msg.header.date;
                timingInfo['shell.execute_reply'] =
                    finished || new Date().toISOString();
                model.setMetadata('execution', timingInfo);
            }
            return msg;
        }
        catch (e) {
            // If we started executing, and the cell is still indicating this
            // execution, clear the prompt.
            if (future && !cell.isDisposed && cell.outputArea.future === future) {
                cell.model.executionState = 'idle';
                if (recordTiming && future.isDisposed) {
                    // Record the time when the cell execution was aborted
                    const timingInfo = Object.assign({}, model.getMetadata('execution'));
                    timingInfo['execution_failed'] = new Date().toISOString();
                    model.setMetadata('execution', timingInfo);
                }
            }
            throw e;
        }
    }
    CodeCell.execute = execute;
})(CodeCell || (CodeCell = {}));
/**
 * `AttachmentsCell` - A base class for a cell widget that allows
 *  attachments to be drag/drop'd or pasted onto it
 */
class AttachmentsCell extends Cell {
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the notebook panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'lm-dragover':
                this._evtDragOver(event);
                break;
            case 'lm-drop':
                this._evtDrop(event);
                break;
            default:
                break;
        }
    }
    /**
     * Get the editor options at initialization.
     *
     * @returns Editor options
     */
    getEditorOptions() {
        var _a, _b;
        const base = (_a = super.getEditorOptions()) !== null && _a !== void 0 ? _a : {};
        base.extensions = [
            ...((_b = base.extensions) !== null && _b !== void 0 ? _b : []),
            dist_index_js_.EditorView.domEventHandlers({
                dragenter: (event) => {
                    event.preventDefault();
                },
                dragover: (event) => {
                    event.preventDefault();
                },
                drop: (event) => {
                    this._evtNativeDrop(event);
                },
                paste: (event) => {
                    this._evtPaste(event);
                }
            })
        ];
        return base;
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        const node = this.node;
        node.addEventListener('lm-dragover', this);
        node.addEventListener('lm-drop', this);
    }
    /**
     * A message handler invoked on a `'before-detach'`
     * message
     */
    onBeforeDetach(msg) {
        const node = this.node;
        node.removeEventListener('lm-dragover', this);
        node.removeEventListener('lm-drop', this);
        super.onBeforeDetach(msg);
    }
    _evtDragOver(event) {
        const supportedMimeType = (0,algorithm_dist_index_es6_js_.some)(rendermime_lib_index_js_.imageRendererFactory.mimeTypes, mimeType => {
            if (!event.mimeData.hasData(CONTENTS_MIME_RICH)) {
                return false;
            }
            const data = event.mimeData.getData(CONTENTS_MIME_RICH);
            return data.model.mimetype === mimeType;
        });
        if (!supportedMimeType) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        event.dropAction = event.proposedAction;
    }
    /**
     * Handle the `paste` event for the widget
     */
    _evtPaste(event) {
        var _a;
        const isEditable = (_a = this.model.getMetadata('editable')) !== null && _a !== void 0 ? _a : true;
        if (event.clipboardData && isEditable) {
            const items = event.clipboardData.items;
            for (let i = 0; i < items.length; i++) {
                if (items[i].type === 'text/plain') {
                    // Skip if this text is the path to a file
                    if (i < items.length - 1 && items[i + 1].kind === 'file') {
                        continue;
                    }
                    items[i].getAsString(text => {
                        var _a, _b;
                        (_b = (_a = this.editor).replaceSelection) === null || _b === void 0 ? void 0 : _b.call(_a, text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'));
                    });
                }
                this._attachFiles(event.clipboardData.items);
            }
        }
        event.preventDefault();
    }
    /**
     * Handle the `drop` event for the widget
     */
    _evtNativeDrop(event) {
        if (event.dataTransfer) {
            this._attachFiles(event.dataTransfer.items);
        }
        event.preventDefault();
    }
    /**
     * Handle the `'lm-drop'` event for the widget.
     */
    _evtDrop(event) {
        const supportedMimeTypes = event.mimeData.types().filter(mimeType => {
            if (mimeType === CONTENTS_MIME_RICH) {
                const data = event.mimeData.getData(CONTENTS_MIME_RICH);
                return (rendermime_lib_index_js_.imageRendererFactory.mimeTypes.indexOf(data.model.mimetype) !== -1);
            }
            return rendermime_lib_index_js_.imageRendererFactory.mimeTypes.indexOf(mimeType) !== -1;
        });
        if (supportedMimeTypes.length === 0) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        if (event.proposedAction === 'none') {
            event.dropAction = 'none';
            return;
        }
        event.dropAction = 'copy';
        for (const mimeType of supportedMimeTypes) {
            if (mimeType === CONTENTS_MIME_RICH) {
                const { model, withContent } = event.mimeData.getData(CONTENTS_MIME_RICH);
                if (model.type === 'file') {
                    const URI = this._generateURI(model.name);
                    this.updateCellSourceWithAttachment(model.name, URI);
                    void withContent().then(fullModel => {
                        this.model.attachments.set(URI, {
                            [fullModel.mimetype]: fullModel.content
                        });
                    });
                }
            }
            else {
                // Pure mimetype, no useful name to infer
                const URI = this._generateURI();
                this.model.attachments.set(URI, {
                    [mimeType]: event.mimeData.getData(mimeType)
                });
                this.updateCellSourceWithAttachment(URI, URI);
            }
        }
    }
    /**
     * Attaches all DataTransferItems (obtained from
     * clipboard or native drop events) to the cell
     */
    _attachFiles(items) {
        for (let i = 0; i < items.length; i++) {
            const item = items[i];
            if (item.kind === 'file') {
                const blob = item.getAsFile();
                if (blob) {
                    this._attachFile(blob);
                }
            }
        }
    }
    /**
     * Takes in a file object and adds it to
     * the cell attachments
     */
    _attachFile(blob) {
        const reader = new FileReader();
        reader.onload = evt => {
            const { href, protocol } = coreutils_lib_index_js_.URLExt.parse(reader.result);
            if (protocol !== 'data:') {
                return;
            }
            const dataURIRegex = /([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/;
            const matches = dataURIRegex.exec(href);
            if (!matches || matches.length !== 4) {
                return;
            }
            const mimeType = matches[1];
            const encodedData = matches[3];
            const bundle = { [mimeType]: encodedData };
            const URI = this._generateURI(blob.name);
            if (mimeType.startsWith('image/')) {
                this.model.attachments.set(URI, bundle);
                this.updateCellSourceWithAttachment(blob.name, URI);
            }
        };
        reader.onerror = evt => {
            console.error(`Failed to attach ${blob.name}` + evt);
        };
        reader.readAsDataURL(blob);
    }
    /**
     * Generates a unique URI for a file
     * while preserving the file extension.
     */
    _generateURI(name = '') {
        const lastIndex = name.lastIndexOf('.');
        return lastIndex !== -1
            ? coreutils_dist_index_js_.UUID.uuid4().concat(name.substring(lastIndex))
            : coreutils_dist_index_js_.UUID.uuid4();
    }
}
/** ****************************************************************************
 * MarkdownCell
 ******************************************************************************/
/**
 * A widget for a Markdown cell.
 *
 * #### Notes
 * Things get complicated if we want the rendered text to update
 * any time the text changes, the text editor model changes,
 * or the input area model changes.  We don't support automatically
 * updating the rendered text in all of these cases.
 */
class MarkdownCell extends AttachmentsCell {
    /**
     * Construct a Markdown cell widget.
     */
    constructor(options) {
        var _a, _b, _c, _d, _e;
        super({ ...options, placeholder: true });
        this._headingsCache = null;
        this._headingCollapsedChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._prevText = '';
        this._rendered = true;
        this._renderedChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._showEditorForReadOnlyMarkdown = true;
        this._cachedHeadingText = '';
        this._headingResolved = false;
        this.addClass(MARKDOWN_CELL_CLASS);
        this.model.contentChanged.connect(this.onContentChanged, this);
        const trans = this.translator.load('jupyterlab');
        this.node.setAttribute('aria-label', trans.__('Markdown Cell Content'));
        // Ensure we can resolve attachments:
        this._rendermime = options.rendermime.clone({
            resolver: new attachments_lib_index_js_.AttachmentsResolver({
                parent: (_a = options.rendermime.resolver) !== null && _a !== void 0 ? _a : undefined,
                model: this.model.attachments
            })
        });
        this._renderer = this._rendermime.createRenderer('text/markdown');
        this._renderer.addClass(MARKDOWN_OUTPUT_CLASS);
        // Check if heading cell is set to be collapsed
        this._headingCollapsed = ((_b = this.model.getMetadata(MARKDOWN_HEADING_COLLAPSED)) !== null && _b !== void 0 ? _b : false);
        this._showEditorForReadOnlyMarkdown =
            (_c = options.showEditorForReadOnlyMarkdown) !== null && _c !== void 0 ? _c : MarkdownCell.defaultShowEditorForReadOnlyMarkdown;
        // Defer setting placeholder as the renderer must be instantiated before initializing the DOM
        this.placeholder = (_d = options.placeholder) !== null && _d !== void 0 ? _d : true;
        this._monitor = new coreutils_lib_index_js_.ActivityMonitor({
            signal: this.model.contentChanged,
            timeout: RENDER_TIMEOUT
        });
        // Throttle the rendering rate of the widget.
        this.ready
            .then(() => {
            if (this.isDisposed) {
                // Bail early
                return;
            }
            this._monitor.activityStopped.connect(() => {
                if (this._rendered) {
                    this.update();
                }
            }, this);
        })
            .catch(reason => {
            console.error('Failed to be ready', reason);
        });
        this._cachedHeadingText = this.model.sharedModel.getSource();
        this._emptyPlaceholder =
            (_e = options.emptyPlaceholder) !== null && _e !== void 0 ? _e : trans.__('Type Markdown and LaTeX: $ α^2 $');
    }
    /**
     * Text that represents the highest heading (i.e. lowest level) if cell is a heading.
     * Returns empty string if not a heading.
     */
    get headingInfo() {
        // Use table of content algorithm for consistency
        const headings = this.headings;
        if (headings.length > 0) {
            // Return the highest level
            const { text, level } = headings.reduce((prev, curr) => (prev.level <= curr.level ? prev : curr), headings[0]);
            return { text, level };
        }
        else {
            return { text: '', level: -1 };
        }
    }
    get headings() {
        var _a;
        return (_a = this._headingsCache) !== null && _a !== void 0 ? _a : [];
    }
    /**
     * Parses and returns the list of Markdown headings in the cell.
     *
     * @returns A promise that resolves to an array of cell headings.
     *
     * @remarks
     * This method caches the result after the first call to avoid redundant parsing.
     **/
    async getHeadings() {
        if (!this._headingsCache) {
            const headings = await toc_lib_index_js_.TableOfContentsUtils.Markdown.parseHeadings(this.model.sharedModel.getSource(), this._rendermime.markdownParser);
            this._headingsCache = headings.map(h => {
                return { ...h, type: Cell.HeadingType.Markdown };
            });
            this._headingResolved = true;
            this.renderCollapseButtons();
        }
        return [...this._headingsCache];
    }
    /**
     * Whether the heading is collapsed or not.
     */
    get headingCollapsed() {
        return this._headingCollapsed;
    }
    set headingCollapsed(value) {
        var _a;
        if (this._headingCollapsed !== value) {
            this._headingCollapsed = value;
            if (value) {
                this.model.setMetadata(MARKDOWN_HEADING_COLLAPSED, value);
            }
            else if (this.model.getMetadata(MARKDOWN_HEADING_COLLAPSED) !== 'undefined') {
                this.model.deleteMetadata(MARKDOWN_HEADING_COLLAPSED);
            }
            const collapseButton = (_a = this.inputArea) === null || _a === void 0 ? void 0 : _a.promptNode.getElementsByClassName(HEADING_COLLAPSER_CLASS)[0];
            if (collapseButton) {
                if (value) {
                    collapseButton.classList.add('jp-mod-collapsed');
                }
                else {
                    collapseButton.classList.remove('jp-mod-collapsed');
                }
            }
            this.renderCollapseButtons(this._renderer);
            this._headingCollapsedChanged.emit(this._headingCollapsed);
        }
    }
    /**
     * Number of collapsed sub cells.
     */
    get numberChildNodes() {
        return this._numberChildNodes;
    }
    set numberChildNodes(value) {
        this._numberChildNodes = value;
        this.renderCollapseButtons(this._renderer);
    }
    /**
     * Signal emitted when the cell collapsed state changes.
     */
    get headingCollapsedChanged() {
        return this._headingCollapsedChanged;
    }
    /**
     * Whether the cell is rendered.
     */
    get rendered() {
        return this._rendered;
    }
    set rendered(value) {
        // Show cell as rendered when cell is not editable
        if (this.readOnly && this._showEditorForReadOnlyMarkdown === false) {
            value = true;
        }
        if (value === this._rendered) {
            return;
        }
        this._rendered = value;
        this._handleRendered()
            .then(() => {
            // If the rendered state changed, raise an event.
            this._displayChanged.emit();
            this._renderedChanged.emit(this._rendered);
        })
            .catch(reason => {
            console.error('Failed to render', reason);
        });
    }
    /**
     * Signal emitted when the markdown cell rendered state changes
     */
    get renderedChanged() {
        return this._renderedChanged;
    }
    /*
     * Whether the Markdown editor is visible in read-only mode.
     */
    get showEditorForReadOnly() {
        return this._showEditorForReadOnlyMarkdown;
    }
    set showEditorForReadOnly(value) {
        this._showEditorForReadOnlyMarkdown = value;
        if (value === false) {
            this.rendered = true;
        }
    }
    /**
     * Renderer
     */
    get renderer() {
        return this._renderer;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._monitor.dispose();
        super.dispose();
    }
    /**
     * Create children widgets.
     */
    initializeDOM() {
        if (!this.placeholder) {
            return;
        }
        super.initializeDOM();
        this.renderCollapseButtons(this._renderer);
        this._handleRendered().catch(reason => {
            console.error('Failed to render', reason);
        });
    }
    maybeCreateCollapseButton() {
        var _a;
        const { level } = this.headingInfo;
        if (level > 0 &&
            ((_a = this.inputArea) === null || _a === void 0 ? void 0 : _a.promptNode.getElementsByClassName(HEADING_COLLAPSER_CLASS).length) == 0) {
            let collapseButton = this.inputArea.promptNode.appendChild(document.createElement('button'));
            collapseButton.className = `jp-Button ${HEADING_COLLAPSER_CLASS}`;
            collapseButton.setAttribute('data-heading-level', level.toString());
            if (this._headingCollapsed) {
                collapseButton.classList.add('jp-mod-collapsed');
            }
            else {
                collapseButton.classList.remove('jp-mod-collapsed');
            }
            collapseButton.onclick = (event) => {
                this.headingCollapsed = !this.headingCollapsed;
            };
        }
    }
    /**
     * Create, update or remove the hidden cells button.
     * Note that the actual visibility is controlled in Static Notebook by toggling jp-mod-showHiddenCellsButton class.
     */
    maybeCreateOrUpdateExpandButton() {
        const showHiddenCellsButtonList = this.node.getElementsByClassName(SHOW_HIDDEN_CELLS_CLASS);
        let trans = this.translator.load('jupyterlab');
        let buttonText = trans._n('%1 cell hidden', '%1 cells hidden', this._numberChildNodes);
        let needToCreateButton = this.headingCollapsed &&
            this._numberChildNodes > 0 &&
            showHiddenCellsButtonList.length == 0;
        if (needToCreateButton) {
            const newShowHiddenCellsButton = document.createElement('button');
            newShowHiddenCellsButton.className = `jp-mod-minimal jp-Button ${SHOW_HIDDEN_CELLS_CLASS}`;
            index_js_.addIcon.render(newShowHiddenCellsButton);
            const buttonTextElement = document.createElement('div');
            buttonTextElement.textContent = buttonText;
            newShowHiddenCellsButton.appendChild(buttonTextElement);
            newShowHiddenCellsButton.onclick = () => {
                this.headingCollapsed = false;
            };
            this.node.appendChild(newShowHiddenCellsButton);
        }
        let needToUpdateButtonText = this.headingCollapsed &&
            this._numberChildNodes > 0 &&
            showHiddenCellsButtonList.length == 1;
        if (needToUpdateButtonText) {
            showHiddenCellsButtonList[0].childNodes[1].textContent = buttonText;
        }
        let needToRemoveButton = !(this.headingCollapsed && this._numberChildNodes > 0);
        if (needToRemoveButton) {
            for (const button of showHiddenCellsButtonList) {
                this.node.removeChild(button);
            }
        }
    }
    /**
     * Callback on content changed
     */
    onContentChanged() {
        super.onContentChanged();
        const model = this.model;
        const text = model && model.sharedModel.getSource();
        // Do not set headingCache to null, if the text has not changed.
        if (text !== this._cachedHeadingText) {
            this._cachedHeadingText = text;
            this._headingsCache = null;
            this._headingResolved = false;
        }
    }
    /**
     * Render the collapse button for heading cells,
     * and for collapsed heading cells render the "expand hidden cells"
     * button.
     */
    renderCollapseButtons(widget) {
        this.node.classList.toggle(MARKDOWN_HEADING_COLLAPSED, this._headingCollapsed);
        this.maybeCreateCollapseButton();
        this.maybeCreateOrUpdateExpandButton();
    }
    /**
     * Render an input instead of the text editor.
     */
    renderInput(widget) {
        this.addClass(RENDERED_CLASS);
        if (!this.placeholder && !this.isDisposed) {
            this.renderCollapseButtons(widget);
            this.inputArea.renderInput(widget);
        }
    }
    /**
     * Show the text editor instead of rendered input.
     */
    showEditor() {
        this.removeClass(RENDERED_CLASS);
        if (!this.placeholder && !this.isDisposed) {
            this.inputArea.showEditor();
            // if this is going to be a heading, place the cursor accordingly
            let numHashAtStart = (this.model.sharedModel
                .getSource()
                .match(/^#+/g) || [''])[0].length;
            if (numHashAtStart > 0) {
                this.inputArea.editor.setCursorPosition({
                    column: numHashAtStart + 1,
                    line: 0
                }, { scroll: false });
            }
        }
    }
    /*
     * Handle `update-request` messages.
     */
    onUpdateRequest(msg) {
        // Make sure we are properly rendered.
        this._handleRendered().catch(reason => {
            console.error('Failed to render', reason);
        });
        super.onUpdateRequest(msg);
    }
    /**
     * Modify the cell source to include a reference to the attachment.
     */
    updateCellSourceWithAttachment(attachmentName, URI) {
        var _a, _b;
        const textToBeAppended = `![${attachmentName}](attachment:${URI !== null && URI !== void 0 ? URI : attachmentName})`;
        // TODO this should be done on the model...
        (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.replaceSelection) === null || _b === void 0 ? void 0 : _b.call(_a, textToBeAppended);
    }
    /**
     * Handle the rendered state.
     */
    async _handleRendered() {
        if (!this._rendered) {
            this.showEditor();
        }
        else {
            // TODO: It would be nice for the cell to provide a way for
            // its consumers to hook into when the rendering is done.
            await this._updateRenderedInput();
            if (this._rendered) {
                // The rendered flag may be updated in the mean time
                this.renderInput(this._renderer);
            }
        }
    }
    /**
     * Update the rendered input.
     */
    _updateRenderedInput() {
        if (this.placeholder) {
            return Promise.resolve();
        }
        const model = this.model;
        const text = (model && model.sharedModel.getSource()) || this._emptyPlaceholder;
        // Do not re-render if the text has not changed.
        if (text !== this._prevText) {
            const mimeModel = new rendermime_lib_index_js_.MimeModel({ data: { 'text/markdown': text } });
            this._prevText = text;
            return this._renderer.renderModel(mimeModel);
        }
        return Promise.resolve();
    }
    /**
     * Clone the cell, using the same model.
     */
    clone() {
        const constructor = this.constructor;
        return new constructor({
            model: this.model,
            contentFactory: this.contentFactory,
            rendermime: this._rendermime,
            placeholder: false,
            translator: this.translator
        });
    }
    get headingsResolved() {
        return this._headingResolved;
    }
}
/**
 * The namespace for the `CodeCell` class statics.
 */
(function (MarkdownCell) {
    /**
     * Default value for showEditorForReadOnlyMarkdown.
     */
    MarkdownCell.defaultShowEditorForReadOnlyMarkdown = true;
})(MarkdownCell || (MarkdownCell = {}));
/** ****************************************************************************
 * RawCell
 ******************************************************************************/
/**
 * A widget for a raw cell.
 */
class RawCell extends Cell {
    /**
     * Construct a raw cell widget.
     */
    constructor(options) {
        super(options);
        this.addClass(RAW_CELL_CLASS);
        const trans = this.translator.load('jupyterlab');
        this.node.setAttribute('aria-label', trans.__('Raw Cell Content'));
    }
    /**
     * Clone the cell, using the same model.
     */
    clone() {
        const constructor = this.constructor;
        return new constructor({
            model: this.model,
            contentFactory: this.contentFactory,
            placeholder: false,
            translator: this.translator
        });
    }
}
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module cells
 */








//# sourceMappingURL=index.js.map

/***/ }),

/***/ 33230:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/attachments/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */


// EXTERNAL MODULE: ../node_modules/@lumino/dragdrop/style/index.js + 1 modules
var dragdrop_style = __webpack_require__(49868);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/documentsearch/style/index.js + 1 modules
var documentsearch_style = __webpack_require__(13737);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/filebrowser/style/index.js + 1 modules
var filebrowser_style = __webpack_require__(40360);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/outputarea/style/index.js + 1 modules
var outputarea_style = __webpack_require__(76941);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/toc/style/index.js + 1 modules
var toc_style = __webpack_require__(91302);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/cells/style/base.css
var base = __webpack_require__(81550);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/cells/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
















/***/ }),

/***/ 15346:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/notebook@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/notebook/lib/index.js)
var index_js_ = __webpack_require__(58448);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/celltags-extension/lib/celltag.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




/**
 * The class name added to the cell-tags field.
 */
const CELL_TAGS_WIDGET_CLASS = 'jp-CellTags';
/**
 * The class name added to each tag element.
 */
const CELL_TAGS_ELEMENT_CLASS = 'jp-CellTags-Tag';
/**
 * The class name added to each applied tag element.
 */
const CELL_TAGS_ELEMENT_APPLIED_CLASS = 'jp-CellTags-Applied';
/**
 * The class name added to each unapplied tag element.
 */
const CELL_TAGS_ELEMENT_UNAPPLIED_CLASS = 'jp-CellTags-Unapplied';
/**
 * The class name added to the tag holder.
 */
const CELL_TAGS_HOLDER_CLASS = 'jp-CellTags-Holder';
/**
 * The class name added to the add-tag input.
 */
const CELL_TAGS_ADD_CLASS = 'jp-CellTags-Add';
/**
 * The class name added to an empty input.
 */
const CELL_TAGS_EMPTY_CLASS = 'jp-CellTags-Empty';
class CellTagField {
    constructor(tracker, translator) {
        this._tracker = tracker;
        this._translator = translator || translation_lib_index_js_.nullTranslator;
        this._trans = this._translator.load('jupyterlab');
        this._editing = false;
    }
    addTag(props, tag) {
        const data = props.formData;
        if (tag && !data.includes(tag)) {
            data.push(tag);
            props.formContext.updateMetadata({ [props.name]: data }, true);
        }
    }
    /**
     * Pull from cell metadata all the tags used in the notebook and update the
     * stored tag list.
     */
    pullTags() {
        var _a, _b;
        const notebook = (_a = this._tracker) === null || _a === void 0 ? void 0 : _a.currentWidget;
        const cells = (_b = notebook === null || notebook === void 0 ? void 0 : notebook.model) === null || _b === void 0 ? void 0 : _b.cells;
        if (cells === undefined) {
            return [];
        }
        const allTags = (0,index_es6_js_.reduce)(cells, (allTags, cell) => {
            var _a;
            const tags = (_a = cell.getMetadata('tags')) !== null && _a !== void 0 ? _a : [];
            return [...allTags, ...tags];
        }, []);
        return [...new Set(allTags)].filter(tag => tag !== '');
    }
    _emptyAddTag(target) {
        target.value = '';
        target.style.width = '';
        target.classList.add(CELL_TAGS_EMPTY_CLASS);
    }
    _onAddTagKeyDown(props, event) {
        const input = event.target;
        if (event.ctrlKey)
            return;
        if (event.key === 'Enter') {
            this.addTag(props, input.value);
        }
        else if (event.key === 'Escape') {
            this._emptyAddTag(input);
        }
    }
    _onAddTagFocus(event) {
        if (!this._editing) {
            event.target.blur();
        }
    }
    _onAddTagBlur(input) {
        if (this._editing) {
            this._editing = false;
            this._emptyAddTag(input);
        }
    }
    _onChange(event) {
        if (!event.target.value) {
            this._emptyAddTag(event.target);
        }
        else {
            event.target.classList.remove(CELL_TAGS_EMPTY_CLASS);
            const tmp = document.createElement('span');
            tmp.className = CELL_TAGS_ADD_CLASS;
            tmp.textContent = event.target.value;
            // set width to the pixel length of the text
            document.body.appendChild(tmp);
            event.target.style.setProperty('width', `calc(${tmp.getBoundingClientRect().width}px + var(--jp-add-tag-extra-width))`);
            document.body.removeChild(tmp);
        }
    }
    _onAddTagClick(props, event) {
        const elem = event.target.closest('div');
        const input = elem === null || elem === void 0 ? void 0 : elem.childNodes[0];
        if (!this._editing) {
            this._editing = true;
            input.value = '';
            input.focus();
        }
        else if (event.target !== input) {
            this.addTag(props, input.value);
        }
        event.preventDefault();
    }
    _onTagClick(props, tag) {
        const data = props.formData;
        if (data.includes(tag)) {
            data.splice(data.indexOf(tag), 1);
        }
        else {
            data.push(tag);
        }
        props.formContext.updateMetadata({ [props.name]: data }, true);
    }
    render(props) {
        const allTags = this.pullTags();
        return (react_index_js_default().createElement("div", { className: CELL_TAGS_WIDGET_CLASS },
            react_index_js_default().createElement("div", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem" }, "Cell Tags"),
            allTags &&
                allTags.map((tag, i) => (react_index_js_default().createElement("div", { key: i, className: `${CELL_TAGS_ELEMENT_CLASS} ${props.formData.includes(tag)
                        ? CELL_TAGS_ELEMENT_APPLIED_CLASS
                        : CELL_TAGS_ELEMENT_UNAPPLIED_CLASS}`, onClick: () => this._onTagClick(props, tag) },
                    react_index_js_default().createElement("div", { className: CELL_TAGS_HOLDER_CLASS },
                        react_index_js_default().createElement("span", null, tag),
                        props.formData.includes(tag) && (react_index_js_default().createElement(lib_index_js_.LabIcon.resolveReact, { icon: lib_index_js_.checkIcon, tag: "span", elementPosition: "center", height: "18px", width: "18px", marginLeft: "5px", marginRight: "-3px" })))))),
            react_index_js_default().createElement("div", { className: `${CELL_TAGS_ELEMENT_CLASS} ${CELL_TAGS_ELEMENT_UNAPPLIED_CLASS}` },
                react_index_js_default().createElement("div", { className: CELL_TAGS_HOLDER_CLASS, onMouseDown: (e) => this._onAddTagClick(props, e) },
                    react_index_js_default().createElement("input", { className: `${CELL_TAGS_ADD_CLASS} ${CELL_TAGS_EMPTY_CLASS}`, type: "text", placeholder: this._trans.__('Add Tag'), onKeyDown: (e) => this._onAddTagKeyDown(props, e), onFocus: (e) => this._onAddTagFocus(e), onBlur: (e) => this._onAddTagBlur(e.target), onChange: (e) => {
                            this._onChange(e);
                        } }),
                    react_index_js_default().createElement(lib_index_js_.LabIcon.resolveReact, { icon: lib_index_js_.addIcon, tag: "span", height: "18px", width: "18px", className: CELL_TAGS_HOLDER_CLASS })))));
    }
}
//# sourceMappingURL=celltag.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/celltags-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module celltags-extension
 */



/**
 * Registering cell tag field.
 */
const customCellTag = {
    id: '@jupyterlab/celltags-extension:plugin',
    description: 'Adds the cell tags editor.',
    autoStart: true,
    requires: [index_js_.INotebookTracker],
    optional: [lib_index_js_.IFormRendererRegistry],
    activate: (app, tracker, formRegistry) => {
        // Register the custom field
        if (formRegistry) {
            const component = {
                fieldRenderer: (props) => {
                    return new CellTagField(tracker).render(props);
                }
            };
            formRegistry.addRenderer('@jupyterlab/celltags-extension:plugin.renderer', component);
        }
    }
};
/* harmony default export */ const lib = ([customCellTag]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 92645:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/notebook/style/index.js + 1 modules
var notebook_style = __webpack_require__(47456);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/celltags-extension/style/base.css
var base = __webpack_require__(34188);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/celltags-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/celltags-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 77391:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  COMPLETER_ACTIVE_CLASS: () => (/* reexport */ COMPLETER_ACTIVE_CLASS),
  COMPLETER_ENABLED_CLASS: () => (/* reexport */ COMPLETER_ENABLED_CLASS),
  COMPLETER_LINE_BEGINNING_CLASS: () => (/* reexport */ COMPLETER_LINE_BEGINNING_CLASS),
  CodeEditor: () => (/* reexport */ CodeEditor),
  CodeEditorWrapper: () => (/* reexport */ CodeEditorWrapper),
  CodeViewerWidget: () => (/* reexport */ CodeViewerWidget),
  IEditorMimeTypeService: () => (/* reexport */ IEditorMimeTypeService),
  IEditorServices: () => (/* reexport */ IEditorServices),
  IPositionModel: () => (/* reexport */ IPositionModel),
  JSONEditor: () => (/* reexport */ JSONEditor),
  LineCol: () => (/* reexport */ LineCol)
});

// EXTERNAL MODULE: consume shared module (default) @jupyter/ydoc@~3.1.0 (singleton) (fallback: ../node_modules/@jupyter/ydoc/lib/index.js)
var index_js_ = __webpack_require__(88162);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var lib_index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/mimetype.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * A namespace for `IEditorMimeTypeService`.
 */
var IEditorMimeTypeService;
(function (IEditorMimeTypeService) {
    /**
     * The default mime type.
     */
    IEditorMimeTypeService.defaultMimeType = 'text/plain';
})(IEditorMimeTypeService || (IEditorMimeTypeService = {}));
//# sourceMappingURL=mimetype.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/editor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A namespace for code editors.
 *
 * #### Notes
 * - A code editor is a set of common assumptions which hold for all concrete editors.
 * - Changes in implementations of the code editor should only be caused by changes in concrete editors.
 * - Common JLab services which are based on the code editor should belong to `IEditorServices`.
 */
var CodeEditor;
(function (CodeEditor) {
    /**
     * The default implementation of the editor model.
     */
    class Model {
        /**
         * Construct a new Model.
         */
        constructor(options = {}) {
            var _a, _b;
            /**
             * Whether the model should disposed the shared model on disposal or not.
             */
            this.standaloneModel = false;
            this._isDisposed = false;
            this._selections = new lib_index_js_.ObservableMap();
            this._mimeType = IEditorMimeTypeService.defaultMimeType;
            this._mimeTypeChanged = new index_es6_js_.Signal(this);
            // Track if we need to dispose the model or not.
            this.standaloneModel = typeof options.sharedModel === 'undefined';
            this.sharedModel = (_a = options.sharedModel) !== null && _a !== void 0 ? _a : new index_js_.YFile();
            this._mimeType =
                (_b = options.mimeType) !== null && _b !== void 0 ? _b : IEditorMimeTypeService.defaultMimeType;
        }
        /**
         * A signal emitted when a mimetype changes.
         */
        get mimeTypeChanged() {
            return this._mimeTypeChanged;
        }
        /**
         * Get the selections for the model.
         */
        get selections() {
            return this._selections;
        }
        /**
         * A mime type of the model.
         */
        get mimeType() {
            return this._mimeType;
        }
        set mimeType(newValue) {
            const oldValue = this.mimeType;
            if (oldValue === newValue) {
                return;
            }
            this._mimeType = newValue;
            this._mimeTypeChanged.emit({
                name: 'mimeType',
                oldValue: oldValue,
                newValue: newValue
            });
        }
        /**
         * Whether the model is disposed.
         */
        get isDisposed() {
            return this._isDisposed;
        }
        /**
         * Dispose of the resources used by the model.
         */
        dispose() {
            if (this._isDisposed) {
                return;
            }
            this._isDisposed = true;
            this._selections.dispose();
            if (this.standaloneModel) {
                this.sharedModel.dispose();
            }
            index_es6_js_.Signal.clearData(this);
        }
    }
    CodeEditor.Model = Model;
})(CodeEditor || (CodeEditor = {}));
//# sourceMappingURL=editor.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/jsoneditor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * The class name added to a JSONEditor instance.
 */
const JSONEDITOR_CLASS = 'jp-JSONEditor';
/**
 * The class name added when the Metadata editor contains invalid JSON.
 */
const ERROR_CLASS = 'jp-mod-error';
/**
 * The class name added to the editor host node.
 */
const HOST_CLASS = 'jp-JSONEditor-host';
/**
 * The class name added to the header area.
 */
const HEADER_CLASS = 'jp-JSONEditor-header';
/**
 * A widget for editing observable JSON.
 */
class JSONEditor extends dist_index_es6_js_.Widget {
    /**
     * Construct a new JSON editor.
     */
    constructor(options) {
        super();
        this._dataDirty = false;
        this._inputDirty = false;
        this._source = null;
        this._originalValue = dist_index_js_.JSONExt.emptyObject;
        this._changeGuard = false;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this.addClass(JSONEDITOR_CLASS);
        this.headerNode = document.createElement('div');
        this.headerNode.className = HEADER_CLASS;
        this.revertButtonNode = ui_components_lib_index_js_.undoIcon.element({
            tag: 'span',
            title: this._trans.__('Revert changes to data')
        });
        this.commitButtonNode = ui_components_lib_index_js_.checkIcon.element({
            tag: 'span',
            title: this._trans.__('Commit changes to data'),
            marginLeft: '8px'
        });
        this.editorHostNode = document.createElement('div');
        this.editorHostNode.className = HOST_CLASS;
        this.headerNode.appendChild(this.revertButtonNode);
        this.headerNode.appendChild(this.commitButtonNode);
        this.node.appendChild(this.headerNode);
        this.node.appendChild(this.editorHostNode);
        const model = new CodeEditor.Model({ mimeType: 'application/json' });
        model.sharedModel.changed.connect(this._onModelChanged, this);
        this.model = model;
        this.editor = options.editorFactory({
            host: this.editorHostNode,
            model,
            config: {
                readOnly: true
            }
        });
    }
    /**
     * The observable source.
     */
    get source() {
        return this._source;
    }
    set source(value) {
        if (this._source === value) {
            return;
        }
        if (this._source) {
            this._source.changed.disconnect(this._onSourceChanged, this);
        }
        this._source = value;
        this.editor.setOption('readOnly', value === null);
        if (value) {
            value.changed.connect(this._onSourceChanged, this);
        }
        this._setValue();
    }
    /**
     * Get whether the editor is dirty.
     */
    get isDirty() {
        return this._dataDirty || this._inputDirty;
    }
    /**
     * Dispose of the editor.
     */
    dispose() {
        var _a;
        if (this.isDisposed) {
            return;
        }
        (_a = this.source) === null || _a === void 0 ? void 0 : _a.dispose();
        this.model.dispose();
        this.editor.dispose();
        super.dispose();
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the notebook panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'blur':
                this._evtBlur(event);
                break;
            case 'click':
                this._evtClick(event);
                break;
            default:
                break;
        }
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        const node = this.editorHostNode;
        node.addEventListener('blur', this, true);
        node.addEventListener('click', this, true);
        this.revertButtonNode.hidden = true;
        this.commitButtonNode.hidden = true;
        this.headerNode.addEventListener('click', this);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        const node = this.editorHostNode;
        node.removeEventListener('blur', this, true);
        node.removeEventListener('click', this, true);
        this.headerNode.removeEventListener('click', this);
    }
    /**
     * Handle a change to the metadata of the source.
     */
    _onSourceChanged(sender, args) {
        if (this._changeGuard) {
            return;
        }
        if (this._inputDirty || this.editor.hasFocus()) {
            this._dataDirty = true;
            return;
        }
        this._setValue();
    }
    /**
     * Handle change events.
     */
    _onModelChanged(model, change) {
        if (change.sourceChange) {
            let valid = true;
            try {
                const value = JSON.parse(this.editor.model.sharedModel.getSource());
                this.removeClass(ERROR_CLASS);
                this._inputDirty =
                    !this._changeGuard && !dist_index_js_.JSONExt.deepEqual(value, this._originalValue);
            }
            catch (err) {
                this.addClass(ERROR_CLASS);
                this._inputDirty = true;
                valid = false;
            }
            this.revertButtonNode.hidden = !this._inputDirty;
            this.commitButtonNode.hidden = !valid || !this._inputDirty;
        }
    }
    /**
     * Handle blur events for the text area.
     */
    _evtBlur(event) {
        // Update the metadata if necessary.
        if (!this._inputDirty && this._dataDirty) {
            this._setValue();
        }
    }
    /**
     * Handle click events for the buttons.
     */
    _evtClick(event) {
        const target = event.target;
        if (this.revertButtonNode.contains(target)) {
            this._setValue();
        }
        else if (this.commitButtonNode.contains(target)) {
            if (!this.commitButtonNode.hidden && !this.hasClass(ERROR_CLASS)) {
                this._changeGuard = true;
                this._mergeContent();
                this._changeGuard = false;
                this._setValue();
            }
        }
        else if (this.editorHostNode.contains(target)) {
            this.editor.focus();
        }
    }
    /**
     * Merge the user content.
     */
    _mergeContent() {
        const model = this.editor.model;
        const old = this._originalValue;
        const user = JSON.parse(model.sharedModel.getSource());
        const source = this.source;
        if (!source) {
            return;
        }
        // If it is in user and has changed from old, set in new.
        for (const key in user) {
            if (!dist_index_js_.JSONExt.deepEqual(user[key], old[key] || null)) {
                source.set(key, user[key]);
            }
        }
        // If it was in old and is not in user, remove from source.
        for (const key in old) {
            if (!(key in user)) {
                source.delete(key);
            }
        }
    }
    /**
     * Set the value given the owner contents.
     */
    _setValue() {
        this._dataDirty = false;
        this._inputDirty = false;
        this.revertButtonNode.hidden = true;
        this.commitButtonNode.hidden = true;
        this.removeClass(ERROR_CLASS);
        const model = this.editor.model;
        const content = this._source ? this._source.toJSON() : {};
        this._changeGuard = true;
        if (content === void 0) {
            model.sharedModel.setSource(this._trans.__('No data!'));
            this._originalValue = dist_index_js_.JSONExt.emptyObject;
        }
        else {
            const value = JSON.stringify(content, null, 4);
            model.sharedModel.setSource(value);
            this._originalValue = content;
            // Move the cursor to within the brace.
            if (value.length > 1 && value[0] === '{') {
                this.editor.setCursorPosition({ line: 0, column: 1 });
            }
        }
        this._changeGuard = false;
        this.commitButtonNode.hidden = true;
        this.revertButtonNode.hidden = true;
    }
}
//# sourceMappingURL=jsoneditor.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/lineCol.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * A component for rendering a "go-to-line" form.
 */
class LineFormComponent extends (react_index_js_default()).Component {
    /**
     * Construct a new LineFormComponent.
     */
    constructor(props) {
        super(props);
        /**
         * Handle a change to the value in the input field.
         */
        this._handleChange = (event) => {
            this.setState({ value: event.currentTarget.value });
        };
        /**
         * Handle submission of the input field.
         */
        this._handleSubmit = (event) => {
            event.preventDefault();
            const value = parseInt(this._textInput.value, 10);
            if (!isNaN(value) &&
                isFinite(value) &&
                1 <= value &&
                value <= this.props.maxLine) {
                this.props.handleSubmit(value);
            }
            return false;
        };
        /**
         * Handle focusing of the input field.
         */
        this._handleFocus = () => {
            this.setState({ hasFocus: true });
        };
        /**
         * Handle blurring of the input field.
         */
        this._handleBlur = () => {
            this.setState({ hasFocus: false });
        };
        this._textInput = null;
        this.translator = props.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this.state = {
            value: '',
            hasFocus: false,
            textInputId: apputils_lib_index_js_.DOMUtils.createDomID() + '-line-number-input'
        };
    }
    /**
     * Focus the element on mount.
     */
    componentDidMount() {
        this._textInput.focus();
    }
    /**
     * Render the LineFormComponent.
     */
    render() {
        return (react_index_js_default().createElement("div", { className: "jp-lineFormSearch" },
            react_index_js_default().createElement("form", { name: "lineColumnForm", onSubmit: this._handleSubmit, noValidate: true },
                react_index_js_default().createElement("div", { className: (0,ui_components_lib_index_js_.classes)('jp-lineFormWrapper', 'lm-lineForm-wrapper', this.state.hasFocus ? 'jp-lineFormWrapperFocusWithin' : undefined) },
                    react_index_js_default().createElement("input", { type: "text", id: this.state.textInputId, className: "jp-lineFormInput", onChange: this._handleChange, onFocus: this._handleFocus, onBlur: this._handleBlur, value: this.state.value, ref: input => {
                            this._textInput = input;
                        } }),
                    react_index_js_default().createElement("div", { className: "jp-baseLineForm jp-lineFormButtonContainer" },
                        react_index_js_default().createElement(ui_components_lib_index_js_.lineFormIcon.react, { className: "jp-baseLineForm jp-lineFormButtonIcon", elementPosition: "center" }),
                        react_index_js_default().createElement("input", { type: "submit", className: "jp-baseLineForm jp-lineFormButton", value: "" }))),
                react_index_js_default().createElement("label", { className: "jp-lineFormCaption", htmlFor: this.state.textInputId }, this._trans.__('Go to line number between 1 and %1', this.props.maxLine)))));
    }
}
/**
 * A pure functional component for rendering a line/column
 * status item.
 */
function LineColComponent(props) {
    const translator = props.translator || translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const keydownHandler = (event) => {
        if (event.key === 'Enter' ||
            event.key === 'Spacebar' ||
            event.key === ' ') {
            event.preventDefault();
            event.stopPropagation();
            props.handleClick();
        }
        else {
            return;
        }
    };
    return (react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { role: "button", "aria-haspopup": true, onClick: props.handleClick, source: trans.__('Ln %1, Col %2', props.line, props.column), title: trans.__('Go to line number…'), tabIndex: 0, onKeyDown: keydownHandler }));
}
/**
 * A widget implementing a line/column status item.
 */
class LineCol extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct a new LineCol status item.
     */
    constructor(translator) {
        super(new LineCol.Model());
        this._popup = null;
        this.addClass('jp-mod-highlighted');
        this.translator = translator || translation_lib_index_js_.nullTranslator;
    }
    /**
     * Render the status item.
     */
    render() {
        if (this.model === null) {
            return null;
        }
        else {
            return (react_index_js_default().createElement(LineColComponent, { line: this.model.line, column: this.model.column, translator: this.translator, handleClick: () => this._handleClick() }));
        }
    }
    /**
     * A click handler for the widget.
     */
    _handleClick() {
        if (this._popup) {
            this._popup.dispose();
        }
        const body = ui_components_lib_index_js_.ReactWidget.create(react_index_js_default().createElement(LineFormComponent, { handleSubmit: val => this._handleSubmit(val), currentLine: this.model.line, maxLine: this.model.editor.lineCount, translator: this.translator }));
        this._popup = (0,statusbar_lib_index_js_.showPopup)({
            body: body,
            anchor: this,
            align: 'right'
        });
    }
    /**
     * Handle submission for the widget.
     */
    _handleSubmit(value) {
        this.model.editor.setCursorPosition({ line: value - 1, column: 0 });
        this._popup.dispose();
        this.model.editor.focus();
    }
}
/**
 * A namespace for LineCol statics.
 */
(function (LineCol) {
    /**
     * A VDom model for a status item tracking the line/column of an editor.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        constructor() {
            super(...arguments);
            /**
             * React to a change in the cursors of the current editor.
             */
            this._onSelectionChanged = () => {
                const oldState = this._getAllState();
                const pos = this.editor.getCursorPosition();
                this._line = pos.line + 1;
                this._column = pos.column + 1;
                this._triggerChange(oldState, this._getAllState());
            };
            this._line = 1;
            this._column = 1;
            this._editor = null;
        }
        /**
         * The current editor of the model.
         */
        get editor() {
            return this._editor;
        }
        set editor(editor) {
            var _a;
            const oldEditor = this._editor;
            if ((_a = oldEditor === null || oldEditor === void 0 ? void 0 : oldEditor.model) === null || _a === void 0 ? void 0 : _a.selections) {
                oldEditor.model.selections.changed.disconnect(this._onSelectionChanged);
            }
            const oldState = this._getAllState();
            this._editor = editor;
            if (!this._editor) {
                this._column = 1;
                this._line = 1;
            }
            else {
                this._editor.model.selections.changed.connect(this._onSelectionChanged);
                const pos = this._editor.getCursorPosition();
                this._column = pos.column + 1;
                this._line = pos.line + 1;
            }
            this._triggerChange(oldState, this._getAllState());
        }
        /**
         * The current line of the model.
         */
        get line() {
            return this._line;
        }
        /**
         * The current column of the model.
         */
        get column() {
            return this._column;
        }
        _getAllState() {
            return [this._line, this._column];
        }
        _triggerChange(oldState, newState) {
            if (oldState[0] !== newState[0] || oldState[1] !== newState[1]) {
                this.stateChanged.emit(void 0);
            }
        }
    }
    LineCol.Model = Model;
})(LineCol || (LineCol = {}));
//# sourceMappingURL=lineCol.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A class added to editors that can host a completer.
 */
const COMPLETER_ENABLED_CLASS = 'jp-mod-completer-enabled';
/**
 * A class added to editors that have an active completer.
 */
const COMPLETER_ACTIVE_CLASS = 'jp-mod-completer-active';
/**
 * A class added to editors that have a cursor at the beginning of the line.
 */
const COMPLETER_LINE_BEGINNING_CLASS = 'jp-mod-at-line-beginning';
/**
 * Code editor services token.
 */
const IEditorServices = new dist_index_js_.Token('@jupyterlab/codeeditor:IEditorServices', `A service for the text editor provider
  for the application. Use this to create new text editors and host them in your
  UI elements.`);
/**
 * Code editor cursor position token.
 */
const IPositionModel = new dist_index_js_.Token('@jupyterlab/codeeditor:IPositionModel', `A service to handle an code editor cursor position.`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The class name added to an editor widget that has a primary selection.
 */
const HAS_SELECTION_CLASS = 'jp-mod-has-primary-selection';
/**
 * The class name added to an editor widget that has a cursor/selection
 * within the whitespace at the beginning of a line
 */
const HAS_IN_LEADING_WHITESPACE_CLASS = 'jp-mod-in-leading-whitespace';
/**
 * A class used to indicate a drop target.
 */
const DROP_TARGET_CLASS = 'jp-mod-dropTarget';
/**
 * RegExp to test for leading whitespace
 */
const leadingWhitespaceRe = /^\s+$/;
/**
 * A widget which hosts a code editor.
 */
class CodeEditorWrapper extends dist_index_es6_js_.Widget {
    /**
     * Construct a new code editor widget.
     */
    constructor(options) {
        super();
        const { factory, model, editorOptions } = options;
        const editor = (this.editor = factory({
            host: this.node,
            model,
            ...editorOptions
        }));
        editor.model.selections.changed.connect(this._onSelectionsChanged, this);
    }
    /**
     * Get the model used by the widget.
     */
    get model() {
        return this.editor.model;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.editor.dispose();
        super.dispose();
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the notebook panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'lm-dragenter':
                this._evtDragEnter(event);
                break;
            case 'lm-dragleave':
                this._evtDragLeave(event);
                break;
            case 'lm-dragover':
                this._evtDragOver(event);
                break;
            case 'lm-drop':
                this._evtDrop(event);
                break;
            default:
                break;
        }
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        this.editor.focus();
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        const node = this.node;
        node.addEventListener('lm-dragenter', this);
        node.addEventListener('lm-dragleave', this);
        node.addEventListener('lm-dragover', this);
        node.addEventListener('lm-drop', this);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        const node = this.node;
        node.removeEventListener('lm-dragenter', this);
        node.removeEventListener('lm-dragleave', this);
        node.removeEventListener('lm-dragover', this);
        node.removeEventListener('lm-drop', this);
    }
    /**
     * Handle a change in model selections.
     */
    _onSelectionsChanged() {
        const { start, end } = this.editor.getSelection();
        if (start.column !== end.column || start.line !== end.line) {
            // a selection was made
            this.addClass(HAS_SELECTION_CLASS);
            this.removeClass(HAS_IN_LEADING_WHITESPACE_CLASS);
        }
        else {
            // the cursor was placed
            this.removeClass(HAS_SELECTION_CLASS);
            if (this.editor
                .getLine(end.line)
                .slice(0, end.column)
                .match(leadingWhitespaceRe)) {
                this.addClass(HAS_IN_LEADING_WHITESPACE_CLASS);
            }
            else {
                this.removeClass(HAS_IN_LEADING_WHITESPACE_CLASS);
            }
        }
    }
    /**
     * Handle the `'lm-dragenter'` event for the widget.
     */
    _evtDragEnter(event) {
        if (this.editor.getOption('readOnly') === true) {
            return;
        }
        const data = Private.findTextData(event.mimeData);
        if (data === undefined) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        this.addClass('jp-mod-dropTarget');
    }
    /**
     * Handle the `'lm-dragleave'` event for the widget.
     */
    _evtDragLeave(event) {
        this.removeClass(DROP_TARGET_CLASS);
        if (this.editor.getOption('readOnly') === true) {
            return;
        }
        const data = Private.findTextData(event.mimeData);
        if (data === undefined) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
    }
    /**
     * Handle the `'lm-dragover'` event for the widget.
     */
    _evtDragOver(event) {
        this.removeClass(DROP_TARGET_CLASS);
        if (this.editor.getOption('readOnly') === true) {
            return;
        }
        const data = Private.findTextData(event.mimeData);
        if (data === undefined) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        event.dropAction = 'copy';
        this.addClass(DROP_TARGET_CLASS);
    }
    /**
     * Handle the `'lm-drop'` event for the widget.
     */
    _evtDrop(event) {
        if (this.editor.getOption('readOnly') === true) {
            return;
        }
        const data = Private.findTextData(event.mimeData);
        if (data === undefined) {
            return;
        }
        const coordinate = {
            top: event.y,
            bottom: event.y,
            left: event.x,
            right: event.x
        };
        const position = this.editor.getPositionForCoordinate(coordinate);
        if (position === null) {
            return;
        }
        this.removeClass(DROP_TARGET_CLASS);
        event.preventDefault();
        event.stopPropagation();
        if (event.proposedAction === 'none') {
            event.dropAction = 'none';
            return;
        }
        const offset = this.editor.getOffsetAt(position);
        this.model.sharedModel.updateSource(offset, offset, data);
    }
}
/**
 * A namespace for private functionality.
 */
var Private;
(function (Private) {
    /**
     * Given a MimeData instance, extract the first text data, if any.
     */
    function findTextData(mime) {
        const types = mime.types();
        const textType = types.find(t => t.indexOf('text') === 0);
        if (textType === undefined) {
            return undefined;
        }
        return mime.getData(textType);
    }
    Private.findTextData = findTextData;
})(Private || (Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/viewer.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



class CodeViewerWidget extends dist_index_es6_js_.Widget {
    /**
     * Construct a new code viewer widget.
     */
    constructor(options) {
        var _a;
        super();
        this.model = options.model;
        const editorWidget = new CodeEditorWrapper({
            factory: options.factory,
            model: this.model,
            editorOptions: {
                ...options.editorOptions,
                config: { ...(_a = options.editorOptions) === null || _a === void 0 ? void 0 : _a.config, readOnly: true }
            }
        });
        this.editor = editorWidget.editor;
        const layout = (this.layout = new dist_index_es6_js_.StackedLayout());
        layout.addWidget(editorWidget);
    }
    static createCodeViewer(options) {
        const { content, mimeType, ...others } = options;
        const model = new CodeEditor.Model({
            mimeType
        });
        model.sharedModel.setSource(content);
        const widget = new CodeViewerWidget({ ...others, model });
        widget.disposed.connect(() => {
            model.dispose();
        });
        return widget;
    }
    get content() {
        return this.model.sharedModel.getSource();
    }
    get mimeType() {
        return this.model.mimeType;
    }
}
//# sourceMappingURL=viewer.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module codeeditor
 */








//# sourceMappingURL=index.js.map

/***/ }),

/***/ 7526:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js + 1 modules
var statusbar_style = __webpack_require__(546);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@lumino/dragdrop/style/index.js + 1 modules
var dragdrop_style = __webpack_require__(49868);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/codeeditor/style/base.css
var base = __webpack_require__(63988);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 97655:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib),
  lineColItem: () => (/* binding */ lineColItem)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @codemirror/commands@^6.10.2 (strict) (fallback: ../node_modules/@codemirror/commands/dist/index.js)
var dist_index_js_ = __webpack_require__(55942);
// EXTERNAL MODULE: consume shared module (default) @codemirror/language@^6.12.1 (strict) (fallback: ../node_modules/@codemirror/language/dist/index.js)
var language_dist_index_js_ = __webpack_require__(17544);
// EXTERNAL MODULE: consume shared module (default) @codemirror/view@~6.39.15 (singleton) (fallback: ../node_modules/@codemirror/view/dist/index.js)
var view_dist_index_js_ = __webpack_require__(1164);
// EXTERNAL MODULE: consume shared module (default) @codemirror/search@^6.6.0 (strict) (fallback: ../node_modules/@codemirror/search/dist/index.js)
var search_dist_index_js_ = __webpack_require__(76724);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/notebook@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/notebook/lib/index.js)
var notebook_lib_index_js_ = __webpack_require__(58448);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror-extension/lib/commands.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */







/**
 * Identifiers of commands.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.deleteLine = 'codemirror:delete-line';
    CommandIDs.toggleBlockComment = 'codemirror:toggle-block-comment';
    CommandIDs.toggleComment = 'codemirror:toggle-comment';
    CommandIDs.selectNextOccurrence = 'codemirror:select-next-occurrence';
    CommandIDs.toggleTabFocusMode = 'codemirror:toggle-tab-focus-mode';
    CommandIDs.foldCurrent = 'codemirror:fold-current';
    CommandIDs.unfoldCurrent = 'codemirror:unfold-current';
    CommandIDs.foldSubregions = 'codemirror:fold-subregions';
    CommandIDs.unfoldSubregions = 'codemirror:unfold-subregions';
    CommandIDs.foldAll = 'codemirror:fold-all';
    CommandIDs.unfoldAll = 'codemirror:unfold-all';
})(CommandIDs || (CommandIDs = {}));
/**
 * Selector for CodeMirror editor with `cmTile` attribute.
 */
const CODE_MIRROR_SELECTOR = '.cm-content';
/**
 * The editor commands.
 */
const commandsPlugin = {
    id: '@jupyterlab/codemirror-extension:commands',
    description: 'Registers commands acting on selected/active CodeMirror editor.',
    autoStart: true,
    requires: [notebook_lib_index_js_.INotebookTracker],
    optional: [translation_lib_index_js_.ITranslator, apputils_lib_index_js_.ICommandPalette],
    activate: (app, tracker, translator, palette) => {
        translator = translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const isCodeMirror = (node) => node.classList.contains(CODE_MIRROR_SELECTOR);
        const findEditorView = () => {
            var _a, _b;
            const node = (_a = app.contextMenuHitTest(isCodeMirror)) !== null && _a !== void 0 ? _a : (_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.closest(CODE_MIRROR_SELECTOR);
            if (!node) {
                return;
            }
            return view_dist_index_js_.EditorView.findFromDOM(node);
        };
        const isEnabled = () => {
            return !!findEditorView();
        };
        const getActiveEditorInfo = () => {
            var _a, _b;
            const currentWidget = app.shell.currentWidget;
            // Check for active notebook
            const notebook = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
            if (tracker.currentWidget !== null &&
                tracker.currentWidget === currentWidget &&
                notebook &&
                notebook.activeCell) {
                return {
                    type: 'notebook',
                    widget: currentWidget,
                    notebook,
                    isEnabled: true
                };
            }
            // Check for file editor
            const fileEditorWidget = currentWidget;
            if (fileEditorWidget &&
                fileEditorWidget.content &&
                typeof ((_b = fileEditorWidget.content.editor) === null || _b === void 0 ? void 0 : _b.focus) === 'function') {
                return {
                    type: 'fileEditor',
                    widget: fileEditorWidget,
                    isEnabled: true
                };
            }
            return {
                type: 'none',
                widget: null,
                isEnabled: false
            };
        };
        // Simplified isEnabled function using the helper
        const isCodeFoldingEnabled = () => {
            return getActiveEditorInfo().isEnabled;
        };
        app.commands.addCommand(CommandIDs.deleteLine, {
            label: trans.__('Delete the current line'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                const view = findEditorView();
                if (!view) {
                    return;
                }
                (0,dist_index_js_.deleteLine)(view);
            },
            isEnabled
        });
        app.commands.addCommand(CommandIDs.toggleBlockComment, {
            label: trans.__('Toggle Block Comment'),
            caption: trans.__('Toggles block comments in languages which support it (e.g. C, JavaScript)'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                const view = findEditorView();
                if (!view) {
                    return;
                }
                (0,dist_index_js_.toggleBlockComment)(view);
            },
            isEnabled
        });
        app.commands.addCommand(CommandIDs.toggleComment, {
            label: trans.__('Toggle Comment'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                const view = findEditorView();
                if (!view) {
                    return;
                }
                (0,dist_index_js_.toggleComment)(view);
            },
            isEnabled
        });
        app.commands.addCommand(CommandIDs.toggleTabFocusMode, {
            label: trans.__('Toggle Tab Focus Mode'),
            caption: trans.__('Toggles behavior of Tab key between inserting indentation and moving to next focusable element'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                const view = findEditorView();
                if (!view) {
                    return;
                }
                (0,dist_index_js_.toggleTabFocusMode)(view);
            },
            isEnabled
        });
        app.commands.addCommand(CommandIDs.selectNextOccurrence, {
            label: trans.__('Select Next Occurrence'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                const view = findEditorView();
                if (!view) {
                    return;
                }
                (0,search_dist_index_js_.selectNextOccurrence)(view);
            },
            isEnabled
        });
        app.commands.addCommand(CommandIDs.foldCurrent, {
            label: trans.__('Fold Current Region'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            // Updated execute function using the helper
            execute: () => {
                var _a;
                const editorInfo = getActiveEditorInfo();
                if (editorInfo.type === 'notebook') {
                    editorInfo.notebook.mode = 'edit';
                    if (editorInfo.notebook.activeCell) {
                        (_a = editorInfo.notebook.activeCell.editor) === null || _a === void 0 ? void 0 : _a.focus();
                    }
                }
                else if (editorInfo.type === 'fileEditor') {
                    editorInfo.widget.content.editor.focus();
                }
                const view = findEditorView();
                if (!view) {
                    return;
                }
                const { state } = view;
                const pos = state.selection.main.head;
                const line = state.doc.lineAt(pos);
                const range = (0,language_dist_index_js_.foldable)(state, line.from, line.to);
                if (range) {
                    (0,language_dist_index_js_.foldCode)(view);
                }
            },
            isEnabled: isCodeFoldingEnabled
        });
        app.commands.addCommand(CommandIDs.unfoldCurrent, {
            label: trans.__('Unfold Current Region'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                var _a;
                const editorInfo = getActiveEditorInfo();
                if (editorInfo.type === 'notebook') {
                    editorInfo.notebook.mode = 'edit';
                    if (editorInfo.notebook.activeCell) {
                        (_a = editorInfo.notebook.activeCell.editor) === null || _a === void 0 ? void 0 : _a.focus();
                    }
                }
                else if (editorInfo.type === 'fileEditor') {
                    editorInfo.widget.content.editor.focus();
                }
                const view = findEditorView();
                if (!view) {
                    return;
                }
                const { state } = view;
                const pos = state.selection.main.head;
                const line = state.doc.lineAt(pos);
                const range = (0,language_dist_index_js_.foldable)(state, line.from, line.to);
                if (range) {
                    (0,language_dist_index_js_.unfoldCode)(view);
                }
            },
            isEnabled: isCodeFoldingEnabled
        });
        app.commands.addCommand(CommandIDs.foldSubregions, {
            label: trans.__('Fold All Subregions'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                var _a;
                const editorInfo = getActiveEditorInfo();
                if (editorInfo.type === 'notebook') {
                    editorInfo.notebook.mode = 'edit';
                    if (editorInfo.notebook.activeCell) {
                        (_a = editorInfo.notebook.activeCell.editor) === null || _a === void 0 ? void 0 : _a.focus();
                    }
                }
                else if (editorInfo.type === 'fileEditor') {
                    editorInfo.widget.content.editor.focus();
                }
                const view = findEditorView();
                if (!view) {
                    return;
                }
                try {
                    const { state } = view;
                    const pos = state.selection.main.head;
                    const line = state.doc.lineAt(pos);
                    const topRegion = (0,language_dist_index_js_.foldable)(state, line.from, line.to);
                    let hasFoldState = false;
                    try {
                        const currentFoldState = state.field(language_dist_index_js_.foldState, false);
                        hasFoldState = currentFoldState !== undefined;
                    }
                    catch (e) {
                        hasFoldState = false;
                    }
                    if (!hasFoldState) {
                        // Prime the folding system with a dummy fold/unfold
                        (0,language_dist_index_js_.foldCode)(view);
                        (0,language_dist_index_js_.unfoldCode)(view);
                    }
                    if (!topRegion) {
                        return;
                    }
                    const effects = [];
                    let subPos = topRegion.from + 1;
                    while (subPos < topRegion.to) {
                        const subLine = state.doc.lineAt(subPos);
                        const subRange = (0,language_dist_index_js_.foldable)(state, subLine.from, subLine.to);
                        if (subRange &&
                            subRange.from > topRegion.from &&
                            subRange.to <= topRegion.to) {
                            effects.push(language_dist_index_js_.foldEffect.of(subRange));
                            subPos = subRange.to;
                        }
                        else {
                            subPos = subLine.to + 1;
                        }
                    }
                    if (effects.length > 0) {
                        view.dispatch({ effects });
                    }
                }
                catch (e) {
                    // Silent fail
                }
            },
            isEnabled: isCodeFoldingEnabled
        });
        app.commands.addCommand(CommandIDs.unfoldSubregions, {
            label: trans.__('Unfold All Subregions'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                var _a;
                const editorInfo = getActiveEditorInfo();
                if (editorInfo.type === 'notebook') {
                    editorInfo.notebook.mode = 'edit';
                    if (editorInfo.notebook.activeCell) {
                        (_a = editorInfo.notebook.activeCell.editor) === null || _a === void 0 ? void 0 : _a.focus();
                    }
                }
                else if (editorInfo.type === 'fileEditor') {
                    editorInfo.widget.content.editor.focus();
                }
                const view = findEditorView();
                if (!view) {
                    return;
                }
                try {
                    const { state } = view;
                    const pos = state.selection.main.head;
                    const line = state.doc.lineAt(pos);
                    const topRegion = (0,language_dist_index_js_.foldable)(state, line.from, line.to);
                    if (!topRegion) {
                        return;
                    }
                    const foldedRanges = state.field(language_dist_index_js_.foldState, false);
                    if (!foldedRanges) {
                        return;
                    }
                    const effects = [];
                    foldedRanges.between(topRegion.from + 1, topRegion.to, (from, to) => {
                        if (from > topRegion.from && to <= topRegion.to) {
                            effects.push(language_dist_index_js_.unfoldEffect.of({ from, to }));
                        }
                    });
                    if (effects.length > 0) {
                        view.dispatch({ effects });
                    }
                }
                catch (e) {
                    // Silent fail
                }
            },
            isEnabled: isCodeFoldingEnabled
        });
        app.commands.addCommand(CommandIDs.foldAll, {
            label: trans.__('Fold All Regions'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                var _a;
                const editorInfo = getActiveEditorInfo();
                if (editorInfo.type === 'notebook') {
                    editorInfo.notebook.mode = 'edit';
                    if (editorInfo.notebook.activeCell) {
                        (_a = editorInfo.notebook.activeCell.editor) === null || _a === void 0 ? void 0 : _a.focus();
                    }
                }
                else if (editorInfo.type === 'fileEditor') {
                    editorInfo.widget.content.editor.focus();
                }
                const view = findEditorView();
                if (!view) {
                    return;
                }
                try {
                    (0,language_dist_index_js_.foldAll)(view);
                }
                catch (e) {
                    // Silent fail
                }
            },
            isEnabled: isCodeFoldingEnabled
        });
        app.commands.addCommand(CommandIDs.unfoldAll, {
            label: trans.__('Unfold All Regions'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                var _a;
                const editorInfo = getActiveEditorInfo();
                if (editorInfo.type === 'notebook') {
                    editorInfo.notebook.mode = 'edit';
                    if (editorInfo.notebook.activeCell) {
                        (_a = editorInfo.notebook.activeCell.editor) === null || _a === void 0 ? void 0 : _a.focus();
                    }
                }
                else if (editorInfo.type === 'fileEditor') {
                    editorInfo.widget.content.editor.focus();
                }
                const view = findEditorView();
                if (!view) {
                    return;
                }
                try {
                    (0,language_dist_index_js_.unfoldAll)(view);
                }
                catch (e) {
                    // Silent fail
                }
            },
            isEnabled: isCodeFoldingEnabled
        });
        if (palette) {
            const category = trans.__('File Operations');
            [
                CommandIDs.foldCurrent,
                CommandIDs.unfoldCurrent,
                CommandIDs.foldSubregions,
                CommandIDs.unfoldSubregions,
                CommandIDs.foldAll,
                CommandIDs.unfoldAll
            ].forEach(command => {
                palette.addItem({ command, category });
            });
        }
    }
};
//# sourceMappingURL=commands.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codemirror@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codemirror/lib/index.js)
var codemirror_lib_index_js_ = __webpack_require__(84088);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var coreutils_dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @rjsf/validator-ajv8@^5.13.4 (strict) (fallback: ../node_modules/@rjsf/validator-ajv8/lib/index.js)
var validator_ajv8_lib_index_js_ = __webpack_require__(27478);
var validator_ajv8_lib_index_js_default = /*#__PURE__*/__webpack_require__.n(validator_ajv8_lib_index_js_);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror-extension/lib/services.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */









/**
 * CodeMirror settings plugin ID
 */
const SETTINGS_ID = '@jupyterlab/codemirror-extension:plugin';
/**
 * CodeMirror language registry provider.
 */
const languagePlugin = {
    id: '@jupyterlab/codemirror-extension:languages',
    description: 'Provides the CodeMirror languages registry.',
    provides: codemirror_lib_index_js_.IEditorLanguageRegistry,
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, translator) => {
        const languages = new codemirror_lib_index_js_.EditorLanguageRegistry();
        // Register default languages
        for (const language of codemirror_lib_index_js_.EditorLanguageRegistry.getDefaultLanguages(translator)) {
            languages.addLanguage(language);
        }
        // Add Jupyter Markdown flavor here to support
        // code block highlighting.
        languages.addLanguage({
            name: 'ipythongfm',
            mime: 'text/x-ipythongfm',
            load: async () => {
                const [m, py, tex] = await Promise.all([
                    __webpack_require__.e(/* import() */ 4360).then(__webpack_require__.t.bind(__webpack_require__, 4360, 23)),
                    Promise.all(/* import() */[__webpack_require__.e(9799), __webpack_require__.e(2552), __webpack_require__.e(8145), __webpack_require__.e(771), __webpack_require__.e(2209)]).then(__webpack_require__.bind(__webpack_require__, 12552)),
                    __webpack_require__.e(/* import() */ 311).then(__webpack_require__.bind(__webpack_require__, 60311))
                ]);
                const mdlang = m.markdown({
                    base: m.markdownLanguage,
                    codeLanguages: (info) => languages.findBest(info),
                    extensions: [
                        (0,codemirror_lib_index_js_.parseMathIPython)(language_dist_index_js_.StreamLanguage.define(tex.stexMath).parser)
                    ]
                });
                return new language_dist_index_js_.LanguageSupport(mdlang.language, [
                    mdlang.support,
                    (0,codemirror_lib_index_js_.pythonBuiltin)(py.pythonLanguage)
                ]);
            }
        });
        return languages;
    }
};
/**
 * CodeMirror theme registry provider.
 */
const themePlugin = {
    id: '@jupyterlab/codemirror-extension:themes',
    description: 'Provides the CodeMirror theme registry',
    provides: codemirror_lib_index_js_.IEditorThemeRegistry,
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, translator) => {
        const themes = new codemirror_lib_index_js_.EditorThemeRegistry();
        // Register default themes
        for (const theme of codemirror_lib_index_js_.EditorThemeRegistry.getDefaultThemes(translator)) {
            themes.addTheme(theme);
        }
        return themes;
    }
};
/**
 * CodeMirror editor extensions registry provider.
 */
const extensionPlugin = {
    id: '@jupyterlab/codemirror-extension:extensions',
    description: 'Provides the CodeMirror extension factory registry.',
    provides: codemirror_lib_index_js_.IEditorExtensionRegistry,
    requires: [codemirror_lib_index_js_.IEditorThemeRegistry],
    optional: [translation_lib_index_js_.ITranslator, settingregistry_lib_index_js_.ISettingRegistry, ui_components_lib_index_js_.IFormRendererRegistry],
    activate: (app, themes, translator, settingRegistry, formRegistry) => {
        const registry = new codemirror_lib_index_js_.EditorExtensionRegistry();
        // Register default extensions
        for (const extensionFactory of codemirror_lib_index_js_.EditorExtensionRegistry.getDefaultExtensions({
            themes,
            translator
        })) {
            registry.addExtension(extensionFactory);
        }
        if (settingRegistry) {
            const updateSettings = (settings) => {
                var _a;
                registry.baseConfiguration =
                    (_a = settings.get('defaultConfig').composite) !== null && _a !== void 0 ? _a : {};
            };
            void Promise.all([
                settingRegistry.load(SETTINGS_ID),
                app.restored
            ]).then(([settings]) => {
                updateSettings(settings);
                settings.changed.connect(updateSettings);
            });
            formRegistry === null || formRegistry === void 0 ? void 0 : formRegistry.addRenderer(`${SETTINGS_ID}.defaultConfig`, {
                fieldRenderer: (props) => {
                    let defaultFormData;
                    const properties = react_index_js_default().useMemo(() => registry.settingsSchema, []);
                    if (props.name in props.formContext.defaultFormData) {
                        defaultFormData = props.formContext.defaultFormData[props.name];
                    }
                    else {
                        defaultFormData = {};
                    }
                    // Only provide customizable options
                    for (const [key, value] of Object.entries(registry.defaultConfiguration)) {
                        if (typeof properties[key] !== 'undefined' &&
                            !(key in defaultFormData)) {
                            defaultFormData[key] = value;
                        }
                    }
                    return (react_index_js_default().createElement("div", { className: "jp-FormGroup-contentNormal" },
                        react_index_js_default().createElement("h3", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem" }, props.schema.title),
                        props.schema.description && (react_index_js_default().createElement("div", { className: "jp-FormGroup-description" }, props.schema.description)),
                        react_index_js_default().createElement(ui_components_lib_index_js_.FormComponent, { schema: {
                                title: props.schema.title,
                                description: props.schema.description,
                                type: 'object',
                                properties,
                                additionalProperties: false
                            }, validator: (validator_ajv8_lib_index_js_default()), formData: { ...defaultFormData, ...props.formData }, formContext: { defaultFormData }, liveValidate: true, onChange: e => {
                                var _a;
                                // Only save non-default values
                                const nonDefault = {};
                                for (const [property, value] of Object.entries((_a = e.formData) !== null && _a !== void 0 ? _a : {})) {
                                    const default_ = defaultFormData[property];
                                    if (default_ === undefined ||
                                        !coreutils_dist_index_js_.JSONExt.deepEqual(value, default_)) {
                                        nonDefault[property] = value;
                                    }
                                }
                                props.onChange(nonDefault);
                            }, tagName: "div", translator: translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator })));
                }
            });
        }
        return registry;
    }
};
/**
 * CodeMirror shared model binding provider.
 */
const bindingPlugin = {
    id: '@jupyterlab/codemirror-extension:binding',
    description: 'Register the CodeMirror extension factory binding the editor and the shared model.',
    autoStart: true,
    requires: [codemirror_lib_index_js_.IEditorExtensionRegistry],
    activate: (app, extensions) => {
        extensions.addExtension({
            name: 'shared-model-binding',
            factory: options => {
                var _a;
                const sharedModel = options.model.sharedModel;
                return codemirror_lib_index_js_.EditorExtensionRegistry.createImmutableExtension((0,codemirror_lib_index_js_.ybinding)({
                    ytext: sharedModel.ysource,
                    undoManager: (_a = sharedModel.undoManager) !== null && _a !== void 0 ? _a : undefined
                }));
            }
        });
    }
};
/**
 * The editor services.
 */
const servicesPlugin = {
    id: '@jupyterlab/codemirror-extension:services',
    description: 'Provides the service to instantiate CodeMirror editors.',
    provides: lib_index_js_.IEditorServices,
    requires: [codemirror_lib_index_js_.IEditorLanguageRegistry, codemirror_lib_index_js_.IEditorExtensionRegistry],
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, languages, extensions, translator) => {
        const factory = new codemirror_lib_index_js_.CodeMirrorEditorFactory({
            extensions,
            languages,
            translator: translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator
        });
        return {
            factoryService: factory,
            mimeTypeService: new codemirror_lib_index_js_.CodeMirrorMimeTypeService(languages)
        };
    }
};
//# sourceMappingURL=services.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module codemirror-extension
 */






/**
 * A plugin providing a line/column status item to the application.
 */
const lineColItem = {
    id: '@jupyterlab/codemirror-extension:line-col-status',
    description: 'Provides the code editor cursor position model.',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator],
    optional: [index_js_.ILabShell, statusbar_lib_index_js_.IStatusBar],
    provides: lib_index_js_.IPositionModel,
    activate: (app, translator, labShell, statusBar) => {
        const item = new lib_index_js_.LineCol(translator);
        const providers = new Set();
        if (statusBar) {
            // Add the status item to the status bar.
            statusBar.registerStatusItem(lineColItem.id, {
                priority: 1,
                item,
                align: 'right',
                rank: 2,
                isActive: () => !!item.model.editor
            });
        }
        const addEditorProvider = (provider) => {
            providers.add(provider);
            if (app.shell.currentWidget) {
                updateEditor(app.shell, {
                    newValue: app.shell.currentWidget,
                    oldValue: null
                });
            }
        };
        const update = () => {
            updateEditor(app.shell, {
                oldValue: app.shell.currentWidget,
                newValue: app.shell.currentWidget
            });
        };
        function updateEditor(shell, changes) {
            Promise.all([...providers].map(provider => provider(changes.newValue)))
                .then(editors => {
                var _a;
                item.model.editor =
                    (_a = editors.filter(editor => editor !== null)[0]) !== null && _a !== void 0 ? _a : null;
            })
                .catch(reason => {
                console.error('Get editors', reason);
            });
        }
        if (labShell) {
            labShell.currentChanged.connect(updateEditor);
        }
        return { addEditorProvider, update };
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    commandsPlugin,
    languagePlugin,
    themePlugin,
    bindingPlugin,
    extensionPlugin,
    servicesPlugin,
    lineColItem
];
/* harmony default export */ const lib = (plugins);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 18934:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_statusbar_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(546);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_codeeditor_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7526);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_codemirror_style_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(32871);
/* harmony import */ var _jupyterlab_notebook_style_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(47456);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */










/***/ }),

/***/ 3748:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CodeMirrorEditor: () => (/* reexport */ CodeMirrorEditor),
  CodeMirrorEditorFactory: () => (/* reexport */ CodeMirrorEditorFactory),
  CodeMirrorMimeTypeService: () => (/* reexport */ CodeMirrorMimeTypeService),
  CodeMirrorSearchHighlighter: () => (/* reexport */ CodeMirrorSearchHighlighter),
  EditorExtensionRegistry: () => (/* reexport */ EditorExtensionRegistry),
  EditorLanguageRegistry: () => (/* reexport */ EditorLanguageRegistry),
  EditorSearchProvider: () => (/* reexport */ EditorSearchProvider),
  EditorThemeRegistry: () => (/* reexport */ EditorThemeRegistry),
  ExtensionsHandler: () => (/* reexport */ ExtensionsHandler),
  IEditorExtensionRegistry: () => (/* reexport */ IEditorExtensionRegistry),
  IEditorLanguageRegistry: () => (/* reexport */ IEditorLanguageRegistry),
  IEditorThemeRegistry: () => (/* reexport */ IEditorThemeRegistry),
  PythonBuiltin: () => (/* reexport */ PythonBuiltin),
  StateCommands: () => (/* reexport */ StateCommands),
  YRange: () => (/* reexport */ YRange),
  YSyncConfig: () => (/* reexport */ YSyncConfig),
  customTheme: () => (/* reexport */ customTheme),
  jupyterEditorTheme: () => (/* reexport */ jupyterEditorTheme),
  jupyterHighlightStyle: () => (/* reexport */ jupyterHighlightStyle),
  jupyterTheme: () => (/* reexport */ jupyterTheme),
  parseMathIPython: () => (/* reexport */ parseMathIPython),
  pythonBuiltin: () => (/* reexport */ pythonBuiltin),
  rulers: () => (/* reexport */ rulers),
  ySync: () => (/* reexport */ ySync),
  ySyncAnnotation: () => (/* reexport */ ySyncAnnotation),
  ySyncFacet: () => (/* reexport */ ySyncFacet),
  ybinding: () => (/* reexport */ ybinding)
});

// EXTERNAL MODULE: consume shared module (default) @codemirror/commands@^6.10.2 (strict) (fallback: ../node_modules/@codemirror/commands/dist/index.js)
var index_js_ = __webpack_require__(55942);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var lib_index_js_ = __webpack_require__(67458);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/commands.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


/**
 * Selector for a widget that can run code.
 */
const CODE_RUNNER_SELECTOR = '[data-jp-code-runner]';
/**
 * Selector for a widget that can run code in terminal mode.
 */
const TERMINAL_CODE_RUNNER_SELECTOR = '[data-jp-interaction-mode="terminal"]';
/**
 * Selector for a widget that can open a tooltip.
 */
const TOOLTIP_OPENER_SELECTOR = '.jp-CodeMirrorEditor:not(.jp-mod-has-primary-selection):not(.jp-mod-in-leading-whitespace):not(.jp-mod-completer-active)';
/**
 * Selector for an active cell in edit mode.
 */
const ACTIVE_CELL_IN_EDIT_MODE_SELECTOR = '.jp-mod-editMode .jp-Cell.jp-mod-active';
/**
 * CodeMirror commands namespace
 */
var StateCommands;
(function (StateCommands) {
    /**
     * Indent or insert a tab as appropriate.
     */
    function indentMoreOrInsertTab(target) {
        var _a;
        let classList = (_a = target.dom.parentElement) === null || _a === void 0 ? void 0 : _a.classList;
        let completerEnabled = classList === null || classList === void 0 ? void 0 : classList.contains(lib_index_js_.COMPLETER_ENABLED_CLASS);
        let lineBeggining = classList === null || classList === void 0 ? void 0 : classList.contains(lib_index_js_.COMPLETER_LINE_BEGINNING_CLASS);
        if (completerEnabled && !lineBeggining) {
            return false;
        }
        const arg = { state: target.state, dispatch: target.dispatch };
        const from = target.state.selection.main.from;
        const to = target.state.selection.main.to;
        if (from != to) {
            return (0,index_js_.indentMore)(arg);
        }
        const line = target.state.doc.lineAt(from);
        const before = target.state.doc.slice(line.from, from).toString();
        if (/^\s*$/.test(before)) {
            return (0,index_js_.indentMore)(arg);
        }
        else {
            return (0,index_js_.insertTab)(arg);
        }
    }
    StateCommands.indentMoreOrInsertTab = indentMoreOrInsertTab;
    /**
     * Insert new line if completer is not active.
     */
    function completerOrInsertNewLine(target) {
        var _a;
        if ((_a = target.dom.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains(lib_index_js_.COMPLETER_ACTIVE_CLASS)) {
            // do not prevent default to allow completer `enter` action
            return false;
        }
        if (target.dom.closest(TERMINAL_CODE_RUNNER_SELECTOR)) {
            // do not prevent default to allow for the cell to run
            return false;
        }
        const arg = { state: target.state, dispatch: target.dispatch };
        return (0,index_js_.insertNewlineAndIndent)(arg);
    }
    StateCommands.completerOrInsertNewLine = completerOrInsertNewLine;
    /**
     * Prevent insertion of new line when running cell with Ctrl/Command + Enter
     * @deprecated
     */
    function preventNewLineOnRun(target) {
        if (target.dom.closest(CODE_RUNNER_SELECTOR)) {
            return true;
        }
        return false;
    }
    StateCommands.preventNewLineOnRun = preventNewLineOnRun;
    /**
     * Insert a new line or run a cell with Ctrl/Command + Enter
     */
    function insertBlankLineOnRun(target) {
        if (target.dom.closest(CODE_RUNNER_SELECTOR)) {
            // do not prevent default to allow `run` action to be handled by lumino
            return false;
        }
        else {
            const arg = { state: target.state, dispatch: target.dispatch };
            return (0,index_js_.insertBlankLine)(arg);
        }
    }
    StateCommands.insertBlankLineOnRun = insertBlankLineOnRun;
    /**
     * Simplify selection but do not prevent default to allow switching to command mode.
     */
    function simplifySelectionAndMaybeSwitchToCommandMode(target) {
        const arg = { state: target.state, dispatch: target.dispatch };
        const preventDefault = (0,index_js_.simplifySelection)(arg);
        if (target.dom.closest(ACTIVE_CELL_IN_EDIT_MODE_SELECTOR)) {
            // do not prevent default to allow switching to command mode
            return false;
        }
        else {
            return preventDefault;
        }
    }
    StateCommands.simplifySelectionAndMaybeSwitchToCommandMode = simplifySelectionAndMaybeSwitchToCommandMode;
    /**
     * Prevent dedenting when launching inspection request (a.k.a tooltip).
     *
     * This function should be removed once a better way to prevent default
     * CodeMirror commands is implemented, as tracked in
     * https://github.com/jupyterlab/jupyterlab/issues/15897
     */
    function dedentIfNotLaunchingTooltip(target) {
        if (target.dom.closest(TOOLTIP_OPENER_SELECTOR)) {
            return false;
        }
        return (0,index_js_.indentLess)(target);
    }
    StateCommands.dedentIfNotLaunchingTooltip = dedentIfNotLaunchingTooltip;
})(StateCommands || (StateCommands = {}));
//# sourceMappingURL=commands.js.map
// EXTERNAL MODULE: consume shared module (default) @codemirror/language@^6.12.1 (strict) (fallback: ../node_modules/@codemirror/language/dist/index.js)
var dist_index_js_ = __webpack_require__(17544);
// EXTERNAL MODULE: consume shared module (default) @codemirror/state@~6.5.4 (singleton) (fallback: ../node_modules/@codemirror/state/dist/index.js)
var state_dist_index_js_ = __webpack_require__(88145);
// EXTERNAL MODULE: consume shared module (default) @codemirror/view@~6.39.15 (singleton) (fallback: ../node_modules/@codemirror/view/dist/index.js)
var view_dist_index_js_ = __webpack_require__(1164);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var coreutils_dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: ../node_modules/@codemirror/autocomplete/dist/index.js
var dist = __webpack_require__(56318);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/extensions/customStyle.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


/**
 * Custom theme configuration
 *
 * The first non-null value takes precedence
 */
const customThemeConfig = state_dist_index_js_.Facet.define({
    combine(configs) {
        return (0,state_dist_index_js_.combineConfig)(configs, {
            fontFamily: null,
            fontSize: null,
            lineHeight: null
        }, {
            fontFamily: (a, b) => a !== null && a !== void 0 ? a : b,
            fontSize: (a, b) => a !== null && a !== void 0 ? a : b,
            lineHeight: (a, b) => a !== null && a !== void 0 ? a : b
        });
    }
});
function setEditorStyle(view) {
    const { fontFamily, fontSize, lineHeight } = view.state.facet(customThemeConfig);
    let style = '';
    if (fontSize) {
        style += `font-size: ${fontSize}px !important;`;
    }
    if (fontFamily) {
        style += `font-family: ${fontFamily} !important;`;
    }
    if (lineHeight) {
        style += `line-height: ${lineHeight.toString()} !important`;
    }
    return { style: style };
}
/**
 * Get the extension to customize an editor theme.
 *
 * @param config Theme customization
 * @returns Editor extension
 */
function customTheme(config) {
    return [
        customThemeConfig.of(config),
        view_dist_index_js_.EditorView.editorAttributes.of(setEditorStyle)
    ];
}
//# sourceMappingURL=customStyle.js.map
// EXTERNAL MODULE: consume shared module (default) @lezer/common@~1.5.0 (singleton) (fallback: ../node_modules/@lezer/common/dist/index.js)
var common_dist_index_js_ = __webpack_require__(50771);
// EXTERNAL MODULE: consume shared module (default) @lezer/highlight@~1.2.0 (singleton) (fallback: ../node_modules/@lezer/highlight/dist/index.js)
var highlight_dist_index_js_ = __webpack_require__(92209);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/extensions/ipython-md.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


// Mathematical expression delimiters
const INLINE_MATH_DOLLAR = 'InlineMathDollar';
const INLINE_MATH_BRACKET = 'InlineMathBracket';
const BLOCK_MATH_DOLLAR = 'BlockMathDollar';
const BLOCK_MATH_BRACKET = 'BlockMathBracket';
/**
 * Length of the delimiter for a math expression
 */
const DELIMITER_LENGTH = {
    [INLINE_MATH_DOLLAR]: 1,
    [INLINE_MATH_BRACKET]: 3,
    [BLOCK_MATH_DOLLAR]: 2,
    [BLOCK_MATH_BRACKET]: 3
};
/**
 * Delimiters for math expressions
 */
// Delimiters must be defined as constant because they are used in object match tests
const DELIMITERS = Object.keys(DELIMITER_LENGTH).reduce((agg, name) => {
    agg[name] = { mark: `${name}Mark`, resolve: name };
    return agg;
}, {});
/**
 * Define an IPython mathematical expression parser for Markdown.
 *
 * @param latexParser CodeMirror {@link Parser} for LaTeX mathematical expression
 * @returns Markdown extension
 */
function parseMathIPython(latexParser) {
    const defineNodes = new Array();
    Object.keys(DELIMITER_LENGTH).forEach(name => {
        defineNodes.push({
            name,
            style: highlight_dist_index_js_.tags.emphasis
        }, { name: `${name}Mark`, style: highlight_dist_index_js_.tags.processingInstruction });
    });
    return {
        defineNodes,
        parseInline: [
            {
                name: BLOCK_MATH_DOLLAR,
                parse(cx, next, pos) {
                    if (next != 36 /* '$' */ || cx.char(pos + 1) != 36) {
                        return -1;
                    }
                    return cx.addDelimiter(DELIMITERS[BLOCK_MATH_DOLLAR], pos, pos + DELIMITER_LENGTH[BLOCK_MATH_DOLLAR], true, true);
                }
            },
            {
                name: INLINE_MATH_DOLLAR,
                parse(cx, next, pos) {
                    if (next != 36 /* '$' */ || cx.char(pos + 1) == 36) {
                        return -1;
                    }
                    return cx.addDelimiter(DELIMITERS[INLINE_MATH_DOLLAR], pos, pos + DELIMITER_LENGTH[INLINE_MATH_DOLLAR], true, true);
                }
            },
            // Inline expression wrapped in \\( ... \\)
            {
                name: INLINE_MATH_BRACKET,
                before: 'Escape', // Search for this delimiter before the escape character
                parse(cx, next, pos) {
                    if (next != 92 /* '\' */ ||
                        cx.char(pos + 1) != 92 ||
                        ![40 /* '(' */, 41 /* ')' */].includes(cx.char(pos + 2))) {
                        return -1;
                    }
                    return cx.addDelimiter(DELIMITERS[INLINE_MATH_BRACKET], pos, pos + DELIMITER_LENGTH[INLINE_MATH_BRACKET], cx.char(pos + 2) == 40, cx.char(pos + 2) == 41);
                }
            },
            // Block expression wrapped in \\[ ... \\]
            {
                name: BLOCK_MATH_BRACKET,
                before: 'Escape', // Search for this delimiter before the escape character
                parse(cx, next, pos) {
                    if (next != 92 /* '\' */ ||
                        cx.char(pos + 1) != 92 ||
                        ![91 /* '[' */, 93 /* ']' */].includes(cx.char(pos + 2))) {
                        return -1;
                    }
                    return cx.addDelimiter(DELIMITERS[BLOCK_MATH_BRACKET], pos, pos + DELIMITER_LENGTH[BLOCK_MATH_BRACKET], cx.char(pos + 2) == 91, cx.char(pos + 2) == 93);
                }
            }
        ],
        wrap: latexParser
            ? (0,common_dist_index_js_.parseMixed)((node, input) => {
                // Test if the node type is one of the math expression
                const delimiterLength = DELIMITER_LENGTH[node.type.name];
                if (delimiterLength) {
                    const contentFrom = node.from + delimiterLength;
                    const contentTo = node.to - delimiterLength;
                    if (contentTo - contentFrom > 0) {
                        return {
                            parser: latexParser,
                            // Remove delimiter from LaTeX parser otherwise it won't be highlighted
                            overlay: [
                                {
                                    from: contentFrom,
                                    to: contentTo
                                }
                            ]
                        };
                    }
                }
                return null;
            })
            : undefined
    };
}
//# sourceMappingURL=ipython-md.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/extensions/rulers.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
// Inspired by https://discuss.codemirror.net/t/how-to-implement-ruler/4616/



const RULERS_CLASSNAME = 'cm-rulers';
/**
 * Rulers style
 */
const baseTheme = view_dist_index_js_.EditorView.baseTheme({
    [`.${RULERS_CLASSNAME}`]: { borderRight: '1px dotted gray', opacity: 0.7 }
});
/**
 * Rulers facet
 */
const rulerConfig = state_dist_index_js_.Facet.define({
    // Merge all unique values
    combine(value) {
        const final = value.reduce((agg, arr) => agg.concat(
        // Check value is not in aggregate nor multiple time in the array.
        arr.filter((v, idx) => !agg.includes(v) && idx == arr.lastIndexOf(v))), []);
        return final;
    }
});
/**
 * View plugin displaying the rulers
 */
const rulers_plugin = view_dist_index_js_.ViewPlugin.fromClass(class {
    constructor(view) {
        var _a, _b;
        this.rulersContainer = view.dom.appendChild(document.createElement('div'));
        this.rulersContainer.style.cssText = `
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                pointer-events: none;
                overflow: hidden;
            `;
        const defaultCharacterWidth = view.defaultCharacterWidth;
        const widths = view.state.facet(rulerConfig);
        const guttersWidths = (_b = (_a = view.scrollDOM.querySelector('.cm-gutters')) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
        this.rulers = widths.map(width => {
            const ruler = this.rulersContainer.appendChild(document.createElement('div'));
            ruler.classList.add(RULERS_CLASSNAME);
            ruler.style.cssText = `
                position: absolute;
                left: ${guttersWidths + width * defaultCharacterWidth}px;
                height: 100%;
            `;
            // FIXME: This should be equal to the amount of padding on a line.
            // This value should be extracted from CodeMirror rather than hardcoded.
            ruler.style.width = '6px';
            return ruler;
        });
    }
    update(update) {
        var _a, _b;
        const widths = update.view.state.facet(rulerConfig);
        if (update.viewportChanged ||
            update.geometryChanged ||
            !coreutils_dist_index_js_.JSONExt.deepEqual(widths, update.startState.facet(rulerConfig))) {
            const guttersWidth = (_b = (_a = update.view.scrollDOM.querySelector('.cm-gutters')) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
            const defaultCharacterWidth = update.view.defaultCharacterWidth;
            this.rulers.forEach((ruler, rulerIdx) => {
                ruler.style.left = `${guttersWidth + widths[rulerIdx] * defaultCharacterWidth}px`;
            });
        }
    }
    destroy() {
        this.rulers.forEach(ruler => {
            ruler.remove();
        });
        this.rulersContainer.remove();
    }
});
/**
 * Extension for CodeMirror 6 displaying rulers.
 *
 * @param value Rulers position
 * @returns CodeMirror 6 extension
 */
function rulers(value) {
    return [baseTheme, rulerConfig.of(value), rulers_plugin];
}
//# sourceMappingURL=rulers.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/extensions/yundomanager.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 *
 * Vendored from https://github.com/yjs/y-codemirror.next
 * licensed under MIT License by Kevin Jahns.
 *
 * Ideally we would depend on the y-codemirror.next, but it is impractical
 * until https://github.com/yjs/y-codemirror.next/issues/27 is resolved.
 *
 * Modifications compared to upstream:
 * - removed spurious mutex (https://github.com/yjs/y-codemirror.next/issues/15)
 * - added TypeScript types
 * - simplified `YUndoManagerConfig` by removing public methods
 * - moved `_onStackItemAdded`, `_onStackItemPopped` and `_storeSelection` definitions out of constructor
 */



class YUndoManagerConfig {
    constructor(undoManager) {
        this.undoManager = undoManager;
    }
}
const yUndoManagerFacet = state_dist_index_js_.Facet.define({
    combine(inputs) {
        return inputs[inputs.length - 1];
    }
});
class YUndoManagerPluginValue {
    constructor(view) {
        this._onStackItemAdded = ({ stackItem, changedParentTypes }) => {
            // only store metadata if this type was affected
            if (changedParentTypes.has(this._syncConf.ytext) &&
                this._beforeChangeSelection &&
                !stackItem.meta.has(this)) {
                // do not overwrite previous stored selection
                stackItem.meta.set(this, this._beforeChangeSelection);
            }
        };
        this._onStackItemPopped = ({ stackItem }) => {
            const sel = stackItem.meta.get(this);
            if (sel) {
                const selection = this._syncConf.fromYRange(sel);
                this._view.dispatch(this._view.state.update({
                    selection,
                    effects: [view_dist_index_js_.EditorView.scrollIntoView(selection)]
                }));
                this._storeSelection();
            }
        };
        this._storeSelection = () => {
            // store the selection before the change is applied so we can restore it with the undo manager.
            this._beforeChangeSelection = this._syncConf.toYRange(this._view.state.selection.main);
        };
        this._view = view;
        this._conf = view.state.facet(yUndoManagerFacet);
        this._undoManager = this._conf.undoManager;
        this._syncConf = view.state.facet(ySyncFacet);
        this._beforeChangeSelection = null;
        this._undoManager.on('stack-item-added', this._onStackItemAdded);
        this._undoManager.on('stack-item-popped', this._onStackItemPopped);
        this._undoManager.addTrackedOrigin(this._syncConf);
    }
    update(update) {
        if (update.selectionSet &&
            (update.transactions.length === 0 ||
                update.transactions[0].annotation(ySyncAnnotation) !== this._syncConf)) {
            // This only works when YUndoManagerPlugin is included before the sync plugin
            this._storeSelection();
        }
    }
    destroy() {
        this._undoManager.off('stack-item-added', this._onStackItemAdded);
        this._undoManager.off('stack-item-popped', this._onStackItemPopped);
        this._undoManager.removeTrackedOrigin(this._syncConf);
    }
}
const yUndoManager = view_dist_index_js_.ViewPlugin.fromClass(YUndoManagerPluginValue);
//# sourceMappingURL=yundomanager.js.map
// EXTERNAL MODULE: consume shared module (default) yjs@~13.6.8 (singleton) (fallback: ../node_modules/yjs/dist/yjs.mjs)
var yjs_mjs_ = __webpack_require__(17843);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/extensions/ybinding.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 *
 * Binding for yjs and codemirror
 *
 * It is a simplification of https://github.com/yjs/y-codemirror.next
 * licensed under MIT License by Kevin Jahns
 */




/**
 * Defines a range on text using relative positions that can be transformed back to
 * absolute positions. (https://docs.yjs.dev/api/relative-positions)
 */
class YRange {
    /**
     * @param yanchor
     * @param yhead
     */
    constructor(yanchor, yhead) {
        this.yanchor = yanchor;
        this.yhead = yhead;
    }
    /**
     * Convert the position to JSON
     */
    toJSON() {
        return {
            yanchor: (0,yjs_mjs_.relativePositionToJSON)(this.yanchor),
            yhead: (0,yjs_mjs_.relativePositionToJSON)(this.yhead)
        };
    }
    /**
     * Convert a JSON range to a YRange
     * @param json Range to convert
     * @return The range as YRange
     */
    static fromJSON(json) {
        return new YRange((0,yjs_mjs_.createRelativePositionFromJSON)(json.yanchor), (0,yjs_mjs_.createRelativePositionFromJSON)(json.yhead));
    }
}
/**
 * Yjs binding configuration
 */
class YSyncConfig {
    /**
     * Create a new binding configuration
     *
     * @param ytext Yjs text to synchronize
     */
    constructor(ytext) {
        this.ytext = ytext;
    }
    /**
     * Helper function to transform an absolute index position to a Yjs-based relative position
     * (https://docs.yjs.dev/api/relative-positions).
     *
     * A relative position can be transformed back to an absolute position even after the document has changed. The position is
     * automatically adapted. This does not require any position transformations. Relative positions are computed based on
     * the internal Yjs document model. Peers that share content through Yjs are guaranteed that their positions will always
     * synced up when using relative positions.
     *
     * ```js
     * import { ySyncFacet } from 'y-codemirror'
     *
     * ..
     * const ysync = view.state.facet(ySyncFacet)
     * // transform an absolute index position to a ypos
     * const ypos = ysync.getYPos(3)
     * // transform the ypos back to an absolute position
     * ysync.fromYPos(ypos) // => 3
     * ```
     *
     * It cannot be guaranteed that absolute index positions can be synced up between peers.
     * This might lead to undesired behavior when implementing features that require that all peers see the
     * same marked range (e.g. a comment plugin).
     *
     * @param pos
     * @param assoc
     */
    toYPos(pos, assoc = 0) {
        return (0,yjs_mjs_.createRelativePositionFromTypeIndex)(this.ytext, pos, assoc);
    }
    /**
     * @param rpos
     */
    fromYPos(rpos) {
        const pos = (0,yjs_mjs_.createAbsolutePositionFromRelativePosition)((0,yjs_mjs_.createRelativePositionFromJSON)(rpos), this.ytext.doc);
        if (pos == null || pos.type !== this.ytext) {
            throw new Error('[y-codemirror] The position you want to retrieve was created by a different document');
        }
        return {
            pos: pos.index,
            assoc: pos.assoc
        };
    }
    /**
     * @param range
     * @return
     */
    toYRange(range) {
        const assoc = range.assoc;
        const yanchor = this.toYPos(range.anchor, assoc);
        const yhead = this.toYPos(range.head, assoc);
        return new YRange(yanchor, yhead);
    }
    /**
     * @param yrange
     */
    fromYRange(yrange) {
        const anchor = this.fromYPos(yrange.yanchor);
        const head = this.fromYPos(yrange.yhead);
        if (anchor.pos === head.pos) {
            return state_dist_index_js_.EditorSelection.cursor(head.pos, head.assoc);
        }
        return state_dist_index_js_.EditorSelection.range(anchor.pos, head.pos);
    }
}
/**
 * Yjs binding facet
 */
const ySyncFacet = state_dist_index_js_.Facet.define({
    combine(inputs) {
        return inputs[inputs.length - 1];
    }
});
/**
 * Yjs binding annotation
 *
 * It is used to track the origin of the document changes
 */
const ySyncAnnotation = state_dist_index_js_.Annotation.define();
/**
 * Yjs binding view plugin to synchronize the
 * editor state with the Yjs document.
 */
const ySync = view_dist_index_js_.ViewPlugin.fromClass(class {
    constructor(view) {
        this.conf = view.state.facet(ySyncFacet);
        this._observer = (event, tr) => {
            var _a;
            if (tr.origin !== this.conf) {
                const delta = event.delta;
                const changes = [];
                let pos = 0;
                for (let i = 0; i < delta.length; i++) {
                    const d = delta[i];
                    if (d.insert != null) {
                        changes.push({ from: pos, to: pos, insert: d.insert });
                    }
                    else if (d.delete != null) {
                        changes.push({ from: pos, to: pos + d.delete, insert: '' });
                        pos += d.delete;
                    }
                    else {
                        pos += (_a = d.retain) !== null && _a !== void 0 ? _a : 0;
                    }
                }
                view.dispatch({
                    changes,
                    // Specified the changes origin to not loop when synchronizing
                    annotations: [ySyncAnnotation.of(this.conf)]
                });
            }
        };
        this._ytext = this.conf.ytext;
        this._ytext.observe(this._observer);
    }
    update(update) {
        if (!update.docChanged ||
            (update.transactions.length > 0 &&
                update.transactions[0].annotation(ySyncAnnotation) === this.conf)) {
            return;
        }
        const ytext = this.conf.ytext;
        ytext.doc.transact(() => {
            /**
             * This variable adjusts the fromA position to the current position in the Y.Text type.
             */
            let adj = 0;
            update.changes.iterChanges((fromA, toA, fromB, toB, insert) => {
                const insertText = insert.sliceString(0, insert.length, '\n');
                if (fromA !== toA) {
                    ytext.delete(fromA + adj, toA - fromA);
                }
                if (insertText.length > 0) {
                    ytext.insert(fromA + adj, insertText);
                }
                adj += insertText.length - (toA - fromA);
            });
            // Set the configuration as origin to not loop when synchronizing
        }, this.conf);
    }
    destroy() {
        this._ytext.unobserve(this._observer);
    }
});
/**
 * Extension for CodeMirror 6 binding the Yjs text (source of truth)
 * and the editor state.
 *
 * @param options.ytext Yjs text to bind
 * @param options.undoManager Yjs text undo manager
 * @returns CodeMirror 6 extension
 */
function ybinding(options) {
    const { ytext, undoManager } = options;
    const ySyncConfig = new YSyncConfig(ytext);
    const plugins = [ySyncFacet.of(ySyncConfig), ySync];
    if (undoManager) {
        plugins.push(
        // We need to add a new origin to the undo manager to ensure text updates
        // are tracked; we also need to restore selection after undo/redo.
        yUndoManagerFacet.of(new YUndoManagerConfig(undoManager)), yUndoManager);
    }
    return plugins;
}
//# sourceMappingURL=ybinding.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/extensions/index.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: consume shared module (default) @codemirror/search@^6.6.0 (strict) (fallback: ../node_modules/@codemirror/search/dist/index.js)
var search_dist_index_js_ = __webpack_require__(76724);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/extension.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.











/**
 * The class name added to read only editor widgets.
 */
const READ_ONLY_CLASS = 'jp-mod-readOnly';
/**
 * Editor configuration handler
 *
 * It stores the editor configuration and the editor extensions.
 * It also allows to inject new extensions into an editor.
 */
class ExtensionsHandler {
    constructor({ baseConfiguration, config, defaultExtensions } = {}) {
        this._configChanged = new index_es6_js_.Signal(this);
        this._disposed = new index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._immutables = new Set();
        this._baseConfig = baseConfiguration !== null && baseConfiguration !== void 0 ? baseConfiguration : {};
        this._config = config !== null && config !== void 0 ? config : {};
        this._configurableBuilderMap = new Map(defaultExtensions);
        const configurables = Object.keys(this._config).concat(Object.keys(this._baseConfig));
        this._immutables = new Set([...this._configurableBuilderMap.keys()].filter(key => !configurables.includes(key)));
    }
    /**
     * Signal triggered when the editor configuration changes.
     * It provides the mapping of the new configuration (only those that changed).
     *
     * It should result in a call to `IExtensionsHandler.reconfigureExtensions`.
     */
    get configChanged() {
        return this._configChanged;
    }
    /**
     * A signal emitted when the object is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Tests whether the object is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the object.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._disposed.emit();
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Get a config option for the editor.
     */
    getOption(option) {
        var _a;
        return (_a = this._config[option]) !== null && _a !== void 0 ? _a : this._baseConfig[option];
    }
    /**
     * Whether the option exists or not.
     */
    hasOption(option) {
        return (Object.keys(this._config).includes(option) ||
            Object.keys(this._baseConfig).includes(option));
    }
    /**
     * Set a config option for the editor.
     *
     * You will need to reconfigure the editor extensions by listening
     * to `IExtensionsHandler.configChanged`.
     */
    setOption(option, value) {
        // Don't bother setting the option if it is already the same.
        if (this._config[option] !== value) {
            this._config[option] = value;
            this._configChanged.emit({ [option]: value });
        }
    }
    /**
     * Set a base config option for the editor.
     *
     * You will need to reconfigure the editor extensions by listening
     * to `IExtensionsHandler.configChanged`.
     */
    setBaseOptions(options) {
        // Change values of baseConfig
        const changed = this._getChangedOptions(options, this._baseConfig);
        if (changed.length > 0) {
            this._baseConfig = options;
            const customizedKeys = Object.keys(this._config);
            const notOverridden = changed.filter(k => !customizedKeys.includes(k));
            if (notOverridden.length > 0) {
                this._configChanged.emit(notOverridden.reduce((agg, key) => {
                    agg[key] = this._baseConfig[key];
                    return agg;
                }, {}));
            }
        }
        // Change values of config keys if present in options
        for (const key of Object.keys(options)) {
            if (key in this._config && this._config[key] != options[key]) {
                this.setOption(key, options[key]);
            }
        }
    }
    /**
     * Set config options for the editor.
     *
     * You will need to reconfigure the editor extensions by listening
     * to `EditorHandler.configChanged`.
     *
     * This method is preferred when setting several options. The
     * options are set within an operation, which only performs
     * the costly update at the end, and not after every option
     * is set.
     */
    setOptions(options) {
        const changed = this._getChangedOptions(options, this._config);
        if (changed.length > 0) {
            this._config = { ...options };
            this._configChanged.emit(changed.reduce((agg, key) => {
                var _a;
                agg[key] = (_a = this._config[key]) !== null && _a !== void 0 ? _a : this._baseConfig[key];
                return agg;
            }, {}));
        }
    }
    /**
     * Reconfigures the extension mapped with key with the provided value.
     *
     * @param view Editor view
     * @param key Parameter unique key
     * @param value Parameter value to be applied
     */
    reconfigureExtension(view, key, value) {
        const effect = this.getEffect(view.state, key, value);
        if (effect) {
            view.dispatch({
                effects: [effect]
            });
        }
    }
    /**
     * Reconfigures all the extensions mapped with the options from the
     * provided partial configuration.
     *
     * @param view Editor view
     * @param configuration Editor configuration
     */
    reconfigureExtensions(view, configuration) {
        const effects = Object.keys(configuration)
            .filter(key => this.has(key))
            .map(key => this.getEffect(view.state, key, configuration[key]));
        view.dispatch({
            effects: effects.filter(effect => effect !== null)
        });
    }
    /**
     * Appends extensions to the top-level configuration of the
     * editor.
     *
     * Injected extension cannot be removed.
     *
     * ### Notes
     * You should prefer registering a IEditorExtensionFactory instead
     * of this feature.
     *
     * @alpha
     * @param view Editor view
     * @param extension Editor extension to inject
     */
    injectExtension(view, extension) {
        view.dispatch({
            effects: state_dist_index_js_.StateEffect.appendConfig.of(extension)
        });
    }
    /**
     * Returns the list of initial extensions of an editor
     * based on the configuration.
     *
     * @returns The initial editor extensions
     */
    getInitialExtensions() {
        const configuration = { ...this._baseConfig, ...this._config };
        const extensions = [...this._immutables]
            .map(key => { var _a; return (_a = this.get(key)) === null || _a === void 0 ? void 0 : _a.instance(undefined); })
            .filter(ext => ext);
        for (const k of Object.keys(configuration)) {
            const builder = this.get(k);
            if (builder) {
                const value = configuration[k];
                extensions.push(builder.instance(value));
            }
        }
        return extensions;
    }
    /**
     * Get a extension builder
     * @param key Extension unique identifier
     * @returns The extension builder
     */
    get(key) {
        return this._configurableBuilderMap.get(key);
    }
    /**
     * Whether the editor has an extension for the identifier.
     *
     * @param key Extension unique identifier
     * @returns Extension existence
     */
    has(key) {
        return this._configurableBuilderMap.has(key);
    }
    getEffect(state, key, value) {
        var _a;
        const builder = this.get(key);
        return (_a = builder === null || builder === void 0 ? void 0 : builder.reconfigure(value)) !== null && _a !== void 0 ? _a : null;
    }
    _getChangedOptions(newConfig, oldConfig) {
        const changed = new Array();
        const newKeys = new Array();
        for (const [key, value] of Object.entries(newConfig)) {
            newKeys.push(key);
            if (oldConfig[key] !== value) {
                changed.push(key);
            }
        }
        // Add removed old keys
        changed.push(...Object.keys(oldConfig).filter(k => !newKeys.includes(k)));
        return changed;
    }
}
/**
 * CodeMirror extensions registry
 */
class EditorExtensionRegistry {
    constructor() {
        this.configurationBuilder = new Map();
        this.configurationSchema = {};
        this.defaultOptions = {};
        this.handlers = new Set();
        this.immutableExtensions = new Set();
        this._baseConfiguration = {};
    }
    /**
     * Base editor configuration
     *
     * This is the default configuration optionally modified by the user;
     * e.g. through user settings.
     */
    get baseConfiguration() {
        return { ...this.defaultOptions, ...this._baseConfiguration };
    }
    set baseConfiguration(v) {
        if (!coreutils_dist_index_js_.JSONExt.deepEqual(v, this._baseConfiguration)) {
            this._baseConfiguration = v;
            for (const handler of this.handlers) {
                handler.setBaseOptions(this.baseConfiguration);
            }
        }
    }
    /**
     * Default editor configuration
     *
     * This is the default configuration as defined when extensions
     * are registered.
     */
    get defaultConfiguration() {
        // Only options with schema should be JSON serializable
        // So we cannot use `JSONExt.deepCopy` on the default options.
        return Object.freeze({ ...this.defaultOptions });
    }
    /**
     * Editor configuration JSON schema
     */
    get settingsSchema() {
        return Object.freeze(coreutils_dist_index_js_.JSONExt.deepCopy(this.configurationSchema));
    }
    /**
     * Add a default editor extension
     *
     * @template T Extension parameter type
     * @param factory Extension factory
     */
    addExtension(factory) {
        var _a;
        if (this.configurationBuilder.has(factory.name)) {
            throw new Error(`Extension named ${factory.name} is already registered.`);
        }
        this.configurationBuilder.set(factory.name, factory);
        if (typeof factory.default != 'undefined') {
            this.defaultOptions[factory.name] = factory.default;
        }
        if (factory.schema) {
            this.configurationSchema[factory.name] = {
                default: (_a = factory.default) !== null && _a !== void 0 ? _a : null,
                ...factory.schema
            };
            this.defaultOptions[factory.name] =
                this.configurationSchema[factory.name].default;
        }
    }
    /**
     * Create a new extensions handler for an editor
     *
     * @param options Extensions options and initial editor configuration
     */
    createNew(options) {
        const configuration = new Array();
        for (const [key, builder] of this.configurationBuilder.entries()) {
            const extension = builder.factory(options);
            if (extension) {
                configuration.push([key, extension]);
            }
        }
        const handler = new ExtensionsHandler({
            baseConfiguration: this.baseConfiguration,
            config: options.config,
            defaultExtensions: configuration
        });
        this.handlers.add(handler);
        handler.disposed.connect(() => {
            this.handlers.delete(handler);
        });
        return handler;
    }
}
/**
 * Editor extension registry namespace
 */
(function (EditorExtensionRegistry) {
    /**
     * Dynamically configurable editor extension.
     */
    class ConfigurableExtension {
        /**
         * Create a dynamic editor extension.
         *
         * @param builder Extension builder
         */
        constructor(builder) {
            this._compartment = new state_dist_index_js_.Compartment();
            this._builder = builder;
        }
        /**
         * Create an editor extension for the provided value.
         *
         * @param value Editor extension parameter value
         * @returns The editor extension
         */
        instance(value) {
            return this._compartment.of(this._builder(value));
        }
        /**
         * Reconfigure an editor extension.
         *
         * @param value Editor extension value
         * @returns Editor state effect
         */
        reconfigure(value) {
            return this._compartment.reconfigure(this._builder(value));
        }
    }
    /**
     * Immutable editor extension class
     */
    class ImmutableExtension {
        /**
         * Create an immutable editor extension.
         *
         * @param extension Extension
         */
        constructor(extension) {
            this._extension = extension;
        }
        /**
         * Create an editor extension.
         *
         * @returns The editor extension
         */
        instance() {
            return this._extension;
        }
        /**
         * Reconfigure an editor extension.
         *
         * This is a no-op
         */
        reconfigure() {
            // This is a no-op
            return null;
        }
    }
    /**
     * Creates a dynamically configurable editor extension.
     *
     * @param builder Extension builder
     * @return The extension
     */
    function createConfigurableExtension(builder) {
        return new ConfigurableExtension(builder);
    }
    EditorExtensionRegistry.createConfigurableExtension = createConfigurableExtension;
    /**
     * Creates a configurable extension returning
     * one of two extensions depending on a boolean value.
     *
     * @param truthy Extension to apply when the parameter is true
     * @param falsy Extension to apply when the parameter is false
     * @return The extension
     */
    function createConditionalExtension(truthy, falsy = []) {
        return new ConfigurableExtension(value => value ? truthy : falsy);
    }
    EditorExtensionRegistry.createConditionalExtension = createConditionalExtension;
    /**
     * Creates an immutable extension.
     *
     * @param extension Immutable extension
     * @return The extension
     */
    function createImmutableExtension(extension) {
        return new ImmutableExtension(extension);
    }
    EditorExtensionRegistry.createImmutableExtension = createImmutableExtension;
    /**
     * Get the default editor extensions.
     *
     * @returns CodeMirror 6 extension factories
     */
    function getDefaultExtensions(options = {}) {
        const { themes, translator } = options;
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const extensions = [
            Object.freeze({
                name: 'autoClosingBrackets',
                default: false,
                factory: () => createConditionalExtension((0,dist/* closeBrackets */.vQ)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Auto Closing Brackets')
                }
            }),
            Object.freeze({
                name: 'codeFolding',
                default: false,
                factory: () => createConditionalExtension((0,dist_index_js_.foldGutter)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Code Folding')
                }
            }),
            Object.freeze({
                name: 'cursorBlinkRate',
                default: 1200,
                factory: () => createConfigurableExtension((value) => (0,view_dist_index_js_.drawSelection)({ cursorBlinkRate: value })),
                schema: {
                    type: 'number',
                    title: trans.__('Cursor blinking rate'),
                    description: trans.__('Half-period in milliseconds used for cursor blinking. The default blink rate is 1200ms. By setting this to zero, blinking can be disabled.')
                }
            }),
            Object.freeze({
                name: 'highlightActiveLine',
                default: false,
                factory: () => createConditionalExtension((0,view_dist_index_js_.highlightActiveLine)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Highlight the active line')
                }
            }),
            Object.freeze({
                name: 'highlightSpecialCharacters',
                default: true,
                factory: () => createConditionalExtension((0,view_dist_index_js_.highlightSpecialChars)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Highlight special characters')
                }
            }),
            Object.freeze({
                name: 'highlightTrailingWhitespace',
                default: false,
                factory: () => createConditionalExtension((0,view_dist_index_js_.highlightTrailingWhitespace)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Highlight trailing white spaces')
                }
            }),
            Object.freeze({
                name: 'highlightWhitespace',
                default: false,
                factory: () => createConditionalExtension((0,view_dist_index_js_.highlightWhitespace)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Highlight white spaces')
                }
            }),
            Object.freeze({
                name: 'indentUnit',
                default: '4',
                factory: () => createConfigurableExtension((value) => value == 'Tab'
                    ? dist_index_js_.indentUnit.of('\t')
                    : dist_index_js_.indentUnit.of(' '.repeat(parseInt(value, 10)))),
                schema: {
                    type: 'string',
                    title: trans.__('Indentation unit'),
                    description: trans.__('The indentation is a `Tab` or the number of spaces. This defaults to 4 spaces.'),
                    enum: ['Tab', '1', '2', '4', '8']
                }
            }),
            // Default keyboard shortcuts
            // TODO at some point we may want to get this configurable
            Object.freeze({
                name: 'keymap',
                default: [
                    {
                        key: 'Mod-Enter',
                        run: StateCommands.insertBlankLineOnRun
                    },
                    {
                        key: 'Enter',
                        run: StateCommands.completerOrInsertNewLine
                    },
                    {
                        key: 'Escape',
                        run: StateCommands.simplifySelectionAndMaybeSwitchToCommandMode
                    },
                    ...index_js_.defaultKeymap.filter(binding => {
                        // - Disable the default Mod-Enter handler as it always prevents default,
                        //   preventing us from running cells with Ctrl + Enter. Instead we provide
                        //   our own handler (insertBlankLineOnRun) which does not prevent default
                        //   when used in code runner editors.
                        // - Disable the default Shift-Mod-k handler because users prefer Ctrl+D
                        //   for deleting lines, and because it prevents opening Table of Contents
                        //   with Ctrl+Shift+K.
                        // - Disable shortcuts for toggling comments ("Mod-/" and "Alt-A")
                        //   as these as handled by lumino command
                        // - Disable Escape handler because it prevents default and we
                        //   want to run a cell action (switch to command mode) on Esc
                        // - Disable default Enter handler because it prevents us from
                        //   accepting a completer suggestion with Enter.
                        // - Disable Ctrl-m (Shift-Alt-m on Mac) which toggles tab focus mode;
                        //   JupyterLab binds `Esc` to an equivalent behavior (switching
                        //   between command end edit mode) in notebooks, but has no equivalent
                        //   in the File Editor; instead, a `codemirror:toggle-tab-focus-mode`
                        //   command can be bound to invoke this behaviour.
                        // - Disable Mod-Alt-ArrowDown/Up that were addd in commands v6.9.0
                        //   until they get more testing in JupyterLab 4.6.0 pre-releases.
                        return ![
                            'Ctrl-m',
                            'Mod-Enter',
                            'Shift-Mod-k',
                            'Mod-/',
                            'Alt-A',
                            'Escape',
                            'Enter',
                            'Mod-Alt-ArrowUp',
                            'Mod-Alt-ArrowDown'
                        ].includes(binding.key);
                    }),
                    {
                        key: 'Tab',
                        run: StateCommands.indentMoreOrInsertTab,
                        shift: StateCommands.dedentIfNotLaunchingTooltip
                    }
                ],
                factory: () => createConfigurableExtension(value => view_dist_index_js_.keymap.of(value))
            }),
            Object.freeze({
                name: 'lineNumbers',
                default: true,
                factory: () => createConditionalExtension((0,view_dist_index_js_.lineNumbers)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Line Numbers')
                }
            }),
            Object.freeze({
                name: 'lineWrap',
                factory: () => createConditionalExtension(view_dist_index_js_.EditorView.lineWrapping),
                default: true,
                schema: {
                    type: 'boolean',
                    title: trans.__('Line Wrap')
                }
            }),
            Object.freeze({
                name: 'dropCursor',
                default: true,
                factory: () => createConditionalExtension((0,view_dist_index_js_.dropCursor)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Drop Cursor')
                }
            }),
            Object.freeze({
                name: 'matchBrackets',
                default: true,
                factory: () => createConditionalExtension([
                    (0,dist_index_js_.bracketMatching)(),
                    // closeBracketsKeymap must have higher precedence over defaultKeymap
                    state_dist_index_js_.Prec.high(view_dist_index_js_.keymap.of(dist/* closeBracketsKeymap */.GA))
                ]),
                schema: {
                    type: 'boolean',
                    title: trans.__('Match Brackets')
                }
            }),
            Object.freeze({
                name: 'rectangularSelection',
                default: true,
                factory: () => createConditionalExtension([
                    (0,view_dist_index_js_.rectangularSelection)(),
                    (0,view_dist_index_js_.crosshairCursor)()
                ]),
                schema: {
                    type: 'boolean',
                    title: trans.__('Rectangular selection'),
                    description: trans.__('Rectangular (block) selection can be created by dragging the mouse pointer while holding the left mouse button and the Alt key. When the Alt key is pressed, a crosshair cursor will appear, indicating that the rectangular selection mode is active.')
                }
            }),
            Object.freeze({
                name: 'readOnly',
                default: false,
                factory: () => createConfigurableExtension((value) => [
                    state_dist_index_js_.EditorState.readOnly.of(value),
                    value
                        ? view_dist_index_js_.EditorView.editorAttributes.of({ class: READ_ONLY_CLASS })
                        : []
                ])
            }),
            Object.freeze({
                name: 'rulers',
                default: [],
                factory: () => createConfigurableExtension((value) => value.length > 0 ? rulers(value) : []),
                schema: {
                    type: 'array',
                    title: trans.__('Rulers'),
                    items: {
                        type: 'number',
                        minimum: 0
                    }
                }
            }),
            Object.freeze({
                name: 'extendSelection',
                default: true,
                factory: () => createConditionalExtension(view_dist_index_js_.keymap.of([
                    {
                        key: 'Mod-Shift-l',
                        run: search_dist_index_js_.selectSelectionMatches,
                        preventDefault: true
                    }
                ]))
            }),
            Object.freeze({
                // Whether to activate the native CodeMirror search panel or not.
                name: 'searchWithCM',
                default: false,
                factory: () => createConditionalExtension(view_dist_index_js_.keymap.of([
                    {
                        key: 'Mod-f',
                        run: search_dist_index_js_.openSearchPanel,
                        scope: 'editor search-panel'
                    },
                    {
                        key: 'F3',
                        run: search_dist_index_js_.findNext,
                        shift: search_dist_index_js_.findPrevious,
                        scope: 'editor search-panel',
                        preventDefault: true
                    },
                    {
                        key: 'Mod-g',
                        run: search_dist_index_js_.findNext,
                        shift: search_dist_index_js_.findPrevious,
                        scope: 'editor search-panel',
                        preventDefault: true
                    },
                    {
                        key: 'Escape',
                        run: search_dist_index_js_.closeSearchPanel,
                        scope: 'editor search-panel'
                    }
                ]))
            }),
            Object.freeze({
                name: 'scrollPastEnd',
                default: false,
                factory: (options) => options.inline ? null : createConditionalExtension((0,view_dist_index_js_.scrollPastEnd)())
            }),
            Object.freeze({
                name: 'smartIndent',
                default: true,
                factory: () => createConditionalExtension((0,dist_index_js_.indentOnInput)()),
                schema: {
                    type: 'boolean',
                    title: trans.__('Smart Indentation')
                }
            }),
            /**
             * tabFocusable
             *
             * Can the user use the tab key to focus on / enter the CodeMirror editor?
             * If this is false, the CodeMirror editor can still be focused (via
             * mouse-click, for example), just not via tab key navigation.
             *
             * It can be useful to set tabFocusable to false when the editor is
             * embedded in a context that provides an alternative to the tab key for
             * navigation. For example, the Notebook widget allows the user to move
             * from one cell to another using the up and down arrow keys and to enter
             * and exit the CodeMirror editor associated with that cell by pressing
             * the enter and escape keys, respectively.
             */
            Object.freeze({
                name: 'tabFocusable',
                // The default for this needs to be true because the CodeMirror editor
                // is used in lots of different places. By default, a user should be
                // able to tab into a CodeMirror editor on the page, and by default, the
                // user should be able to get out of the editor by pressing the escape
                // key then immediately pressing the tab key (or shift+tab to go
                // backwards on the page). If there are places in the app where this
                // model of user interaction doesn't make sense or is broken, those
                // places should be remedied on a case-by-case basis, **not** by making
                // `tabFocusable` false by default.
                default: true,
                factory: () => createConditionalExtension(view_dist_index_js_.EditorView.contentAttributes.of({
                    tabIndex: '0'
                }), view_dist_index_js_.EditorView.contentAttributes.of({
                    tabIndex: '-1'
                }))
            }),
            Object.freeze({
                name: 'tabSize',
                default: 4,
                factory: () => createConfigurableExtension((value) => state_dist_index_js_.EditorState.tabSize.of(value)),
                schema: {
                    type: 'number',
                    title: trans.__('Tab size')
                }
            }),
            Object.freeze({
                name: 'tooltips',
                factory: () => 
                // we need `absolute` due to use of `contain: layout` in lumino;
                // we attach to body to ensure cursor collaboration tooltip is
                // visible in first line of the editor.
                createImmutableExtension((0,view_dist_index_js_.tooltips)({
                    position: 'absolute',
                    parent: document.body
                }))
            }),
            Object.freeze({
                name: 'allowMultipleSelections',
                default: true,
                factory: () => createConfigurableExtension((value) => state_dist_index_js_.EditorState.allowMultipleSelections.of(value)),
                schema: {
                    type: 'boolean',
                    title: trans.__('Multiple selections')
                }
            }),
            Object.freeze({
                name: 'customStyles',
                factory: () => createConfigurableExtension(config => customTheme(config)),
                default: {
                    fontFamily: null,
                    fontSize: null,
                    lineHeight: null
                },
                schema: {
                    title: trans.__('Custom editor styles'),
                    type: 'object',
                    properties: {
                        fontFamily: {
                            type: ['string', 'null'],
                            title: trans.__('Font Family')
                        },
                        fontSize: {
                            type: ['number', 'null'],
                            minimum: 1,
                            maximum: 100,
                            title: trans.__('Font Size')
                        },
                        lineHeight: {
                            type: ['number', 'null'],
                            title: trans.__('Line Height')
                        }
                    },
                    additionalProperties: false
                }
            })
        ];
        if (themes) {
            extensions.push(Object.freeze({
                name: 'theme',
                default: 'jupyter',
                factory: () => createConfigurableExtension(value => themes.getTheme(value)),
                schema: {
                    type: 'string',
                    title: trans.__('Theme'),
                    description: trans.__('CodeMirror theme')
                }
            }));
        }
        if (translator) {
            extensions.push(Object.freeze({
                name: 'translation',
                // The list of internal strings is available at https://codemirror.net/examples/translate/
                default: {
                    // @codemirror/view
                    'Control character': trans.__('Control character'),
                    // @codemirror/commands
                    'Selection deleted': trans.__('Selection deleted'),
                    // @codemirror/language
                    'Folded lines': trans.__('Folded lines'),
                    'Unfolded lines': trans.__('Unfolded lines'),
                    to: trans.__('to'),
                    'folded code': trans.__('folded code'),
                    unfold: trans.__('unfold'),
                    'Fold line': trans.__('Fold line'),
                    'Unfold line': trans.__('Unfold line'),
                    // @codemirror/search
                    'Go to line': trans.__('Go to line'),
                    go: trans.__('go'),
                    Find: trans.__('Find'),
                    Replace: trans.__('Replace'),
                    next: trans.__('next'),
                    previous: trans.__('previous'),
                    all: trans.__('all'),
                    'match case': trans.__('match case'),
                    replace: trans.__('replace'),
                    'replace all': trans.__('replace all'),
                    close: trans.__('close'),
                    'current match': trans.__('current match'),
                    'replaced $ matches': trans.__('replaced $ matches'),
                    'replaced match on line $': trans.__('replaced match on line $'),
                    'on line': trans.__('on line'),
                    // @codemirror/autocomplete
                    Completions: trans.__('Completions'),
                    // @codemirror/lint
                    Diagnostics: trans.__('Diagnostics'),
                    'No diagnostics': trans.__('No diagnostics'),
                    // @jupyterlab/debugger
                    Breakpoint: trans.__('Breakpoint'),
                    'Selected breakpoint': trans.__('Selected breakpoint')
                },
                factory: () => createConfigurableExtension(value => state_dist_index_js_.EditorState.phrases.of(value))
            }));
        }
        return extensions;
    }
    EditorExtensionRegistry.getDefaultExtensions = getDefaultExtensions;
})(EditorExtensionRegistry || (EditorExtensionRegistry = {}));
//# sourceMappingURL=extension.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: ../node_modules/@lezer/generator/dist/index.js
var generator_dist = __webpack_require__(50306);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/theme.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




const jupyterEditorTheme = view_dist_index_js_.EditorView.theme({
    /**
     * CodeMirror themes are handling the background/color in this way. This works
     * fine for CodeMirror editors outside the notebook, but the notebook styles
     * these things differently.
     */
    '&': {
        background: 'var(--jp-layout-color0)',
        color: 'var(--jp-content-font-color1)'
    },
    /* Panels and buttons used by the native CodeMirror search function
       (rarely used in JupyterLab, but still accessible)
       and by the vim extension (among others).
    */
    '.cm-panels': {
        color: 'var(--jp-ui-font-color2)',
        backgroundColor: 'var(--jp-layout-color2)'
    },
    '.cm-panels.cm-panels-bottom': {
        borderTop: '1px solid var(--jp-border-color2)'
    },
    '.cm-button': {
        background: 'var(--jp-layout-color2)',
        border: 'var(--jp-border-width) solid var(--jp-border-color1)',
        color: 'var(--jp-ui-font-color1)',
        borderRadius: 'var(--jp-border-radius)'
    },
    '.cm-button:hover': {
        background: 'var(--jp-layout-color1)'
    },
    '.cm-panel.cm-search > label': {
        color: 'var(--jp-ui-font-color1)'
    },
    '.cm-textfield': {
        backgroundColor: 'var(--jp-layout-color2)',
        color: 'var(--jp-ui-font-color1)',
        border: 'var(--jp-border-width) solid var(--jp-border-color1)'
    },
    /* In the notebook, we want this styling to be handled by its container */
    '.jp-CodeConsole &, .jp-Notebook &': {
        background: 'transparent'
    },
    '.cm-content': {
        caretColor: 'var(--jp-editor-cursor-color)'
    },
    /* Inherit font family from .cm-editor */
    '.cm-scroller': {
        fontFamily: 'inherit'
    },
    '.cm-cursor, .cm-dropCursor': {
        borderLeft: 'var(--jp-code-cursor-width0) solid var(--jp-editor-cursor-color)'
    },
    '.cm-selectionBackground, .cm-content ::selection': {
        backgroundColor: 'var(--jp-editor-selected-background)'
    },
    '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground': {
        backgroundColor: 'var(--jp-editor-selected-focused-background)'
    },
    '.cm-gutters': {
        borderRight: '1px solid var(--jp-border-color2)',
        backgroundColor: 'var(--jp-layout-color2)'
    },
    '.cm-gutter': {
        backgroundColor: 'var(--jp-layout-color2)'
    },
    '.cm-activeLine': {
        backgroundColor: 'color-mix(in srgb, var(--jp-layout-color3) 25%, transparent)'
    },
    '.cm-lineNumbers': {
        color: 'var(--jp-ui-font-color2)'
    },
    '.cm-searchMatch': {
        backgroundColor: 'var(--jp-search-unselected-match-background-color)',
        color: 'var(--jp-search-unselected-match-color)'
    },
    '.cm-searchMatch.cm-searchMatch-selected': {
        backgroundColor: 'var(--jp-search-selected-match-background-color) !important',
        color: 'var(--jp-search-selected-match-color) !important'
    },
    '.cm-tooltip': {
        backgroundColor: 'var(--jp-layout-color1)'
    }
});
// The list of available tags for syntax highlighting is available at
// https://lezer.codemirror.net/docs/ref/#highlight.tags
const jupyterHighlightStyle = dist_index_js_.HighlightStyle.define([
    // Order matters - a rule will override the previous ones; important for example for in headings styles.
    { tag: highlight_dist_index_js_.tags.meta, color: 'var(--jp-mirror-editor-meta-color)' },
    { tag: highlight_dist_index_js_.tags.heading, color: 'var(--jp-mirror-editor-header-color)' },
    {
        tag: [highlight_dist_index_js_.tags.heading1, highlight_dist_index_js_.tags.heading2, highlight_dist_index_js_.tags.heading3, highlight_dist_index_js_.tags.heading4],
        color: 'var(--jp-mirror-editor-header-color)',
        fontWeight: 'bold'
    },
    {
        tag: highlight_dist_index_js_.tags.keyword,
        color: 'var(--jp-mirror-editor-keyword-color)',
        fontWeight: 'bold'
    },
    { tag: highlight_dist_index_js_.tags.atom, color: 'var(--jp-mirror-editor-atom-color)' },
    { tag: highlight_dist_index_js_.tags.number, color: 'var(--jp-mirror-editor-number-color)' },
    {
        tag: [highlight_dist_index_js_.tags.definition(highlight_dist_index_js_.tags.name), highlight_dist_index_js_.tags.function(highlight_dist_index_js_.tags.definition(highlight_dist_index_js_.tags.variableName))],
        color: 'var(--jp-mirror-editor-def-color)'
    },
    {
        tag: highlight_dist_index_js_.tags.standard(highlight_dist_index_js_.tags.variableName),
        color: 'var(--jp-mirror-editor-builtin-color)'
    },
    {
        tag: [highlight_dist_index_js_.tags.special(highlight_dist_index_js_.tags.variableName), highlight_dist_index_js_.tags.self],
        color: 'var(--jp-mirror-editor-variable-2-color)'
    },
    { tag: highlight_dist_index_js_.tags.punctuation, color: 'var(--jp-mirror-editor-punctuation-color)' },
    { tag: highlight_dist_index_js_.tags.propertyName, color: 'var(--jp-mirror-editor-property-color)' },
    {
        tag: highlight_dist_index_js_.tags.operator,
        color: 'var(--jp-mirror-editor-operator-color)',
        fontWeight: 'bold'
    },
    {
        tag: highlight_dist_index_js_.tags.comment,
        color: 'var(--jp-mirror-editor-comment-color)',
        fontStyle: 'italic'
    },
    { tag: highlight_dist_index_js_.tags.string, color: 'var(--jp-mirror-editor-string-color)' },
    {
        tag: [highlight_dist_index_js_.tags.labelName, highlight_dist_index_js_.tags.monospace, highlight_dist_index_js_.tags.special(highlight_dist_index_js_.tags.string)],
        color: 'var(--jp-mirror-editor-string-2-color)'
    },
    { tag: highlight_dist_index_js_.tags.bracket, color: 'var(--jp-mirror-editor-bracket-color)' },
    { tag: highlight_dist_index_js_.tags.tagName, color: 'var(--jp-mirror-editor-tag-color)' },
    { tag: highlight_dist_index_js_.tags.attributeName, color: 'var(--jp-mirror-editor-attribute-color)' },
    { tag: highlight_dist_index_js_.tags.quote, color: 'var(--jp-mirror-editor-quote-color)' },
    {
        tag: highlight_dist_index_js_.tags.link,
        color: 'var(--jp-mirror-editor-link-color)',
        textDecoration: 'underline'
    },
    { tag: [highlight_dist_index_js_.tags.separator, highlight_dist_index_js_.tags.derefOperator, highlight_dist_index_js_.tags.paren], color: '' },
    { tag: highlight_dist_index_js_.tags.strong, fontWeight: 'bold' },
    { tag: highlight_dist_index_js_.tags.emphasis, fontStyle: 'italic' },
    { tag: highlight_dist_index_js_.tags.strikethrough, textDecoration: 'line-through' },
    {
        tag: highlight_dist_index_js_.tags.bool,
        color: 'var(--jp-mirror-editor-keyword-color)',
        fontWeight: 'bold'
    }
]);
/**
 * JupyterLab CodeMirror 6 theme
 */
const jupyterTheme = [
    jupyterEditorTheme,
    (0,dist_index_js_.syntaxHighlighting)(jupyterHighlightStyle)
];
/**
 * CodeMirror 6 theme registry
 */
class EditorThemeRegistry {
    constructor() {
        /**
         * CodeMirror 6 themes
         */
        this._themeMap = new Map([
            ['jupyter', Object.freeze({ name: 'jupyter', theme: jupyterTheme })]
        ]);
    }
    /**
     * Get all themes
     */
    get themes() {
        return Array.from(this._themeMap.values());
    }
    /**
     * Get the default CodeMirror 6 theme for JupyterLab
     *
     * @returns Default theme
     */
    defaultTheme() {
        return this._themeMap.get('jupyter').theme;
    }
    /**
     * Register a new theme.
     *
     * @param theme Codemirror 6 theme
     */
    addTheme(theme) {
        if (this._themeMap.has(theme.name)) {
            throw new Error(`A theme named '${theme.name}' is already registered.`);
        }
        this._themeMap.set(theme.name, { displayName: theme.name, ...theme });
    }
    /**
     * Get a theme.
     *
     * #### Notes
     * It falls back to the default theme
     *
     * @param name Theme name
     * @returns Theme extension
     */
    getTheme(name) {
        var _a;
        const ext = (_a = this._themeMap.get(name)) === null || _a === void 0 ? void 0 : _a.theme;
        return ext !== null && ext !== void 0 ? ext : this.defaultTheme();
    }
}
/**
 * EditorThemeRegistry namespace
 */
(function (EditorThemeRegistry) {
    /**
     * Get the default editor themes.
     *
     * @param translator Application translator
     * @returns Default CodeMirror 6 themes
     */
    function getDefaultThemes(translator) {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return [
            Object.freeze({
                name: 'codemirror',
                displayName: trans.__('codemirror'),
                theme: [
                    view_dist_index_js_.EditorView.baseTheme({}),
                    (0,dist_index_js_.syntaxHighlighting)(dist_index_js_.defaultHighlightStyle)
                ]
            })
        ];
    }
    EditorThemeRegistry.getDefaultThemes = getDefaultThemes;
})(EditorThemeRegistry || (EditorThemeRegistry = {}));
//# sourceMappingURL=theme.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/pythonBuiltin.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




class PythonBuiltin {
    constructor(view, langPython) {
        this.langPython = langPython;
        this.tree = (0,dist_index_js_.syntaxTree)(view.state);
        this.mark = view_dist_index_js_.Decoration.mark({ class: 'cm-builtin' });
        this.decorations = this.buildDeco(view);
        this.decoratedTo = view.viewport.to;
    }
    update(update) {
        let tree = (0,dist_index_js_.syntaxTree)(update.state);
        let { viewport } = update.view, decoratedToMapped = update.changes.mapPos(this.decoratedTo, 1);
        if (tree.length < viewport.to &&
            tree.type == this.tree.type &&
            decoratedToMapped >= viewport.to) {
            this.decorations = this.decorations.map(update.changes);
            this.decoratedTo = decoratedToMapped;
        }
        else if (tree != this.tree || update.viewportChanged) {
            this.tree = tree;
            this.decorations = this.buildDeco(update.view);
            this.decoratedTo = viewport.to;
        }
    }
    buildDeco(view) {
        if (!this.tree.length)
            return view_dist_index_js_.Decoration.none;
        let builder = new state_dist_index_js_.RangeSetBuilder();
        const enter = (node) => {
            var _a;
            const cursor = node.node.cursor();
            // Handle nested language, e.g. Markdown
            const mounted = cursor.tree && cursor.tree.prop(common_dist_index_js_.NodeProp.mounted);
            if (mounted && mounted.overlay) {
                (_a = node.node
                    .enter(mounted.overlay[0].from + node.from, 1)) === null || _a === void 0 ? void 0 : _a.cursor().iterate(enter);
            }
            if (this.langPython.isActiveAt(view.state, node.from + 1) &&
                node.name === 'VariableName') {
                const variableName = view.state.sliceDoc(node.from, node.to);
                if (builtins.includes(variableName)) {
                    builder.add(node.from, node.to, this.mark);
                }
            }
        };
        for (let { from, to } of view.visibleRanges) {
            this.tree.iterate({ enter, from, to });
        }
        return builder.finish();
    }
}
function pythonBuiltin(langPython) {
    return view_dist_index_js_.ViewPlugin.define(view => new PythonBuiltin(view, langPython), {
        decorations: v => v.decorations
    });
}
const builtins = [
    'abs',
    'aiter',
    'all',
    'any',
    'anext',
    'ascii',
    'bin',
    'bool',
    'breakpoint',
    'bytearray',
    'bytes',
    'callable',
    'chr',
    'classmethod',
    'compile',
    'complex',
    'delattr',
    'dict',
    'dir',
    'divmod',
    'enumerate',
    'eval',
    'exec',
    'filter',
    'float',
    'format',
    'frozenset',
    'getattr',
    'globals',
    'hasattr',
    'hash',
    'help',
    'hex',
    'id',
    'input',
    'int',
    'isinstance',
    'issubclass',
    'iter',
    'len',
    'list',
    'locals',
    'map',
    'max',
    'memoryview',
    'min',
    'next',
    'object',
    'oct',
    'open',
    'ord',
    'pow',
    'print',
    'property',
    'range',
    'repr',
    'reversed',
    'round',
    'set',
    'setattr',
    'slice',
    'sorted',
    'staticmethod',
    'str',
    'sum',
    'super',
    'tuple',
    'type',
    'vars',
    'zip',
    '__import__'
];
//# sourceMappingURL=pythonBuiltin.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/language.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * CodeMirror language registry
 */
class EditorLanguageRegistry {
    constructor() {
        this._modeList = [];
        // Add default language text/plain -> No expressions to parse
        this.addLanguage({
            name: 'none',
            mime: 'text/plain',
            support: new dist_index_js_.LanguageSupport(
            // Create a dummy parser that as no expression to parse
            dist_index_js_.LRLanguage.define({ parser: (0,generator_dist/* buildParser */.pV)('@top Program { }') }))
        });
    }
    /**
     * Register a new language for CodeMirror
     *
     * @param language Language to register
     */
    addLanguage(language) {
        var _a;
        const info = (_a = this.findByName(language.name)) !== null && _a !== void 0 ? _a : this.findByMIME(language.mime, true);
        if (info) {
            throw new Error(`${language.mime} already registered`);
        }
        this._modeList.push(this.makeSpec(language));
    }
    /**
     * Ensure a codemirror mode is available by name or Codemirror spec.
     *
     * @param language - The mode to ensure.  If it is a string, uses [findBest]
     *   to get the appropriate spec.
     *
     * @returns A promise that resolves when the mode is available.
     */
    async getLanguage(language) {
        const spec = this.findBest(language);
        if (spec && !spec.support) {
            spec.support = await spec.load();
        }
        return spec;
    }
    /**
     * Get the raw list of available modes specs.
     *
     * @returns The available modes
     */
    getLanguages() {
        return [...this._modeList];
    }
    /**
     * Find a codemirror mode by MIME.
     *
     * @param mime Mime type to look for
     * @param strict Whether xml and json should be assimilated to the generic mimetype
     * @returns The mode or null
     */
    findByMIME(mime, strict = false) {
        if (Array.isArray(mime)) {
            for (let i = 0; i < mime.length; i++) {
                const spec = this.findByMIME(mime[i]);
                if (spec)
                    return spec;
            }
            return null;
        }
        mime = mime.toLowerCase();
        for (let i = 0; i < this._modeList.length; i++) {
            let info = this._modeList[i];
            if (Array.isArray(info.mime)) {
                for (let j = 0; j < info.mime.length; j++) {
                    if (info.mime[j] == mime) {
                        return info;
                    }
                }
            }
            else if (info.mime == mime) {
                return info;
            }
        }
        if (!strict) {
            if (/\+xml$/.test(mime))
                return this.findByMIME('application/xml');
            if (/\+json$/.test(mime))
                return this.findByMIME('application/json');
        }
        return null;
    }
    /**
     * Find a codemirror mode by name.
     *
     * @param name The mode name
     * @returns The mode or null
     */
    findByName(name) {
        name = name.toLowerCase();
        for (let i = 0; i < this._modeList.length; i++) {
            let info = this._modeList[i];
            if (info.name.toLowerCase() == name)
                return info;
            if (info.alias) {
                for (let j = 0; j < info.alias.length; j++) {
                    if (info.alias[j].toLowerCase() == name) {
                        return info;
                    }
                }
            }
        }
        return null;
    }
    /**
     * Find a codemirror mode by extension.
     *
     * @param ext The extension name
     * @returns The mode or null
     */
    findByExtension(ext) {
        if (Array.isArray(ext)) {
            for (let i = 0; i < ext.length; i++) {
                const spec = this.findByExtension(ext[i]);
                if (spec)
                    return spec;
            }
            return null;
        }
        ext = ext.toLowerCase();
        for (let i = 0; i < this._modeList.length; i++) {
            let info = this._modeList[i];
            for (let j = 0; j < info.extensions.length; j++) {
                if (info.extensions[j].toLowerCase() == ext) {
                    return info;
                }
            }
        }
        return null;
    }
    /**
     * Find a codemirror mode by filename.
     *
     * @param name File name
     * @returns The mode or null
     */
    findByFileName(name) {
        const basename = coreutils_lib_index_js_.PathExt.basename(name);
        for (let i = 0; i < this._modeList.length; i++) {
            let info = this._modeList[i];
            if (info.filename && info.filename.test(basename)) {
                return info;
            }
        }
        let dot = basename.lastIndexOf('.');
        let ext = dot > -1 && basename.substring(dot + 1, basename.length);
        if (ext) {
            return this.findByExtension(ext);
        }
        return null;
    }
    /**
     * Find a codemirror mode by name or CodeMirror spec.
     *
     * @param language The CodeMirror mode
     * @param fallback Whether to fallback to default mimetype spec or not
     * @returns The mode or null
     */
    findBest(language, fallback = true) {
        var _a, _b, _c, _d;
        const modename = typeof language === 'string' ? language : language.name;
        const mimetype = typeof language !== 'string' ? language.mime : modename;
        const ext = typeof language !== 'string' ? (_a = language.extensions) !== null && _a !== void 0 ? _a : [] : [];
        return ((_d = (_c = (_b = (modename ? this.findByName(modename) : null)) !== null && _b !== void 0 ? _b : (mimetype ? this.findByMIME(mimetype) : null)) !== null && _c !== void 0 ? _c : this.findByExtension(ext)) !== null && _d !== void 0 ? _d : (fallback
            ? this.findByMIME(lib_index_js_.IEditorMimeTypeService.defaultMimeType)
            : null));
    }
    /**
     * Parse and style a string.
     *
     * @param code Code to highlight
     * @param language Code language
     * @param el HTML element into which the highlighted code will be inserted
     */
    async highlight(code, language, el) {
        var _a;
        if (language) {
            await this.getLanguage(language);
        }
        const language_ = (_a = language === null || language === void 0 ? void 0 : language.support) === null || _a === void 0 ? void 0 : _a.language;
        if (!language_) {
            el.appendChild(document.createTextNode(code));
            return;
        }
        const tree = language_.parser.parse(code);
        // position state required because unstyled tokens are not emitted
        // in highlightTree
        let pos = 0;
        (0,highlight_dist_index_js_.highlightTree)(tree, jupyterHighlightStyle, (from, to, classes) => {
            if (from > pos) {
                // No style applied to the token between pos and from
                el.appendChild(document.createTextNode(code.slice(pos, from)));
            }
            const sp = el.appendChild(document.createElement('span'));
            sp.className = classes;
            sp.appendChild(document.createTextNode(code.slice(from, to)));
            pos = to;
        });
        if (pos === 0 && code.length > 0) {
            // No tokens were emitted (e.g., single unrecognized character like 'x')
            // Render the entire code as plain text fallback
            el.appendChild(document.createTextNode(code));
        }
        else if (pos < code.length) {
            // Handle any remaining unstyled content
            el.appendChild(document.createTextNode(code.slice(pos, code.length)));
        }
    }
    // Code mirror uses two similar structures, a plain object with optional fields,
    // and a class with the same fields but all mandatory. Maybe adopting the same
    // pattern would be less confusing (although far more verbose)
    makeSpec(spec) {
        let res = dist_index_js_.LanguageDescription.of(spec);
        // CodeMirror does not store/use mime type of a language
        res.mime = spec.mime;
        res.displayName = spec.displayName;
        return res;
    }
}
/**
 * EditorLanguageRegistry namespace
 */
(function (EditorLanguageRegistry) {
    /**
     * Convert an CodeMirror 5 language parser to CodeMirror 6
     *
     * @param parser Legacy parser
     * @returns Language object
     */
    function legacy(parser) {
        return new dist_index_js_.LanguageSupport(dist_index_js_.StreamLanguage.define(parser));
    }
    EditorLanguageRegistry.legacy = legacy;
    /**
     * Create a dialect of SQL
     *
     * @param dialectName SQL dialect
     * @returns Language object
     */
    async function sql(dialectName) {
        const m = await __webpack_require__.e(/* import() */ 5828).then(__webpack_require__.bind(__webpack_require__, 25828));
        return m.sql({ dialect: m[dialectName] });
    }
    /**
     * Get the default editor languages
     *
     * @param translator Application translator
     * @returns Default CodeMirror 6 languages
     */
    function getDefaultLanguages(translator) {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return [
            {
                name: 'C',
                displayName: trans.__('C'),
                mime: 'text/x-csrc',
                extensions: ['c', 'h', 'ino'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7674).then(__webpack_require__.bind(__webpack_require__, 87674));
                    return m.cpp();
                }
            },
            {
                name: 'C++',
                displayName: trans.__('C++'),
                mime: 'text/x-c++src',
                extensions: ['cpp', 'c++', 'cc', 'cxx', 'hpp', 'h++', 'hh', 'hxx'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7674).then(__webpack_require__.bind(__webpack_require__, 87674));
                    return m.cpp();
                }
            },
            {
                name: 'CQL',
                displayName: trans.__('CQL'),
                mime: 'text/x-cassandra',
                extensions: ['cql'],
                load() {
                    return sql('Cassandra');
                }
            },
            {
                name: 'CSS',
                displayName: trans.__('CSS'),
                mime: 'text/css',
                extensions: ['css'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9239).then(__webpack_require__.bind(__webpack_require__, 59239));
                    return m.css();
                }
            },
            {
                name: 'HTML',
                displayName: trans.__('HTML'),
                alias: ['xhtml'],
                mime: 'text/html',
                extensions: ['html', 'htm', 'handlebars', 'hbs'],
                async load() {
                    const m = await Promise.all(/* import() */[__webpack_require__.e(5850), __webpack_require__.e(9239), __webpack_require__.e(7866)]).then(__webpack_require__.bind(__webpack_require__, 77866));
                    return m.html();
                }
            },
            {
                name: 'Java',
                displayName: trans.__('Java'),
                mime: 'text/x-java',
                extensions: ['java'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1053).then(__webpack_require__.bind(__webpack_require__, 41053));
                    return m.java();
                }
            },
            {
                name: 'Javascript',
                displayName: trans.__('Javascript'),
                alias: ['ecmascript', 'js', 'node'],
                mime: [
                    'text/javascript',
                    'text/ecmascript',
                    'application/javascript',
                    'application/x-javascript',
                    'application/ecmascript'
                ],
                extensions: ['js', 'mjs', 'cjs'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5850).then(__webpack_require__.bind(__webpack_require__, 65850));
                    return m.javascript();
                }
            },
            {
                name: 'JSON',
                displayName: trans.__('JSON'),
                alias: ['json5'],
                mime: ['application/json', 'application/x-json'],
                extensions: ['json', 'map'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4670).then(__webpack_require__.bind(__webpack_require__, 44670));
                    return m.json();
                }
            },
            {
                name: 'JSX',
                displayName: trans.__('JSX'),
                mime: 'text/jsx',
                extensions: ['jsx'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5850).then(__webpack_require__.bind(__webpack_require__, 65850));
                    return m.javascript({ jsx: true });
                }
            },
            {
                name: 'MariaDB SQL',
                displayName: trans.__('MariaDB SQL'),
                mime: 'text/x-mariadb',
                load() {
                    return sql('MariaSQL');
                }
            },
            {
                name: 'Markdown',
                displayName: trans.__('Markdown'),
                mime: 'text/x-markdown',
                extensions: ['md', 'markdown', 'mkd'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4360).then(__webpack_require__.t.bind(__webpack_require__, 4360, 23));
                    return m.markdown({ codeLanguages: this._modeList });
                }
            },
            {
                name: 'MS SQL',
                displayName: trans.__('MS SQL'),
                mime: 'text/x-mssql',
                load() {
                    return sql('MSSQL');
                }
            },
            {
                name: 'MySQL',
                displayName: trans.__('MySQL'),
                mime: 'text/x-mysql',
                load() {
                    return sql('MySQL');
                }
            },
            {
                name: 'PHP',
                displayName: trans.__('PHP'),
                mime: [
                    'text/x-php',
                    'application/x-httpd-php',
                    'application/x-httpd-php-open'
                ],
                extensions: ['php', 'php3', 'php4', 'php5', 'php7', 'phtml'],
                async load() {
                    const m = await Promise.all(/* import() */[__webpack_require__.e(5850), __webpack_require__.e(9239), __webpack_require__.e(7866), __webpack_require__.e(8010)]).then(__webpack_require__.bind(__webpack_require__, 78010));
                    return m.php();
                }
            },
            {
                name: 'PLSQL',
                displayName: trans.__('PLSQL'),
                mime: 'text/x-plsql',
                extensions: ['pls'],
                load() {
                    return sql('PLSQL');
                }
            },
            {
                name: 'PostgreSQL',
                displayName: trans.__('PostgreSQL'),
                mime: 'text/x-pgsql',
                load() {
                    return sql('PostgreSQL');
                }
            },
            {
                name: 'Python',
                displayName: trans.__('Python'),
                mime: 'text/x-python',
                extensions: ['BUILD', 'bzl', 'py', 'pyw'],
                filename: /^(BUCK|BUILD)$/,
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 2552).then(__webpack_require__.bind(__webpack_require__, 12552));
                    return new dist_index_js_.LanguageSupport(m.pythonLanguage, pythonBuiltin(m.pythonLanguage));
                }
            },
            {
                name: 'ipython',
                displayName: trans.__('ipython'),
                mime: 'text/x-ipython',
                async load() {
                    // FIXME Restore '?' operator - using the default python LanguageSupport allows
                    // to activate feature such as code folding.
                    // return Promise.resolve(legacy(mkPython({ singleOperators: /\?/ })));
                    const m = await __webpack_require__.e(/* import() */ 2552).then(__webpack_require__.bind(__webpack_require__, 12552));
                    return new dist_index_js_.LanguageSupport(m.pythonLanguage, pythonBuiltin(m.pythonLanguage));
                }
            },
            {
                name: 'Rust',
                displayName: trans.__('Rust'),
                mime: 'text/x-rustsrc',
                extensions: ['rs'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 6972).then(__webpack_require__.bind(__webpack_require__, 58879));
                    return m.rust();
                }
            },
            {
                name: 'SQL',
                displayName: trans.__('SQL'),
                mime: ['application/sql', 'text/x-sql'],
                extensions: ['sql'],
                load() {
                    return sql('StandardSQL');
                }
            },
            {
                name: 'SQLite',
                displayName: trans.__('SQLite'),
                mime: 'text/x-sqlite',
                load() {
                    return sql('SQLite');
                }
            },
            {
                name: 'TSX',
                displayName: trans.__('TSX'),
                alias: ['TypeScript-JSX'],
                mime: 'text/typescript-jsx',
                extensions: ['tsx'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5850).then(__webpack_require__.bind(__webpack_require__, 65850));
                    return m.javascript({ jsx: true, typescript: true });
                }
            },
            {
                name: 'TypeScript',
                displayName: trans.__('TypeScript'),
                alias: ['ts'],
                mime: 'application/typescript',
                extensions: ['ts'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5850).then(__webpack_require__.bind(__webpack_require__, 65850));
                    return m.javascript({ typescript: true });
                }
            },
            {
                name: 'WebAssembly',
                displayName: trans.__('WebAssembly'),
                mime: 'text/webassembly',
                extensions: ['wat', 'wast'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4810).then(__webpack_require__.bind(__webpack_require__, 14810));
                    return m.wast();
                }
            },
            {
                name: 'XML',
                displayName: trans.__('XML'),
                alias: ['rss', 'wsdl', 'xsd'],
                mime: ['application/xml', 'text/xml'],
                extensions: ['xml', 'xsl', 'xsd', 'svg'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4588).then(__webpack_require__.bind(__webpack_require__, 64588));
                    return m.xml();
                }
            },
            // Legacy modes ported from CodeMirror 5
            {
                name: 'APL',
                displayName: trans.__('APL'),
                mime: 'text/apl',
                extensions: ['dyalog', 'apl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 563).then(__webpack_require__.bind(__webpack_require__, 10563));
                    return legacy(m.apl);
                }
            },
            {
                name: 'PGP',
                displayName: trans.__('PGP'),
                alias: ['asciiarmor'],
                mime: [
                    'application/pgp',
                    'application/pgp-encrypted',
                    'application/pgp-keys',
                    'application/pgp-signature'
                ],
                extensions: ['asc', 'pgp', 'sig'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8983).then(__webpack_require__.bind(__webpack_require__, 98983));
                    return legacy(m.asciiArmor);
                }
            },
            {
                name: 'ASN.1',
                displayName: trans.__('ASN.1'),
                mime: 'text/x-ttcn-asn',
                extensions: ['asn', 'asn1'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7534).then(__webpack_require__.bind(__webpack_require__, 97534));
                    return legacy(m.asn1({}));
                }
            },
            {
                name: 'Asterisk',
                displayName: trans.__('Asterisk'),
                mime: 'text/x-asterisk',
                filename: /^extensions\.conf$/i,
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 403).then(__webpack_require__.bind(__webpack_require__, 70403));
                    return legacy(m.asterisk);
                }
            },
            {
                name: 'Brainfuck',
                displayName: trans.__('Brainfuck'),
                mime: 'text/x-brainfuck',
                extensions: ['b', 'bf'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 2702).then(__webpack_require__.bind(__webpack_require__, 12702));
                    return legacy(m.brainfuck);
                }
            },
            {
                name: 'Cobol',
                displayName: trans.__('Cobol'),
                mime: 'text/x-cobol',
                extensions: ['cob', 'cpy'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8979).then(__webpack_require__.bind(__webpack_require__, 38979));
                    return legacy(m.cobol);
                }
            },
            {
                name: 'C#',
                displayName: trans.__('C#'),
                alias: ['csharp', 'cs'],
                mime: 'text/x-csharp',
                extensions: ['cs'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9425).then(__webpack_require__.bind(__webpack_require__, 49425));
                    return legacy(m.csharp);
                }
            },
            {
                name: 'Clojure',
                displayName: trans.__('Clojure'),
                mime: 'text/x-clojure',
                extensions: ['clj', 'cljc', 'cljx'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4002).then(__webpack_require__.bind(__webpack_require__, 54002));
                    return legacy(m.clojure);
                }
            },
            {
                name: 'ClojureScript',
                displayName: trans.__('ClojureScript'),
                mime: 'text/x-clojurescript',
                extensions: ['cljs'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4002).then(__webpack_require__.bind(__webpack_require__, 54002));
                    return legacy(m.clojure);
                }
            },
            {
                name: 'Closure Stylesheets (GSS)',
                displayName: trans.__('Closure Stylesheets (GSS)'),
                mime: 'text/x-gss',
                extensions: ['gss'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5019).then(__webpack_require__.bind(__webpack_require__, 85019));
                    return legacy(m.gss);
                }
            },
            {
                name: 'CMake',
                displayName: trans.__('CMake'),
                mime: 'text/x-cmake',
                extensions: ['cmake', 'cmake.in'],
                filename: /^CMakeLists\.txt$/,
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1941).then(__webpack_require__.bind(__webpack_require__, 41941));
                    return legacy(m.cmake);
                }
            },
            {
                name: 'CoffeeScript',
                displayName: trans.__('CoffeeScript'),
                alias: ['coffee', 'coffee-script'],
                mime: [
                    'application/vnd.coffeescript',
                    'text/coffeescript',
                    'text/x-coffeescript'
                ],
                extensions: ['coffee'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3449).then(__webpack_require__.bind(__webpack_require__, 83449));
                    return legacy(m.coffeeScript);
                }
            },
            {
                name: 'Common Lisp',
                displayName: trans.__('Common Lisp'),
                alias: ['lisp'],
                mime: 'text/x-common-lisp',
                extensions: ['cl', 'lisp', 'el'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3370).then(__webpack_require__.bind(__webpack_require__, 43370));
                    return legacy(m.commonLisp);
                }
            },
            {
                name: 'Cypher',
                displayName: trans.__('Cypher'),
                mime: 'application/x-cypher-query',
                extensions: ['cyp', 'cypher'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4387).then(__webpack_require__.bind(__webpack_require__, 24387));
                    return legacy(m.cypher);
                }
            },
            {
                name: 'Cython',
                displayName: trans.__('Cython'),
                mime: 'text/x-cython',
                extensions: ['pyx', 'pxd', 'pxi'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 2871).then(__webpack_require__.bind(__webpack_require__, 72871));
                    return legacy(m.cython);
                }
            },
            {
                name: 'Crystal',
                displayName: trans.__('Crystal'),
                mime: 'text/x-crystal',
                extensions: ['cr'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3420).then(__webpack_require__.bind(__webpack_require__, 13420));
                    return legacy(m.crystal);
                }
            },
            {
                name: 'D',
                displayName: trans.__('D'),
                mime: 'text/x-d',
                extensions: ['d'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3501).then(__webpack_require__.bind(__webpack_require__, 73501));
                    return legacy(m.d);
                }
            },
            {
                name: 'Dart',
                displayName: trans.__('Dart'),
                mime: ['application/dart', 'text/x-dart'],
                extensions: ['dart'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9425).then(__webpack_require__.bind(__webpack_require__, 49425));
                    return legacy(m.dart);
                }
            },
            {
                name: 'diff',
                displayName: trans.__('diff'),
                mime: 'text/x-diff',
                extensions: ['diff', 'patch'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9116).then(__webpack_require__.bind(__webpack_require__, 39116));
                    return legacy(m.diff);
                }
            },
            {
                name: 'Dockerfile',
                displayName: trans.__('Dockerfile'),
                mime: 'text/x-dockerfile',
                filename: /^Dockerfile$/,
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 2343).then(__webpack_require__.bind(__webpack_require__, 58761));
                    return legacy(m.dockerFile);
                }
            },
            {
                name: 'DTD',
                displayName: trans.__('DTD'),
                mime: 'application/xml-dtd',
                extensions: ['dtd'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 221).then(__webpack_require__.bind(__webpack_require__, 30221));
                    return legacy(m.dtd);
                }
            },
            {
                name: 'Dylan',
                displayName: trans.__('Dylan'),
                mime: 'text/x-dylan',
                extensions: ['dylan', 'dyl', 'intr'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9331).then(__webpack_require__.bind(__webpack_require__, 69331));
                    return legacy(m.dylan);
                }
            },
            {
                name: 'EBNF',
                displayName: trans.__('EBNF'),
                mime: 'text/x-ebnf',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 647).then(__webpack_require__.bind(__webpack_require__, 90647));
                    return legacy(m.ebnf);
                }
            },
            {
                name: 'ECL',
                displayName: trans.__('ECL'),
                mime: 'text/x-ecl',
                extensions: ['ecl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5061).then(__webpack_require__.bind(__webpack_require__, 75061));
                    return legacy(m.ecl);
                }
            },
            {
                name: 'edn',
                displayName: trans.__('edn'),
                mime: 'application/edn',
                extensions: ['edn'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4002).then(__webpack_require__.bind(__webpack_require__, 54002));
                    return legacy(m.clojure);
                }
            },
            {
                name: 'Eiffel',
                displayName: trans.__('Eiffel'),
                mime: 'text/x-eiffel',
                extensions: ['e'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7264).then(__webpack_require__.bind(__webpack_require__, 57264));
                    return legacy(m.eiffel);
                }
            },
            {
                name: 'Elm',
                displayName: trans.__('Elm'),
                mime: 'text/x-elm',
                extensions: ['elm'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1558).then(__webpack_require__.bind(__webpack_require__, 21558));
                    return legacy(m.elm);
                }
            },
            {
                name: 'Erlang',
                displayName: trans.__('Erlang'),
                mime: 'text/x-erlang',
                extensions: ['erl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 883).then(__webpack_require__.bind(__webpack_require__, 20883));
                    return legacy(m.erlang);
                }
            },
            {
                name: 'Esper',
                displayName: trans.__('Esper'),
                mime: 'text/x-esper',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8479).then(__webpack_require__.bind(__webpack_require__, 48479));
                    return legacy(m.esper);
                }
            },
            {
                name: 'Factor',
                displayName: trans.__('Factor'),
                mime: 'text/x-factor',
                extensions: ['factor'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9037).then(__webpack_require__.bind(__webpack_require__, 59037));
                    return legacy(m.factor);
                }
            },
            {
                name: 'FCL',
                displayName: trans.__('FCL'),
                mime: 'text/x-fcl',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4521).then(__webpack_require__.bind(__webpack_require__, 74521));
                    return legacy(m.fcl);
                }
            },
            {
                name: 'Forth',
                displayName: trans.__('Forth'),
                mime: 'text/x-forth',
                extensions: ['forth', 'fth', '4th'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7817).then(__webpack_require__.bind(__webpack_require__, 77817));
                    return legacy(m.forth);
                }
            },
            {
                name: 'Fortran',
                displayName: trans.__('Fortran'),
                mime: 'text/x-fortran',
                extensions: ['f', 'for', 'f77', 'f90', 'f95'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3562).then(__webpack_require__.bind(__webpack_require__, 33562));
                    return legacy(m.fortran);
                }
            },
            {
                name: 'F#',
                displayName: trans.__('F#'),
                alias: ['fsharp'],
                mime: 'text/x-fsharp',
                extensions: ['fs'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7022).then(__webpack_require__.bind(__webpack_require__, 47022));
                    return legacy(m.fSharp);
                }
            },
            {
                name: 'Gas',
                displayName: trans.__('Gas'),
                mime: 'text/x-gas',
                extensions: ['s'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5972).then(__webpack_require__.bind(__webpack_require__, 15972));
                    return legacy(m.gas);
                }
            },
            {
                name: 'Gherkin',
                displayName: trans.__('Gherkin'),
                mime: 'text/x-feature',
                extensions: ['feature'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 906).then(__webpack_require__.bind(__webpack_require__, 10906));
                    return legacy(m.gherkin);
                }
            },
            {
                name: 'Go',
                displayName: trans.__('Go'),
                mime: 'text/x-go',
                extensions: ['go'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9022).then(__webpack_require__.bind(__webpack_require__, 89022));
                    return legacy(m.go);
                }
            },
            {
                name: 'Groovy',
                displayName: trans.__('Groovy'),
                mime: 'text/x-groovy',
                extensions: ['groovy', 'gradle'],
                filename: /^Jenkinsfile$/,
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7360).then(__webpack_require__.bind(__webpack_require__, 7360));
                    return legacy(m.groovy);
                }
            },
            {
                name: 'Haskell',
                displayName: trans.__('Haskell'),
                mime: 'text/x-haskell',
                extensions: ['hs'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3111).then(__webpack_require__.bind(__webpack_require__, 63111));
                    return legacy(m.haskell);
                }
            },
            {
                name: 'Haxe',
                displayName: trans.__('Haxe'),
                mime: 'text/x-haxe',
                extensions: ['hx'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4039).then(__webpack_require__.bind(__webpack_require__, 84039));
                    return legacy(m.haxe);
                }
            },
            {
                name: 'HXML',
                displayName: trans.__('HXML'),
                mime: 'text/x-hxml',
                extensions: ['hxml'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4039).then(__webpack_require__.bind(__webpack_require__, 84039));
                    return legacy(m.hxml);
                }
            },
            {
                name: 'HTTP',
                displayName: trans.__('HTTP'),
                mime: 'message/http',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9060).then(__webpack_require__.bind(__webpack_require__, 19060));
                    return legacy(m.http);
                }
            },
            {
                name: 'IDL',
                displayName: trans.__('IDL'),
                mime: 'text/x-idl',
                extensions: ['pro'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9250).then(__webpack_require__.bind(__webpack_require__, 89250));
                    return legacy(m.idl);
                }
            },
            {
                name: 'JSON-LD',
                displayName: trans.__('JSON-LD'),
                alias: ['jsonld'],
                mime: 'application/ld+json',
                extensions: ['jsonld'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 661).then(__webpack_require__.bind(__webpack_require__, 70661));
                    return legacy(m.jsonld);
                }
            },
            {
                name: 'Jinja2',
                displayName: trans.__('Jinja2'),
                mime: 'text/jinja2',
                extensions: ['j2', 'jinja', 'jinja2'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9558).then(__webpack_require__.bind(__webpack_require__, 79558));
                    return legacy(m.jinja2);
                }
            },
            {
                name: 'Julia',
                displayName: trans.__('Julia'),
                mime: 'text/x-julia',
                extensions: ['jl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1837).then(__webpack_require__.bind(__webpack_require__, 81837));
                    return legacy(m.julia);
                }
            },
            {
                name: 'Kotlin',
                displayName: trans.__('Kotlin'),
                mime: 'text/x-kotlin',
                extensions: ['kt'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9425).then(__webpack_require__.bind(__webpack_require__, 49425));
                    return legacy(m.kotlin);
                }
            },
            {
                name: 'LESS',
                displayName: trans.__('LESS'),
                mime: 'text/x-less',
                extensions: ['less'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5019).then(__webpack_require__.bind(__webpack_require__, 85019));
                    return legacy(m.less);
                }
            },
            {
                name: 'LiveScript',
                displayName: trans.__('LiveScript'),
                alias: ['ls'],
                mime: 'text/x-livescript',
                extensions: ['ls'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3211).then(__webpack_require__.bind(__webpack_require__, 3211));
                    return legacy(m.liveScript);
                }
            },
            {
                name: 'Lua',
                displayName: trans.__('Lua'),
                mime: 'text/x-lua',
                extensions: ['lua'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5494).then(__webpack_require__.bind(__webpack_require__, 25494));
                    return legacy(m.lua);
                }
            },
            {
                name: 'mIRC',
                displayName: trans.__('mIRC'),
                mime: 'text/mirc',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8937).then(__webpack_require__.bind(__webpack_require__, 58937));
                    return legacy(m.mirc);
                }
            },
            {
                name: 'Mathematica',
                displayName: trans.__('Mathematica'),
                mime: 'text/x-mathematica',
                extensions: ['m', 'nb', 'wl', 'wls'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1418).then(__webpack_require__.bind(__webpack_require__, 1418));
                    return legacy(m.mathematica);
                }
            },
            {
                name: 'Modelica',
                displayName: trans.__('Modelica'),
                mime: 'text/x-modelica',
                extensions: ['mo'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 6788).then(__webpack_require__.bind(__webpack_require__, 26788));
                    return legacy(m.modelica);
                }
            },
            {
                name: 'MUMPS',
                displayName: trans.__('MUMPS'),
                mime: 'text/x-mumps',
                extensions: ['mps'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 6139).then(__webpack_require__.bind(__webpack_require__, 66139));
                    return legacy(m.mumps);
                }
            },
            {
                name: 'mbox',
                displayName: trans.__('mbox'),
                mime: 'application/mbox',
                extensions: ['mbox'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4965).then(__webpack_require__.bind(__webpack_require__, 24965));
                    return legacy(m.mbox);
                }
            },
            {
                name: 'Nginx',
                displayName: trans.__('Nginx'),
                mime: 'text/x-nginx-conf',
                filename: /nginx.*\.conf$/i,
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 67).then(__webpack_require__.bind(__webpack_require__, 80067));
                    return legacy(m.nginx);
                }
            },
            {
                name: 'NSIS',
                displayName: trans.__('NSIS'),
                mime: 'text/x-nsis',
                extensions: ['nsh', 'nsi'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1091).then(__webpack_require__.bind(__webpack_require__, 61091));
                    return legacy(m.nsis);
                }
            },
            {
                name: 'NTriples',
                displayName: trans.__('NTriples'),
                mime: [
                    'application/n-triples',
                    'application/n-quads',
                    'text/n-triples'
                ],
                extensions: ['nt', 'nq'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9676).then(__webpack_require__.bind(__webpack_require__, 39676));
                    return legacy(m.ntriples);
                }
            },
            {
                name: 'Objective-C',
                displayName: trans.__('Objective-C'),
                alias: ['objective-c', 'objc'],
                mime: 'text/x-objectivec',
                extensions: ['m'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9425).then(__webpack_require__.bind(__webpack_require__, 49425));
                    return legacy(m.objectiveC);
                }
            },
            {
                name: 'Objective-C++',
                displayName: trans.__('Objective-C++'),
                alias: ['objective-c++', 'objc++'],
                mime: 'text/x-objectivec++',
                extensions: ['mm'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9425).then(__webpack_require__.bind(__webpack_require__, 49425));
                    return legacy(m.objectiveCpp);
                }
            },
            {
                name: 'OCaml',
                displayName: trans.__('OCaml'),
                mime: 'text/x-ocaml',
                extensions: ['ml', 'mli', 'mll', 'mly'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7022).then(__webpack_require__.bind(__webpack_require__, 47022));
                    return legacy(m.oCaml);
                }
            },
            {
                name: 'Octave',
                displayName: trans.__('Octave'),
                mime: 'text/x-octave',
                extensions: ['m'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3336).then(__webpack_require__.bind(__webpack_require__, 33336));
                    return legacy(m.octave);
                }
            },
            {
                name: 'Oz',
                displayName: trans.__('Oz'),
                mime: 'text/x-oz',
                extensions: ['oz'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 632).then(__webpack_require__.bind(__webpack_require__, 632));
                    return legacy(m.oz);
                }
            },
            {
                name: 'Pascal',
                displayName: trans.__('Pascal'),
                mime: 'text/x-pascal',
                extensions: ['p', 'pas'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 2386).then(__webpack_require__.bind(__webpack_require__, 42386));
                    return legacy(m.pascal);
                }
            },
            {
                name: 'Perl',
                displayName: trans.__('Perl'),
                mime: 'text/x-perl',
                extensions: ['pl', 'pm'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3322).then(__webpack_require__.bind(__webpack_require__, 53322));
                    return legacy(m.perl);
                }
            },
            {
                name: 'Pig',
                displayName: trans.__('Pig'),
                mime: 'text/x-pig',
                extensions: ['pig'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8381).then(__webpack_require__.bind(__webpack_require__, 68381));
                    return legacy(m.pig);
                }
            },
            {
                name: 'PowerShell',
                displayName: trans.__('PowerShell'),
                mime: 'application/x-powershell',
                extensions: ['ps1', 'psd1', 'psm1'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8378).then(__webpack_require__.bind(__webpack_require__, 18378));
                    return legacy(m.powerShell);
                }
            },
            {
                name: 'Properties files',
                displayName: trans.__('Properties files'),
                alias: ['ini', 'properties'],
                mime: 'text/x-properties',
                extensions: ['properties', 'ini', 'in'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7803).then(__webpack_require__.bind(__webpack_require__, 87803));
                    return legacy(m.properties);
                }
            },
            {
                name: 'ProtoBuf',
                displayName: trans.__('ProtoBuf'),
                mime: 'text/x-protobuf',
                extensions: ['proto'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 114).then(__webpack_require__.bind(__webpack_require__, 40114));
                    return legacy(m.protobuf);
                }
            },
            {
                name: 'Pug',
                displayName: trans.__('Pug'),
                mime: 'text/x-pug',
                extensions: ['pug'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1601).then(__webpack_require__.bind(__webpack_require__, 51601));
                    return legacy(m.pug);
                }
            },
            {
                name: 'Puppet',
                displayName: trans.__('Puppet'),
                mime: 'text/x-puppet',
                extensions: ['pp'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7005).then(__webpack_require__.bind(__webpack_require__, 57005));
                    return legacy(m.puppet);
                }
            },
            {
                name: 'Q',
                displayName: trans.__('Q'),
                mime: 'text/x-q',
                extensions: ['q'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1088).then(__webpack_require__.bind(__webpack_require__, 31088));
                    return legacy(m.q);
                }
            },
            {
                name: 'R',
                displayName: trans.__('R'),
                alias: ['rscript'],
                mime: 'text/x-rsrc',
                extensions: ['r', 'R'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 2188).then(__webpack_require__.bind(__webpack_require__, 42188));
                    return legacy(m.r);
                }
            },
            {
                name: 'RPM Changes',
                displayName: trans.__('RPM Changes'),
                mime: 'text/x-rpm-changes',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3700).then(__webpack_require__.bind(__webpack_require__, 13700));
                    return legacy(m.rpmChanges);
                }
            },
            {
                name: 'RPM Spec',
                displayName: trans.__('RPM Spec'),
                mime: 'text/x-rpm-spec',
                extensions: ['spec'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 3700).then(__webpack_require__.bind(__webpack_require__, 13700));
                    return legacy(m.rpmSpec);
                }
            },
            {
                name: 'Ruby',
                displayName: trans.__('Ruby'),
                alias: ['jruby', 'macruby', 'rake', 'rb', 'rbx'],
                mime: 'text/x-ruby',
                extensions: ['rb'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5299).then(__webpack_require__.bind(__webpack_require__, 68433));
                    return legacy(m.ruby);
                }
            },
            {
                name: 'SAS',
                displayName: trans.__('SAS'),
                mime: 'text/x-sas',
                extensions: ['sas'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4825).then(__webpack_require__.bind(__webpack_require__, 44825));
                    return legacy(m.sas);
                }
            },
            {
                name: 'Scala',
                displayName: trans.__('Scala'),
                mime: 'text/x-scala',
                extensions: ['scala'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9425).then(__webpack_require__.bind(__webpack_require__, 49425));
                    return legacy(m.scala);
                }
            },
            {
                name: 'Scheme',
                displayName: trans.__('Scheme'),
                mime: 'text/x-scheme',
                extensions: ['scm', 'ss'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 899).then(__webpack_require__.bind(__webpack_require__, 20899));
                    return legacy(m.scheme);
                }
            },
            {
                name: 'SCSS',
                displayName: trans.__('SCSS'),
                mime: 'text/x-scss',
                extensions: ['scss'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5019).then(__webpack_require__.bind(__webpack_require__, 85019));
                    return legacy(m.sCSS);
                }
            },
            {
                name: 'Shell',
                displayName: trans.__('Shell'),
                alias: ['bash', 'sh', 'zsh'],
                mime: ['text/x-sh', 'application/x-sh'],
                extensions: ['sh', 'ksh', 'bash'],
                filename: /^PKGBUILD$/,
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7170).then(__webpack_require__.bind(__webpack_require__, 27170));
                    return legacy(m.shell);
                }
            },
            {
                name: 'Sieve',
                displayName: trans.__('Sieve'),
                mime: 'application/sieve',
                extensions: ['siv', 'sieve'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 745).then(__webpack_require__.bind(__webpack_require__, 50745));
                    return legacy(m.sieve);
                }
            },
            {
                name: 'Smalltalk',
                displayName: trans.__('Smalltalk'),
                mime: 'text/x-stsrc',
                extensions: ['st'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9234).then(__webpack_require__.bind(__webpack_require__, 9234));
                    return legacy(m.smalltalk);
                }
            },
            {
                name: 'Solr',
                displayName: trans.__('Solr'),
                mime: 'text/x-solr',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 85).then(__webpack_require__.bind(__webpack_require__, 50085));
                    return legacy(m.solr);
                }
            },
            {
                name: 'SML',
                displayName: trans.__('SML'),
                mime: 'text/x-sml',
                extensions: ['sml', 'sig', 'fun', 'smackspec'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7022).then(__webpack_require__.bind(__webpack_require__, 47022));
                    return legacy(m.sml);
                }
            },
            {
                name: 'SPARQL',
                displayName: trans.__('SPARQL'),
                alias: ['sparul'],
                mime: 'application/sparql-query',
                extensions: ['rq', 'sparql'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5249).then(__webpack_require__.bind(__webpack_require__, 55249));
                    return legacy(m.sparql);
                }
            },
            {
                name: 'Spreadsheet',
                displayName: trans.__('Spreadsheet'),
                alias: ['excel', 'formula'],
                mime: 'text/x-spreadsheet',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 69).then(__webpack_require__.bind(__webpack_require__, 70069));
                    return legacy(m.spreadsheet);
                }
            },
            {
                name: 'Squirrel',
                displayName: trans.__('Squirrel'),
                mime: 'text/x-squirrel',
                extensions: ['nut'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9425).then(__webpack_require__.bind(__webpack_require__, 49425));
                    return legacy(m.squirrel);
                }
            },
            {
                name: 'Stylus',
                displayName: trans.__('Stylus'),
                mime: 'text/x-styl',
                extensions: ['styl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 6739).then(__webpack_require__.bind(__webpack_require__, 56739));
                    return legacy(m.stylus);
                }
            },
            {
                name: 'Swift',
                displayName: trans.__('Swift'),
                mime: 'text/x-swift',
                extensions: ['swift'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1618).then(__webpack_require__.bind(__webpack_require__, 51618));
                    return legacy(m.swift);
                }
            },
            {
                name: 'sTeX',
                displayName: trans.__('sTeX'),
                mime: 'text/x-stex',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 311).then(__webpack_require__.bind(__webpack_require__, 60311));
                    return legacy(m.stex);
                }
            },
            {
                name: 'LaTeX',
                displayName: trans.__('LaTeX'),
                alias: ['tex'],
                mime: 'text/x-latex',
                extensions: ['text', 'ltx', 'tex'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 311).then(__webpack_require__.bind(__webpack_require__, 60311));
                    return legacy(m.stex);
                }
            },
            {
                name: 'SystemVerilog',
                displayName: trans.__('SystemVerilog'),
                mime: 'text/x-systemverilog',
                extensions: ['v', 'sv', 'svh'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5822).then(__webpack_require__.bind(__webpack_require__, 45822));
                    return legacy(m.verilog);
                }
            },
            {
                name: 'Tcl',
                displayName: trans.__('Tcl'),
                mime: 'text/x-tcl',
                extensions: ['tcl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8446).then(__webpack_require__.bind(__webpack_require__, 8446));
                    return legacy(m.tcl);
                }
            },
            {
                name: 'Textile',
                displayName: trans.__('Textile'),
                mime: 'text/x-textile',
                extensions: ['textile'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4030).then(__webpack_require__.bind(__webpack_require__, 84030));
                    return legacy(m.textile);
                }
            },
            {
                name: 'TiddlyWiki',
                displayName: trans.__('TiddlyWiki'),
                mime: 'text/x-tiddlywiki',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 7054).then(__webpack_require__.bind(__webpack_require__, 27054));
                    return legacy(m.tiddlyWiki);
                }
            },
            {
                name: 'Tiki wiki',
                displayName: trans.__('Tiki wiki'),
                mime: 'text/tiki',
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5425).then(__webpack_require__.bind(__webpack_require__, 15425));
                    return legacy(m.tiki);
                }
            },
            {
                name: 'TOML',
                displayName: trans.__('TOML'),
                mime: 'text/x-toml',
                extensions: ['toml'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 2682).then(__webpack_require__.bind(__webpack_require__, 92682));
                    return legacy(m.toml);
                }
            },
            {
                name: 'troff',
                displayName: trans.__('troff'),
                mime: 'text/troff',
                extensions: ['1', '2', '3', '4', '5', '6', '7', '8', '9'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8433).then(__webpack_require__.bind(__webpack_require__, 28433));
                    return legacy(m.troff);
                }
            },
            {
                name: 'TTCN',
                displayName: trans.__('TTCN'),
                mime: 'text/x-ttcn',
                extensions: ['ttcn', 'ttcn3', 'ttcnpp'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 1122).then(__webpack_require__.bind(__webpack_require__, 21122));
                    return legacy(m.ttcn);
                }
            },
            {
                name: 'TTCN_CFG',
                displayName: trans.__('TTCN_CFG'),
                mime: 'text/x-ttcn-cfg',
                extensions: ['cfg'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 6942).then(__webpack_require__.bind(__webpack_require__, 6942));
                    return legacy(m.ttcnCfg);
                }
            },
            {
                name: 'Turtle',
                displayName: trans.__('Turtle'),
                mime: 'text/turtle',
                extensions: ['ttl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9604).then(__webpack_require__.bind(__webpack_require__, 19604));
                    return legacy(m.turtle);
                }
            },
            {
                name: 'Web IDL',
                displayName: trans.__('Web IDL'),
                mime: 'text/x-webidl',
                extensions: ['webidl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4148).then(__webpack_require__.bind(__webpack_require__, 64148));
                    return legacy(m.webIDL);
                }
            },
            {
                name: 'VB.NET',
                displayName: trans.__('VB.NET'),
                mime: 'text/x-vb',
                extensions: ['vb'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5834).then(__webpack_require__.bind(__webpack_require__, 75834));
                    return legacy(m.vb);
                }
            },
            {
                name: 'VBScript',
                displayName: trans.__('VBScript'),
                mime: 'text/vbscript',
                extensions: ['vbs'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5996).then(__webpack_require__.bind(__webpack_require__, 35996));
                    return legacy(m.vbScript);
                }
            },
            {
                name: 'Velocity',
                displayName: trans.__('Velocity'),
                mime: 'text/velocity',
                extensions: ['vtl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 431).then(__webpack_require__.bind(__webpack_require__, 431));
                    return legacy(m.velocity);
                }
            },
            {
                name: 'Verilog',
                displayName: trans.__('Verilog'),
                mime: 'text/x-verilog',
                extensions: ['v'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5822).then(__webpack_require__.bind(__webpack_require__, 45822));
                    return legacy(m.verilog);
                }
            },
            {
                name: 'VHDL',
                displayName: trans.__('VHDL'),
                mime: 'text/x-vhdl',
                extensions: ['vhd', 'vhdl'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 677).then(__webpack_require__.bind(__webpack_require__, 30677));
                    return legacy(m.vhdl);
                }
            },
            {
                name: 'XQuery',
                displayName: trans.__('XQuery'),
                mime: 'application/xquery',
                extensions: ['xy', 'xquery'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 8162).then(__webpack_require__.bind(__webpack_require__, 83230));
                    return legacy(m.xQuery);
                }
            },
            {
                name: 'Yacas',
                displayName: trans.__('Yacas'),
                mime: 'text/x-yacas',
                extensions: ['ys'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4038).then(__webpack_require__.bind(__webpack_require__, 44038));
                    return legacy(m.yacas);
                }
            },
            {
                name: 'YAML',
                displayName: trans.__('YAML'),
                alias: ['yml'],
                mime: ['text/x-yaml', 'text/yaml'],
                extensions: ['yaml', 'yml'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 9233).then(__webpack_require__.bind(__webpack_require__, 9233));
                    return legacy(m.yaml);
                }
            },
            {
                name: 'Z80',
                displayName: trans.__('Z80'),
                mime: 'text/x-z80',
                extensions: ['z80'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 5698).then(__webpack_require__.bind(__webpack_require__, 75698));
                    return legacy(m.z80);
                }
            },
            {
                name: 'mscgen',
                displayName: trans.__('mscgen'),
                mime: 'text/x-mscgen',
                extensions: ['mscgen', 'mscin', 'msc'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4843).then(__webpack_require__.bind(__webpack_require__, 64843));
                    return legacy(m.mscgen);
                }
            },
            {
                name: 'xu',
                displayName: trans.__('xu'),
                mime: 'text/x-xu',
                extensions: ['xu'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4843).then(__webpack_require__.bind(__webpack_require__, 64843));
                    return legacy(m.xu);
                }
            },
            {
                name: 'msgenny',
                displayName: trans.__('msgenny'),
                mime: 'text/x-msgenny',
                extensions: ['msgenny'],
                async load() {
                    const m = await __webpack_require__.e(/* import() */ 4843).then(__webpack_require__.bind(__webpack_require__, 64843));
                    return legacy(m.msgenny);
                }
            }
        ];
    }
    EditorLanguageRegistry.getDefaultLanguages = getDefaultLanguages;
})(EditorLanguageRegistry || (EditorLanguageRegistry = {}));
//# sourceMappingURL=language.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/editor.js
/* eslint-disable @typescript-eslint/ban-types */
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The class name added to CodeMirrorWidget instances.
 */
const EDITOR_CLASS = 'jp-CodeMirrorEditor';
/**
 * The key code for the up arrow key.
 */
const UP_ARROW = 38;
/**
 * The key code for the down arrow key.
 */
const DOWN_ARROW = 40;
/**
 * CodeMirror editor.
 */
class CodeMirrorEditor {
    /**
     * Construct a CodeMirror editor.
     */
    constructor(options) {
        var _a, _b, _c, _d, _e, _f;
        /**
         * A signal emitted when either the top or bottom edge is requested.
         */
        this.edgeRequested = new index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._language = new state_dist_index_js_.Compartment();
        this._uuid = '';
        this._languages = (_a = options.languages) !== null && _a !== void 0 ? _a : new EditorLanguageRegistry();
        this._configurator =
            (_d = (_b = options.extensionsRegistry) === null || _b === void 0 ? void 0 : _b.createNew({
                ...options,
                inline: (_c = options.inline) !== null && _c !== void 0 ? _c : false
            })) !== null && _d !== void 0 ? _d : new ExtensionsHandler();
        const host = (this.host = options.host);
        host.classList.add(EDITOR_CLASS);
        host.classList.add('jp-Editor');
        host.addEventListener('focus', this, true);
        host.addEventListener('blur', this, true);
        host.addEventListener('scroll', this, true);
        this._uuid = (_e = options.uuid) !== null && _e !== void 0 ? _e : coreutils_dist_index_js_.UUID.uuid4();
        const model = (this._model = options.model);
        // Default keydown handler - it will have low priority
        const onKeyDown = view_dist_index_js_.EditorView.domEventHandlers({
            keydown: (event, view) => {
                return this.onKeydown(event);
            }
        });
        const updateListener = view_dist_index_js_.EditorView.updateListener.of((update) => {
            this._onDocChanged(update);
        });
        this._editor = Private.createEditor(host, this._configurator, [
            // We need to set the order to high, otherwise the keybinding for ArrowUp/ArrowDown
            // will process the event shunting our edge detection code.
            state_dist_index_js_.Prec.high(onKeyDown),
            updateListener,
            // Initialize with empty extension
            this._language.of([]),
            ...((_f = options.extensions) !== null && _f !== void 0 ? _f : [])
        ], model.sharedModel.source);
        // For backward-compatibility with older CodeMirror
        const content = host.querySelector('.cm-content');
        content.cmView = {
            view: this._editor,
            dom: content
        };
        this._onMimeTypeChanged();
        this._onCursorActivity();
        this._configurator.configChanged.connect(this.onConfigChanged, this);
        model.mimeTypeChanged.connect(this._onMimeTypeChanged, this);
    }
    /**
     * The uuid of this editor;
     */
    get uuid() {
        return this._uuid;
    }
    set uuid(value) {
        this._uuid = value;
    }
    /**
     * Get the codemirror editor wrapped by the editor.
     */
    get editor() {
        return this._editor;
    }
    /**
     * Get the codemirror doc wrapped by the widget.
     */
    get doc() {
        return this._editor.state.doc;
    }
    /**
     * Get the number of lines in the editor.
     */
    get lineCount() {
        return this.doc.lines;
    }
    /**
     * Returns a model for this editor.
     */
    get model() {
        return this._model;
    }
    /**
     * The height of a line in the editor in pixels.
     */
    get lineHeight() {
        return this._editor.defaultLineHeight;
    }
    /**
     * The widget of a character in the editor in pixels.
     */
    get charWidth() {
        return this._editor.defaultCharacterWidth;
    }
    /**
     * Tests whether the editor is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.host.removeEventListener('focus', this, true);
        this.host.removeEventListener('blur', this, true);
        this.host.removeEventListener('scroll', this, true);
        this._configurator.dispose();
        index_es6_js_.Signal.clearData(this);
        this.editor.destroy();
    }
    /**
     * Get a config option for the editor.
     */
    getOption(option) {
        return this._configurator.getOption(option);
    }
    /**
     * Whether the option exists or not.
     */
    hasOption(option) {
        return this._configurator.hasOption(option);
    }
    /**
     * Set a config option for the editor.
     */
    setOption(option, value) {
        this._configurator.setOption(option, value);
    }
    /**
     * Set config options for the editor.
     *
     * This method is preferred when setting several options. The
     * options are set within an operation, which only performs
     * the costly update at the end, and not after every option
     * is set.
     */
    setOptions(options) {
        this._configurator.setOptions(options);
    }
    /**
     * Set a base config options for the editor.
     */
    setBaseOptions(options) {
        this._configurator.setBaseOptions(options);
    }
    /**
     * Inject an extension into the editor
     *
     * @alpha
     * @experimental
     * @param ext CodeMirror 6 extension
     */
    injectExtension(ext) {
        this._configurator.injectExtension(this._editor, ext);
    }
    /**
     * Returns the content for the given line number.
     */
    getLine(line) {
        // Jupyter uses a 0-based index for line numbers, CodeMirror 6 uses a 1-based index
        line = line + 1;
        return line <= this.doc.lines ? this.doc.line(line).text : undefined;
    }
    /**
     * Find an offset for the given position.
     */
    getOffsetAt(position) {
        // Jupyter uses a 0-based index for line numbers, CodeMirror 6 uses a 1-based index
        return this.doc.line(position.line + 1).from + position.column;
    }
    /**
     * Find a position for the given offset.
     */
    getPositionAt(offset) {
        // Jupyter uses a 0-based index for line numbers, CodeMirror 6 uses a 1-based index
        const line = this.doc.lineAt(offset);
        return { line: line.number - 1, column: offset - line.from };
    }
    /**
     * Undo one edit (if any undo events are stored).
     */
    undo() {
        this.model.sharedModel.undo();
    }
    /**
     * Redo one undone edit.
     */
    redo() {
        this.model.sharedModel.redo();
    }
    /**
     * Clear the undo history.
     */
    clearHistory() {
        this.model.sharedModel.clearUndoHistory();
    }
    /**
     * Brings browser focus to this editor text.
     */
    focus() {
        // Add the focused class before the editor focus event fires
        // to avoid layout trashing when it gets called in response
        // to focus event from CodeMirror.
        this.host.classList.add('jp-mod-focused');
        this._editor.focus();
    }
    /**
     * Test whether the editor has keyboard focus.
     */
    hasFocus() {
        return this._editor.hasFocus;
    }
    /**
     * Explicitly blur the editor.
     */
    blur() {
        this._editor.contentDOM.blur();
    }
    get state() {
        return this._editor.state;
    }
    firstLine() {
        // TODO: return 1 when CM6 first line number has propagated
        return 0;
    }
    lastLine() {
        return this.doc.lines - 1;
    }
    cursorCoords(where, mode) {
        const selection = this.state.selection.main;
        const pos = where ? selection.from : selection.to;
        const rect = this.editor.coordsAtPos(pos);
        return rect;
    }
    getRange(from, to, separator) {
        const fromOffset = this.getOffsetAt(this._toPosition(from));
        const toOffset = this.getOffsetAt(this._toPosition(to));
        return this.state.sliceDoc(fromOffset, toOffset);
    }
    /**
     * Reveal the given position in the editor.
     */
    revealPosition(position, options) {
        const offset = this.getOffsetAt(position);
        this._editor.dispatch({
            effects: view_dist_index_js_.EditorView.scrollIntoView(offset, {
                y: options === null || options === void 0 ? void 0 : options.block,
                x: options === null || options === void 0 ? void 0 : options.inline
            })
        });
    }
    /**
     * Reveal the given selection in the editor.
     */
    revealSelection(selection, options) {
        const start = this.getOffsetAt(selection.start);
        const end = this.getOffsetAt(selection.end);
        this._editor.dispatch({
            effects: view_dist_index_js_.EditorView.scrollIntoView(state_dist_index_js_.EditorSelection.range(start, end), {
                y: options === null || options === void 0 ? void 0 : options.block,
                x: options === null || options === void 0 ? void 0 : options.inline
            })
        });
    }
    /**
     * Get the window coordinates given a cursor position.
     */
    getCoordinateForPosition(position) {
        const offset = this.getOffsetAt(position);
        const rect = this.editor.coordsAtPos(offset);
        return rect;
    }
    /**
     * Get the cursor position given window coordinates.
     *
     * @param coordinate - The desired coordinate.
     *
     * @returns The position of the coordinates, or null if not
     *   contained in the editor.
     */
    getPositionForCoordinate(coordinate) {
        const offset = this.editor.posAtCoords({
            x: coordinate.left,
            y: coordinate.top
        });
        return this.getPositionAt(offset) || null;
    }
    /**
     * Returns the primary position of the cursor, never `null`.
     */
    getCursorPosition() {
        const offset = this.state.selection.main.head;
        return this.getPositionAt(offset);
    }
    /**
     * Set the primary position of the cursor.
     *
     * #### Notes
     * This will remove any secondary cursors.
     *
     * @deprecated options bias and origin are not used
     */
    setCursorPosition(position, options = {}) {
        const offset = this.getOffsetAt(position);
        this.editor.dispatch({
            selection: { anchor: offset },
            scrollIntoView: options.scroll === false ? false : true
        });
        // If the editor does not have focus, this cursor change
        // will get screened out in _onCursorsChanged(). Make an
        // exception for this method.
        if (!this.editor.hasFocus) {
            this.model.selections.set(this.uuid, this.getSelections());
        }
    }
    /**
     * Returns the primary selection, never `null`.
     */
    getSelection() {
        return this.getSelections()[0];
    }
    /**
     * Set the primary selection. This will remove any secondary cursors.
     */
    setSelection(selection) {
        this.setSelections([selection]);
    }
    /**
     * Gets the selections for all the cursors, never `null` or empty.
     */
    getSelections() {
        const selections = this.state.selection.ranges; //= [{anchor: number, head: number}]
        if (selections.length > 0) {
            const sel = selections.map(r => ({
                anchor: this._toCodeMirrorPosition(this.getPositionAt(r.from)),
                head: this._toCodeMirrorPosition(this.getPositionAt(r.to))
            }));
            return sel.map(selection => this._toSelection(selection));
        }
        const cursor = this._toCodeMirrorPosition(this.getPositionAt(this.state.selection.main.head));
        const selection = this._toSelection({ anchor: cursor, head: cursor });
        return [selection];
    }
    /**
     * Sets the selections for all the cursors, should not be empty.
     * Cursors will be removed or added, as necessary.
     * Passing an empty array resets a cursor position to the start of a document.
     */
    setSelections(selections) {
        const sel = selections.length
            ? selections.map(r => state_dist_index_js_.EditorSelection.range(this.getOffsetAt(r.start), this.getOffsetAt(r.end)))
            : [state_dist_index_js_.EditorSelection.range(0, 0)];
        this.editor.dispatch({ selection: state_dist_index_js_.EditorSelection.create(sel) });
    }
    /**
     * Replaces the current selection with the given text.
     *
     * Behaviour for multiple selections is undefined.
     *
     * @param text The text to be inserted.
     */
    replaceSelection(text) {
        const firstSelection = this.getSelections()[0];
        this.model.sharedModel.updateSource(this.getOffsetAt(firstSelection.start), this.getOffsetAt(firstSelection.end), text);
        const newPosition = this.getPositionAt(this.getOffsetAt(firstSelection.start) + text.length);
        this.setSelection({ start: newPosition, end: newPosition });
    }
    /**
     * Get a list of tokens for the current editor text content.
     */
    getTokens() {
        const tokens = [];
        const tree = (0,dist_index_js_.ensureSyntaxTree)(this.state, this.doc.length);
        if (tree) {
            tree.iterate({
                enter: (ref) => {
                    if (ref.node.firstChild === null) {
                        tokens.push({
                            value: this.state.sliceDoc(ref.from, ref.to),
                            offset: ref.from,
                            type: ref.name
                        });
                    }
                    return true;
                }
            });
        }
        return tokens;
    }
    /**
     * Get the token at a given editor position.
     */
    getTokenAt(offset) {
        const tree = (0,dist_index_js_.ensureSyntaxTree)(this.state, offset);
        let token = null;
        if (tree) {
            tree.iterate({
                enter: (ref) => {
                    // If a token has already been discovered, stop iterating.
                    if (token) {
                        return false;
                    }
                    // If it is not a leaf, keep iterating.
                    if (ref.node.firstChild) {
                        return true;
                    }
                    // If the relevant leaf token has been found, stop iterating.
                    if (offset >= ref.from && offset <= ref.to) {
                        let currentNode = ref;
                        // The syntax tree of the code lines ending with an incomplete string creates an erronous
                        // child of the last node, in this case the parent should be considered for the token.
                        if (ref.name === '⚠' && ref.from === ref.to && ref.node.parent) {
                            currentNode = ref.node.parent;
                        }
                        token = {
                            value: this.state.sliceDoc(currentNode.from, currentNode.to),
                            offset: currentNode.from,
                            type: currentNode.name
                        };
                        return false;
                    }
                    return true;
                }
            });
        }
        return token || { offset, value: '' };
    }
    /**
     * Get the token a the cursor position.
     */
    getTokenAtCursor() {
        return this.getTokenAt(this.state.selection.main.head);
    }
    /**
     * Insert a new indented line at the current cursor position.
     */
    newIndentedLine() {
        (0,index_js_.insertNewlineAndIndent)({
            state: this.state,
            dispatch: this.editor.dispatch
        });
    }
    /**
     * Execute a codemirror command on the editor.
     *
     * @param command - The name of the command to execute.
     */
    execCommand(command) {
        command(this.editor);
    }
    onConfigChanged(configurator, changes) {
        const definedChanges = Object.keys(changes).reduce((agg, key) => {
            if (changes[key] != undefined) {
                agg[key] = changes[key];
            }
            return agg;
        }, {});
        configurator.reconfigureExtensions(this._editor, definedChanges);
        // when customStyles change and the editor is not initialized
        if (changes['customStyles'] && !changes['fontSize']) {
            // update the state to change the gutter height
            this.editor.setState(this.editor.state);
        }
    }
    /**
     * Handle keydown events from the editor.
     */
    onKeydown(event) {
        const position = this.state.selection.main.head;
        if (position === 0 && event.keyCode === UP_ARROW) {
            if (!event.shiftKey) {
                this.edgeRequested.emit('top');
            }
            return false;
        }
        const line = this.doc.lineAt(position).number;
        if (line === 1 && event.keyCode === UP_ARROW) {
            if (!event.shiftKey) {
                this.edgeRequested.emit('topLine');
            }
            return false;
        }
        const length = this.doc.length;
        if (position === length && event.keyCode === DOWN_ARROW) {
            if (!event.shiftKey) {
                this.edgeRequested.emit('bottom');
            }
            return false;
        }
        return false;
    }
    /**
     * Handles a mime type change.
     */
    _onMimeTypeChanged() {
        // TODO: should we provide a hook for when the mode is done being set?
        this._languages
            .getLanguage(this._model.mimeType)
            .then(language => {
            var _a;
            this._editor.dispatch({
                effects: this._language.reconfigure((_a = language === null || language === void 0 ? void 0 : language.support) !== null && _a !== void 0 ? _a : [])
            });
        })
            .catch(reason => {
            console.log(`Failed to load language for '${this._model.mimeType}'.`, reason);
            this._editor.dispatch({
                effects: this._language.reconfigure([])
            });
        });
    }
    /**
     * Handles a cursor activity event.
     */
    _onCursorActivity() {
        // Only add selections if the editor has focus. This avoids unwanted
        // triggering of cursor activity due to collaborator actions.
        if (this._editor.hasFocus) {
            const selections = this.getSelections();
            this.model.selections.set(this.uuid, selections);
        }
    }
    /**
     * Converts a code mirror selection to an editor selection.
     */
    _toSelection(selection) {
        return {
            uuid: this.uuid,
            start: this._toPosition(selection.anchor),
            end: this._toPosition(selection.head)
        };
    }
    /**
     * Convert a code mirror position to an editor position.
     */
    _toPosition(position) {
        return {
            line: position.line,
            column: position.ch
        };
    }
    /**
     * Convert an editor position to a code mirror position.
     */
    _toCodeMirrorPosition(position) {
        return {
            line: position.line,
            ch: position.column
        };
    }
    /**
     * Handles document changes.
     */
    _onDocChanged(update) {
        if (update.transactions.length && update.transactions[0].selection) {
            this._onCursorActivity();
        }
    }
    /**
     * Handle the DOM events for the editor.
     *
     * @param event - The DOM event sent to the editor.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the editor's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'focus':
                this._evtFocus(event);
                break;
            case 'blur':
                this._evtBlur(event);
                break;
            default:
                break;
        }
    }
    /**
     * Handle `focus` events for the editor.
     */
    _evtFocus(event) {
        this.host.classList.add('jp-mod-focused');
        // Update the selections on editor gaining focus because
        // the onCursorActivity function filters usual cursor events
        // based on the editor's focus.
        this._onCursorActivity();
    }
    /**
     * Handle `blur` events for the editor.
     */
    _evtBlur(event) {
        this.host.classList.remove('jp-mod-focused');
    }
}
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    function createEditor(host, editorConfig, additionalExtensions, doc) {
        const extensions = editorConfig.getInitialExtensions();
        extensions.push(...additionalExtensions);
        const view = new view_dist_index_js_.EditorView({
            state: state_dist_index_js_.EditorState.create({
                doc,
                extensions
            }),
            parent: host
        });
        return view;
    }
    Private.createEditor = createEditor;
})(Private || (Private = {}));
//# sourceMappingURL=editor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/factory.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * CodeMirror editor factory.
 */
class CodeMirrorEditorFactory {
    /**
     * Construct an IEditorFactoryService for CodeMirrorEditors.
     */
    constructor(options = {}) {
        var _a, _b, _c;
        /**
         * Create a new editor for inline code.
         */
        this.newInlineEditor = (options) => {
            options.host.dataset.type = 'inline';
            return this.newEditor({
                ...options,
                config: { ...this.inlineCodeMirrorConfig, ...(options.config || {}) },
                inline: true
            });
        };
        /**
         * Create a new editor for a full document.
         */
        this.newDocumentEditor = (options) => {
            var _a, _b;
            options.host.dataset.type = 'document';
            return this.newEditor({
                ...options,
                config: { ...this.documentCodeMirrorConfig, ...((_a = options.config) !== null && _a !== void 0 ? _a : {}) },
                inline: false,
                extensions: (_b = options.extensions) !== null && _b !== void 0 ? _b : []
            });
        };
        this.languages = (_a = options.languages) !== null && _a !== void 0 ? _a : new EditorLanguageRegistry();
        this.extensions = (_b = options.extensions) !== null && _b !== void 0 ? _b : new EditorExtensionRegistry();
        this.translator = (_c = options.translator) !== null && _c !== void 0 ? _c : translation_lib_index_js_.nullTranslator;
        this.inlineCodeMirrorConfig = {
            searchWithCM: true
        };
        this.documentCodeMirrorConfig = {
            lineNumbers: true,
            scrollPastEnd: true
        };
    }
    /**
     * Create a new editor
     *
     * @param options Editor options
     * @returns The editor
     */
    newEditor(options) {
        const editor = new CodeMirrorEditor({
            extensionsRegistry: this.extensions,
            languages: this.languages,
            translator: this.translator,
            ...options
        });
        return editor;
    }
}
//# sourceMappingURL=factory.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/mimetype.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * The mime type service for CodeMirror.
 */
class CodeMirrorMimeTypeService {
    constructor(languages) {
        this.languages = languages;
    }
    /**
     * Returns a mime type for the given language info.
     *
     * #### Notes
     * If a mime type cannot be found returns the default mime type `text/plain`, never `null`.
     * There may be more than one mime type, but only the first one will be returned.
     * To access all mime types, use `IEditorLanguageRegistry` instead.
     */
    getMimeTypeByLanguage(info) {
        var _a;
        const ext = info.file_extension || '';
        const mode = this.languages.findBest(info.codemirror_mode || {
            mimetype: info.mimetype,
            name: info.name,
            ext: [ext.split('.').slice(-1)[0]]
        });
        return mode
            ? Array.isArray(mode.mime)
                ? (_a = mode.mime[0]) !== null && _a !== void 0 ? _a : lib_index_js_.IEditorMimeTypeService.defaultMimeType
                : mode.mime
            : lib_index_js_.IEditorMimeTypeService.defaultMimeType;
    }
    /**
     * Returns a mime type for the given file path.
     *
     * #### Notes
     * If a mime type cannot be found returns the default mime type `text/plain`, never `null`.
     * There may be more than one mime type, but only the first one will be returned.
     * To access all mime types, use `IEditorLanguageRegistry` instead.
     */
    getMimeTypeByFilePath(path) {
        var _a;
        const ext = coreutils_lib_index_js_.PathExt.extname(path);
        if (ext === '.ipy') {
            return 'text/x-python';
        }
        else if (ext === '.md') {
            return 'text/x-ipythongfm';
        }
        const mode = this.languages.findByFileName(path);
        return mode
            ? Array.isArray(mode.mime)
                ? (_a = mode.mime[0]) !== null && _a !== void 0 ? _a : lib_index_js_.IEditorMimeTypeService.defaultMimeType
                : mode.mime
            : lib_index_js_.IEditorMimeTypeService.defaultMimeType;
    }
}
//# sourceMappingURL=mimetype.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/documentsearch@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/documentsearch/lib/index.js)
var documentsearch_lib_index_js_ = __webpack_require__(3894);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/searchprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * Search provider for editors.
 */
class EditorSearchProvider {
    /**
     * Constructor
     */
    constructor() {
        /**
         * Current match index
         */
        this.currentIndex = null;
        /**
         * Current search query
         */
        this.query = null;
        this._isActive = true;
        this._inSelection = null;
        this._isDisposed = false;
        this._cmHandler = null;
        this.currentIndex = null;
        this._stateChanged = new index_es6_js_.Signal(this);
    }
    /**
     * CodeMirror search highlighter
     */
    get cmHandler() {
        if (!this._cmHandler) {
            this._cmHandler = new CodeMirrorSearchHighlighter(this.editor);
        }
        return this._cmHandler;
    }
    /**
     * Changed signal to be emitted when search matches change.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * Current match index
     */
    get currentMatchIndex() {
        return this.isActive ? this.currentIndex : null;
    }
    /**
     * Whether the cell search is active.
     *
     * This is used when applying search only on selected cells.
     */
    get isActive() {
        return this._isActive;
    }
    /**
     * Whether the search provider is disposed or not.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Number of matches in the cell.
     */
    get matchesCount() {
        return this.isActive ? this.cmHandler.matches.length : 0;
    }
    /**
     * Clear currently highlighted match
     */
    clearHighlight() {
        this.currentIndex = null;
        this.cmHandler.clearHighlight();
        return Promise.resolve();
    }
    /**
     * Dispose the search provider
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        index_es6_js_.Signal.clearData(this);
        if (this.isActive) {
            this.endQuery().catch(reason => {
                console.error(`Failed to end search query on cells.`, reason);
            });
        }
    }
    /**
     * Set `isActive` status.
     *
     * #### Notes
     * It will start or end the search
     *
     * @param v New value
     */
    async setIsActive(v) {
        if (this._isActive === v) {
            return;
        }
        this._isActive = v;
        if (this._isActive) {
            if (this.query !== null) {
                await this.startQuery(this.query, this.filters);
            }
        }
        else {
            await this.endQuery();
        }
    }
    /**
     * Set whether search should be limited to specified text selection.
     */
    async setSearchSelection(selection) {
        if (this._inSelection === selection) {
            return;
        }
        this._inSelection = selection;
        await this.updateCodeMirror(this.model.sharedModel.getSource());
        this._stateChanged.emit();
    }
    /**
     * Set whether user selection should be protected from modifications.
     *
     * If disabled, the selection will be updated on search and on editor focus
     * to cover the current match. We need to protect selection from modifications
     * for both: search in text and search in cells; since `setSearchSelection`
     * is only telling us about search in text, we need to have an additional
     * way to signal that either search in text or in cells is active, or for
     * any other reason selection range should be protected.
     */
    setProtectSelection(v) {
        this.cmHandler.protectSelection = v;
    }
    /**
     * Initialize the search using the provided options. Should update the UI
     * to highlight all matches and "select" the first match.
     *
     * @param query A RegExp to be use to perform the search
     * @param filters Filter parameters to pass to provider
     */
    async startQuery(query, filters) {
        this.query = query;
        this.filters = filters;
        // Search input
        const content = this.model.sharedModel.getSource();
        await this.updateCodeMirror(content);
        this.model.sharedModel.changed.connect(this.onSharedModelChanged, this);
    }
    /**
     * Stop the search and clean any UI elements.
     */
    async endQuery() {
        await this.clearHighlight();
        await this.cmHandler.endQuery();
        this.currentIndex = null;
    }
    /**
     * Highlight the next match.
     *
     * @returns The next match if there is one.
     */
    async highlightNext(loop = true, options) {
        if (this.matchesCount === 0 || !this.isActive) {
            this.currentIndex = null;
        }
        else {
            let match = await this.cmHandler.highlightNext(options);
            if (match) {
                this.currentIndex = this.cmHandler.currentIndex;
            }
            else {
                // Note: the loop logic is only used in single-editor (e.g. file editor)
                // provider sub-classes, notebook has its own loop logic and ignores
                // `currentIndex` as set here.
                this.currentIndex = loop ? 0 : null;
            }
            return match;
        }
        return Promise.resolve(this.getCurrentMatch());
    }
    /**
     * Highlight the previous match.
     *
     * @returns The previous match if there is one.
     */
    async highlightPrevious(loop = true, options) {
        if (this.matchesCount === 0 || !this.isActive) {
            this.currentIndex = null;
        }
        else {
            let match = await this.cmHandler.highlightPrevious(options);
            if (match) {
                this.currentIndex = this.cmHandler.currentIndex;
            }
            else {
                this.currentIndex = loop ? this.matchesCount - 1 : null;
            }
            return match;
        }
        return Promise.resolve(this.getCurrentMatch());
    }
    /**
     * Replace the currently selected match with the provided text.
     *
     * If no match is selected, it won't do anything.
     *
     * The caller of this method is expected to call `highlightNext` if after
     * calling `replaceCurrentMatch()` attribute `this.currentIndex` is null.
     * It is necessary to let the caller handle highlighting because this
     * method is used in composition pattern (search engine of notebook cells)
     * and highlighting on the composer (notebook) level needs to switch to next
     * engine (cell) with matches.
     *
     * @param newText The replacement text.
     * @returns Whether a replace occurred.
     */
    replaceCurrentMatch(newText, loop, options) {
        if (!this.isActive) {
            return Promise.resolve(false);
        }
        if (this.currentIndex !== null &&
            this.currentIndex < this.cmHandler.matches.length) {
            const match = this.getCurrentMatch();
            if (!match) {
                this.currentIndex = null;
            }
            else {
                const substitutedText = (options === null || options === void 0 ? void 0 : options.regularExpression)
                    ? match.text.replace(this.query, newText)
                    : newText;
                const insertText = (options === null || options === void 0 ? void 0 : options.preserveCase)
                    ? documentsearch_lib_index_js_.GenericSearchProvider.preserveCase(match.text, substitutedText)
                    : substitutedText;
                this.model.sharedModel.updateSource(match.position, match.position + match.text.length, insertText);
                // Regenerate the match list, then iterate through it.
                return new Promise((resolve, reject) => {
                    this.updateCodeMirror(this.model.sharedModel.getSource())
                        .then(() => {
                        const allMatches = this.cmHandler.matches;
                        const positionAfterReplacement = match.position + insertText.length;
                        let nextMatchFound = false;
                        for (let matchIdx = this.currentIndex || 0; matchIdx < allMatches.length; matchIdx++) {
                            if (allMatches[matchIdx].position >= positionAfterReplacement) {
                                this.currentIndex = matchIdx;
                                nextMatchFound = true;
                                break;
                            }
                            // Move the highlight forward from the previous match, not looping.
                            void this.highlightNext(false, { from: 'previous-match' });
                        }
                        if (!nextMatchFound) {
                            this.currentIndex = null; // No more matches in this string
                        }
                        resolve(true);
                    })
                        .catch(err => {
                        const errorMessage = `Failed to regenerate match list: ${err}`;
                        console.error(errorMessage);
                        reject(errorMessage);
                    });
                });
            }
        }
        return Promise.resolve(false);
    }
    /**
     * Replace all matches in the cell source with the provided text
     *
     * @param newText The replacement text.
     * @returns Whether a replace occurred.
     */
    replaceAllMatches(newText, options) {
        if (!this.isActive) {
            return Promise.resolve(false);
        }
        let occurred = this.cmHandler.matches.length > 0;
        let src = this.model.sharedModel.getSource();
        let lastEnd = 0;
        const finalSrc = this.cmHandler.matches.reduce((agg, match) => {
            const start = match.position;
            const end = start + match.text.length;
            const substitutedText = (options === null || options === void 0 ? void 0 : options.regularExpression)
                ? match.text.replace(this.query, newText)
                : newText;
            const insertText = (options === null || options === void 0 ? void 0 : options.preserveCase)
                ? documentsearch_lib_index_js_.GenericSearchProvider.preserveCase(match.text, substitutedText)
                : substitutedText;
            const newStep = `${agg}${src.slice(lastEnd, start)}${insertText}`;
            lastEnd = end;
            return newStep;
        }, '');
        if (occurred) {
            this.cmHandler.matches = [];
            this.currentIndex = null;
            this.model.sharedModel.setSource(`${finalSrc}${src.slice(lastEnd)}`);
        }
        return Promise.resolve(occurred);
    }
    /**
     * Get the current match if it exists.
     *
     * @returns The current match
     */
    getCurrentMatch() {
        if (this.currentIndex === null) {
            return undefined;
        }
        else {
            let match = undefined;
            if (this.currentIndex < this.cmHandler.matches.length) {
                match = this.cmHandler.matches[this.currentIndex];
            }
            return match;
        }
    }
    /**
     * Callback on source change
     *
     * @param emitter Source of the change
     * @param changes Source change
     */
    async onSharedModelChanged(emitter, changes) {
        if (changes.sourceChange) {
            await this.updateCodeMirror(emitter.getSource());
            this._stateChanged.emit();
        }
    }
    /**
     * Update matches
     */
    async updateCodeMirror(content) {
        if (this.query !== null && this.isActive) {
            const allMatches = await documentsearch_lib_index_js_.TextSearchEngine.search(this.query, content);
            if (this._inSelection) {
                const editor = this.editor;
                const start = editor.getOffsetAt(this._inSelection.start);
                const end = editor.getOffsetAt(this._inSelection.end);
                this.cmHandler.matches = allMatches.filter(match => match.position >= start && match.position <= end);
                // A special case to always have a current match when in line selection mode.
                if (this.cmHandler.currentIndex === null &&
                    this.cmHandler.matches.length > 0) {
                    await this.cmHandler.highlightNext({
                        from: 'selection',
                        select: false,
                        scroll: false
                    });
                }
                this.currentIndex = this.cmHandler.currentIndex;
            }
            else {
                this.cmHandler.matches = allMatches;
            }
        }
        else {
            this.cmHandler.matches = [];
        }
    }
}
/**
 * Helper class to highlight texts in a code mirror editor.
 *
 * Highlighted texts (aka `matches`) must be provided through
 * the `matches` attributes.
 *
 * **NOTES:**
 * - to retain the selection visibility `drawSelection` extension is needed.
 * - highlighting starts from the cursor (if editor is focused and `from` is set
 *   to `'auto'`, cursor moved, or `from` argument is set to `'selection'` or
 *   `'selection-start'`), or from last "current" match otherwise.
 * - `currentIndex` is the (readonly) source of truth for the current match.
 */
class CodeMirrorSearchHighlighter {
    /**
     * Constructor
     *
     * @param editor The CodeMirror editor
     */
    constructor(editor) {
        this._current = null;
        this._cm = editor;
        this._matches = new Array();
        this._currentIndex = null;
        this._highlightEffect = state_dist_index_js_.StateEffect.define({
            map: (value, mapping) => {
                const transform = (v) => ({
                    text: v.text,
                    position: mapping.mapPos(v.position)
                });
                return {
                    matches: value.matches.map(transform),
                    currentMatch: value.currentMatch
                        ? transform(value.currentMatch)
                        : null
                };
            }
        });
        this._highlightMark = view_dist_index_js_.Decoration.mark({ class: 'cm-searching' });
        this._currentMark = view_dist_index_js_.Decoration.mark({ class: 'jp-current-match' });
        this._highlightField = state_dist_index_js_.StateField.define({
            create: () => {
                return view_dist_index_js_.Decoration.none;
            },
            update: (highlights, transaction) => {
                highlights = highlights.map(transaction.changes);
                for (let ef of transaction.effects) {
                    if (ef.is(this._highlightEffect)) {
                        const e = ef;
                        if (e.value.matches.length) {
                            // Note: nesting will vary; sometimes `.cm-searching` will be
                            // inside `.jp-current-match`, sometime the other way round.
                            highlights = highlights.update({
                                add: e.value.matches.map(m => this._highlightMark.range(m.position, m.position + m.text.length)),
                                // filter out old marks
                                filter: () => false
                            });
                            highlights = highlights.update({
                                add: e.value.currentMatch
                                    ? [
                                        this._currentMark.range(e.value.currentMatch.position, e.value.currentMatch.position +
                                            e.value.currentMatch.text.length)
                                    ]
                                    : []
                            });
                        }
                        else {
                            highlights = view_dist_index_js_.Decoration.none;
                        }
                    }
                }
                return highlights;
            },
            provide: f => view_dist_index_js_.EditorView.decorations.from(f)
        });
        this._domEventHandlers = view_dist_index_js_.EditorView.domEventHandlers({
            focus: () => {
                // Set cursor on active match when editor gets focused.
                this._selectCurrentMatch();
            }
        });
    }
    /**
     * The current index of the selected match.
     */
    get currentIndex() {
        return this._currentIndex;
    }
    /**
     * The list of matches
     */
    get matches() {
        return this._matches;
    }
    set matches(v) {
        this._matches = v;
        if (this._currentIndex !== null &&
            this._currentIndex > this._matches.length) {
            this._currentIndex = this._matches.length > 0 ? 0 : null;
        }
        this._highlightCurrentMatch({ select: false });
    }
    /**
     * Whether the cursor/selection should not be modified.
     */
    get protectSelection() {
        return this._protectSelection;
    }
    set protectSelection(v) {
        this._protectSelection = v;
    }
    /**
     * Clear all highlighted matches
     */
    clearHighlight() {
        this._currentIndex = null;
        this._highlightCurrentMatch();
    }
    /**
     * Clear the highlighted matches.
     */
    endQuery() {
        this._currentIndex = null;
        this._matches = [];
        if (this._cm) {
            this._cm.editor.dispatch({
                effects: this._highlightEffect.of({ matches: [], currentMatch: null })
            });
        }
        return Promise.resolve();
    }
    /**
     * Highlight the next match
     *
     * @returns The next match if available
     */
    highlightNext(options) {
        var _a;
        this._currentIndex = this._findNext(false, (_a = options === null || options === void 0 ? void 0 : options.from) !== null && _a !== void 0 ? _a : 'auto');
        this._highlightCurrentMatch(options);
        return Promise.resolve(this._currentIndex !== null
            ? this._matches[this._currentIndex]
            : undefined);
    }
    /**
     * Highlight the previous match
     *
     * @returns The previous match if available
     */
    highlightPrevious(options) {
        var _a;
        this._currentIndex = this._findNext(true, (_a = options === null || options === void 0 ? void 0 : options.from) !== null && _a !== void 0 ? _a : 'auto');
        this._highlightCurrentMatch(options);
        return Promise.resolve(this._currentIndex !== null
            ? this._matches[this._currentIndex]
            : undefined);
    }
    /**
     * Set the editor
     *
     * @param editor Editor
     */
    setEditor(editor) {
        if (this._cm) {
            throw new Error('CodeMirrorEditor already set.');
        }
        else {
            this._cm = editor;
            if (this._currentIndex !== null) {
                this._highlightCurrentMatch();
            }
            this._cm.editor.dispatch({
                effects: state_dist_index_js_.StateEffect.appendConfig.of(this._domEventHandlers)
            });
            this._refresh();
        }
    }
    _selectCurrentMatch(scroll = true) {
        // This method has two responsibilities:
        // 1) Scroll the current match into the view - useful for long lines,
        //    and file editors with more lines that fit on the screen
        // 2) When user has focus on the editor (not search box) and presses
        //    ctrl + g/ctrl + shift + g to jump to next match they want their
        //    cursor to jump too.
        // We execute (1) and (2) together as CodeMirror has a special code path
        // to handle both in a single dispatch.
        // The (2) case is inapplicable to search in selection mode, as it would
        // invalidate the query selection, so in that case we only execute (1).
        const match = this._current;
        if (!match) {
            return;
        }
        if (!this._cm) {
            return;
        }
        const cursor = {
            anchor: match.position,
            head: match.position + match.text.length
        };
        const selection = this._cm.editor.state.selection.main;
        if ((selection.from === match.position &&
            selection.to === match.position + match.text.length) ||
            this._protectSelection) {
            // Correct selection is already set or search is restricted to selection:
            // scroll without changing the selection.
            if (scroll) {
                this._cm.editor.dispatch({
                    effects: view_dist_index_js_.EditorView.scrollIntoView(state_dist_index_js_.EditorSelection.range(cursor.anchor, cursor.head))
                });
                return;
            }
        }
        else {
            this._cm.editor.dispatch({
                selection: cursor,
                scrollIntoView: scroll
            });
        }
    }
    _highlightCurrentMatch(options) {
        var _a, _b, _c;
        if (!this._cm) {
            // no-op
            return;
        }
        // Highlight the current index
        if (this._currentIndex !== null) {
            const match = this.matches[this._currentIndex];
            this._current = match;
            // We do not change selection nor scroll if:
            // - user is selecting text,
            // - document was modified
            if ((_a = options === null || options === void 0 ? void 0 : options.select) !== null && _a !== void 0 ? _a : true) {
                if (this._cm.hasFocus()) {
                    // If editor is focused we actually set the cursor on the match.
                    this._selectCurrentMatch((_b = options === null || options === void 0 ? void 0 : options.scroll) !== null && _b !== void 0 ? _b : true);
                }
                else if ((_c = options === null || options === void 0 ? void 0 : options.scroll) !== null && _c !== void 0 ? _c : true) {
                    // otherwise we just scroll to preserve the selection.
                    this._cm.editor.dispatch({
                        effects: view_dist_index_js_.EditorView.scrollIntoView(match.position)
                    });
                }
            }
        }
        else {
            this._current = null;
        }
        this._refresh();
    }
    _refresh() {
        if (!this._cm) {
            // no-op
            return;
        }
        let effects = [
            this._highlightEffect.of({
                matches: this.matches,
                currentMatch: this._current
            })
        ];
        if (!this._cm.state.field(this._highlightField, false)) {
            effects.push(state_dist_index_js_.StateEffect.appendConfig.of([this._highlightField]));
        }
        this._cm.editor.dispatch({ effects });
    }
    _findNext(reverse, from = 'auto') {
        var _a, _b, _c, _d;
        if (this._matches.length === 0) {
            // No-op
            return null;
        }
        // If the editor has not be instantiated yet (e.g. a cell that has not yet be seen in the viewport),
        // force the behavior
        if (!this._cm && !['previous-match', 'start'].includes(from)) {
            from = 'previous-match';
        }
        let lastPosition = 0;
        if ((from === 'auto' && ((_b = (_a = this._cm) === null || _a === void 0 ? void 0 : _a.hasFocus()) !== null && _b !== void 0 ? _b : false)) ||
            from === 'selection') {
            const cursor = this._cm.state.selection.main;
            lastPosition = reverse ? cursor.anchor : cursor.head;
        }
        else if (from === 'selection-start') {
            const cursor = this._cm.state.selection.main;
            lastPosition = Math.min(cursor.anchor, cursor.head);
        }
        else if (from === 'start') {
            lastPosition = 0;
        }
        else if (this._current) {
            lastPosition = reverse
                ? this._current.position
                : this._current.position + this._current.text.length;
        }
        if (lastPosition === 0 && reverse && this.currentIndex === null) {
            // The default position is (0, 0) but we want to start from the end in that case
            // Fallback to the end of the latest match if the editor is not instantiated
            lastPosition =
                (_d = (_c = this._cm) === null || _c === void 0 ? void 0 : _c.doc.length) !== null && _d !== void 0 ? _d : endLastMatch(this._matches[this._matches.length - 1]);
        }
        const position = lastPosition;
        let found = Utils.findNext(this._matches, position, 0, this._matches.length - 1);
        if (found === null) {
            // Don't loop
            return reverse ? this._matches.length - 1 : null;
        }
        if (reverse) {
            found -= 1;
            if (found < 0) {
                // Don't loop
                return null;
            }
        }
        return found;
        function endLastMatch(lastMatch) {
            return lastMatch ? lastMatch.position + lastMatch.text.length : 0;
        }
    }
}
/**
 * Helpers namespace
 */
var Utils;
(function (Utils) {
    /**
     * Find the closest match at `position` just after it.
     *
     * #### Notes
     * Search is done using a binary search algorithm
     *
     * @param matches List of matches
     * @param position Searched position
     * @param lowerBound Lower range index
     * @param higherBound High range index
     * @returns The next match or null if none exists
     */
    function findNext(matches, position, lowerBound = 0, higherBound = Infinity) {
        higherBound = Math.min(matches.length - 1, higherBound);
        while (lowerBound <= higherBound) {
            let middle = Math.floor(0.5 * (lowerBound + higherBound));
            const currentPosition = matches[middle].position;
            if (currentPosition < position) {
                lowerBound = middle + 1;
                if (lowerBound < matches.length &&
                    matches[lowerBound].position > position) {
                    return lowerBound;
                }
            }
            else if (currentPosition > position) {
                higherBound = middle - 1;
                if (higherBound > 0 && matches[higherBound].position < position) {
                    return middle;
                }
            }
            else {
                return middle;
            }
        }
        // Next could be the first item
        const first = lowerBound > 0 ? lowerBound - 1 : 0;
        const match = matches[first];
        return match.position >= position ? first : null;
    }
    Utils.findNext = findNext;
})(Utils || (Utils = {}));
//# sourceMappingURL=searchprovider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/token.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/**
 * Editor language token.
 */
const IEditorExtensionRegistry = new coreutils_dist_index_js_.Token('@jupyterlab/codemirror:IEditorExtensionRegistry', `A registry for CodeMirror extension factories.`);
/**
 * Editor language token.
 */
const IEditorLanguageRegistry = new coreutils_dist_index_js_.Token('@jupyterlab/codemirror:IEditorLanguageRegistry', 'A registry for CodeMirror languages.');
/**
 * Editor theme token.
 */
const IEditorThemeRegistry = new coreutils_dist_index_js_.Token('@jupyterlab/codemirror:IEditorThemeRegistry', 'A registry for CodeMirror theme.');
//# sourceMappingURL=token.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module codemirror
 */











//# sourceMappingURL=index.js.map

/***/ }),

/***/ 32871:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/documentsearch/style/index.js + 1 modules
var documentsearch_style = __webpack_require__(13737);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/codemirror/style/base.css
var base = __webpack_require__(3492);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 33340:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/completer@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/completer/lib/index.js)
var completer_lib_index_js_ = __webpack_require__(27709);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/commands@~2.3.3 (singleton) (fallback: ../node_modules/@lumino/commands/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(88532);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer-extension/lib/renderer.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

const AVAILABLE_PROVIDERS = 'availableProviders';
/**
 * Custom setting renderer for provider rank.
 */
function renderAvailableProviders(props) {
    const { schema } = props;
    const title = schema.title;
    const desc = schema.description;
    const settings = props.formContext.settings;
    const userData = settings.get(AVAILABLE_PROVIDERS).user;
    const items = {
        ...schema.default
    };
    if (userData) {
        for (const key of Object.keys(items)) {
            if (key in userData) {
                items[key] = userData[key];
            }
            else {
                items[key] = -1;
            }
        }
    }
    const [settingValue, setValue] = (0,react_index_js_.useState)(items);
    const onSettingChange = (key, e) => {
        const newValue = {
            ...settingValue,
            [key]: parseInt(e.target.value)
        };
        settings.set(AVAILABLE_PROVIDERS, newValue).catch(console.error);
        setValue(newValue);
    };
    return (
    //TODO Remove hard coded class names
    react_index_js_default().createElement("div", null,
        react_index_js_default().createElement("fieldset", null,
            react_index_js_default().createElement("legend", null, title),
            react_index_js_default().createElement("p", { className: "field-description" }, desc),
            Object.keys(items).map(key => {
                return (react_index_js_default().createElement("div", { key: key, className: "form-group small-field" },
                    react_index_js_default().createElement("div", null,
                        react_index_js_default().createElement("h3", null,
                            " ",
                            key),
                        react_index_js_default().createElement("div", { className: "inputFieldWrapper" },
                            react_index_js_default().createElement("input", { className: "form-control", type: "number", value: settingValue[key], onChange: e => {
                                    onSettingChange(key, e);
                                } })))));
            }))));
}
//# sourceMappingURL=renderer.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module completer-extension
 */








const COMPLETION_MANAGER_PLUGIN = '@jupyterlab/completer-extension:manager';
const INLINE_COMPLETER_PLUGIN = '@jupyterlab/completer-extension:inline-completer';
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.nextInline = 'inline-completer:next';
    CommandIDs.previousInline = 'inline-completer:previous';
    CommandIDs.acceptInline = 'inline-completer:accept';
    CommandIDs.invokeInline = 'inline-completer:invoke';
})(CommandIDs || (CommandIDs = {}));
const defaultProviders = {
    id: '@jupyterlab/completer-extension:base-service',
    description: 'Adds context and kernel completion providers.',
    requires: [completer_lib_index_js_.ICompletionProviderManager],
    autoStart: true,
    activate: (app, completionManager) => {
        completionManager.registerProvider(new completer_lib_index_js_.ContextCompleterProvider());
        completionManager.registerProvider(new completer_lib_index_js_.KernelCompleterProvider());
    }
};
const inlineHistoryProvider = {
    id: '@jupyterlab/completer-extension:inline-history',
    description: 'Adds inline completion provider suggesting code from execution history.',
    requires: [completer_lib_index_js_.ICompletionProviderManager],
    optional: [translation_lib_index_js_.ITranslator],
    autoStart: true,
    activate: (app, completionManager, translator) => {
        completionManager.registerInlineProvider(new completer_lib_index_js_.HistoryInlineCompletionProvider({
            translator: translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator
        }));
    }
};
const inlineCompleterFactory = {
    id: '@jupyterlab/completer-extension:inline-completer-factory',
    description: 'Provides a factory for inline completer.',
    provides: completer_lib_index_js_.IInlineCompleterFactory,
    optional: [translation_lib_index_js_.ITranslator],
    autoStart: true,
    activate: (app, translator) => {
        const trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return {
            factory: options => {
                const inlineCompleter = new completer_lib_index_js_.InlineCompleter({
                    ...options,
                    trans: trans
                });
                const describeShortcut = (commandID) => {
                    const binding = app.commands.keyBindings.find(binding => binding.command === commandID);
                    const keys = binding
                        ? index_es6_js_.CommandRegistry.formatKeystroke(binding.keys)
                        : '';
                    return keys ? `${keys}` : '';
                };
                const labelCache = {
                    [CommandIDs.previousInline]: describeShortcut(CommandIDs.previousInline),
                    [CommandIDs.nextInline]: describeShortcut(CommandIDs.nextInline),
                    [CommandIDs.acceptInline]: describeShortcut(CommandIDs.acceptInline)
                };
                app.commands.keyBindingChanged.connect((_emitter, change) => {
                    const command = change.binding.command;
                    if (labelCache.hasOwnProperty(command)) {
                        const cached = labelCache[command];
                        const newLabel = describeShortcut(command);
                        if (newLabel !== cached) {
                            // Update cache
                            labelCache[command] = newLabel;
                            // Re-render any UI elements using this command
                            app.commands.notifyCommandChanged(command);
                        }
                    }
                });
                inlineCompleter.toolbar.addItem('previous-inline-completion', new lib_index_js_.CommandToolbarButton({
                    commands: app.commands,
                    icon: lib_index_js_.caretLeftIcon,
                    id: CommandIDs.previousInline,
                    label: () => labelCache[CommandIDs.previousInline],
                    caption: trans.__('Previous')
                }));
                inlineCompleter.toolbar.addItem('next-inline-completion', new lib_index_js_.CommandToolbarButton({
                    commands: app.commands,
                    icon: lib_index_js_.caretRightIcon,
                    id: CommandIDs.nextInline,
                    label: () => labelCache[CommandIDs.nextInline],
                    caption: trans.__('Next')
                }));
                inlineCompleter.toolbar.addItem('accept-inline-completion', new lib_index_js_.CommandToolbarButton({
                    commands: app.commands,
                    icon: lib_index_js_.checkIcon,
                    id: CommandIDs.acceptInline,
                    label: () => labelCache[CommandIDs.acceptInline],
                    caption: trans.__('Accept')
                }));
                inlineCompleter.model.suggestionsChanged.connect(() => {
                    // Enabled state of these commands depends on whether
                    // there are any suggestions (or whether there is more
                    // than one suggestion) so the UI needs to be modified
                    // when the suggestions change to reflect the enabled
                    // state in the buttons state.
                    for (const command of [
                        CommandIDs.previousInline,
                        CommandIDs.nextInline,
                        CommandIDs.acceptInline
                    ]) {
                        app.commands.notifyCommandChanged(command);
                    }
                });
                return inlineCompleter;
            }
        };
    }
};
const inlineCompleter = {
    id: INLINE_COMPLETER_PLUGIN,
    description: 'Registers the inline completer factory; adds inline completer commands, shortcuts and settings.',
    requires: [
        completer_lib_index_js_.ICompletionProviderManager,
        completer_lib_index_js_.IInlineCompleterFactory,
        settingregistry_lib_index_js_.ISettingRegistry
    ],
    optional: [translation_lib_index_js_.ITranslator],
    autoStart: true,
    activate: (app, completionManager, factory, settings, translator) => {
        completionManager.setInlineCompleterFactory(factory);
        const trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const isEnabled = () => !!app.shell.currentWidget && !!completionManager.inline;
        let inlineCompleterSettings;
        app.commands.addCommand(CommandIDs.nextInline, {
            execute: () => {
                var _a;
                (_a = completionManager.inline) === null || _a === void 0 ? void 0 : _a.cycle(app.shell.currentWidget.id, 'next');
            },
            label: trans.__('Next Inline Completion'),
            isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        app.commands.addCommand(CommandIDs.previousInline, {
            execute: () => {
                var _a;
                (_a = completionManager.inline) === null || _a === void 0 ? void 0 : _a.cycle(app.shell.currentWidget.id, 'previous');
            },
            label: trans.__('Previous Inline Completion'),
            isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        app.commands.addCommand(CommandIDs.acceptInline, {
            execute: () => {
                var _a;
                (_a = completionManager.inline) === null || _a === void 0 ? void 0 : _a.accept(app.shell.currentWidget.id);
            },
            label: trans.__('Accept Inline Completion'),
            isEnabled: () => {
                return (isEnabled() &&
                    completionManager.inline.isActive(app.shell.currentWidget.id));
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        app.commands.addCommand(CommandIDs.invokeInline, {
            execute: () => {
                var _a;
                (_a = completionManager.inline) === null || _a === void 0 ? void 0 : _a.invoke(app.shell.currentWidget.id);
            },
            label: trans.__('Invoke Inline Completer'),
            isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        const updateSettings = (settings) => {
            var _a;
            inlineCompleterSettings =
                settings.composite;
            (_a = completionManager.inline) === null || _a === void 0 ? void 0 : _a.configure(inlineCompleterSettings);
        };
        app.restored
            .then(() => {
            var _a;
            const availableProviders = (_a = completionManager.inlineProviders) !== null && _a !== void 0 ? _a : [];
            const composeDefaults = (provider) => {
                var _a, _b;
                return {
                    // By default all providers are opt-out, but
                    // any provider can configure itself to be opt-in.
                    enabled: true,
                    autoFillInMiddle: false,
                    timeout: 5000,
                    debouncerDelay: 0,
                    ...((_b = (_a = provider.schema) === null || _a === void 0 ? void 0 : _a.default) !== null && _b !== void 0 ? _b : {})
                };
            };
            settings.transform(INLINE_COMPLETER_PLUGIN, {
                compose: plugin => {
                    var _a, _b;
                    const providers = (_a = plugin.data.composite['providers']) !== null && _a !== void 0 ? _a : {};
                    for (const provider of availableProviders) {
                        const defaults = composeDefaults(provider);
                        providers[provider.identifier] = {
                            ...defaults,
                            ...((_b = providers[provider.identifier]) !== null && _b !== void 0 ? _b : {})
                        };
                    }
                    // Add fallback defaults in composite settings values
                    plugin.data['composite']['providers'] = providers;
                    return plugin;
                },
                fetch: plugin => {
                    var _a, _b;
                    const schema = plugin.schema.properties;
                    const providersSchema = {};
                    for (const provider of availableProviders) {
                        providersSchema[provider.identifier] = {
                            title: trans.__('%1 provider', provider.name),
                            properties: {
                                ...((_b = (_a = provider.schema) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {}),
                                timeout: {
                                    title: trans.__('Timeout'),
                                    description: trans.__('Timeout for %1 provider (in milliseconds).', provider.name),
                                    type: 'number',
                                    minimum: 0
                                },
                                debouncerDelay: {
                                    title: trans.__('Debouncer delay'),
                                    minimum: 0,
                                    description: trans.__('Time since the last key press to wait before requesting completions from %1 provider (in milliseconds).', provider.name),
                                    type: 'number'
                                },
                                enabled: {
                                    title: trans.__('Enabled'),
                                    description: trans.__('Whether to fetch completions %1 provider.', provider.name),
                                    type: 'boolean'
                                },
                                autoFillInMiddle: {
                                    title: trans.__('Fill in middle on typing'),
                                    description: trans.__('Whether to show completions in the middle of the code line from %1 provider on typing.', provider.name),
                                    type: 'boolean'
                                }
                            },
                            default: composeDefaults(provider),
                            type: 'object'
                        };
                    }
                    // Populate schema for providers settings
                    schema['providers']['properties'] = providersSchema;
                    return plugin;
                }
            });
            const settingsPromise = settings.load(INLINE_COMPLETER_PLUGIN);
            settingsPromise
                .then(settingValues => {
                updateSettings(settingValues);
                settingValues.changed.connect(newSettings => {
                    updateSettings(newSettings);
                });
            })
                .catch(console.error);
        })
            .catch(console.error);
        const findKeybinding = (commandID) => {
            return app.commands.keyBindings.find(binding => binding.command === commandID);
        };
        const keyBindings = {
            [CommandIDs.acceptInline]: findKeybinding(CommandIDs.acceptInline),
            [CommandIDs.invokeInline]: findKeybinding(CommandIDs.invokeInline)
        };
        app.commands.keyBindingChanged.connect((_emitter, change) => {
            const command = change.binding.command;
            if (keyBindings.hasOwnProperty(command)) {
                keyBindings[command] =
                    findKeybinding(command);
            }
        });
        const evtKeydown = (event) => {
            // Handle bindings to `Tab` key specially
            if (!(event.target instanceof Element)) {
                return;
            }
            const target = event.target;
            switch (event.keyCode) {
                case 9: {
                    // Tab key
                    const potentialTabBindings = [
                        // Note: `accept` should come ahead of `invoke` due to specificity
                        keyBindings[CommandIDs.acceptInline],
                        keyBindings[CommandIDs.invokeInline]
                    ];
                    for (const binding of potentialTabBindings) {
                        if (binding &&
                            binding.keys.length === 1 &&
                            binding.keys[0] === 'Tab' &&
                            target.closest(binding.selector) &&
                            app.commands.isEnabled(binding.command)) {
                            const tabCompleterActive = target.closest('.' + index_js_.COMPLETER_ACTIVE_CLASS);
                            if ((inlineCompleterSettings === null || inlineCompleterSettings === void 0 ? void 0 : inlineCompleterSettings.suppressIfTabCompleterActive) &&
                                tabCompleterActive) {
                                return;
                            }
                            app.commands.execute(binding.command).catch(console.error);
                            event.preventDefault();
                            event.stopPropagation();
                            event.stopImmediatePropagation();
                            return;
                        }
                    }
                    break;
                }
                default:
                    return;
            }
        };
        document.addEventListener('keydown', evtKeydown, true);
    }
};
const manager = {
    id: COMPLETION_MANAGER_PLUGIN,
    description: 'Provides the completion provider manager.',
    requires: [settingregistry_lib_index_js_.ISettingRegistry],
    optional: [lib_index_js_.IFormRendererRegistry],
    provides: completer_lib_index_js_.ICompletionProviderManager,
    autoStart: true,
    activate: (app, settings, editorRegistry) => {
        const AVAILABLE_PROVIDERS = 'availableProviders';
        const manager = new completer_lib_index_js_.CompletionProviderManager();
        const updateSetting = (settingValues, availableProviders) => {
            var _a;
            const providersData = settingValues.get(AVAILABLE_PROVIDERS);
            const composite = settingValues.composite;
            manager.setTimeout(composite.providerTimeout);
            manager.setShowDocumentationPanel(composite.showDocumentationPanel);
            manager.setContinuousHinting(composite.autoCompletion);
            manager.setSuppressIfInlineCompleterActive(composite.suppressIfInlineCompleterActive);
            const selectedProviders = (_a = providersData.user) !== null && _a !== void 0 ? _a : providersData.composite;
            const sortedProviders = Object.entries(selectedProviders !== null && selectedProviders !== void 0 ? selectedProviders : {})
                .filter(val => val[1] >= 0 && availableProviders.includes(val[0]))
                .sort(([, rank1], [, rank2]) => rank2 - rank1)
                .map(item => item[0]);
            manager.activateProvider(sortedProviders);
        };
        app.restored
            .then(() => {
            const availableProviders = [...manager.getProviders().entries()];
            const availableProviderIDs = availableProviders.map(([key, value]) => key);
            settings.transform(COMPLETION_MANAGER_PLUGIN, {
                fetch: plugin => {
                    const schema = plugin.schema.properties;
                    const defaultValue = {};
                    availableProviders.forEach(([key, value], index) => {
                        var _a;
                        defaultValue[key] = (_a = value.rank) !== null && _a !== void 0 ? _a : (index + 1) * 10;
                    });
                    schema[AVAILABLE_PROVIDERS]['default'] = defaultValue;
                    return plugin;
                }
            });
            const settingsPromise = settings.load(COMPLETION_MANAGER_PLUGIN);
            settingsPromise
                .then(settingValues => {
                updateSetting(settingValues, availableProviderIDs);
                settingValues.changed.connect(newSettings => {
                    updateSetting(newSettings, availableProviderIDs);
                });
            })
                .catch(console.error);
        })
            .catch(console.error);
        if (editorRegistry) {
            const renderer = {
                fieldRenderer: (props) => {
                    return renderAvailableProviders(props);
                }
            };
            editorRegistry.addRenderer(`${COMPLETION_MANAGER_PLUGIN}.availableProviders`, renderer);
        }
        return manager;
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    manager,
    defaultProviders,
    inlineHistoryProvider,
    inlineCompleterFactory,
    inlineCompleter
];
/* harmony default export */ const lib = (plugins);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 24017:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_codeeditor_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7526);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_completer_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76576);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 53583:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CONTEXT_PROVIDER_ID: () => (/* reexport */ CONTEXT_PROVIDER_ID),
  Completer: () => (/* reexport */ Completer),
  CompleterModel: () => (/* reexport */ CompleterModel),
  CompletionHandler: () => (/* reexport */ CompletionHandler),
  CompletionProviderManager: () => (/* reexport */ CompletionProviderManager),
  CompletionTriggerKind: () => (/* reexport */ CompletionTriggerKind),
  ContextCompleterProvider: () => (/* reexport */ ContextCompleterProvider),
  HistoryInlineCompletionProvider: () => (/* reexport */ HistoryInlineCompletionProvider),
  ICompletionProviderManager: () => (/* reexport */ ICompletionProviderManager),
  IInlineCompleterFactory: () => (/* reexport */ IInlineCompleterFactory),
  InlineCompleter: () => (/* reexport */ InlineCompleter),
  InlineCompletionTriggerKind: () => (/* reexport */ InlineCompletionTriggerKind),
  KERNEL_PROVIDER_ID: () => (/* reexport */ KERNEL_PROVIDER_ID),
  KernelCompleterProvider: () => (/* reexport */ KernelCompleterProvider),
  ProviderReconciliator: () => (/* reexport */ ProviderReconciliator),
  completerWidgetIcon: () => (/* reexport */ completerWidgetIcon),
  inlineCompleterIcon: () => (/* reexport */ inlineCompleterIcon)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The type of completion request.
 */
var CompletionTriggerKind;
(function (CompletionTriggerKind) {
    CompletionTriggerKind[CompletionTriggerKind["Invoked"] = 1] = "Invoked";
    CompletionTriggerKind[CompletionTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter";
    CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions";
})(CompletionTriggerKind || (CompletionTriggerKind = {}));
/**
 * Describes how an inline completion provider was triggered.
 * @alpha
 */
var InlineCompletionTriggerKind;
(function (InlineCompletionTriggerKind) {
    /**
     * Completion was triggered explicitly by a user gesture.
     * Return multiple completion items to enable cycling through them.
     */
    InlineCompletionTriggerKind[InlineCompletionTriggerKind["Invoke"] = 0] = "Invoke";
    /**
     * Completion was triggered automatically while editing.
     * It is sufficient to return a single completion item in this case.
     */
    InlineCompletionTriggerKind[InlineCompletionTriggerKind["Automatic"] = 1] = "Automatic";
})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
/**
 * Token allowing to override (or disable) inline completer widget factory.
 */
const IInlineCompleterFactory = new dist_index_js_.Token('@jupyterlab/completer:IInlineCompleterFactory', 'A factory of inline completer widgets.');
/**
 * The exported token used to register new provider.
 */
const ICompletionProviderManager = new dist_index_js_.Token('@jupyterlab/completer:ICompletionProviderManager', 'A service for the completion providers management.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/handler.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * A completion handler for editors.
 */
class CompletionHandler {
    /**
     * Construct a new completion handler for a widget.
     */
    constructor(options) {
        this._fetchingInline = 0;
        this._editor = null;
        this._enabled = false;
        this._isDisposed = false;
        this._autoCompletion = false;
        this._continuousInline = true;
        this._tabCompleterActive = false;
        this.completer = options.completer;
        this.inlineCompleter = options.inlineCompleter;
        this.completer.selected.connect(this.onCompletionSelected, this);
        this.completer.visibilityChanged.connect(this.onVisibilityChanged, this);
        this._reconciliator = options.reconciliator;
    }
    set reconciliator(reconciliator) {
        this._reconciliator = reconciliator;
    }
    /**
     * The editor used by the completion handler.
     */
    get editor() {
        return this._editor;
    }
    set editor(newValue) {
        if (newValue === this._editor) {
            return;
        }
        let editor = this._editor;
        // Clean up and disconnect from old editor.
        if (editor && !editor.isDisposed) {
            const model = editor.model;
            editor.host.classList.remove(index_js_.COMPLETER_ENABLED_CLASS);
            editor.host.classList.remove(index_js_.COMPLETER_ACTIVE_CLASS);
            model.selections.changed.disconnect(this.onSelectionsChanged, this);
            model.sharedModel.changed.disconnect(this._onSharedModelChanged, this);
        }
        // Reset completer state.
        this.completer.reset();
        this.completer.editor = newValue;
        // Update the editor and signal connections.
        editor = this._editor = newValue;
        if (editor) {
            const model = editor.model;
            this._enabled = false;
            model.selections.changed.connect(this.onSelectionsChanged, this);
            // We expect the model to be an editor, a file editor, or a cell.
            const sharedModel = model.sharedModel;
            // For cells and files the `changed` signal is not limited to text,
            // but also fires on changes to metadata, outputs, execution count,
            // and state changes, hence we need to filter the change type.
            sharedModel.changed.connect(this._onSharedModelChanged, this);
            // On initial load, manually check the cursor position.
            this.onSelectionsChanged();
            if (this.inlineCompleter) {
                this.inlineCompleter.editor = editor;
            }
        }
    }
    /**
     * Get whether the completion handler is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Enable/disable continuous hinting mode.
     */
    set autoCompletion(value) {
        this._autoCompletion = value;
    }
    get autoCompletion() {
        return this._autoCompletion;
    }
    /**
     * Dispose of the resources used by the handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Invoke the inline completer on explicit user request.
     */
    invokeInline() {
        const editor = this._editor;
        if (editor) {
            this._makeInlineRequest(editor.getCursorPosition(), InlineCompletionTriggerKind.Invoke).catch(reason => {
                console.warn('Inline invoke request bailed', reason);
            });
        }
    }
    /**
     * Invoke the handler and launch a completer.
     */
    invoke() {
        index_es6_js_.MessageLoop.sendMessage(this, CompletionHandler.Msg.InvokeRequest);
    }
    /**
     * Process a message sent to the completion handler.
     */
    processMessage(msg) {
        switch (msg.type) {
            case CompletionHandler.Msg.InvokeRequest.type:
                this.onInvokeRequest(msg);
                break;
            default:
                break;
        }
    }
    /**
     * Get the state of the text editor at the given position.
     */
    getState(editor, position) {
        return {
            text: editor.model.sharedModel.getSource(),
            line: position.line,
            column: position.column
        };
    }
    /**
     * Handle a completion selected signal from the completion widget.
     */
    onCompletionSelected(completer, val) {
        const model = completer.model;
        const editor = this._editor;
        if (!editor || !model) {
            return;
        }
        const patch = model.createPatch(val);
        if (!patch) {
            return;
        }
        const { start, end, value } = patch;
        const cursorBeforeChange = editor.getOffsetAt(editor.getCursorPosition());
        // Update the document and the cursor position in the same transaction
        // to ensure consistency in listeners to document changes.
        // Note: it also ensures a single change is stored by the undo manager.
        const transactions = {
            changes: { from: start, to: end, insert: value }
        };
        if (cursorBeforeChange <= end && cursorBeforeChange >= start) {
            transactions.selection = { anchor: start + value.length };
        }
        editor.editor.dispatch(transactions);
    }
    /**
     * Handle `invoke-request` messages.
     */
    onInvokeRequest(msg) {
        // If there is no completer model, bail.
        if (!this.completer.model) {
            return;
        }
        // If a completer session is already active, bail.
        if (this.completer.model.original) {
            return;
        }
        const editor = this._editor;
        if (editor) {
            this._makeRequest(editor.getCursorPosition(), CompletionTriggerKind.Invoked).catch(reason => {
                console.warn('Invoke request bailed', reason);
            });
        }
    }
    /**
     * Handle selection changed signal from an editor.
     *
     * #### Notes
     * If a sub-class reimplements this method, then that class must either call
     * its super method or it must take responsibility for adding and removing
     * the completer completable class to the editor host node.
     *
     * Despite the fact that the editor widget adds a class whenever there is a
     * primary selection, this method checks independently for two reasons:
     *
     * 1. The editor widget connects to the same signal to add that class, so
     *    there is no guarantee that the class will be added before this method
     *    is invoked so simply checking for the CSS class's existence is not an
     *    option. Secondarily, checking the editor state should be faster than
     *    querying the DOM in either case.
     * 2. Because this method adds a class that indicates whether completer
     *    functionality ought to be enabled, relying on the behavior of the
     *    `jp-mod-has-primary-selection` to filter out any editors that have
     *    a selection means the semantic meaning of `jp-mod-completer-enabled`
     *    is obscured because there may be cases where the enabled class is added
     *    even though the completer is not available.
     */
    onSelectionsChanged() {
        var _a;
        const model = this.completer.model;
        const editor = this._editor;
        if (!editor) {
            return;
        }
        const inlineModel = (_a = this.inlineCompleter) === null || _a === void 0 ? void 0 : _a.model;
        if (inlineModel) {
            // Dispatch selection change.
            inlineModel.handleSelectionChange(editor.getSelection());
        }
        const host = editor.host;
        // If there is no model, return.
        if (!model) {
            this._enabled = false;
            host.classList.remove(index_js_.COMPLETER_ENABLED_CLASS);
            return;
        }
        // If we are currently performing a subset match,
        // return without resetting the completer.
        if (model.subsetMatch) {
            return;
        }
        const position = editor.getCursorPosition();
        const line = editor.getLine(position.line);
        const { start, end } = editor.getSelection();
        // If there is a text selection, return.
        if (start.column !== end.column || start.line !== end.line) {
            this._enabled = false;
            model.reset(true);
            host.classList.remove(index_js_.COMPLETER_ENABLED_CLASS);
            return;
        }
        // If line is empty or the cursor doesn't have any characters before
        // it besides whitespace, add line beginning class
        // so that completer can stay enabled, but tab
        // in codemirror can still be triggered.
        if (!line || end.column === 0) {
            host.classList.add(index_js_.COMPLETER_LINE_BEGINNING_CLASS);
        }
        else if (line && line.slice(0, position.column).match(/^\s*$/)) {
            host.classList.add(index_js_.COMPLETER_LINE_BEGINNING_CLASS);
        }
        else {
            host.classList.remove(index_js_.COMPLETER_LINE_BEGINNING_CLASS);
        }
        // Enable completion.
        if (!this._enabled) {
            this._enabled = true;
            host.classList.add(index_js_.COMPLETER_ENABLED_CLASS);
        }
        // Dispatch the cursor change.
        model.handleCursorChange(this.getState(editor, editor.getCursorPosition()));
    }
    /**
     * Handle a text changed signal from an editor.
     */
    async onTextChanged(str, changed) {
        var _a;
        if (!this._enabled) {
            return;
        }
        const model = this.completer.model;
        const editor = this.editor;
        if (!editor) {
            return;
        }
        if (model &&
            this._autoCompletion &&
            this._reconciliator.shouldShowContinuousHint &&
            (await this._reconciliator.shouldShowContinuousHint(this.completer.isVisible, changed))) {
            void this._makeRequest(editor.getCursorPosition(), CompletionTriggerKind.TriggerCharacter);
        }
        const inlineModel = (_a = this.inlineCompleter) === null || _a === void 0 ? void 0 : _a.model;
        if (inlineModel) {
            // Dispatch the text change to inline completer
            // (this happens before request is sent)
            inlineModel.handleTextChange(changed);
            if (this._continuousInline) {
                void this._makeInlineRequest(editor.getCursorPosition(), InlineCompletionTriggerKind.Automatic);
            }
        }
        if (model) {
            // If there is a text selection, no completion is allowed.
            const { start, end } = editor.getSelection();
            if (start.column !== end.column || start.line !== end.line) {
                return;
            }
            // Dispatch the text change.
            model.handleTextChange(this.getState(editor, editor.getCursorPosition()));
        }
    }
    /**
     * Handle a visibility change signal from a completer widget.
     */
    onVisibilityChanged(completer) {
        var _a;
        // Completer is not active.
        if (completer.isDisposed || completer.isHidden) {
            this._tabCompleterActive = false;
            if (this._editor) {
                this._editor.host.classList.remove(index_js_.COMPLETER_ACTIVE_CLASS);
                this._editor.focus();
            }
            return;
        }
        // Completer is active.
        this._tabCompleterActive = true;
        (_a = this._editor) === null || _a === void 0 ? void 0 : _a.host.classList.add(index_js_.COMPLETER_ACTIVE_CLASS);
    }
    /**
     * Handle a text shared model change signal from an editor.
     */
    async _onSharedModelChanged(str, changed) {
        if (changed.sourceChange) {
            await this.onTextChanged(str, changed);
        }
    }
    /**
     * Make a completion request.
     */
    _makeRequest(position, trigger) {
        const editor = this.editor;
        if (!editor) {
            return Promise.reject(new Error('No active editor'));
        }
        const request = this._composeRequest(editor, position);
        const state = this.getState(editor, position);
        return this._reconciliator
            .fetch(request, trigger)
            .then(reply => {
            var _a;
            if (!reply) {
                return;
            }
            const model = this._updateModel(state, reply.start, reply.end);
            if (!model) {
                return;
            }
            if (this.completer.suppressIfInlineCompleterActive &&
                ((_a = this.inlineCompleter) === null || _a === void 0 ? void 0 : _a.isActive)) {
                return;
            }
            if (model.setCompletionItems) {
                model.setCompletionItems(reply.items);
            }
        })
            .catch(p => {
            /* Fails silently. */
        });
    }
    async _makeInlineRequest(position, trigger) {
        const editor = this.editor;
        if (!editor) {
            return Promise.reject(new Error('No active editor'));
        }
        if (!this.inlineCompleter) {
            return Promise.reject(new Error('No inline completer'));
        }
        const line = editor.getLine(position.line);
        if (trigger === InlineCompletionTriggerKind.Automatic &&
            (typeof line === 'undefined' ||
                line.slice(0, position.column).match(/^\s*$/))) {
            // In Automatic mode we only auto-trigger on the end of line (and not on the beginning).
            // Increase the counter to avoid out-of date replies when pressing Backspace quickly.
            this._fetchingInline += 1;
            return;
        }
        let isMiddleOfLine = false;
        if (typeof line !== 'undefined' && position.column < line.length) {
            isMiddleOfLine = true;
        }
        const request = this._composeRequest(editor, position);
        const model = this.inlineCompleter.model;
        if (!model) {
            return;
        }
        model.cursor = position;
        const current = ++this._fetchingInline;
        const promises = this._reconciliator.fetchInline(request, trigger, isMiddleOfLine);
        let cancelled = false;
        const completed = new Set();
        for (const promise of promises) {
            promise
                .then(result => {
                var _a;
                if (cancelled || !result || !result.items) {
                    return;
                }
                if (current !== this._fetchingInline) {
                    return;
                }
                completed.add(promise);
                if (completed.size === 1) {
                    if (((_a = this.inlineCompleter) === null || _a === void 0 ? void 0 : _a.suppressIfTabCompleterActive) &&
                        this._tabCompleterActive) {
                        cancelled = true;
                        return;
                    }
                    model.setCompletions(result);
                }
                else {
                    model.appendCompletions(result);
                }
            })
                .catch(e => {
                // Emit warning for debugging.
                console.warn(e);
            })
                .finally(() => {
                // Mark the provider promise as completed.
                completed.add(promise);
                // Let the model know that we are awaiting for fewer providers now.
                const remaining = promises.length - completed.size;
                model.notifyProgress({
                    pendingProviders: remaining,
                    totalProviders: promises.length
                });
            });
        }
    }
    _composeRequest(editor, position) {
        const text = editor.model.sharedModel.getSource();
        const mimeType = editor.model.mimeType;
        const offset = lib_index_js_.Text.jsIndexToCharIndex(editor.getOffsetAt(position), text);
        return { text, offset, mimeType };
    }
    /**
     * Updates model with text state and current cursor position.
     */
    _updateModel(state, start, end) {
        const model = this.completer.model;
        const text = state.text;
        if (!model) {
            return null;
        }
        // Update the original request.
        model.original = state;
        // Update the cursor.
        model.cursor = {
            start: lib_index_js_.Text.charIndexToJsIndex(start, text),
            end: lib_index_js_.Text.charIndexToJsIndex(end, text)
        };
        return model;
    }
}
/**
 * A namespace for cell completion handler statics.
 */
(function (CompletionHandler) {
    /**
     * Stream event type.
     */
    let StraemEvent;
    (function (StraemEvent) {
        StraemEvent[StraemEvent["opened"] = 0] = "opened";
        StraemEvent[StraemEvent["update"] = 1] = "update";
        StraemEvent[StraemEvent["closed"] = 2] = "closed";
    })(StraemEvent = CompletionHandler.StraemEvent || (CompletionHandler.StraemEvent = {}));
    /**
     * A namespace for completion handler messages.
     */
    let Msg;
    (function (Msg) {
        /**
         * A singleton `'invoke-request'` message.
         */
        Msg.InvokeRequest = new index_es6_js_.Message('invoke-request');
    })(Msg = CompletionHandler.Msg || (CompletionHandler.Msg = {}));
})(CompletionHandler || (CompletionHandler = {}));
//# sourceMappingURL=handler.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Escape HTML by native means of the browser.
 */
function escapeHTML(text) {
    const node = document.createElement('span');
    node.textContent = text;
    return node.innerHTML;
}
/**
 * An implementation of a completer model.
 */
class CompleterModel {
    constructor() {
        this.processedItemsCache = null;
        this._current = null;
        this._cursor = null;
        this._isDisposed = false;
        this._completionItems = [];
        this._original = null;
        this._query = '';
        this._subsetMatch = false;
        this._typeMap = {};
        this._orderedTypes = [];
        this._stateChanged = new dist_index_es6_js_.Signal(this);
        this._queryChanged = new dist_index_es6_js_.Signal(this);
        /**
         * The weak map between a processed completion item with the original item.
         * It's used to keep track of original completion item in case of displaying
         * the completer with query.
         */
        this._processedToOriginalItem = null;
        /**
         * A counter to cancel ongoing `resolveItem` call.
         */
        this._resolvingItem = 0;
    }
    /**
     * A signal emitted when state of the completer menu changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * A signal emitted when query string changes (at invocation, or as user types).
     */
    get queryChanged() {
        return this._queryChanged;
    }
    /**
     * The original completion request details.
     */
    get original() {
        return this._original;
    }
    set original(newValue) {
        const unchanged = this._original === newValue ||
            (this._original &&
                newValue &&
                dist_index_js_.JSONExt.deepEqual(newValue, this._original));
        if (unchanged) {
            return;
        }
        this._reset();
        // Set both the current and original to the same value when original is set.
        this._current = this._original = newValue;
        this._stateChanged.emit(undefined);
    }
    /**
     * The current text change details.
     */
    get current() {
        return this._current;
    }
    set current(newValue) {
        const unchanged = this._current === newValue ||
            (this._current && newValue && dist_index_js_.JSONExt.deepEqual(newValue, this._current));
        if (unchanged) {
            return;
        }
        const original = this._original;
        // Original request must always be set before a text change. If it isn't
        // the model fails silently.
        if (!original) {
            return;
        }
        const cursor = this._cursor;
        // Cursor must always be set before a text change. This happens
        // automatically in the completer handler, but since `current` is a public
        // attribute, this defensive check is necessary.
        if (!cursor) {
            return;
        }
        const current = (this._current = newValue);
        if (!current) {
            this._stateChanged.emit(undefined);
            return;
        }
        const originalLine = original.text.split('\n')[original.line];
        const currentLine = current.text.split('\n')[current.line];
        // If the text change means that the original start point has been preceded,
        // then the completion is no longer valid and should be reset.
        if (!this._subsetMatch && currentLine.length < originalLine.length) {
            this.reset(true);
            return;
        }
        const { start, end } = cursor;
        // Clip the front of the current line.
        let query = current.text.substring(start);
        // Clip the back of the current line by calculating the end of the original.
        const ending = original.text.substring(end);
        query = query.substring(0, query.lastIndexOf(ending));
        this._query = query;
        this.processedItemsCache = null;
        this._processedToOriginalItem = null;
        this._queryChanged.emit({ newValue: this._query, origin: 'editorUpdate' });
        this._stateChanged.emit(undefined);
    }
    /**
     * The cursor details that the API has used to return matching options.
     */
    get cursor() {
        return this._cursor;
    }
    set cursor(newValue) {
        // Original request must always be set before a cursor change. If it isn't
        // the model fails silently.
        if (!this.original) {
            return;
        }
        this._cursor = newValue;
    }
    /**
     * The query against which items are filtered.
     */
    get query() {
        return this._query;
    }
    set query(newValue) {
        this._query = newValue;
        this.processedItemsCache = null;
        this._processedToOriginalItem = null;
        this._queryChanged.emit({ newValue: this._query, origin: 'setter' });
    }
    /**
     * A flag that is true when the model value was modified by a subset match.
     */
    get subsetMatch() {
        return this._subsetMatch;
    }
    set subsetMatch(newValue) {
        this._subsetMatch = newValue;
    }
    /**
     * Get whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the model.
     */
    dispose() {
        // Do nothing if already disposed.
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * The list of visible items in the completer menu.
     *
     * #### Notes
     * This is a read-only property.
     * When overriding it is recommended to cache results in `processedItemsCache`
     * property which will be automatically nullified when needed.
     */
    completionItems() {
        if (!this.processedItemsCache) {
            let query = this._query;
            if (query) {
                const markedItems = this._markup(query);
                this.processedItemsCache = markedItems.map(it => it.processedItem);
                this._processedToOriginalItem = new WeakMap(markedItems.map(it => [it.processedItem, it.originalItem]));
            }
            else {
                this.processedItemsCache = this._completionItems.map(item => {
                    return this._escapeItemLabel(item);
                });
                this._processedToOriginalItem = null;
            }
        }
        return this.processedItemsCache;
    }
    /**
     * Set the list of visible items in the completer menu, and append any
     * new types to KNOWN_TYPES.
     */
    setCompletionItems(newValue) {
        if (dist_index_js_.JSONExt.deepEqual(newValue, this._completionItems)) {
            return;
        }
        this._completionItems = newValue;
        this._orderedTypes = Private.findOrderedCompletionItemTypes(this._completionItems);
        this.processedItemsCache = null;
        this._processedToOriginalItem = null;
        this._stateChanged.emit(undefined);
    }
    /**
     * The map from identifiers (a.b) to types (function, module, class, instance,
     * etc.).
     *
     * #### Notes
     * A type map is currently only provided by the latest IPython kernel using
     * the completer reply metadata field `_jupyter_types_experimental`. The
     * values are completely up to the kernel.
     *
     */
    typeMap() {
        return this._typeMap;
    }
    /**
     * An ordered list of all the known types in the typeMap.
     *
     * #### Notes
     * To visually encode the types of the completer matches, we assemble an
     * ordered list. This list begins with:
     * ```
     * ['function', 'instance', 'class', 'module', 'keyword']
     * ```
     * and then has any remaining types listed alphabetically. This will give
     * reliable visual encoding for these known types, but allow kernels to
     * provide new types.
     */
    orderedTypes() {
        return this._orderedTypes;
    }
    /**
     * Handle a cursor change.
     */
    handleCursorChange(change) {
        // If there is no active completion, return.
        if (!this._original) {
            return;
        }
        const { column, line } = change;
        const { current, original } = this;
        if (!original) {
            return;
        }
        // If a cursor change results in a the cursor being on a different line
        // than the original request, cancel.
        if (line !== original.line) {
            this.reset(true);
            return;
        }
        // If a cursor change results in the cursor being set to a position that
        // precedes the original column, cancel.
        if (column < original.column) {
            this.reset(true);
            return;
        }
        const { cursor } = this;
        if (!cursor || !current) {
            return;
        }
        // If a cursor change results in the cursor being set to a position beyond
        // the end of the area that would be affected by completion, cancel.
        const cursorDelta = cursor.end - cursor.start;
        const originalLine = original.text.split('\n')[original.line];
        const currentLine = current.text.split('\n')[current.line];
        const inputDelta = currentLine.length - originalLine.length;
        if (column > original.column + cursorDelta + inputDelta) {
            this.reset(true);
            return;
        }
    }
    /**
     * Handle a text change.
     */
    handleTextChange(change) {
        const original = this._original;
        // If there is no active completion, return.
        if (!original) {
            return;
        }
        const { text, column, line } = change;
        const last = text.split('\n')[line][column - 1];
        // If last character entered is not whitespace or if the change column is
        // greater than or equal to the original column, update completion.
        if ((last && last.match(/\S/)) || change.column >= original.column) {
            this.current = change;
            return;
        }
        // If final character is whitespace, reset completion.
        this.reset(false);
    }
    /**
     * Create a resolved patch between the original state and a patch string.
     *
     * @param patch - The patch string to apply to the original value.
     *
     * @returns A patched text change or undefined if original value did not exist.
     */
    createPatch(patch) {
        const original = this._original;
        const cursor = this._cursor;
        const current = this._current;
        if (!original || !cursor || !current) {
            return undefined;
        }
        let { start, end } = cursor;
        // Also include any filtering/additional-typing that has occurred
        // since the completion request in the patched length.
        end = end + (current.text.length - original.text.length);
        return { start, end, value: patch };
    }
    /**
     * Reset the state of the model and emit a state change signal.
     *
     * @param hard - Reset even if a subset match is in progress.
     */
    reset(hard = false) {
        // When the completer detects a common subset prefix for all options,
        // it updates the model and sets the model source to that value, triggering
        // a reset. Unless explicitly a hard reset, this should be ignored.
        if (!hard && this._subsetMatch) {
            return;
        }
        this._reset();
        this._stateChanged.emit(undefined);
    }
    /**
     * Check if CompletionItem matches against query.
     * Highlight matching prefix by adding <mark> tags.
     */
    _markup(query) {
        var _a;
        const items = this._completionItems;
        let results = [];
        for (const originalItem of items) {
            // See if label matches query string
            // With ICompletionItems, the label may include parameters,
            // so we exclude them from the matcher.
            // e.g. Given label `foo(b, a, r)` and query `bar`,
            // don't count parameters, `b`, `a`, and `r` as matches.
            const index = originalItem.label.indexOf('(');
            const text = index > -1
                ? originalItem.label.substring(0, index)
                : originalItem.label;
            const match = algorithm_dist_index_es6_js_.StringExt.matchSumOfSquares(escapeHTML(text), query);
            // Filter non-matching items.
            if (match) {
                // Highlight label text if there's a match
                let marked = algorithm_dist_index_es6_js_.StringExt.highlight(escapeHTML(originalItem.label), match.indices, Private.mark);
                // Use `Object.assign` to evaluate getters.
                const highlightedItem = Object.assign({}, originalItem);
                highlightedItem.label = marked.join('');
                highlightedItem.insertText =
                    (_a = originalItem.insertText) !== null && _a !== void 0 ? _a : originalItem.label;
                results.push({
                    item: highlightedItem,
                    score: match.score,
                    originalItem
                });
            }
        }
        results.sort(Private.scoreCmp);
        // Extract only the item (dropping the extra score attribute to not leak
        // implementation details to JavaScript callers.
        return results.map(match => ({
            processedItem: match.item,
            originalItem: match.originalItem
        }));
    }
    /**
     * Lazy load missing data of an item.
     * @param indexOrValue - the item or its index
     * @remarks
     * Resolving item by index will be deprecated in
     * the JupyterLab 5.0 and removed in JupyterLab 6.0.
     *
     * @return Return `undefined` if the completion item with `activeIndex` index can not be found.
     *  Return a promise of `null` if another `resolveItem` is called. Otherwise return the
     * promise of resolved completion item.
     */
    resolveItem(indexOrValue) {
        let processedItem;
        if (typeof indexOrValue === 'number') {
            const completionItems = this.completionItems();
            if (!completionItems || !completionItems[indexOrValue]) {
                return undefined;
            }
            processedItem = completionItems[indexOrValue];
        }
        else {
            processedItem = indexOrValue;
        }
        if (!processedItem) {
            return undefined;
        }
        let originalItem;
        if (this._processedToOriginalItem) {
            originalItem = this._processedToOriginalItem.get(processedItem);
        }
        else {
            originalItem = processedItem;
        }
        if (!originalItem) {
            return undefined;
        }
        return this._resolveItemByValue(originalItem);
    }
    /**
     * Lazy load missing data of a completion item.
     *
     * @param  completionItem - the item to be resolved
     * @return See `resolveItem` method
     */
    _resolveItemByValue(completionItem) {
        const current = ++this._resolvingItem;
        let resolvedItem;
        if (completionItem.resolve) {
            let patch;
            if (completionItem.insertText) {
                patch = this.createPatch(completionItem.insertText);
            }
            resolvedItem = completionItem.resolve(patch);
        }
        else {
            resolvedItem = Promise.resolve(completionItem);
        }
        return resolvedItem
            .then(activeItem => {
            // Escape the label it in place
            this._escapeItemLabel(activeItem, true);
            Object.keys(activeItem).forEach((key) => {
                completionItem[key] = activeItem[key];
            });
            completionItem.resolve = undefined;
            if (current !== this._resolvingItem) {
                return Promise.resolve(null);
            }
            return activeItem;
        })
            .catch(e => {
            console.error(e);
            // Failed to resolve missing data, return the original item.
            return Promise.resolve(completionItem);
        });
    }
    /**
     * Escape item label, storing the original label and adding `insertText` if needed.
     * If escaping changes label creates a new item unless `inplace` is true.
     */
    _escapeItemLabel(item, inplace = false) {
        var _a;
        const escapedLabel = escapeHTML(item.label);
        // If there was no insert text, use the original (unescaped) label.
        if (escapedLabel !== item.label) {
            const newItem = inplace ? item : Object.assign({}, item);
            newItem.insertText = (_a = item.insertText) !== null && _a !== void 0 ? _a : item.label;
            newItem.label = escapedLabel;
            return newItem;
        }
        return item;
    }
    /**
     * Reset the state of the model.
     */
    _reset() {
        const hadQuery = this._query;
        this._current = null;
        this._cursor = null;
        this._completionItems = [];
        this._original = null;
        this._query = '';
        this.processedItemsCache = null;
        this._processedToOriginalItem = null;
        this._subsetMatch = false;
        this._typeMap = {};
        this._orderedTypes = [];
        if (hadQuery) {
            this._queryChanged.emit({ newValue: this._query, origin: 'reset' });
        }
    }
}
/**
 * A namespace for completer model private data.
 */
var Private;
(function (Private) {
    /**
     * The list of known type annotations of completer matches.
     */
    const KNOWN_TYPES = ['function', 'instance', 'class', 'module', 'keyword'];
    /**
     * The map of known type annotations of completer matches.
     */
    const KNOWN_MAP = KNOWN_TYPES.reduce((acc, type) => {
        acc[type] = null;
        return acc;
    }, {});
    /**
     * Mark a highlighted chunk of text.
     */
    function mark(value) {
        return `<mark>${value}</mark>`;
    }
    Private.mark = mark;
    /**
     * A sort comparison function for item match scores.
     *
     * #### Notes
     * This orders the items first based on score (lower is better), then
     * by locale order of the item text.
     */
    function scoreCmp(a, b) {
        var _a, _b, _c;
        const delta = a.score - b.score;
        if (delta !== 0) {
            return delta;
        }
        return (_c = (_a = a.item.insertText) === null || _a === void 0 ? void 0 : _a.localeCompare((_b = b.item.insertText) !== null && _b !== void 0 ? _b : '')) !== null && _c !== void 0 ? _c : 0;
    }
    Private.scoreCmp = scoreCmp;
    /**
     * Compute a reliably ordered list of types for ICompletionItems.
     *
     * #### Notes
     * The resulting list always begins with the known types:
     * ```
     * ['function', 'instance', 'class', 'module', 'keyword']
     * ```
     * followed by other types in alphabetical order.
     *
     */
    function findOrderedCompletionItemTypes(items) {
        const newTypeSet = new Set();
        items.forEach(item => {
            if (item.type &&
                !KNOWN_TYPES.includes(item.type) &&
                !newTypeSet.has(item.type)) {
                newTypeSet.add(item.type);
            }
        });
        const newTypes = Array.from(newTypeSet);
        newTypes.sort((a, b) => a.localeCompare(b));
        return KNOWN_TYPES.concat(newTypes);
    }
    Private.findOrderedCompletionItemTypes = findOrderedCompletionItemTypes;
    /**
     * Compute a reliably ordered list of types.
     *
     * #### Notes
     * The resulting list always begins with the known types:
     * ```
     * ['function', 'instance', 'class', 'module', 'keyword']
     * ```
     * followed by other types in alphabetical order.
     */
    function findOrderedTypes(typeMap) {
        const filtered = Object.keys(typeMap)
            .map(key => typeMap[key])
            .filter((value) => !!value && !(value in KNOWN_MAP))
            .sort((a, b) => a.localeCompare(b));
        return KNOWN_TYPES.concat(filtered);
    }
    Private.findOrderedTypes = findOrderedTypes;
})(Private || (Private = {}));
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var domutils_dist_index_es6_js_ = __webpack_require__(19451);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * The class name added to completer menu items.
 */
const ITEM_CLASS = 'jp-Completer-item';
/**
 * The class name added to an active completer menu item.
 */
const ACTIVE_CLASS = 'jp-mod-active';
/**
 * The class used by item listing which determines the height of the completer.
 */
const LIST_CLASS = 'jp-Completer-list';
/**
 * Class of the documentation panel.
 */
const DOC_PANEL_CLASS = 'jp-Completer-docpanel';
/**
 * A flag to indicate that event handlers are caught in the capture phase.
 */
const USE_CAPTURE = true;
/**
 * The number of colors defined for the completer type annotations.
 * These are listed in completer/style/index.css#102-152.
 */
const N_COLORS = 10;
/**
 * A widget that enables text completion.
 *
 * #### Notes
 * The completer is intended to be absolutely positioned on the
 * page and hover over any other content, so it should be attached directly
 * to `document.body`, or a node that is the full size of `document.body`.
 * Attaching it to other nodes may incorrectly locate the completer.
 */
class Completer extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a text completer menu widget.
     */
    constructor(options) {
        var _a, _b, _c, _d;
        super({ node: document.createElement('div') });
        this._activeIndex = 0;
        this._editor = null;
        this._model = null;
        this._selected = new dist_index_es6_js_.Signal(this);
        this._visibilityChanged = new dist_index_es6_js_.Signal(this);
        this._indexChanged = new dist_index_es6_js_.Signal(this);
        this._lastSubsetMatch = '';
        this._geometryLock = false;
        /**
         * Increasing this counter invalidates previous request to save geometry cache in animation callback.
         */
        this._geometryCounter = 0;
        this._docPanelExpanded = false;
        this._renderCounter = 0;
        this.sanitizer = (_a = options.sanitizer) !== null && _a !== void 0 ? _a : new apputils_lib_index_js_.Sanitizer();
        this._defaultRenderer = Completer.getDefaultRenderer(this.sanitizer);
        this._renderer = (_b = options.renderer) !== null && _b !== void 0 ? _b : this._defaultRenderer;
        this._docPanel = this._createDocPanelNode();
        this.model = (_c = options.model) !== null && _c !== void 0 ? _c : null;
        this.editor = (_d = options.editor) !== null && _d !== void 0 ? _d : null;
        this.addClass('jp-Completer');
        this.addClass('jp-ThemedContainer');
        this._updateConstraints();
    }
    /**
     * Cache style constraints from CSS.
     */
    _updateConstraints() {
        const tempNode = document.createElement('div');
        tempNode.classList.add(LIST_CLASS);
        tempNode.style.visibility = 'hidden';
        tempNode.style.overflowY = 'scroll';
        document.body.appendChild(tempNode);
        const computedStyle = window.getComputedStyle(tempNode);
        this._maxHeight = parseInt(computedStyle.maxHeight, 10);
        this._minHeight = parseInt(computedStyle.minHeight, 10);
        this._scrollbarWidth = tempNode.offsetWidth - tempNode.clientWidth;
        document.body.removeChild(tempNode);
        const tempDocPanel = this._createDocPanelNode();
        this._docPanelWidth = widget_Private.measureSize(tempDocPanel, 'inline-block').width;
    }
    /**
     * The active index.
     */
    get activeIndex() {
        return this._activeIndex;
    }
    /**
     * The editor used by the completion widget.
     */
    get editor() {
        return this._editor;
    }
    set editor(newValue) {
        this._editor = newValue;
    }
    /**
     * A signal emitted when a selection is made from the completer menu.
     */
    get selected() {
        return this._selected;
    }
    /**
     * A signal emitted when the completer widget's visibility changes.
     *
     * #### Notes
     * This signal is useful when there are multiple floating widgets that may
     * contend with the same space and ought to be mutually exclusive.
     */
    get visibilityChanged() {
        return this._visibilityChanged;
    }
    /**
     * A signal emitted when the active index changes.
     */
    get indexChanged() {
        return this._indexChanged;
    }
    /**
     * The model used by the completer widget.
     */
    get model() {
        return this._model;
    }
    set model(model) {
        if ((!model && !this._model) || model === this._model) {
            return;
        }
        if (this._model) {
            this._model.stateChanged.disconnect(this.onModelStateChanged, this);
            this._model.queryChanged.disconnect(this.onModelQueryChanged, this);
        }
        this._model = model;
        if (this._model) {
            this._model.stateChanged.connect(this.onModelStateChanged, this);
            this._model.queryChanged.connect(this.onModelQueryChanged, this);
        }
    }
    /**
     * The completer used by the completer widget.
     */
    get renderer() {
        return this._renderer;
    }
    set renderer(renderer) {
        this._renderer = renderer;
    }
    /**
     * Enable/disable the document panel.
     */
    set showDocsPanel(showDoc) {
        this._showDoc = showDoc;
    }
    get showDocsPanel() {
        return this._showDoc;
    }
    /**
     * Dispose of the resources held by the completer widget.
     */
    dispose() {
        this._sizeCache = undefined;
        this._model = null;
        super.dispose();
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the dock panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        if (this.isHidden || !this._editor) {
            return;
        }
        switch (event.type) {
            case 'keydown':
                this._evtKeydown(event);
                break;
            case 'pointerdown':
                this._evtPointerdown(event);
                break;
            case 'scroll':
                this._evtScroll(event);
                break;
            default:
                break;
        }
    }
    /**
     * Reset the widget.
     */
    reset() {
        this._activeIndex = 0;
        this._lastSubsetMatch = '';
        if (this._model) {
            this._model.reset(true);
        }
        this._docPanel.style.display = 'none';
        // Clear size cache.
        this._sizeCache = undefined;
        this.node.scrollTop = 0;
    }
    /**
     * Emit the selected signal for the current active item and reset.
     */
    selectActive() {
        const active = this.node.querySelector(`.${ACTIVE_CLASS}`);
        if (!active) {
            this.reset();
            return;
        }
        this._selected.emit(active.getAttribute('data-value'));
        this.reset();
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        document.addEventListener('keydown', this, USE_CAPTURE);
        document.addEventListener('pointerdown', this, USE_CAPTURE);
        document.addEventListener('scroll', this, USE_CAPTURE);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        document.removeEventListener('keydown', this, USE_CAPTURE);
        document.removeEventListener('pointerdown', this, USE_CAPTURE);
        document.removeEventListener('scroll', this, USE_CAPTURE);
    }
    /**
     * Handle model state changes.
     */
    onModelStateChanged() {
        if (this.isAttached) {
            this._activeIndex = 0;
            this._indexChanged.emit(this._activeIndex);
            this.update();
        }
    }
    /**
     * Handle model query changes.
     */
    onModelQueryChanged(model, queryChange) {
        // If query was changed by the user typing, the filtered down items
        // may no longer reach/exceed the maxHeight of the completer widget,
        // hence size needs to be recalculated.
        if (this._sizeCache && queryChange.origin === 'editorUpdate') {
            const newItems = model.completionItems();
            const oldItems = this._sizeCache.items;
            // Only reset size if the number of items changed, or the longest item changed.
            const oldWidest = oldItems[this._findWidestItemIndex(oldItems)];
            const newWidest = newItems[this._findWidestItemIndex(newItems)];
            const heuristic = this._getPreferredItemWidthHeuristic();
            if (newItems.length !== this._sizeCache.items.length ||
                heuristic(oldWidest) !== heuristic(newWidest)) {
                this._sizeCache = undefined;
            }
        }
    }
    /**
     * Handle `update-request` messages.
     */
    onUpdateRequest(msg) {
        var _a;
        const model = this._model;
        if (!model) {
            return;
        }
        // If this is the first time the current completer session has loaded,
        // populate any initial subset match. This is being done before node
        // gets rendered to avoid rendering it twice.
        if (!model.query) {
            this._populateSubset();
        }
        let items = model.completionItems();
        // If there are no items, reset and bail.
        if (!items.length) {
            if (!this.isHidden) {
                this.reset();
                this.hide();
                this._visibilityChanged.emit(undefined);
            }
            return;
        }
        // Update constraints before any DOM modifications
        this._updateConstraints();
        // Do not trigger any geometry updates from async code when in lock.
        this._geometryLock = true;
        const node = this._createCompleterNode(model, items);
        let active = node.querySelectorAll(`.${ITEM_CLASS}`)[this._activeIndex];
        active.classList.add(ACTIVE_CLASS);
        const resolvedItem = (_a = this.model) === null || _a === void 0 ? void 0 : _a.resolveItem(items[this._activeIndex]);
        // Add the documentation panel
        if (this._showDoc) {
            this._docPanel.innerText = '';
            node.appendChild(this._docPanel);
            this._docPanelExpanded = false;
            this._docPanel.style.display = 'none';
            this._updateDocPanel(resolvedItem, active);
        }
        if (this.isHidden) {
            this.show();
            this._setGeometry();
            this._visibilityChanged.emit(undefined);
        }
        else {
            this._setGeometry();
        }
        this._geometryLock = false;
    }
    /**
     * Get cached dimensions of the completer box.
     */
    get sizeCache() {
        if (!this._sizeCache) {
            return;
        }
        return {
            width: this._sizeCache.width + this._sizeCache.docPanelWidth,
            height: Math.max(this._sizeCache.height, this._sizeCache.docPanelHeight)
        };
    }
    _createDocPanelNode() {
        const docPanel = document.createElement('div');
        docPanel.className = DOC_PANEL_CLASS;
        return docPanel;
    }
    _createCompleterNode(model, items) {
        const current = ++this._renderCounter;
        // Clear the node.
        let node = this.node;
        node.textContent = '';
        // Compute an ordered list of all the types in the typeMap, this is computed
        // once by the model each time new data arrives for efficiency.
        let orderedTypes = model.orderedTypes();
        // Populate the completer items.
        let ul = document.createElement('ul');
        ul.className = LIST_CLASS;
        // Add first N items to fill the first "page" assuming that the completer
        // would reach its maximum allowed height.
        const first = this._renderer.createCompletionItemNode(items[0], orderedTypes);
        const renderedItems = [first];
        const firstItemSize = widget_Private.measureSize(first, 'inline-grid');
        const pageSize = Math.max(Math.ceil(this._maxHeight / firstItemSize.height), 5);
        // We add one item in case if height heuristic is inaccurate.
        const toRenderImmediately = Math.min(pageSize + 1, items.length);
        const start = performance.now();
        for (let i = 1; i < toRenderImmediately; i++) {
            const li = this._renderer.createCompletionItemNode(items[i], orderedTypes);
            renderedItems.push(li);
        }
        for (const li of renderedItems) {
            ul.appendChild(li);
        }
        // Pre-calculate size:
        //  - height will equal first element height times number of items,
        //    or maximum allowed height if there are more items than fit on a page,
        //  - width will be estimated from the widest item.
        const widestItemIndex = this._findWidestItemIndex(items);
        const widestItem = widestItemIndex < renderedItems.length
            ? renderedItems[widestItemIndex]
            : this._renderer.createCompletionItemNode(items[widestItemIndex], orderedTypes);
        // The node needs to be cloned to avoid side-effect of detaching it.
        const widestItemSize = widget_Private.measureSize(widestItem.cloneNode(true), 'inline-grid');
        this._sizeCache = {
            height: Math.min(this._maxHeight, firstItemSize.height * items.length),
            width: widestItemSize.width + this._scrollbarWidth,
            items: items,
            docPanelWidth: 0,
            docPanelHeight: 0
        };
        if (toRenderImmediately < items.length) {
            // Render remaining items on idle in subsequent animation frames,
            // in chunks of size such that each frame would take about 16ms
            // allowing for 4ms of overhead, but keep the chunks no smaller
            // than 5 items at a time.
            const timePerItem = (performance.now() - start) / toRenderImmediately;
            const chunkSize = Math.max(5, Math.floor(12 / timePerItem));
            let alreadyRendered = toRenderImmediately;
            let previousChunkFinal = renderedItems[renderedItems.length - 1];
            const renderChunk = () => {
                if (alreadyRendered >= items.length) {
                    return;
                }
                // Add a filler so that the list with partially rendered items has the total
                // height equal to the (predicted) final height to avoid scrollbar jitter.
                const predictedMissingHeight = firstItemSize.height * (items.length - alreadyRendered);
                previousChunkFinal.style.marginBottom = `${predictedMissingHeight}px`;
                requestAnimationFrame(() => {
                    if (current != this._renderCounter) {
                        // Bail if rendering afresh was requested in the meantime.
                        return;
                    }
                    previousChunkFinal.style.marginBottom = '';
                    const limit = Math.min(items.length, alreadyRendered + chunkSize);
                    for (let i = alreadyRendered; i < limit; i++) {
                        const li = this._renderer.createCompletionItemNode(items[i], orderedTypes);
                        ul.appendChild(li);
                        previousChunkFinal = li;
                    }
                    alreadyRendered = limit;
                    renderChunk();
                });
            };
            renderChunk();
        }
        node.appendChild(ul);
        return node;
    }
    /**
     * Use preferred heuristic to find the index of the widest item.
     */
    _findWidestItemIndex(items) {
        const widthHeuristic = this._getPreferredItemWidthHeuristic();
        const widthHeuristics = items.map(widthHeuristic);
        return widthHeuristics.indexOf(Math.max(...widthHeuristics));
    }
    /**
     * Get item width heuristic function from renderer if available,
     * or the default one otherwise.
     */
    _getPreferredItemWidthHeuristic() {
        return this._renderer.itemWidthHeuristic
            ? this._renderer.itemWidthHeuristic.bind(this._renderer)
            : this._defaultRenderer.itemWidthHeuristic.bind(this._defaultRenderer);
    }
    /**
     * Cycle through the available completer items.
     *
     * #### Notes
     * When the user cycles all the way `down` to the last index, subsequent
     * `down` cycles will cycle to the first index. When the user cycles `up` to
     * the first item, subsequent `up` cycles will cycle to the last index.
     */
    _cycle(direction) {
        var _a, _b;
        const items = this.node.querySelectorAll(`.${ITEM_CLASS}`);
        const index = this._activeIndex;
        const last = items.length - 1;
        let active = this.node.querySelector(`.${ACTIVE_CLASS}`);
        active.classList.remove(ACTIVE_CLASS);
        switch (direction) {
            case 'up':
                this._activeIndex = index === 0 ? last : index - 1;
                break;
            case 'down':
                this._activeIndex = index < last ? index + 1 : 0;
                break;
            case 'pageUp':
            case 'pageDown': {
                // Measure the number of items on a page and clamp to the list length.
                const container = this.node.getBoundingClientRect();
                const current = active.getBoundingClientRect();
                const page = Math.floor(container.height / current.height);
                const sign = direction === 'pageUp' ? -1 : 1;
                this._activeIndex = Math.min(Math.max(0, index + sign * page), last);
                break;
            }
        }
        active = items[this._activeIndex];
        active.classList.add(ACTIVE_CLASS);
        let completionList = this.node.querySelector(`.${LIST_CLASS}`);
        domutils_dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(completionList, active);
        this._indexChanged.emit(this._activeIndex);
        const visibleCompletionItems = (_a = this.model) === null || _a === void 0 ? void 0 : _a.completionItems();
        const activeCompletionItem = visibleCompletionItems === null || visibleCompletionItems === void 0 ? void 0 : visibleCompletionItems[this._activeIndex];
        if (activeCompletionItem) {
            const resolvedItem = (_b = this.model) === null || _b === void 0 ? void 0 : _b.resolveItem(activeCompletionItem);
            if (this._showDoc) {
                this._updateDocPanel(resolvedItem, active);
            }
        }
    }
    /**
     * Handle keydown events for the widget.
     */
    _evtKeydown(event) {
        if (this.isHidden || !this._editor) {
            return;
        }
        if (!this._editor.host.contains(event.target)) {
            this.reset();
            return;
        }
        switch (event.keyCode) {
            case 9: {
                // Tab key
                event.preventDefault();
                event.stopPropagation();
                event.stopImmediatePropagation();
                const model = this._model;
                if (!model) {
                    return;
                }
                // Autoinsert single completions on manual request (tab)
                const items = model.completionItems();
                if (items && items.length === 1) {
                    this._selected.emit(items[0].insertText || items[0].label);
                    this.reset();
                    return;
                }
                const populated = this._populateSubset();
                // If the common subset was found and set on `query`,
                // or if there is a `query` in the initialization options,
                // then emit a completion signal with that `query` (=subset match),
                // but only if the query has actually changed.
                // See: https://github.com/jupyterlab/jupyterlab/issues/10439#issuecomment-875189540
                if (model.query && model.query !== this._lastSubsetMatch) {
                    model.subsetMatch = true;
                    this._selected.emit(model.query);
                    model.subsetMatch = false;
                    this._lastSubsetMatch = model.query;
                }
                // If the query changed, update rendering of the options.
                if (populated) {
                    this.update();
                }
                this._cycle(event.shiftKey ? 'up' : 'down');
                return;
            }
            case 27: // Esc key
                event.preventDefault();
                event.stopPropagation();
                event.stopImmediatePropagation();
                this.reset();
                return;
            case 33: // PageUp
            case 34: // PageDown
            case 38: // Up arrow key
            case 40: {
                // Down arrow key
                event.preventDefault();
                event.stopPropagation();
                event.stopImmediatePropagation();
                const cycle = widget_Private.keyCodeMap[event.keyCode];
                this._cycle(cycle);
                return;
            }
            default:
                return;
        }
    }
    /**
     * Handle mousedown events for the widget.
     */
    _evtPointerdown(event) {
        if (this.isHidden || !this._editor) {
            return;
        }
        if (widget_Private.nonstandardClick(event)) {
            this.reset();
            return;
        }
        let target = event.target;
        while (target !== document.documentElement) {
            // If the user has made a selection, emit its value and reset the widget.
            if (target.classList.contains(ITEM_CLASS)) {
                event.preventDefault();
                event.stopPropagation();
                event.stopImmediatePropagation();
                this._selected.emit(target.getAttribute('data-value'));
                this.reset();
                return;
            }
            // If the mouse event happened anywhere else in the widget, bail.
            if (target === this.node) {
                event.preventDefault();
                event.stopPropagation();
                event.stopImmediatePropagation();
                return;
            }
            target = target.parentElement;
        }
        this.reset();
    }
    /**
     * Handle scroll events for the widget
     */
    _evtScroll(event) {
        if (this.isHidden || !this._editor) {
            return;
        }
        const { node } = this;
        // All scrolls except scrolls in the actual hover box node may cause the
        // referent editor that anchors the node to move, so the only scroll events
        // that can safely be ignored are ones that happen inside the hovering node.
        if (node.contains(event.target)) {
            return;
        }
        // Set the geometry of the node asynchronously.
        requestAnimationFrame(() => {
            this._setGeometry();
        });
    }
    /**
     * Populate the completer up to the longest initial subset of items.
     *
     * @returns `true` if a subset match was found and populated.
     */
    _populateSubset() {
        const { model } = this;
        if (!model) {
            return false;
        }
        const items = model.completionItems();
        const subset = widget_Private.commonSubset(items.map(item => item.insertText || item.label));
        const { query } = model;
        // If a common subset exists and it is not the current query, highlight it.
        if (subset && subset !== query && subset.indexOf(query) === 0) {
            model.query = subset;
            return true;
        }
        return false;
    }
    /**
     * Set the visible dimensions of the widget.
     */
    _setGeometry() {
        const { node } = this;
        const model = this._model;
        const editor = this._editor;
        // This is an overly defensive test: `cursor` will always exist if
        // `original` exists, except in contrived tests. But since it is possible
        // to generate a runtime error, the check occurs here.
        if (!editor || !model || !model.original || !model.cursor) {
            return;
        }
        const start = model.cursor.start;
        const position = editor.getPositionAt(start);
        const anchor = editor.getCoordinateForPosition(position);
        if (!anchor) {
            return;
        }
        const style = window.getComputedStyle(node);
        const borderLeft = parseInt(style.borderLeftWidth, 10) || 0;
        const paddingLeft = parseInt(style.paddingLeft, 10) || 0;
        // When the editor is attached to the main area, contain the completer hover box
        // to the full area available (rather than to the editor itself); the available
        // area excludes the toolbar, hence the first Widget child between MainAreaWidget
        // and editor is preferred. The difference is negligible in File Editor, but
        // substantial for Notebooks.
        const host = editor.host.closest('.jp-MainAreaWidget > .lm-Widget') ||
            editor.host;
        const items = model.completionItems();
        // Fast cache invalidation (only checks for length rather than length + width)
        if (this._sizeCache && this._sizeCache.items.length !== items.length) {
            this._sizeCache = undefined;
        }
        // Calculate the geometry of the completer.
        ui_components_lib_index_js_.HoverBox.setGeometry({
            anchor,
            host: host,
            maxHeight: this._maxHeight,
            minHeight: this._minHeight,
            node: node,
            size: this.sizeCache,
            offset: { horizontal: borderLeft + paddingLeft },
            privilege: 'below',
            style: style,
            outOfViewDisplay: {
                top: 'stick-inside',
                bottom: 'stick-inside',
                left: 'stick-inside',
                right: 'stick-outside'
            }
        });
        const current = ++this._geometryCounter;
        if (!this._sizeCache) {
            // If size was not pre-calculated using heuristics, save the actual
            // size into cache once rendered.
            requestAnimationFrame(() => {
                if (current != this._geometryCounter) {
                    // Do not set size to cache if it may already be outdated.
                    return;
                }
                let rect = node.getBoundingClientRect();
                let panel = this._docPanel.getBoundingClientRect();
                this._sizeCache = {
                    width: rect.width - panel.width,
                    height: rect.height,
                    items: items,
                    docPanelWidth: panel.width,
                    docPanelHeight: panel.height
                };
            });
        }
    }
    /**
     * Update the display-state and contents of the documentation panel
     */
    _updateDocPanel(resolvedItem, activeNode) {
        var _a, _b, _c;
        let docPanel = this._docPanel;
        if (!resolvedItem) {
            this._toggleDocPanel(false);
            return;
        }
        const loadingIndicator = (_c = (_b = (_a = this._renderer).createLoadingDocsIndicator) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : this._defaultRenderer.createLoadingDocsIndicator();
        activeNode.appendChild(loadingIndicator);
        resolvedItem
            .then(activeItem => {
            var _a, _b, _c;
            if (!activeItem) {
                return;
            }
            if (!docPanel) {
                return;
            }
            if (activeItem.documentation) {
                const node = (_c = (_b = (_a = this._renderer).createDocumentationNode) === null || _b === void 0 ? void 0 : _b.call(_a, activeItem)) !== null && _c !== void 0 ? _c : this._defaultRenderer.createDocumentationNode(activeItem);
                docPanel.textContent = '';
                docPanel.appendChild(node);
                this._toggleDocPanel(true);
            }
            else {
                this._toggleDocPanel(false);
            }
        })
            .catch(e => console.error(e))
            .finally(() => {
            activeNode.removeChild(loadingIndicator);
        });
    }
    _toggleDocPanel(show) {
        let docPanel = this._docPanel;
        if (show) {
            if (this._docPanelExpanded) {
                return;
            }
            docPanel.style.display = '';
            this._docPanelExpanded = true;
        }
        else {
            if (!this._docPanelExpanded) {
                return;
            }
            docPanel.style.display = 'none';
            this._docPanelExpanded = false;
        }
        const sizeCache = this._sizeCache;
        if (sizeCache) {
            sizeCache.docPanelHeight = show ? this._maxHeight : 0;
            sizeCache.docPanelWidth = show ? this._docPanelWidth : 0;
            if (!this._geometryLock) {
                this._setGeometry();
            }
        }
    }
}
(function (Completer) {
    /**
     * The default implementation of an `IRenderer`.
     */
    class Renderer {
        constructor(options) {
            this.sanitizer = (options === null || options === void 0 ? void 0 : options.sanitizer) || new apputils_lib_index_js_.Sanitizer();
        }
        /**
         * Create an item node from an ICompletionItem for a text completer menu.
         */
        createCompletionItemNode(item, orderedTypes) {
            let wrapperNode = this._createWrapperNode(item.insertText || item.label);
            if (item.deprecated) {
                wrapperNode.classList.add('jp-Completer-deprecated');
            }
            return this._constructNode(wrapperNode, this._createLabelNode(item.label), !!item.type, item.type, orderedTypes, item.icon);
        }
        /**
         * Create a documentation node for documentation panel.
         */
        createDocumentationNode(activeItem) {
            const host = document.createElement('div');
            host.classList.add('jp-RenderedText');
            const sanitizer = this.sanitizer;
            const source = activeItem.documentation || '';
            (0,rendermime_lib_index_js_.renderText)({ host, sanitizer, source }).catch(console.error);
            return host;
        }
        /**
         * Get a heuristic for the width of an item.
         */
        itemWidthHeuristic(item) {
            var _a;
            // Get the label text without HTML markup (`<mark>` is the only markup
            // that is allowed in processed items, everything else gets escaped).
            const labelText = item.label.replace(/<(\/)?mark>/g, '');
            return labelText.length + (((_a = item.type) === null || _a === void 0 ? void 0 : _a.length) || 0);
        }
        /**
         * Create a loading bar for the documentation panel.
         */
        createLoadingDocsIndicator() {
            const loadingContainer = document.createElement('div');
            loadingContainer.classList.add('jp-Completer-loading-bar-container');
            const loadingBar = document.createElement('div');
            loadingBar.classList.add('jp-Completer-loading-bar');
            loadingContainer.append(loadingBar);
            return loadingContainer;
        }
        /**
         * Create base node with the value to be inserted.
         */
        _createWrapperNode(value) {
            const li = document.createElement('li');
            li.className = ITEM_CLASS;
            // Set the raw, un-marked up value as a data attribute.
            li.setAttribute('data-value', value);
            return li;
        }
        /**
         * Create match node to highlight potential prefix match within result.
         */
        _createLabelNode(result) {
            const matchNode = document.createElement('code');
            matchNode.className = 'jp-Completer-match';
            // Use innerHTML because search results include <mark> tags.
            matchNode.innerHTML = result;
            return matchNode;
        }
        /**
         * Attaches type and match nodes to base node.
         */
        _constructNode(li, matchNode, typesExist, type, orderedTypes, icon) {
            // Add the icon or type monogram
            if (icon) {
                const iconNode = icon.element({
                    className: 'jp-Completer-type jp-Completer-icon'
                });
                li.appendChild(iconNode);
            }
            else if (typesExist) {
                const typeNode = document.createElement('span');
                typeNode.textContent = (type[0] || '').toLowerCase();
                const colorIndex = (orderedTypes.indexOf(type) % N_COLORS) + 1;
                typeNode.className = 'jp-Completer-type jp-Completer-monogram';
                typeNode.setAttribute(`data-color-index`, colorIndex.toString());
                li.appendChild(typeNode);
            }
            else {
                // Create empty span to ensure consistent list styling.
                // Otherwise, in a list of two items,
                // if one item has an icon, but the other has type,
                // the icon grows out of its bounds.
                const dummyNode = document.createElement('span');
                dummyNode.className = 'jp-Completer-monogram';
                li.appendChild(dummyNode);
            }
            li.appendChild(matchNode);
            // If there is a type, add the type extension and title
            if (typesExist) {
                li.title = type;
                const typeExtendedNode = document.createElement('code');
                typeExtendedNode.className = 'jp-Completer-typeExtended';
                typeExtendedNode.textContent = type.toLocaleLowerCase();
                li.appendChild(typeExtendedNode);
            }
            else {
                // If no type is present on the right,
                // the highlighting of the completion item
                // doesn't cover the entire row.
                const dummyTypeExtendedNode = document.createElement('span');
                dummyTypeExtendedNode.className = 'jp-Completer-typeExtended';
                li.appendChild(dummyTypeExtendedNode);
            }
            return li;
        }
    }
    Completer.Renderer = Renderer;
    /**
     * Default renderer
     */
    let _defaultRenderer;
    /**
     * The default `IRenderer` instance.
     */
    function getDefaultRenderer(sanitizer) {
        if (!_defaultRenderer ||
            (sanitizer && _defaultRenderer.sanitizer !== sanitizer)) {
            _defaultRenderer = new Renderer({ sanitizer: sanitizer });
        }
        return _defaultRenderer;
    }
    Completer.getDefaultRenderer = getDefaultRenderer;
})(Completer || (Completer = {}));
/**
 * A namespace for completer widget private data.
 */
var widget_Private;
(function (Private) {
    /**
     * Mapping from keyCodes to scrollTypes.
     */
    Private.keyCodeMap = {
        38: 'up',
        40: 'down',
        33: 'pageUp',
        34: 'pageDown'
    };
    /**
     * Returns the common subset string that a list of strings shares.
     */
    function commonSubset(values) {
        const len = values.length;
        let subset = '';
        if (len < 2) {
            return subset;
        }
        const strlen = values[0].length;
        for (let i = 0; i < strlen; i++) {
            const ch = values[0][i];
            for (let j = 1; j < len; j++) {
                if (values[j][i] !== ch) {
                    return subset;
                }
            }
            subset += ch;
        }
        return subset;
    }
    Private.commonSubset = commonSubset;
    /**
     * Returns true for any modified click event (i.e., not a left-click).
     */
    function nonstandardClick(event) {
        return (event.button !== 0 ||
            event.altKey ||
            event.ctrlKey ||
            event.shiftKey ||
            event.metaKey);
    }
    Private.nonstandardClick = nonstandardClick;
    /**
     * Measure size of provided HTML element without painting it.
     *
     * #### Notes
     * The provided element has to be detached (not connected to DOM),
     * or a side-effect of detaching it will occur.
     */
    function measureSize(element, display) {
        if (element.isConnected) {
            console.warn('Measuring connected elements with `measureSize` has side-effects');
        }
        element.style.visibility = 'hidden';
        element.style.display = display;
        document.body.appendChild(element);
        const size = element.getBoundingClientRect();
        document.body.removeChild(element);
        element.removeAttribute('style');
        return size;
    }
    Private.measureSize = measureSize;
})(widget_Private || (widget_Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/utils.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * Determines whether the given MIME type is suitable for code completion.
 *
 * @param mimeType - The MIME type of the current editor context.
 * @returns `true` if the MIME type supports code completion; otherwise, `false`.
 */
function isHintableMimeType(mimeType) {
    const excludedMimeTypes = new Set([
        'text/plain',
        'text/markdown',
        'text/x-ipythongfm',
        'text/x-rst',
        'text/latex',
        'application/json',
        'text/html',
        'text/css'
    ]);
    return !excludedMimeTypes.has(mimeType);
}
//# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/reconciliator.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * The reconciliator which is used to fetch and merge responses from multiple completion providers.
 */
class ProviderReconciliator {
    /**
     * Creates an instance of ProviderReconciliator.
     */
    constructor(options) {
        var _a, _b;
        this._resolveFactory = (provider, el) => provider.resolve
            ? (patch) => provider.resolve(el, this._context, patch)
            : undefined;
        /**
         * Counter to reject current provider response if a new fetch request is created.
         */
        this._fetching = 0;
        /**
         * Counter to reject current inline provider response if a new `inlineFetch` request is created.
         */
        this._inlineFetching = 0;
        this._providers = options.providers;
        this._inlineProviders = (_a = options.inlineProviders) !== null && _a !== void 0 ? _a : [];
        this._inlineProvidersSettings = (_b = options.inlineProvidersSettings) !== null && _b !== void 0 ? _b : {};
        this._context = options.context;
        this._timeout = options.timeout;
    }
    /**
     * Check for the providers which are applicable with the current context
     *
     * @return  List of applicable providers
     */
    async applicableProviders() {
        const isApplicablePromises = this._providers.map(p => p.isApplicable(this._context));
        const applicableProviders = await Promise.all(isApplicablePromises);
        return this._providers.filter((_, idx) => applicableProviders[idx]);
    }
    fetchInline(request, trigger, isMiddleOfLine) {
        let promises = [];
        const current = ++this._inlineFetching;
        for (const provider of this._inlineProviders) {
            const settings = this._inlineProvidersSettings[provider.identifier];
            if (trigger !== InlineCompletionTriggerKind.Invoke &&
                isMiddleOfLine &&
                !settings.autoFillInMiddle) {
                // Skip if FIM is disabled
                continue;
            }
            let delay = 0;
            if (trigger === InlineCompletionTriggerKind.Automatic) {
                delay = settings.debouncerDelay;
            }
            const fetch = () => {
                const promise = provider
                    .fetch(request, { ...this._context, triggerKind: trigger })
                    .then(completionList => {
                    return {
                        ...completionList,
                        items: completionList.items.map(item => {
                            const newItem = item;
                            newItem.stream = new dist_index_es6_js_.Signal(newItem);
                            newItem.provider = provider;
                            void this._stream(newItem, provider);
                            return newItem;
                        })
                    };
                });
                const timeoutPromise = new Promise(resolve => {
                    return setTimeout(() => resolve(null), delay + settings.timeout);
                });
                return Promise.race([promise, timeoutPromise]);
            };
            const promise = delay === 0
                ? fetch()
                : new Promise((resolve, reject) => {
                    return setTimeout(() => {
                        if (current != this._inlineFetching) {
                            // User pressed another key or explicitly requested completions since.
                            return reject(null);
                        }
                        else {
                            return resolve(fetch());
                        }
                    }, delay);
                });
            // Wrap promise and return error in case of failure.
            promises.push(promise.catch(p => p));
        }
        return promises;
    }
    async _stream(item, provider) {
        if (!item.isIncomplete || !provider.stream || !item.token) {
            return;
        }
        const streamed = item.stream;
        const token = item.token;
        item.token = undefined;
        // Notify that streaming started.
        item.streaming = true;
        streamed.emit(CompletionHandler.StraemEvent.opened);
        for await (const reply of provider.stream(token)) {
            const updated = reply.response;
            const addition = updated.insertText.substring(item.insertText.length);
            // Stream an update.
            item.insertText = updated.insertText;
            item.lastStreamed = addition;
            item.error = reply.response.error;
            streamed.emit(CompletionHandler.StraemEvent.update);
        }
        // Notify that streaming is no longer in progress.
        item.isIncomplete = false;
        item.lastStreamed = undefined;
        item.streaming = false;
        streamed.emit(CompletionHandler.StraemEvent.closed);
    }
    /**
     * Fetch response from multiple providers, If a provider can not return
     * the response for a completer request before timeout,
     * the result of this provider will be ignored.
     *
     * @param {CompletionHandler.IRequest} request - The completion request.
     */
    async fetch(request, trigger) {
        const current = ++this._fetching;
        let promises = [];
        const applicableProviders = await this.applicableProviders();
        for (const provider of applicableProviders) {
            let promise;
            promise = provider.fetch(request, this._context, trigger).then(reply => {
                if (current !== this._fetching) {
                    return Promise.reject(void 0);
                }
                const items = reply.items.map(el => ({
                    ...el,
                    resolve: this._resolveFactory(provider, el)
                }));
                return { ...reply, items };
            });
            const timeoutPromise = new Promise(resolve => {
                return setTimeout(() => resolve(null), this._timeout);
            });
            promise = Promise.race([promise, timeoutPromise]);
            // Wrap promise and return error in case of failure.
            promises.push(promise.catch(p => p));
        }
        // TODO: maybe use `Promise.allSettled` once library is at es2020 instead of adding a catch.
        const combinedPromise = Promise.all(promises);
        return this._mergeCompletions(combinedPromise);
    }
    /**
     * Check if completer should make request to fetch completion responses
     * on user typing. If the provider with highest rank does not have
     * `shouldShowContinuousHint` method, a default one will be used.
     *
     * @param completerIsVisible - The visible status of completer widget.
     * @param changed - CodeMirror changed argument.
     */
    async shouldShowContinuousHint(completerIsVisible, changed) {
        const applicableProviders = await this.applicableProviders();
        if (applicableProviders.length === 0) {
            return false;
        }
        if (applicableProviders[0].shouldShowContinuousHint) {
            return applicableProviders[0].shouldShowContinuousHint(completerIsVisible, changed, this._context);
        }
        return this._defaultShouldShowContinuousHint(completerIsVisible, changed);
    }
    _alignPrefixes(replies, minStart, maxStart) {
        if (minStart != maxStart) {
            const editor = this._context.editor;
            if (!editor) {
                return replies;
            }
            const cursor = editor.getCursorPosition();
            const line = editor.getLine(cursor.line);
            if (!line) {
                return replies;
            }
            const lineOffset = editor.getOffsetAt({ line: cursor.line, column: 0 });
            return replies.map(reply => {
                const prefixStart = Math.max(reply.start - lineOffset, 0);
                const prefixEnd = Math.max(maxStart - lineOffset, 0);
                // No prefix to strip, return as-is.
                if (prefixStart == prefixEnd) {
                    return reply;
                }
                const prefix = line.substring(prefixStart, prefixEnd);
                return {
                    ...reply,
                    items: reply.items.map(item => {
                        let insertText = item.insertText || item.label;
                        item.insertText = insertText.startsWith(prefix)
                            ? insertText.slice(prefix.length)
                            : insertText;
                        return item;
                    })
                };
            });
        }
        return replies;
    }
    async _mergeCompletions(promises) {
        let replies = (await promises).filter(reply => {
            // Ignore it errors out.
            if (!reply || reply instanceof Error) {
                return false;
            }
            // Ignore if no matches.
            if (!reply.items.length) {
                return false;
            }
            // Otherwise keep.
            return true;
        });
        // Fast path for a single reply or no replies.
        if (replies.length == 0) {
            return null;
        }
        else if (replies.length == 1) {
            return replies[0];
        }
        const minEnd = Math.min(...replies.map(reply => reply.end));
        // If any of the replies uses a wider range, we need to align them
        // so that all responses use the same range.
        const starts = replies.map(reply => reply.start);
        const minStart = Math.min(...starts);
        const maxStart = Math.max(...starts);
        replies = this._alignPrefixes(replies, minStart, maxStart);
        const insertTextSet = new Set();
        const mergedItems = new Array();
        for (const reply of replies) {
            reply.items.forEach(item => {
                // IPython returns 'import' and 'import '; while the latter is more useful,
                // user should not see two suggestions with identical labels and nearly-identical
                // behaviour as they could not distinguish the two either way.
                let text = (item.insertText || item.label).trim();
                if (insertTextSet.has(text)) {
                    return;
                }
                insertTextSet.add(text);
                mergedItems.push(item);
            });
        }
        return {
            start: maxStart,
            end: minEnd,
            items: mergedItems
        };
    }
    _defaultShouldShowContinuousHint(completerIsVisible, changed) {
        var _a, _b, _c;
        const mimeType = (_c = (_b = (_a = this._context) === null || _a === void 0 ? void 0 : _a.editor) === null || _b === void 0 ? void 0 : _b.model.mimeType) !== null && _c !== void 0 ? _c : '';
        if (!isHintableMimeType(mimeType)) {
            return false;
        }
        return (!completerIsVisible &&
            (changed.sourceChange == null ||
                changed.sourceChange.some(delta => delta.insert != null && delta.insert.length > 0)));
    }
}
//# sourceMappingURL=reconciliator.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/default/contextprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
const CONTEXT_PROVIDER_ID = 'CompletionProvider:context';
/**
 * A context connector for completion handlers.
 */
class ContextCompleterProvider {
    constructor() {
        this.identifier = CONTEXT_PROVIDER_ID;
        this.rank = 500;
        this.renderer = null;
    }
    /**
     * The context completion provider is applicable on all cases.
     * @param context - additional information about context of completion request
     */
    async isApplicable(context) {
        return true;
    }
    /**
     * Fetch completion requests.
     *
     * @param request - The completion request text and details.
     */
    fetch(request, context) {
        const editor = context.editor;
        if (!editor) {
            return Promise.reject('No editor');
        }
        return new Promise(resolve => {
            resolve(contextprovider_Private.contextHint(editor));
        });
    }
}
/**
 * A namespace for Private functionality.
 */
var contextprovider_Private;
(function (Private) {
    /**
     * Get a list of completion hints from a tokenization
     * of the editor.
     */
    function contextHint(editor) {
        // Find the token at the cursor
        const token = editor.getTokenAtCursor();
        // Get the list of matching tokens.
        const tokenList = getCompletionTokens(token, editor);
        // Only choose the ones that have a non-empty type
        // field, which are likely to be of interest.
        const completionList = tokenList.filter(t => t.type).map(t => t.value);
        // Remove duplicate completions from the list
        const matches = new Set(completionList);
        const items = new Array();
        matches.forEach(label => items.push({ label }));
        return {
            start: token.offset,
            end: token.offset + token.value.length,
            items
        };
    }
    Private.contextHint = contextHint;
    /**
     * Get a list of tokens that match the completion request,
     * but are not identical to the completion request.
     */
    function getCompletionTokens(token, editor) {
        const candidates = editor.getTokens();
        // Only get the tokens that have a common start, but
        // are not identical.
        return candidates.filter(t => t.value.indexOf(token.value) === 0 && t.value !== token.value);
    }
})(contextprovider_Private || (contextprovider_Private = {}));
//# sourceMappingURL=contextprovider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/default/kernelprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


const KERNEL_PROVIDER_ID = 'CompletionProvider:kernel';
/**
 * A kernel connector for completion handlers.
 */
class KernelCompleterProvider {
    constructor() {
        this.identifier = KERNEL_PROVIDER_ID;
        this.rank = 550;
        this.renderer = null;
    }
    /**
     * The kernel completion provider is applicable only if the kernel is available.
     * @param context - additional information about context of completion request
     */
    async isApplicable(context) {
        var _a;
        const hasKernel = (_a = context.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!hasKernel) {
            return false;
        }
        return true;
    }
    /**
     * Fetch completion requests.
     *
     * @param request - The completion request text and details.
     */
    async fetch(request, context) {
        var _a;
        const kernel = (_a = context.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!kernel) {
            throw new Error('No kernel for completion request.');
        }
        const contents = {
            code: request.text,
            cursor_pos: request.offset
        };
        const msg = await kernel.requestComplete(contents);
        const response = msg.content;
        if (response.status !== 'ok') {
            throw new Error('Completion fetch failed to return successfully.');
        }
        const items = new Array();
        const metadata = response.metadata._jupyter_types_experimental;
        response.matches.forEach((label, index) => {
            if (metadata && metadata[index]) {
                items.push({
                    label,
                    type: metadata[index].type,
                    insertText: metadata[index].text
                });
            }
            else {
                items.push({ label });
            }
        });
        return {
            start: response.cursor_start,
            end: response.cursor_end,
            items
        };
    }
    /**
     * Kernel provider will use the inspect request to lazy-load the content
     * for document panel.
     */
    async resolve(item, context, patch) {
        const { editor, session } = context;
        if (session && editor) {
            let code = editor.model.sharedModel.getSource();
            const position = editor.getCursorPosition();
            let offset = lib_index_js_.Text.jsIndexToCharIndex(editor.getOffsetAt(position), code);
            const kernel = session.kernel;
            if (!code || !kernel) {
                return Promise.resolve(item);
            }
            if (patch) {
                const { start, value } = patch;
                code = code.substring(0, start) + value;
                offset = offset + value.length;
            }
            const contents = {
                code,
                cursor_pos: offset,
                detail_level: 0
            };
            const msg = await kernel.requestInspect(contents);
            const value = msg.content;
            if (value.status !== 'ok' || !value.found) {
                return item;
            }
            item.documentation = value.data['text/plain'];
            return item;
        }
        return item;
    }
    /**
     * Kernel provider will activate the completer in continuous mode after
     * the `.` character.
     */
    shouldShowContinuousHint(visible, changed, context) {
        var _a, _b;
        const mimeType = (_b = (_a = context === null || context === void 0 ? void 0 : context.editor) === null || _a === void 0 ? void 0 : _a.model.mimeType) !== null && _b !== void 0 ? _b : '';
        if (!isHintableMimeType(mimeType)) {
            return false;
        }
        const sourceChange = changed.sourceChange;
        if (sourceChange == null) {
            return true;
        }
        if (sourceChange.some(delta => delta.delete != null)) {
            return false;
        }
        return sourceChange.some(delta => delta.insert != null &&
            (delta.insert === '.' || (!visible && delta.insert.trim().length > 0)));
    }
}
//# sourceMappingURL=kernelprovider.js.map
// EXTERNAL MODULE: consume shared module (default) @codemirror/view@~6.39.15 (singleton) (fallback: ../node_modules/@codemirror/view/dist/index.js)
var view_dist_index_js_ = __webpack_require__(1164);
// EXTERNAL MODULE: consume shared module (default) @codemirror/state@~6.5.4 (singleton) (fallback: ../node_modules/@codemirror/state/dist/index.js)
var state_dist_index_js_ = __webpack_require__(88145);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/ghost.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


const TRANSIENT_LINE_SPACER_CLASS = 'jp-GhostText-lineSpacer';
const TRANSIENT_LETTER_SPACER_CLASS = 'jp-GhostText-letterSpacer';
const GHOST_TEXT_CLASS = 'jp-GhostText';
const STREAMED_TOKEN_CLASS = 'jp-GhostText-streamedToken';
const STREAMING_INDICATOR_CLASS = 'jp-GhostText-streamingIndicator';
const ERROR_INDICATOR_CLASS = 'jp-GhostText-errorIndicator';
const HIDDEN_LINES_CLASS = 'jp-GhostText-hiddenLines';
class GhostTextManager {
    constructor(options) {
        this.options = options;
        // no-op
    }
    /**
     * Place ghost text in an editor.
     */
    placeGhost(view, text) {
        const effects = [ghost_Private.addMark.of(text)];
        if (!view.state.field(ghost_Private.markField, false)) {
            effects.push(state_dist_index_js_.StateEffect.appendConfig.of([ghost_Private.markField]));
            effects.push(state_dist_index_js_.StateEffect.appendConfig.of([
                view_dist_index_js_.EditorView.domEventHandlers({
                    blur: (event) => {
                        if (this.options.onBlur(event) === false) {
                            return true;
                        }
                        const effects = [
                            ghost_Private.removeMark.of(null)
                        ];
                        // Only execute it after editor update has completed.
                        setTimeout(() => {
                            view.dispatch({ effects });
                        }, 0);
                    }
                })
            ]));
        }
        view.dispatch({ effects });
    }
    /**
     * Clear all ghost texts from the editor.
     */
    clearGhosts(view) {
        const effects = [ghost_Private.removeMark.of(null)];
        view.dispatch({ effects });
    }
}
/**
 * Typing animation.
 */
GhostTextManager.streamingAnimation = 'uncover';
/**
 * Delay for removal of line spacer.
 */
GhostTextManager.spacerRemovalDelay = 700;
/**
 * Duration for line spacer removal.
 */
GhostTextManager.spacerRemovalDuration = 300;
class GhostTextWidget extends view_dist_index_js_.WidgetType {
    constructor(options) {
        super();
        this.options = options;
        this.isSpacer = false;
        this._clearErrorTimeout = null;
    }
    eq(other) {
        return (other.content == this.content &&
            other.options.streaming === this.options.streaming &&
            other.options.error === this.options.error);
    }
    get lineBreaks() {
        return (this.content.match(/\n/g) || '').length;
    }
    updateDOM(dom, _view) {
        this._updateDOM(dom);
        return true;
    }
    get content() {
        return this.options.content;
    }
    toDOM() {
        let wrap = document.createElement('span');
        if (this.options.onPointerOver) {
            wrap.addEventListener('pointerover', this.options.onPointerOver);
        }
        if (this.options.onPointerLeave) {
            wrap.addEventListener('pointerleave', this.options.onPointerLeave);
        }
        wrap.classList.add(GHOST_TEXT_CLASS);
        wrap.dataset.animation = GhostTextManager.streamingAnimation;
        wrap.dataset.providedBy = this.options.providerId;
        this._updateDOM(wrap);
        return wrap;
    }
    _removeErrorAnimation(dom) {
        const elementsToRemove = dom.querySelectorAll(`.${ERROR_INDICATOR_CLASS}`);
        elementsToRemove.forEach(element => {
            element.remove();
        });
    }
    /**
     * Mount the error animation DOM and remove the streaming indicator if any.
     */
    _mountErrorAnimation(dom) {
        const errorIndicator = document.createElement('span');
        errorIndicator.className = ERROR_INDICATOR_CLASS;
        const error = this.options.error;
        if (error === null || error === void 0 ? void 0 : error.message) {
            errorIndicator.title = error === null || error === void 0 ? void 0 : error.message;
        }
        // Delete stream and previous error animation
        const elementsToRemove = dom.querySelectorAll(`.${STREAMING_INDICATOR_CLASS}, .${ERROR_INDICATOR_CLASS}`);
        elementsToRemove.forEach(element => {
            element.remove();
        });
        dom.appendChild(errorIndicator);
    }
    _updateDOM(dom) {
        var _a, _b;
        if (this.options.error) {
            this._mountErrorAnimation(dom);
            this._clearErrorTimeout = setTimeout(() => {
                this._removeErrorAnimation(dom);
                this._clearErrorTimeout = null;
            }, 5000);
            return;
        }
        // If not in an error anymore, clear the error indicator
        if (this._clearErrorTimeout !== null) {
            clearTimeout(this._clearErrorTimeout);
            this._removeErrorAnimation(dom);
            this._clearErrorTimeout = null;
        }
        let content = this.content;
        let hiddenContent = '';
        let addition = this.options.addedPart;
        if (addition) {
            if (addition.startsWith('\n')) {
                // Show the new line straight away to ensure proper positioning.
                addition = addition.substring(1);
            }
            content = content.substring(0, content.length - addition.length);
        }
        if (this.options.maxLines) {
            // Split into content to show immediately and the hidden part
            const lines = content.split('\n');
            content = lines.slice(0, this.options.maxLines).join('\n');
            hiddenContent = lines.slice(this.options.maxLines).join('\n');
        }
        const minLines = Math.min((_a = this.options.minLines) !== null && _a !== void 0 ? _a : 0, (_b = this.options.maxLines) !== null && _b !== void 0 ? _b : Infinity);
        const linesToAdd = Math.max(0, minLines - content.split('\n').length + 1);
        const placeHolderLines = new Array(linesToAdd).fill('').join('\n');
        if (this.isSpacer) {
            dom.innerText = content + placeHolderLines;
            return;
        }
        dom.innerText = content;
        let streamedTokenHost = dom;
        if (hiddenContent.length > 0) {
            const hiddenWrapper = document.createElement('span');
            hiddenWrapper.className = 'jp-GhostText-hiddenWrapper';
            dom.appendChild(hiddenWrapper);
            const expandOnHover = document.createElement('span');
            expandOnHover.className = 'jp-GhostText-expandHidden';
            expandOnHover.innerText = '⇓';
            const hiddenPart = document.createElement('span');
            hiddenWrapper.appendChild(expandOnHover);
            hiddenPart.className = HIDDEN_LINES_CLASS;
            hiddenPart.innerText = '\n' + hiddenContent;
            hiddenWrapper.appendChild(hiddenPart);
            streamedTokenHost = hiddenPart;
        }
        if (addition) {
            const addedPart = document.createElement('span');
            addedPart.className = STREAMED_TOKEN_CLASS;
            addedPart.innerText = addition;
            streamedTokenHost.appendChild(addedPart);
        }
        // Add "streaming-in-progress" indicator
        if (this.options.streaming) {
            const streamingIndicator = document.createElement('span');
            streamingIndicator.className = STREAMING_INDICATOR_CLASS;
            streamedTokenHost.appendChild(streamingIndicator);
        }
        if (placeHolderLines.length > 0) {
            const placeholderLinesNode = document.createTextNode(placeHolderLines);
            streamedTokenHost.appendChild(placeholderLinesNode);
        }
    }
    destroy(dom) {
        if (this.options.onPointerOver) {
            dom.removeEventListener('pointerover', this.options.onPointerOver);
        }
        if (this.options.onPointerLeave) {
            dom.removeEventListener('pointerleave', this.options.onPointerLeave);
        }
        super.destroy(dom);
    }
}
/**
 * Spacers are used to reduce height jitter in the transition between multi-line inline suggestions.
 * In particular, when user removes a letter they will often get a new suggestion in split-second,
 * but without spacer they would see the editor collapse in height and then elongate again.
 */
class TransientSpacerWidget extends GhostTextWidget {
    constructor() {
        super(...arguments);
        this.isSpacer = true;
    }
}
class TransientLineSpacerWidget extends TransientSpacerWidget {
    toDOM() {
        const wrap = super.toDOM();
        wrap.classList.add(TRANSIENT_LINE_SPACER_CLASS);
        wrap.style.animationDelay = GhostTextManager.spacerRemovalDelay + 'ms';
        wrap.style.animationDuration =
            GhostTextManager.spacerRemovalDuration + 'ms';
        return wrap;
    }
}
class TransientLetterSpacerWidget extends TransientSpacerWidget {
    get content() {
        return this.options.content[0];
    }
    toDOM() {
        const wrap = super.toDOM();
        wrap.classList.add(TRANSIENT_LETTER_SPACER_CLASS);
        return wrap;
    }
}
var ghost_Private;
(function (Private) {
    let GhostAction;
    (function (GhostAction) {
        GhostAction[GhostAction["Set"] = 0] = "Set";
        GhostAction[GhostAction["Remove"] = 1] = "Remove";
        GhostAction[GhostAction["FilterAndUpdate"] = 2] = "FilterAndUpdate";
    })(GhostAction || (GhostAction = {}));
    Private.addMark = state_dist_index_js_.StateEffect.define({
        map: (old, change) => ({
            ...old,
            from: change.mapPos(old.from),
            to: change.mapPos(old.from + old.content.length)
        })
    });
    Private.removeMark = state_dist_index_js_.StateEffect.define();
    /**
     * Decide what should be done for transaction effects.
     */
    function chooseAction(tr) {
        // This function can short-circuit because at any time there is no more than one ghost text.
        for (let e of tr.effects) {
            if (e.is(Private.addMark)) {
                return {
                    action: GhostAction.Set,
                    spec: e.value
                };
            }
            else if (e.is(Private.removeMark)) {
                return {
                    action: GhostAction.Remove
                };
            }
        }
        if (tr.docChanged || tr.selection) {
            return {
                action: GhostAction.FilterAndUpdate
            };
        }
        return null;
    }
    function createWidget(spec, tr) {
        const ghost = view_dist_index_js_.Decoration.widget({
            widget: new GhostTextWidget(spec),
            side: 1,
            ghostSpec: spec
        });
        // Widget decorations can only have zero-length ranges
        return ghost.range(Math.min(spec.from, tr.newDoc.length), Math.min(spec.from, tr.newDoc.length));
    }
    function createSpacer(spec, tr, timeout = 1000) {
        // no spacer needed if content is only one character long.
        if (spec.content.length < 2) {
            return [];
        }
        const timeoutInfo = {
            elapsed: false
        };
        setTimeout(() => {
            timeoutInfo.elapsed = true;
        }, timeout);
        const characterSpacer = view_dist_index_js_.Decoration.widget({
            widget: new TransientLetterSpacerWidget(spec),
            side: 1,
            timeoutInfo
        });
        const lineSpacer = view_dist_index_js_.Decoration.widget({
            widget: new TransientLineSpacerWidget(spec),
            side: 1,
            timeoutInfo
        });
        // We add two different spacers: one to temporarily preserve height of as many lines
        // as there were in the content, and the other (character spacer) to ensure that
        // cursor is not malformed by the presence of the line spacer.
        return [
            characterSpacer.range(Math.min(spec.from, tr.newDoc.length), Math.min(spec.from, tr.newDoc.length)),
            lineSpacer.range(Math.min(spec.from, tr.newDoc.length), Math.min(spec.from, tr.newDoc.length))
        ];
    }
    Private.markField = state_dist_index_js_.StateField.define({
        create() {
            return view_dist_index_js_.Decoration.none;
        },
        update(marks, tr) {
            const data = chooseAction(tr);
            // remove spacers after timeout
            marks = marks.update({
                filter: (_from, _to, value) => {
                    if (value.spec.widget instanceof TransientSpacerWidget) {
                        return !value.spec.timeoutInfo.elapsed;
                    }
                    return true;
                }
            });
            if (!data) {
                return marks.map(tr.changes);
            }
            switch (data.action) {
                case GhostAction.Set: {
                    const spec = data.spec;
                    const newWidget = createWidget(spec, tr);
                    return marks.update({
                        add: [newWidget],
                        filter: (_from, _to, value) => value === newWidget.value
                    });
                }
                case GhostAction.Remove:
                    return marks.update({
                        filter: () => false
                    });
                case GhostAction.FilterAndUpdate: {
                    let cursor = marks.iter();
                    // skip over spacer if any
                    while (cursor.value &&
                        cursor.value.spec.widget instanceof TransientSpacerWidget) {
                        cursor.next();
                    }
                    if (!cursor.value) {
                        // short-circuit if no widgets are present, or if only spacer was present
                        return marks.map(tr.changes);
                    }
                    const originalSpec = cursor.value.spec.ghostSpec;
                    const spec = { ...originalSpec };
                    let shouldRemoveGhost = false;
                    tr.changes.iterChanges((fromA, toA, fromB, toB, inserted) => {
                        if (shouldRemoveGhost) {
                            return;
                        }
                        if (fromA === toA && fromB !== toB) {
                            // text was inserted without modifying old text
                            for (let lineNumber = 0; lineNumber < inserted.lines; lineNumber++) {
                                const lineContent = inserted.lineAt(lineNumber).text;
                                const line = lineNumber > 0 ? '\n' + lineContent : lineContent;
                                if (spec.content.startsWith(line)) {
                                    spec.content = spec.content.slice(line.length);
                                    spec.from += line.length;
                                }
                                else {
                                    shouldRemoveGhost = true;
                                    break;
                                }
                            }
                        }
                        else if (fromB === toB && fromA !== toA) {
                            // text was removed
                            shouldRemoveGhost = true;
                        }
                        else {
                            // text was replaced
                            shouldRemoveGhost = true;
                            // TODO: could check if the previous spec matches
                        }
                    });
                    // removing multi-line widget would cause the code cell to jump; instead
                    // we add a temporary spacer widget(s) which will be removed in a future update
                    // allowing a slight delay between getting a new suggestion and reducing cell height
                    const newWidgets = shouldRemoveGhost
                        ? createSpacer(originalSpec, tr)
                        : [createWidget(spec, tr)];
                    const newValues = newWidgets.map(widget => widget.value);
                    marks = marks.update({
                        add: newWidgets,
                        filter: (_from, _to, value) => newValues.includes(value)
                    });
                    if (shouldRemoveGhost) {
                        // TODO this can error out when deleting text, ideally a clean solution would be used.
                        try {
                            marks = marks.map(tr.changes);
                        }
                        catch (e) {
                            console.warn(e);
                            return view_dist_index_js_.Decoration.none;
                        }
                    }
                    return marks;
                }
            }
        },
        provide: f => view_dist_index_js_.EditorView.decorations.from(f)
    });
})(ghost_Private || (ghost_Private = {}));
//# sourceMappingURL=ghost.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/inline.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




const INLINE_COMPLETER_CLASS = 'jp-InlineCompleter';
const INLINE_COMPLETER_ACTIVE_CLASS = 'jp-mod-inline-completer-active';
const HOVER_CLASS = 'jp-InlineCompleter-hover';
const PROGRESS_BAR_CLASS = 'jp-InlineCompleter-progressBar';
/**
 * Widget enabling user to choose among inline completions,
 * typically by pressing next/previous buttons, and showing
 * additional metadata about active completion, such as
 * inline completion provider name.
 */
class InlineCompleter extends widgets_dist_index_es6_js_.Widget {
    constructor(options) {
        var _a, _b;
        super({ node: document.createElement('div') });
        this._clearHoverTimeout = null;
        this._current = 0;
        this._editor = null;
        this._lastItem = null;
        this._model = null;
        this._providerWidget = new widgets_dist_index_es6_js_.Widget();
        this._showShortcuts = InlineCompleter.defaultSettings.showShortcuts;
        this._showWidget = InlineCompleter.defaultSettings.showWidget;
        this._suggestionsCounter = new widgets_dist_index_es6_js_.Widget();
        this._toolbar = new ui_components_lib_index_js_.Toolbar();
        this.model = (_a = options.model) !== null && _a !== void 0 ? _a : null;
        this.editor = (_b = options.editor) !== null && _b !== void 0 ? _b : null;
        this.addClass(INLINE_COMPLETER_CLASS);
        this.addClass('jp-ThemedContainer');
        this._ghostManager = new GhostTextManager({
            onBlur: this._onEditorBlur.bind(this)
        });
        this._trans = options.trans;
        const layout = (this.layout = new widgets_dist_index_es6_js_.PanelLayout());
        layout.addWidget(this._suggestionsCounter);
        layout.addWidget(this.toolbar);
        layout.addWidget(this._providerWidget);
        this._progressBar = document.createElement('div');
        this._progressBar.className = PROGRESS_BAR_CLASS;
        this.node.appendChild(this._progressBar);
        this._updateShortcutsVisibility();
        this._updateDisplay();
        // Allow the node to receive focus, which prevents removing the ghost text
        // when user mis-clicks on the tooltip instead of the button in the tooltip.
        this.node.tabIndex = 0;
    }
    /**
     * Toolbar with buttons such as previous/next/accept.
     */
    get toolbar() {
        return this._toolbar;
    }
    /**
     * The editor used by the completion widget.
     */
    get editor() {
        return this._editor;
    }
    set editor(newValue) {
        var _a;
        (_a = this.model) === null || _a === void 0 ? void 0 : _a.reset();
        this._editor = newValue;
    }
    /**
     * The model used by the completer widget.
     */
    get model() {
        return this._model;
    }
    set model(model) {
        if ((!model && !this._model) || model === this._model) {
            return;
        }
        if (this._model) {
            this._model.suggestionsChanged.disconnect(this._onModelSuggestionsChanged, this);
            this._model.filterTextChanged.disconnect(this._onModelFilterTextChanged, this);
            this._model.provisionProgress.disconnect(this._onProvisionProgress, this);
        }
        this._model = model;
        if (this._model) {
            this._model.suggestionsChanged.connect(this._onModelSuggestionsChanged, this);
            this._model.filterTextChanged.connect(this._onModelFilterTextChanged, this);
            this._model.provisionProgress.connect(this._onProvisionProgress, this);
        }
    }
    cycle(direction) {
        var _a, _b;
        const items = (_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.completions) === null || _b === void 0 ? void 0 : _b.items;
        if (!items) {
            return;
        }
        if (direction === 'next') {
            const proposed = this._current + 1;
            this._current = proposed === items.length ? 0 : proposed;
        }
        else {
            const proposed = this._current - 1;
            this._current = proposed === -1 ? items.length - 1 : proposed;
        }
        this._updateStreamTracking();
        this._render();
    }
    accept() {
        const model = this.model;
        const candidate = this.current;
        const editor = this._editor;
        if (!editor || !model || !candidate) {
            return;
        }
        const position = model.cursor;
        const value = candidate.insertText;
        const cursorBeforeChange = editor.getOffsetAt(editor.getCursorPosition());
        const requestPosition = editor.getOffsetAt(position);
        const start = requestPosition;
        const end = cursorBeforeChange;
        const transactions = {
            changes: { from: start, to: end, insert: value }
        };
        if (cursorBeforeChange <= end && cursorBeforeChange >= start) {
            transactions.selection = { anchor: start + value.length };
        }
        editor.editor.dispatch(transactions);
        model.reset();
        this.update();
    }
    get current() {
        var _a;
        const completions = (_a = this.model) === null || _a === void 0 ? void 0 : _a.completions;
        if (!completions) {
            return null;
        }
        return completions.items[this._current];
    }
    _updateStreamTracking() {
        if (this._lastItem) {
            this._lastItem.stream.disconnect(this._onStream, this);
        }
        const current = this.current;
        if (current) {
            current.stream.connect(this._onStream, this);
        }
        this._lastItem = current;
    }
    _onStream(_emitter, _change) {
        var _a;
        // TODO handle stuck streams, i.e. if we connected and received 'opened'
        // but then did not receive 'closed' for a long time we should disconnect
        // and update widget with an 'timed out' status.
        const completions = (_a = this.model) === null || _a === void 0 ? void 0 : _a.completions;
        if (!completions || !completions.items || completions.items.length === 0) {
            return;
        }
        if (this.isHidden) {
            return;
        }
        const candidate = completions.items[this._current];
        this._setText(candidate);
    }
    /**
     * Change user-configurable settings.
     */
    configure(settings) {
        this._showWidget = settings.showWidget;
        this._updateDisplay();
        if (settings.showShortcuts !== this._showShortcuts) {
            this._showShortcuts = settings.showShortcuts;
            this._updateShortcutsVisibility();
        }
        GhostTextManager.streamingAnimation = settings.streamingAnimation;
        GhostTextManager.spacerRemovalDelay = Math.max(0, settings.editorResizeDelay - 300);
        GhostTextManager.spacerRemovalDuration = Math.max(0, Math.min(300, settings.editorResizeDelay - 300));
        this._minLines = settings.minLines;
        this._maxLines = settings.maxLines;
        this._reserveSpaceForLongest = settings.reserveSpaceForLongest;
        this._suppressIfTabCompleterActive = settings.suppressIfTabCompleterActive;
    }
    /**
     * Whether to suppress the inline completer when tab completer is active.
     */
    get suppressIfTabCompleterActive() {
        return this._suppressIfTabCompleterActive;
    }
    /**
     * Whether the inline completer is active.
     */
    get isActive() {
        var _a;
        return !!((_a = this.editor) === null || _a === void 0 ? void 0 : _a.host.classList.contains(INLINE_COMPLETER_ACTIVE_CLASS));
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the dock panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        if (this.isHidden || !this._editor) {
            return;
        }
        switch (event.type) {
            case 'pointerdown':
                this._evtPointerdown(event);
                break;
            case 'scroll':
                this._evtScroll(event);
                break;
            default:
                break;
        }
    }
    /**
     * Handle `update-request` messages.
     */
    onUpdateRequest(msg) {
        super.onUpdateRequest(msg);
        const model = this._model;
        if (!model) {
            return;
        }
        let reply = model.completions;
        // If there are no items, hide.
        if (!reply || !reply.items || reply.items.length === 0) {
            if (!this.isHidden) {
                this.hide();
            }
            return;
        }
        if (this.isHidden) {
            this.show();
            this._setGeometry();
        }
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        document.addEventListener('scroll', this, true);
        document.addEventListener('pointerdown', this, true);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        document.removeEventListener('scroll', this, true);
        document.removeEventListener('pointerdown', this, true);
    }
    /**
     * Handle pointerdown events for the widget.
     */
    _evtPointerdown(event) {
        var _a;
        if (this.isHidden || !this._editor) {
            return;
        }
        const target = event.target;
        if (this.node.contains(target)) {
            return true;
        }
        this.hide();
        (_a = this.model) === null || _a === void 0 ? void 0 : _a.reset();
    }
    /**
     * Handle scroll events for the widget
     */
    _evtScroll(event) {
        if (this.isHidden || !this._editor) {
            return;
        }
        const { node } = this;
        // All scrolls except scrolls in the actual hover box node may cause the
        // referent editor that anchors the node to move, so the only scroll events
        // that can safely be ignored are ones that happen inside the hovering node.
        if (node.contains(event.target)) {
            return;
        }
        // Set the geometry of the node asynchronously.
        requestAnimationFrame(() => {
            this._setGeometry();
        });
    }
    _onEditorBlur(event) {
        var _a;
        if (this.node.contains(event.relatedTarget)) {
            // Cancel removing ghost text if our node is receiving focus
            return false;
        }
        // The ghost text will be removed, so nothing to accept
        (_a = this._editor) === null || _a === void 0 ? void 0 : _a.host.classList.remove(INLINE_COMPLETER_ACTIVE_CLASS);
        // Hide the widget if editor was blurred.
        this.hide();
    }
    _onModelSuggestionsChanged(_emitter, args) {
        var _a;
        if (!this.isAttached) {
            this.update();
            return;
        }
        if (args.event === 'set') {
            this._current = (_a = args.indexMap.get(this._current)) !== null && _a !== void 0 ? _a : 0;
        }
        else if (args.event === 'clear') {
            const editor = this.editor;
            if (editor) {
                this._ghostManager.clearGhosts(editor.editor);
                editor.host.classList.remove(INLINE_COMPLETER_ACTIVE_CLASS);
            }
        }
        this._updateStreamTracking();
        this.update();
        this._render();
    }
    _onModelFilterTextChanged(_emitter, mapping) {
        var _a, _b;
        const completions = (_a = this.model) === null || _a === void 0 ? void 0 : _a.completions;
        if (!completions || !completions.items || completions.items.length === 0) {
            return;
        }
        this._current = (_b = mapping.get(this._current)) !== null && _b !== void 0 ? _b : 0;
        this._updateStreamTracking();
        // Because the signal will be emitted during `EditorView.update` we want to
        // wait for the update to complete before calling `this._render()`. As there
        // is no API to check if update is done, we instead defer to next engine tick.
        setTimeout(() => {
            this._render();
            // (reading layout to get coordinate to position hoverbox is not allowed either)
            this._setGeometry();
        }, 0);
    }
    _onProvisionProgress(_emitter, progress) {
        requestAnimationFrame(() => {
            if (progress.pendingProviders === 0) {
                this._progressBar.style.display = 'none';
            }
            else {
                this._progressBar.style.display = '';
                this._progressBar.style.width =
                    (100 * progress.pendingProviders) / progress.totalProviders + '%';
            }
        });
    }
    _render() {
        var _a, _b;
        const completions = (_a = this.model) === null || _a === void 0 ? void 0 : _a.completions;
        if (!completions || !completions.items || completions.items.length === 0) {
            return;
        }
        const candidate = completions.items[this._current];
        this._setText(candidate);
        if (this._showWidget === 'never') {
            return;
        }
        this._suggestionsCounter.node.innerText = this._trans.__('%1/%2', this._current + 1, completions.items.length);
        this._providerWidget.node.title = this._trans.__('Provider: %1', candidate.provider.name);
        const icon = (_b = candidate.provider.icon) !== null && _b !== void 0 ? _b : ui_components_lib_index_js_.kernelIcon;
        icon.render(this._providerWidget.node);
    }
    _setText(item) {
        var _a, _b, _c;
        const text = item.insertText;
        const editor = this._editor;
        const model = this._model;
        if (!model || !editor) {
            return;
        }
        const view = editor.editor;
        let minLines;
        if (this._reserveSpaceForLongest) {
            const items = (_c = (_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.completions) === null || _b === void 0 ? void 0 : _b.items) !== null && _c !== void 0 ? _c : [];
            const longest = Math.max(...items.map(i => i.insertText.split('\n').length));
            minLines = Math.max(this._minLines, longest);
        }
        else {
            minLines = this._minLines;
        }
        this._ghostManager.placeGhost(view, {
            from: editor.getOffsetAt(model.cursor),
            content: text,
            providerId: item.provider.identifier,
            addedPart: item.lastStreamed,
            streaming: item.streaming,
            minLines: minLines,
            maxLines: this._maxLines,
            onPointerOver: this._onPointerOverGhost.bind(this),
            onPointerLeave: this._onPointerLeaveGhost.bind(this),
            error: item.error
        });
        editor.host.classList.add(INLINE_COMPLETER_ACTIVE_CLASS);
    }
    _onPointerOverGhost() {
        if (this._clearHoverTimeout !== null) {
            window.clearTimeout(this._clearHoverTimeout);
            this._clearHoverTimeout = null;
        }
        this.node.classList.add(HOVER_CLASS);
    }
    _onPointerLeaveGhost() {
        // Remove after a small delay to avoid flicker when moving cursor
        // between the lines or around the edges of the ghost text.
        this._clearHoverTimeout = window.setTimeout(() => this.node.classList.remove(HOVER_CLASS), 500);
    }
    _setGeometry() {
        const { node } = this;
        const model = this._model;
        const editor = this._editor;
        if (!editor || !model || !model.cursor) {
            return;
        }
        const host = editor.host.closest('.jp-MainAreaWidget > .lm-Widget') ||
            editor.host;
        let anchor;
        try {
            const maybeAnchor = editor.getCoordinateForPosition(model.cursor);
            if (!maybeAnchor) {
                throw Error('No coordinates for cursor position');
            }
            anchor = maybeAnchor;
        }
        catch (_a) {
            // if coordinate is no longer in editor (e.g. after deleting a line), hide widget
            this.hide();
            return;
        }
        ui_components_lib_index_js_.HoverBox.setGeometry({
            anchor,
            host: host,
            maxHeight: 40,
            minHeight: 20,
            node: node,
            privilege: 'forceAbove',
            outOfViewDisplay: {
                top: 'stick-outside',
                bottom: 'stick-inside',
                left: 'stick-inside',
                right: 'stick-outside'
            }
        });
    }
    _updateShortcutsVisibility() {
        this.node.dataset.showShortcuts = this._showShortcuts + '';
    }
    _updateDisplay() {
        this.node.dataset.display = this._showWidget;
    }
}
/**
 * A namespace for inline completer statics.
 */
(function (InlineCompleter) {
    /**
     * Defaults for runtime user-configurable settings.
     */
    InlineCompleter.defaultSettings = {
        showWidget: 'onHover',
        showShortcuts: true,
        streamingAnimation: 'uncover',
        providers: {},
        minLines: 2,
        maxLines: 4,
        editorResizeDelay: 1000,
        reserveSpaceForLongest: false,
        suppressIfTabCompleterActive: true
    };
    /**
     * Model for inline completions.
     */
    class Model {
        constructor() {
            this.suggestionsChanged = new dist_index_es6_js_.Signal(this);
            this.filterTextChanged = new dist_index_es6_js_.Signal(this);
            this.provisionProgress = new dist_index_es6_js_.Signal(this);
            this._isDisposed = false;
            this._completions = null;
        }
        setCompletions(reply) {
            var _a, _b;
            const previousPositions = new Map((_b = (_a = this._completions) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map((item, index) => [item.insertText, index]));
            this._completions = reply;
            const indexMap = new Map(reply.items.map((item, newIndex) => [
                previousPositions.get(item.insertText),
                newIndex
            ]));
            this.suggestionsChanged.emit({
                event: 'set',
                indexMap
            });
        }
        appendCompletions(reply) {
            if (!this._completions || !this._completions.items) {
                console.warn('No completions to append to');
                return;
            }
            this._completions.items.push(...reply.items);
            this.suggestionsChanged.emit({ event: 'append' });
        }
        notifyProgress(progress) {
            this.provisionProgress.emit(progress);
        }
        get cursor() {
            return this._cursor;
        }
        set cursor(value) {
            this._cursor = value;
        }
        get completions() {
            return this._completions;
        }
        reset() {
            this._completions = null;
            this.suggestionsChanged.emit({ event: 'clear' });
        }
        /**
         * Get whether the model is disposed.
         */
        get isDisposed() {
            return this._isDisposed;
        }
        handleTextChange(sourceChange) {
            var _a;
            const completions = this._completions;
            if (!completions ||
                !completions.items ||
                completions.items.length === 0) {
                return;
            }
            const originalPositions = new Map(completions.items.map((item, index) => [item, index]));
            for (let change of (_a = sourceChange.sourceChange) !== null && _a !== void 0 ? _a : []) {
                const insert = change.insert;
                if (insert) {
                    const items = completions.items.filter(item => {
                        var _a;
                        const filterText = (_a = item.filterText) !== null && _a !== void 0 ? _a : item.insertText;
                        if (!filterText.startsWith(insert)) {
                            return false;
                        }
                        item.filterText = filterText.substring(insert.length);
                        item.insertText = item.insertText.substring(insert.length);
                        return true;
                    });
                    if (items.length === 0) {
                        // all items from this provider were filtered out
                        this._completions = null;
                    }
                    completions.items = items;
                }
                else {
                    if (!change.retain) {
                        this._completions = null;
                    }
                }
            }
            const indexMap = new Map(completions.items.map((item, newIndex) => [
                originalPositions.get(item),
                newIndex
            ]));
            this.filterTextChanged.emit(indexMap);
        }
        handleSelectionChange(range) {
            const initialCursor = this.cursor;
            if (!initialCursor) {
                return;
            }
            const { start, end } = range;
            if (start.column !== end.column || start.line !== end.line) {
                // Cancel if user started selecting text.
                this.reset();
            }
            if (start.line !== initialCursor.line ||
                start.column < initialCursor.column) {
                // Cancel if user moved cursor to next line or receded to before the origin
                this.reset();
            }
        }
        /**
         * Dispose of the resources held by the model.
         */
        dispose() {
            // Do nothing if already disposed.
            if (this._isDisposed) {
                return;
            }
            this._isDisposed = true;
            dist_index_es6_js_.Signal.clearData(this);
        }
    }
    InlineCompleter.Model = Model;
})(InlineCompleter || (InlineCompleter = {}));
//# sourceMappingURL=inline.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/manager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.









/**
 * A manager for completion providers.
 */
class CompletionProviderManager {
    /**
     * Construct a new completer manager.
     */
    constructor() {
        /**
         * The set of activated providers
         */
        this._activeProviders = new Set([KERNEL_PROVIDER_ID, CONTEXT_PROVIDER_ID]);
        this._inlineCompleterSettings = InlineCompleter.defaultSettings;
        this._providers = new Map();
        this._inlineProviders = new Map();
        this._panelHandlers = new Map();
        this._mostRecentContext = new Map();
        this._activeProvidersChanged = new dist_index_es6_js_.Signal(this);
        this._selected = new dist_index_es6_js_.Signal(this);
        this._inlineCompleterFactory = null;
    }
    /**
     * Signal emitted when active providers list is changed.
     */
    get activeProvidersChanged() {
        return this._activeProvidersChanged;
    }
    /**
     * Signal emitted when a selection is made from a completer menu.
     */
    get selected() {
        return this._selected;
    }
    /**
     * Set provider timeout.
     *
     * @param {number} timeout - value of timeout in millisecond.
     */
    setTimeout(timeout) {
        this._timeout = timeout;
    }
    /**
     * Enable/disable the document panel.
     */
    setShowDocumentationPanel(showDoc) {
        this._panelHandlers.forEach(handler => (handler.completer.showDocsPanel = showDoc));
        this._showDoc = showDoc;
    }
    /**
     * Whether to suppress the tab completer when inline completions are presented.
     */
    setSuppressIfInlineCompleterActive(suppress) {
        this._panelHandlers.forEach(handler => (handler.completer.suppressIfInlineCompleterActive = suppress));
        this._suppressIfInlineCompleterActive = suppress;
    }
    /**
     * Enable/disable continuous hinting mode.
     */
    setContinuousHinting(value) {
        this._panelHandlers.forEach(handler => (handler.autoCompletion = value));
        this._autoCompletion = value;
    }
    /**
     * Register a completer provider with the manager.
     *
     * @param {ICompletionProvider} provider - the provider to be registered.
     */
    registerProvider(provider) {
        const identifier = provider.identifier;
        if (this._providers.has(identifier)) {
            console.warn(`Completion provider with identifier ${identifier} is already registered`);
        }
        else {
            this._providers.set(identifier, provider);
            this._panelHandlers.forEach((handler, id) => {
                void this.updateCompleter(this._mostRecentContext.get(id));
            });
        }
    }
    registerInlineProvider(provider) {
        const identifier = provider.identifier;
        if (this._inlineProviders.has(identifier)) {
            console.warn(`Completion provider with identifier ${identifier} is already registered`);
        }
        else {
            this._inlineProviders.set(identifier, provider);
            this._panelHandlers.forEach((handler, id) => {
                void this.updateCompleter(this._mostRecentContext.get(id));
            });
        }
    }
    /**
     *
     * Return the map of providers.
     */
    getProviders() {
        return this._providers;
    }
    /**
     * Activate the providers by id, the list of ids is populated from user setting.
     * The non-existing providers will be discarded.
     *
     * @param {Array<string>} providerIds - Array of strings with ids of provider
     */
    activateProvider(providerIds) {
        this._activeProviders = new Set([]);
        providerIds.forEach(providerId => {
            if (this._providers.has(providerId)) {
                this._activeProviders.add(providerId);
            }
        });
        if (this._activeProviders.size === 0) {
            this._activeProviders.add(KERNEL_PROVIDER_ID);
            this._activeProviders.add(CONTEXT_PROVIDER_ID);
        }
        this._activeProvidersChanged.emit();
    }
    /**
     * Create or update completer handler of a widget with new context.
     *
     * @param newCompleterContext - The completion context.
     */
    async updateCompleter(newCompleterContext) {
        var _a, _b;
        const { widget, editor, sanitizer } = newCompleterContext;
        const id = widget.id;
        const handler = this._panelHandlers.get(id);
        const firstProvider = [...this._activeProviders][0];
        const provider = this._providers.get(firstProvider);
        let renderer = (_a = provider === null || provider === void 0 ? void 0 : provider.renderer) !== null && _a !== void 0 ? _a : Completer.getDefaultRenderer(sanitizer);
        const modelFactory = provider === null || provider === void 0 ? void 0 : provider.modelFactory;
        let model;
        if (modelFactory) {
            model = await modelFactory.call(provider, newCompleterContext);
        }
        else {
            model = new CompleterModel();
        }
        this._mostRecentContext.set(widget.id, newCompleterContext);
        const options = {
            model,
            editor,
            renderer,
            sanitizer,
            showDoc: this._showDoc
        };
        if (!handler) {
            // Create a new handler.
            const handler = await this._generateHandler(newCompleterContext, options);
            this._panelHandlers.set(widget.id, handler);
            handler.completer.selected.connect((completer, insertText) => this._selected.emit({ insertText }));
            widget.disposed.connect(old => {
                this.disposeHandler(old.id, handler);
                this._mostRecentContext.delete(id);
            });
        }
        else {
            // Update existing completer.
            const completer = handler.completer;
            (_b = completer.model) === null || _b === void 0 ? void 0 : _b.dispose();
            completer.model = options.model;
            completer.renderer = options.renderer;
            completer.showDocsPanel = options.showDoc;
            completer.suppressIfInlineCompleterActive =
                this._suppressIfInlineCompleterActive;
            // Update other handler attributes.
            handler.autoCompletion = this._autoCompletion;
            if (editor) {
                handler.editor = editor;
                handler.reconciliator =
                    await this.generateReconciliator(newCompleterContext);
            }
        }
    }
    /**
     * Invoke the completer in the widget with provided id.
     *
     * @param id - the id of notebook panel, console panel or code editor.
     */
    invoke(id) {
        const handler = this._panelHandlers.get(id);
        if (handler) {
            handler.invoke();
        }
    }
    /**
     * Activate `select` command in the widget with provided id.
     *
     * @param {string} id - the id of notebook panel, console panel or code editor.
     */
    select(id) {
        const handler = this._panelHandlers.get(id);
        if (handler) {
            handler.completer.selectActive();
        }
    }
    /**
     * Set inline completer factory.
     */
    setInlineCompleterFactory(factory) {
        this._inlineCompleterFactory = factory;
        this._panelHandlers.forEach((handler, id) => {
            void this.updateCompleter(this._mostRecentContext.get(id));
        });
        if (this.inline) {
            return;
        }
        this.inline = {
            invoke: (id) => {
                const handler = this._panelHandlers.get(id);
                if (handler && handler.inlineCompleter) {
                    handler.invokeInline();
                }
            },
            isActive: (id) => {
                const handler = this._panelHandlers.get(id);
                if (handler && handler.inlineCompleter) {
                    return handler.inlineCompleter.isActive;
                }
                return false;
            },
            cycle: (id, direction) => {
                const handler = this._panelHandlers.get(id);
                if (handler && handler.inlineCompleter) {
                    handler.inlineCompleter.cycle(direction);
                }
            },
            accept: (id) => {
                const handler = this._panelHandlers.get(id);
                if (handler && handler.inlineCompleter) {
                    handler.inlineCompleter.accept();
                }
            },
            configure: (settings) => {
                this._inlineCompleterSettings = settings;
                for (const [providerId, provider] of this._inlineProviders.entries()) {
                    if (provider.configure) {
                        provider.configure(settings.providers[providerId]);
                    }
                }
                this._panelHandlers.forEach((handler, handlerId) => {
                    if (handler.inlineCompleter) {
                        handler.inlineCompleter.configure(settings);
                    }
                    // trigger update to regenerate reconciliator
                    void this.updateCompleter(this._mostRecentContext.get(handlerId));
                });
            }
        };
    }
    /**
     * Inline providers information.
     */
    get inlineProviders() {
        return [...this._inlineProviders.values()];
    }
    /**
     * Helper function to generate a `ProviderReconciliator` with provided context.
     * The `isApplicable` method of provider is used to filter out the providers
     * which can not be used with provided context.
     *
     * @param {ICompletionContext} completerContext - the current completer context
     */
    async generateReconciliator(completerContext) {
        const enabledProviders = [];
        for (const [id, providerSettings] of Object.entries(this._inlineCompleterSettings.providers)) {
            if (providerSettings.enabled === true) {
                enabledProviders.push(id);
            }
        }
        const inlineProviders = [...this._inlineProviders.values()].filter(provider => enabledProviders.includes(provider.identifier));
        const providers = [];
        for (const id of this._activeProviders) {
            const provider = this._providers.get(id);
            if (provider) {
                providers.push(provider);
            }
        }
        return new ProviderReconciliator({
            context: completerContext,
            providers,
            inlineProviders,
            inlineProvidersSettings: this._inlineCompleterSettings.providers,
            timeout: this._timeout
        });
    }
    /**
     * Helper to dispose the completer handler on widget disposed event.
     *
     * @param {string} id - id of the widget
     * @param {CompletionHandler} handler - the handler to be disposed.
     */
    disposeHandler(id, handler) {
        var _a, _b, _c, _d;
        (_a = handler.completer.model) === null || _a === void 0 ? void 0 : _a.dispose();
        handler.completer.dispose();
        (_c = (_b = handler.inlineCompleter) === null || _b === void 0 ? void 0 : _b.model) === null || _c === void 0 ? void 0 : _c.dispose();
        (_d = handler.inlineCompleter) === null || _d === void 0 ? void 0 : _d.dispose();
        handler.dispose();
        this._panelHandlers.delete(id);
    }
    /**
     * Helper to generate a completer handler from provided context.
     */
    async _generateHandler(completerContext, options) {
        const completer = new Completer(options);
        const inlineCompleter = this._inlineCompleterFactory
            ? this._inlineCompleterFactory.factory({
                ...options,
                model: new InlineCompleter.Model()
            })
            : undefined;
        completer.hide();
        widgets_dist_index_es6_js_.Widget.attach(completer, document.body);
        if (inlineCompleter) {
            widgets_dist_index_es6_js_.Widget.attach(inlineCompleter, document.body);
            inlineCompleter.hide();
            inlineCompleter.configure(this._inlineCompleterSettings);
        }
        const reconciliator = await this.generateReconciliator(completerContext);
        const handler = new CompletionHandler({
            completer,
            inlineCompleter,
            reconciliator: reconciliator
        });
        handler.editor = completerContext.editor;
        return handler;
    }
}
//# sourceMappingURL=manager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/style/icons/inline.svg
const icons_inline_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path class=\"jp-icon4\" fill=\"#bbbbbb\" d=\"M17 15H3v2h14v-2Zm0-8h-6v2h6V7ZM3 13h18v-2H3v2Zm0 8h18v-2H3v2Z\"/>\n  <path class=\"jp-icon1\" fill=\"#616161\" d=\"M3 3v2h18V3H3ZM3 7v2h8V7H3Z\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/style/icons/widget.svg
const icons_widget_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n<g fill=\"#616161\" class=\"jp-icon2 jp-icon-selectable\">\n  <path d=\"M6 8h16v14.3H6z\" style=\"fill:#eee;stroke:#444;stroke-linejoin:round\"/>\n  <path d=\"M3 3v2h10V3H3Z\" transform=\"matrix(.8 0 0 1 .5 0)\"/>\n</g>\n<g class=\"jp-icon3 jp-icon-selectable\">\n  <path fill=\"#616161\" d=\"M18 14.1H8v2h11v-2ZM8 12.1H20V10.1H8v2Zm0 8H20v-2H8v3Z\"/>\n</g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/icons.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



const inlineCompleterIcon = new ui_components_lib_index_js_.LabIcon({
    name: 'completer:inline',
    svgstr: icons_inline_namespaceObject
});
const completerWidgetIcon = new ui_components_lib_index_js_.LabIcon({
    name: 'completer:widget',
    svgstr: icons_widget_namespaceObject
});
//# sourceMappingURL=icons.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/default/inlinehistoryprovider.js


/**
 * An example inline completion provider using history to populate suggestions.
 */
class HistoryInlineCompletionProvider {
    constructor(options) {
        this.options = options;
        this.identifier = '@jupyterlab/inline-completer:history';
        this._maxSuggestions = 100;
        const translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = translator.load('jupyterlab');
    }
    get name() {
        return this._trans.__('History');
    }
    get icon() {
        return ui_components_lib_index_js_.historyIcon;
    }
    get schema() {
        return {
            properties: {
                maxSuggestions: {
                    title: this._trans.__('Maximum number of suggestions'),
                    description: this._trans.__('The maximum number of suggestions to retrieve from history.'),
                    type: 'number'
                }
            },
            default: {
                // make this provider opt-in
                enabled: false,
                maxSuggestions: 100
            }
        };
    }
    configure(settings) {
        var _a;
        this._maxSuggestions = (_a = settings.maxSuggestions) !== null && _a !== void 0 ? _a : 100;
    }
    async fetch(request, context, trigger) {
        var _a;
        const kernel = (_a = context.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!kernel) {
            throw new Error('No kernel for completion request.');
        }
        const multiLinePrefix = request.text.slice(0, request.offset);
        const linePrefix = multiLinePrefix.split('\n').slice(-1)[0];
        const suffix = request.text.slice(request.offset).split('\n')[0];
        let historyRequest;
        const items = [];
        if (linePrefix === '') {
            historyRequest = {
                output: false,
                raw: true,
                hist_access_type: 'tail',
                n: this._maxSuggestions
            };
            const reply = await kernel.requestHistory(historyRequest);
            if (reply.content.status === 'ok') {
                let history = reply.content.history;
                const historyFrequencyMap = new Map();
                // Count the frequency of each element
                for (const entry of history.reverse()) {
                    const sourceLines = entry[2];
                    historyFrequencyMap.set(sourceLines, (historyFrequencyMap.get(sourceLines) || 0) + 1);
                }
                const frequencyHistory = Array.from(historyFrequencyMap.entries());
                const sortedFrequencyHistory = frequencyHistory.sort((a, b) => {
                    if (a[1] > b[1]) {
                        return -1;
                    }
                    else if (a[1] < b[1]) {
                        return 1;
                    }
                    else {
                        return 0;
                    }
                });
                for (const entry of sortedFrequencyHistory) {
                    items.push({
                        insertText: entry[0]
                    });
                }
            }
        }
        else {
            historyRequest = {
                output: false,
                raw: true,
                hist_access_type: 'search',
                pattern: linePrefix + '*' + (suffix ? suffix + '*' : ''),
                unique: true,
                n: this._maxSuggestions
            };
            const reply = await kernel.requestHistory(historyRequest);
            if (reply.content.status === 'ok') {
                for (const entry of reply.content.history) {
                    const sourceLines = entry[2].split('\n');
                    for (let i = 0; i < sourceLines.length; i++) {
                        const line = sourceLines[i];
                        if (line.startsWith(linePrefix)) {
                            let followingLines = line.slice(linePrefix.length);
                            if (i + 1 < sourceLines.length) {
                                followingLines += '\n' + sourceLines.slice(i + 1).join('\n');
                            }
                            if (suffix) {
                                followingLines = followingLines.slice(0, followingLines.indexOf(suffix));
                            }
                            items.push({
                                insertText: followingLines
                            });
                        }
                    }
                }
            }
        }
        return { items };
    }
}
//# sourceMappingURL=inlinehistoryprovider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module completer
 */











//# sourceMappingURL=index.js.map

/***/ }),

/***/ 76576:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/completer/style/base.css
var base = __webpack_require__(60533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/completer/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 86748:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/completer@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/completer/lib/index.js)
var completer_lib_index_js_ = __webpack_require__(27709);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/console@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/console/lib/index.js)
var console_lib_index_js_ = __webpack_require__(69897);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/filebrowser@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/filebrowser/lib/index.js)
var filebrowser_lib_index_js_ = __webpack_require__(29543);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/launcher@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/launcher/lib/index.js)
var launcher_lib_index_js_ = __webpack_require__(62961);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/mainmenu@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/mainmenu/lib/index.js)
var mainmenu_lib_index_js_ = __webpack_require__(38911);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @lumino/properties@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/properties/dist/index.es6.js)
var properties_dist_index_es6_js_ = __webpack_require__(10249);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console-extension/lib/foreign.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * The console foreign handler.
 */
const foreign = {
    id: '@jupyterlab/console-extension:foreign',
    description: 'Add foreign handler of IOPub messages to the console.',
    requires: [console_lib_index_js_.IConsoleTracker, settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ICommandPalette],
    activate: activateForeign,
    autoStart: true
};
/* harmony default export */ const lib_foreign = (foreign);
function activateForeign(app, tracker, settingRegistry, translator, palette) {
    var _a;
    const trans = translator.load('jupyterlab');
    const { shell } = app;
    tracker.widgetAdded.connect((sender, widget) => {
        const console = widget.console;
        const handler = new console_lib_index_js_.ForeignHandler({
            sessionContext: console.sessionContext,
            parent: console
        });
        Private.foreignHandlerProperty.set(console, handler);
        // Property showAllKernelActivity configures foreign handler enabled on start.
        void settingRegistry
            .get('@jupyterlab/console-extension:tracker', 'showAllKernelActivity')
            .then(({ composite }) => {
            const showAllKernelActivity = composite;
            handler.enabled = showAllKernelActivity;
        });
        console.disposed.connect(() => {
            handler.dispose();
        });
    });
    const { commands } = app;
    const category = trans.__('Console');
    const toggleShowAllActivity = 'console:toggle-show-all-kernel-activity';
    // Get the current widget and activate unless the args specify otherwise.
    function getCurrent(args) {
        const widget = tracker.currentWidget;
        const activate = args['activate'] !== false;
        if (activate && widget) {
            shell.activateById(widget.id);
        }
        return widget;
    }
    commands.addCommand(toggleShowAllActivity, {
        label: args => trans.__('Show All Kernel Activity'),
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            const handler = Private.foreignHandlerProperty.get(current.console);
            if (handler) {
                handler.enabled = !handler.enabled;
            }
        },
        isToggled: () => {
            var _a;
            return tracker.currentWidget !== null &&
                !!((_a = Private.foreignHandlerProperty.get(tracker.currentWidget.console)) === null || _a === void 0 ? void 0 : _a.enabled);
        },
        isEnabled: () => tracker.currentWidget !== null &&
            tracker.currentWidget === shell.currentWidget,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        }
    });
    const notify = () => {
        commands.notifyCommandChanged(toggleShowAllActivity);
    };
    tracker.currentChanged.connect(notify);
    (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);
    if (palette) {
        palette.addItem({
            command: toggleShowAllActivity,
            category,
            args: { isPalette: true }
        });
    }
}
/*
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * An attached property for a console's foreign handler.
     */
    Private.foreignHandlerProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'foreignHandler',
        create: () => undefined
    });
})(Private || (Private = {}));
//# sourceMappingURL=foreign.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console-extension/lib/cellexecutor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Console cell executor plugin.
 */
const cellExecutor = {
    id: '@jupyterlab/console-extension:cell-executor',
    description: 'Provides the console cell executor.',
    autoStart: true,
    provides: console_lib_index_js_.IConsoleCellExecutor,
    activate: () => {
        return Object.freeze({ runCell: console_lib_index_js_.runCell });
    }
};
//# sourceMappingURL=cellexecutor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module console-extension
 */


















/**
 * The command IDs used by the console plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.autoClosingBrackets = 'console:toggle-autoclosing-brackets';
    CommandIDs.create = 'console:create';
    CommandIDs.clear = 'console:clear';
    CommandIDs.runUnforced = 'console:run-unforced';
    CommandIDs.runForced = 'console:run-forced';
    CommandIDs.linebreak = 'console:linebreak';
    CommandIDs.interrupt = 'console:interrupt-kernel';
    CommandIDs.restart = 'console:restart-kernel';
    CommandIDs.closeAndShutdown = 'console:close-and-shutdown';
    CommandIDs.open = 'console:open';
    CommandIDs.inject = 'console:inject';
    CommandIDs.changeKernel = 'console:change-kernel';
    CommandIDs.getKernel = 'console:get-kernel';
    CommandIDs.interactionMode = 'console:interaction-mode';
    CommandIDs.redo = 'console:redo';
    CommandIDs.replaceSelection = 'console:replace-selection';
    CommandIDs.shutdown = 'console:shutdown';
    CommandIDs.undo = 'console:undo';
    CommandIDs.invokeCompleter = 'completer:invoke-console';
    CommandIDs.selectCompleter = 'completer:select-console';
})(CommandIDs || (CommandIDs = {}));
/**
 * The console widget tracker provider.
 */
const tracker = {
    id: '@jupyterlab/console-extension:tracker',
    description: 'Provides the console widget tracker.',
    provides: console_lib_index_js_.IConsoleTracker,
    requires: [
        console_lib_index_js_.ConsolePanel.IContentFactory,
        codeeditor_lib_index_js_.IEditorServices,
        console_lib_index_js_.IConsoleCellExecutor,
        rendermime_lib_index_js_.IRenderMimeRegistry,
        settingregistry_lib_index_js_.ISettingRegistry
    ],
    optional: [
        index_js_.ILayoutRestorer,
        filebrowser_lib_index_js_.IDefaultFileBrowser,
        mainmenu_lib_index_js_.IMainMenu,
        lib_index_js_.ICommandPalette,
        launcher_lib_index_js_.ILauncher,
        index_js_.ILabStatus,
        lib_index_js_.ISessionContextDialogs,
        ui_components_lib_index_js_.IFormRendererRegistry,
        translation_lib_index_js_.ITranslator,
        lib_index_js_.ISessionContextDialogs,
        lib_index_js_.IToolbarWidgetRegistry
    ],
    activate: activateConsole,
    autoStart: true
};
/**
 * The console widget content factory.
 */
const factory = {
    id: '@jupyterlab/console-extension:factory',
    description: 'Provides the console widget content factory.',
    provides: console_lib_index_js_.ConsolePanel.IContentFactory,
    requires: [codeeditor_lib_index_js_.IEditorServices],
    autoStart: true,
    activate: (app, editorServices) => {
        const editorFactory = editorServices.factoryService.newInlineEditor;
        return new console_lib_index_js_.ConsolePanel.ContentFactory({ editorFactory });
    }
};
/**
 * Kernel status indicator.
 */
const kernelStatus = {
    id: '@jupyterlab/console-extension:kernel-status',
    description: 'Adds the console to the kernel status indicator model.',
    autoStart: true,
    requires: [console_lib_index_js_.IConsoleTracker, lib_index_js_.IKernelStatusModel],
    activate: (app, tracker, kernelStatus) => {
        const provider = (widget) => {
            let session = null;
            if (widget && tracker.has(widget)) {
                return widget.sessionContext;
            }
            return session;
        };
        kernelStatus.addSessionProvider(provider);
    }
};
/**
 * Cursor position.
 */
const lineColStatus = {
    id: '@jupyterlab/console-extension:cursor-position',
    description: 'Adds the console to the code editor cursor position model.',
    autoStart: true,
    requires: [console_lib_index_js_.IConsoleTracker, codeeditor_lib_index_js_.IPositionModel],
    activate: (app, tracker, positionModel) => {
        let previousWidget = null;
        const provider = async (widget) => {
            let editor = null;
            if (widget !== previousWidget) {
                previousWidget === null || previousWidget === void 0 ? void 0 : previousWidget.console.promptCellCreated.disconnect(positionModel.update);
                previousWidget = null;
                if (widget && tracker.has(widget)) {
                    widget.console.promptCellCreated.connect(positionModel.update);
                    const promptCell = widget.console.promptCell;
                    editor = null;
                    if (promptCell) {
                        await promptCell.ready;
                        editor = promptCell.editor;
                    }
                    previousWidget = widget;
                }
            }
            else if (widget) {
                const promptCell = widget.console.promptCell;
                editor = null;
                if (promptCell) {
                    await promptCell.ready;
                    editor = promptCell.editor;
                }
            }
            return editor;
        };
        positionModel.addEditorProvider(provider);
    }
};
const completerPlugin = {
    id: '@jupyterlab/console-extension:completer',
    description: 'Adds completion to the console.',
    autoStart: true,
    requires: [console_lib_index_js_.IConsoleTracker],
    optional: [completer_lib_index_js_.ICompletionProviderManager, translation_lib_index_js_.ITranslator, lib_index_js_.ISanitizer],
    activate: activateConsoleCompleterService
};
/**
 * Export the plugins as the default.
 */
const plugins = [
    factory,
    tracker,
    lib_foreign,
    kernelStatus,
    lineColStatus,
    completerPlugin,
    cellExecutor
];
/* harmony default export */ const lib = (plugins);
/**
 * Activate the console extension.
 */
async function activateConsole(app, contentFactory, editorServices, executor, rendermime, settingRegistry, restorer, filebrowser, mainMenu, palette, launcher, status, sessionDialogs_, formRegistry, translator_, sessionContextDialogs, toolbarRegistry) {
    var _a;
    const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const manager = app.serviceManager;
    const { commands, shell } = app;
    const category = trans.__('Console');
    const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new lib_index_js_.SessionContextDialogs({ translator });
    const pluginId = '@jupyterlab/console-extension:tracker';
    const promptCellPositions = [
        'top',
        'bottom',
        'left',
        'right'
    ];
    // Instantiate the toolbar factory for console panel at plugin activation time
    // since the plugin defines toolbar items and "jupyter.lab.toolbars" is set to true.
    let toolbarFactory;
    if (toolbarRegistry) {
        const factory = 'ConsolePanel';
        toolbarFactory = (0,lib_index_js_.createToolbarFactory)(toolbarRegistry, settingRegistry, factory, pluginId, translator);
        if (sessionContextDialogs) {
            toolbarRegistry.addFactory(factory, 'kernelName', panel => lib_index_js_.Toolbar.createKernelNameItem(panel.sessionContext, sessionContextDialogs, translator));
        }
        toolbarRegistry.addFactory(factory, 'kernelStatus', panel => {
            const sessionContext = panel.sessionContext;
            // TODO: update use of deprecated APIs, without having to depend on @jupyterlab/notebook
            const indicator = lib_index_js_.Toolbar.createKernelStatusItem(sessionContext);
            return indicator;
        });
        const promptMenu = new widgets_dist_index_es6_js_.Menu({ commands });
        promptMenu.addClass('jp-CodeConsolePromptMenu');
        promptCellPositions.forEach(position => {
            promptMenu.addItem({ command: `console:prompt-to-${position}` });
        });
        toolbarRegistry.addFactory(factory, 'promptPosition', panel => {
            const button = new ui_components_lib_index_js_.ToolbarButton({
                tooltip: trans.__('Change Console Prompt Position'),
                icon: ui_components_lib_index_js_.dotsIcon,
                onClick: () => {
                    const right = button.node.getBoundingClientRect().right;
                    const bottom = button.node.getBoundingClientRect().bottom;
                    promptMenu.open(right, bottom, { horizontalAlignment: 'right' });
                }
            });
            return button;
        });
    }
    // Create a widget tracker for all console panels.
    const tracker = new lib_index_js_.WidgetTracker({
        namespace: 'console'
    });
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: CommandIDs.create,
            args: widget => {
                const { path, name, kernelPreference } = widget.console.sessionContext;
                return {
                    path,
                    name,
                    kernelPreference: { ...kernelPreference }
                };
            },
            name: widget => { var _a; return (_a = widget.console.sessionContext.path) !== null && _a !== void 0 ? _a : dist_index_js_.UUID.uuid4(); },
            when: manager.ready
        });
    }
    // Add a launcher item if the launcher is available.
    if (launcher) {
        void manager.ready.then(() => {
            let disposables = null;
            const onSpecsChanged = () => {
                if (disposables) {
                    disposables.dispose();
                    disposables = null;
                }
                const specs = manager.kernelspecs.specs;
                if (!specs) {
                    return;
                }
                disposables = new dist_index_es6_js_.DisposableSet();
                for (const name in specs.kernelspecs) {
                    const rank = name === specs.default ? 0 : Infinity;
                    const spec = specs.kernelspecs[name];
                    const kernelIconUrl = spec.resources['logo-svg'] || spec.resources['logo-64x64'];
                    disposables.add(launcher.add({
                        command: CommandIDs.create,
                        args: { isLauncher: true, kernelPreference: { name } },
                        category: trans.__('Console'),
                        rank,
                        kernelIconUrl,
                        metadata: {
                            kernel: dist_index_js_.JSONExt.deepCopy(spec.metadata || {})
                        }
                    }));
                }
            };
            onSpecsChanged();
            manager.kernelspecs.specsChanged.connect(onSpecsChanged);
        });
    }
    /**
     * Create a console for a given path.
     */
    async function createConsole(options) {
        var _a, _b;
        await manager.ready;
        const panel = new console_lib_index_js_.ConsolePanel({
            manager,
            contentFactory,
            mimeTypeService: editorServices.mimeTypeService,
            rendermime,
            sessionDialogs,
            executor,
            translator,
            setBusy: (_a = (status && (() => status.setBusy()))) !== null && _a !== void 0 ? _a : undefined,
            ...options
        });
        if (toolbarFactory) {
            (0,lib_index_js_.setToolbar)(panel, toolbarFactory);
        }
        const interactionMode = (await settingRegistry.get('@jupyterlab/console-extension:tracker', 'interactionMode')).composite;
        panel.console.node.dataset.jpInteractionMode = interactionMode;
        // Add the console panel to the tracker. We want the panel to show up before
        // any kernel selection dialog, so we do not await panel.session.ready;
        await tracker.add(panel);
        panel.sessionContext.propertyChanged.connect(() => {
            void tracker.save(panel);
        });
        if (options.subshell) {
            panel.sessionContext.kernelChanged.connect(async () => {
                if (!panel.sessionContext.isDisposed) {
                    panel.sessionContext.ready
                        .then(async () => {
                        if (panel.sessionContext.session === null) {
                            console.error('Cannot create subshell without session');
                        }
                        else if (panel.sessionContext.session.kernel === null) {
                            console.error('Cannot create subshell without kernel');
                        }
                        else {
                            const { kernel } = panel.sessionContext.session;
                            // Ensure kernel has received kernel_info.
                            await kernel.info;
                            const replyMsg = await kernel.requestCreateSubshell({}).done;
                            kernel.subshellId = replyMsg.content.subshell_id;
                        }
                    })
                        .catch(reason => {
                        console.error('Failed to initialize SessionContext or create new subshell.', reason);
                    });
                }
            });
        }
        shell.add(panel, 'main', {
            ref: options.ref,
            mode: options.insertMode,
            activate: options.activate !== false,
            type: (_b = options.type) !== null && _b !== void 0 ? _b : 'Console'
        });
        return panel;
    }
    let clearCellsOnExecute;
    let clearCodeContentOnExecute;
    let hideCodeInput;
    let interactionMode;
    let promptCellConfig = {};
    let promptCellPosition;
    let showBanner;
    /**
     * Update settings for one console or all consoles.
     *
     * @param panel Optional - single console to update.
     */
    async function updateSettings(panel) {
        clearCellsOnExecute = (await settingRegistry.get(pluginId, 'clearCellsOnExecute')).composite;
        clearCodeContentOnExecute = (await settingRegistry.get(pluginId, 'clearCodeContentOnExecute')).composite;
        hideCodeInput = (await settingRegistry.get(pluginId, 'hideCodeInput'))
            .composite;
        interactionMode = (await settingRegistry.get(pluginId, 'interactionMode'))
            .composite;
        promptCellConfig = (await settingRegistry.get(pluginId, 'promptCellConfig'))
            .composite;
        promptCellPosition = (await settingRegistry.get(pluginId, 'promptCellPosition')).composite;
        showBanner = (await settingRegistry.get(pluginId, 'showBanner'))
            .composite;
        const setWidgetOptions = (widget) => {
            var _a, _b;
            widget.console.node.dataset.jpInteractionMode = interactionMode;
            // Update future promptCells
            widget.console.editorConfig = promptCellConfig;
            // Update promptCell already on screen
            (_b = (_a = widget.console.promptCell) === null || _a === void 0 ? void 0 : _a.editor) === null || _b === void 0 ? void 0 : _b.setOptions(promptCellConfig);
            // Set other config options
            widget.console.setConfig({
                clearCellsOnExecute,
                clearCodeContentOnExecute,
                hideCodeInput,
                promptCellPosition,
                showBanner
            });
        };
        if (panel) {
            setWidgetOptions(panel);
        }
        else {
            tracker.forEach(setWidgetOptions);
        }
    }
    settingRegistry.pluginChanged.connect((sender, plugin) => {
        if (plugin === pluginId) {
            void updateSettings();
        }
    });
    await updateSettings();
    if (formRegistry) {
        const CMRenderer = formRegistry.getRenderer('@jupyterlab/codemirror-extension:plugin.defaultConfig');
        if (CMRenderer) {
            formRegistry.addRenderer('@jupyterlab/console-extension:tracker.promptCellConfig', CMRenderer);
        }
    }
    // Apply settings when a console is created.
    tracker.widgetAdded.connect((sender, panel) => {
        void updateSettings(panel);
    });
    commands.addCommand(CommandIDs.autoClosingBrackets, {
        execute: async (args) => {
            var _a;
            promptCellConfig.autoClosingBrackets = !!((_a = args['force']) !== null && _a !== void 0 ? _a : !promptCellConfig.autoClosingBrackets);
            await settingRegistry.set(pluginId, 'promptCellConfig', promptCellConfig);
        },
        label: trans.__('Auto Close Brackets for Code Console Prompt'),
        isToggled: () => promptCellConfig.autoClosingBrackets,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    force: {
                        type: 'boolean',
                        description: trans.__('Whether to force the toggle state')
                    }
                }
            }
        }
    });
    /**
     * Whether there is an active console.
     */
    function isEnabled() {
        return (tracker.currentWidget !== null &&
            tracker.currentWidget === shell.currentWidget);
    }
    commands.addCommand(CommandIDs.open, {
        label: trans.__('Open a console for the provided `path`.'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: trans.__('The path of the session to open')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the console widget')
                    }
                },
                required: ['path']
            }
        },
        execute: (args) => {
            const path = args['path'];
            const widget = tracker.find(value => {
                var _a;
                return ((_a = value.console.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path) === path;
            });
            if (widget) {
                if (args.activate !== false) {
                    shell.activateById(widget.id);
                }
                return widget;
            }
            else {
                return manager.ready.then(() => {
                    const model = (0,index_es6_js_.find)(manager.sessions.running(), item => {
                        return item.path === path;
                    });
                    if (model) {
                        return createConsole(args);
                    }
                    return Promise.reject(`No running kernel session for path: ${path}`);
                });
            }
        }
    });
    commands.addCommand(CommandIDs.create, {
        label: args => {
            var _a, _b, _c, _d;
            if (args['isPalette']) {
                return trans.__('New Console');
            }
            else if (args['isLauncher'] && args['kernelPreference']) {
                const kernelPreference = args['kernelPreference'];
                // TODO: Lumino command functions should probably be allowed to return undefined?
                return ((_d = (_c = (_b = (_a = manager.kernelspecs) === null || _a === void 0 ? void 0 : _a.specs) === null || _b === void 0 ? void 0 : _b.kernelspecs[kernelPreference.name || '']) === null || _c === void 0 ? void 0 : _c.display_name) !== null && _d !== void 0 ? _d : '');
            }
            return trans.__('Console');
        },
        icon: args => (args['isPalette'] ? undefined : ui_components_lib_index_js_.consoleIcon),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    isPalette: {
                        type: 'boolean',
                        description: trans.__('Whether the command is executed from the palette')
                    },
                    isLauncher: {
                        type: 'boolean',
                        description: trans.__('Whether the command is executed from the launcher')
                    },
                    kernelPreference: {
                        type: 'object',
                        description: trans.__('The kernel preference for the console')
                    },
                    basePath: {
                        type: 'string',
                        description: trans.__('The base path for the console')
                    },
                    cwd: {
                        type: 'string',
                        description: trans.__('The current working directory')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    },
                    ref: {
                        type: 'string',
                        description: trans.__('The reference widget id for the insert location')
                    },
                    insertMode: {
                        type: 'string',
                        description: trans.__('The tab insert mode')
                    }
                }
            }
        },
        execute: args => {
            var _a;
            const basePath = (_a = (args['basePath'] ||
                args['cwd'] ||
                (filebrowser === null || filebrowser === void 0 ? void 0 : filebrowser.model.path))) !== null && _a !== void 0 ? _a : '';
            return createConsole({ basePath, ...args });
        }
    });
    // Get the current widget and activate unless the args specify otherwise.
    function getCurrent(args) {
        var _a;
        const widget = args[lib_index_js_.SemanticCommand.WIDGET]
            ? (_a = tracker.find(panel => panel.id === args[lib_index_js_.SemanticCommand.WIDGET])) !== null && _a !== void 0 ? _a : null
            : tracker.currentWidget;
        const activate = args['activate'] !== false;
        if (activate && widget) {
            shell.activateById(widget.id);
        }
        return widget;
    }
    /**
     * Create commands to change the position of the prompt cell.
     */
    const iconMap = {
        top: ui_components_lib_index_js_.dockTopIcon,
        bottom: ui_components_lib_index_js_.dockBottomIcon,
        right: ui_components_lib_index_js_.dockRightIcon,
        left: ui_components_lib_index_js_.dockLeftIcon
    };
    promptCellPositions.forEach((position) => {
        const command = `console:prompt-to-${position}`;
        commands.addCommand(command, {
            execute: args => {
                const current = getCurrent(args);
                if (!current) {
                    return;
                }
                current.console.setConfig({ promptCellPosition: position });
            },
            isEnabled: isEnabled,
            label: trans.__(`Prompt to ${position}`),
            icon: args => (args['isPalette'] ? undefined : iconMap[position]),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        activate: {
                            type: 'boolean',
                            description: trans.__('Whether to activate the widget')
                        },
                        isPalette: {
                            type: 'boolean',
                            description: trans.__('Whether the command is executed from palette')
                        }
                    }
                }
            }
        });
        if (palette) {
            palette.addItem({
                command,
                category,
                args: { isPalette: true }
            });
        }
    });
    /**
     * Add undo command
     */
    commands.addCommand(CommandIDs.undo, {
        execute: args => {
            var _a;
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            const editor = (_a = current.console.promptCell) === null || _a === void 0 ? void 0 : _a.editor;
            if (!editor) {
                return;
            }
            editor.undo();
        },
        isEnabled: args => {
            var _a, _b, _c;
            if (!isEnabled()) {
                return false;
            }
            const editor = (_c = (_b = (_a = getCurrent(args)) === null || _a === void 0 ? void 0 : _a.console) === null || _b === void 0 ? void 0 : _b.promptCell) === null || _c === void 0 ? void 0 : _c.editor;
            if (!editor) {
                return false;
            }
            return editor.model.sharedModel.canUndo();
        },
        icon: ui_components_lib_index_js_.undoIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Undo'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        }
    });
    /**
     * Add redo command
     */
    commands.addCommand(CommandIDs.redo, {
        execute: args => {
            var _a;
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            const editor = (_a = current.console.promptCell) === null || _a === void 0 ? void 0 : _a.editor;
            if (!editor) {
                return;
            }
            editor.redo();
        },
        isEnabled: args => {
            var _a, _b, _c;
            if (!isEnabled()) {
                return false;
            }
            const editor = (_c = (_b = (_a = getCurrent(args)) === null || _a === void 0 ? void 0 : _a.console) === null || _b === void 0 ? void 0 : _b.promptCell) === null || _c === void 0 ? void 0 : _c.editor;
            if (!editor) {
                return false;
            }
            return editor.model.sharedModel.canRedo();
        },
        icon: ui_components_lib_index_js_.redoIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Redo'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.clear, {
        label: trans.__('Clear Console Cells'),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.clearIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: trans.__('Whether executed from toolbar')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            current.console.clear();
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.runUnforced, {
        label: trans.__('Run Cell (unforced)'),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.runIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: trans.__('Whether executed from toolbar')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            return current.console.execute();
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.runForced, {
        label: trans.__('Run Cell (forced)'),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.runIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: trans.__('Whether executed from toolbar')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            return current.console.execute(true);
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.linebreak, {
        label: trans.__('Insert Line Break'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            current.console.insertLinebreak();
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.replaceSelection, {
        label: trans.__('Replace Selection in Console'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    text: {
                        type: 'string',
                        description: trans.__('The text to replace the selection with')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            const text = args['text'] || '';
            current.console.replaceSelection(text);
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.interrupt, {
        label: trans.__('Interrupt Kernel'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            var _a;
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            const kernel = (_a = current.console.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
            if (kernel) {
                return kernel.interrupt();
            }
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.restart, {
        label: trans.__('Restart Kernel…'),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.refreshIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: trans.__('Whether executed from toolbar')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            return sessionDialogs.restart(current.console.sessionContext);
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.shutdown, {
        label: trans.__('Shut Down'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            return current.console.sessionContext.shutdown();
        }
    });
    commands.addCommand(CommandIDs.closeAndShutdown, {
        label: trans.__('Close and Shut Down…'),
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            return (0,lib_index_js_.showDialog)({
                title: trans.__('Shut down the console?'),
                body: trans.__('Are you sure you want to close "%1"?', current.title.label),
                buttons: [
                    lib_index_js_.Dialog.cancelButton({
                        ariaLabel: trans.__('Cancel console Shut Down')
                    }),
                    lib_index_js_.Dialog.warnButton({
                        ariaLabel: trans.__('Confirm console Shut Down')
                    })
                ]
            }).then(result => {
                if (result.button.accept) {
                    return commands
                        .execute(CommandIDs.shutdown, { activate: false })
                        .then(() => {
                        current.dispose();
                        return true;
                    });
                }
                else {
                    return false;
                }
            });
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.inject, {
        label: trans.__('Inject some code in a console.'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: trans.__('The path of the console session')
                    },
                    code: {
                        type: 'string',
                        description: trans.__('The code to inject')
                    },
                    metadata: {
                        type: 'object',
                        description: trans.__('The metadata for the code')
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                },
                required: ['path', 'code']
            }
        },
        execute: args => {
            const path = args['path'];
            tracker.find(widget => {
                var _a;
                if (((_a = widget.console.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path) === path) {
                    if (args['activate'] !== false) {
                        shell.activateById(widget.id);
                    }
                    void widget.console.inject(args['code'], args['metadata']);
                    return true;
                }
                return false;
            });
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.changeKernel, {
        label: trans.__('Change Kernel…'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            const current = getCurrent(args);
            if (!current) {
                return;
            }
            return sessionDialogs.selectKernel(current.console.sessionContext);
        },
        isEnabled
    });
    commands.addCommand(CommandIDs.getKernel, {
        label: trans.__('Get Kernel'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        },
        execute: args => {
            var _a;
            const current = getCurrent({ activate: false, ...args });
            if (!current) {
                return;
            }
            return (_a = current.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
        },
        isEnabled
    });
    // All commands with isEnabled defined directly or in a semantic commands
    const skip = [CommandIDs.create];
    const notify = () => {
        Object.values(CommandIDs)
            .filter(id => !skip.includes(id))
            .forEach(id => app.commands.notifyCommandChanged(id));
    };
    tracker.currentChanged.connect(notify);
    (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);
    if (palette) {
        // Add command palette items
        [
            CommandIDs.create,
            CommandIDs.linebreak,
            CommandIDs.clear,
            CommandIDs.runUnforced,
            CommandIDs.runForced,
            CommandIDs.restart,
            CommandIDs.interrupt,
            CommandIDs.changeKernel,
            CommandIDs.closeAndShutdown
        ].forEach(command => {
            palette.addItem({ command, category, args: { isPalette: true } });
        });
    }
    if (mainMenu) {
        // Add a close and shutdown command to the file menu.
        mainMenu.fileMenu.closeAndCleaners.add({
            id: CommandIDs.closeAndShutdown,
            isEnabled
        });
        // Add a kernel user to the Kernel menu
        mainMenu.kernelMenu.kernelUsers.changeKernel.add({
            id: CommandIDs.changeKernel,
            isEnabled
        });
        mainMenu.kernelMenu.kernelUsers.clearWidget.add({
            id: CommandIDs.clear,
            isEnabled
        });
        mainMenu.kernelMenu.kernelUsers.interruptKernel.add({
            id: CommandIDs.interrupt,
            isEnabled
        });
        mainMenu.kernelMenu.kernelUsers.restartKernel.add({
            id: CommandIDs.restart,
            isEnabled
        });
        mainMenu.kernelMenu.kernelUsers.shutdownKernel.add({
            id: CommandIDs.shutdown,
            isEnabled
        });
        // Add a code runner to the Run menu.
        mainMenu.runMenu.codeRunners.run.add({
            id: CommandIDs.runForced,
            isEnabled
        });
        // Add a clearer to the edit menu
        mainMenu.editMenu.clearers.clearCurrent.add({
            id: CommandIDs.clear,
            isEnabled
        });
        // Add undo/redo hooks to the edit menu.
        mainMenu.editMenu.undoers.redo.add({
            id: CommandIDs.redo,
            isEnabled
        });
        mainMenu.editMenu.undoers.undo.add({
            id: CommandIDs.undo,
            isEnabled
        });
        // Add kernel information to the application help menu.
        mainMenu.helpMenu.getKernel.add({
            id: CommandIDs.getKernel,
            isEnabled
        });
    }
    // For backwards compatibility and clarity, we explicitly label the run
    // keystroke with the actual effected change, rather than the generic
    // "notebook" or "terminal" interaction mode. When this interaction mode
    // affects more than just the run keystroke, we can make this menu title more
    // generic.
    const runShortcutTitles = {
        notebook: trans.__('Execute with Shift+Enter'),
        terminal: trans.__('Execute with Enter')
    };
    // Add the execute keystroke setting submenu.
    commands.addCommand(CommandIDs.interactionMode, {
        label: args => {
            var _a;
            return (_a = runShortcutTitles[args['interactionMode']]) !== null && _a !== void 0 ? _a : 'Set the console interaction mode.';
        },
        execute: async (args) => {
            const key = 'keyMap';
            try {
                await settingRegistry.set(pluginId, 'interactionMode', args['interactionMode']);
            }
            catch (reason) {
                console.error(`Failed to set ${pluginId}:${key} - ${reason.message}`);
            }
        },
        isToggled: args => args['interactionMode'] === interactionMode,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    interactionMode: {
                        type: 'string',
                        enum: ['notebook', 'terminal'],
                        description: trans.__('The interaction mode for the console')
                    }
                }
            }
        }
    });
    return tracker;
}
/**
 * Activate the completer service for console.
 */
function activateConsoleCompleterService(app, consoles, manager, translator, appSanitizer) {
    if (!manager) {
        return;
    }
    const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
    const sanitizer = appSanitizer !== null && appSanitizer !== void 0 ? appSanitizer : new lib_index_js_.Sanitizer();
    app.commands.addCommand(CommandIDs.invokeCompleter, {
        label: trans.__('Display the completion helper.'),
        execute: () => {
            const id = consoles.currentWidget && consoles.currentWidget.id;
            if (id) {
                return manager.invoke(id);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    app.commands.addCommand(CommandIDs.selectCompleter, {
        label: trans.__('Select the completion suggestion.'),
        execute: () => {
            const id = consoles.currentWidget && consoles.currentWidget.id;
            if (id) {
                return manager.select(id);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    app.commands.addKeyBinding({
        command: CommandIDs.selectCompleter,
        keys: ['Enter'],
        selector: '.jp-ConsolePanel .jp-mod-completer-active'
    });
    const updateCompleter = async (_, consolePanel) => {
        var _a, _b;
        const completerContext = {
            editor: (_b = (_a = consolePanel.console.promptCell) === null || _a === void 0 ? void 0 : _a.editor) !== null && _b !== void 0 ? _b : null,
            session: consolePanel.console.sessionContext.session,
            widget: consolePanel
        };
        await manager.updateCompleter(completerContext);
        consolePanel.console.promptCellCreated.connect((codeConsole, cell) => {
            const newContext = {
                editor: cell.editor,
                session: codeConsole.sessionContext.session,
                widget: consolePanel,
                sanitzer: sanitizer
            };
            manager.updateCompleter(newContext).catch(console.error);
        });
        consolePanel.console.sessionContext.sessionChanged.connect(() => {
            var _a, _b;
            const newContext = {
                editor: (_b = (_a = consolePanel.console.promptCell) === null || _a === void 0 ? void 0 : _a.editor) !== null && _b !== void 0 ? _b : null,
                session: consolePanel.console.sessionContext.session,
                widget: consolePanel,
                sanitizer: sanitizer
            };
            manager.updateCompleter(newContext).catch(console.error);
        });
    };
    consoles.widgetAdded.connect(updateCompleter);
    manager.activeProvidersChanged.connect(() => {
        consoles.forEach(consoleWidget => {
            updateCompleter(undefined, consoleWidget).catch(e => console.error(e));
        });
    });
}
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 76518:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/completer/style/index.js + 1 modules
var completer_style = __webpack_require__(76576);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/filebrowser/style/index.js + 1 modules
var filebrowser_style = __webpack_require__(40360);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/console/style/index.js + 1 modules
var console_style = __webpack_require__(42249);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/launcher/style/index.js + 1 modules
var launcher_style = __webpack_require__(22640);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/mainmenu/style/index.js
var mainmenu_style = __webpack_require__(70022);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/console-extension/style/base.css
var base = __webpack_require__(61923);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */















/***/ }),

/***/ 72636:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CodeConsole: () => (/* reexport */ CodeConsole),
  ConsoleHistory: () => (/* reexport */ ConsoleHistory),
  ConsolePanel: () => (/* reexport */ ConsolePanel),
  ForeignHandler: () => (/* reexport */ ForeignHandler),
  IConsoleCellExecutor: () => (/* reexport */ IConsoleCellExecutor),
  IConsoleTracker: () => (/* reexport */ IConsoleTracker),
  runCell: () => (/* reexport */ runCell)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/cells@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/cells/lib/index.js)
var index_js_ = __webpack_require__(9214);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/lib/cellexecutor.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/**
 * Run a console cell.
 *
 * @param options Cell execution options
 * @returns Execution status
 */
async function runCell({ cell, onCellExecuted, sessionContext }) {
    const onSuccess = (value) => {
        if (value && value.content.status === 'ok') {
            const content = value.content;
            // Use deprecated payloads for backwards compatibility.
            if (content.payload && content.payload.length) {
                const setNextInput = content.payload.filter(i => {
                    return i.source === 'set_next_input';
                })[0];
                if (setNextInput) {
                    const text = setNextInput.text;
                    // Ignore the `replace` value and always set the next cell.
                    cell.model.sharedModel.setSource(text);
                }
            }
            onCellExecuted({
                cell,
                executionDate: new Date(),
                success: true
            });
            return true;
        }
        else if (value && value.content.status === 'error') {
            const errorName = value.content.ename;
            const errorValue = value.content.evalue;
            onCellExecuted({
                cell,
                executionDate: new Date(),
                success: false,
                error: new Error(`KernelReplyNotOK: ${errorName} ${errorValue}`)
            });
            return false;
        }
        onCellExecuted({
            cell,
            executionDate: new Date(),
            success: false
        });
        return false;
    };
    const onFailure = (reason) => {
        onCellExecuted({
            cell,
            executionDate: new Date(),
            success: false,
            error: new Error(reason)
        });
        return false;
    };
    return index_js_.CodeCell.execute(cell, sessionContext).then(onSuccess, onFailure);
}
//# sourceMappingURL=cellexecutor.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/lib/foreign.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

const FOREIGN_CELL_CLASS = 'jp-CodeConsole-foreignCell';
/**
 * A handler for capturing API messages from other sessions that should be
 * rendered in a given parent.
 */
class ForeignHandler {
    /**
     * Construct a new foreign message handler.
     */
    constructor(options) {
        this._enabled = false;
        this._isDisposed = false;
        this.sessionContext = options.sessionContext;
        this.sessionContext.iopubMessage.connect(this.onIOPubMessage, this);
        this._parent = options.parent;
    }
    /**
     * Set whether the handler is able to inject foreign cells into a console.
     */
    get enabled() {
        return this._enabled;
    }
    set enabled(value) {
        this._enabled = value;
    }
    /**
     * The foreign handler's parent receiver.
     */
    get parent() {
        return this._parent;
    }
    /**
     * Test whether the handler is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose the resources held by the handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Handler IOPub messages.
     *
     * @returns `true` if the message resulted in a new cell injection or a
     * previously injected cell being updated and `false` for all other messages.
     */
    onIOPubMessage(sender, msg) {
        var _a;
        // Only process messages if foreign cell injection is enabled.
        if (!this._enabled) {
            return false;
        }
        const kernel = (_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!kernel) {
            return false;
        }
        // Check whether this message came from an external session.
        const parent = this._parent;
        const session = msg.parent_header.session;
        if (session === kernel.clientId) {
            return false;
        }
        const msgType = msg.header.msg_type;
        const parentHeader = msg.parent_header;
        const parentMsgId = parentHeader.msg_id;
        let cell;
        switch (msgType) {
            case 'execute_input': {
                const inputMsg = msg;
                cell = this._newCell(parentMsgId);
                const model = cell.model;
                model.executionCount = inputMsg.content.execution_count;
                model.sharedModel.setSource(inputMsg.content.code);
                model.trusted = true;
                parent.update();
                return true;
            }
            case 'execute_result':
            case 'display_data':
            case 'stream':
            case 'error': {
                cell = this._parent.getCell(parentMsgId);
                if (!cell) {
                    return false;
                }
                const output = {
                    ...msg.content,
                    output_type: msgType
                };
                cell.model.outputs.add(output);
                parent.update();
                return true;
            }
            case 'clear_output': {
                const wait = msg.content.wait;
                cell = this._parent.getCell(parentMsgId);
                if (cell) {
                    cell.model.outputs.clear(wait);
                }
                return true;
            }
            default:
                return false;
        }
    }
    /**
     * Create a new code cell for an input originated from a foreign session.
     */
    _newCell(parentMsgId) {
        const cell = this.parent.createCodeCell();
        cell.addClass(FOREIGN_CELL_CLASS);
        this._parent.addCell(cell, parentMsgId);
        return cell;
    }
}
//# sourceMappingURL=foreign.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/lib/history.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A console history manager object.
 */
class ConsoleHistory {
    /**
     * Construct a new console history object.
     */
    constructor(options) {
        this._cursor = 0;
        this._hasSession = false;
        this._history = [];
        this._placeholder = '';
        this._setByHistory = false;
        this._isDisposed = false;
        this._editor = null;
        this._filtered = [];
        const { sessionContext } = options;
        if (sessionContext) {
            this.sessionContext = sessionContext;
            void this._handleKernel();
            this.sessionContext.kernelChanged.connect(this._handleKernel, this);
        }
    }
    /**
     * The current editor used by the history manager.
     */
    get editor() {
        return this._editor;
    }
    set editor(value) {
        if (this._editor === value) {
            return;
        }
        const prev = this._editor;
        if (prev) {
            prev.edgeRequested.disconnect(this.onEdgeRequest, this);
            prev.model.sharedModel.changed.disconnect(this.onTextChange, this);
        }
        this._editor = value;
        if (value) {
            value.edgeRequested.connect(this.onEdgeRequest, this);
            value.model.sharedModel.changed.connect(this.onTextChange, this);
        }
    }
    /**
     * The placeholder text that a history session began with.
     */
    get placeholder() {
        return this._placeholder;
    }
    /**
     * Get whether the console history manager is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the console history manager.
     */
    dispose() {
        this._isDisposed = true;
        this._history.length = 0;
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Get the previous item in the console history.
     *
     * @param placeholder - The placeholder string that gets temporarily added
     * to the history only for the duration of one history session. If multiple
     * placeholders are sent within a session, only the first one is accepted.
     *
     * @returns A Promise for console command text or `undefined` if unavailable.
     */
    back(placeholder) {
        if (!this._hasSession) {
            this._hasSession = true;
            this._placeholder = placeholder;
            // Filter the history with the placeholder string.
            this.setFilter(placeholder);
            this._cursor = this._filtered.length - 1;
        }
        --this._cursor;
        this._cursor = Math.max(0, this._cursor);
        const content = this._filtered[this._cursor];
        return Promise.resolve(content);
    }
    /**
     * Get the next item in the console history.
     *
     * @param placeholder - The placeholder string that gets temporarily added
     * to the history only for the duration of one history session. If multiple
     * placeholders are sent within a session, only the first one is accepted.
     *
     * @returns A Promise for console command text or `undefined` if unavailable.
     */
    forward(placeholder) {
        if (!this._hasSession) {
            this._hasSession = true;
            this._placeholder = placeholder;
            // Filter the history with the placeholder string.
            this.setFilter(placeholder);
            this._cursor = this._filtered.length;
        }
        ++this._cursor;
        this._cursor = Math.min(this._filtered.length - 1, this._cursor);
        const content = this._filtered[this._cursor];
        return Promise.resolve(content);
    }
    /**
     * Add a new item to the bottom of history.
     *
     * @param item The item being added to the bottom of history.
     *
     * #### Notes
     * If the item being added is undefined or empty, it is ignored. If the item
     * being added is the same as the last item in history, it is ignored as well
     * so that the console's history will consist of no contiguous repetitions.
     */
    push(item) {
        if (item && item !== this._history[this._history.length - 1]) {
            this._history.push(item);
        }
        this.reset();
    }
    /**
     * Reset the history navigation state, i.e., start a new history session.
     */
    reset() {
        this._cursor = this._history.length;
        this._hasSession = false;
        this._placeholder = '';
    }
    /**
     * Populate the history collection on history reply from a kernel.
     *
     * @param value The kernel message history reply.
     *
     * #### Notes
     * History entries have the shape:
     * [session: number, line: number, input: string]
     * Contiguous duplicates are stripped out of the API response.
     */
    onHistory(value) {
        this._history.length = 0;
        let last = '';
        let current = '';
        if (value.content.status === 'ok') {
            for (let i = 0; i < value.content.history.length; i++) {
                current = value.content.history[i][2];
                if (current !== last) {
                    this._history.push((last = current));
                }
            }
        }
        // Reset the history navigation cursor back to the bottom.
        this._cursor = this._history.length;
    }
    /**
     * Handle a text change signal from the editor.
     */
    onTextChange() {
        if (this._setByHistory) {
            this._setByHistory = false;
            return;
        }
        this.reset();
    }
    /**
     * Handle an edge requested signal.
     */
    onEdgeRequest(editor, location) {
        const sharedModel = editor.model.sharedModel;
        const source = sharedModel.getSource();
        if (location === 'top' || location === 'topLine') {
            void this.back(source).then(value => {
                if (this.isDisposed || !value) {
                    return;
                }
                if (sharedModel.getSource() === value) {
                    return;
                }
                this._setByHistory = true;
                sharedModel.setSource(value);
                let columnPos = 0;
                columnPos = value.indexOf('\n');
                if (columnPos < 0) {
                    columnPos = value.length;
                }
                editor.setCursorPosition({ line: 0, column: columnPos });
            });
        }
        else {
            void this.forward(source).then(value => {
                if (this.isDisposed) {
                    return;
                }
                const text = value || this.placeholder;
                if (sharedModel.getSource() === text) {
                    return;
                }
                this._setByHistory = true;
                sharedModel.setSource(text);
                const pos = editor.getPositionAt(text.length);
                if (pos) {
                    editor.setCursorPosition(pos);
                }
            });
        }
    }
    /**
     * Handle the current kernel changing.
     */
    async _handleKernel() {
        var _a, _b;
        const kernel = (_b = (_a = this.sessionContext) === null || _a === void 0 ? void 0 : _a.session) === null || _b === void 0 ? void 0 : _b.kernel;
        if (!kernel) {
            this._history.length = 0;
            return;
        }
        return kernel.requestHistory(Private.initialRequest).then(v => {
            this.onHistory(v);
        });
    }
    /**
     * Set the filter data.
     *
     * @param filterStr - The string to use when filtering the data.
     */
    setFilter(filterStr = '') {
        // Apply the new filter and remove contiguous duplicates.
        this._filtered.length = 0;
        let last = '';
        let current = '';
        for (let i = 0; i < this._history.length; i++) {
            current = this._history[i];
            if (current !== last &&
                filterStr === current.slice(0, filterStr.length)) {
                this._filtered.push((last = current));
            }
        }
        this._filtered.push(filterStr);
    }
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    Private.initialRequest = {
        output: false,
        raw: true,
        hist_access_type: 'tail',
        n: 500
    };
})(Private || (Private = {}));
//# sourceMappingURL=history.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @jupyter/ydoc@~3.1.0 (singleton) (fallback: ../node_modules/@jupyter/ydoc/lib/index.js)
var ydoc_lib_index_js_ = __webpack_require__(88162);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var observables_lib_index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @lumino/dragdrop@~2.1.8 (singleton) (fallback: ../node_modules/@lumino/dragdrop/dist/index.es6.js)
var dragdrop_dist_index_es6_js_ = __webpack_require__(58980);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.











/**
 * The data attribute added to a widget that has an active kernel.
 */
const KERNEL_USER = 'jpKernelUser';
/**
 * The data attribute added to a widget can run code.
 */
const CODE_RUNNER = 'jpCodeRunner';
/**
 * The class name added to console widgets.
 */
const CONSOLE_CLASS = 'jp-CodeConsole';
/**
 * The class added to console cells
 */
const CONSOLE_CELL_CLASS = 'jp-Console-cell';
/**
 * The class name added to the console banner.
 */
const BANNER_CLASS = 'jp-CodeConsole-banner';
/**
 * The class name of the active prompt cell.
 */
const PROMPT_CLASS = 'jp-CodeConsole-promptCell';
/**
 * The class name of the panel that holds cell content.
 */
const CONTENT_CLASS = 'jp-CodeConsole-content';
/**
 * The class name of the panel that holds prompts.
 */
const INPUT_CLASS = 'jp-CodeConsole-input';
/**
 * The class name added to the console when an element within it is focused
 * and takes keyboard input, such as <input> and <div contenteditable>
 *
 * This class is also effective when the focused element is in shadow DOM.
 */
const READ_WRITE_CLASS = 'jp-mod-readWrite';
/**
 * The timeout in ms for execution requests to the kernel.
 */
const EXECUTION_TIMEOUT = 250;
/**
 * The mimetype used for Jupyter cell data.
 */
const JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';
/**
 * The data attribute added to a widget that can undo.
 */
const UNDOER = 'jpUndoer';
/**
 * A widget containing a Jupyter console.
 *
 * #### Notes
 * The CodeConsole class is intended to be used within a ConsolePanel
 * instance. Under most circumstances, it is not instantiated by user code.
 */
class CodeConsole extends dist_index_es6_js_.Widget {
    /**
     * Construct a console widget.
     */
    constructor(options) {
        var _a, _b, _c;
        super();
        /**
         * The configuration options for the text editor widget.
         */
        this.editorConfig = CodeConsole.defaultEditorConfig;
        this._banner = null;
        this._executed = new index_es6_js_.Signal(this);
        this._config = {};
        this._mimetype = 'text/x-ipython';
        this._msgIds = new Map();
        this._msgIdCells = new Map();
        this._promptCellCreated = new index_es6_js_.Signal(this);
        this._dragData = null;
        this._drag = null;
        this._focusedCell = null;
        this._promptResizeObserver = null;
        this._hasManualResize = false;
        this._resizeAnimationFrameId = null;
        this._translator = (_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator;
        this._executor = (_b = options.executor) !== null && _b !== void 0 ? _b : Object.freeze({ runCell: runCell });
        this.addClass(CONSOLE_CLASS);
        this.node.dataset[KERNEL_USER] = 'true';
        this.node.dataset[CODE_RUNNER] = 'true';
        this.node.dataset[UNDOER] = 'true';
        this.node.tabIndex = -1; // Allow the widget to take focus.
        // Create the panels that hold the content and input.
        const layout = (this.layout = new dist_index_es6_js_.PanelLayout());
        this._cells = new observables_lib_index_js_.ObservableList();
        this._content = new dist_index_es6_js_.Panel();
        this._input = new dist_index_es6_js_.Panel();
        this._splitPanel = new dist_index_es6_js_.SplitPanel({ spacing: 0 });
        this._splitPanel.addClass('jp-CodeConsole-split');
        this.contentFactory = options.contentFactory;
        this.modelFactory = (_c = options.modelFactory) !== null && _c !== void 0 ? _c : CodeConsole.defaultModelFactory;
        this.rendermime = options.rendermime;
        this.sessionContext = options.sessionContext;
        this._mimeTypeService = options.mimeTypeService;
        // Add top-level CSS classes.
        this._content.addClass(CONTENT_CLASS);
        this._input.addClass(INPUT_CLASS);
        layout.addWidget(this._splitPanel);
        // Listen for manual split panel resizing.
        this._splitPanel.handleMoved.connect(() => {
            this._setManualResize();
        }, this);
        // Listen for pointerdown to detect when user starts dragging the split
        // handle. We need to catch this early to prevent the ResizeObserver from
        // fighting with the user during the first drag.
        this._splitPanel.node.addEventListener('pointerdown', event => {
            const target = event.target;
            if (target.classList.contains('lm-SplitPanel-handle')) {
                this._setManualResize();
            }
        }, true);
        // initialize the console with defaults
        this.setConfig({
            clearCellsOnExecute: false,
            clearCodeContentOnExecute: true,
            hideCodeInput: false,
            promptCellPosition: 'bottom',
            showBanner: true
        });
        this._history = new ConsoleHistory({
            sessionContext: this.sessionContext
        });
        void this._onKernelChanged();
        this.sessionContext.kernelChanged.connect(this._onKernelChanged, this);
        this.sessionContext.statusChanged.connect(this._onKernelStatusChanged, this);
    }
    /**
     * A signal emitted when the console finished executing its prompt cell.
     */
    get executed() {
        return this._executed;
    }
    /**
     * A signal emitted when a new prompt cell is created.
     */
    get promptCellCreated() {
        return this._promptCellCreated;
    }
    /**
     * The list of content cells in the console.
     *
     * #### Notes
     * This list does not include the current banner or the prompt for a console.
     * It may include previous banners as raw cells.
     */
    get cells() {
        return this._cells;
    }
    /*
     * The console input prompt cell.
     */
    get promptCell() {
        const inputLayout = this._input.layout;
        if (!inputLayout) {
            return null;
        }
        return inputLayout.widgets[0] || null;
    }
    /**
     * Add a new cell to the content panel.
     *
     * @param cell - The code cell widget being added to the content panel.
     *
     * @param msgId - The optional execution message id for the cell.
     *
     * #### Notes
     * This method is meant for use by outside classes that want to add cells to a
     * console. It is distinct from the `inject` method in that it requires
     * rendered code cell widgets and does not execute them (though it can store
     * the execution message id).
     */
    addCell(cell, msgId) {
        if (this._config.clearCellsOnExecute) {
            this.clear();
        }
        cell.addClass(CONSOLE_CELL_CLASS);
        this._content.addWidget(cell);
        this._cells.push(cell);
        if (msgId) {
            this._msgIds.set(msgId, cell);
            this._msgIdCells.set(cell, msgId);
        }
        cell.disposed.connect(this._onCellDisposed, this);
        this.update();
    }
    /**
     * Add a banner cell.
     */
    addBanner() {
        if (this._banner) {
            // An old banner just becomes a normal cell now.
            const cell = this._banner;
            this._cells.push(this._banner);
            cell.disposed.connect(this._onCellDisposed, this);
        }
        // Create the banner.
        const model = this.modelFactory.createRawCell({
            sharedModel: (0,ydoc_lib_index_js_.createStandaloneCell)({
                cell_type: 'raw',
                source: '...'
            })
        });
        const banner = (this._banner = new index_js_.RawCell({
            model,
            contentFactory: this.contentFactory,
            placeholder: false,
            editorConfig: {
                autoClosingBrackets: false,
                codeFolding: false,
                highlightActiveLine: false,
                highlightTrailingWhitespace: false,
                highlightWhitespace: false,
                indentUnit: '4',
                lineNumbers: false,
                lineWrap: true,
                matchBrackets: false,
                readOnly: true,
                rulers: [],
                scrollPastEnd: false,
                smartIndent: false,
                tabSize: 4,
                theme: 'jupyter'
            }
        })).initializeState();
        banner.addClass(BANNER_CLASS);
        banner.readOnly = true;
        this._content.addWidget(banner);
    }
    /**
     * Clear the code cells.
     */
    clear() {
        // Dispose all the content cells
        const cells = this._cells;
        while (cells.length > 0) {
            cells.get(0).dispose();
        }
    }
    /**
     * Create a new cell with the built-in factory.
     */
    createCodeCell() {
        const factory = this.contentFactory;
        const options = this._createCodeCellOptions();
        const cell = factory.createCodeCell(options);
        cell.readOnly = true;
        cell.model.mimeType = this._mimetype;
        return cell;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        // Do nothing if already disposed.
        if (this.isDisposed) {
            return;
        }
        // Clean up ResizeObserver and content listener from the current prompt cell
        const promptCell = this.promptCell;
        if (promptCell) {
            if (this._promptResizeObserver) {
                this._promptResizeObserver.disconnect();
                this._promptResizeObserver = null;
            }
            promptCell.model.sharedModel.changed.disconnect(this._onPromptContentChanged, this);
        }
        this._cancelPendingResizeAdjustment();
        this._msgIdCells = null;
        this._msgIds = null;
        this._history.dispose();
        super.dispose();
    }
    /**
     * Execute the current prompt.
     *
     * @param force - Whether to force execution without checking code
     * completeness.
     *
     * @param timeout - The length of time, in milliseconds, that the execution
     * should wait for the API to determine whether code being submitted is
     * incomplete before attempting submission anyway. The default value is `250`.
     */
    async execute(force = false, timeout = EXECUTION_TIMEOUT) {
        var _a, _b;
        if (((_b = (_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.status) === 'dead') {
            return;
        }
        const promptCell = this.promptCell;
        if (!promptCell) {
            throw new Error('Cannot execute without a prompt cell');
        }
        promptCell.model.trusted = true;
        if (force) {
            // Create a new prompt cell before kernel execution to allow typeahead.
            this.newPromptCell();
            await this._execute(promptCell);
            return;
        }
        // Check whether we should execute.
        const shouldExecute = await this._shouldExecute(timeout);
        if (this.isDisposed) {
            return;
        }
        if (shouldExecute) {
            // Create a new prompt cell before kernel execution to allow typeahead.
            this.newPromptCell();
            this.promptCell.editor.focus();
            await this._execute(promptCell);
        }
        else {
            // add a newline if we shouldn't execute
            promptCell.editor.newIndentedLine();
        }
    }
    /**
     * Get a cell given a message id.
     *
     * @param msgId - The message id.
     */
    getCell(msgId) {
        return this._msgIds.get(msgId);
    }
    /**
     * Inject arbitrary code for the console to execute immediately.
     *
     * @param code - The code contents of the cell being injected.
     *
     * @returns A promise that indicates when the injected cell's execution ends.
     */
    inject(code, metadata = {}) {
        var _a;
        const cell = this.createCodeCell();
        cell.model.sharedModel.setSource(code);
        for (const key of Object.keys(metadata)) {
            cell.model.setMetadata(key, metadata[key]);
        }
        this.addCell(cell);
        if (this._config.hideCodeInput) {
            (_a = cell.inputArea) === null || _a === void 0 ? void 0 : _a.setHidden(true);
        }
        return this._execute(cell);
    }
    /**
     * Insert a line break in the prompt cell.
     */
    insertLinebreak() {
        const promptCell = this.promptCell;
        if (!promptCell) {
            return;
        }
        promptCell.editor.newIndentedLine();
    }
    /**
     * Replaces the selected text in the prompt cell.
     *
     * @param text - The text to replace the selection.
     */
    replaceSelection(text) {
        var _a, _b;
        const promptCell = this.promptCell;
        if (!promptCell) {
            return;
        }
        (_b = (_a = promptCell.editor).replaceSelection) === null || _b === void 0 ? void 0 : _b.call(_a, text);
    }
    /**
     * Set configuration options for the console.
     */
    setConfig(config) {
        const { clearCellsOnExecute, clearCodeContentOnExecute, hideCodeInput, promptCellPosition, showBanner } = config;
        this._config = {
            clearCellsOnExecute: clearCellsOnExecute !== null && clearCellsOnExecute !== void 0 ? clearCellsOnExecute : this._config.clearCellsOnExecute,
            clearCodeContentOnExecute: clearCodeContentOnExecute !== null && clearCodeContentOnExecute !== void 0 ? clearCodeContentOnExecute : this._config.clearCodeContentOnExecute,
            hideCodeInput: hideCodeInput !== null && hideCodeInput !== void 0 ? hideCodeInput : this._config.hideCodeInput,
            promptCellPosition: promptCellPosition !== null && promptCellPosition !== void 0 ? promptCellPosition : this._config.promptCellPosition,
            showBanner: showBanner !== null && showBanner !== void 0 ? showBanner : this._config.showBanner
        };
        this._updateLayout();
    }
    /**
     * Serialize the output.
     *
     * #### Notes
     * This only serializes the code cells and the prompt cell if it exists, and
     * skips any old banner cells.
     */
    serialize() {
        const cells = [];
        for (const cell of this._cells) {
            const model = cell.model;
            if ((0,index_js_.isCodeCellModel)(model)) {
                cells.push(model.toJSON());
            }
        }
        if (this.promptCell) {
            cells.push(this.promptCell.model.toJSON());
        }
        return cells;
    }
    /**
     * Handle `mousedown` events for the widget.
     */
    _evtMouseDown(event) {
        const { button, shiftKey } = event;
        // We only handle main or secondary button actions.
        if (!(button === 0 || button === 2) ||
            // Shift right-click gives the browser default behavior.
            (shiftKey && button === 2)) {
            return;
        }
        let target = event.target;
        const cellFilter = (node) => node.classList.contains(CONSOLE_CELL_CLASS);
        let cellIndex = index_js_.CellDragUtils.findCell(target, this._cells, cellFilter);
        if (cellIndex === -1) {
            // `event.target` sometimes gives an orphaned node in
            // Firefox 57, which can have `null` anywhere in its parent line. If we fail
            // to find a cell using `event.target`, try again using a target
            // reconstructed from the position of the click event.
            target = document.elementFromPoint(event.clientX, event.clientY);
            cellIndex = index_js_.CellDragUtils.findCell(target, this._cells, cellFilter);
        }
        if (cellIndex === -1) {
            return;
        }
        const cell = this._cells.get(cellIndex);
        const targetArea = index_js_.CellDragUtils.detectTargetArea(cell, event.target);
        if (targetArea === 'prompt') {
            this._dragData = {
                pressX: event.clientX,
                pressY: event.clientY,
                index: cellIndex
            };
            this._focusedCell = cell;
            document.addEventListener('mouseup', this, true);
            document.addEventListener('mousemove', this, true);
            event.preventDefault();
        }
    }
    /**
     * Handle `mousemove` event of widget
     */
    _evtMouseMove(event) {
        const data = this._dragData;
        if (data &&
            index_js_.CellDragUtils.shouldStartDrag(data.pressX, data.pressY, event.clientX, event.clientY)) {
            void this._startDrag(data.index, event.clientX, event.clientY);
        }
    }
    /**
     * Start a drag event
     */
    _startDrag(index, clientX, clientY) {
        const cellModel = this._focusedCell.model;
        const selected = [cellModel.toJSON()];
        const dragImage = index_js_.CellDragUtils.createCellDragImage(this._focusedCell, selected);
        this._drag = new dragdrop_dist_index_es6_js_.Drag({
            mimeData: new dist_index_js_.MimeData(),
            dragImage,
            proposedAction: 'copy',
            supportedActions: 'copy',
            source: this
        });
        this._drag.mimeData.setData(JUPYTER_CELL_MIME, selected);
        const textContent = cellModel.sharedModel.getSource();
        this._drag.mimeData.setData('text/plain', textContent);
        this._focusedCell = null;
        document.removeEventListener('mousemove', this, true);
        document.removeEventListener('mouseup', this, true);
        return this._drag.start(clientX, clientY).then(() => {
            if (this.isDisposed) {
                return;
            }
            this._drag = null;
            this._dragData = null;
        });
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event -The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the notebook panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'keydown':
                this._evtKeyDown(event);
                break;
            case 'mousedown':
                this._evtMouseDown(event);
                break;
            case 'mousemove':
                this._evtMouseMove(event);
                break;
            case 'mouseup':
                this._evtMouseUp(event);
                break;
            case 'resize':
                this._splitPanel.fit();
                break;
            case 'focusin':
                this._evtFocusIn(event);
                break;
            case 'focusout':
                this._evtFocusOut(event);
                break;
            default:
                break;
        }
    }
    /**
     * Handle `after_attach` messages for the widget.
     */
    onAfterAttach(msg) {
        const node = this.node;
        node.addEventListener('keydown', this, true);
        node.addEventListener('click', this);
        node.addEventListener('mousedown', this);
        node.addEventListener('focusin', this);
        node.addEventListener('focusout', this);
        // Create a prompt if necessary.
        if (!this.promptCell) {
            this.newPromptCell();
        }
        else {
            this.promptCell.editor.focus();
            this.update();
        }
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        const node = this.node;
        node.removeEventListener('keydown', this, true);
        node.removeEventListener('click', this);
        node.removeEventListener('focusin', this);
        node.removeEventListener('focusout', this);
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        const editor = this.promptCell && this.promptCell.editor;
        if (editor) {
            editor.focus();
        }
        this.update();
    }
    /**
     * Make a new prompt cell.
     */
    newPromptCell() {
        var _a, _b, _c, _d, _e;
        let promptCell = this.promptCell;
        const input = this._input;
        const previousContent = (_a = promptCell === null || promptCell === void 0 ? void 0 : promptCell.model.sharedModel.getSource()) !== null && _a !== void 0 ? _a : '';
        const previousCursorPosition = (_b = promptCell === null || promptCell === void 0 ? void 0 : promptCell.editor) === null || _b === void 0 ? void 0 : _b.getCursorPosition();
        // Make the last prompt read-only, clear its signals, and move to content.
        if (promptCell) {
            promptCell.readOnly = true;
            promptCell.removeClass(PROMPT_CLASS);
            // Disconnect the content change listener
            promptCell.model.sharedModel.changed.disconnect(this._onPromptContentChanged, this);
            // Schedule execution of signal clearance to happen later so that
            // the `readOnly` configuration gets updated before editor signals
            // get disconnected (see `Cell.onUpdateRequest`).
            const oldCell = promptCell;
            const promptResizeObserver = this._promptResizeObserver;
            requestIdleCallback(() => {
                // Clear the signals to avoid memory leaks
                index_es6_js_.Signal.clearData(oldCell.editor);
                if (promptResizeObserver) {
                    promptResizeObserver.disconnect();
                }
            });
            // Ensure to clear the cursor
            (_c = promptCell.editor) === null || _c === void 0 ? void 0 : _c.blur();
            const child = input.widgets[0];
            child.parent = null;
            if (this._config.hideCodeInput) {
                (_d = promptCell.inputArea) === null || _d === void 0 ? void 0 : _d.setHidden(true);
            }
            this.addCell(promptCell);
        }
        // Create the new prompt cell.
        const factory = this.contentFactory;
        const options = this._createCodeCellOptions();
        promptCell = factory.createCodeCell(options);
        promptCell.model.mimeType = this._mimetype;
        promptCell.addClass(PROMPT_CLASS);
        // Add the prompt cell to the DOM, making `this.promptCell` valid again.
        this._input.addWidget(promptCell);
        this._history.editor = promptCell.editor;
        // Detect height changes via ResizeObserver for when the cell grows
        if (promptCell.node) {
            this._promptResizeObserver = new ResizeObserver(() => {
                this._scheduleInputSizeAdjustment();
            });
            this._promptResizeObserver.observe(promptCell.node);
        }
        // Also listen for content changes to handle shrinking when content is removed (e.g. line deletes)
        promptCell.model.sharedModel.changed.connect(this._onPromptContentChanged, this);
        if (!this._config.clearCodeContentOnExecute) {
            promptCell.model.sharedModel.setSource(previousContent);
            if (previousCursorPosition) {
                (_e = promptCell.editor) === null || _e === void 0 ? void 0 : _e.setCursorPosition(previousCursorPosition);
            }
        }
        this._promptCellCreated.emit(promptCell);
    }
    /**
     * Handle `update-request` messages.
     */
    onUpdateRequest(msg) {
        widget_Private.scrollToBottom(this._content.node);
    }
    /**
     * Handle the `'keydown'` event for the widget.
     */
    _evtKeyDown(event) {
        const editor = this.promptCell && this.promptCell.editor;
        if (!editor) {
            return;
        }
        if (event.keyCode === 13 && !editor.hasFocus()) {
            event.preventDefault();
            editor.focus();
        }
        else if (event.keyCode === 27 && editor.hasFocus()) {
            // Set to command mode
            event.preventDefault();
            event.stopPropagation();
            this.node.focus();
        }
    }
    /**
     * Handle the `'mouseup'` event for the widget.
     */
    _evtMouseUp(event) {
        if (this.promptCell &&
            this.promptCell.node.contains(event.target)) {
            this.promptCell.editor.focus();
        }
    }
    /**
     * Handle `focus` events for the widget.
     */
    _evtFocusIn(event) {
        // Update read-write class state.
        this._updateReadWrite();
    }
    /**
     * Handle `focusout` events for the widget.
     */
    _evtFocusOut(event) {
        // Update read-write class state.
        this._updateReadWrite();
    }
    /**
     * Execute the code in the current prompt cell.
     */
    async _execute(cell) {
        const source = cell.model.sharedModel.getSource();
        this._history.push(source);
        // If the source of the console is just "clear", clear the console as we
        // do in IPython or QtConsole.
        if (source === 'clear' || source === '%clear') {
            this.clear();
            return Promise.resolve(void 0);
        }
        cell.model.contentChanged.connect(this.update, this);
        const options = {
            cell,
            sessionContext: this.sessionContext,
            onCellExecuted: (args) => {
                this._executed.emit(args.executionDate);
                if (args.error) {
                    for (const cell of this._cells) {
                        if (cell.model.executionCount === null) {
                            cell.model.executionState = 'idle';
                        }
                    }
                }
            }
        };
        try {
            await this._executor.runCell(options);
        }
        finally {
            if (!this.isDisposed) {
                cell.model.contentChanged.disconnect(this.update, this);
                this.update();
            }
        }
    }
    /**
     * Update the console based on the kernel info.
     */
    _handleInfo(info) {
        if (info.status !== 'ok') {
            if (this._banner) {
                this._banner.model.sharedModel.setSource('Error in getting kernel banner');
            }
            return;
        }
        if (this._banner) {
            this._banner.model.sharedModel.setSource(info.banner);
        }
        const lang = info.language_info;
        this._mimetype = this._mimeTypeService.getMimeTypeByLanguage(lang);
        if (this.promptCell) {
            this.promptCell.model.mimeType = this._mimetype;
        }
    }
    /**
     * Create the options used to initialize a code cell widget.
     */
    _createCodeCellOptions() {
        const contentFactory = this.contentFactory;
        const modelFactory = this.modelFactory;
        const model = modelFactory.createCodeCell({});
        const rendermime = this.rendermime;
        const editorConfig = this.editorConfig;
        return {
            model,
            rendermime,
            contentFactory,
            editorConfig,
            placeholder: false,
            translator: this._translator
        };
    }
    /**
     * Handle cell disposed signals.
     */
    _onCellDisposed(sender, args) {
        if (!this.isDisposed) {
            this._cells.removeValue(sender);
            const msgId = this._msgIdCells.get(sender);
            if (msgId) {
                this._msgIdCells.delete(sender);
                this._msgIds.delete(msgId);
            }
        }
    }
    /**
     * Test whether we should execute the prompt cell.
     */
    _shouldExecute(timeout) {
        const promptCell = this.promptCell;
        if (!promptCell) {
            return Promise.resolve(false);
        }
        const model = promptCell.model;
        const code = model.sharedModel.getSource();
        return new Promise((resolve, reject) => {
            var _a;
            const timer = setTimeout(() => {
                resolve(true);
            }, timeout);
            const kernel = (_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
            if (!kernel) {
                resolve(false);
                return;
            }
            kernel
                .requestIsComplete({ code })
                .then(isComplete => {
                clearTimeout(timer);
                if (this.isDisposed) {
                    resolve(false);
                }
                if (isComplete.content.status !== 'incomplete') {
                    resolve(true);
                    return;
                }
                resolve(false);
            })
                .catch(() => {
                resolve(true);
            });
        });
    }
    /**
     * Handle a change to the kernel.
     */
    async _onKernelChanged() {
        var _a;
        this.clear();
        if (this._banner) {
            this._banner.dispose();
            this._banner = null;
        }
        if (this._config.showBanner) {
            this.addBanner();
        }
        if ((_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel) {
            this._handleInfo(await this.sessionContext.session.kernel.info);
        }
    }
    /**
     * Handle a change to the kernel status.
     */
    async _onKernelStatusChanged() {
        var _a;
        const kernel = (_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if ((kernel === null || kernel === void 0 ? void 0 : kernel.status) === 'restarting') {
            if (this._config.showBanner) {
                this.addBanner();
            }
            this._handleInfo(await (kernel === null || kernel === void 0 ? void 0 : kernel.info));
        }
    }
    /**
     * Update the console node with class indicating read-write state.
     */
    _updateReadWrite() {
        // TODO: de-duplicate with code in notebook/src/widget.ts
        const inReadWrite = lib_index_js_.DOMUtils.hasActiveEditableElement(this.node);
        this.node.classList.toggle(READ_WRITE_CLASS, inReadWrite);
    }
    /**
     * Calculate relative sizes for split panel based on prompt cell position.
     */
    _calculateRelativeSizes() {
        const { promptCellPosition = 'bottom' } = this._config;
        let sizes = [1, 1];
        if (promptCellPosition === 'top') {
            sizes = [1, 100];
        }
        else if (promptCellPosition === 'bottom') {
            sizes = [100, 1];
        }
        return sizes;
    }
    /**
     * Set the manual resize flag and cancel any pending auto-resize.
     */
    _setManualResize() {
        this._hasManualResize = true;
        this._cancelPendingResizeAdjustment();
    }
    /**
     * Cancel any pending resize adjustment animation frame.
     */
    _cancelPendingResizeAdjustment() {
        if (this._resizeAnimationFrameId !== null) {
            cancelAnimationFrame(this._resizeAnimationFrameId);
            this._resizeAnimationFrameId = null;
        }
    }
    /**
     * Schedule an input size adjustment using requestAnimationFrame to coalesce
     * multiple rapid events into a single layout update.
     */
    _scheduleInputSizeAdjustment() {
        // Don't schedule if manual resize is active
        if (this._hasManualResize) {
            return;
        }
        if (this._resizeAnimationFrameId === null) {
            this._resizeAnimationFrameId = requestAnimationFrame(() => {
                this._resizeAnimationFrameId = null;
                this._adjustSplitPanelForInputGrowth();
            });
        }
    }
    /**
     * Handle changes to the prompt cell content.
     */
    _onPromptContentChanged() {
        this._scheduleInputSizeAdjustment();
    }
    /**
     * Adjust split panel sizes when the input cell grows or shrinks.
     */
    _adjustSplitPanelForInputGrowth() {
        if (this.isDisposed ||
            !this._input.node ||
            !this._content.node ||
            this._hasManualResize) {
            return;
        }
        const { promptCellPosition = 'bottom' } = this._config;
        // Only adjust for vertical layouts (top/bottom positions)
        if (promptCellPosition === 'left' || promptCellPosition === 'right') {
            return;
        }
        const promptCell = this.promptCell;
        if (!promptCell || !promptCell.editor) {
            return;
        }
        // Get the editor's content height directly from CodeMirror.
        // This gives us the intrinsic height needed regardless of container size.
        const cmEditor = promptCell.editor;
        const editorContentHeight = cmEditor.editor.contentHeight;
        // Get additional padding from the input area and cell
        const cellPadding = this._getInputCellPadding();
        const inputHeight = editorContentHeight + cellPadding;
        const totalHeight = this._splitPanel.node.clientHeight;
        if (totalHeight <= 0 || inputHeight <= 0) {
            this._splitPanel.fit();
            return;
        }
        const remainingHeight = totalHeight - inputHeight;
        let contentRatio;
        let inputRatio;
        if (promptCellPosition === 'bottom') {
            contentRatio = remainingHeight / totalHeight;
            inputRatio = inputHeight / totalHeight;
        }
        else {
            inputRatio = inputHeight / totalHeight;
            contentRatio = remainingHeight / totalHeight;
        }
        // Convert to the format expected by setRelativeSizes
        const totalRatio = contentRatio + inputRatio;
        if (totalRatio > 0) {
            const normalizedSizes = promptCellPosition === 'bottom'
                ? [contentRatio / totalRatio, inputRatio / totalRatio]
                : [inputRatio / totalRatio, contentRatio / totalRatio];
            this._splitPanel.setRelativeSizes(normalizedSizes);
        }
    }
    /**
     * Get the total vertical padding for the input cell (excluding editor content).
     */
    _getInputCellPadding() {
        var _a;
        const inputPanelNode = this._input.node;
        const inputPanelStyle = window.getComputedStyle(inputPanelNode);
        const inputPanelPadding = parseFloat(inputPanelStyle.paddingTop) +
            parseFloat(inputPanelStyle.paddingBottom);
        const promptCell = this.promptCell;
        if (!promptCell) {
            return inputPanelPadding;
        }
        const cellStyle = window.getComputedStyle(promptCell.node);
        const cellPadding = parseFloat(cellStyle.paddingTop) + parseFloat(cellStyle.paddingBottom);
        // Account for editor wrapper border (CodeMirror's contentHeight includes its own padding)
        const editorWrapper = (_a = promptCell.editorWidget) === null || _a === void 0 ? void 0 : _a.node;
        let editorBorder = 0;
        if (editorWrapper) {
            const editorStyle = window.getComputedStyle(editorWrapper);
            editorBorder =
                parseFloat(editorStyle.borderTopWidth) +
                    parseFloat(editorStyle.borderBottomWidth);
        }
        return inputPanelPadding + cellPadding + editorBorder;
    }
    /**
     * Update the layout of the code console.
     */
    _updateLayout() {
        const { promptCellPosition = 'bottom' } = this._config;
        // Reset manual resize flag when layout changes
        this._hasManualResize = false;
        this._splitPanel.orientation = ['left', 'right'].includes(promptCellPosition)
            ? 'horizontal'
            : 'vertical';
        // Insert the content and input panes into the widget.
        dist_index_es6_js_.SplitPanel.setStretch(this._content, 1);
        dist_index_es6_js_.SplitPanel.setStretch(this._input, 1);
        if (promptCellPosition === 'bottom' || promptCellPosition === 'right') {
            this._splitPanel.insertWidget(0, this._content);
            this._splitPanel.insertWidget(1, this._input);
        }
        else {
            this._splitPanel.insertWidget(0, this._input);
            this._splitPanel.insertWidget(1, this._content);
        }
        this._splitPanel.setRelativeSizes(this._calculateRelativeSizes());
        requestAnimationFrame(() => {
            // adjust the sizes if the prompt cell is moved with code in it
            this._adjustSplitPanelForInputGrowth();
        });
    }
}
/**
 * A namespace for CodeConsole statics.
 */
(function (CodeConsole) {
    /**
     * Default console editor configuration
     */
    CodeConsole.defaultEditorConfig = {
        codeFolding: false,
        lineNumbers: false
    };
    /**
     * Default implementation of `IContentFactory`.
     */
    class ContentFactory extends index_js_.Cell.ContentFactory {
        /**
         * Create a new code cell widget.
         *
         * #### Notes
         * If no cell content factory is passed in with the options, the one on the
         * notebook content factory is used.
         */
        createCodeCell(options) {
            return new index_js_.CodeCell(options).initializeState();
        }
        /**
         * Create a new raw cell widget.
         *
         * #### Notes
         * If no cell content factory is passed in with the options, the one on the
         * notebook content factory is used.
         */
        createRawCell(options) {
            return new index_js_.RawCell(options).initializeState();
        }
    }
    CodeConsole.ContentFactory = ContentFactory;
    /**
     * The default implementation of an `IModelFactory`.
     */
    class ModelFactory {
        /**
         * Create a new cell model factory.
         */
        constructor(options = {}) {
            this.codeCellContentFactory =
                options.codeCellContentFactory || index_js_.CodeCellModel.defaultContentFactory;
        }
        /**
         * Create a new code cell.
         * @param options - The data to use for the original source data.
         * @returns A new code cell. If a source cell is provided, the
        new cell will be initialized with the data from the source.
        If the contentFactory is not provided, the instance
        `codeCellContentFactory` will be used.
         */
        createCodeCell(options = {}) {
            if (!options.contentFactory) {
                options.contentFactory = this.codeCellContentFactory;
            }
            return new index_js_.CodeCellModel(options);
        }
        /**
         * Create a new raw cell.
         * @param options - The data to use for the original source data.
         * @returns A new raw cell. If a source cell is provided, the
        new cell will be initialized with the data from the source.
         */
        createRawCell(options) {
            return new index_js_.RawCellModel(options);
        }
    }
    CodeConsole.ModelFactory = ModelFactory;
    /**
     * The default `ModelFactory` instance.
     */
    CodeConsole.defaultModelFactory = new ModelFactory({});
})(CodeConsole || (CodeConsole = {}));
/**
 * A namespace for console widget private data.
 */
var widget_Private;
(function (Private) {
    /**
     * Jump to the bottom of a node.
     *
     * @param node - The scrollable element.
     */
    function scrollToBottom(node) {
        node.scrollTop = node.scrollHeight - node.clientHeight;
    }
    Private.scrollToBottom = scrollToBottom;
})(widget_Private || (widget_Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/lib/panel.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The class name added to console panels.
 */
const PANEL_CLASS = 'jp-ConsolePanel';
/**
 * A panel which contains a console and the ability to add other children.
 */
class ConsolePanel extends lib_index_js_.MainAreaWidget {
    /**
     * Construct a console panel.
     */
    constructor(options) {
        super({ content: new dist_index_es6_js_.Panel() });
        this._executed = null;
        this._connected = null;
        this.addClass(PANEL_CLASS);
        let { executor, rendermime, mimeTypeService, path, basePath, name, manager, modelFactory, sessionContext, translator } = options;
        this.translator = translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator;
        const trans = this.translator.load('jupyterlab');
        const contentFactory = (this.contentFactory = options.contentFactory);
        const count = panel_Private.count++;
        if (!path) {
            path = coreutils_lib_index_js_.PathExt.join(basePath || '', `console-${count}-${dist_index_js_.UUID.uuid4()}`);
        }
        sessionContext = this._sessionContext =
            sessionContext !== null && sessionContext !== void 0 ? sessionContext : new lib_index_js_.SessionContext({
                kernelManager: manager.kernels,
                sessionManager: manager.sessions,
                specsManager: manager.kernelspecs,
                path: manager.contents.localPath(path),
                name: name || trans.__('Console %1', count),
                type: 'console',
                kernelPreference: options.kernelPreference,
                setBusy: options.setBusy
            });
        const resolver = new rendermime_lib_index_js_.RenderMimeRegistry.UrlResolver({
            path,
            contents: manager.contents
        });
        rendermime = rendermime.clone({ resolver });
        this.console = contentFactory.createConsole({
            executor,
            rendermime,
            sessionContext: sessionContext,
            mimeTypeService,
            contentFactory,
            modelFactory,
            translator
        });
        this.content.addWidget(this.console);
        void sessionContext.initialize().then(async (value) => {
            var _a;
            if (value) {
                await ((_a = options.sessionDialogs) !== null && _a !== void 0 ? _a : new lib_index_js_.SessionContextDialogs({ translator })).selectKernel(sessionContext);
            }
            this._connected = new Date();
            this._updateTitlePanel();
        });
        this.console.executed.connect(this._onExecuted, this);
        this._updateTitlePanel();
        sessionContext.kernelChanged.connect(this._updateTitlePanel, this);
        sessionContext.propertyChanged.connect(this._updateTitlePanel, this);
        this.title.icon = ui_components_lib_index_js_.consoleIcon;
        this.title.closable = true;
        this.id = `console-${count}`;
    }
    /**
     * The session used by the panel.
     */
    get sessionContext() {
        return this._sessionContext;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        this.sessionContext.dispose();
        this.console.dispose();
        super.dispose();
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        const prompt = this.console.promptCell;
        if (prompt) {
            prompt.editor.focus();
        }
    }
    /**
     * Handle `'close-request'` messages.
     */
    onCloseRequest(msg) {
        super.onCloseRequest(msg);
        this.dispose();
    }
    /**
     * Handle a console execution.
     */
    _onExecuted(sender, args) {
        this._executed = args;
        this._updateTitlePanel();
    }
    /**
     * Update the console panel title.
     */
    _updateTitlePanel() {
        panel_Private.updateTitle(this, this._connected, this._executed, this.translator);
    }
}
/**
 * A namespace for ConsolePanel statics.
 */
(function (ConsolePanel) {
    /**
     * Default implementation of `IContentFactory`.
     */
    class ContentFactory extends CodeConsole.ContentFactory {
        /**
         * Create a new console panel.
         */
        createConsole(options) {
            return new CodeConsole(options);
        }
    }
    ConsolePanel.ContentFactory = ContentFactory;
    /**
     * The console renderer token.
     */
    ConsolePanel.IContentFactory = new dist_index_js_.Token('@jupyterlab/console:IContentFactory', 'A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.');
})(ConsolePanel || (ConsolePanel = {}));
/**
 * A namespace for private data.
 */
var panel_Private;
(function (Private) {
    /**
     * The counter for new consoles.
     */
    Private.count = 1;
    /**
     * Update the title of a console panel.
     */
    function updateTitle(panel, connected, executed, translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const sessionContext = panel.console.sessionContext.session;
        if (sessionContext) {
            // FIXME:
            let caption = trans.__('Name: %1\n', sessionContext.name) +
                trans.__('Directory: %1\n', coreutils_lib_index_js_.PathExt.dirname(sessionContext.path)) +
                trans.__('Kernel: %1', panel.console.sessionContext.kernelDisplayName);
            if (connected) {
                caption += trans.__('\nConnected: %1', coreutils_lib_index_js_.Time.format(connected.toISOString()));
            }
            if (executed) {
                caption += trans.__('\nLast Execution: %1');
            }
            panel.title.label = sessionContext.name;
            panel.title.caption = caption;
        }
        else {
            panel.title.label = trans.__('Console');
            panel.title.caption = '';
        }
    }
    Private.updateTitle = updateTitle;
})(panel_Private || (panel_Private = {}));
//# sourceMappingURL=panel.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The console tracker token.
 */
const IConsoleTracker = new dist_index_js_.Token('@jupyterlab/console:IConsoleTracker', `A widget tracker for code consoles.
  Use this if you want to be able to iterate over and interact with code consoles
  created by the application.`);
/**
 * The Console cell executor token.
 */
const IConsoleCellExecutor = new dist_index_js_.Token('@jupyterlab/console:IConsoleCellExecutor', `The console cell executor`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module console
 */






//# sourceMappingURL=index.js.map

/***/ }),

/***/ 42249:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@lumino/dragdrop/style/index.js + 1 modules
var dragdrop_style = __webpack_require__(49868);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/cells/style/index.js + 2 modules
var cells_style = __webpack_require__(33230);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/console/style/base.css
var base = __webpack_require__(43313);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/console/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */












/***/ }),

/***/ 24598:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ActivityMonitor = void 0;
const signaling_1 = __webpack_require__(46257);
/**
 * A class that monitors activity on a signal.
 */
class ActivityMonitor {
    /**
     * Construct a new activity monitor.
     */
    constructor(options) {
        this._timer = -1;
        this._timeout = -1;
        this._isDisposed = false;
        this._activityStopped = new signaling_1.Signal(this);
        options.signal.connect(this._onSignalFired, this);
        this._timeout = options.timeout || 1000;
    }
    /**
     * A signal emitted when activity has ceased.
     */
    get activityStopped() {
        return this._activityStopped;
    }
    /**
     * The timeout associated with the monitor, in milliseconds.
     */
    get timeout() {
        return this._timeout;
    }
    set timeout(value) {
        this._timeout = value;
    }
    /**
     * Test whether the monitor has been disposed.
     *
     * #### Notes
     * This is a read-only property.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the activity monitor.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_1.Signal.clearData(this);
    }
    /**
     * A signal handler for the monitored signal.
     */
    _onSignalFired(sender, args) {
        clearTimeout(this._timer);
        this._sender = sender;
        this._args = args;
        this._timer = setTimeout(() => {
            this._activityStopped.emit({
                sender: this._sender,
                args: this._args
            });
        }, this._timeout);
    }
}
exports.ActivityMonitor = ActivityMonitor;
//# sourceMappingURL=activitymonitor.js.map

/***/ }),

/***/ 2866:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module coreutils
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
__exportStar(__webpack_require__(24598), exports);
__exportStar(__webpack_require__(51632), exports);
__exportStar(__webpack_require__(79844), exports);
__exportStar(__webpack_require__(94741), exports);
__exportStar(__webpack_require__(86083), exports);
__exportStar(__webpack_require__(12361), exports);
__exportStar(__webpack_require__(82053), exports);
__exportStar(__webpack_require__(84157), exports);
__exportStar(__webpack_require__(59635), exports);
__exportStar(__webpack_require__(34410), exports);
__exportStar(__webpack_require__(53227), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 51632:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=interfaces.js.map

/***/ }),

/***/ 79844:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LruCache = void 0;
const DEFAULT_MAX_SIZE = 128;
/** A least-recently-used cache. */
class LruCache {
    constructor(options = {}) {
        this._map = new Map();
        this._maxSize = (options === null || options === void 0 ? void 0 : options.maxSize) || DEFAULT_MAX_SIZE;
    }
    /**
     * Return the current size of the cache.
     */
    get size() {
        return this._map.size;
    }
    /**
     * Clear the values in the cache.
     */
    clear() {
        this._map.clear();
    }
    /**
     * Get a value (or null) from the cache, pushing the item to the front of the cache.
     */
    get(key) {
        const item = this._map.get(key) || null;
        if (item != null) {
            this._map.delete(key);
            this._map.set(key, item);
        }
        return item;
    }
    /**
     * Set a value in the cache, potentially evicting an old item.
     */
    set(key, value) {
        if (this._map.size >= this._maxSize) {
            this._map.delete(this._map.keys().next().value);
        }
        this._map.set(key, value);
    }
}
exports.LruCache = LruCache;
//# sourceMappingURL=lru.js.map

/***/ }),

/***/ 94741:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MarkdownCodeBlocks = void 0;
/**
 * The namespace for code block functions which help
 * in extract code from markdown text
 */
var MarkdownCodeBlocks;
(function (MarkdownCodeBlocks) {
    MarkdownCodeBlocks.CODE_BLOCK_MARKER = '```';
    const markdownExtensions = [
        '.markdown',
        '.mdown',
        '.mkdn',
        '.md',
        '.mkd',
        '.mdwn',
        '.mdtxt',
        '.mdtext',
        '.text',
        '.txt',
        '.Rmd'
    ];
    class MarkdownCodeBlock {
        constructor(startLine) {
            this.startLine = startLine;
            this.code = '';
            this.endLine = -1;
        }
    }
    MarkdownCodeBlocks.MarkdownCodeBlock = MarkdownCodeBlock;
    /**
     * Check whether the given file extension is a markdown extension
     * @param extension - A file extension
     *
     * @returns true/false depending on whether this is a supported markdown extension
     */
    function isMarkdown(extension) {
        return markdownExtensions.indexOf(extension) > -1;
    }
    MarkdownCodeBlocks.isMarkdown = isMarkdown;
    /**
     * Construct all code snippets from current text
     * (this could be potentially optimized if we can cache and detect differences)
     * @param text - A string to parse codeblocks from
     *
     * @returns An array of MarkdownCodeBlocks.
     */
    function findMarkdownCodeBlocks(text) {
        if (!text || text === '') {
            return [];
        }
        const lines = text.split('\n');
        const codeBlocks = [];
        let currentBlock = null;
        for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
            const line = lines[lineIndex];
            const lineContainsMarker = line.indexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER) === 0;
            const constructingBlock = currentBlock != null;
            // Skip this line if it is not part of any code block and doesn't contain a marker.
            if (!lineContainsMarker && !constructingBlock) {
                continue;
            }
            // Check if we are already constructing a code block.
            if (!constructingBlock) {
                // Start constructing a new code block.
                currentBlock = new MarkdownCodeBlock(lineIndex);
                // Check whether this is a single line code block of the form ```a = 10```.
                const firstIndex = line.indexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER);
                const lastIndex = line.lastIndexOf(MarkdownCodeBlocks.CODE_BLOCK_MARKER);
                const isSingleLine = firstIndex !== lastIndex;
                if (isSingleLine) {
                    currentBlock.code = line.substring(firstIndex + MarkdownCodeBlocks.CODE_BLOCK_MARKER.length, lastIndex);
                    currentBlock.endLine = lineIndex;
                    codeBlocks.push(currentBlock);
                    currentBlock = null;
                }
            }
            else if (currentBlock) {
                if (lineContainsMarker) {
                    // End of block, finish it up.
                    currentBlock.endLine = lineIndex - 1;
                    codeBlocks.push(currentBlock);
                    currentBlock = null;
                }
                else {
                    // Append the current line.
                    currentBlock.code += line + '\n';
                }
            }
        }
        return codeBlocks;
    }
    MarkdownCodeBlocks.findMarkdownCodeBlocks = findMarkdownCodeBlocks;
})(MarkdownCodeBlocks || (exports.MarkdownCodeBlocks = MarkdownCodeBlocks = {}));
//# sourceMappingURL=markdowncodeblocks.js.map

/***/ }),

/***/ 86083:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(27061);

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PageConfig = void 0;
const coreutils_1 = __webpack_require__(72215);
const minimist_1 = __importDefault(__webpack_require__(66161));
const url_1 = __webpack_require__(34410);
/**
 * The namespace for `PageConfig` functions.
 */
var PageConfig;
(function (PageConfig) {
    /**
     * Get global configuration data for the Jupyter application.
     *
     * @param name - The name of the configuration option.
     *
     * @returns The config value or an empty string if not found.
     *
     * #### Notes
     * All values are treated as strings.
     * For browser based applications, it is assumed that the page HTML
     * includes a script tag with the id `jupyter-config-data` containing the
     * configuration as valid JSON.  In order to support the classic Notebook,
     * we fall back on checking for `body` data of the given `name`.
     *
     * For node applications, it is assumed that the process was launched
     * with a `--jupyter-config-data` option pointing to a JSON settings
     * file.
     */
    function getOption(name) {
        if (configData) {
            return configData[name] || getBodyData(name);
        }
        configData = Object.create(null);
        let found = false;
        // Use script tag if available.
        if (typeof document !== 'undefined' && document) {
            const el = document.getElementById('jupyter-config-data');
            if (el) {
                configData = JSON.parse(el.textContent || '');
                found = true;
            }
        }
        // Otherwise use CLI if given.
        if (!found && typeof process !== 'undefined' && process.argv) {
            try {
                const cli = (0, minimist_1.default)(process.argv.slice(2));
                const path = __webpack_require__(67425);
                let fullPath = '';
                if ('jupyter-config-data' in cli) {
                    fullPath = path.resolve(cli['jupyter-config-data']);
                }
                else if ('JUPYTER_CONFIG_DATA' in process.env) {
                    fullPath = path.resolve(process.env['JUPYTER_CONFIG_DATA']);
                }
                if (fullPath) {
                    // Force Webpack to ignore this require.
                    // eslint-disable-next-line
                    configData = eval('require')(fullPath);
                }
            }
            catch (e) {
                console.error(e);
            }
        }
        if (!coreutils_1.JSONExt.isObject(configData)) {
            configData = Object.create(null);
        }
        else {
            for (const key in configData) {
                // PageConfig expects strings
                if (typeof configData[key] !== 'string') {
                    configData[key] = JSON.stringify(configData[key]);
                }
            }
        }
        return configData[name] || getBodyData(name);
    }
    PageConfig.getOption = getOption;
    /**
     * Set global configuration data for the Jupyter application.
     *
     * @param name - The name of the configuration option.
     * @param value - The value to set the option to.
     *
     * @returns The last config value or an empty string if it doesn't exist.
     */
    function setOption(name, value) {
        const last = getOption(name);
        configData[name] = value;
        return last;
    }
    PageConfig.setOption = setOption;
    /**
     * Get the base url for a Jupyter application, or the base url of the page.
     */
    function getBaseUrl() {
        return url_1.URLExt.normalize(getOption('baseUrl') || '/');
    }
    PageConfig.getBaseUrl = getBaseUrl;
    /**
     * Get the tree url for a JupyterLab application.
     */
    function getTreeUrl() {
        return url_1.URLExt.join(getBaseUrl(), getOption('treeUrl'));
    }
    PageConfig.getTreeUrl = getTreeUrl;
    /**
     * Get the base url for sharing links (usually baseUrl)
     */
    function getShareUrl() {
        return url_1.URLExt.normalize(getOption('shareUrl') || getBaseUrl());
    }
    PageConfig.getShareUrl = getShareUrl;
    /**
     * Get the tree url for shareable links.
     * Usually the same as treeUrl,
     * but overridable e.g. when sharing with JupyterHub.
     */
    function getTreeShareUrl() {
        return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(), getOption('treeUrl')));
    }
    PageConfig.getTreeShareUrl = getTreeShareUrl;
    /**
     * Create a new URL given an optional mode and tree path.
     *
     * This is used to create URLS when the mode or tree path change as the user
     * changes mode or the current document in the main area. If fields in
     * options are omitted, the value in PageConfig will be used.
     *
     * @param options - IGetUrlOptions for the new path.
     */
    function getUrl(options) {
        var _a, _b, _c, _d;
        let path = options.toShare ? getShareUrl() : getBaseUrl();
        const mode = (_a = options.mode) !== null && _a !== void 0 ? _a : getOption('mode');
        const workspace = (_b = options.workspace) !== null && _b !== void 0 ? _b : getOption('workspace');
        const labOrDoc = mode === 'single-document' ? 'doc' : 'lab';
        path = url_1.URLExt.join(path, labOrDoc);
        if (workspace !== PageConfig.defaultWorkspace) {
            path = url_1.URLExt.join(path, 'workspaces', encodeURIComponent((_c = getOption('workspace')) !== null && _c !== void 0 ? _c : PageConfig.defaultWorkspace));
        }
        const treePath = (_d = options.treePath) !== null && _d !== void 0 ? _d : getOption('treePath');
        if (treePath) {
            path = url_1.URLExt.join(path, 'tree', url_1.URLExt.encodeParts(treePath));
        }
        return path;
    }
    PageConfig.getUrl = getUrl;
    PageConfig.defaultWorkspace = 'default';
    /**
     * Get the base websocket url for a Jupyter application, or an empty string.
     */
    function getWsUrl(baseUrl) {
        let wsUrl = getOption('wsUrl');
        if (!wsUrl) {
            baseUrl = baseUrl ? url_1.URLExt.normalize(baseUrl) : getBaseUrl();
            if (baseUrl.indexOf('http') !== 0) {
                return '';
            }
            wsUrl = 'ws' + baseUrl.slice(4);
        }
        return url_1.URLExt.normalize(wsUrl);
    }
    PageConfig.getWsUrl = getWsUrl;
    /**
     * Returns the URL converting this notebook to a certain
     * format with nbconvert.
     */
    function getNBConvertURL({ path, format, download }) {
        const notebookPath = url_1.URLExt.encodeParts(path);
        const url = url_1.URLExt.join(getBaseUrl(), 'nbconvert', format, notebookPath);
        if (download) {
            return url + '?download=true';
        }
        return url;
    }
    PageConfig.getNBConvertURL = getNBConvertURL;
    /**
     * Get the authorization token for a Jupyter application.
     */
    function getToken() {
        return getOption('token') || getBodyData('jupyterApiToken');
    }
    PageConfig.getToken = getToken;
    /**
     * Get the Notebook version info [major, minor, patch].
     */
    function getNotebookVersion() {
        const notebookVersion = getOption('notebookVersion');
        if (notebookVersion === '') {
            return [0, 0, 0];
        }
        return JSON.parse(notebookVersion);
    }
    PageConfig.getNotebookVersion = getNotebookVersion;
    /**
     * Private page config data for the Jupyter application.
     */
    let configData = null;
    /**
     * Get a url-encoded item from `body.data` and decode it
     * We should never have any encoded URLs anywhere else in code
     * until we are building an actual request.
     */
    function getBodyData(key) {
        if (typeof document === 'undefined' || !document.body) {
            return '';
        }
        const val = document.body.dataset[key];
        if (typeof val === 'undefined') {
            return '';
        }
        return decodeURIComponent(val);
    }
    /**
     * The namespace for page config `Extension` functions.
     */
    let Extension;
    (function (Extension) {
        /**
         * Populate an array from page config.
         *
         * @param key - The page config key (e.g., `deferredExtensions`).
         *
         * #### Notes
         * This is intended for `deferredExtensions` and `disabledExtensions`.
         */
        function populate(key) {
            try {
                const raw = getOption(key);
                if (raw) {
                    return JSON.parse(raw);
                }
            }
            catch (error) {
                console.warn(`Unable to parse ${key}.`, error);
            }
            return [];
        }
        /**
         * The collection of deferred extensions in page config.
         */
        Extension.deferred = populate('deferredExtensions');
        /**
         * The collection of disabled extensions in page config.
         */
        Extension.disabled = populate('disabledExtensions');
        /**
         * Returns whether a plugin is deferred.
         *
         * @param id - The plugin ID.
         */
        function isDeferred(id) {
            // Check for either a full plugin id match or an extension
            // name match.
            const separatorIndex = id.indexOf(':');
            let extName = '';
            if (separatorIndex !== -1) {
                extName = id.slice(0, separatorIndex);
            }
            return Extension.deferred.some(val => val === id || (extName && val === extName));
        }
        Extension.isDeferred = isDeferred;
        /**
         * Returns whether a plugin is disabled.
         *
         * @param id - The plugin ID.
         */
        function isDisabled(id) {
            // Check for either a full plugin id match or an extension
            // name match.
            const separatorIndex = id.indexOf(':');
            let extName = '';
            if (separatorIndex !== -1) {
                extName = id.slice(0, separatorIndex);
            }
            return Extension.disabled.some(val => val === id || (extName && val === extName));
        }
        Extension.isDisabled = isDisabled;
    })(Extension = PageConfig.Extension || (PageConfig.Extension = {}));
})(PageConfig || (exports.PageConfig = PageConfig = {}));
//# sourceMappingURL=pageconfig.js.map

/***/ }),

/***/ 12361:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PathExt = void 0;
const path_1 = __webpack_require__(67425);
/**
 * The namespace for path-related functions.
 *
 * Note that Jupyter server paths do not start with a leading slash.
 */
var PathExt;
(function (PathExt) {
    /**
     * Join all arguments together and normalize the resulting path.
     * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
     *
     * @param paths - The string paths to join.
     */
    function join(...paths) {
        const path = path_1.posix.join(...paths);
        return path === '.' ? '' : removeSlash(path);
    }
    PathExt.join = join;
    /**
     * Join all arguments together and normalize the resulting path and preserve the leading slash.
     *
     * @param paths - The string paths to join.
     */
    function joinWithLeadingSlash(...paths) {
        const path = path_1.posix.join(...paths);
        return path === '.' ? '' : path;
    }
    PathExt.joinWithLeadingSlash = joinWithLeadingSlash;
    /**
     * Return the last portion of a path. Similar to the Unix basename command.
     * Often used to extract the file name from a fully qualified path.
     *
     * @param path - The path to evaluate.
     *
     * @param ext - An extension to remove from the result.
     */
    function basename(path, ext) {
        return path_1.posix.basename(path, ext);
    }
    PathExt.basename = basename;
    /**
     * Get the directory name of a path, similar to the Unix dirname command.
     * When an empty path is given, returns the root path.
     *
     * @param path - The file path.
     */
    function dirname(path) {
        const dir = removeSlash(path_1.posix.dirname(path));
        return dir === '.' ? '' : dir;
    }
    PathExt.dirname = dirname;
    /**
     * Get the extension of the path.
     *
     * @param path - The file path.
     *
     * @returns the extension of the file.
     *
     * #### Notes
     * The extension is the string from the last occurrence of the `.`
     * character to end of string in the last portion of the path, inclusive.
     * If there is no `.` in the last portion of the path, or if the first
     * character of the basename of path [[basename]] is `.`, then an
     * empty string is returned.
     */
    function extname(path) {
        return path_1.posix.extname(path);
    }
    PathExt.extname = extname;
    /**
     * Normalize a string path, reducing '..' and '.' parts.
     * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
     * When an empty path is given, returns the root path.
     *
     * @param path - The string path to normalize.
     */
    function normalize(path) {
        if (path === '') {
            return '';
        }
        return removeSlash(path_1.posix.normalize(path));
    }
    PathExt.normalize = normalize;
    /**
     * Resolve a sequence of paths or path segments into an absolute path.
     * The root path in the application has no leading slash, so it is removed.
     *
     * @param parts - The paths to join.
     *
     * #### Notes
     * The right-most parameter is considered \{to\}.  Other parameters are considered an array of \{from\}.
     *
     * Starting from leftmost \{from\} parameter, resolves \{to\} to an absolute path.
     *
     * If \{to\} isn't already absolute, \{from\} arguments are prepended in right to left order, until an absolute path is found. If after using all \{from\} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
     */
    function resolve(...parts) {
        return removeSlash(path_1.posix.resolve(...parts));
    }
    PathExt.resolve = resolve;
    /**
     * Solve the relative path from \{from\} to \{to\}.
     *
     * @param from - The source path.
     *
     * @param to - The target path.
     *
     * #### Notes
     * If from and to each resolve to the same path (after calling
     * path.resolve() on each), a zero-length string is returned.
     * If a zero-length string is passed as from or to, `/`
     * will be used instead of the zero-length strings.
     */
    function relative(from, to) {
        return removeSlash(path_1.posix.relative(from, to));
    }
    PathExt.relative = relative;
    /**
     * Normalize a file extension to be of the type `'.foo'`.
     *
     * @param extension - the file extension.
     *
     * #### Notes
     * Adds a leading dot if not present and converts to lower case.
     */
    function normalizeExtension(extension) {
        if (extension.length > 0 && extension.indexOf('.') !== 0) {
            extension = `.${extension}`;
        }
        return extension;
    }
    PathExt.normalizeExtension = normalizeExtension;
    /**
     * Remove the leading slash from a path.
     *
     * @param path the path from which to remove a leading slash.
     */
    function removeSlash(path) {
        if (path.indexOf('/') === 0) {
            path = path.slice(1);
        }
        return path;
    }
    PathExt.removeSlash = removeSlash;
})(PathExt || (exports.PathExt = PathExt = {}));
//# sourceMappingURL=path.js.map

/***/ }),

/***/ 53227:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.JupyterPluginRegistry = void 0;
const coreutils_1 = __webpack_require__(72215);
const PLUGIN_ACTIVATION_TIMEOUT = 5000;
class JupyterPluginRegistry extends coreutils_1.PluginRegistry {
    constructor(options) {
        var _a;
        super(options);
        this._pluginData = new Map();
        this._expectedActivationTime =
            (_a = options === null || options === void 0 ? void 0 : options.expectedActivationTime) !== null && _a !== void 0 ? _a : PLUGIN_ACTIVATION_TIMEOUT;
    }
    registerPlugin(plugin) {
        this._pluginData.set(plugin.id, plugin);
        return super.registerPlugin(plugin);
    }
    async activatePlugin(id) {
        const startTime = performance.now();
        // Set a timeout to detect if the plugin stalls
        let timeoutId = setTimeout(() => {
            console.warn(`Plugin ${id} is taking too long to activate.`);
        }, this._expectedActivationTime);
        try {
            const result = await super.activatePlugin(id);
            clearTimeout(timeoutId);
            const endTime = performance.now();
            const activationTime = endTime - startTime;
            if (activationTime >= this._expectedActivationTime) {
                const dependantCount = this._getDependentCount(id);
                console.warn(`Plugin ${id} (with ${dependantCount} dependants) took ${activationTime.toFixed(2)}ms to activate.`);
            }
            return result;
        }
        catch (error) {
            clearTimeout(timeoutId);
            console.error(`Error activating plugin: ${id}`, error);
            throw error;
        }
    }
    _getDependentCount(id) {
        var _a;
        const plugin = this._pluginData.get(id);
        if (!(plugin === null || plugin === void 0 ? void 0 : plugin.provides))
            return 0;
        const tokenName = plugin.provides.name;
        let dependentCount = 0;
        for (const [otherId, otherPlugin] of this._pluginData.entries()) {
            if (otherId === id)
                continue;
            const isDependant = (_a = otherPlugin.requires) === null || _a === void 0 ? void 0 : _a.filter((token) => !!token).some((token) => token.name === tokenName);
            if (isDependant) {
                dependentCount++;
            }
        }
        return dependentCount;
    }
}
exports.JupyterPluginRegistry = JupyterPluginRegistry;
//# sourceMappingURL=pluginregistry.js.map

/***/ }),

/***/ 82053:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.signalToPromise = signalToPromise;
const coreutils_1 = __webpack_require__(72215);
/**
 * Convert a signal into a promise for the first emitted value.
 *
 * @param signal - The signal we are listening to.
 * @param timeout - Timeout to wait for signal in ms (not timeout if not defined or 0)
 *
 * @returns a Promise that resolves with a `(sender, args)` pair.
 */
function signalToPromise(signal, timeout) {
    const waitForSignal = new coreutils_1.PromiseDelegate();
    function cleanup() {
        signal.disconnect(slot);
    }
    function slot(sender, args) {
        cleanup();
        waitForSignal.resolve([sender, args]);
    }
    signal.connect(slot);
    if ((timeout !== null && timeout !== void 0 ? timeout : 0) > 0) {
        setTimeout(() => {
            cleanup();
            waitForSignal.reject(`Signal not emitted within ${timeout} ms.`);
        }, timeout);
    }
    return waitForSignal.promise;
}
//# sourceMappingURL=signal.js.map

/***/ }),

/***/ 84157:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Text = void 0;
/**
 * The namespace for text-related functions.
 */
var Text;
(function (Text) {
    // javascript stores text as utf16 and string indices use "code units",
    // which stores high-codepoint characters as "surrogate pairs",
    // which occupy two indices in the javascript string.
    // We need to translate cursor_pos in the Jupyter protocol (in characters)
    // to js offset (with surrogate pairs taking two spots).
    const HAS_SURROGATES = '𝐚'.length > 1;
    /**
     * Convert a javascript string index into a unicode character offset
     *
     * @param jsIdx - The javascript string index (counting surrogate pairs)
     *
     * @param text - The text in which the offset is calculated
     *
     * @returns The unicode character offset
     */
    function jsIndexToCharIndex(jsIdx, text) {
        if (!HAS_SURROGATES) {
            // not using surrogates, nothing to do
            return jsIdx;
        }
        let charIdx = jsIdx;
        for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {
            const charCode = text.charCodeAt(i);
            // check for surrogate pair
            if (charCode >= 0xd800 && charCode <= 0xdbff) {
                const nextCharCode = text.charCodeAt(i + 1);
                if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {
                    charIdx--;
                    i++;
                }
            }
        }
        return charIdx;
    }
    Text.jsIndexToCharIndex = jsIndexToCharIndex;
    /**
     * Convert a unicode character offset to a javascript string index.
     *
     * @param charIdx - The index in unicode characters
     *
     * @param text - The text in which the offset is calculated
     *
     * @returns The js-native index
     */
    function charIndexToJsIndex(charIdx, text) {
        if (!HAS_SURROGATES) {
            // not using surrogates, nothing to do
            return charIdx;
        }
        let jsIdx = charIdx;
        for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {
            const charCode = text.charCodeAt(i);
            // check for surrogate pair
            if (charCode >= 0xd800 && charCode <= 0xdbff) {
                const nextCharCode = text.charCodeAt(i + 1);
                if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {
                    jsIdx++;
                    i++;
                }
            }
        }
        return jsIdx;
    }
    Text.charIndexToJsIndex = charIndexToJsIndex;
    /**
     * Given a 'snake-case', 'snake_case', 'snake:case', or
     * 'snake case' string, will return the camel case version: 'snakeCase'.
     *
     * @param str the snake-case input string.
     *
     * @param upper default = false. If true, the first letter of the
     * returned string will be capitalized.
     *
     * @returns the camel case version of the input string.
     */
    function camelCase(str, upper = false) {
        return str.replace(/^(\w)|[\s-_:]+(\w)/g, function (match, p1, p2) {
            if (p2) {
                return p2.toUpperCase();
            }
            else {
                return upper ? p1.toUpperCase() : p1.toLowerCase();
            }
        });
    }
    Text.camelCase = camelCase;
    /**
     * Given a string, title case the words in the string.
     *
     * @param str the string to title case.
     *
     * @returns the same string, but with each word capitalized.
     */
    function titleCase(str) {
        return (str || '')
            .toLowerCase()
            .split(' ')
            .map(word => word.charAt(0).toUpperCase() + word.slice(1))
            .join(' ');
    }
    Text.titleCase = titleCase;
})(Text || (exports.Text = Text = {}));
//# sourceMappingURL=text.js.map

/***/ }),

/***/ 59635:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Time = void 0;
/**
 * A list of time units with their associated value in milliseconds.
 */
const UNITS = [
    { name: 'years', milliseconds: 365 * 24 * 60 * 60 * 1000 },
    { name: 'months', milliseconds: 30 * 24 * 60 * 60 * 1000 },
    { name: 'days', milliseconds: 24 * 60 * 60 * 1000 },
    { name: 'hours', milliseconds: 60 * 60 * 1000 },
    { name: 'minutes', milliseconds: 60 * 1000 },
    { name: 'seconds', milliseconds: 1000 }
];
/**
 * The namespace for date functions.
 */
var Time;
(function (Time) {
    /**
     * Convert a timestring to a human readable string (e.g. 'two minutes ago').
     *
     * @param value - The date timestring or date object.
     *
     * @returns A formatted date.
     */
    function formatHuman(value, format = 'long') {
        const lang = document.documentElement.lang || 'en';
        const formatter = new Intl.RelativeTimeFormat(lang, {
            numeric: 'auto',
            style: format
        });
        const delta = new Date(value).getTime() - Date.now();
        for (let unit of UNITS) {
            const amount = Math.ceil(delta / unit.milliseconds);
            if (amount === 0) {
                continue;
            }
            return formatter.format(amount, unit.name);
        }
        return formatter.format(0, 'seconds');
    }
    Time.formatHuman = formatHuman;
    /**
     * Convenient helper to convert a timestring to a date format.
     *
     * @param value - The date timestring or date object.
     *
     * @returns A formatted date.
     */
    function format(value) {
        const lang = document.documentElement.lang || 'en';
        const formatter = new Intl.DateTimeFormat(lang, {
            dateStyle: 'short',
            timeStyle: 'short'
        });
        return formatter.format(new Date(value));
    }
    Time.format = format;
})(Time || (exports.Time = Time = {}));
//# sourceMappingURL=time.js.map

/***/ }),

/***/ 34410:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.URLExt = void 0;
const path_1 = __webpack_require__(67425);
const url_parse_1 = __importDefault(__webpack_require__(80899));
/**
 * The namespace for URL-related functions.
 */
var URLExt;
(function (URLExt) {
    /**
     * Parse a url into a URL object.
     *
     * @param url - The URL string to parse.
     *
     * @returns A URL object.
     */
    function parse(url) {
        if (typeof document !== 'undefined' && document) {
            const a = document.createElement('a');
            a.href = url;
            return a;
        }
        return (0, url_parse_1.default)(url);
    }
    URLExt.parse = parse;
    /**
     * Parse URL and retrieve hostname
     *
     * @param url - The URL string to parse
     *
     * @returns a hostname string value
     */
    function getHostName(url) {
        return (0, url_parse_1.default)(url).hostname;
    }
    URLExt.getHostName = getHostName;
    function normalize(url) {
        return url && parse(url).toString();
    }
    URLExt.normalize = normalize;
    /**
     * Join a sequence of url components and normalizes as in node `path.join`.
     *
     * @param parts - The url components.
     *
     * @returns the joined url.
     */
    function join(...parts) {
        let u = (0, url_parse_1.default)(parts[0], {});
        // Schema-less URL can be only parsed as relative to a base URL
        // see https://github.com/unshiftio/url-parse/issues/219#issuecomment-1002219326
        const isSchemaLess = u.protocol === '' && u.slashes;
        if (isSchemaLess) {
            u = (0, url_parse_1.default)(parts[0], 'https:' + parts[0]);
        }
        const prefix = `${isSchemaLess ? '' : u.protocol}${u.slashes ? '//' : ''}${u.auth}${u.auth ? '@' : ''}${u.host}`;
        // If there was a prefix, then the first path must start at the root.
        const path = path_1.posix.join(`${!!prefix && u.pathname[0] !== '/' ? '/' : ''}${u.pathname}`, ...parts.slice(1));
        return `${prefix}${path === '.' ? '' : path}`;
    }
    URLExt.join = join;
    /**
     * Encode the components of a multi-segment url.
     *
     * @param url - The url to encode.
     *
     * @returns the encoded url.
     *
     * #### Notes
     * Preserves the `'/'` separators.
     * Should not include the base url, since all parts are escaped.
     */
    function encodeParts(url) {
        return join(...url.split('/').map(encodeURIComponent));
    }
    URLExt.encodeParts = encodeParts;
    /**
     * Return a serialized object string suitable for a query.
     *
     * @param value The source object.
     *
     * @returns an encoded url query.
     *
     * #### Notes
     * Modified version of [stackoverflow](http://stackoverflow.com/a/30707423).
     */
    function objectToQueryString(value) {
        const keys = Object.keys(value).filter(key => key.length > 0);
        if (!keys.length) {
            return '';
        }
        return ('?' +
            keys
                .map(key => {
                const content = encodeURIComponent(String(value[key]));
                return key + (content ? '=' + content : '');
            })
                .join('&'));
    }
    URLExt.objectToQueryString = objectToQueryString;
    /**
     * Return a parsed object that represents the values in a query string.
     */
    function queryStringToObject(value) {
        return value
            .replace(/^\?/, '')
            .split('&')
            .reduce((acc, val) => {
            const [key, value] = val.split('=');
            if (key.length > 0) {
                acc[key] = decodeURIComponent(value || '');
            }
            return acc;
        }, {});
    }
    URLExt.queryStringToObject = queryStringToObject;
    /**
     * Test whether the url is a local url.
     *
     * @param allowRoot - Whether the paths starting at Unix-style filesystem root (`/`) are permitted.
     *
     * #### Notes
     * This function returns `false` for any fully qualified url, including
     * `data:`, `file:`, and `//` protocol URLs.
     */
    function isLocal(url, allowRoot = false) {
        const { protocol } = parse(url);
        return ((!protocol || url.toLowerCase().indexOf(protocol) !== 0) &&
            (allowRoot ? url.indexOf('//') !== 0 : url.indexOf('/') !== 0));
    }
    URLExt.isLocal = isLocal;
})(URLExt || (exports.URLExt = URLExt = {}));
//# sourceMappingURL=url.js.map

/***/ }),

/***/ 41827:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_csvviewer_lib_widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(21058);
/* harmony import */ var _jupyterlab_csvviewer_lib_toolbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(40930);
/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3894);
/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38911);
/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module csvviewer-extension
 */








/**
 * The name of the factories that creates widgets.
 */
const FACTORY_CSV = 'CSVTable';
const FACTORY_TSV = 'TSVTable';
/**
 * The command IDs used by the csvviewer plugins.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.CSVGoToLine = 'csv:go-to-line';
    CommandIDs.TSVGoToLine = 'tsv:go-to-line';
})(CommandIDs || (CommandIDs = {}));
/**
 * The CSV file handler extension.
 */
const csv = {
    activate: activateCsv,
    id: '@jupyterlab/csvviewer-extension:csv',
    description: 'Adds viewer for CSV file types',
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__.ITranslator],
    optional: [
        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IThemeManager,
        _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__.IMainMenu,
        _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.ISearchProviderRegistry,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.ISettingRegistry,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IToolbarWidgetRegistry
    ],
    autoStart: true
};
/**
 * The TSV file handler extension.
 */
const tsv = {
    activate: activateTsv,
    id: '@jupyterlab/csvviewer-extension:tsv',
    description: 'Adds viewer for TSV file types.',
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__.ITranslator],
    optional: [
        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IThemeManager,
        _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__.IMainMenu,
        _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.ISearchProviderRegistry,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.ISettingRegistry,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IToolbarWidgetRegistry
    ],
    autoStart: true
};
/**
 * Activate cssviewer extension for CSV files
 */
function activateCsv(app, translator, restorer, themeManager, mainMenu, searchRegistry, settingRegistry, toolbarRegistry) {
    var _a;
    const { commands, shell } = app;
    let toolbarFactory;
    if (toolbarRegistry) {
        toolbarRegistry.addFactory(FACTORY_CSV, 'delimiter', widget => new _jupyterlab_csvviewer_lib_toolbar__WEBPACK_IMPORTED_MODULE_6__/* .CSVDelimiter */ .p({
            widget: widget.content,
            translator
        }));
        if (settingRegistry) {
            toolbarFactory = (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.createToolbarFactory)(toolbarRegistry, settingRegistry, FACTORY_CSV, csv.id, translator);
        }
    }
    const trans = translator.load('jupyterlab');
    const factory = new _jupyterlab_csvviewer_lib_widget__WEBPACK_IMPORTED_MODULE_7__/* .CSVViewerFactory */ .LT({
        name: FACTORY_CSV,
        label: trans.__('CSV Viewer'),
        fileTypes: ['csv'],
        defaultFor: ['csv'],
        readOnly: true,
        toolbarFactory,
        translator
    });
    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
        namespace: 'csvviewer'
    });
    // The current styles for the data grids.
    let style = Private.LIGHT_STYLE;
    let rendererConfig = Private.LIGHT_TEXT_CONFIG;
    if (restorer) {
        // Handle state restoration.
        void restorer.restore(tracker, {
            command: 'docmanager:open',
            args: widget => ({ path: widget.context.path, factory: FACTORY_CSV }),
            name: widget => widget.context.path
        });
    }
    app.docRegistry.addWidgetFactory(factory);
    const ft = app.docRegistry.getFileType('csv');
    let searchProviderInitialized = false;
    factory.widgetCreated.connect(async (sender, widget) => {
        // Track the widget.
        void tracker.add(widget);
        // Notify the widget tracker if restore data needs to update.
        widget.context.pathChanged.connect(() => {
            void tracker.save(widget);
        });
        if (ft) {
            widget.title.icon = ft.icon;
            widget.title.iconClass = ft.iconClass;
            widget.title.iconLabel = ft.iconLabel;
        }
        // Delay await to execute `widget.title` setters (above) synchronously
        if (searchRegistry && !searchProviderInitialized) {
            const { CSVSearchProvider } = await Promise.all(/* import() */[__webpack_require__.e(4144), __webpack_require__.e(6608)]).then(__webpack_require__.bind(__webpack_require__, 36017));
            searchRegistry.add('csv', CSVSearchProvider);
            searchProviderInitialized = true;
        }
        // Set the theme for the new widget; requires `.content` to be loaded.
        await widget.content.ready;
        widget.content.style = style;
        widget.content.rendererConfig = rendererConfig;
        // Make sure the theme is correctly set when new widgets are created.
        updateThemes();
    });
    // Keep the themes up-to-date.
    const updateThemes = () => {
        const isLight = themeManager && themeManager.theme
            ? themeManager.isLight(themeManager.theme)
            : true;
        style = isLight ? Private.LIGHT_STYLE : Private.DARK_STYLE;
        rendererConfig = isLight
            ? Private.LIGHT_TEXT_CONFIG
            : Private.DARK_TEXT_CONFIG;
        tracker.forEach(async (grid) => {
            await grid.content.ready;
            grid.content.style = style;
            grid.content.rendererConfig = rendererConfig;
        });
    };
    if (themeManager) {
        themeManager.themeChanged.connect(updateThemes);
    }
    // Add commands
    const isEnabled = () => tracker.currentWidget !== null &&
        tracker.currentWidget === shell.currentWidget;
    commands.addCommand(CommandIDs.CSVGoToLine, {
        label: trans.__('Go to Line'),
        execute: async () => {
            const widget = tracker.currentWidget;
            if (widget === null) {
                return;
            }
            const result = await _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.InputDialog.getNumber({
                title: trans.__('Go to Line'),
                value: 0
            });
            if (result.button.accept && result.value !== null) {
                widget.content.goToLine(result.value);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    if (mainMenu) {
        // Add go to line capability to the edit menu.
        mainMenu.editMenu.goToLiners.add({
            id: CommandIDs.CSVGoToLine,
            isEnabled
        });
    }
    const notify = () => {
        commands.notifyCommandChanged(CommandIDs.CSVGoToLine);
    };
    tracker.currentChanged.connect(notify);
    (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);
}
/**
 * Activate cssviewer extension for TSV files
 */
function activateTsv(app, translator, restorer, themeManager, mainMenu, searchRegistry, settingRegistry, toolbarRegistry) {
    const { commands, shell } = app;
    let toolbarFactory;
    if (toolbarRegistry) {
        toolbarRegistry.addFactory(FACTORY_TSV, 'delimiter', widget => new _jupyterlab_csvviewer_lib_toolbar__WEBPACK_IMPORTED_MODULE_6__/* .CSVDelimiter */ .p({
            widget: widget.content,
            translator
        }));
        if (settingRegistry) {
            toolbarFactory = (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.createToolbarFactory)(toolbarRegistry, settingRegistry, FACTORY_TSV, tsv.id, translator);
        }
    }
    const trans = translator.load('jupyterlab');
    const factory = new _jupyterlab_csvviewer_lib_widget__WEBPACK_IMPORTED_MODULE_7__/* .TSVViewerFactory */ ._d({
        name: FACTORY_TSV,
        label: trans.__('TSV Viewer'),
        fileTypes: ['tsv'],
        defaultFor: ['tsv'],
        readOnly: true,
        toolbarFactory,
        translator
    });
    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
        namespace: 'tsvviewer'
    });
    // The current styles for the data grids.
    let style = Private.LIGHT_STYLE;
    let rendererConfig = Private.LIGHT_TEXT_CONFIG;
    if (restorer) {
        // Handle state restoration.
        void restorer.restore(tracker, {
            command: 'docmanager:open',
            args: widget => ({ path: widget.context.path, factory: FACTORY_TSV }),
            name: widget => widget.context.path
        });
    }
    app.docRegistry.addWidgetFactory(factory);
    const ft = app.docRegistry.getFileType('tsv');
    let searchProviderInitialized = false;
    factory.widgetCreated.connect(async (sender, widget) => {
        // Track the widget.
        void tracker.add(widget);
        // Notify the widget tracker if restore data needs to update.
        widget.context.pathChanged.connect(() => {
            void tracker.save(widget);
        });
        if (ft) {
            widget.title.icon = ft.icon;
            widget.title.iconClass = ft.iconClass;
            widget.title.iconLabel = ft.iconLabel;
        }
        // Delay await to execute `widget.title` setters (above) synchronously
        if (searchRegistry && !searchProviderInitialized) {
            const { CSVSearchProvider } = await Promise.all(/* import() */[__webpack_require__.e(4144), __webpack_require__.e(6608)]).then(__webpack_require__.bind(__webpack_require__, 36017));
            searchRegistry.add('tsv', CSVSearchProvider);
            searchProviderInitialized = true;
        }
        // Set the theme for the new widget; requires `.content` to be loaded.
        await widget.content.ready;
        widget.content.style = style;
        widget.content.rendererConfig = rendererConfig;
    });
    // Keep the themes up-to-date.
    const updateThemes = () => {
        const isLight = themeManager && themeManager.theme
            ? themeManager.isLight(themeManager.theme)
            : true;
        style = isLight ? Private.LIGHT_STYLE : Private.DARK_STYLE;
        rendererConfig = isLight
            ? Private.LIGHT_TEXT_CONFIG
            : Private.DARK_TEXT_CONFIG;
        tracker.forEach(async (grid) => {
            await grid.content.ready;
            grid.content.style = style;
            grid.content.rendererConfig = rendererConfig;
        });
    };
    if (themeManager) {
        themeManager.themeChanged.connect(updateThemes);
    }
    // Add commands
    const isEnabled = () => tracker.currentWidget !== null &&
        tracker.currentWidget === shell.currentWidget;
    commands.addCommand(CommandIDs.TSVGoToLine, {
        label: trans.__('Go to Line'),
        execute: async () => {
            const widget = tracker.currentWidget;
            if (widget === null) {
                return;
            }
            const result = await _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.InputDialog.getNumber({
                title: trans.__('Go to Line'),
                value: 0
            });
            if (result.button.accept && result.value !== null) {
                widget.content.goToLine(result.value);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    if (mainMenu) {
        // Add go to line capability to the edit menu.
        mainMenu.editMenu.goToLiners.add({
            id: CommandIDs.TSVGoToLine,
            isEnabled
        });
    }
    tracker.currentChanged.connect(() => {
        commands.notifyCommandChanged(CommandIDs.TSVGoToLine);
    });
}
/**
 * Export the plugins as default.
 */
const plugins = [csv, tsv];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * The light theme for the data grid.
     */
    Private.LIGHT_STYLE = {
        voidColor: '#F3F3F3',
        backgroundColor: 'white',
        headerBackgroundColor: '#EEEEEE',
        gridLineColor: 'rgba(20, 20, 20, 0.15)',
        headerGridLineColor: 'rgba(20, 20, 20, 0.25)',
        rowBackgroundColor: i => (i % 2 === 0 ? '#F5F5F5' : 'white')
    };
    /**
     * The dark theme for the data grid.
     */
    Private.DARK_STYLE = {
        voidColor: 'black',
        backgroundColor: '#111111',
        headerBackgroundColor: '#424242',
        gridLineColor: 'rgba(235, 235, 235, 0.15)',
        headerGridLineColor: 'rgba(235, 235, 235, 0.25)',
        rowBackgroundColor: i => (i % 2 === 0 ? '#212121' : '#111111')
    };
    /**
     * The light config for the data grid renderer.
     */
    Private.LIGHT_TEXT_CONFIG = {
        textColor: '#111111',
        matchBackgroundColor: '#FFFFE0',
        currentMatchBackgroundColor: '#FFFF00',
        horizontalAlignment: 'right'
    };
    /**
     * The dark config for the data grid renderer.
     */
    Private.DARK_TEXT_CONFIG = {
        textColor: '#F5F5F5',
        matchBackgroundColor: '#838423',
        currentMatchBackgroundColor: '#A3807A',
        horizontalAlignment: 'right'
    };
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 36017:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CSVSearchProvider: () => (/* binding */ CSVSearchProvider)
/* harmony export */ });
/* harmony import */ var _jupyterlab_csvviewer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6608);
/* harmony import */ var _jupyterlab_csvviewer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_csvviewer__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34992);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3894);
/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * CSV viewer search provider
 */
class CSVSearchProvider extends _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.SearchProvider {
    constructor() {
        super(...arguments);
        /**
         * Set to true if the widget under search is read-only, false
         * if it is editable.  Will be used to determine whether to show
         * the replace option.
         */
        this.isReadOnly = true;
    }
    /**
     * Instantiate a search provider for the widget.
     *
     * #### Notes
     * The widget provided is always checked using `isApplicable` before calling
     * this factory.
     *
     * @param widget The widget to search on
     * @param translator [optional] The translator object
     *
     * @returns The search provider on the widget
     */
    static createNew(widget, translator) {
        return new CSVSearchProvider(widget);
    }
    /**
     * Report whether or not this provider has the ability to search on the given object
     */
    static isApplicable(domain) {
        // check to see if the CSVSearchProvider can search on the
        // first cell, false indicates another editor is present
        return (domain instanceof _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__.DocumentWidget && domain.content instanceof _jupyterlab_csvviewer__WEBPACK_IMPORTED_MODULE_0__.CSVViewer);
    }
    /**
     * Clear currently highlighted match.
     */
    clearHighlight() {
        // no-op
        return Promise.resolve();
    }
    /**
     * Move the current match indicator to the next match.
     *
     * @param loop Whether to loop within the matches list.
     *
     * @returns The match is never returned by this provider
     */
    highlightNext(loop) {
        this.widget.content.searchService.find(this._query);
        return Promise.resolve(undefined);
    }
    /**
     * Move the current match indicator to the previous match.
     *
     * @param loop Whether to loop within the matches list.
     *
     * @returns The match is never returned by this provider
     */
    highlightPrevious(loop) {
        this.widget.content.searchService.find(this._query, true);
        return Promise.resolve(undefined);
    }
    /**
     * Replace the currently selected match with the provided text
     * Not implemented in the CSV viewer as it is read-only.
     *
     * @param newText The replacement text
     * @param loop Whether to loop within the matches list.
     *
     * @returns A promise that resolves once the action has completed.
     */
    replaceCurrentMatch(newText, loop) {
        return Promise.resolve(false);
    }
    /**
     * Replace all matches in the notebook with the provided text
     * Not implemented in the CSV viewer as it is read-only.
     *
     * @param newText The replacement text
     *
     * @returns A promise that resolves once the action has completed.
     */
    replaceAllMatches(newText) {
        return Promise.resolve(false);
    }
    /**
     * Initialize the search using the provided options.  Should update the UI
     * to highlight all matches and "select" whatever the first match should be.
     *
     * @param query A RegExp to be use to perform the search
     */
    startQuery(query) {
        this._query = query;
        this.widget.content.searchService.find(query);
        return Promise.resolve();
    }
    /**
     * Clears state of a search provider to prepare for startQuery to be called
     * in order to start a new query or refresh an existing one.
     */
    endQuery() {
        this.widget.content.searchService.clear();
        return Promise.resolve();
    }
}
//# sourceMappingURL=searchprovider.js.map

/***/ }),

/***/ 93751:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/csvviewer/style/base.css
var base = __webpack_require__(11959);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/csvviewer/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/csvviewer/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






// EXTERNAL MODULE: ../node_modules/@jupyterlab/documentsearch/style/index.js + 1 modules
var documentsearch_style = __webpack_require__(13737);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/mainmenu/style/index.js
var mainmenu_style = __webpack_require__(70022);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/csvviewer-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 65313:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CSVDelimiter: () => (/* reexport safe */ _toolbar__WEBPACK_IMPORTED_MODULE_2__.p),
/* harmony export */   CSVDocumentWidget: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_3__.kw),
/* harmony export */   CSVViewer: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_3__.A9),
/* harmony export */   CSVViewerFactory: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_3__.LT),
/* harmony export */   DSVModel: () => (/* reexport safe */ _model__WEBPACK_IMPORTED_MODULE_0__.DSVModel),
/* harmony export */   GridSearchService: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_3__.JZ),
/* harmony export */   TSVViewerFactory: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_3__._d),
/* harmony export */   TextRenderConfig: () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_3__.B0),
/* harmony export */   parseDSV: () => (/* reexport safe */ _parse__WEBPACK_IMPORTED_MODULE_1__.G),
/* harmony export */   parseDSVNoQuotes: () => (/* reexport safe */ _parse__WEBPACK_IMPORTED_MODULE_1__.z)
/* harmony export */ });
/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18032);
/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48234);
/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40930);
/* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21058);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module csvviewer
 */




//# sourceMappingURL=index.js.map

/***/ }),

/***/ 18032:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DSVModel: () => (/* binding */ DSVModel)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_datagrid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32444);
/* harmony import */ var _lumino_datagrid__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_datagrid__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(48234);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/*
Possible ideas for further implementation:

- Show a spinner or something visible when we are doing delayed parsing.
- The cache right now handles scrolling down great - it gets the next several hundred rows. However, scrolling up causes lots of cache misses - each new row causes a flush of the cache. When invalidating an entire cache, we should put the requested row in middle of the cache (adjusting for rows at the beginning or end). When populating a cache, we should retrieve rows both above and below the requested row.
- When we have a header, and we are guessing the parser to use, try checking just the part of the file *after* the header row for quotes. I think often a first header row is quoted, but the rest of the file is not and can be parsed much faster.
- autdetect the delimiter (look for comma, tab, semicolon in first line. If more than one found, parse first row with comma, tab, semicolon delimiters. One with most fields wins).
- Toolbar buttons to control the row delimiter, the parsing engine (quoted/not quoted), the quote character, etc.
- Investigate incremental loading strategies in the parseAsync function. In initial investigations, setting the chunk size to 100k in parseAsync seems cause instability with large files in Chrome (such as 8-million row files). Perhaps this is because we are recycling the row offset and column offset arrays quickly? It doesn't seem that there is a memory leak. On this theory, perhaps we just need to keep the offsets list an actual list, and pass it into the parsing function to extend without copying, and finalize it into an array buffer only when we are done parsing. Or perhaps we double the size of the array buffer each time, which may be wasteful, but at the end we trim it down if it's too wasteful (perhaps we have our own object that is backed by an array buffer, but has a push method that will automatically double the array buffer size as needed, and a trim function to finalize the array to exactly the size needed)? Or perhaps we don't use array buffers at all - compare the memory cost and speed of keeping the offsets as lists instead of memory buffers.
- Investigate a time-based incremental parsing strategy, rather than a row-based one. The parser could take a maximum time to parse (say 300ms), and will parse up to that duration, in which case the parser probably also needs a way to notify when it has reached the end of a file.
- For very large files, where we are only storing a small cache, scrolling is very laggy in Safari. It would be good to profile it.
*/
/**
 * Possible delimiter-separated data parsers.
 */
const PARSERS = {
    quotes: _parse__WEBPACK_IMPORTED_MODULE_2__/* .parseDSV */ .G,
    noquotes: _parse__WEBPACK_IMPORTED_MODULE_2__/* .parseDSVNoQuotes */ .z
};
/**
 * A data model implementation for in-memory delimiter-separated data.
 *
 * #### Notes
 * This model handles data with up to 2**32 characters.
 */
class DSVModel extends _lumino_datagrid__WEBPACK_IMPORTED_MODULE_1__.DataModel {
    /**
     * Create a data model with static CSV data.
     *
     * @param options - The options for initializing the data model.
     */
    constructor(options) {
        super();
        this._rowCount = 0;
        // Cache information
        /**
         * The header strings.
         */
        this._header = [];
        /**
         * The column offset cache, starting with row _columnOffsetsStartingRow
         *
         * #### Notes
         * The index of the first character in the data string for row r, column c is
         * _columnOffsets[(r-this._columnOffsetsStartingRow)*numColumns+c]
         */
        this._columnOffsets = new Uint32Array(0);
        /**
         * The row that _columnOffsets[0] represents.
         */
        this._columnOffsetsStartingRow = 0;
        /**
         * The maximum number of rows to parse when there is a cache miss.
         */
        this._maxCacheGet = 1000;
        /**
         * The index for the start of each row.
         */
        this._rowOffsets = new Uint32Array(0);
        // Bookkeeping variables.
        this._delayedParse = null;
        this._startedParsing = false;
        this._doneParsing = false;
        this._isDisposed = false;
        this._ready = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        let { data, delimiter = ',', rowDelimiter = undefined, quote = '"', quoteParser = undefined, header = true, initialRows = 500 } = options;
        this._rawData = data;
        this._delimiter = delimiter;
        this._quote = quote;
        this._quoteEscaped = new RegExp(quote + quote, 'g');
        this._initialRows = initialRows;
        // Guess the row delimiter if it was not supplied. This will be fooled if a
        // different line delimiter possibility appears in the first row.
        if (rowDelimiter === undefined) {
            const i = data.slice(0, 5000).indexOf('\r');
            if (i === -1) {
                rowDelimiter = '\n';
            }
            else if (data[i + 1] === '\n') {
                rowDelimiter = '\r\n';
            }
            else {
                rowDelimiter = '\r';
            }
        }
        this._rowDelimiter = rowDelimiter;
        if (quoteParser === undefined) {
            // Check for the existence of quotes if the quoteParser is not set.
            quoteParser = data.indexOf(quote) >= 0;
        }
        this._parser = quoteParser ? 'quotes' : 'noquotes';
        // Parse the data.
        this.parseAsync();
        // Cache the header row.
        if (header === true && this._columnCount > 0) {
            const h = [];
            for (let c = 0; c < this._columnCount; c++) {
                h.push(this._getField(0, c));
            }
            this._header = h;
        }
    }
    /**
     * Whether this model has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * A promise that resolves when the model has parsed all of its data.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * The string representation of the data.
     */
    get rawData() {
        return this._rawData;
    }
    set rawData(value) {
        this._rawData = value;
    }
    /**
     * The initial chunk of rows to parse.
     */
    get initialRows() {
        return this._initialRows;
    }
    set initialRows(value) {
        this._initialRows = value;
    }
    /**
     * The header strings.
     */
    get header() {
        return this._header;
    }
    set header(value) {
        this._header = value;
    }
    /**
     * The delimiter between entries on the same row.
     */
    get delimiter() {
        return this._delimiter;
    }
    /**
     * The delimiter between rows.
     */
    get rowDelimiter() {
        return this._rowDelimiter;
    }
    /**
     * A boolean determined by whether parsing has completed.
     */
    get doneParsing() {
        return this._doneParsing;
    }
    /**
     * Get the row count for a region in the data model.
     *
     * @param region - The row region of interest.
     *
     * @returns - The row count for the region.
     */
    rowCount(region) {
        if (region === 'body') {
            if (this._header.length === 0) {
                return this._rowCount;
            }
            else {
                return this._rowCount - 1;
            }
        }
        return 1;
    }
    /**
     * Get the column count for a region in the data model.
     *
     * @param region - The column region of interest.
     *
     * @returns - The column count for the region.
     */
    columnCount(region) {
        if (region === 'body') {
            return this._columnCount;
        }
        return 1;
    }
    /**
     * Get the data value for a cell in the data model.
     *
     * @param region - The cell region of interest.
     *
     * @param row - The row index of the cell of interest.
     *
     * @param column - The column index of the cell of interest.
     *
     * @returns - The data value for the specified cell.
     */
    data(region, row, column) {
        let value;
        // Look up the field and value for the region.
        switch (region) {
            case 'body':
                if (this._header.length === 0) {
                    value = this._getField(row, column);
                }
                else {
                    value = this._getField(row + 1, column);
                }
                break;
            case 'column-header':
                if (this._header.length === 0) {
                    value = (column + 1).toString();
                }
                else {
                    value = this._header[column];
                }
                break;
            case 'row-header':
                value = (row + 1).toString();
                break;
            case 'corner-header':
                value = '';
                break;
            default:
                throw 'unreachable';
        }
        // Return the final value.
        return value;
    }
    /**
     * Dispose the resources held by this model.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._columnCount = undefined;
        this._rowCount = undefined;
        this._rowOffsets = null;
        this._columnOffsets = null;
        this._rawData = null;
        // Clear out state associated with the asynchronous parsing.
        if (this._doneParsing === false) {
            // Explicitly catch this rejection at least once so an error is not thrown
            // to the console.
            this.ready.catch(() => {
                return;
            });
            this._ready.reject(undefined);
        }
        if (this._delayedParse !== null) {
            window.clearTimeout(this._delayedParse);
        }
    }
    /**
     * Get the index in the data string for the first character of a row and
     * column.
     *
     * @param row - The row of the data item.
     * @param column - The column of the data item.
     * @returns - The index into the data string where the data item starts.
     */
    getOffsetIndex(row, column) {
        // Declare local variables.
        const ncols = this._columnCount;
        // Check to see if row *should* be in the cache, based on the cache size.
        let rowIndex = (row - this._columnOffsetsStartingRow) * ncols;
        if (rowIndex < 0 || rowIndex > this._columnOffsets.length) {
            // Row isn't in the cache, so we invalidate the entire cache and set up
            // the cache to hold the requested row.
            this._columnOffsets.fill(0xffffffff);
            this._columnOffsetsStartingRow = row;
            rowIndex = 0;
        }
        // Check to see if we need to fetch the row data into the cache.
        if (this._columnOffsets[rowIndex] === 0xffffffff) {
            // Figure out how many rows below us also need to be fetched.
            let maxRows = 1;
            while (maxRows <= this._maxCacheGet &&
                this._columnOffsets[rowIndex + maxRows * ncols] === 0xffffff) {
                maxRows++;
            }
            // Parse the data to get the column offsets.
            const { offsets } = PARSERS[this._parser]({
                data: this._rawData,
                delimiter: this._delimiter,
                rowDelimiter: this._rowDelimiter,
                quote: this._quote,
                columnOffsets: true,
                maxRows: maxRows,
                ncols: ncols,
                startIndex: this._rowOffsets[row]
            });
            // Copy results to the cache.
            for (let i = 0; i < offsets.length; i++) {
                this._columnOffsets[rowIndex + i] = offsets[i];
            }
        }
        // Return the offset index from cache.
        return this._columnOffsets[rowIndex + column];
    }
    /**
     * Parse the data string asynchronously.
     *
     * #### Notes
     * It can take several seconds to parse a several hundred megabyte string, so
     * we parse the first 500 rows to get something up on the screen, then we
     * parse the full data string asynchronously.
     */
    parseAsync() {
        // Number of rows to get initially.
        let currentRows = this._initialRows;
        // Number of rows to get in each chunk thereafter. We set this high to just
        // get the rest of the rows for now.
        let chunkRows = Math.pow(2, 32) - 1;
        // We give the UI a chance to draw by delaying the chunk parsing.
        const delay = 30; // milliseconds
        // Define a function to parse a chunk up to and including endRow.
        const parseChunk = (endRow) => {
            try {
                this._computeRowOffsets(endRow);
            }
            catch (e) {
                // Sometimes the data string cannot be parsed with the full parser (for
                // example, we may have the wrong delimiter). In these cases, fall back to
                // the simpler parser so we can show something.
                if (this._parser === 'quotes') {
                    console.warn(e);
                    this._parser = 'noquotes';
                    this._resetParser();
                    this._computeRowOffsets(endRow);
                }
                else {
                    throw e;
                }
            }
            return this._doneParsing;
        };
        // Reset the parser to its initial state.
        this._resetParser();
        // Parse the first rows to give us the start of the data right away.
        const done = parseChunk(currentRows);
        // If we are done, return early.
        if (done) {
            return;
        }
        // Define a function to recursively parse the next chunk after a delay.
        const delayedParse = () => {
            // Parse up to the new end row.
            const done = parseChunk(currentRows + chunkRows);
            currentRows += chunkRows;
            // Gradually double the chunk size until we reach a million rows, if we
            // start below a million-row chunk size.
            if (chunkRows < 1000000) {
                chunkRows *= 2;
            }
            // If we aren't done, the schedule another parse.
            if (done) {
                this._delayedParse = null;
            }
            else {
                this._delayedParse = window.setTimeout(delayedParse, delay);
            }
        };
        // Parse full data string in chunks, delayed by a few milliseconds to give the UI a chance to draw.
        this._delayedParse = window.setTimeout(delayedParse, delay);
    }
    /**
     * Compute the row offsets and initialize the column offset cache.
     *
     * @param endRow - The last row to parse, from the start of the data (first
     * row is row 1).
     *
     * #### Notes
     * This method supports parsing the data incrementally by calling it with
     * incrementally higher endRow. Rows that have already been parsed will not be
     * parsed again.
     */
    _computeRowOffsets(endRow = 4294967295) {
        var _a;
        // If we've already parsed up to endRow, or if we've already parsed the
        // entire data set, return early.
        if (this._rowCount >= endRow || this._doneParsing === true) {
            return;
        }
        // Compute the column count if we don't already have it.
        if (this._columnCount === undefined) {
            // Get number of columns in first row
            this._columnCount = PARSERS[this._parser]({
                data: this._rawData,
                delimiter: this._delimiter,
                rowDelimiter: this._rowDelimiter,
                quote: this._quote,
                columnOffsets: true,
                maxRows: 1
            }).ncols;
        }
        // `reparse` is the number of rows we are requesting to parse over again.
        // We generally start at the beginning of the last row offset, so that the
        // first row offset returned is the same as the last row offset we already
        // have. We parse the data up to and including the requested row.
        const reparse = this._rowCount > 0 ? 1 : 0;
        const { nrows, offsets } = PARSERS[this._parser]({
            data: this._rawData,
            startIndex: (_a = this._rowOffsets[this._rowCount - reparse]) !== null && _a !== void 0 ? _a : 0,
            delimiter: this._delimiter,
            rowDelimiter: this._rowDelimiter,
            quote: this._quote,
            columnOffsets: false,
            maxRows: endRow - this._rowCount + reparse
        });
        // If we have already set up our initial bookkeeping, return early if we
        // did not get any new rows beyond the last row that we've parsed, i.e.,
        // nrows===1.
        if (this._startedParsing && nrows <= reparse) {
            this._doneParsing = true;
            this._ready.resolve(undefined);
            return;
        }
        this._startedParsing = true;
        // Update the row count, accounting for how many rows were reparsed.
        const oldRowCount = this._rowCount;
        const duplicateRows = Math.min(nrows, reparse);
        this._rowCount = oldRowCount + nrows - duplicateRows;
        // If we didn't reach the requested row, we must be done.
        if (this._rowCount < endRow) {
            this._doneParsing = true;
            this._ready.resolve(undefined);
        }
        // Copy the new offsets into a new row offset array if needed.
        if (this._rowCount > oldRowCount) {
            const oldRowOffsets = this._rowOffsets;
            this._rowOffsets = new Uint32Array(this._rowCount);
            this._rowOffsets.set(oldRowOffsets);
            this._rowOffsets.set(offsets, oldRowCount - duplicateRows);
        }
        // Expand the column offsets array if needed
        // If the full column offsets array is small enough, build a cache big
        // enough for all column offsets. We allocate up to 128 megabytes:
        // 128*(2**20 bytes/M)/(4 bytes/entry) = 33554432 entries.
        const maxColumnOffsetsRows = Math.floor(33554432 / this._columnCount);
        // We need to expand the column offset array if we were storing all column
        // offsets before. Check to see if the previous size was small enough that
        // we stored all column offsets.
        if (oldRowCount <= maxColumnOffsetsRows) {
            // Check to see if the new column offsets array is small enough to still
            // store, or if we should cut over to a small cache.
            if (this._rowCount <= maxColumnOffsetsRows) {
                // Expand the existing column offset array for new column offsets.
                const oldColumnOffsets = this._columnOffsets;
                this._columnOffsets = new Uint32Array(this._rowCount * this._columnCount);
                this._columnOffsets.set(oldColumnOffsets);
                this._columnOffsets.fill(0xffffffff, oldColumnOffsets.length);
            }
            else {
                // If not, then our cache size is at most the maximum number of rows we
                // fill in the cache at a time.
                const oldColumnOffsets = this._columnOffsets;
                this._columnOffsets = new Uint32Array(Math.min(this._maxCacheGet, maxColumnOffsetsRows) * this._columnCount);
                // Fill in the entries we already have.
                this._columnOffsets.set(oldColumnOffsets.subarray(0, this._columnOffsets.length));
                // Invalidate the rest of the entries.
                this._columnOffsets.fill(0xffffffff, oldColumnOffsets.length);
                this._columnOffsetsStartingRow = 0;
            }
        }
        // We have more rows than before, so emit the rows-inserted change signal.
        let firstIndex = oldRowCount;
        if (this._header.length > 0) {
            firstIndex -= 1;
        }
        this.emitChanged({
            type: 'rows-inserted',
            region: 'body',
            index: firstIndex,
            span: this._rowCount - oldRowCount
        });
    }
    /**
     * Get the parsed string field for a row and column.
     *
     * @param row - The row number of the data item.
     * @param column - The column number of the data item.
     * @returns The parsed string for the data item.
     */
    _getField(row, column) {
        // Declare local variables.
        let value;
        let nextIndex;
        // Find the index for the first character in the field.
        const index = this.getOffsetIndex(row, column);
        // Initialize the trim adjustments.
        let trimRight = 0;
        let trimLeft = 0;
        // Find the end of the slice (the start of the next field), and how much we
        // should adjust to trim off a trailing field or row delimiter. First check
        // if we are getting the last column.
        if (column === this._columnCount - 1) {
            // Check if we are getting any row but the last.
            if (row < this._rowCount - 1) {
                // Set the next offset to the next row, column 0.
                nextIndex = this.getOffsetIndex(row + 1, 0);
                // Since we are not at the last row, we need to trim off the row
                // delimiter.
                trimRight += this._rowDelimiter.length;
            }
            else {
                // We are getting the last data item, so the slice end is the end of the
                // data string.
                nextIndex = this._rawData.length;
                // The string may or may not end in a row delimiter (RFC 4180 2.2), so
                // we explicitly check if we should trim off a row delimiter.
                if (this._rawData[nextIndex - 1] ===
                    this._rowDelimiter[this._rowDelimiter.length - 1]) {
                    trimRight += this._rowDelimiter.length;
                }
            }
        }
        else {
            // The next field starts at the next column offset.
            nextIndex = this.getOffsetIndex(row, column + 1);
            // Trim off the delimiter if it exists at the end of the field
            if (index < nextIndex &&
                this._rawData[nextIndex - 1] === this._delimiter) {
                trimRight += 1;
            }
        }
        // Check to see if the field begins with a quote. If it does, trim a quote on either side.
        if (this._rawData[index] === this._quote) {
            trimLeft += 1;
            trimRight += 1;
        }
        // Slice the actual value out of the data string.
        value = this._rawData.slice(index + trimLeft, nextIndex - trimRight);
        // If we have a quoted field and we have an escaped quote inside it, unescape it.
        if (trimLeft === 1 && value.indexOf(this._quote) !== -1) {
            value = value.replace(this._quoteEscaped, this._quote);
        }
        // Return the value.
        return value;
    }
    /**
     * Reset the parser state.
     */
    _resetParser() {
        this._columnCount = undefined;
        this._rowOffsets = new Uint32Array(0);
        this._rowCount = 0;
        this._startedParsing = false;
        this._columnOffsets = new Uint32Array(0);
        // Clear out state associated with the asynchronous parsing.
        if (this._doneParsing === false) {
            // Explicitly catch this rejection at least once so an error is not thrown
            // to the console.
            this.ready.catch(() => {
                return;
            });
            this._ready.reject(undefined);
        }
        this._doneParsing = false;
        this._ready = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        if (this._delayedParse !== null) {
            window.clearTimeout(this._delayedParse);
            this._delayedParse = null;
        }
        this.emitChanged({ type: 'model-reset' });
    }
}
//# sourceMappingURL=model.js.map

/***/ }),

/***/ 48234:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   G: () => (/* binding */ parseDSV),
/* harmony export */   z: () => (/* binding */ parseDSVNoQuotes)
/* harmony export */ });
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * Possible parser states.
 */
var STATE;
(function (STATE) {
    STATE[STATE["QUOTED_FIELD"] = 0] = "QUOTED_FIELD";
    STATE[STATE["QUOTED_FIELD_QUOTE"] = 1] = "QUOTED_FIELD_QUOTE";
    STATE[STATE["UNQUOTED_FIELD"] = 2] = "UNQUOTED_FIELD";
    STATE[STATE["NEW_FIELD"] = 3] = "NEW_FIELD";
    STATE[STATE["NEW_ROW"] = 4] = "NEW_ROW";
})(STATE || (STATE = {}));
/**
 * Possible row delimiters for the parser.
 */
var ROW_DELIMITER;
(function (ROW_DELIMITER) {
    ROW_DELIMITER[ROW_DELIMITER["CR"] = 0] = "CR";
    ROW_DELIMITER[ROW_DELIMITER["CRLF"] = 1] = "CRLF";
    ROW_DELIMITER[ROW_DELIMITER["LF"] = 2] = "LF";
})(ROW_DELIMITER || (ROW_DELIMITER = {}));
/**
 * Parse delimiter-separated data.
 *
 * @param options The parser options
 * @returns An object giving the offsets for the rows or columns parsed.
 *
 * #### Notes
 * This implementation is based on [RFC 4180](https://tools.ietf.org/html/rfc4180).
 */
function parseDSV(options) {
    const { data, columnOffsets, delimiter = ',', startIndex = 0, maxRows = 0xffffffff, rowDelimiter = '\r\n', quote = '"' } = options;
    // ncols will be set automatically if it is undefined.
    let ncols = options.ncols;
    // The number of rows we've already parsed.
    let nrows = 0;
    // The row or column offsets we return.
    const offsets = [];
    // Set up some useful local variables.
    const CH_DELIMITER = delimiter.charCodeAt(0);
    const CH_QUOTE = quote.charCodeAt(0);
    const CH_LF = 10; // \n
    const CH_CR = 13; // \r
    const endIndex = data.length;
    const { QUOTED_FIELD, QUOTED_FIELD_QUOTE, UNQUOTED_FIELD, NEW_FIELD, NEW_ROW } = STATE;
    const { CR, LF, CRLF } = ROW_DELIMITER;
    const [rowDelimiterCode, rowDelimiterLength] = rowDelimiter === '\r\n'
        ? [CRLF, 2]
        : rowDelimiter === '\r'
            ? [CR, 1]
            : [LF, 1];
    // Always start off at the beginning of a row.
    let state = NEW_ROW;
    // Set up the starting index.
    let i = startIndex;
    // We initialize to 0 just in case we are asked to parse past the end of the
    // string. In that case, we want the number of columns to be 0.
    let col = 0;
    // Declare some useful temporaries
    let char;
    // Loop through the data string
    while (i < endIndex) {
        // i is the index of a character in the state.
        // If we just hit a new row, and there are still characters left, push a new
        // offset on and reset the column counter. We want this logic at the top of
        // the while loop rather than the bottom because we don't want a trailing
        // row delimiter at the end of the data to trigger a new row offset.
        if (state === NEW_ROW) {
            // Start a new row and reset the column counter.
            offsets.push(i);
            col = 1;
        }
        // Below, we handle this character, modify the parser state and increment the index to be consistent.
        // Get the integer code for the current character, so the comparisons below
        // are faster.
        char = data.charCodeAt(i);
        // Update the parser state. This switch statement is responsible for
        // updating the state to be consistent with the index i+1 (we increment i
        // after the switch statement). In some situations, we may increment i
        // inside this loop to skip over indices as a shortcut.
        switch (state) {
            // At the beginning of a row or field, we can have a quote, row delimiter, or field delimiter.
            case NEW_ROW:
            case NEW_FIELD:
                switch (char) {
                    // If we have a quote, we are starting an escaped field.
                    case CH_QUOTE:
                        state = QUOTED_FIELD;
                        break;
                    // A field delimiter means we are starting a new field.
                    case CH_DELIMITER:
                        state = NEW_FIELD;
                        break;
                    // A row delimiter means we are starting a new row.
                    case CH_CR:
                        if (rowDelimiterCode === CR) {
                            state = NEW_ROW;
                        }
                        else if (rowDelimiterCode === CRLF &&
                            data.charCodeAt(i + 1) === CH_LF) {
                            // If we see an expected \r\n, then increment to the end of the delimiter.
                            i++;
                            state = NEW_ROW;
                        }
                        else {
                            throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(i + 1)}`;
                        }
                        break;
                    case CH_LF:
                        if (rowDelimiterCode === LF) {
                            state = NEW_ROW;
                        }
                        else {
                            throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
                        }
                        break;
                    // Otherwise, we are starting an unquoted field.
                    default:
                        state = UNQUOTED_FIELD;
                        break;
                }
                break;
            // We are in a quoted field.
            case QUOTED_FIELD:
                // Skip ahead until we see another quote, which either ends the quoted
                // field or starts an escaped quote.
                i = data.indexOf(quote, i);
                if (i < 0) {
                    throw `string index ${i} (in row ${nrows}, column ${col}): mismatched quote`;
                }
                state = QUOTED_FIELD_QUOTE;
                break;
            // We just saw a quote in a quoted field. This could be the end of the
            // field, or it could be a repeated quote (i.e., an escaped quote according
            // to RFC 4180).
            case QUOTED_FIELD_QUOTE:
                switch (char) {
                    // Another quote means we just saw an escaped quote, so we are still in
                    // the quoted field.
                    case CH_QUOTE:
                        state = QUOTED_FIELD;
                        break;
                    // A field or row delimiter means the quoted field just ended and we are
                    // going into a new field or new row.
                    case CH_DELIMITER:
                        state = NEW_FIELD;
                        break;
                    // A row delimiter means we are starting a new row in the next index.
                    case CH_CR:
                        if (rowDelimiterCode === CR) {
                            state = NEW_ROW;
                        }
                        else if (rowDelimiterCode === CRLF &&
                            data.charCodeAt(i + 1) === CH_LF) {
                            // If we see an expected \r\n, then increment to the end of the delimiter.
                            i++;
                            state = NEW_ROW;
                        }
                        else {
                            throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(i + 1)}`;
                        }
                        break;
                    case CH_LF:
                        if (rowDelimiterCode === LF) {
                            state = NEW_ROW;
                        }
                        else {
                            throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
                        }
                        break;
                    default:
                        throw `string index ${i} (in row ${nrows}, column ${col}): quote in escaped field not followed by quote, delimiter, or row delimiter`;
                }
                break;
            // We are in an unquoted field, so the only thing we look for is the next
            // row or field delimiter.
            case UNQUOTED_FIELD:
                // Skip ahead to either the next field delimiter or possible start of a
                // row delimiter (CR or LF).
                while (i < endIndex) {
                    char = data.charCodeAt(i);
                    if (char === CH_DELIMITER || char === CH_LF || char === CH_CR) {
                        break;
                    }
                    i++;
                }
                // Process the character we're seeing in an unquoted field.
                switch (char) {
                    // A field delimiter means we are starting a new field.
                    case CH_DELIMITER:
                        state = NEW_FIELD;
                        break;
                    // A row delimiter means we are starting a new row in the next index.
                    case CH_CR:
                        if (rowDelimiterCode === CR) {
                            state = NEW_ROW;
                        }
                        else if (rowDelimiterCode === CRLF &&
                            data.charCodeAt(i + 1) === CH_LF) {
                            // If we see an expected \r\n, then increment to the end of the delimiter.
                            i++;
                            state = NEW_ROW;
                        }
                        else {
                            throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(i + 1)}`;
                        }
                        break;
                    case CH_LF:
                        if (rowDelimiterCode === LF) {
                            state = NEW_ROW;
                        }
                        else {
                            throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
                        }
                        break;
                    // Otherwise, we continue on in the unquoted field.
                    default:
                        continue;
                }
                break;
            // We should never reach this point since the parser state is handled above,
            // so throw an error if we do.
            default:
                throw `string index ${i} (in row ${nrows}, column ${col}): state not recognized`;
        }
        // Increment i to the next character index
        i++;
        // Update return values based on state.
        switch (state) {
            case NEW_ROW:
                nrows++;
                // If ncols is undefined, set it to the number of columns in this row (first row implied).
                if (ncols === undefined) {
                    if (nrows !== 1) {
                        throw new Error('Error parsing default number of columns');
                    }
                    ncols = col;
                }
                // Pad or truncate the column offsets in the previous row if we are
                // returning them.
                if (columnOffsets === true) {
                    if (col < ncols) {
                        // We didn't have enough columns, so add some more column offsets that
                        // point to just before the row delimiter we just saw.
                        for (; col < ncols; col++) {
                            offsets.push(i - rowDelimiterLength);
                        }
                    }
                    else if (col > ncols) {
                        // We had too many columns, so truncate them.
                        offsets.length = offsets.length - (col - ncols);
                    }
                }
                // Shortcut return if nrows reaches the maximum rows we are to parse.
                if (nrows === maxRows) {
                    return { nrows, ncols: columnOffsets ? ncols : 0, offsets };
                }
                break;
            case NEW_FIELD:
                // If we are returning column offsets, log the current index.
                if (columnOffsets === true) {
                    offsets.push(i);
                }
                // Update the column counter.
                col++;
                break;
            default:
                break;
        }
    }
    // If we finished parsing and we are *not* in the NEW_ROW state, then do the
    // column padding/truncation for the last row. Also make sure ncols is
    // defined.
    if (state !== NEW_ROW) {
        nrows++;
        if (columnOffsets === true) {
            // If ncols is *still* undefined, then we only parsed one row and didn't
            // have a newline, so set it to the number of columns we found.
            if (ncols === undefined) {
                ncols = col;
            }
            if (col < ncols) {
                // We didn't have enough columns, so add some more column offsets that
                // point to just before the row delimiter we just saw.
                for (; col < ncols; col++) {
                    offsets.push(i - (rowDelimiterLength - 1));
                }
            }
            else if (col > ncols) {
                // We had too many columns, so truncate them.
                offsets.length = offsets.length - (col - ncols);
            }
        }
    }
    return { nrows, ncols: columnOffsets ? ncols !== null && ncols !== void 0 ? ncols : 0 : 0, offsets };
}
/**
 * Parse delimiter-separated data where no delimiter is quoted.
 *
 * @param options The parser options
 * @returns An object giving the offsets for the rows or columns parsed.
 *
 * #### Notes
 * This function is an optimized parser for cases where there are no field or
 * row delimiters in quotes. Note that the data can have quotes, but they are
 * not interpreted in any special way. This implementation is based on [RFC
 * 4180](https://tools.ietf.org/html/rfc4180), but disregards quotes.
 */
function parseDSVNoQuotes(options) {
    // Set option defaults.
    const { data, columnOffsets, delimiter = ',', rowDelimiter = '\r\n', startIndex = 0, maxRows = 0xffffffff } = options;
    // ncols will be set automatically if it is undefined.
    let ncols = options.ncols;
    // Set up our return variables.
    const offsets = [];
    let nrows = 0;
    // Set up various state variables.
    const rowDelimiterLength = rowDelimiter.length;
    let currRow = startIndex;
    const len = data.length;
    let nextRow;
    let col;
    let rowString;
    let colIndex;
    // The end of the current row.
    let rowEnd;
    // Start parsing at the start index.
    nextRow = startIndex;
    // Loop through rows until we run out of data or we've reached maxRows.
    while (nextRow !== -1 && nrows < maxRows && currRow < len) {
        // Store the offset for the beginning of the row and increment the rows.
        offsets.push(currRow);
        nrows++;
        // Find the next row delimiter.
        nextRow = data.indexOf(rowDelimiter, currRow);
        // If the next row delimiter is not found, set the end of the row to the
        // end of the data string.
        rowEnd = nextRow === -1 ? len : nextRow;
        // If we are returning column offsets, push them onto the array.
        if (columnOffsets === true) {
            // Find the next field delimiter. We slice the current row out so that
            // the indexOf will stop at the end of the row. It may possibly be faster
            // to just use a loop to check each character.
            col = 1;
            rowString = data.slice(currRow, rowEnd);
            colIndex = rowString.indexOf(delimiter);
            if (ncols === undefined) {
                // If we don't know how many columns we need, loop through and find all
                // of the field delimiters in this row.
                while (colIndex !== -1) {
                    offsets.push(currRow + colIndex + 1);
                    col++;
                    colIndex = rowString.indexOf(delimiter, colIndex + 1);
                }
                // Set ncols to the number of fields we found.
                ncols = col;
            }
            else {
                // If we know the number of columns we expect, find the field delimiters
                // up to that many columns.
                while (colIndex !== -1 && col < ncols) {
                    offsets.push(currRow + colIndex + 1);
                    col++;
                    colIndex = rowString.indexOf(delimiter, colIndex + 1);
                }
                // If we didn't reach the number of columns we expected, pad the offsets
                // with the offset just before the row delimiter.
                while (col < ncols) {
                    offsets.push(rowEnd);
                    col++;
                }
            }
        }
        // Skip past the row delimiter at the end of the row.
        currRow = rowEnd + rowDelimiterLength;
    }
    return { nrows, ncols: columnOffsets ? ncols !== null && ncols !== void 0 ? ncols : 0 : 0, offsets };
}
//# sourceMappingURL=parse.js.map

/***/ }),

/***/ 40930:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   p: () => (/* binding */ CSVDelimiter)
/* harmony export */ });
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_2__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * The class name added to a csv toolbar widget.
 */
const CSV_DELIMITER_CLASS = 'jp-CSVDelimiter';
const CSV_DELIMITER_LABEL_CLASS = 'jp-CSVDelimiter-label';
/**
 * The class name added to a csv toolbar's dropdown element.
 */
const CSV_DELIMITER_DROPDOWN_CLASS = 'jp-CSVDelimiter-dropdown';
/**
 * A widget for selecting a delimiter.
 */
class CSVDelimiter extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.Widget {
    /**
     * Construct a new csv table widget.
     */
    constructor(options) {
        super({
            node: Private.createNode(options.widget.delimiter, options.translator)
        });
        this._widget = options.widget;
        this.addClass(CSV_DELIMITER_CLASS);
    }
    /**
     * The delimiter dropdown menu.
     */
    get selectNode() {
        return this.node.getElementsByTagName('select')[0];
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the dock panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'change':
                this._widget.delimiter = this.selectNode.value;
                break;
            default:
                break;
        }
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        this.selectNode.addEventListener('change', this);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        this.selectNode.removeEventListener('change', this);
    }
}
/**
 * A namespace for private toolbar methods.
 */
var Private;
(function (Private) {
    /**
     * Create the node for the delimiter switcher.
     */
    function createNode(selected, translator) {
        translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0__.nullTranslator;
        const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');
        // The supported parsing delimiters and labels.
        const delimiters = [
            [',', ','],
            [';', ';'],
            ['\t', trans.__('tab')],
            ['|', trans.__('pipe')],
            ['#', trans.__('hash')]
        ];
        const div = document.createElement('div');
        const label = document.createElement('span');
        const select = document.createElement('select');
        label.textContent = trans.__('Delimiter: ');
        label.className = CSV_DELIMITER_LABEL_CLASS;
        for (const [delimiter, label] of delimiters) {
            const option = document.createElement('option');
            option.value = delimiter;
            option.textContent = label;
            if (delimiter === selected) {
                option.selected = true;
            }
            select.appendChild(option);
        }
        div.appendChild(label);
        const node = _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__.Styling.wrapSelect(select);
        node.classList.add(CSV_DELIMITER_DROPDOWN_CLASS);
        div.appendChild(node);
        return div;
    }
    Private.createNode = createNode;
})(Private || (Private = {}));
//# sourceMappingURL=toolbar.js.map

/***/ }),

/***/ 21058:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A9: () => (/* binding */ CSVViewer),
/* harmony export */   B0: () => (/* binding */ TextRenderConfig),
/* harmony export */   JZ: () => (/* binding */ GridSearchService),
/* harmony export */   LT: () => (/* binding */ CSVViewerFactory),
/* harmony export */   _d: () => (/* binding */ TSVViewerFactory),
/* harmony export */   kw: () => (/* binding */ CSVDocumentWidget)
/* harmony export */ });
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34992);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(40930);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * The class name added to a CSV viewer.
 */
const CSV_CLASS = 'jp-CSVViewer';
/**
 * The class name added to a CSV viewer datagrid.
 */
const CSV_GRID_CLASS = 'jp-CSVViewer-grid';
/**
 * The timeout to wait for change activity to have ceased before rendering.
 */
const RENDER_TIMEOUT = 1000;
/**
 * Configuration for cells textrenderer.
 */
class TextRenderConfig {
}
/**
 * Search service remembers the search state and the location of the last
 * match, for incremental searching.
 * Search service is also responsible of providing a cell renderer function
 * to set the background color of cells matching the search text.
 */
class GridSearchService {
    constructor(grid) {
        this._looping = true;
        this._changed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal(this);
        this._grid = grid;
        this._query = null;
        this._row = 0;
        this._column = -1;
    }
    /**
     * A signal fired when the grid changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Returns a cellrenderer config function to render each cell background.
     * If cell match, background is matchBackgroundColor, if it's the current
     * match, background is currentMatchBackgroundColor.
     */
    cellBackgroundColorRendererFunc(config) {
        return ({ value, row, column }) => {
            if (this._query) {
                if (value.match(this._query)) {
                    if (this._row === row && this._column === column) {
                        return config.currentMatchBackgroundColor;
                    }
                    return config.matchBackgroundColor;
                }
            }
            return '';
        };
    }
    /**
     * Clear the search.
     */
    clear() {
        this._query = null;
        this._row = 0;
        this._column = -1;
        this._changed.emit(undefined);
    }
    /**
     * incrementally look for searchText.
     */
    find(query, reverse = false) {
        const model = this._grid.dataModel;
        const rowCount = model.rowCount('body');
        const columnCount = model.columnCount('body');
        if (this._query !== query) {
            // reset search
            this._row = 0;
            this._column = -1;
        }
        this._query = query;
        // check if the match is in current viewport
        const minRow = this._grid.scrollY / this._grid.defaultSizes.rowHeight;
        const maxRow = (this._grid.scrollY + this._grid.pageHeight) /
            this._grid.defaultSizes.rowHeight;
        const minColumn = this._grid.scrollX / this._grid.defaultSizes.columnHeaderHeight;
        const maxColumn = (this._grid.scrollX + this._grid.pageWidth) /
            this._grid.defaultSizes.columnHeaderHeight;
        const isInViewport = (row, column) => {
            return (row >= minRow &&
                row <= maxRow &&
                column >= minColumn &&
                column <= maxColumn);
        };
        const increment = reverse ? -1 : 1;
        this._column += increment;
        for (let row = this._row; reverse ? row >= 0 : row < rowCount; row += increment) {
            for (let col = this._column; reverse ? col >= 0 : col < columnCount; col += increment) {
                const cellData = model.data('body', row, col);
                if (cellData.match(query)) {
                    // to update the background of matching cells.
                    // TODO: we only really need to invalidate the previous and current
                    // cell rects, not the entire grid.
                    this._changed.emit(undefined);
                    if (!isInViewport(row, col)) {
                        this._grid.scrollToRow(row);
                    }
                    this._row = row;
                    this._column = col;
                    return true;
                }
            }
            this._column = reverse ? columnCount - 1 : 0;
        }
        // We've finished searching all the way to the limits of the grid. If this
        // is the first time through (looping is true), wrap the indices and search
        // again. Otherwise, give up.
        if (this._looping) {
            this._looping = false;
            this._row = reverse ? 0 : rowCount - 1;
            this._wrapRows(reverse);
            try {
                return this.find(query, reverse);
            }
            finally {
                this._looping = true;
            }
        }
        return false;
    }
    /**
     * Wrap indices if needed to just before the start or just after the end.
     */
    _wrapRows(reverse = false) {
        const model = this._grid.dataModel;
        const rowCount = model.rowCount('body');
        const columnCount = model.columnCount('body');
        if (reverse && this._row <= 0) {
            // if we are at the front, wrap to just past the end.
            this._row = rowCount - 1;
            this._column = columnCount;
        }
        else if (!reverse && this._row >= rowCount - 1) {
            // if we are at the end, wrap to just before the front.
            this._row = 0;
            this._column = -1;
        }
    }
    get query() {
        return this._query;
    }
}
/**
 * A viewer for CSV tables.
 */
class CSVViewer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_4__.Widget {
    /**
     * Construct a new CSV viewer.
     */
    constructor(options) {
        super();
        this._monitor = null;
        this._delimiter = ',';
        this._revealed = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
        this._baseRenderer = null;
        this._context = options.context;
        this.layout = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_4__.PanelLayout();
        this.addClass(CSV_CLASS);
        this._ready = this.initialize();
    }
    /**
     * Promise which resolves when the content is ready.
     */
    get ready() {
        return this._ready;
    }
    async initialize() {
        const layout = this.layout;
        if (this.isDisposed || !layout) {
            return;
        }
        const { BasicKeyHandler, BasicMouseHandler, DataGrid } = await Private.ensureDataGrid();
        this._defaultStyle = DataGrid.defaultStyle;
        this._grid = new DataGrid({
            defaultSizes: {
                rowHeight: 24,
                columnWidth: 144,
                rowHeaderWidth: 64,
                columnHeaderHeight: 36
            }
        });
        this._grid.addClass(CSV_GRID_CLASS);
        this._grid.headerVisibility = 'all';
        this._grid.keyHandler = new BasicKeyHandler();
        this._grid.mouseHandler = new BasicMouseHandler();
        this._grid.copyConfig = {
            separator: '\t',
            format: DataGrid.copyFormatGeneric,
            headers: 'all',
            warningThreshold: 1e6
        };
        layout.addWidget(this._grid);
        this._searchService = new GridSearchService(this._grid);
        this._searchService.changed.connect(this._updateRenderer, this);
        await this._context.ready;
        await this._updateGrid();
        this._revealed.resolve(undefined);
        // Throttle the rendering rate of the widget.
        this._monitor = new _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.ActivityMonitor({
            signal: this._context.model.contentChanged,
            timeout: RENDER_TIMEOUT
        });
        this._monitor.activityStopped.connect(this._updateGrid, this);
    }
    /**
     * The CSV widget's context.
     */
    get context() {
        return this._context;
    }
    /**
     * A promise that resolves when the csv viewer is ready to be revealed.
     */
    get revealed() {
        return this._revealed.promise;
    }
    /**
     * The delimiter for the file.
     */
    get delimiter() {
        return this._delimiter;
    }
    set delimiter(value) {
        if (value === this._delimiter) {
            return;
        }
        this._delimiter = value;
        void this._updateGrid();
    }
    /**
     * The style used by the data grid.
     */
    get style() {
        return this._grid.style;
    }
    set style(value) {
        this._grid.style = { ...this._defaultStyle, ...value };
    }
    /**
     * The config used to create text renderer.
     */
    set rendererConfig(rendererConfig) {
        this._baseRenderer = rendererConfig;
        void this._updateRenderer();
    }
    /**
     * The search service
     */
    get searchService() {
        return this._searchService;
    }
    /**
     * Dispose of the resources used by the widget.
     */
    dispose() {
        if (this._monitor) {
            this._monitor.dispose();
        }
        super.dispose();
    }
    /**
     * Go to line
     */
    goToLine(lineNumber) {
        this._grid.scrollToRow(lineNumber);
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        this.node.tabIndex = -1;
        this.node.focus();
    }
    /**
     * Create the model for the grid.
     */
    async _updateGrid() {
        const { BasicSelectionModel } = await Private.ensureDataGrid();
        const { DSVModel } = await Private.ensureDSVModel();
        const data = this._context.model.toString();
        const delimiter = this._delimiter;
        const oldModel = this._grid.dataModel;
        const dataModel = (this._grid.dataModel = new DSVModel({
            data,
            delimiter
        }));
        this._grid.selectionModel = new BasicSelectionModel({ dataModel });
        if (oldModel) {
            oldModel.dispose();
        }
    }
    /**
     * Update the renderer for the grid.
     */
    async _updateRenderer() {
        if (this._baseRenderer === null) {
            return;
        }
        const { TextRenderer } = await Private.ensureDataGrid();
        const rendererConfig = this._baseRenderer;
        const renderer = new TextRenderer({
            textColor: rendererConfig.textColor,
            horizontalAlignment: rendererConfig.horizontalAlignment,
            backgroundColor: this._searchService.cellBackgroundColorRendererFunc(rendererConfig)
        });
        this._grid.cellRenderers.update({
            body: renderer,
            'column-header': renderer,
            'corner-header': renderer,
            'row-header': renderer
        });
    }
}
/**
 * A document widget for CSV content widgets.
 */
class CSVDocumentWidget extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__.DocumentWidget {
    constructor(options) {
        let { content, context, delimiter, reveal, ...other } = options;
        content = content || Private.createContent(context);
        reveal = Promise.all([reveal, content.revealed]);
        super({ content, context, reveal, ...other });
        if (delimiter) {
            content.delimiter = delimiter;
        }
    }
    /**
     * Set URI fragment identifier for rows
     */
    setFragment(fragment) {
        const parseFragments = fragment.split('=');
        // TODO: expand to allow columns and cells to be selected
        // reference: https://tools.ietf.org/html/rfc7111#section-3
        if (parseFragments[0] !== '#row') {
            return;
        }
        // multiple rows, separated by semi-colons can be provided, we will just
        // go to the top one
        let topRow = parseFragments[1].split(';')[0];
        // a range of rows can be provided, we will take the first value
        topRow = topRow.split('-')[0];
        // go to that row
        void this.context.ready.then(() => {
            this.content.goToLine(Number(topRow));
        });
    }
}
/**
 * A widget factory for CSV widgets.
 */
class CSVViewerFactory extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__.ABCWidgetFactory {
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        const translator = this.translator;
        return new CSVDocumentWidget({ context, translator });
    }
    /**
     * Default factory for toolbar items to be added after the widget is created.
     */
    defaultToolbarFactory(widget) {
        return [
            {
                name: 'delimiter',
                widget: new _toolbar__WEBPACK_IMPORTED_MODULE_5__/* .CSVDelimiter */ .p({
                    widget: widget.content,
                    translator: this.translator
                })
            }
        ];
    }
}
/**
 * A widget factory for TSV widgets.
 */
class TSVViewerFactory extends CSVViewerFactory {
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        const delimiter = '\t';
        return new CSVDocumentWidget({
            context,
            delimiter,
            translator: this.translator
        });
    }
}
var Private;
(function (Private) {
    let gridLoaded = null;
    let modelLoaded = null;
    /**
     * Lazily load the datagrid module when the first grid is requested.
     */
    async function ensureDataGrid() {
        if (gridLoaded == null) {
            gridLoaded = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
            gridLoaded.resolve(await __webpack_require__.e(/* import() */ 2444).then(__webpack_require__.t.bind(__webpack_require__, 32444, 23)));
        }
        return gridLoaded.promise;
    }
    Private.ensureDataGrid = ensureDataGrid;
    async function ensureDSVModel() {
        if (modelLoaded == null) {
            modelLoaded = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
            modelLoaded.resolve(await Promise.all(/* import() */[__webpack_require__.e(4144), __webpack_require__.e(2444)]).then(__webpack_require__.bind(__webpack_require__, 18032)));
        }
        return modelLoaded.promise;
    }
    Private.ensureDSVModel = ensureDSVModel;
    function createContent(context) {
        return new CSVViewer({ context });
    }
    Private.createContent = createContent;
})(Private || (Private = {}));
//# sourceMappingURL=widget.js.map

/***/ }),

/***/ 68217:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/console@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/console/lib/index.js)
var console_lib_index_js_ = __webpack_require__(69897);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/debugger@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/debugger/lib/index.js)
var debugger_lib_index_js_ = __webpack_require__(25845);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/fileeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/fileeditor/lib/index.js)
var fileeditor_lib_index_js_ = __webpack_require__(82591);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/notebook@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/notebook/lib/index.js)
var notebook_lib_index_js_ = __webpack_require__(58448);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/completer@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/completer/lib/index.js)
var completer_lib_index_js_ = __webpack_require__(27709);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger-extension/lib/debug-console-executor.js
/**
 * Custom console cell executor that uses debugger evaluation.
 */
class DebugConsoleCellExecutor {
    constructor(options) {
        this._debuggerService = options.debuggerService;
        this._trans = options.trans;
    }
    /**
     * Create an IDisplayData object with the given text content.
     */
    createDisplayData(text, executionCount) {
        return {
            output_type: 'display_data',
            data: {
                'text/plain': text
            },
            metadata: {
                execution_count: executionCount
            }
        };
    }
    async evaluateWithDebugger(options) {
        const { code, executionCount } = options;
        try {
            // Check if debugger has stopped threads (required for evaluation)
            if (!this._debuggerService.hasStoppedThreads()) {
                return this.createDisplayData(this._trans.__('Debugger does not have stopped threads - cannot evaluate'), executionCount);
            }
            // Evaluate the code using the debugger service
            const reply = await this._debuggerService.evaluate(code);
            if (!reply) {
                return this.createDisplayData(this._trans.__('Evaluation resulted in an error'), executionCount);
            }
            // Convert reply to IDisplayData format
            return this.createDisplayData(reply.result, executionCount);
        }
        catch (error) {
            console.error('Error evaluating code with debugger:', error);
            return this.createDisplayData(`Error: ${error}`, executionCount);
        }
    }
    /**
     * Execute a cell using debugger evaluation.
     */
    async runCell(options) {
        const { cell } = options;
        const code = cell.model.sharedModel.getSource();
        const executionCount = cell.model.sharedModel.execution_count;
        const outputDisplayData = await this.evaluateWithDebugger({
            code,
            executionCount
        });
        if (!outputDisplayData) {
            const errorOutputData = this.createDisplayData(this._trans.__('Could not display output data'), executionCount);
            cell.model.outputs.add(errorOutputData);
            return false;
        }
        cell.model.outputs.add(outputDisplayData);
        return true;
    }
}
//# sourceMappingURL=debug-console-executor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger-extension/lib/debugger-completion-provider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Completion provider that uses debugger evaluation for suggestions.
 */
class DebuggerCompletionProvider {
    constructor(options) {
        this.options = options;
        this.identifier = 'DebuggerCompletionProvider';
        this.rank = 1000;
        const translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = translator.load('jupyterlab');
        this.name = this._trans.__('Debugger');
        this._debuggerService = options.debuggerService;
    }
    /**
     * Check if this completion provider is applicable to the given context.
     */
    async isApplicable(context) {
        var _a, _b, _c;
        try {
            const spec = await ((_c = (_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.spec);
            return (spec === null || spec === void 0 ? void 0 : spec.language) === 'python';
        }
        catch (error) {
            return false;
        }
    }
    /**
     * Fetch completion suggestions using debugger evaluation.
     */
    async fetch(request, context, trigger) {
        var _a, _b;
        let items = [];
        let parsedResult;
        try {
            const { text, offset } = request;
            const pyCode = `
from IPython.core.completer import provisionalcompleter as _provisionalcompleter
from IPython.core.completer import rectify_completions as _rectify_completions
from IPython.core.completer import IPCompleter
_EXPERIMENTAL_KEY_NAME = "_jupyter_types_experimental"

def getCompletionsForDebugger(code, cursor_pos):
    ip = get_ipython()

    # Access the current debugger frame
    import inspect
    current_frame = inspect.currentframe()

    # Get the frame that called this function (the debugger's target frame)
    caller_frame = current_frame.f_back if current_frame else None

    # Get the debugger's frame variables
    if caller_frame:
        frame_locals = caller_frame.f_locals
        frame_globals = caller_frame.f_globals
    else:
        frame_locals = locals()
        frame_globals = globals()

    local_completer = IPCompleter(shell=ip, namespace=frame_locals, global_namespace=frame_globals, parent=ip)

    with _provisionalcompleter():
        raw_completions = local_completer.completions(code, cursor_pos)
        completions = list(_rectify_completions(code, raw_completions))

        comps = []
        for comp in completions:
            comps.append(
                dict(
                    start=comp.start,
                    end=comp.end,
                    text=comp.text,
                    type=comp.type,
                    signature=comp.signature,
                )
            )

        if completions:
            s = completions[0].start
            e = completions[0].end
            matches = [c.text for c in completions]
            types = [c.type for c in completions]
        else:
            s = cursor_pos
            e = cursor_pos
            matches = []
            types = []

        result = {
            "matches": matches,
            "types": types,
            "cursor_end": e,
            "cursor_start": s,
            "status": "ok",
        }

        return result
`;
            // create method
            await this._debuggerService.evaluate(pyCode);
            const debuggerCompletions = `getCompletionsForDebugger(${JSON.stringify(text)}, ${offset})`;
            const evalReply = await this._debuggerService.evaluate(debuggerCompletions);
            if (!evalReply) {
                return { start: 0, end: 0, items: [] };
            }
            const matches = evalReply.result;
            // Replace single quotes with double quotes in matches string for JSON parsing
            let correctedMatches = matches.replace(/'/g, '"');
            // TODO - Investigate truncation
            // The eval reply from kernel truncates the result string (a string representation
            // of an array containing completion results). Anything after a certain number of
            // matches (19 for ipykernel) is replaced by ellipses, which needs to be removed to parse into JSON.
            correctedMatches = correctedMatches.replace(/, \.\.\./g, '');
            try {
                parsedResult = JSON.parse(correctedMatches);
            }
            catch (error) {
                console.error('Failed to parse corrected matches:', error);
                return { start: 0, end: 0, items: [] };
            }
            // Parse completions into completion items
            const parsedCompletions = parsedResult.matches.map((match, index) => {
                var _a;
                return ({
                    label: match,
                    insertText: match,
                    type: ((_a = parsedResult.types) === null || _a === void 0 ? void 0 : _a[index]) || undefined
                });
            });
            items = [...parsedCompletions];
        }
        catch (error) {
            console.warn('Error fetching debugger completions:', error);
            // Return empty items on error
            return { start: 0, end: 0, items: [] };
        }
        // Extract cursor positions from the parsed result if available
        const start = (_a = parsedResult.cursor_start) !== null && _a !== void 0 ? _a : 0;
        const end = (_b = parsedResult.cursor_end) !== null && _b !== void 0 ? _b : 0;
        return { start, end, items };
    }
}
//# sourceMappingURL=debugger-completion-provider.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/cells@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/cells/lib/index.js)
var cells_lib_index_js_ = __webpack_require__(9214);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module debugger-extension
 */

















function notifyCommands(commands) {
    Object.values(debugger_lib_index_js_.Debugger.CommandIDs).forEach(command => {
        if (commands.hasCommand(command)) {
            commands.notifyCommandChanged(command);
        }
    });
}
function updateState(commands, debug) {
    const hasStoppedThreads = debug.hasStoppedThreads();
    if (hasStoppedThreads) {
        document.body.dataset.jpDebuggerStoppedThreads = 'true';
    }
    else {
        delete document.body.dataset.jpDebuggerStoppedThreads;
    }
    notifyCommands(commands);
}
/**
 * A plugin that provides visual debugging support for consoles.
 */
const consoles = {
    // FIXME This should be in @jupyterlab/console-extension
    id: '@jupyterlab/debugger-extension:consoles',
    description: 'Add debugger capability to the consoles.',
    autoStart: true,
    requires: [debugger_lib_index_js_.IDebugger, console_lib_index_js_.IConsoleTracker],
    optional: [
        index_js_.ILabShell,
        settingregistry_lib_index_js_.ISettingRegistry,
        translation_lib_index_js_.ITranslator,
        debugger_lib_index_js_.IDebuggerDisplayRegistry
    ],
    activate: async (app, debug, consoleTracker, labShell, settingRegistry, translator, displayRegistry) => {
        if (settingRegistry) {
            const settings = await (settingRegistry === null || settingRegistry === void 0 ? void 0 : settingRegistry.load(main.id));
            const updateOverlaySetting = () => {
                var _a;
                const showOverlay = (_a = settings.composite['showPausedOverlay']) !== null && _a !== void 0 ? _a : true;
                document.body.dataset.showPausedOverlay = showOverlay
                    ? 'true'
                    : 'false';
            };
            updateOverlaySetting();
            settings.changed.connect(updateOverlaySetting);
        }
        const handler = new debugger_lib_index_js_.Debugger.Handler({
            type: 'console',
            shell: app.shell,
            service: debug,
            translator: translator
        });
        const updateHandlerAndCommands = async (widget) => {
            const { sessionContext } = widget;
            await sessionContext.ready;
            await handler.updateContext(widget, sessionContext);
            updateState(app.commands, debug);
        };
        if (labShell) {
            labShell.currentChanged.connect((_, update) => {
                const widget = update.newValue;
                if (widget instanceof console_lib_index_js_.ConsolePanel) {
                    void updateHandlerAndCommands(widget);
                }
            });
        }
        else {
            consoleTracker.currentChanged.connect((_, consolePanel) => {
                if (consolePanel) {
                    void updateHandlerAndCommands(consolePanel);
                }
            });
        }
        if (displayRegistry) {
            displayRegistry.register({
                canHandle(source) {
                    var _a, _b;
                    return (_b = (_a = source.path) === null || _a === void 0 ? void 0 : _a.includes('ipykernel_')) !== null && _b !== void 0 ? _b : false;
                },
                getDisplayName(source) {
                    var _a;
                    let displayName = (_a = source.path) !== null && _a !== void 0 ? _a : '';
                    consoleTracker.forEach(panel => {
                        var _a, _b;
                        for (const cell of panel.console.cells) {
                            const model = cell.model;
                            if (!(0,cells_lib_index_js_.isCodeCellModel)(model)) {
                                continue;
                            }
                            const code = model.sharedModel.getSource();
                            const codeId = debug.getCodeId(code);
                            if (codeId && codeId === source.path) {
                                const exec = (_a = model.executionCount) !== null && _a !== void 0 ? _a : null;
                                const state = (_b = model.executionState) !== null && _b !== void 0 ? _b : null;
                                if (state === 'running') {
                                    displayName = 'In [*]';
                                }
                                else if (exec === null) {
                                    displayName = 'In [ ]';
                                }
                                else {
                                    displayName = `In [${exec}]`;
                                }
                                return;
                            }
                        }
                    });
                    return displayName;
                }
            });
        }
    }
};
/**
 * A plugin that provides visual debugging support for file editors.
 */
const files = {
    // FIXME This should be in @jupyterlab/fileeditor-extension
    id: '@jupyterlab/debugger-extension:files',
    description: 'Adds debugger capabilities to files.',
    autoStart: true,
    requires: [debugger_lib_index_js_.IDebugger, fileeditor_lib_index_js_.IEditorTracker],
    optional: [index_js_.ILabShell, settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    activate: async (app, debug, editorTracker, labShell, settingRegistry, translator) => {
        if (settingRegistry) {
            const settings = await (settingRegistry === null || settingRegistry === void 0 ? void 0 : settingRegistry.load(main.id));
            const updateOverlaySetting = () => {
                var _a;
                const showOverlay = (_a = settings.composite['showPausedOverlay']) !== null && _a !== void 0 ? _a : true;
                document.body.dataset.showPausedOverlay = showOverlay
                    ? 'true'
                    : 'false';
            };
            updateOverlaySetting();
            settings.changed.connect(updateOverlaySetting);
        }
        const handler = new debugger_lib_index_js_.Debugger.Handler({
            type: 'file',
            shell: app.shell,
            service: debug,
            translator: translator
        });
        const activeSessions = {};
        const updateHandlerAndCommands = async (widget) => {
            const sessions = app.serviceManager.sessions;
            try {
                const model = await sessions.findByPath(widget.context.path);
                if (!model) {
                    return;
                }
                let session = activeSessions[model.id];
                if (!session) {
                    // Use `connectTo` only if the session does not exist.
                    // `connectTo` sends a kernel_info_request on the shell
                    // channel, which blocks the debug session restore when waiting
                    // for the kernel to be ready
                    session = sessions.connectTo({ model });
                    activeSessions[model.id] = session;
                }
                await handler.update(widget, session);
                updateState(app.commands, debug);
            }
            catch (_a) {
                return;
            }
        };
        if (labShell) {
            labShell.currentChanged.connect((_, update) => {
                const widget = update.newValue;
                if (widget instanceof docregistry_lib_index_js_.DocumentWidget) {
                    const { content } = widget;
                    if (content instanceof fileeditor_lib_index_js_.FileEditor) {
                        void updateHandlerAndCommands(widget);
                    }
                }
            });
        }
        else {
            editorTracker.currentChanged.connect((_, documentWidget) => {
                if (documentWidget) {
                    void updateHandlerAndCommands(documentWidget);
                }
            });
        }
    }
};
/**
 * A plugin that provides visual debugging support for notebooks.
 */
const notebooks = {
    // FIXME This should be in @jupyterlab/notebook-extension
    id: '@jupyterlab/debugger-extension:notebooks',
    description: 'Adds debugger capability to notebooks and provides the debugger notebook handler.',
    autoStart: true,
    requires: [debugger_lib_index_js_.IDebugger, notebook_lib_index_js_.INotebookTracker],
    optional: [
        index_js_.ILabShell,
        lib_index_js_.ICommandPalette,
        lib_index_js_.ISessionContextDialogs,
        settingregistry_lib_index_js_.ISettingRegistry,
        translation_lib_index_js_.ITranslator,
        debugger_lib_index_js_.IDebuggerDisplayRegistry
    ],
    provides: debugger_lib_index_js_.IDebuggerHandler,
    activate: async (app, service, notebookTracker, labShell, palette, sessionDialogs_, settingRegistry, translator_, displayRegistry) => {
        const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
        if (settingRegistry) {
            const settings = await (settingRegistry === null || settingRegistry === void 0 ? void 0 : settingRegistry.load(main.id));
            const updateOverlaySetting = () => {
                var _a;
                const showOverlay = (_a = settings.composite['showPausedOverlay']) !== null && _a !== void 0 ? _a : true;
                document.body.dataset.showPausedOverlay = showOverlay
                    ? 'true'
                    : 'false';
            };
            updateOverlaySetting();
            settings.changed.connect(updateOverlaySetting);
        }
        const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new lib_index_js_.SessionContextDialogs({ translator });
        const handler = new debugger_lib_index_js_.Debugger.Handler({
            type: 'notebook',
            shell: app.shell,
            service,
            translator: translator
        });
        const trans = translator.load('jupyterlab');
        app.commands.addCommand(debugger_lib_index_js_.Debugger.CommandIDs.restartDebug, {
            label: trans.__('Restart Kernel and Debug…'),
            caption: trans.__('Restart Kernel and Debug…'),
            isEnabled: () => service.isStarted,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: async () => {
                const state = service.getDebuggerState();
                const widget = notebookTracker.currentWidget;
                if (!widget) {
                    return;
                }
                const { content, sessionContext } = widget;
                const restarted = await sessionDialogs.restart(sessionContext, {
                    onBeforeRestart: async () => {
                        await service.stop();
                    }
                });
                if (!restarted) {
                    return;
                }
                await service.start();
                await service.restoreDebuggerState(state);
                await handler.updateWidget(widget, sessionContext.session);
                await notebook_lib_index_js_.NotebookActions.runAll(content, sessionContext, sessionDialogs, translator);
            }
        });
        const updateHandlerAndCommands = async (widget) => {
            if (widget) {
                const { sessionContext } = widget;
                await sessionContext.ready;
                await handler.updateContext(widget, sessionContext);
                await handler.updateWidget(widget, sessionContext.session);
            }
            updateState(app.commands, service);
        };
        if (labShell) {
            labShell.currentChanged.connect((_, update) => {
                const widget = update.newValue;
                if (widget instanceof notebook_lib_index_js_.NotebookPanel) {
                    void updateHandlerAndCommands(widget);
                }
            });
        }
        else {
            notebookTracker.currentChanged.connect((_, notebookPanel) => {
                if (notebookPanel) {
                    void updateHandlerAndCommands(notebookPanel);
                }
            });
        }
        if (palette) {
            palette.addItem({
                category: 'Notebook Operations',
                command: debugger_lib_index_js_.Debugger.CommandIDs.restartDebug
            });
        }
        if (displayRegistry) {
            displayRegistry.register({
                canHandle(source) {
                    var _a, _b;
                    return (_b = (_a = source.path) === null || _a === void 0 ? void 0 : _a.includes('ipykernel_')) !== null && _b !== void 0 ? _b : false;
                },
                getDisplayName(source) {
                    var _a;
                    let displayName = (_a = source.path) !== null && _a !== void 0 ? _a : '';
                    notebookTracker.forEach(panel => {
                        for (const cell of panel.content.widgets) {
                            const model = cell.model;
                            if (!(0,cells_lib_index_js_.isCodeCellModel)(model)) {
                                continue;
                            }
                            const code = model.sharedModel.getSource();
                            const codeId = service.getCodeId(code);
                            if (codeId === source.path) {
                                const exec = model.executionCount;
                                if (model.executionState === 'running') {
                                    displayName = 'Cell [*]';
                                }
                                else {
                                    displayName = exec == null ? 'Cell [ ]' : `Cell [${exec}]`;
                                }
                                // Stop iteration once we found the matching cell
                                return;
                            }
                        }
                    });
                    return displayName;
                }
            });
        }
        return handler;
    }
};
/**
 * A plugin that provides a debugger service.
 */
const service = {
    id: '@jupyterlab/debugger-extension:service',
    description: 'Provides the debugger service.',
    autoStart: true,
    provides: debugger_lib_index_js_.IDebugger,
    requires: [debugger_lib_index_js_.IDebuggerConfig],
    optional: [debugger_lib_index_js_.IDebuggerDisplayRegistry, debugger_lib_index_js_.IDebuggerSources, translation_lib_index_js_.ITranslator],
    activate: (app, config, displayRegistry, debuggerSources, translator) => new debugger_lib_index_js_.Debugger.Service({
        config,
        displayRegistry,
        debuggerSources,
        specsManager: app.serviceManager.kernelspecs,
        translator
    })
};
/**
 * A plugin providing the debugger display registry.
 */
const displayRegistry = {
    id: '@jupyterlab/debugger-extension:display-registry',
    description: 'Provides the debugger display registry for cell/file display names.',
    provides: debugger_lib_index_js_.IDebuggerDisplayRegistry,
    autoStart: true,
    activate: () => new debugger_lib_index_js_.DebuggerDisplayRegistry()
};
/**
 * A plugin that provides a configuration with hash method.
 */
const configuration = {
    id: '@jupyterlab/debugger-extension:config',
    description: 'Provides the debugger configuration',
    provides: debugger_lib_index_js_.IDebuggerConfig,
    autoStart: true,
    activate: () => new debugger_lib_index_js_.Debugger.Config()
};
/**
 * A plugin that provides source/editor functionality for debugging.
 */
const sources = {
    id: '@jupyterlab/debugger-extension:sources',
    description: 'Provides the source feature for debugging',
    autoStart: true,
    provides: debugger_lib_index_js_.IDebuggerSources,
    requires: [debugger_lib_index_js_.IDebuggerConfig, codeeditor_lib_index_js_.IEditorServices],
    optional: [notebook_lib_index_js_.INotebookTracker, console_lib_index_js_.IConsoleTracker, fileeditor_lib_index_js_.IEditorTracker],
    activate: (app, config, editorServices, notebookTracker, consoleTracker, editorTracker) => {
        return new debugger_lib_index_js_.Debugger.Sources({
            config,
            shell: app.shell,
            editorServices,
            notebookTracker,
            consoleTracker,
            editorTracker
        });
    }
};
/**
 * A plugin to open detailed views for variables.
 */
const variables = {
    id: '@jupyterlab/debugger-extension:variables',
    description: 'Adds variables renderer and inspection in the debugger variable panel.',
    autoStart: true,
    requires: [debugger_lib_index_js_.IDebugger, debugger_lib_index_js_.IDebuggerHandler, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.IThemeManager, rendermime_lib_index_js_.IRenderMimeRegistry],
    activate: (app, service, handler, translator, themeManager, rendermime) => {
        const trans = translator.load('jupyterlab');
        const { commands, shell } = app;
        const tracker = new lib_index_js_.WidgetTracker({
            namespace: 'debugger/inspect-variable'
        });
        const trackerMime = new lib_index_js_.WidgetTracker({
            namespace: 'debugger/render-variable'
        });
        const CommandIDs = debugger_lib_index_js_.Debugger.CommandIDs;
        // Add commands
        commands.addCommand(CommandIDs.inspectVariable, {
            label: trans.__('Inspect Variable'),
            caption: trans.__('Inspect Variable'),
            isEnabled: args => {
                var _a, _b, _c, _d;
                return !!((_a = service.session) === null || _a === void 0 ? void 0 : _a.isStarted) &&
                    Number((_d = (_b = args.variableReference) !== null && _b !== void 0 ? _b : (_c = service.model.variables.selectedVariable) === null || _c === void 0 ? void 0 : _c.variablesReference) !== null && _d !== void 0 ? _d : 0) > 0;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        variableReference: {
                            type: 'number',
                            description: trans.__('The variable reference to inspect')
                        },
                        name: {
                            type: 'string',
                            description: trans.__('The name of the variable to inspect')
                        }
                    }
                }
            },
            execute: async (args) => {
                var _a, _b, _c, _d;
                let { variableReference, name } = args;
                if (!variableReference) {
                    variableReference =
                        (_a = service.model.variables.selectedVariable) === null || _a === void 0 ? void 0 : _a.variablesReference;
                }
                if (!name) {
                    name = (_b = service.model.variables.selectedVariable) === null || _b === void 0 ? void 0 : _b.name;
                }
                const id = `jp-debugger-variable-${name}`;
                if (!name ||
                    !variableReference ||
                    tracker.find(widget => widget.id === id)) {
                    return;
                }
                const variables = await service.inspectVariable(variableReference);
                if (!variables || variables.length === 0) {
                    return;
                }
                const model = service.model.variables;
                const widget = new lib_index_js_.MainAreaWidget({
                    content: new debugger_lib_index_js_.Debugger.VariablesGrid({
                        model,
                        commands,
                        scopes: [{ name, variables }],
                        themeManager
                    })
                });
                widget.addClass('jp-DebuggerVariables');
                widget.id = id;
                widget.title.icon = debugger_lib_index_js_.Debugger.Icons.variableIcon;
                widget.title.label = `${(_d = (_c = service.session) === null || _c === void 0 ? void 0 : _c.connection) === null || _d === void 0 ? void 0 : _d.name} - ${name}`;
                void tracker.add(widget);
                const disposeWidget = () => {
                    widget.dispose();
                    model.changed.disconnect(disposeWidget);
                };
                model.changed.connect(disposeWidget);
                shell.add(widget, 'main', {
                    mode: tracker.currentWidget ? 'split-right' : 'split-bottom',
                    activate: false,
                    type: 'Debugger Variables'
                });
            }
        });
        commands.addCommand(CommandIDs.renderMimeVariable, {
            label: trans.__('Render Variable'),
            caption: trans.__('Render variable according to its mime type'),
            isEnabled: () => { var _a; return !!((_a = service.session) === null || _a === void 0 ? void 0 : _a.isStarted); },
            isVisible: () => service.model.hasRichVariableRendering &&
                (rendermime !== null || handler.activeWidget instanceof notebook_lib_index_js_.NotebookPanel),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        frameId: {
                            type: 'number',
                            description: trans.__('The frame ID')
                        },
                        name: {
                            type: 'string',
                            description: trans.__('The name of the variable to render')
                        }
                    }
                }
            },
            execute: args => {
                var _a, _b, _c, _d, _e, _f, _g, _h;
                let { name, frameId } = args;
                if (!name) {
                    name = (_a = service.model.variables.selectedVariable) === null || _a === void 0 ? void 0 : _a.name;
                }
                if (!frameId) {
                    frameId = (_b = service.model.callstack.frame) === null || _b === void 0 ? void 0 : _b.id;
                }
                const activeWidget = handler.activeWidget;
                let activeRendermime = activeWidget instanceof notebook_lib_index_js_.NotebookPanel
                    ? activeWidget.content.rendermime
                    : rendermime;
                if (!activeRendermime) {
                    return;
                }
                const id = `jp-debugger-variable-mime-${name}-${(_d = (_c = service.session) === null || _c === void 0 ? void 0 : _c.connection) === null || _d === void 0 ? void 0 : _d.path.replace('/', '-')}`;
                if (!name || // Name is mandatory
                    trackerMime.find(widget => widget.id === id) || // Widget already exists
                    (!frameId && service.hasStoppedThreads()) // frame id missing on breakpoint
                ) {
                    return;
                }
                const variablesModel = service.model.variables;
                const widget = new debugger_lib_index_js_.Debugger.VariableRenderer({
                    dataLoader: () => service.inspectRichVariable(name, frameId),
                    rendermime: activeRendermime,
                    translator
                });
                widget.addClass('jp-DebuggerRichVariable');
                widget.id = id;
                widget.title.icon = debugger_lib_index_js_.Debugger.Icons.variableIcon;
                widget.title.label = `${name} - ${(_f = (_e = service.session) === null || _e === void 0 ? void 0 : _e.connection) === null || _f === void 0 ? void 0 : _f.name}`;
                widget.title.caption = `${name} - ${(_h = (_g = service.session) === null || _g === void 0 ? void 0 : _g.connection) === null || _h === void 0 ? void 0 : _h.path}`;
                void trackerMime.add(widget);
                const disposeWidget = () => {
                    widget.dispose();
                    variablesModel.changed.disconnect(refreshWidget);
                    activeWidget === null || activeWidget === void 0 ? void 0 : activeWidget.disposed.disconnect(disposeWidget);
                };
                const refreshWidget = () => {
                    // Refresh the widget only if the active element is the same.
                    if (handler.activeWidget === activeWidget) {
                        void widget.refresh();
                    }
                };
                widget.disposed.connect(disposeWidget);
                variablesModel.changed.connect(refreshWidget);
                activeWidget === null || activeWidget === void 0 ? void 0 : activeWidget.disposed.connect(disposeWidget);
                shell.add(widget, 'main', {
                    mode: trackerMime.currentWidget ? 'split-right' : 'split-bottom',
                    activate: false,
                    type: 'Debugger Variables'
                });
            }
        });
        commands.addCommand(CommandIDs.copyToClipboard, {
            label: trans.__('Copy to Clipboard'),
            caption: trans.__('Copy text representation of the value to clipboard'),
            isEnabled: () => {
                var _a, _b;
                return (!!((_a = service.session) === null || _a === void 0 ? void 0 : _a.isStarted) &&
                    !!((_b = service.model.variables.selectedVariable) === null || _b === void 0 ? void 0 : _b.value));
            },
            isVisible: () => handler.activeWidget instanceof notebook_lib_index_js_.NotebookPanel,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: async () => {
                const value = service.model.variables.selectedVariable.value;
                if (value) {
                    lib_index_js_.Clipboard.copyToSystem(value);
                }
            }
        });
        commands.addCommand(CommandIDs.copyToGlobals, {
            label: trans.__('Copy Variable to Globals'),
            caption: trans.__('Copy variable to globals scope'),
            isEnabled: () => { var _a; return !!((_a = service.session) === null || _a === void 0 ? void 0 : _a.isStarted); },
            isVisible: () => handler.activeWidget instanceof notebook_lib_index_js_.NotebookPanel &&
                service.model.supportCopyToGlobals,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: async (args) => {
                const name = service.model.variables.selectedVariable.name;
                await service.copyToGlobals(name);
            }
        });
    }
};
/**
 * Debugger sidebar provider plugin.
 */
const sidebar = {
    id: '@jupyterlab/debugger-extension:sidebar',
    description: 'Provides the debugger sidebar.',
    provides: debugger_lib_index_js_.IDebuggerSidebar,
    requires: [debugger_lib_index_js_.IDebugger, codeeditor_lib_index_js_.IEditorServices, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.IThemeManager, settingregistry_lib_index_js_.ISettingRegistry],
    autoStart: true,
    activate: async (app, service, editorServices, translator, themeManager, settingRegistry) => {
        const { commands } = app;
        const CommandIDs = debugger_lib_index_js_.Debugger.CommandIDs;
        const callstackCommands = {
            registry: commands,
            continue: CommandIDs.debugContinue,
            terminate: CommandIDs.terminate,
            next: CommandIDs.next,
            stepIn: CommandIDs.stepIn,
            stepOut: CommandIDs.stepOut,
            evaluate: CommandIDs.evaluate
        };
        const breakpointsCommands = {
            registry: commands,
            pauseOnExceptions: CommandIDs.pauseOnExceptions
        };
        const sidebar = new debugger_lib_index_js_.Debugger.Sidebar({
            service,
            callstackCommands,
            breakpointsCommands,
            editorServices,
            themeManager,
            translator
        });
        if (settingRegistry) {
            const setting = await settingRegistry.load(main.id);
            const updateSettings = () => {
                var _a, _b, _c, _d;
                const filters = setting.get('variableFilters').composite;
                const kernel = (_d = (_c = (_b = (_a = service.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '';
                if (kernel && filters[kernel]) {
                    sidebar.variables.filter = new Set(filters[kernel]);
                }
                const kernelSourcesFilter = setting.get('defaultKernelSourcesFilter')
                    .composite;
                sidebar.kernelSources.filter = kernelSourcesFilter;
            };
            updateSettings();
            setting.changed.connect(updateSettings);
            service.sessionChanged.connect(updateSettings);
        }
        return sidebar;
    }
};
/**
 * The source viewer UI plugin.
 */
const sourceViewer = {
    id: '@jupyterlab/debugger-extension:source-viewer',
    description: 'Initialize the debugger sources viewer.',
    requires: [debugger_lib_index_js_.IDebugger, codeeditor_lib_index_js_.IEditorServices, debugger_lib_index_js_.IDebuggerSources, translation_lib_index_js_.ITranslator],
    provides: debugger_lib_index_js_.IDebuggerSourceViewer,
    autoStart: true,
    activate: async (app, service, editorServices, debuggerSources, translator) => {
        const readOnlyEditorFactory = new debugger_lib_index_js_.Debugger.ReadOnlyEditorFactory({
            editorServices
        });
        const { model } = service;
        const onCurrentFrameChanged = (_, frame) => {
            var _a, _b, _c, _d, _e, _f, _g, _h, _j;
            debuggerSources
                .find({
                focus: true,
                kernel: (_d = (_c = (_b = (_a = service.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '',
                path: (_g = (_f = (_e = service.session) === null || _e === void 0 ? void 0 : _e.connection) === null || _f === void 0 ? void 0 : _f.path) !== null && _g !== void 0 ? _g : '',
                source: (_j = (_h = frame === null || frame === void 0 ? void 0 : frame.source) === null || _h === void 0 ? void 0 : _h.path) !== null && _j !== void 0 ? _j : ''
            })
                .forEach(editor => {
                requestAnimationFrame(() => {
                    void editor.reveal().then(() => {
                        const edit = editor.get();
                        if (edit) {
                            debugger_lib_index_js_.Debugger.EditorHandler.showCurrentLine(edit, frame.line);
                        }
                    });
                });
            });
        };
        model.callstack.currentFrameChanged.connect(onCurrentFrameChanged);
        const openSource = (source, breakpoint) => {
            var _a, _b, _c, _d, _e, _f, _g;
            if (!source) {
                return;
            }
            const { content, mimeType, path } = source;
            const results = debuggerSources.find({
                focus: true,
                kernel: (_d = (_c = (_b = (_a = service.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '',
                path: (_g = (_f = (_e = service.session) === null || _e === void 0 ? void 0 : _e.connection) === null || _f === void 0 ? void 0 : _f.path) !== null && _g !== void 0 ? _g : '',
                source: path
            });
            if (results.length > 0) {
                if (breakpoint && typeof breakpoint.line !== 'undefined') {
                    results.forEach(editor => {
                        void editor.reveal().then(() => {
                            var _a;
                            (_a = editor.get()) === null || _a === void 0 ? void 0 : _a.revealPosition({
                                line: breakpoint.line - 1,
                                column: breakpoint.column || 0
                            });
                        });
                    });
                }
                return;
            }
            const editorWrapper = readOnlyEditorFactory.createNewEditor({
                content,
                mimeType,
                path
            });
            const editor = editorWrapper.editor;
            const editorHandler = new debugger_lib_index_js_.Debugger.EditorHandler({
                debuggerService: service,
                editorReady: () => Promise.resolve(editor),
                getEditor: () => editor,
                path,
                src: editor.model.sharedModel
            });
            editorWrapper.disposed.connect(() => editorHandler.dispose());
            debuggerSources.open({
                label: coreutils_lib_index_js_.PathExt.basename(path),
                caption: path,
                editorWrapper
            });
            const frame = service.model.callstack.frame;
            if (frame) {
                debugger_lib_index_js_.Debugger.EditorHandler.showCurrentLine(editor, frame.line);
            }
        };
        const trans = translator.load('jupyterlab');
        app.commands.addCommand(debugger_lib_index_js_.Debugger.CommandIDs.openSource, {
            label: trans.__('Open Source'),
            caption: trans.__('Open Source'),
            isEnabled: () => !!sourceViewer,
            execute: async (args) => {
                const path = args.path || '';
                if (!path) {
                    throw Error('Path to open is needed');
                }
                if (!service.isStarted) {
                    const choice = await (0,lib_index_js_.showDialog)({
                        title: trans.__('Start debugger?'),
                        body: trans.__('The debugger service is needed to open the source %1', path),
                        buttons: [
                            lib_index_js_.Dialog.cancelButton({ label: trans.__('Cancel') }),
                            lib_index_js_.Dialog.okButton({ label: trans.__('Start debugger') })
                        ]
                    });
                    if (choice.button.accept) {
                        await service.start();
                    }
                    else {
                        return;
                    }
                }
                const source = await service.getSource({
                    path
                });
                return openSource(source);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        path: {
                            type: 'string',
                            description: trans.__('Path to the source file to open')
                        }
                    }
                }
            }
        });
        return Object.freeze({
            open: openSource
        });
    }
};
/**
 * The main debugger UI plugin.
 */
const main = {
    id: '@jupyterlab/debugger-extension:main',
    description: 'Initialize the debugger user interface.',
    requires: [
        debugger_lib_index_js_.IDebugger,
        debugger_lib_index_js_.IDebuggerSidebar,
        codeeditor_lib_index_js_.IEditorServices,
        translation_lib_index_js_.ITranslator,
        console_lib_index_js_.ConsolePanel.IContentFactory,
        console_lib_index_js_.IConsoleTracker
    ],
    optional: [
        lib_index_js_.ICommandPalette,
        debugger_lib_index_js_.IDebuggerSourceViewer,
        index_js_.ILabShell,
        index_js_.ILayoutRestorer,
        settingregistry_lib_index_js_.ISettingRegistry
    ],
    autoStart: true,
    activate: async (app, service, sidebar, editorServices, translator, consolePanelContentFactory, consoleTracker, palette, sourceViewer, labShell, restorer, settingRegistry) => {
        var _a;
        const trans = translator.load('jupyterlab');
        const { commands, shell, serviceManager } = app;
        const { kernelspecs } = serviceManager;
        const CommandIDs = debugger_lib_index_js_.Debugger.CommandIDs;
        // First check if there is a PageConfig override for the extension visibility
        const alwaysShowDebuggerExtension = coreutils_lib_index_js_.PageConfig.getOption('alwaysShowDebuggerExtension').toLowerCase() ===
            'true';
        if (!alwaysShowDebuggerExtension) {
            // hide the debugger sidebar if no kernel with support for debugging is available
            await kernelspecs.ready;
            const specs = (_a = kernelspecs.specs) === null || _a === void 0 ? void 0 : _a.kernelspecs;
            if (!specs) {
                return;
            }
            const enabled = Object.keys(specs).some(name => { var _a, _b, _c; return !!((_c = (_b = (_a = specs[name]) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b['debugger']) !== null && _c !== void 0 ? _c : false); });
            if (!enabled) {
                return;
            }
        }
        commands.addCommand(CommandIDs.debugContinue, {
            label: () => {
                return service.hasStoppedThreads()
                    ? trans.__('Continue')
                    : trans.__('Pause');
            },
            caption: () => {
                return service.hasStoppedThreads()
                    ? trans.__('Continue')
                    : trans.__('Pause');
            },
            icon: () => {
                return service.hasStoppedThreads()
                    ? debugger_lib_index_js_.Debugger.Icons.continueIcon
                    : debugger_lib_index_js_.Debugger.Icons.pauseIcon;
            },
            isEnabled: () => { var _a, _b; return (_b = (_a = service.session) === null || _a === void 0 ? void 0 : _a.isStarted) !== null && _b !== void 0 ? _b : false; },
            execute: async () => {
                if (service.hasStoppedThreads()) {
                    await service.continue();
                }
                else {
                    await service.pause();
                }
                commands.notifyCommandChanged(CommandIDs.debugContinue);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.terminate, {
            label: trans.__('Terminate'),
            caption: trans.__('Terminate'),
            icon: debugger_lib_index_js_.Debugger.Icons.terminateIcon,
            isEnabled: () => service.hasStoppedThreads(),
            execute: async () => {
                await service.restart();
                updateState(app.commands, service);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.next, {
            label: trans.__('Next'),
            caption: trans.__('Next'),
            icon: debugger_lib_index_js_.Debugger.Icons.stepOverIcon,
            isEnabled: () => service.hasStoppedThreads(),
            execute: async () => {
                await service.next();
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.stepIn, {
            label: trans.__('Step In'),
            caption: trans.__('Step In'),
            icon: debugger_lib_index_js_.Debugger.Icons.stepIntoIcon,
            isEnabled: () => service.hasStoppedThreads(),
            execute: async () => {
                await service.stepIn();
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.stepOut, {
            label: trans.__('Step Out'),
            caption: trans.__('Step Out'),
            icon: debugger_lib_index_js_.Debugger.Icons.stepOutIcon,
            isEnabled: () => service.hasStoppedThreads(),
            execute: async () => {
                await service.stepOut();
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.pauseOnExceptions, {
            label: args => args.filter || 'Breakpoints on exception',
            caption: args => { var _a; return (_a = args.description) !== null && _a !== void 0 ? _a : ''; },
            isToggled: args => { var _a; return ((_a = service.session) === null || _a === void 0 ? void 0 : _a.isPausingOnException(args.filter)) || false; },
            isEnabled: () => service.pauseOnExceptionsIsValid(),
            execute: async (args) => {
                var _a, _b, _c;
                if (args === null || args === void 0 ? void 0 : args.filter) {
                    let filter = args.filter;
                    await service.pauseOnExceptionsFilter(filter);
                }
                else {
                    let items = [];
                    (_b = (_a = service.session) === null || _a === void 0 ? void 0 : _a.exceptionBreakpointFilters) === null || _b === void 0 ? void 0 : _b.forEach(availableFilter => {
                        items.push(availableFilter.filter);
                    });
                    const result = await lib_index_js_.InputDialog.getMultipleItems({
                        title: trans.__('Select a filter for breakpoints on exception'),
                        items: items,
                        defaults: ((_c = service.session) === null || _c === void 0 ? void 0 : _c.currentExceptionFilters) || []
                    });
                    let filters = result.button.accept ? result.value : null;
                    if (filters !== null) {
                        await service.pauseOnExceptions(filters);
                    }
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        filter: {
                            type: 'string',
                            description: trans.__('Exception filter to pause on')
                        },
                        description: {
                            type: 'string',
                            description: trans.__('Description of the exception filter')
                        }
                    }
                }
            }
        });
        let autoCollapseSidebar = false;
        if (settingRegistry) {
            const setting = await settingRegistry.load(main.id);
            const updateSettings = () => {
                autoCollapseSidebar = setting.get('autoCollapseDebuggerSidebar')
                    .composite;
            };
            updateSettings();
            setting.changed.connect(updateSettings);
        }
        service.eventMessage.connect((_, event) => {
            updateState(app.commands, service);
            if (labShell && event.event === 'initialized') {
                labShell.activateById(sidebar.id);
            }
            else if (labShell &&
                sidebar.isVisible &&
                event.event === 'terminated' &&
                autoCollapseSidebar) {
                labShell.collapseRight();
            }
        });
        service.sessionChanged.connect(_ => {
            updateState(app.commands, service);
        });
        if (restorer) {
            restorer.add(sidebar, 'debugger-sidebar');
        }
        sidebar.node.setAttribute('role', 'region');
        sidebar.node.setAttribute('aria-label', trans.__('Debugger section'));
        sidebar.title.caption = trans.__('Debugger');
        shell.add(sidebar, 'right', { type: 'Debugger' });
        commands.addCommand(CommandIDs.showPanel, {
            label: trans.__('Debugger Panel'),
            execute: () => {
                shell.activateById(sidebar.id);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        if (palette) {
            const category = trans.__('Debugger');
            [
                CommandIDs.debugContinue,
                CommandIDs.terminate,
                CommandIDs.next,
                CommandIDs.stepIn,
                CommandIDs.stepOut,
                CommandIDs.evaluate,
                CommandIDs.pauseOnExceptions
            ].forEach(command => {
                palette.addItem({ command, category });
            });
        }
        if (sourceViewer) {
            const { model } = service;
            const onKernelSourceOpened = (_, source, breakpoint) => {
                if (!source) {
                    return;
                }
                sourceViewer.open(source, breakpoint);
            };
            model.sources.currentSourceOpened.connect((_, source) => {
                sourceViewer.open(source);
            });
            model.kernelSources.kernelSourceOpened.connect(onKernelSourceOpened);
            model.breakpoints.clicked.connect(async (_, breakpoint) => {
                var _a;
                const path = (_a = breakpoint.source) === null || _a === void 0 ? void 0 : _a.path;
                const source = await service.getSource({
                    sourceReference: 0,
                    path
                });
                sourceViewer.open(source, breakpoint);
            });
        }
    }
};
/**
 * A plugin that provides debugger-based completions.
 */
const debuggerCompletions = {
    id: '@jupyterlab/debugger-extension:completions',
    description: 'Provides debugger-based completions.',
    autoStart: true,
    requires: [debugger_lib_index_js_.IDebugger, completer_lib_index_js_.ICompletionProviderManager],
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, debuggerService, completionManager, translator) => {
        // Create and register the debugger completion provider
        const provider = new DebuggerCompletionProvider({
            debuggerService: debuggerService,
            translator: translator || translation_lib_index_js_.nullTranslator
        });
        // Register the provider with the completion manager
        completionManager.registerProvider(provider);
    }
};
/**
 * A plugin that provides the debug console functionality.
 */
const debugConsole = {
    id: '@jupyterlab/debugger-extension:debug-console',
    description: 'Debugger console to enable evaluation in debugger context.',
    autoStart: true,
    requires: [
        debugger_lib_index_js_.IDebugger,
        console_lib_index_js_.ConsolePanel.IContentFactory,
        codeeditor_lib_index_js_.IEditorServices,
        completer_lib_index_js_.ICompletionProviderManager,
        lib_index_js_.ISanitizer,
        translation_lib_index_js_.ITranslator
    ],
    optional: [index_js_.ILabShell],
    activate: (app, service, consolePanelContentFactory, editorServices, manager, sanitizer, translator, labShell) => {
        const CommandIDs = debugger_lib_index_js_.Debugger.CommandIDs;
        const trans = translator.load('jupyterlab');
        // Create our own tracker for debug consoles
        const debugConsoleTracker = new lib_index_js_.WidgetTracker({
            namespace: 'debugger-debug-console'
        });
        // Global debug console widget variable for toggling
        let debugConsoleWidget = null;
        // Create the console
        const createDebugConsole = async () => {
            const rendermime = new rendermime_lib_index_js_.RenderMimeRegistry({ initialFactories: rendermime_lib_index_js_.standardRendererFactories });
            const debugExecutor = new DebugConsoleCellExecutor({
                debuggerService: service,
                trans
            });
            debugConsoleWidget = new console_lib_index_js_.ConsolePanel({
                manager: app.serviceManager,
                name: trans.__('Debug Console'),
                contentFactory: consolePanelContentFactory,
                rendermime,
                executor: debugExecutor,
                mimeTypeService: editorServices.mimeTypeService,
                kernelPreference: { shouldStart: false, canStart: false }
            });
            debugConsoleWidget.title.label = trans.__('Debug Console');
            debugConsoleWidget.title.icon = debugger_lib_index_js_.Debugger.Icons.evaluateIcon;
            // Add a specific class to distinguish debug console from regular consoles
            debugConsoleWidget.addClass('jp-DebugConsole');
            debugConsoleWidget.console.addClass('jp-DebugConsole-widget');
            // Close console when debugger is terminated
            service.eventMessage.connect((_, event) => {
                if (labShell && event.event === 'terminated') {
                    debugConsoleWidget === null || debugConsoleWidget === void 0 ? void 0 : debugConsoleWidget.dispose();
                }
            });
            const notifyCommands = () => {
                app.commands.notifyCommandChanged(CommandIDs.evaluate);
                app.commands.notifyCommandChanged(CommandIDs.executeConsole);
                app.commands.notifyCommandChanged(CommandIDs.invokeConsole);
                app.commands.notifyCommandChanged(CommandIDs.selectConsole);
            };
            debugConsoleWidget.disposed.connect(() => {
                debugConsoleWidget = null;
            });
            app.shell.add(debugConsoleWidget, 'main', {
                mode: 'split-bottom',
                activate: true,
                type: 'Debugger Console'
            });
            void debugConsoleTracker.add(debugConsoleWidget);
            app.shell.activateById(debugConsoleWidget.id);
            await updateCompleter(undefined, debugConsoleWidget);
            debugConsoleWidget === null || debugConsoleWidget === void 0 ? void 0 : debugConsoleWidget.update();
            notifyCommands();
        };
        // Set up completer
        const updateCompleter = async (_, consolePanel) => {
            var _a, _b;
            const completerContext = {
                editor: (_b = (_a = consolePanel.console.promptCell) === null || _a === void 0 ? void 0 : _a.editor) !== null && _b !== void 0 ? _b : null,
                session: consolePanel.console.sessionContext.session,
                widget: consolePanel
            };
            await manager.updateCompleter(completerContext);
            consolePanel.console.promptCellCreated.connect((codeConsole, cell) => {
                const newContext = {
                    editor: cell.editor,
                    session: codeConsole.sessionContext.session,
                    widget: consolePanel,
                    sanitizer: sanitizer
                };
                manager.updateCompleter(newContext).catch(console.error);
            });
            consolePanel.console.sessionContext.sessionChanged.connect(() => {
                var _a, _b;
                const newContext = {
                    editor: (_b = (_a = consolePanel.console.promptCell) === null || _a === void 0 ? void 0 : _a.editor) !== null && _b !== void 0 ? _b : null,
                    session: consolePanel.console.sessionContext.session,
                    widget: consolePanel,
                    sanitizer: sanitizer
                };
                manager.updateCompleter(newContext).catch(console.error);
            });
        };
        debugConsoleTracker.widgetAdded.connect(updateCompleter);
        manager.activeProvidersChanged.connect(() => {
            debugConsoleTracker.forEach(consoleWidget => {
                updateCompleter(undefined, consoleWidget).catch(e => console.error(e));
            });
        });
        // Add commands
        app.commands.addCommand(CommandIDs.invokeConsole, {
            label: trans.__('Display the tab completion widget.'),
            execute: () => {
                const id = debugConsoleTracker.currentWidget &&
                    debugConsoleTracker.currentWidget.id;
                if (id) {
                    return manager.invoke(id);
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        app.commands.addCommand(CommandIDs.selectConsole, {
            label: trans.__('Select the completion suggestion.'),
            execute: () => {
                const id = debugConsoleTracker.currentWidget &&
                    debugConsoleTracker.currentWidget.id;
                if (id) {
                    return manager.select(id);
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        // Add the debugger console execute command
        app.commands.addCommand(CommandIDs.executeConsole, {
            label: trans.__('Execute the current line in debug console.'),
            execute: async () => {
                const currentWidget = debugConsoleTracker.currentWidget;
                if (currentWidget && currentWidget.console) {
                    await currentWidget.console.execute(true);
                    // Ensure focus stays on the console prompt after execution
                    const promptCell = currentWidget.console.promptCell;
                    if (promptCell && promptCell.editor) {
                        promptCell.editor.focus();
                    }
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        app.commands.addCommand(CommandIDs.evaluate, {
            label: trans.__('Evaluate Code'),
            caption: trans.__('Evaluate Code'),
            icon: debugger_lib_index_js_.Debugger.Icons.evaluateIcon,
            isEnabled: () => { var _a; return !!((_a = service.session) === null || _a === void 0 ? void 0 : _a.isStarted); },
            execute: async () => {
                if (debugConsoleWidget) {
                    debugConsoleWidget.dispose();
                }
                else {
                    void createDebugConsole();
                }
            },
            isToggled: () => {
                return debugConsoleWidget !== null;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        // Add the keybindings
        app.commands.addKeyBinding({
            command: CommandIDs.selectConsole,
            keys: ['Enter'],
            selector: '.jp-ConsolePanel.jp-DebugConsole .jp-DebugConsole-widget .jp-mod-completer-active'
        });
        app.commands.addKeyBinding({
            command: CommandIDs.invokeConsole,
            keys: ['Tab'],
            selector: '.jp-ConsolePanel.jp-DebugConsole .jp-DebugConsole-widget .jp-CodeConsole-promptCell .jp-mod-completer-enabled:not(.jp-mod-at-line-beginning)'
        });
        app.commands.addKeyBinding({
            command: CommandIDs.executeConsole,
            keys: ['Shift Enter'],
            selector: '.jp-ConsolePanel.jp-DebugConsole .jp-DebugConsole-widget .jp-CodeConsole-promptCell'
        });
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    service,
    displayRegistry,
    consoles,
    files,
    notebooks,
    variables,
    sidebar,
    main,
    sources,
    sourceViewer,
    configuration,
    debuggerCompletions,
    debugConsole
];
/* harmony default export */ const lib = (plugins);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 75617:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/cells/style/index.js + 2 modules
var cells_style = __webpack_require__(33230);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/completer/style/index.js + 1 modules
var completer_style = __webpack_require__(76576);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/console/style/index.js + 1 modules
var console_style = __webpack_require__(42249);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/fileeditor/style/index.js + 1 modules
var fileeditor_style = __webpack_require__(44696);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/notebook/style/index.js + 1 modules
var notebook_style = __webpack_require__(47456);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var widgets_style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/debugger/style/base.css
var base = __webpack_require__(34114);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */















;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */













/***/ }),

/***/ 12069:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  q: () => (/* binding */ Debugger)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var index_js_ = __webpack_require__(12331);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/hash.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// Most of the implementation below is adapted from the following repository:
// https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
// Which has the following MIT License:
//
// Copyright (c) 2011 Gary Court
// 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.
// The implementation below uses case fallthrough as part of the algorithm.
/* eslint-disable no-fallthrough */
const m = 0x5bd1e995;
const encoder = new TextEncoder();
/**
 * Calculate the murmurhash2 for a given string and seed.
 *
 * @param str The string to calculate the Murmur2 hash for.
 * @param seed The seed.
 *
 * @returns The Murmurhash2 hash.
 */
function murmur2(str, seed) {
    const data = encoder.encode(str);
    let len = data.length;
    let h = seed ^ len;
    let i = 0;
    while (len >= 4) {
        let k = (data[i] & 0xff) |
            ((data[++i] & 0xff) << 8) |
            ((data[++i] & 0xff) << 16) |
            ((data[++i] & 0xff) << 24);
        k = (k & 0xffff) * m + ((((k >>> 16) * m) & 0xffff) << 16);
        k ^= k >>> 24;
        k = (k & 0xffff) * m + ((((k >>> 16) * m) & 0xffff) << 16);
        h = ((h & 0xffff) * m + ((((h >>> 16) * m) & 0xffff) << 16)) ^ k;
        len -= 4;
        ++i;
    }
    switch (len) {
        case 3:
            h ^= (data[i + 2] & 0xff) << 16;
        case 2:
            h ^= (data[i + 1] & 0xff) << 8;
        case 1:
            h ^= data[i] & 0xff;
            h = (h & 0xffff) * m + ((((h >>> 16) * m) & 0xffff) << 16);
    }
    h ^= h >>> 13;
    h = (h & 0xffff) * m + ((((h >>> 16) * m) & 0xffff) << 16);
    h ^= h >>> 15;
    return h >>> 0;
}
//# sourceMappingURL=hash.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/config.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A class that holds debugger configuration for all kernels.
 */
class DebuggerConfig {
    constructor() {
        this._fileParams = new Map();
        this._hashMethods = new Map();
    }
    /**
     * Returns an id based on the given code.
     *
     * @param code The source code.
     * @param kernel The kernel name from current session.
     */
    getCodeId(code, kernel) {
        const fileParams = this._fileParams.get(kernel);
        if (!fileParams) {
            throw new Error(`Kernel (${kernel}) has no tmp file params.`);
        }
        const hash = this._hashMethods.get(kernel);
        if (!hash) {
            throw new Error(`Kernel (${kernel}) has no hashing params.`);
        }
        const { prefix, suffix } = fileParams;
        return `${prefix}${hash(code)}${suffix}`;
    }
    /**
     * Sets the hash parameters for a kernel.
     *
     * @param params - Hashing parameters for a kernel.
     */
    setHashParams(params) {
        const { kernel, method, seed } = params;
        if (!kernel) {
            throw new TypeError(`Kernel name is not defined.`);
        }
        switch (method) {
            case 'Murmur2':
                this._hashMethods.set(kernel, code => murmur2(code, seed).toString());
                break;
            default:
                throw new Error(`Hash method (${method}) is not supported.`);
        }
    }
    /**
     * Sets the parameters used by the kernel to create temp files (e.g. cells).
     *
     * @param params - Temporary file prefix and suffix for a kernel.
     */
    setTmpFileParams(params) {
        const { kernel, prefix, suffix } = params;
        if (!kernel) {
            throw new TypeError(`Kernel name is not defined.`);
        }
        this._fileParams.set(kernel, { kernel, prefix, suffix });
    }
    /**
     * Gets the parameters used for the temp files (e.e. cells) for a kernel.
     *
     * @param kernel - The kernel name from current session.
     */
    getTmpFileParams(kernel) {
        return this._fileParams.get(kernel);
    }
}
//# sourceMappingURL=config.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/cells@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/cells/lib/index.js)
var cells_lib_index_js_ = __webpack_require__(9214);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/dialogs/evaluate.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * A namespace for DebuggerEvaluateDialog statics.
 */
var DebuggerEvaluateDialog;
(function (DebuggerEvaluateDialog) {
    /**
     * Create and show a dialog to prompt user for code.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted
     */
    function getCode(options) {
        const dialog = new EvaluateDialog({
            ...options,
            body: new EvaluateDialogBody(options),
            buttons: [
                lib_index_js_.Dialog.cancelButton({ label: options.cancelLabel }),
                lib_index_js_.Dialog.okButton({ label: options.okLabel })
            ]
        });
        return dialog.launch();
    }
    DebuggerEvaluateDialog.getCode = getCode;
})(DebuggerEvaluateDialog || (DebuggerEvaluateDialog = {}));
/**
 * A dialog to prompt users for code to evaluate.
 */
class EvaluateDialog extends lib_index_js_.Dialog {
    /**
     * Handle the DOM events for the Evaluate dialog.
     *
     * @param event The DOM event sent to the dialog widget
     */
    handleEvent(event) {
        if (event.type === 'keydown') {
            const keyboardEvent = event;
            const { code, shiftKey } = keyboardEvent;
            if (shiftKey && code === 'Enter') {
                return this.resolve();
            }
            if (code === 'Enter') {
                return;
            }
        }
        super.handleEvent(event);
    }
}
/**
 * Widget body with a code cell prompt in a dialog
 */
class EvaluateDialogBody extends index_es6_js_.Widget {
    /**
     * CodePromptDialog constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        super();
        const { contentFactory, rendermime, mimeType } = options;
        const model = new cells_lib_index_js_.CodeCellModel();
        model.mimeType = mimeType !== null && mimeType !== void 0 ? mimeType : '';
        this._prompt = new cells_lib_index_js_.CodeCell({
            contentFactory,
            rendermime,
            model,
            placeholder: false
        }).initializeState();
        // explicitly remove the prompt in front of the input area
        this._prompt.inputArea.promptNode.remove();
        this.node.appendChild(this._prompt.node);
    }
    /**
     * Get the text specified by the user
     */
    getValue() {
        return this._prompt.model.sharedModel.getSource();
    }
    /**
     *  A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        this._prompt.activate();
    }
}
//# sourceMappingURL=evaluate.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/factory.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A widget factory for read only editors.
 */
class factory_ReadOnlyEditorFactory {
    /**
     * Construct a new editor widget factory.
     *
     * @param options The instantiation options for a ReadOnlyEditorFactory.
     */
    constructor(options) {
        this._services = options.editorServices;
    }
    /**
     * Create a new CodeEditorWrapper given a Source.
     *
     * @param source The source to create a new editor for.
     */
    createNewEditor(source) {
        const { content, mimeType, path } = source;
        const factory = this._services.factoryService.newInlineEditor;
        const mimeTypeService = this._services.mimeTypeService;
        const model = new codeeditor_lib_index_js_.CodeEditor.Model({
            mimeType: mimeType || mimeTypeService.getMimeTypeByFilePath(path)
        });
        model.sharedModel.source = content;
        const editor = new codeeditor_lib_index_js_.CodeEditorWrapper({
            editorOptions: {
                config: {
                    readOnly: true,
                    lineNumbers: true
                }
            },
            model,
            factory
        });
        editor.node.setAttribute('data-jp-debugger', 'true');
        editor.disposed.connect(() => {
            model.dispose();
        });
        return editor;
    }
}
//# sourceMappingURL=factory.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var observables_lib_index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @codemirror/state@~6.5.4 (singleton) (fallback: ../node_modules/@codemirror/state/dist/index.js)
var dist_index_js_ = __webpack_require__(88145);
// EXTERNAL MODULE: consume shared module (default) @codemirror/view@~6.39.15 (singleton) (fallback: ../node_modules/@codemirror/view/dist/index.js)
var view_dist_index_js_ = __webpack_require__(1164);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/handlers/editor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * The class name added to the current line.
 */
const LINE_HIGHLIGHT_CLASS = 'jp-DebuggerEditor-highlight';
/**
 * The timeout for listening to editor content changes.
 */
const EDITOR_CHANGED_TIMEOUT = 1000;
/**
 * A handler for a CodeEditor.IEditor.
 */
class editor_EditorHandler {
    /**
     * Instantiate a new EditorHandler.
     *
     * @param options The instantiation options for a EditorHandler.
     */
    constructor(options) {
        var _a, _b, _c, _d;
        this._src = options.src;
        this._id = (_c = (_b = (_a = options.debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : '';
        this._path = (_d = options.path) !== null && _d !== void 0 ? _d : '';
        this._debuggerService = options.debuggerService;
        this._editor = options.getEditor;
        this._editorMonitor = new coreutils_lib_index_js_.ActivityMonitor({
            signal: this._src.changed,
            timeout: EDITOR_CHANGED_TIMEOUT
        });
        this._editorMonitor.activityStopped.connect(() => {
            this._sendEditorBreakpoints();
        }, this);
        this._selectedBreakpoint =
            this._debuggerService.model.breakpoints.selectedBreakpoint;
        this._debuggerService.model.breakpoints.changed.connect(async () => {
            const editor = this.editor;
            if (!editor || editor.isDisposed) {
                return;
            }
            this._addBreakpointsToEditor();
        }, this);
        this._debuggerService.model.breakpoints.restored.connect(async () => {
            const editor = this.editor;
            if (!editor || editor.isDisposed) {
                return;
            }
            this._addBreakpointsToEditor();
        }, this);
        this._debuggerService.model.breakpoints.selectedChanged.connect((_, breakpoint) => {
            this._selectedBreakpoint = breakpoint;
            this._addBreakpointsToEditor();
        }, this);
        this._debuggerService.model.callstack.currentFrameChanged.connect((_, frame) => {
            var _a, _b;
            const editor = this.editor;
            if (editor) {
                editor_EditorHandler.clearHighlight(editor);
                const framePath = (_b = (_a = frame === null || frame === void 0 ? void 0 : frame.source) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : '';
                const editorPath = this._path ||
                    this._debuggerService.getCodeId(this._src.getSource());
                // If the current frame belongs to this editor, highlight its line.
                if (framePath && editorPath && framePath === editorPath) {
                    if (typeof (frame === null || frame === void 0 ? void 0 : frame.line) === 'number') {
                        editor_EditorHandler.showCurrentLine(editor, frame.line);
                    }
                }
            }
        }, this);
        this._breakpointEffect = dist_index_js_.StateEffect.define({
            map: (value, mapping) => value.map(v => ({
                pos: mapping.mapPos(v.pos),
                selected: v.selected
            }))
        });
        this._breakpointState = dist_index_js_.StateField.define({
            create: () => {
                return dist_index_js_.RangeSet.empty;
            },
            update: (breakpoints, transaction) => {
                let hasEffect = false;
                let decorations = [];
                for (let ef of transaction.effects) {
                    if (ef.is(this._breakpointEffect)) {
                        hasEffect = true;
                        decorations = ef.value.map(({ pos, selected }) => {
                            const marker = selected
                                ? Private.selectedBreakpointMarker
                                : Private.breakpointMarker;
                            return marker.range(pos);
                        });
                    }
                }
                if (hasEffect) {
                    return dist_index_js_.RangeSet.of(decorations, true);
                }
                return breakpoints.map(transaction.changes);
            }
        });
        this._gutter = new dist_index_js_.Compartment();
        this._highlightDeco = view_dist_index_js_.Decoration.line({ class: LINE_HIGHLIGHT_CLASS });
        this._highlightState = dist_index_js_.StateField.define({
            create: () => {
                return view_dist_index_js_.Decoration.none;
            },
            update: (highlights, transaction) => {
                highlights = highlights.map(transaction.changes);
                for (let ef of transaction.effects) {
                    if (ef.is(editor_EditorHandler._highlightEffect)) {
                        let e = ef;
                        if (e.value.pos.length) {
                            highlights = highlights.update({
                                add: e.value.pos.map(v => this._highlightDeco.range(v))
                            });
                        }
                        else {
                            highlights = view_dist_index_js_.Decoration.none;
                        }
                    }
                }
                return highlights;
            },
            provide: f => view_dist_index_js_.EditorView.decorations.from(f)
        });
        void options.editorReady().then(() => {
            this._setupEditor();
        });
    }
    /**
     * The editor
     */
    get editor() {
        return this._editor();
    }
    /**
     * Dispose the handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._editorMonitor.dispose();
        this._clearEditor();
        this.isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Refresh the breakpoints display
     */
    refreshBreakpoints() {
        this._addBreakpointsToEditor();
    }
    /**
     * Setup the editor.
     */
    _setupEditor() {
        const editor = this.editor;
        if (!editor || editor.isDisposed) {
            return;
        }
        editor.setOption('lineNumbers', true);
        const breakpointGutter = [
            this._breakpointState,
            this._highlightState,
            dist_index_js_.Prec.highest((0,view_dist_index_js_.gutter)({
                class: 'cm-breakpoint-gutter',
                renderEmptyElements: true,
                markers: v => v.state.field(this._breakpointState),
                initialSpacer: () => Private.breakpointMarker,
                domEventHandlers: {
                    mousedown: (view, line) => {
                        this._onGutterClick(view, line.from);
                        return true;
                    }
                }
            }))
        ];
        editor.injectExtension(this._gutter.of(breakpointGutter));
        this._addBreakpointsToEditor();
    }
    /**
     * Clear the editor by removing visual elements and handlers.
     */
    _clearEditor() {
        const editor = this.editor;
        if (!editor || editor.isDisposed) {
            return;
        }
        editor_EditorHandler.clearHighlight(editor);
        this._clearGutter(editor);
        editor.setOption('lineNumbers', false);
        editor.editor.dispatch({
            effects: this._gutter.reconfigure([])
        });
    }
    /**
     * Send the breakpoints from the editor UI via the debug service.
     */
    _sendEditorBreakpoints() {
        var _a;
        if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.isDisposed) {
            return;
        }
        const breakpoints = this._getBreakpointsFromEditor().map(lineNumber => {
            var _a, _b;
            return Private.createBreakpoint(((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.name) || '', lineNumber);
        });
        void this._debuggerService.updateBreakpoints(this._src.getSource(), breakpoints, this._path);
    }
    /**
     * Handle a click on the gutter.
     *
     * @param editor The editor from where the click originated.
     * @param position The position corresponding to the click event.
     */
    _getEffectiveClickedLine(editor, position) {
        let clickedLine = editor.state.doc.lineAt(position);
        let clickedLineNumber = clickedLine.number;
        let targetLine = undefined;
        let isLineEmpty = false; /* is true is the clicked line of code is empty */
        if (clickedLine.text.trim() === '') {
            isLineEmpty = true;
            while (clickedLineNumber > 1) {
                clickedLineNumber--;
                const prevLine = editor.state.doc.line(clickedLineNumber);
                if (prevLine.text.trim() !== '') {
                    targetLine = prevLine;
                    break;
                }
            }
        }
        else {
            if (isLineEmpty === false) {
                targetLine = clickedLine;
            }
        }
        return [targetLine, isLineEmpty];
    }
    /**
     * Handle a click on the gutter.
     *
     * @param editor The editor from where the click originated.
     * @param position The position corresponding to the click event.
     */
    _onGutterClick(editor, position) {
        var _a, _b, _c;
        if (this._id !== ((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.id)) {
            return;
        }
        const [clickedLine, isLineEmpty] = this._getEffectiveClickedLine(editor, position);
        let breakpoints = this._getBreakpoints();
        let stateBreakpoints = editor.state.field(this._breakpointState);
        let hasBreakpoint = false;
        if (clickedLine) {
            stateBreakpoints.between(clickedLine === null || clickedLine === void 0 ? void 0 : clickedLine.from, clickedLine === null || clickedLine === void 0 ? void 0 : clickedLine.from, () => {
                hasBreakpoint = true;
            });
            if (!hasBreakpoint) {
                /* if there is no breakpoint at effective clickedLine : add one */
                this._debuggerService.model.breakpoints.selectedBreakpoint = null;
                const newBreakpoint = Private.createBreakpoint((_c = this._path) !== null && _c !== void 0 ? _c : this._debuggerService.session.connection.name, clickedLine.number);
                breakpoints.push(newBreakpoint);
            }
            else {
                /* if there is already a breakpoint */
                if (!isLineEmpty) {
                    /* remove the in place breakpoint if the clicked line of code is not empty*/
                    breakpoints = breakpoints.filter(ele => ele.line !== clickedLine.number);
                    if (this._selectedBreakpoint) {
                        /* if the breakpoint is a selected one: remove it*/
                        breakpoints = breakpoints.filter(ele => { var _a; return ele.line !== ((_a = this._selectedBreakpoint) === null || _a === void 0 ? void 0 : _a.line); });
                    }
                }
                else {
                    /* if the clicked line of code is empty, find the breakpoint at the effective clicked line
                    and make it the selected breakpoint*/
                    const breakPointAtClickedLine = breakpoints.find(b => b.line === clickedLine.number);
                    if (breakPointAtClickedLine) {
                        this._debuggerService.model.breakpoints.selectedBreakpoint =
                            breakPointAtClickedLine;
                    }
                }
            }
        }
        breakpoints.sort((a, b) => a.line - b.line);
        void this._debuggerService.updateBreakpoints(this._src.getSource(), breakpoints, this._path);
    }
    /**
     * Add the breakpoints to the editor.
     */
    _addBreakpointsToEditor() {
        var _a, _b, _c, _d, _e;
        if (!this.editor ||
            this._id !== ((_b = (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.id)) {
            return;
        }
        const editor = this.editor;
        const breakpoints = this._getBreakpoints();
        this._clearGutter(editor);
        const selectedLine = (_c = this._selectedBreakpoint) === null || _c === void 0 ? void 0 : _c.line;
        const selectedPath = (_e = (_d = this._selectedBreakpoint) === null || _d === void 0 ? void 0 : _d.source) === null || _e === void 0 ? void 0 : _e.path;
        const breakpointData = breakpoints.map(b => {
            var _a;
            const pos = editor.state.doc.line(b.line).from;
            const selected = b.line === selectedLine && ((_a = b.source) === null || _a === void 0 ? void 0 : _a.path) === selectedPath;
            return { pos, selected };
        });
        editor.editor.dispatch({
            effects: this._breakpointEffect.of(breakpointData)
        });
    }
    /**
     * Retrieve the breakpoints from the editor.
     */
    _getBreakpointsFromEditor() {
        if (!this.editor) {
            return [];
        }
        const editor = this.editor;
        const breakpoints = editor.editor.state.field(this._breakpointState);
        let lines = [];
        breakpoints.between(0, editor.doc.length, (from) => {
            lines.push(editor.doc.lineAt(from).number);
        });
        return lines;
    }
    _clearGutter(editor) {
        if (!editor) {
            return;
        }
        const view = editor.editor;
        view.dispatch({
            effects: this._breakpointEffect.of([])
        });
    }
    /**
     * Get the breakpoints for the editor using its content (code),
     * or its path (if it exists).
     */
    _getBreakpoints() {
        const code = this._src.getSource();
        return this._debuggerService.model.breakpoints.getBreakpoints(this._path || this._debuggerService.getCodeId(code));
    }
}
/**
 * A namespace for EditorHandler `statics`.
 */
(function (EditorHandler) {
    EditorHandler._highlightEffect = dist_index_js_.StateEffect.define({
        map: (value, mapping) => ({ pos: value.pos.map(v => mapping.mapPos(v)) })
    });
    /**
     * Highlight the current line of the frame in the given editor.
     *
     * @param editor The editor to highlight.
     * @param line The line number.
     * @param scrollLogicalPosition the position of the the widget after scroll, or false
     * if no scroll is expected.
     */
    function showCurrentLine(editor, line, scrollLogicalPosition = 'nearest') {
        clearHighlight(editor);
        const cmEditor = editor;
        const linePos = cmEditor.doc.line(line).from;
        const effects = [
            EditorHandler._highlightEffect.of({ pos: [linePos] })
        ];
        if (scrollLogicalPosition) {
            // getOffsetAt increases the line number before scrolling to it, because
            // Jupyter uses 0-indexes line number while CM6 uses 1-indexes line number.
            // In this case, the line number is 1-indexes as it comes from the debugProtocol
            // stackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame,
            // therefore we need to decrease it first.
            const offset = cmEditor.getOffsetAt({ line: line - 1, column: 0 });
            effects.push(view_dist_index_js_.EditorView.scrollIntoView(offset, { y: scrollLogicalPosition }));
        }
        cmEditor.editor.dispatch({
            effects: effects
        });
    }
    EditorHandler.showCurrentLine = showCurrentLine;
    /**
     * Remove all line highlighting indicators for the given editor.
     *
     * @param editor The editor to cleanup.
     */
    function clearHighlight(editor) {
        if (!editor || editor.isDisposed) {
            return;
        }
        const cmEditor = editor;
        cmEditor.editor.dispatch({
            effects: EditorHandler._highlightEffect.of({ pos: [] })
        });
    }
    EditorHandler.clearHighlight = clearHighlight;
})(editor_EditorHandler || (editor_EditorHandler = {}));
/**
 * A namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * Create a marker DOM element for a breakpoint.
     */
    Private.breakpointMarker = new (class extends view_dist_index_js_.GutterMarker {
        toDOM(view) {
            const marker = document.createElement('span');
            marker.className = 'cm-breakpoint-gutter';
            marker.ariaLabel = view.state.phrase('Breakpoint');
            const iconNode = index_js_.breakpointIcon.element({
                tag: 'span',
                className: 'cm-breakpoint-icon'
            });
            marker.appendChild(iconNode);
            return marker;
        }
    })();
    Private.selectedBreakpointMarker = new (class extends view_dist_index_js_.GutterMarker {
        toDOM(view) {
            const marker = document.createElement('span');
            marker.className = 'cm-breakpoint-gutter';
            marker.ariaLabel = view.state.phrase('Selected breakpoint');
            const iconNode = index_js_.selectedBreakpointIcon.element({
                tag: 'span',
                className: 'cm-selected-breakpoint-icon'
            });
            marker.appendChild(iconNode);
            return marker;
        }
    })();
    /**
     * Create a new breakpoint.
     *
     * @param session The name of the session.
     * @param line The line number of the breakpoint.
     */
    function createBreakpoint(session, line) {
        return {
            line,
            verified: true,
            source: {
                name: session
            }
        };
    }
    Private.createBreakpoint = createBreakpoint;
})(Private || (Private = {}));
//# sourceMappingURL=editor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/handlers/pausedoverlay.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A reusable helper to show a "Paused in Debugger" overlay and block interactions.
 */
class DebuggerPausedOverlay {
    constructor(options) {
        this._isDisposed = false;
        this._debuggerService = options.debuggerService;
        this._container = options.container;
        this._trans = (options.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        // Create overlay
        const overlay = document.createElement('div');
        overlay.className = 'jp-DebuggerPausedOverlay';
        const text = document.createElement('span');
        text.textContent = this._trans.__('Paused in Debugger');
        overlay.appendChild(text);
        const continueBtn = document.createElement('button');
        continueBtn.className = 'jp-DebuggerPausedButton';
        continueBtn.title = this._trans.__('Continue');
        index_js_.runIcon.element({ container: continueBtn, elementPosition: 'center' });
        continueBtn.onclick = () => {
            void this._debuggerService.continue();
        };
        const nextBtn = document.createElement('button');
        nextBtn.className = 'jp-DebuggerPausedButton';
        nextBtn.title = this._trans.__('Next');
        index_js_.stepOverIcon.element({ container: nextBtn, elementPosition: 'center' });
        nextBtn.onclick = () => {
            void this._debuggerService.next();
        };
        overlay.appendChild(continueBtn);
        overlay.appendChild(nextBtn);
        overlay.style.pointerEvents = 'auto';
        this._overlay = overlay;
    }
    /**
     * Show the overlay, if enabled by user settings.
     */
    show() {
        if (this._isDisposed) {
            return;
        }
        const showOverlay = document.body.dataset.showPausedOverlay !== 'false';
        if (!showOverlay || !this._overlay || this._overlay.isConnected) {
            return;
        }
        this._container.appendChild(this._overlay);
    }
    /**
     * Hide and unmount the overlay.
     */
    hide() {
        if (this._isDisposed || !this._overlay || !this._overlay.isConnected) {
            return;
        }
        this._container.style.pointerEvents = '';
        this._overlay.remove();
    }
    /**
     * Dispose of the overlay completely.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.hide();
        this._overlay = null;
    }
    /**
     * Whether the overlay has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
}
//# sourceMappingURL=pausedoverlay.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/handlers/console.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * A handler for consoles.
 */
class ConsoleHandler {
    /**
     * Instantiate a new ConsoleHandler.
     *
     * @param options The instantiation options for a ConsoleHandler.
     */
    constructor(options) {
        var _a;
        this._debuggerService = options.debuggerService;
        this._consolePanel = options.widget;
        this._cellMap = new observables_lib_index_js_.ObservableMap();
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._pausedOverlay = new DebuggerPausedOverlay({
            debuggerService: this._debuggerService,
            container: this._consolePanel.node,
            translator: this.translator
        });
        const codeConsole = this._consolePanel.console;
        if (codeConsole.promptCell) {
            this._addEditorHandler(codeConsole.promptCell);
        }
        codeConsole.promptCellCreated.connect((_, cell) => {
            this._addEditorHandler(cell);
        });
        const addHandlers = () => {
            for (const cell of codeConsole.cells) {
                this._addEditorHandler(cell);
            }
        };
        addHandlers();
        this._consolePanel.console.cells.changed.connect(addHandlers);
        // Connect debugger events
        (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.eventMessage.connect((_, event) => {
            var _a, _b, _c;
            const session = this._debuggerService.session;
            const contextSession = this._consolePanel.sessionContext.session;
            if (!session || !contextSession) {
                return;
            }
            if (((_b = (_a = session.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.id) !== ((_c = contextSession.kernel) === null || _c === void 0 ? void 0 : _c.id)) {
                return;
            }
            if (event.event === 'stopped') {
                void this._pausedOverlay.show();
            }
            else if (event.event === 'continued' || event.event === 'terminated') {
                void this._pausedOverlay.hide();
            }
        });
        // If already paused when initialized
        if (this._debuggerService.hasStoppedThreads()) {
            void this._pausedOverlay.show();
        }
    }
    /**
     * Dispose the handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.isDisposed = true;
        this._pausedOverlay.dispose();
        this._cellMap.values().forEach(handler => handler.dispose());
        this._cellMap.dispose();
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Add a new editor handler for the given cell.
     *
     * @param cell The cell to add the handler to.
     */
    _addEditorHandler(cell) {
        const modelId = cell.model.id;
        if (cell.model.type !== 'code' || this._cellMap.has(modelId)) {
            return;
        }
        const codeCell = cell;
        const editorHandler = new editor_EditorHandler({
            debuggerService: this._debuggerService,
            editorReady: async () => {
                await codeCell.ready;
                return codeCell.editor;
            },
            getEditor: () => codeCell.editor,
            src: cell.model.sharedModel
        });
        codeCell.disposed.connect(() => {
            this._cellMap.delete(modelId);
            editorHandler.dispose();
        });
        this._cellMap.set(modelId, editorHandler);
    }
}
//# sourceMappingURL=console.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/handlers/file.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A handler for files.
 */
class FileHandler {
    /**
     * Instantiate a new FileHandler.
     *
     * @param options The instantiation options for a FileHandler.
     */
    constructor(options) {
        var _a, _b;
        this._debuggerService = options.debuggerService;
        this._fileEditor = options.widget.content;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._hasLineNumber =
            (_a = this._fileEditor.editor.getOption('lineNumbers')) !== null && _a !== void 0 ? _a : false;
        this._editorHandler = new editor_EditorHandler({
            debuggerService: this._debuggerService,
            editorReady: () => Promise.resolve(this._fileEditor.editor),
            getEditor: () => this._fileEditor.editor,
            src: this._fileEditor.model.sharedModel
        });
        this._pausedOverlay = new DebuggerPausedOverlay({
            debuggerService: this._debuggerService,
            container: options.widget.node,
            translator: this.translator
        });
        (_b = this._debuggerService.session) === null || _b === void 0 ? void 0 : _b.eventMessage.connect((_, event) => {
            var _a, _b, _c;
            const session = this._debuggerService.session;
            const contextSession = options.widget.context.sessionContext.session;
            if (!session || !contextSession) {
                return;
            }
            if (((_b = (_a = session.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.id) !== ((_c = contextSession.kernel) === null || _c === void 0 ? void 0 : _c.id)) {
                return;
            }
            if (event.event === 'stopped') {
                void this._pausedOverlay.show();
            }
            else if (event.event === 'continued' || event.event === 'terminated') {
                void this._pausedOverlay.hide();
            }
        });
        if (this._debuggerService.hasStoppedThreads()) {
            void this._pausedOverlay.show();
        }
    }
    /**
     * Dispose the handler.
     */
    dispose() {
        var _a, _b;
        if (this.isDisposed) {
            return;
        }
        this.isDisposed = true;
        this._pausedOverlay.dispose();
        (_a = this._editorHandler) === null || _a === void 0 ? void 0 : _a.dispose();
        // Restore editor options
        (_b = this._editorHandler) === null || _b === void 0 ? void 0 : _b.editor.setOptions({
            lineNumbers: this._hasLineNumber
        });
        dist_index_es6_js_.Signal.clearData(this);
    }
}
//# sourceMappingURL=file.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/handlers/notebook.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * A handler for notebooks.
 */
class NotebookHandler {
    /**
     * Instantiate a new NotebookHandler.
     *
     * @param options The instantiation options for a NotebookHandler.
     */
    constructor(options) {
        var _a;
        this._debuggerService = options.debuggerService;
        this._notebookPanel = options.widget;
        this._cellMap = new observables_lib_index_js_.ObservableMap();
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._pausedOverlay = new DebuggerPausedOverlay({
            debuggerService: this._debuggerService,
            container: this._notebookPanel.node,
            translator: this.translator
        });
        const notebook = this._notebookPanel.content;
        notebook.model.cells.changed.connect(this._onCellsChanged, this);
        (_a = this._debuggerService.session) === null || _a === void 0 ? void 0 : _a.eventMessage.connect((_, event) => {
            var _a, _b, _c;
            const session = this._debuggerService.session;
            const contextSession = this._notebookPanel.sessionContext.session;
            if (!session || !contextSession) {
                return;
            }
            if (((_b = (_a = session.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.id) !== ((_c = contextSession.kernel) === null || _c === void 0 ? void 0 : _c.id)) {
                return;
            }
            if (event.event === 'stopped') {
                void this._pausedOverlay.show();
            }
            else if (event.event === 'continued' || event.event === 'terminated') {
                void this._pausedOverlay.hide();
            }
        });
        if (this._debuggerService.hasStoppedThreads() === true) {
            void this._pausedOverlay.show();
        }
        this._onCellsChanged();
    }
    /**
     * Dispose the handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.isDisposed = true;
        this._pausedOverlay.dispose();
        this._cellMap.values().forEach(handler => {
            var _a;
            handler.dispose();
            // Ensure to restore notebook editor settings
            (_a = handler.editor) === null || _a === void 0 ? void 0 : _a.setOptions({
                ...this._notebookPanel.content.editorConfig.code
            });
        });
        this._cellMap.dispose();
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Handle a notebook cells changed event.
     */
    _onCellsChanged(cells, changes) {
        var _a;
        this._notebookPanel.content.widgets.forEach(cell => this._addEditorHandler(cell));
        if ((changes === null || changes === void 0 ? void 0 : changes.type) === 'move') {
            for (const cell of changes.newValues) {
                (_a = this._cellMap.get(cell.id)) === null || _a === void 0 ? void 0 : _a.refreshBreakpoints();
            }
        }
    }
    /**
     * Add a new editor handler for the given cell.
     *
     * @param cell The cell to add the handler to.
     */
    _addEditorHandler(cell) {
        const modelId = cell.model.id;
        if (cell.model.type !== 'code' || this._cellMap.has(modelId)) {
            return;
        }
        const codeCell = cell;
        const editorHandler = new editor_EditorHandler({
            debuggerService: this._debuggerService,
            editorReady: async () => {
                await codeCell.ready;
                return codeCell.editor;
            },
            getEditor: () => codeCell.editor,
            src: cell.model.sharedModel
        });
        codeCell.disposed.connect(() => {
            this._cellMap.delete(modelId);
            editorHandler.dispose();
        });
        this._cellMap.set(cell.model.id, editorHandler);
    }
}
//# sourceMappingURL=notebook.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/handler.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






const TOOLBAR_DEBUGGER_ITEM = 'debugger-icon';
/**
 * Add a bug icon to the widget toolbar to enable and disable debugging.
 *
 * @param widget The widget to add the debug toolbar button to.
 * @param onClick The callback when the toolbar button is clicked.
 */
function updateIconButton(widget, onClick, enabled, pressed, translator = translation_lib_index_js_.nullTranslator) {
    const trans = translator.load('jupyterlab');
    const icon = new index_js_.ToolbarButton({
        className: 'jp-DebuggerBugButton',
        icon: index_js_.bugIcon,
        tooltip: trans.__('Enable Debugger'),
        pressedIcon: index_js_.bugDotIcon,
        pressedTooltip: trans.__('Disable Debugger'),
        disabledTooltip: trans.__('Select a kernel that supports debugging to enable debugger'),
        enabled,
        pressed,
        onClick
    });
    if (!widget.toolbar.insertBefore('kernelName', TOOLBAR_DEBUGGER_ITEM, icon)) {
        widget.toolbar.addItem(TOOLBAR_DEBUGGER_ITEM, icon);
    }
    return icon;
}
/**
 * Updates button state to on/off,
 * adds/removes css class to update styling
 *
 * @param widget the debug button widget
 * @param pressed true if pressed, false otherwise
 * @param enabled true if widget enabled, false otherwise
 * @param onClick click handler
 */
function updateIconButtonState(widget, pressed, enabled = true, onClick) {
    if (widget) {
        widget.enabled = enabled;
        widget.pressed = pressed;
        if (onClick) {
            widget.onClick = onClick;
        }
    }
}
/**
 * A handler for debugging a widget.
 */
class DebuggerHandler {
    /**
     * Instantiate a new DebuggerHandler.
     *
     * @param options The instantiation options for a DebuggerHandler.
     */
    constructor(options) {
        this._handlers = {};
        this._contextKernelChangedHandlers = {};
        this._kernelChangedHandlers = {};
        this._statusChangedHandlers = {};
        this._iopubMessageHandlers = {};
        this._iconButtons = {};
        this._type = options.type;
        this._shell = options.shell;
        this._service = options.service;
        this._translator = options.translator || translation_lib_index_js_.nullTranslator;
    }
    /**
     * Get the active widget.
     */
    get activeWidget() {
        return this._activeWidget;
    }
    /**
     * Update a debug handler for the given widget, and
     * handle kernel changed events.
     *
     * @param widget The widget to update.
     * @param connection The session connection.
     */
    async update(widget, connection) {
        if (!connection) {
            delete this._kernelChangedHandlers[widget.id];
            delete this._statusChangedHandlers[widget.id];
            delete this._iopubMessageHandlers[widget.id];
            return this.updateWidget(widget, connection);
        }
        const kernelChanged = () => {
            void this.updateWidget(widget, connection);
        };
        const kernelChangedHandler = this._kernelChangedHandlers[widget.id];
        if (kernelChangedHandler) {
            connection.kernelChanged.disconnect(kernelChangedHandler);
        }
        this._kernelChangedHandlers[widget.id] = kernelChanged;
        connection.kernelChanged.connect(kernelChanged);
        const statusChanged = (_, status) => {
            if (status.endsWith('restarting')) {
                void this.updateWidget(widget, connection);
            }
        };
        const statusChangedHandler = this._statusChangedHandlers[widget.id];
        if (statusChangedHandler) {
            connection.statusChanged.disconnect(statusChangedHandler);
        }
        connection.statusChanged.connect(statusChanged);
        this._statusChangedHandlers[widget.id] = statusChanged;
        const iopubMessage = (_, msg) => {
            if (this._service.isStarted &&
                !this._service.hasStoppedThreads() &&
                msg.parent_header.msg_type ===
                    'execute_request') {
                void this._service.displayDefinedVariables();
            }
        };
        const iopubMessageHandler = this._iopubMessageHandlers[widget.id];
        if (iopubMessageHandler) {
            connection.iopubMessage.disconnect(iopubMessageHandler);
        }
        connection.iopubMessage.connect(iopubMessage);
        this._iopubMessageHandlers[widget.id] = iopubMessage;
        this._activeWidget = widget;
        return this.updateWidget(widget, connection);
    }
    /**
     * Update a debug handler for the given widget, and
     * handle connection kernel changed events.
     *
     * @param widget The widget to update.
     * @param sessionContext The session context.
     */
    async updateContext(widget, sessionContext) {
        const connectionChanged = () => {
            const { session: connection } = sessionContext;
            void this.update(widget, connection);
        };
        const contextKernelChangedHandlers = this._contextKernelChangedHandlers[widget.id];
        if (contextKernelChangedHandlers) {
            sessionContext.kernelChanged.disconnect(contextKernelChangedHandlers);
        }
        this._contextKernelChangedHandlers[widget.id] = connectionChanged;
        sessionContext.kernelChanged.connect(connectionChanged);
        return this.update(widget, sessionContext.session);
    }
    /**
     * Update a debug handler for the given widget.
     *
     * @param widget The widget to update.
     * @param connection The session connection.
     */
    async updateWidget(widget, connection) {
        var _a, _b, _c, _d;
        if (!this._service.model || !connection) {
            return;
        }
        const hasFocus = () => {
            return this._shell.currentWidget === widget;
        };
        const updateAttribute = () => {
            if (!this._handlers[widget.id]) {
                widget.node.removeAttribute('data-jp-debugger');
                return;
            }
            widget.node.setAttribute('data-jp-debugger', 'true');
        };
        const createHandler = () => {
            if (this._handlers[widget.id]) {
                return;
            }
            switch (this._type) {
                case 'notebook':
                    this._handlers[widget.id] = new NotebookHandler({
                        debuggerService: this._service,
                        widget: widget,
                        translator: this._translator || undefined
                    });
                    break;
                case 'console':
                    this._handlers[widget.id] = new ConsoleHandler({
                        debuggerService: this._service,
                        widget: widget,
                        translator: this._translator || undefined
                    });
                    break;
                case 'file':
                    this._handlers[widget.id] = new FileHandler({
                        debuggerService: this._service,
                        widget: widget,
                        translator: this._translator || undefined
                    });
                    break;
                default:
                    throw Error(`No handler for the type ${this._type}`);
            }
            updateAttribute();
        };
        const removeHandlers = () => {
            var _a, _b, _c, _d;
            const handler = this._handlers[widget.id];
            if (!handler) {
                return;
            }
            handler.dispose();
            delete this._handlers[widget.id];
            delete this._kernelChangedHandlers[widget.id];
            delete this._statusChangedHandlers[widget.id];
            delete this._iopubMessageHandlers[widget.id];
            delete this._contextKernelChangedHandlers[widget.id];
            // Clear the model if the handler being removed corresponds
            // to the current active debug session, or if the connection
            // does not have a kernel.
            if (((_b = (_a = this._service.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.path) === (connection === null || connection === void 0 ? void 0 : connection.path) ||
                !((_d = (_c = this._service.session) === null || _c === void 0 ? void 0 : _c.connection) === null || _d === void 0 ? void 0 : _d.kernel)) {
                const model = this._service.model;
                model.clear();
            }
            updateAttribute();
        };
        const addToolbarButton = (enabled = true) => {
            const debugButton = this._iconButtons[widget.id];
            if (!debugButton) {
                this._iconButtons[widget.id] = updateIconButton(widget, toggleDebugging, this._service.isStarted, enabled);
            }
            else {
                updateIconButtonState(debugButton, this._service.isStarted, enabled, toggleDebugging);
            }
        };
        const isDebuggerOn = () => {
            var _a;
            return (this._service.isStarted &&
                ((_a = this._previousConnection) === null || _a === void 0 ? void 0 : _a.id) === (connection === null || connection === void 0 ? void 0 : connection.id));
        };
        const stopDebugger = async () => {
            this._service.session.connection = connection;
            await this._service.stop();
        };
        const startDebugger = async () => {
            var _a, _b;
            this._service.session.connection = connection;
            this._previousConnection = connection;
            await this._service.restoreState(true);
            await this._service.displayDefinedVariables();
            if ((_b = (_a = this._service.session) === null || _a === void 0 ? void 0 : _a.capabilities) === null || _b === void 0 ? void 0 : _b.supportsModulesRequest) {
                await this._service.displayModules();
            }
        };
        const toggleDebugging = async () => {
            // bail if the widget doesn't have focus
            if (!hasFocus()) {
                return;
            }
            const debugButton = this._iconButtons[widget.id];
            if (isDebuggerOn()) {
                await stopDebugger();
                removeHandlers();
                updateIconButtonState(debugButton, false);
            }
            else {
                await startDebugger();
                createHandler();
                updateIconButtonState(debugButton, true);
            }
        };
        addToolbarButton(false);
        // listen to the disposed signals
        widget.disposed.connect(async () => {
            if (isDebuggerOn()) {
                await stopDebugger();
            }
            removeHandlers();
            delete this._iconButtons[widget.id];
            delete this._contextKernelChangedHandlers[widget.id];
        });
        const debuggingEnabled = await this._service.isAvailable(connection);
        if (!debuggingEnabled) {
            removeHandlers();
            updateIconButtonState(this._iconButtons[widget.id], false, false);
            return;
        }
        // update the active debug session
        if (!this._service.session) {
            this._service.session = new Debugger.Session({
                connection,
                config: this._service.config
            });
        }
        else {
            this._previousConnection = ((_a = this._service.session.connection) === null || _a === void 0 ? void 0 : _a.kernel)
                ? this._service.session.connection
                : null;
            this._service.session.connection = connection;
        }
        if (isDebuggerOn()) {
            await this._service.restoreState(true);
        }
        else {
            await this._service.restoreState(false);
        }
        if (this._service.isStarted && !this._service.hasStoppedThreads()) {
            await this._service.displayDefinedVariables();
            if ((_c = (_b = this._service.session) === null || _b === void 0 ? void 0 : _b.capabilities) === null || _c === void 0 ? void 0 : _c.supportsModulesRequest) {
                await this._service.displayModules();
            }
        }
        updateIconButtonState(this._iconButtons[widget.id], this._service.isStarted, true);
        // check the state of the debug session
        if (!this._service.isStarted) {
            removeHandlers();
            this._service.session.connection = (_d = this._previousConnection) !== null && _d !== void 0 ? _d : connection;
            await this._service.restoreState(false);
            return;
        }
        // if the debugger is started but there is no handler, create a new one
        createHandler();
        this._previousConnection = connection;
    }
}
//# sourceMappingURL=handler.js.map
// EXTERNAL MODULE: ../node_modules/@jupyterlab/debugger/lib/displayregistry.js
var displayregistry = __webpack_require__(65200);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/breakpoints/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A model for a list of breakpoints.
 */
class BreakpointsModel {
    constructor(options) {
        var _a;
        this._breakpoints = new Map();
        this._changed = new dist_index_es6_js_.Signal(this);
        this._restored = new dist_index_es6_js_.Signal(this);
        this._clicked = new dist_index_es6_js_.Signal(this);
        this._selectedChanged = new dist_index_es6_js_.Signal(this);
        this._displayRegistry =
            (_a = options.displayRegistry) !== null && _a !== void 0 ? _a : new displayregistry/* DebuggerDisplayRegistry */.M();
    }
    /**
     * Signal emitted when the model changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Signal emitted when the breakpoints are restored.
     */
    get restored() {
        return this._restored;
    }
    /**
     * Signal emitted when a breakpoint is clicked.
     */
    get clicked() {
        return this._clicked;
    }
    /**
     * Signal emitted when the selected breakpoint changes.
     */
    get selectedChanged() {
        return this._selectedChanged;
    }
    /**
     * Get selected breakpoint
     */
    get selectedBreakpoint() {
        return this._selectedBreakpoint;
    }
    /**
     * Set selected breakpoint
     */
    set selectedBreakpoint(selected) {
        this._selectedBreakpoint = selected;
        this._selectedChanged.emit(selected);
    }
    /**
     * Get all the breakpoints.
     */
    get breakpoints() {
        return this._breakpoints;
    }
    /**
     * Set the breakpoints for a given id (path).
     *
     * @param id The code id (path).
     * @param breakpoints The list of breakpoints.
     */
    setBreakpoints(id, breakpoints) {
        this._breakpoints.set(id, breakpoints);
        this._changed.emit(breakpoints);
    }
    /**
     * Get the breakpoints for a given id (path).
     *
     * @param id The code id (path).
     */
    getBreakpoints(id) {
        var _a;
        return (_a = this._breakpoints.get(id)) !== null && _a !== void 0 ? _a : [];
    }
    /**
     * Restore a map of breakpoints.
     *
     * @param breakpoints The map of breakpoints
     */
    restoreBreakpoints(breakpoints) {
        this._breakpoints = breakpoints;
        this._restored.emit();
    }
    /**
     * Get a human-readable display string for a breakpoint.
     * Shows execution count if notebook cell, [*] if running, [ ] if never executed.
     */
    getDisplayName(breakpoint) {
        return this._displayRegistry.getDisplayName(breakpoint.source);
    }
}
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/callstack/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A model for a callstack.
 */
class CallstackModel {
    constructor(options) {
        var _a;
        this._state = [];
        this._currentFrame = null;
        this._framesChanged = new dist_index_es6_js_.Signal(this);
        this._currentFrameChanged = new dist_index_es6_js_.Signal(this);
        this._displayRegistry =
            (_a = options.displayRegistry) !== null && _a !== void 0 ? _a : new displayregistry/* DebuggerDisplayRegistry */.M();
    }
    /**
     * Get all the frames.
     */
    get frames() {
        return this._state;
    }
    /**
     * Set the frames.
     */
    set frames(newFrames) {
        this._state = newFrames;
        const currentFrameId = this.frame !== null ? model_Private.getFrameId(this.frame) : '';
        const frame = newFrames.find(frame => model_Private.getFrameId(frame) === currentFrameId);
        // Default to the first frame if the previous one can't be found.
        // Otherwise keep the current frame selected.
        if (!frame) {
            this.frame = newFrames[0];
        }
        this._framesChanged.emit(newFrames);
    }
    /**
     * Get the current frame.
     */
    get frame() {
        return this._currentFrame;
    }
    /**
     * Set the current frame.
     */
    set frame(frame) {
        this._currentFrame = frame;
        this._currentFrameChanged.emit(frame);
    }
    /**
     * Signal emitted when the frames have changed.
     */
    get framesChanged() {
        return this._framesChanged;
    }
    /**
     * Signal emitted when the current frame has changed.
     */
    get currentFrameChanged() {
        return this._currentFrameChanged;
    }
    /**
     * Returns a human-readable display for a frame.
     */
    getDisplayName(frame) {
        let name = this._displayRegistry.getDisplayName(frame.source);
        if (frame.line !== undefined) {
            name += `:${frame.line}`;
        }
        return name;
    }
}
/**
 * A namespace for private data.
 */
var model_Private;
(function (Private) {
    /**
     * Construct an id for the given frame.
     *
     * @param frame The frame.
     */
    function getFrameId(frame) {
        var _a;
        return `${(_a = frame === null || frame === void 0 ? void 0 : frame.source) === null || _a === void 0 ? void 0 : _a.path}-${frame === null || frame === void 0 ? void 0 : frame.id}`;
    }
    Private.getFrameId = getFrameId;
})(model_Private || (model_Private = {}));
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/sources/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * The model to keep track of the current source being displayed.
 */
class SourcesModel {
    /**
     * Instantiate a new Sources.Model
     *
     * @param options The Sources.Model instantiation options.
     */
    constructor(options) {
        var _a;
        this._currentSourceOpened = new dist_index_es6_js_.Signal(this);
        this._currentSourceChanged = new dist_index_es6_js_.Signal(this);
        this.currentFrameChanged = options.currentFrameChanged;
        this._displayRegistry =
            (_a = options.displayRegistry) !== null && _a !== void 0 ? _a : new displayregistry/* DebuggerDisplayRegistry */.M();
    }
    /**
     * Signal emitted when a source should be open in the main area.
     */
    get currentSourceOpened() {
        return this._currentSourceOpened;
    }
    /**
     * Signal emitted when the current source changes.
     */
    get currentSourceChanged() {
        return this._currentSourceChanged;
    }
    /**
     * Return the current source.
     */
    get currentSource() {
        return this._currentSource;
    }
    /**
     * Set the current source.
     *
     * @param source The source to set as the current source.
     */
    set currentSource(source) {
        this._currentSource = source;
        this._currentSourceChanged.emit(source);
    }
    /**
     * Open a source in the main area.
     */
    open() {
        this._currentSourceOpened.emit(this._currentSource);
    }
    /**
     * Get a human-readable display for a frame.
     *
     * For notebook cells, shows execution count if available, [*] if running, or [ ] if never executed.
     */
    /**
     * Returns a human-readable display for a frame.
     */
    getDisplayName(frame) {
        let name = this._displayRegistry.getDisplayName(frame.source);
        if (frame.line !== undefined) {
            name += `:${frame.line}`;
        }
        return name;
    }
}
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/kernelSources/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * The rate limit for the filter debouncer
 */
const DEBOUNCER_RATE_LIMIT_MS = 500;
const compare = (a, b) => {
    if (a.name < b.name) {
        return -1;
    }
    if (a.name > b.name) {
        return 1;
    }
    return 0;
};
/**
 * The model to keep track of the current source being displayed.
 */
class KernelSourcesModel {
    constructor() {
        this._filteredKernelSources = null;
        this._filter = '';
        this._isDisposed = false;
        this._kernelSources = null;
        this._changed = new dist_index_es6_js_.Signal(this);
        this._filterChanged = new dist_index_es6_js_.Signal(this);
        this._kernelSourceOpened = new dist_index_es6_js_.Signal(this);
        this.refresh = this.refresh.bind(this);
        this._refreshDebouncer = new polling_dist_index_es6_js_.Debouncer(this.refresh, DEBOUNCER_RATE_LIMIT_MS);
    }
    /**
     * Get the filter.
     */
    get filter() {
        return this._filter;
    }
    /**
     * Set the filter.
     * The update
     */
    set filter(filter) {
        this._filter = filter;
        this._filterChanged.emit(filter);
        void this._refreshDebouncer.invoke();
    }
    /**
     * Whether the kernel sources model is disposed or not.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Get the kernel sources.
     */
    get kernelSources() {
        return this._kernelSources;
    }
    /**
     * Set the kernel sources and emit a changed signal.
     */
    set kernelSources(kernelSources) {
        this._kernelSources = kernelSources;
        this.refresh();
    }
    /**
     * Signal emitted when the current source changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Signal emitted when the current source changes.
     */
    get filterChanged() {
        return this._filterChanged;
    }
    /**
     * Signal emitted when a kernel source should be open in the main area.
     */
    get kernelSourceOpened() {
        return this._kernelSourceOpened;
    }
    /**
     * Dispose the kernel sources model
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._refreshDebouncer.dispose();
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Open a source in the main area.
     */
    open(kernelSource) {
        this._kernelSourceOpened.emit(kernelSource);
    }
    getFilteredKernelSources() {
        const regexp = new RegExp(this._filter);
        return this._kernelSources.filter(module => regexp.test(module.name));
    }
    refresh() {
        if (this._kernelSources) {
            this._filteredKernelSources = this._filter
                ? this.getFilteredKernelSources()
                : this._kernelSources;
            this._filteredKernelSources.sort(compare);
        }
        else {
            this._kernelSources = new Array();
            this._filteredKernelSources = new Array();
        }
        this._changed.emit(this._filteredKernelSources);
    }
}
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/variables/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A model for a variable explorer.
 */
class VariablesModel {
    constructor() {
        this._selectedVariable = null;
        this._state = [];
        this._variableExpanded = new dist_index_es6_js_.Signal(this);
        this._changed = new dist_index_es6_js_.Signal(this);
    }
    /**
     * Get all the scopes.
     */
    get scopes() {
        return this._state;
    }
    /**
     * Set the scopes.
     */
    set scopes(scopes) {
        this._state = scopes;
        this._changed.emit();
    }
    /**
     * Signal emitted when the current variable has changed.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Signal emitted when the current variable has been expanded.
     */
    get variableExpanded() {
        return this._variableExpanded;
    }
    get selectedVariable() {
        return this._selectedVariable;
    }
    set selectedVariable(selection) {
        this._selectedVariable = selection;
    }
    /**
     * Expand a variable.
     *
     * @param variable The variable to expand.
     */
    expandVariable(variable) {
        this._variableExpanded.emit(variable);
    }
}
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * A model for a debugger.
 */
class DebuggerModel {
    /**
     * Instantiate a new DebuggerModel
     */
    constructor(options) {
        var _a;
        this._disposed = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._hasRichVariableRendering = false;
        this._supportCopyToGlobals = false;
        this._stoppedThreads = new Set();
        this._title = '-';
        this._titleChanged = new dist_index_es6_js_.Signal(this);
        const displayRegistry = (_a = options.displayRegistry) !== null && _a !== void 0 ? _a : new displayregistry/* DebuggerDisplayRegistry */.M();
        this.breakpoints = new BreakpointsModel({ displayRegistry });
        this.callstack = new CallstackModel({
            displayRegistry
        });
        this.variables = new VariablesModel();
        this.sources = new SourcesModel({
            currentFrameChanged: this.callstack.currentFrameChanged,
            displayRegistry
        });
        this.kernelSources = new KernelSourcesModel();
    }
    /**
     * A signal emitted when the debugger widget is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Whether the kernel support rich variable rendering based on mime type.
     */
    get hasRichVariableRendering() {
        return this._hasRichVariableRendering;
    }
    set hasRichVariableRendering(v) {
        this._hasRichVariableRendering = v;
    }
    /**
     * Whether the kernel supports the copyToGlobals request.
     */
    get supportCopyToGlobals() {
        return this._supportCopyToGlobals;
    }
    set supportCopyToGlobals(v) {
        this._supportCopyToGlobals = v;
    }
    /**
     * Whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * The set of threads in stopped state.
     */
    get stoppedThreads() {
        return this._stoppedThreads;
    }
    /**
     * Assigns the parameters to the set of threads in stopped state.
     */
    set stoppedThreads(threads) {
        this._stoppedThreads = threads;
    }
    /**
     * The current debugger title.
     */
    get title() {
        return this._title;
    }
    /**
     * Set the current debugger title.
     */
    set title(title) {
        if (title === this._title) {
            return;
        }
        this._title = title !== null && title !== void 0 ? title : '-';
        this._titleChanged.emit(title);
    }
    /**
     * A signal emitted when the title changes.
     */
    get titleChanged() {
        return this._titleChanged;
    }
    /**
     * Dispose the model.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.kernelSources.dispose();
        this._disposed.emit();
    }
    /**
     * Clear the model.
     */
    clear() {
        this._stoppedThreads.clear();
        const breakpoints = new Map();
        this.breakpoints.restoreBreakpoints(breakpoints);
        this.callstack.frames = [];
        this.variables.scopes = [];
        this.sources.currentSource = null;
        this.kernelSources.kernelSources = null;
        this.title = '-';
    }
}
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/variables/grid.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A data grid that displays variables in a debugger session.
 */
class VariablesBodyGrid extends index_es6_js_.Panel {
    /**
     * Instantiate a new VariablesBodyGrid.
     *
     * @param options The instantiation options for a VariablesBodyGrid.
     */
    constructor(options) {
        super();
        this._filter = new Set();
        this._grid = null;
        this._pending = null;
        this.commands = options.commands;
        this.model = options.model;
        this.themeManager = options.themeManager;
        this.translator = options.translator;
        this.model.changed.connect(() => this.update(), this);
        this.addClass('jp-DebuggerVariables-body');
    }
    /**
     * The variable filter list.
     */
    get filter() {
        return this._filter;
    }
    set filter(filter) {
        this._filter = filter;
        this.update();
    }
    /**
     * The current scope of the variables.
     */
    get scope() {
        return this._scope;
    }
    set scope(scope) {
        this._scope = scope;
        if (scope !== 'Globals') {
            this.addClass('jp-debuggerVariables-local');
        }
        else {
            this.removeClass('jp-debuggerVariables-local');
        }
        this.update();
    }
    /**
     * Load the grid panel implementation and instantiate a grid.
     */
    async initialize() {
        if (this._grid || this._pending) {
            return;
        }
        // Lazily load the datagrid module when the first grid is requested.
        const { Grid } = await (this._pending = Promise.all(/* import() */[__webpack_require__.e(4144), __webpack_require__.e(2444)]).then(__webpack_require__.bind(__webpack_require__, 31958)));
        const { commands, model, themeManager, translator } = this;
        this._grid = new Grid({ commands, model, themeManager, translator });
        this._grid.addClass('jp-DebuggerVariables-grid');
        this._pending = null;
        this.addWidget(this._grid);
        this.update();
    }
    /**
     * Wait until actually displaying the grid to trigger initialization.
     */
    onBeforeShow(msg) {
        if (!this._grid && !this._pending) {
            void this.initialize();
        }
        super.onBeforeShow(msg);
    }
    /**
     * Handle `update-request` messages.
     */
    onUpdateRequest(msg) {
        var _a;
        if (this._grid) {
            const { dataModel } = this._grid;
            dataModel.filter = this._filter;
            dataModel.scope = this._scope;
            dataModel.setData((_a = this.model.scopes) !== null && _a !== void 0 ? _a : []);
        }
        super.onUpdateRequest(msg);
    }
}
//# sourceMappingURL=grid.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var coreutils_dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/variables/mimerenderer.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */






const RENDERER_PANEL_CLASS = 'jp-VariableRendererPanel';
const RENDERER_PANEL_RENDERER_CLASS = 'jp-VariableRendererPanel-renderer';
/**
 * Debugger variable mime type renderer
 */
class VariableMimeRenderer extends lib_index_js_.MainAreaWidget {
    /**
     * Instantiate a new VariableMimeRenderer.
     */
    constructor(options) {
        const { dataLoader, rendermime, translator } = options;
        const content = new index_es6_js_.Panel();
        const loaded = new coreutils_dist_index_js_.PromiseDelegate();
        super({
            content,
            reveal: Promise.all([dataLoader, loaded.promise])
        });
        this.content.addClass(RENDERER_PANEL_CLASS);
        this.trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.dataLoader = dataLoader;
        this.renderMime = rendermime;
        this._dataHash = null;
        this.refresh()
            .then(() => {
            loaded.resolve();
        })
            .catch(reason => loaded.reject(reason));
    }
    /**
     * Refresh the variable view
     */
    async refresh(force = false) {
        let data = await this.dataLoader();
        if (Object.keys(data.data).length === 0) {
            data = {
                data: {
                    'text/plain': this.trans.__('The variable is undefined in the active context.')
                },
                metadata: {}
            };
        }
        if (data.data) {
            const hash = murmur2(JSON.stringify(data), 17);
            if (force || this._dataHash !== hash) {
                if (this.content.layout) {
                    this.content.widgets.forEach(w => {
                        this.content.layout.removeWidget(w);
                    });
                }
                // We trust unconditionally the data as the user is required to
                // execute the code to load a particular variable in memory
                const mimeType = this.renderMime.preferredMimeType(data.data, 'any');
                if (mimeType) {
                    const widget = this.renderMime.createRenderer(mimeType);
                    widget.addClass(RENDERER_PANEL_RENDERER_CLASS);
                    const model = new rendermime_lib_index_js_.MimeModel({ ...data, trusted: true });
                    this._dataHash = hash;
                    await widget.renderModel(model);
                    this.content.addWidget(widget);
                }
                else {
                    this._dataHash = null;
                    return Promise.reject('Unable to determine the preferred mime type.');
                }
            }
        }
        else {
            this._dataHash = null;
            return Promise.reject('Unable to get a view on the variable.');
        }
    }
}
//# sourceMappingURL=mimerenderer.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/service.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A concrete implementation of the IDebugger interface.
 */
class DebuggerService {
    /**
     * Instantiate a new DebuggerService.
     *
     * @param options The instantiation options for a DebuggerService.
     */
    constructor(options) {
        var _a, _b;
        this._eventMessage = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._sessionChanged = new dist_index_es6_js_.Signal(this);
        this._pauseOnExceptionChanged = new dist_index_es6_js_.Signal(this);
        this._config = options.config;
        // Avoids setting session with invalid client
        // session should be set only when a notebook or
        // a console get the focus.
        // TODO: also checks that the notebook or console
        // runs a kernel with debugging ability
        this._session = null;
        this._specsManager = (_a = options.specsManager) !== null && _a !== void 0 ? _a : null;
        this._model = new Debugger.Model({
            displayRegistry: options.displayRegistry
        });
        this._debuggerSources = (_b = options.debuggerSources) !== null && _b !== void 0 ? _b : null;
        this._trans = (options.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
    }
    /**
     * Signal emitted for debug event messages.
     */
    get eventMessage() {
        return this._eventMessage;
    }
    /**
     * Get debugger config.
     */
    get config() {
        return this._config;
    }
    /**
     * Whether the debug service is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Whether the current debugger is started.
     */
    get isStarted() {
        var _a, _b;
        return (_b = (_a = this._session) === null || _a === void 0 ? void 0 : _a.isStarted) !== null && _b !== void 0 ? _b : false;
    }
    /**
     * A signal emitted when the pause on exception filter changes.
     */
    get pauseOnExceptionChanged() {
        return this._pauseOnExceptionChanged;
    }
    /**
     * Returns the debugger service's model.
     */
    get model() {
        return this._model;
    }
    /**
     * Returns the current debug session.
     */
    get session() {
        return this._session;
    }
    /**
     * Sets the current debug session to the given parameter.
     *
     * @param session - the new debugger session.
     */
    set session(session) {
        var _a;
        if (this._session === session) {
            return;
        }
        if (this._session) {
            this._session.dispose();
        }
        this._session = session;
        (_a = this._session) === null || _a === void 0 ? void 0 : _a.eventMessage.connect((_, event) => {
            if (event.event === 'stopped') {
                this._model.stoppedThreads.clear();
                this._model.stoppedThreads.add(event.body.threadId);
                void this._getAllFrames();
            }
            else if (event.event === 'continued') {
                this._model.stoppedThreads.delete(event.body.threadId);
                this._clearModel();
                this._clearSignals();
            }
            this._eventMessage.emit(event);
        });
        this._sessionChanged.emit(session);
    }
    /**
     * Signal emitted upon session changed.
     */
    get sessionChanged() {
        return this._sessionChanged;
    }
    /**
     * Dispose the debug service.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Computes an id based on the given code.
     *
     * @param code The source code.
     */
    getCodeId(code) {
        var _a, _b, _c, _d;
        try {
            return this._config.getCodeId(code, (_d = (_c = (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '');
        }
        catch (_e) {
            return '';
        }
    }
    /**
     * Whether there exists a thread in stopped state.
     */
    hasStoppedThreads() {
        var _a, _b;
        return (_b = ((_a = this._model) === null || _a === void 0 ? void 0 : _a.stoppedThreads.size) > 0) !== null && _b !== void 0 ? _b : false;
    }
    /**
     * Request whether debugging is available for the session connection.
     *
     * @param connection The session connection.
     */
    async isAvailable(connection) {
        var _a, _b, _c, _d;
        if (!this._specsManager) {
            return true;
        }
        await this._specsManager.ready;
        const kernel = connection === null || connection === void 0 ? void 0 : connection.kernel;
        if (!kernel) {
            return false;
        }
        const name = kernel.name;
        if (!((_a = this._specsManager.specs) === null || _a === void 0 ? void 0 : _a.kernelspecs[name])) {
            return true;
        }
        return !!((_d = (_c = (_b = this._specsManager.specs.kernelspecs[name]) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c['debugger']) !== null && _d !== void 0 ? _d : false);
    }
    /**
     * Clear all the breakpoints for the current session.
     */
    async clearBreakpoints() {
        var _a;
        if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.isStarted) !== true) {
            return;
        }
        this._model.breakpoints.breakpoints.forEach((_, path, map) => {
            void this._setBreakpoints([], path);
        });
        let bpMap = new Map();
        this._model.breakpoints.restoreBreakpoints(bpMap);
    }
    /**
     * Continues the execution of the current thread.
     */
    async continue() {
        try {
            if (!this.session) {
                throw new Error('No active debugger session');
            }
            await this.session.sendRequest('continue', {
                threadId: this._currentThread()
            });
            this._model.stoppedThreads.delete(this._currentThread());
            this._clearModel();
            this._clearSignals();
        }
        catch (err) {
            console.error('Error:', err.message);
        }
    }
    /**
     * Retrieve the content of a source file.
     *
     * @param source The source object containing the path to the file.
     */
    async getSource(source) {
        var _a, _b;
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const reply = await this.session.sendRequest('source', {
            source,
            sourceReference: (_a = source.sourceReference) !== null && _a !== void 0 ? _a : 0
        });
        return { ...reply.body, path: (_b = source.path) !== null && _b !== void 0 ? _b : '' };
    }
    /**
     * Evaluate an expression.
     *
     * @param expression The expression to evaluate as a string.
     */
    async evaluate(expression) {
        var _a;
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const frameId = (_a = this.model.callstack.frame) === null || _a === void 0 ? void 0 : _a.id;
        const reply = await this.session.sendRequest('evaluate', {
            context: 'repl',
            expression,
            frameId
        });
        if (!reply.success) {
            return null;
        }
        // TODO - Should this be here?
        this._model.variables.scopes = [];
        // get the frames to retrieve the latest state of the variables
        await this._getAllFrames();
        return reply.body;
    }
    /**
     * Makes the current thread run again for one step.
     */
    async next() {
        try {
            if (!this.session) {
                throw new Error('No active debugger session');
            }
            await this.session.sendRequest('next', {
                threadId: this._currentThread()
            });
        }
        catch (err) {
            console.error('Error:', err.message);
        }
    }
    /**
     * Request rich representation of a variable.
     *
     * @param variableName The variable name to request
     * @param frameId The current frame id in which to request the variable
     * @returns The mime renderer data model
     */
    async inspectRichVariable(variableName, frameId) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const reply = await this.session.sendRequest('richInspectVariables', {
            variableName,
            frameId
        });
        if (reply.success) {
            return reply.body;
        }
        else {
            throw new Error(reply.message);
        }
    }
    /**
     * Request variables for a given variable reference.
     *
     * @param variablesReference The variable reference to request.
     */
    async inspectVariable(variablesReference) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const reply = await this.session.sendRequest('variables', {
            variablesReference
        });
        if (reply.success) {
            return reply.body.variables;
        }
        else {
            throw new Error(reply.message);
        }
    }
    /**
     * Request to set a variable in the global scope.
     *
     * @param name The name of the variable.
     */
    async copyToGlobals(name) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        if (!this.model.supportCopyToGlobals) {
            throw new Error('The "copyToGlobals" request is not supported by the kernel');
        }
        const frames = this.model.callstack.frames;
        this.session
            .sendRequest('copyToGlobals', {
            srcVariableName: name,
            dstVariableName: name,
            srcFrameId: frames[0].id
        })
            .then(async () => {
            const scopes = await this._getScopes(frames[0]);
            const variables = await Promise.all(scopes.map(scope => this._getVariables(scope)));
            const variableScopes = this._convertScopes(scopes, variables);
            this._model.variables.scopes = variableScopes;
        })
            .catch(reason => {
            console.error(reason);
        });
    }
    /**
     * Requests all the defined variables and display them in the
     * table view.
     */
    async displayDefinedVariables() {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const inspectReply = await this.session.sendRequest('inspectVariables', {});
        const variables = inspectReply.body.variables;
        const variableScopes = [
            {
                name: this._trans.__('Globals'),
                variables: variables
            }
        ];
        this._model.variables.scopes = variableScopes;
    }
    async displayModules() {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const modules = await this.session.sendRequest('modules', {});
        this._model.kernelSources.kernelSources = modules.body.modules.map(module => {
            return {
                name: module.name,
                path: module.path
            };
        });
    }
    /**
     * Restart the debugger.
     */
    async restart() {
        const { breakpoints } = this._model.breakpoints;
        await this.stop();
        await this.start();
        await this._restoreBreakpoints(breakpoints);
    }
    /**
     * Restore the state of a debug session.
     *
     * @param autoStart - If true, starts the debugger if it has not been started.
     */
    async restoreState(autoStart) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
        if (!this.model || !this.session) {
            return;
        }
        const reply = await this.session.restoreState();
        const { body } = reply;
        const kernelBreakpoints = this._mapBreakpoints(body.breakpoints);
        const stoppedThreads = new Set(body.stoppedThreads);
        const oldDebuggerState = this.getDebuggerState();
        this._model.hasRichVariableRendering = body.richRendering === true;
        this._model.supportCopyToGlobals = body.copyToGlobals === true;
        this._config.setHashParams({
            kernel: (_d = (_c = (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '',
            method: body.hashMethod,
            seed: body.hashSeed
        });
        this._config.setTmpFileParams({
            kernel: (_h = (_g = (_f = (_e = this.session) === null || _e === void 0 ? void 0 : _e.connection) === null || _f === void 0 ? void 0 : _f.kernel) === null || _g === void 0 ? void 0 : _g.name) !== null && _h !== void 0 ? _h : '',
            prefix: body.tmpFilePrefix,
            suffix: body.tmpFileSuffix
        });
        this._model.stoppedThreads = stoppedThreads;
        if (!this.isStarted && (autoStart || stoppedThreads.size !== 0)) {
            await this.start();
        }
        if (this.isStarted || autoStart) {
            this._model.title = this.isStarted
                ? ((_k = (_j = this.session) === null || _j === void 0 ? void 0 : _j.connection) === null || _k === void 0 ? void 0 : _k.name) || '-'
                : '-';
        }
        const breakpoints = await this._migrateBreakpoints(oldDebuggerState);
        // Merge kernel breakpoints with existing breakpoints, avoiding duplicates
        for (const [path, kernelBpList] of kernelBreakpoints) {
            const existingBreakpoints = (_l = breakpoints.get(path)) !== null && _l !== void 0 ? _l : [];
            // Filter out kernel breakpoints that already exist at the same line
            const newBreakpoints = kernelBpList.filter(kernelBp => !existingBreakpoints.some(existingBp => existingBp.line === kernelBp.line));
            // Merge existing and new breakpoints
            breakpoints.set(path, [...existingBreakpoints, ...newBreakpoints]);
        }
        // restore in kernel AND model
        await this._restoreBreakpoints(breakpoints);
        this._model.breakpoints.restoreBreakpoints(breakpoints);
        if (stoppedThreads.size !== 0) {
            await this._getAllFrames();
        }
        else if (this.isStarted) {
            this._model.callstack.frames = [];
            this._clearSignals();
        }
        // Send the currentExceptionFilters to debugger.
        if (this.session.currentExceptionFilters) {
            await this.pauseOnExceptions(this.session.currentExceptionFilters);
        }
    }
    /**
     * Starts a debugger.
     * Precondition: !isStarted
     */
    start() {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        return this.session.start();
    }
    /**
     * Makes the current thread pause if possible.
     */
    async pause() {
        try {
            if (!this.session) {
                throw new Error('No active debugger session');
            }
            await this.session.sendRequest('pause', {
                threadId: this._currentThread()
            });
        }
        catch (err) {
            console.error('Error:', err.message);
        }
    }
    /**
     * Makes the current thread step in a function / method if possible.
     */
    async stepIn() {
        try {
            if (!this.session) {
                throw new Error('No active debugger session');
            }
            await this.session.sendRequest('stepIn', {
                threadId: this._currentThread()
            });
        }
        catch (err) {
            console.error('Error:', err.message);
        }
    }
    /**
     * Makes the current thread step out a function / method if possible.
     */
    async stepOut() {
        try {
            if (!this.session) {
                throw new Error('No active debugger session');
            }
            await this.session.sendRequest('stepOut', {
                threadId: this._currentThread()
            });
        }
        catch (err) {
            console.error('Error:', err.message);
        }
    }
    /**
     * Stops the debugger.
     * Precondition: isStarted
     */
    async stop() {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        await this.session.stop();
        if (this._model) {
            this._model.clear();
        }
    }
    /**
     * Update all breakpoints at once.
     *
     * @param code - The code in the cell where the breakpoints are set.
     * @param breakpoints - The list of breakpoints to set.
     * @param path - Optional path to the file where to set the breakpoints.
     */
    async updateBreakpoints(code, breakpoints, path) {
        var _a;
        if (!((_a = this.session) === null || _a === void 0 ? void 0 : _a.isStarted)) {
            return;
        }
        if (!path) {
            path = (await this._dumpCell(code)).body.sourcePath;
        }
        const state = await this.session.restoreState();
        const localBreakpoints = breakpoints
            .filter(({ line }) => typeof line === 'number')
            .map(({ line }) => ({ line: line }));
        const remoteBreakpoints = this._mapBreakpoints(state.body.breakpoints);
        this._model.breakpoints.restoreBreakpoints(remoteBreakpoints);
        // Removes duplicated breakpoints. It is better to do it here than
        // in the editor, because the kernel can change the line of a
        // breakpoint (when you attempt to set a breakpoint on an empty
        // line for instance).
        let addedLines = new Set();
        // Set the kernel's breakpoints for this path.
        const reply = await this._setBreakpoints(localBreakpoints, path);
        const updatedBreakpoints = reply.body.breakpoints.filter((val, _, arr) => {
            const cond1 = arr.findIndex(el => el.line === val.line) > -1;
            const cond2 = !addedLines.has(val.line);
            addedLines.add(val.line);
            return cond1 && cond2;
        });
        // Update the local model and finish kernel configuration.
        this._model.breakpoints.setBreakpoints(path, updatedBreakpoints);
    }
    /**
     * Determines if pausing on exceptions is supported by the kernel
     */
    pauseOnExceptionsIsValid() {
        var _a, _b;
        if (this.isStarted) {
            if (((_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.exceptionBreakpointFilters) === null || _b === void 0 ? void 0 : _b.length) !== 0) {
                return true;
            }
        }
        return false;
    }
    /**
     * Add or remove a filter from the current used filters.
     *
     * @param exceptionFilter - The filter to add or remove from current filters.
     */
    async pauseOnExceptionsFilter(exceptionFilter) {
        var _a;
        if (!((_a = this.session) === null || _a === void 0 ? void 0 : _a.isStarted)) {
            return;
        }
        let exceptionFilters = this.session.currentExceptionFilters;
        if (this.session.isPausingOnException(exceptionFilter)) {
            const index = exceptionFilters.indexOf(exceptionFilter);
            exceptionFilters.splice(index, 1);
        }
        else {
            exceptionFilters === null || exceptionFilters === void 0 ? void 0 : exceptionFilters.push(exceptionFilter);
        }
        await this.pauseOnExceptions(exceptionFilters);
    }
    /**
     * Enable or disable pausing on exceptions.
     *
     * @param exceptionFilters - The filters to use for the current debugging session.
     */
    async pauseOnExceptions(exceptionFilters) {
        var _a, _b;
        if (!((_a = this.session) === null || _a === void 0 ? void 0 : _a.isStarted)) {
            return;
        }
        const exceptionBreakpointFilters = ((_b = this.session.exceptionBreakpointFilters) === null || _b === void 0 ? void 0 : _b.map(e => e.filter)) || [];
        let options = {
            filters: []
        };
        exceptionFilters.forEach(filter => {
            if (exceptionBreakpointFilters.includes(filter)) {
                options.filters.push(filter);
            }
        });
        this.session.currentExceptionFilters = options.filters;
        await this.session.sendRequest('setExceptionBreakpoints', options);
        this._pauseOnExceptionChanged.emit();
    }
    /**
     * Get the debugger state
     *
     * @returns Debugger state
     */
    getDebuggerState() {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
        const breakpoints = this._model.breakpoints.breakpoints;
        let cells = [];
        const kernel = (_d = (_c = (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '';
        const tmpFileParams = this._config.getTmpFileParams(kernel);
        const tmpPrefix = (_e = tmpFileParams === null || tmpFileParams === void 0 ? void 0 : tmpFileParams.prefix) !== null && _e !== void 0 ? _e : '';
        if (this._debuggerSources) {
            for (const id of breakpoints.keys()) {
                const editorList = this._debuggerSources.find({
                    focus: false,
                    kernel: (_j = (_h = (_g = (_f = this.session) === null || _f === void 0 ? void 0 : _f.connection) === null || _g === void 0 ? void 0 : _g.kernel) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : '',
                    path: (_m = (_l = (_k = this._session) === null || _k === void 0 ? void 0 : _k.connection) === null || _l === void 0 ? void 0 : _l.path) !== null && _m !== void 0 ? _m : '',
                    source: id
                });
                const tmpCells = editorList.map(e => e.src.getSource());
                cells = cells.concat(tmpCells);
            }
        }
        return { cells, breakpoints, tmpPrefix };
    }
    /**
     * Restore the debugger state
     *
     * @param state Debugger state
     * @returns Whether the state has been restored successfully or not
     */
    async restoreDebuggerState(state) {
        const breakpoints = await this._migrateBreakpoints(state);
        await this._restoreBreakpoints(breakpoints);
        const config = await this.session.sendRequest('configurationDone', {});
        await this.restoreState(false);
        return config.success;
    }
    /**
     * Migrate breakpoints from previous path to new path when restoring service state
     * @param breakpoints
     * @returns
     */
    async _migrateBreakpoints(debuggerState) {
        var _a, _b, _c, _d;
        const oldSessionPrefix = debuggerState.tmpPrefix;
        const kernel = (_d = (_c = (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '';
        const { prefix } = this._config.getTmpFileParams(kernel);
        const { breakpoints } = debuggerState;
        // Bail early if nothing to do
        if (oldSessionPrefix === prefix) {
            return breakpoints;
        }
        const migratedBreakpoints = new Map();
        for (const item of breakpoints) {
            const [id, list] = item;
            if (oldSessionPrefix &&
                id.startsWith(oldSessionPrefix) &&
                oldSessionPrefix !== prefix) {
                /* replace tmpPrefix by the new prefix in newId*/
                const newId = id.replace(oldSessionPrefix, prefix);
                migratedBreakpoints.set(newId, list.map(bp => {
                    var _a;
                    return {
                        ...bp,
                        source: {
                            ...bp.source,
                            path: ((_a = bp.source) === null || _a === void 0 ? void 0 : _a.path)
                                ? bp.source.path.replace(oldSessionPrefix, prefix)
                                : undefined
                        }
                    };
                }));
            }
            else {
                /* keep the original id otherwise */
                migratedBreakpoints.set(id, list);
            }
        }
        // The session has changed (tmpPrefix has changed), the new kernel does not know
        // about the cells, request to dump cells
        for (const cell of debuggerState.cells) {
            await this._dumpCell(cell);
        }
        return migratedBreakpoints;
    }
    /**
     * Clear the current model.
     */
    _clearModel() {
        this._model.callstack.frames = [];
        this._model.variables.scopes = [];
    }
    /**
     * Clear the signals set on the model.
     */
    _clearSignals() {
        this._model.callstack.currentFrameChanged.disconnect(this._onCurrentFrameChanged, this);
        this._model.variables.variableExpanded.disconnect(this._onVariableExpanded, this);
    }
    /**
     * Map a list of scopes to a list of variables.
     *
     * @param scopes The list of scopes.
     * @param variables The list of variables.
     */
    _convertScopes(scopes, variables) {
        if (!variables || !scopes) {
            return [];
        }
        return scopes.map((scope, i) => {
            return {
                name: scope.name,
                variables: variables[i].map(variable => {
                    return { ...variable };
                })
            };
        });
    }
    /**
     * Get the current thread from the model.
     */
    _currentThread() {
        var _a;
        return (_a = this._model.stoppedThreads.values().next().value) !== null && _a !== void 0 ? _a : 1;
    }
    /**
     * Dump the content of a cell.
     *
     * @param code The source code to dump.
     */
    async _dumpCell(code) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        return this.session.sendRequest('dumpCell', { code });
    }
    /**
     * Get all the frames from the kernel.
     */
    async _getAllFrames() {
        this._model.callstack.currentFrameChanged.connect(this._onCurrentFrameChanged, this);
        this._model.variables.variableExpanded.connect(this._onVariableExpanded, this);
        const stackFrames = await this._getFrames(this._currentThread());
        this._model.callstack.frames = stackFrames;
    }
    /**
     * Get all the frames for the given thread id.
     *
     * @param threadId The thread id.
     */
    async _getFrames(threadId) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const reply = await this.session.sendRequest('stackTrace', {
            threadId
        });
        const stackFrames = reply.body.stackFrames;
        return stackFrames;
    }
    /**
     * Get all the scopes for the given frame.
     *
     * @param frame The frame.
     */
    async _getScopes(frame) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        if (!frame) {
            return [];
        }
        const reply = await this.session.sendRequest('scopes', {
            frameId: frame.id
        });
        return reply.body.scopes;
    }
    /**
     * Get the variables for a given scope.
     *
     * @param scope The scope to get variables for.
     */
    async _getVariables(scope) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        if (!scope) {
            return [];
        }
        const reply = await this.session.sendRequest('variables', {
            variablesReference: scope.variablesReference
        });
        return reply.body.variables;
    }
    /**
     * Process the list of breakpoints from the server and return as a map.
     *
     * @param breakpoints - The list of breakpoints from the kernel.
     *
     */
    _mapBreakpoints(breakpoints) {
        if (!breakpoints.length) {
            return new Map();
        }
        return breakpoints.reduce((map, val) => {
            const { breakpoints, source } = val;
            map.set(source, breakpoints.map(point => ({
                ...point,
                source: { path: source },
                verified: true
            })));
            return map;
        }, new Map());
    }
    /**
     * Handle a change of the current active frame.
     *
     * @param _ The callstack model
     * @param frame The frame.
     */
    async _onCurrentFrameChanged(_, frame) {
        if (!frame) {
            return;
        }
        const scopes = await this._getScopes(frame);
        const variables = await Promise.all(scopes.map(scope => this._getVariables(scope)));
        const variableScopes = this._convertScopes(scopes, variables);
        this._model.variables.scopes = variableScopes;
    }
    /**
     * Handle a variable expanded event and request variables from the kernel.
     *
     * @param _ The variables model.
     * @param variable The expanded variable.
     */
    async _onVariableExpanded(_, variable) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        const reply = await this.session.sendRequest('variables', {
            variablesReference: variable.variablesReference
        });
        let newVariable = { ...variable, expanded: true };
        reply.body.variables.forEach((variable) => {
            newVariable = { [variable.name]: variable, ...newVariable };
        });
        const newScopes = this._model.variables.scopes.map(scope => {
            const findIndex = scope.variables.findIndex(ele => ele.variablesReference === variable.variablesReference);
            scope.variables[findIndex] = newVariable;
            return { ...scope };
        });
        this._model.variables.scopes = [...newScopes];
        return reply.body.variables;
    }
    /**
     * Set the breakpoints for a given file.
     *
     * @param breakpoints The list of breakpoints to set.
     * @param path The path to where to set the breakpoints.
     */
    async _setBreakpoints(breakpoints, path) {
        if (!this.session) {
            throw new Error('No active debugger session');
        }
        return await this.session.sendRequest('setBreakpoints', {
            breakpoints: breakpoints,
            source: { path },
            sourceModified: false
        });
    }
    /**
     * Re-send the breakpoints to the kernel and update the model.
     *
     * @param breakpoints The map of breakpoints to send
     */
    async _restoreBreakpoints(breakpoints) {
        for (const [source, points] of breakpoints) {
            await this._setBreakpoints(points
                .filter(({ line }) => typeof line === 'number')
                .map(({ line }) => ({ line: line })), source);
        }
        this._model.breakpoints.restoreBreakpoints(breakpoints);
    }
}
//# sourceMappingURL=service.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/session.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A concrete implementation of IDebugger.ISession.
 */
class DebuggerSession {
    /**
     * Instantiate a new debug session
     *
     * @param options - The debug session instantiation options.
     */
    constructor(options) {
        this._seq = 0;
        this._ready = new coreutils_dist_index_js_.PromiseDelegate();
        this._isDisposed = false;
        this._isStarted = false;
        this._exceptionPaths = [];
        this._exceptionBreakpointFilters = [];
        this._currentExceptionFilters = {};
        this._disposed = new dist_index_es6_js_.Signal(this);
        this._eventMessage = new dist_index_es6_js_.Signal(this);
        this.connection = options.connection;
        this._config = options.config;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
    }
    /**
     * Whether the debug session is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Returns the initialize response .
     */
    get capabilities() {
        return this._capabilities;
    }
    /**
     * A signal emitted when the debug session is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Returns the API session connection to connect to a debugger.
     */
    get connection() {
        return this._connection;
    }
    /**
     * Sets the API session connection to connect to a debugger to
     * the given parameter.
     *
     * @param connection - The new API session connection.
     */
    set connection(connection) {
        var _a, _b;
        if (this._connection) {
            this._connection.iopubMessage.disconnect(this._handleEvent, this);
        }
        this._connection = connection;
        if (!this._connection) {
            this._isStarted = false;
            return;
        }
        this._connection.iopubMessage.connect(this._handleEvent, this);
        this._ready = new coreutils_dist_index_js_.PromiseDelegate();
        const future = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.requestDebug({
            type: 'request',
            seq: 0,
            command: 'debugInfo'
        });
        if (future) {
            future.onReply = (msg) => {
                this._ready.resolve();
                future.dispose();
            };
        }
    }
    /**
     * Whether the debug session is started.
     */
    get isStarted() {
        return this._isStarted;
    }
    /**
     * Exception paths defined by the debugger
     */
    get exceptionPaths() {
        return this._exceptionPaths;
    }
    /**
     * Exception breakpoint filters defined by the debugger
     */
    get exceptionBreakpointFilters() {
        return this._exceptionBreakpointFilters;
    }
    /**
     * Get current exception filters.
     */
    get currentExceptionFilters() {
        var _a, _b, _c;
        const kernel = (_c = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '';
        if (!kernel) {
            return [];
        }
        const tmpFileParams = this._config.getTmpFileParams(kernel);
        if (!tmpFileParams) {
            return [];
        }
        let prefix = tmpFileParams.prefix;
        if (Object.keys(this._currentExceptionFilters).includes(prefix)) {
            return this._currentExceptionFilters[prefix];
        }
        return [];
    }
    /**
     * Set current exception filters.
     */
    set currentExceptionFilters(exceptionFilters) {
        var _a, _b, _c;
        const kernel = (_c = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '';
        if (!kernel) {
            return;
        }
        const tmpFileParams = this._config.getTmpFileParams(kernel);
        if (!tmpFileParams) {
            return;
        }
        let prefix = tmpFileParams.prefix;
        if (exceptionFilters === null) {
            if (Object.keys(this._currentExceptionFilters).includes(prefix)) {
                delete this._currentExceptionFilters[prefix];
            }
        }
        else {
            this._currentExceptionFilters[prefix] = exceptionFilters;
        }
    }
    /**
     * Signal emitted for debug event messages.
     */
    get eventMessage() {
        return this._eventMessage;
    }
    /**
     * Dispose the debug session.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._disposed.emit();
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Start a new debug session
     */
    async start() {
        var _a, _b, _c, _d;
        const initializeResponse = await this.sendRequest('initialize', {
            clientID: 'jupyterlab',
            clientName: 'JupyterLab',
            adapterID: (_c = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '',
            pathFormat: 'path',
            linesStartAt1: true,
            columnsStartAt1: true,
            supportsVariableType: true,
            supportsVariablePaging: true,
            supportsRunInTerminalRequest: true,
            locale: document.documentElement.lang
        });
        if (!initializeResponse.success) {
            throw new Error(`Could not start the debugger: ${initializeResponse.message}`);
        }
        this._capabilities = initializeResponse.body;
        this._isStarted = true;
        this._exceptionBreakpointFilters =
            (_d = initializeResponse.body) === null || _d === void 0 ? void 0 : _d.exceptionBreakpointFilters;
        await this.sendRequest('attach', {});
    }
    /**
     * Stop the running debug session.
     */
    async stop() {
        this._isStarted = false;
        await this.sendRequest('disconnect', {
            restart: false,
            terminateDebuggee: false
        });
    }
    /**
     * Restore the state of a debug session.
     */
    async restoreState() {
        var _a;
        const message = await this.sendRequest('debugInfo', {});
        this._isStarted = message.body.isStarted;
        this._exceptionPaths = (_a = message.body) === null || _a === void 0 ? void 0 : _a.exceptionPaths;
        return message;
    }
    /**
     * Whether the debugger is pausing on exception.
     *
     * @param filter - Specify a filter
     */
    isPausingOnException(filter) {
        var _a, _b;
        if (filter) {
            return (_b = (_a = this.currentExceptionFilters) === null || _a === void 0 ? void 0 : _a.includes(filter)) !== null && _b !== void 0 ? _b : false;
        }
        else {
            return this.currentExceptionFilters.length > 0;
        }
    }
    /**
     * Send a custom debug request to the kernel.
     *
     * @param command debug command.
     * @param args arguments for the debug command.
     */
    async sendRequest(command, args) {
        await this._ready.promise;
        const message = await this._sendDebugMessage({
            type: 'request',
            seq: this._seq++,
            command,
            arguments: args
        });
        return message.content;
    }
    /**
     * Handle debug events sent on the 'iopub' channel.
     *
     * @param sender - the emitter of the event.
     * @param message - the event message.
     */
    _handleEvent(sender, message) {
        const msgType = message.header.msg_type;
        if (msgType !== 'debug_event') {
            return;
        }
        const event = message.content;
        this._eventMessage.emit(event);
    }
    /**
     * Send a debug request message to the kernel.
     *
     * @param msg debug request message to send to the kernel.
     */
    async _sendDebugMessage(msg) {
        var _a;
        const kernel = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!kernel) {
            return Promise.reject(new Error('A kernel is required to send debug messages.'));
        }
        const reply = new coreutils_dist_index_js_.PromiseDelegate();
        const future = kernel.requestDebug(msg);
        future.onReply = (msg) => {
            reply.resolve(msg);
        };
        await future.done;
        return reply.promise;
    }
}
//# sourceMappingURL=session.js.map
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/breakpoints/body.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * The body for a Breakpoints Panel.
 */
class BreakpointsBody extends index_js_.ReactWidget {
    /**
     * Instantiate a new Body for the Breakpoints Panel.
     *
     * @param model The model for the breakpoints.
     */
    constructor(model, translator = translation_lib_index_js_.nullTranslator) {
        super();
        this._model = model;
        this._translator = translator;
        this.addClass('jp-DebuggerBreakpoints-body');
    }
    render() {
        return (react_index_js_default().createElement(BreakpointsComponent, { model: this._model, translator: this._translator }));
    }
}
/**
 * A React component to display a list of breakpoints.
 *
 * @param {object} props The component props.
 * @param props.model The model for the breakpoints.
 * @returns A JSX element.
 */
const BreakpointsComponent = ({ model, translator }) => {
    const trans = translator.load('jupyterlab');
    const [breakpoints, setBreakpoints] = (0,react_index_js_.useState)(Array.from(model.breakpoints.entries()));
    const [selectedBreakpoint, setSelectedBreakpoint] = (0,react_index_js_.useState)(null);
    (0,react_index_js_.useEffect)(() => {
        const updateBreakpoints = (_, updates) => {
            setBreakpoints(Array.from(model.breakpoints.entries()));
        };
        const restoreBreakpoints = (_) => {
            setBreakpoints(Array.from(model.breakpoints.entries()));
        };
        const handleClick = (_, breakpoint) => {
            model.selectedBreakpoint = breakpoint;
        };
        const handleSelectedChanged = (_) => {
            setSelectedBreakpoint(model.selectedBreakpoint);
        };
        model.changed.connect(updateBreakpoints);
        model.restored.connect(restoreBreakpoints);
        model.clicked.connect(handleClick);
        model.selectedChanged.connect(handleSelectedChanged);
        return () => {
            model.changed.disconnect(updateBreakpoints);
            model.restored.disconnect(restoreBreakpoints);
            model.clicked.disconnect(handleClick);
            model.selectedChanged.disconnect(() => handleSelectedChanged);
        };
    });
    return (react_index_js_default().createElement((react_index_js_default()).Fragment, null, breakpoints.map(entry => (react_index_js_default().createElement(BreakpointCellComponent, { key: entry[0], breakpoints: entry[1], model: model, selectedBreakpoint: selectedBreakpoint, trans: trans })))));
};
/**
 * A React Component to display breakpoints grouped by source file.
 *
 * @param {object} props The component props.
 * @param props.breakpoints The list of breakpoints.
 * @param props.model The model for the breakpoints.
 * @returns A JSX element.
 */
const BreakpointCellComponent = ({ breakpoints, model, selectedBreakpoint, trans }) => {
    return (react_index_js_default().createElement((react_index_js_default()).Fragment, null, breakpoints
        .sort((a, b) => {
        var _a, _b;
        return ((_a = a.line) !== null && _a !== void 0 ? _a : 0) - ((_b = b.line) !== null && _b !== void 0 ? _b : 0);
    })
        .map((breakpoint, index) => {
        var _a, _b, _c, _d;
        return (react_index_js_default().createElement(BreakpointComponent, { key: ((_b = (_a = breakpoint.source) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : '') + index, breakpoint: breakpoint, model: model, isSelected: (selectedBreakpoint === null || selectedBreakpoint === void 0 ? void 0 : selectedBreakpoint.line) === breakpoint.line &&
                ((_c = selectedBreakpoint === null || selectedBreakpoint === void 0 ? void 0 : selectedBreakpoint.source) === null || _c === void 0 ? void 0 : _c.path) === ((_d = breakpoint.source) === null || _d === void 0 ? void 0 : _d.path), trans: trans }));
    })));
};
/**
 * A React Component to display a single breakpoint.
 *
 * @param {object} props The component props.
 * @param props.breakpoint The breakpoint.
 * @param props.model The model for the breakpoints.
 * @returns A JSX element.
 */
const BreakpointComponent = ({ breakpoint, model, isSelected, trans }) => {
    var _a;
    const display = model.getDisplayName(breakpoint);
    return (react_index_js_default().createElement("div", { className: "jp-DebuggerBreakpoint", onClick: () => model.clicked.emit(breakpoint), title: (_a = breakpoint.source) === null || _a === void 0 ? void 0 : _a.path },
        react_index_js_default().createElement("span", { className: "jp-DebuggerBreakpoint-container" }, !isSelected ? (react_index_js_default().createElement(index_js_.breakpointIcon.react, { "aria-label": trans.__('Breakpoint') })) : (react_index_js_default().createElement(index_js_.selectedBreakpointIcon.react, { "aria-label": trans.__('Selected breakpoint') }))),
        react_index_js_default().createElement("span", { className: 'jp-DebuggerBreakpoint-source jp-left-truncated' }, display),
        react_index_js_default().createElement("span", { className: "jp-DebuggerBreakpoint-line" }, breakpoint.line)));
};
//# sourceMappingURL=body.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/breakpoints/pauseonexceptions.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


const PAUSE_ON_EXCEPTION_CLASS = 'jp-debugger-pauseOnExceptions';
const PAUSE_ON_EXCEPTION_BUTTON_CLASS = 'jp-PauseOnExceptions';
const PAUSE_ON_EXCEPTION_MENU_CLASS = 'jp-PauseOnExceptions-menu';
/**
 * A button which display a menu on click, to select the filter.
 */
class PauseOnExceptionsWidget extends index_js_.ToolbarButton {
    /**
     * Constructor of the button.
     */
    constructor(props) {
        super();
        /**
         * open menu on click.
         */
        this.onclick = () => {
            this._menu.open(this.node.getBoundingClientRect().left, this.node.getBoundingClientRect().bottom);
        };
        this._menu = new PauseOnExceptionsMenu({
            service: props.service,
            commands: {
                registry: props.commands.registry,
                pauseOnExceptions: props.commands.pauseOnExceptions
            }
        });
        this.node.className = PAUSE_ON_EXCEPTION_CLASS;
        this._props = props;
        this._props.className = PAUSE_ON_EXCEPTION_BUTTON_CLASS;
        this._props.service.eventMessage.connect((_, event) => {
            if (event.event === 'initialized' || event.event === 'terminated') {
                this.onChange();
            }
        }, this);
        this._props.enabled = this._props.service.pauseOnExceptionsIsValid();
        this._props.service.pauseOnExceptionChanged.connect(this.onChange, this);
    }
    /**
     * Called when the debugger is initialized or the filter changed.
     */
    onChange() {
        var _a;
        const session = this._props.service.session;
        const exceptionBreakpointFilters = session === null || session === void 0 ? void 0 : session.exceptionBreakpointFilters;
        this._props.className = PAUSE_ON_EXCEPTION_BUTTON_CLASS;
        if (((_a = this._props.service.session) === null || _a === void 0 ? void 0 : _a.isStarted) && exceptionBreakpointFilters) {
            this._props.pressed = session.isPausingOnException();
            this._props.enabled = true;
        }
        else {
            this._props.enabled = false;
        }
        this.update();
    }
    render() {
        return react_index_js_.createElement(index_js_.ToolbarButtonComponent, { ...this._props, onClick: this.onclick });
    }
}
/**
 * A menu with all the available filter from the debugger as entries.
 */
class PauseOnExceptionsMenu extends index_js_.MenuSvg {
    /**
     * The constructor of the menu.
     */
    constructor(props) {
        super({ commands: props.commands.registry });
        this._service = props.service;
        this._command = props.commands.pauseOnExceptions;
        props.service.eventMessage.connect((_, event) => {
            if (event.event === 'initialized') {
                this._build();
            }
        }, this);
        this._build();
        this.addClass(PAUSE_ON_EXCEPTION_MENU_CLASS);
    }
    _build() {
        var _a, _b;
        this.clearItems();
        const exceptionsBreakpointFilters = (_b = (_a = this._service.session) === null || _a === void 0 ? void 0 : _a.exceptionBreakpointFilters) !== null && _b !== void 0 ? _b : [];
        exceptionsBreakpointFilters.map((filter, _) => {
            this.addItem({
                command: this._command,
                args: {
                    filter: filter.filter,
                    description: filter.description
                }
            });
        });
    }
}
//# sourceMappingURL=pauseonexceptions.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/breakpoints/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * A Panel to show a list of breakpoints.
 */
class Breakpoints extends index_js_.PanelWithToolbar {
    /**
     * Instantiate a new Breakpoints Panel.
     *
     * @param options The instantiation options for a Breakpoints Panel.
     */
    constructor(options) {
        var _a;
        super(options);
        this.clicked = new dist_index_es6_js_.Signal(this);
        const { model, service, commands } = options;
        const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.title.label = trans.__('Breakpoints');
        const body = new BreakpointsBody(model);
        this.toolbar.node.setAttribute('aria-label', trans.__('Breakpoints panel toolbar'));
        this.toolbar.addItem('pauseOnException', new PauseOnExceptionsWidget({
            service: service,
            commands: commands,
            icon: index_js_.exceptionsIcon,
            tooltip: trans.__('Pause on exception filter')
        }));
        this.toolbar.addItem('closeAll', new index_js_.ToolbarButton({
            icon: index_js_.closeAllIcon,
            onClick: async () => {
                if (model.breakpoints.size === 0) {
                    return;
                }
                const result = await (0,lib_index_js_.showDialog)({
                    title: trans.__('Remove All Breakpoints'),
                    body: trans.__('Are you sure you want to remove all breakpoints?'),
                    buttons: [
                        lib_index_js_.Dialog.okButton({ label: trans.__('Remove breakpoints') }),
                        lib_index_js_.Dialog.cancelButton()
                    ],
                    hasClose: true
                });
                if (result.button.accept) {
                    return service.clearBreakpoints();
                }
            },
            tooltip: trans.__('Remove All Breakpoints')
        }));
        this.addWidget(body);
        this.addClass('jp-DebuggerBreakpoints');
    }
}
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/callstack/body.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * The body for a Callstack Panel.
 */
class CallstackBody extends index_js_.ReactWidget {
    /**
     * Instantiate a new Body for the Callstack Panel.
     *
     * @param model The model for the callstack.
     */
    constructor(model) {
        super();
        this._model = model;
        this.addClass('jp-DebuggerCallstack-body');
    }
    /**
     * Render the FramesComponent.
     */
    render() {
        return react_index_js_default().createElement(FramesComponent, { model: this._model });
    }
}
/**
 * A React component to display a list of frames in a callstack.
 *
 * @param {object} props The component props.
 * @param props.model The model for the callstack.
 * @returns A JSX element.
 */
const FramesComponent = ({ model }) => {
    const [frames, setFrames] = (0,react_index_js_.useState)(model.frames);
    const [selected, setSelected] = (0,react_index_js_.useState)(model.frame);
    const onSelected = (frame) => {
        setSelected(frame);
        model.frame = frame;
    };
    (0,react_index_js_.useEffect)(() => {
        const updateFrames = () => {
            setSelected(model.frame);
            setFrames(model.frames);
        };
        model.framesChanged.connect(updateFrames);
        return () => {
            model.framesChanged.disconnect(updateFrames);
        };
    }, [model]);
    return (react_index_js_default().createElement("ul", null, frames.map(ele => {
        var _a, _b, _c, _d;
        return (react_index_js_default().createElement("li", { key: ele.id, onClick: () => onSelected(ele), className: (selected === null || selected === void 0 ? void 0 : selected.id) === ele.id
                ? 'selected jp-DebuggerCallstackFrame'
                : 'jp-DebuggerCallstackFrame' },
            react_index_js_default().createElement("span", { className: 'jp-DebuggerCallstackFrame-name' }, ele.name),
            react_index_js_default().createElement("span", { className: 'jp-DebuggerCallstackFrame-location', title: (_a = ele.source) === null || _a === void 0 ? void 0 : _a.path }, (_c = (_b = model.getDisplayName) === null || _b === void 0 ? void 0 : _b.call(model, ele)) !== null && _c !== void 0 ? _c : (_d = ele.source) === null || _d === void 0 ? void 0 : _d.path)));
    })));
};
//# sourceMappingURL=body.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/callstack/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A Panel to show a callstack.
 */
class Callstack extends index_js_.PanelWithToolbar {
    /**
     * Instantiate a new Callstack Panel.
     *
     * @param options The instantiation options for a Callstack Panel.
     */
    constructor(options) {
        var _a;
        super(options);
        const { commands, model } = options;
        const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.title.label = trans.__('Callstack');
        const body = new CallstackBody(model);
        this.toolbar.node.setAttribute('aria-label', trans.__('Callstack panel toolbar'));
        this.toolbar.addItem('continue', new index_js_.CommandToolbarButton({
            commands: commands.registry,
            id: commands.continue,
            label: ''
        }));
        this.toolbar.addItem('terminate', new index_js_.CommandToolbarButton({
            commands: commands.registry,
            id: commands.terminate,
            label: ''
        }));
        this.toolbar.addItem('step-over', new index_js_.CommandToolbarButton({
            commands: commands.registry,
            id: commands.next,
            label: ''
        }));
        this.toolbar.addItem('step-in', new index_js_.CommandToolbarButton({
            commands: commands.registry,
            id: commands.stepIn,
            label: ''
        }));
        this.toolbar.addItem('step-out', new index_js_.CommandToolbarButton({
            commands: commands.registry,
            id: commands.stepOut,
            label: ''
        }));
        this.toolbar.addItem('evaluate', new index_js_.CommandToolbarButton({
            commands: commands.registry,
            id: commands.evaluate,
            label: ''
        }));
        this.addWidget(body);
        this.addClass('jp-DebuggerCallstack');
    }
}
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/sources/body.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * The body for a Sources Panel.
 */
class SourcesBody extends index_es6_js_.Widget {
    /**
     * Instantiate a new Body for the SourcesBody widget.
     *
     * @param options The instantiation options for a SourcesBody.
     */
    constructor(options) {
        super();
        this._model = options.model;
        this._debuggerService = options.service;
        this._mimeTypeService = options.editorServices.mimeTypeService;
        const factory = new Debugger.ReadOnlyEditorFactory({
            editorServices: options.editorServices
        });
        this._editor = factory.createNewEditor({
            content: '',
            mimeType: '',
            path: ''
        });
        this._editor.hide();
        this._model.currentFrameChanged.connect(async (_, frame) => {
            if (!frame) {
                this._clearEditor();
                return;
            }
            void this._showSource(frame);
        });
        const layout = new index_es6_js_.PanelLayout();
        layout.addWidget(this._editor);
        this.layout = layout;
        this.addClass('jp-DebuggerSources-body');
    }
    /**
     * Dispose the sources body widget.
     */
    dispose() {
        var _a;
        if (this.isDisposed) {
            return;
        }
        (_a = this._editorHandler) === null || _a === void 0 ? void 0 : _a.dispose();
        dist_index_es6_js_.Signal.clearData(this);
        super.dispose();
    }
    /**
     * Clear the content of the source read-only editor.
     */
    _clearEditor() {
        this._model.currentSource = null;
        this._editor.hide();
    }
    /**
     * Show the content of the source for the given frame.
     *
     * @param frame The current frame.
     */
    async _showSource(frame) {
        var _a, _b, _c, _d, _e;
        const displayPath = this._model.getDisplayName(frame);
        const source = await this._debuggerService.getSource({
            sourceReference: 0,
            path: (_a = frame.source) === null || _a === void 0 ? void 0 : _a.path
        });
        if (!(source === null || source === void 0 ? void 0 : source.content)) {
            this._clearEditor();
            return;
        }
        if (this._editorHandler) {
            this._editorHandler.dispose();
        }
        const { content, mimeType } = source;
        const editorMimeType = mimeType ||
            this._mimeTypeService.getMimeTypeByFilePath((_c = (_b = frame.source) === null || _b === void 0 ? void 0 : _b.path) !== null && _c !== void 0 ? _c : '');
        this._editor.model.sharedModel.setSource(content);
        this._editor.model.mimeType = editorMimeType;
        this._editorHandler = new editor_EditorHandler({
            debuggerService: this._debuggerService,
            editorReady: () => Promise.resolve(this._editor.editor),
            getEditor: () => this._editor.editor,
            path: (_e = (_d = frame.source) === null || _d === void 0 ? void 0 : _d.path) !== null && _e !== void 0 ? _e : '',
            src: this._editor.model.sharedModel
        });
        this._model.currentSource = {
            content,
            mimeType: editorMimeType,
            path: displayPath
        };
        requestAnimationFrame(() => {
            editor_EditorHandler.showCurrentLine(this._editor.editor, frame.line, 'start');
        });
        this._editor.show();
    }
}
//# sourceMappingURL=body.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/sources/sourcepath.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A React component to display the path to a source.
 *
 * @param {object} props The component props.
 * @param props.model The model for the sources.
 */
const SourcePathComponent = ({ model, trans }) => {
    return (react_index_js_default().createElement(index_js_.UseSignal, { signal: model.currentSourceChanged, initialSender: model }, (model) => {
        var _a, _b;
        return (react_index_js_default().createElement("span", { onClick: (event) => {
                if (event.ctrlKey) {
                    model === null || model === void 0 ? void 0 : model.open();
                }
            }, title: trans.__('Ctrl + click to open in the Main Area'), className: "jp-DebuggerSources-header-path" }, (_b = (_a = model === null || model === void 0 ? void 0 : model.currentSource) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : ''));
    }));
};
//# sourceMappingURL=sourcepath.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/sources/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/





/**
 * A Panel that shows a preview of the source code while debugging.
 */
class Sources extends index_js_.PanelWithToolbar {
    /**
     * Instantiate a new Sources preview Panel.
     *
     * @param options The Sources instantiation options.
     */
    constructor(options) {
        var _a;
        super();
        const { model, service, editorServices } = options;
        const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.title.label = trans.__('Source');
        this.toolbar.addClass('jp-DebuggerSources-header');
        this.toolbar.node.setAttribute('aria-label', trans.__('Sources preview panel toolbar'));
        const body = new SourcesBody({
            service,
            model,
            editorServices
        });
        this.toolbar.addItem('open', new index_js_.ToolbarButton({
            icon: index_js_.viewBreakpointIcon,
            onClick: () => model.open(),
            tooltip: trans.__('Open in the Main Area')
        }));
        const sourcePath = index_js_.ReactWidget.create(react_index_js_default().createElement(SourcePathComponent, { model: model, trans: trans }));
        this.toolbar.addItem('sourcePath', sourcePath);
        this.addClass('jp-DebuggerSources-header');
        this.addWidget(body);
        this.addClass('jp-DebuggerSources');
    }
}
//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyter/react-components@~0.16.7 (singleton) (fallback: ../node_modules/@jupyter/react-components/lib/index.js)
var react_components_lib_index_js_ = __webpack_require__(75816);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/kernelSources/filter.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



const FilterBox = (props) => {
    const onFilterChange = (e) => {
        const filter = e.target.value;
        props.model.filter = filter;
    };
    return (react_index_js_default().createElement(react_components_lib_index_js_.Search, { onChange: onFilterChange, placeholder: props.trans.__('Filter the kernel sources'), value: props.model.filter }));
};
/**
 * A widget which hosts a input textbox to filter on file names.
 */
const KernelSourcesFilter = (props) => {
    return (react_index_js_default().createElement(index_js_.UseSignal, { signal: props.model.filterChanged, initialArgs: props.model.filter }, model => react_index_js_default().createElement(FilterBox, { model: props.model, trans: props.trans })));
};
//# sourceMappingURL=filter.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/kernelSources/body.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * The class name added to the filterbox node.
 */
const FILTERBOX_CLASS = 'jp-DebuggerKernelSource-filterBox';
/**
 * The class name added to hide the filterbox node.
 */
const FILTERBOX_HIDDEN_CLASS = 'jp-DebuggerKernelSource-filterBox-hidden';
/**
 * The class for each source row.
 */
const SOURCE_CLASS = 'jp-DebuggerKernelSource-source';
/**
 * The body for a Sources Panel.
 */
class KernelSourcesBody extends index_js_.ReactWidget {
    /**
     * Instantiate a new Body for the KernelSourcesBody widget.
     *
     * @param options The instantiation options for a KernelSourcesBody.
     */
    constructor(options) {
        var _a;
        super();
        this._showFilter = false;
        this._model = options.model;
        this._debuggerService = options.service;
        this._trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.addClass('jp-DebuggerKernelSources-body');
    }
    render() {
        let filterClass = FILTERBOX_CLASS;
        if (!this._showFilter) {
            filterClass += ' ' + FILTERBOX_HIDDEN_CLASS;
        }
        return (react_index_js_default().createElement((react_index_js_default()).Fragment, null,
            react_index_js_default().createElement("div", { className: filterClass, key: 'filter' },
                react_index_js_default().createElement(KernelSourcesFilter, { model: this._model, trans: this._trans })),
            react_index_js_default().createElement(index_js_.UseSignal, { signal: this._model.changed }, (_, kernelSources) => {
                const keymap = {};
                return (kernelSources !== null && kernelSources !== void 0 ? kernelSources : []).map(module => {
                    var _a;
                    const name = module.name;
                    const path = module.path;
                    const key = name + (keymap[name] = ((_a = keymap[name]) !== null && _a !== void 0 ? _a : 0) + 1).toString();
                    return (react_index_js_default().createElement("div", { key: key, title: path, className: SOURCE_CLASS, onClick: () => {
                            this._debuggerService
                                .getSource({
                                sourceReference: 0,
                                path: path
                            })
                                .then(source => {
                                this._model.open(source);
                            })
                                .catch(reason => {
                                void (0,lib_index_js_.showErrorMessage)(this._trans.__('Fail to get source'), this._trans.__("Fail to get '%1' source:\n%2", path, reason));
                            });
                        } },
                        react_index_js_default().createElement(index_js_.LabIcon.resolveReact, { icon: index_js_.openKernelSourceIcon, iconClass: (0,index_js_.classes)('jp-Icon'), tag: null }),
                        name));
                });
            })));
    }
    /**
     * Show or hide the filter box.
     */
    toggleFilterbox() {
        this._showFilter = !this._showFilter;
        this.update();
    }
}
//# sourceMappingURL=body.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/kernelSources/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A Panel that shows a preview of the source code while debugging.
 */
class KernelSources extends index_js_.PanelWithToolbar {
    /**
     * Instantiate a new Sources preview Panel.
     *
     * @param options The Sources instantiation options.
     */
    constructor(options) {
        var _a;
        super();
        const { model, service } = options;
        this._model = model;
        const trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.title.label = trans.__('Kernel Sources');
        this.toolbar.addClass('jp-DebuggerKernelSources-header');
        this.toolbar.node.setAttribute('aria-label', trans.__('Kernel sources panel toolbar'));
        this._body = new KernelSourcesBody({
            service,
            model,
            translator: options.translator
        });
        this.toolbar.addItem('open-filter', new index_js_.ToolbarButton({
            icon: index_js_.searchIcon,
            onClick: async () => {
                this._body.toggleFilterbox();
            },
            tooltip: trans.__('Toggle search filter')
        }));
        this.toolbar.addItem('refresh', new index_js_.ToolbarButton({
            icon: index_js_.refreshIcon,
            onClick: () => {
                this._model.kernelSources = [];
                void service.displayModules().catch(reason => {
                    void (0,lib_index_js_.showErrorMessage)(trans.__('Fail to get kernel sources'), trans.__('Fail to get kernel sources:\n%2', reason));
                });
            },
            tooltip: trans.__('Refresh kernel sources')
        }));
        this.addClass('jp-DebuggerKernelSources-header');
        this.addWidget(this._body);
        this.addClass('jp-DebuggerKenelSources');
    }
    set filter(filter) {
        this._model.filter = filter;
    }
}
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/variables/scope.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * A React component to handle scope changes.
 *
 * @param {object} props The component props.
 * @param props.model The variables model.
 * @param props.tree The variables tree widget.
 * @param props.grid The variables grid widget.
 * @param props.trans The translation bundle.
 */
const ScopeSwitcherComponent = ({ model, tree, grid, trans }) => {
    const [value, setValue] = (0,react_index_js_.useState)('-');
    const scopes = model.scopes;
    const onChange = (event) => {
        const value = event.target.value;
        setValue(value);
        tree.scope = value;
        grid.scope = value;
    };
    return (react_index_js_default().createElement(index_js_.HTMLSelect, { onChange: onChange, value: value, "aria-label": trans.__('Scope') }, scopes.map(scope => (react_index_js_default().createElement("option", { key: scope.name, value: scope.name }, trans.__(scope.name))))));
};
/**
 * A widget to switch between scopes.
 */
class ScopeSwitcher extends index_js_.ReactWidget {
    /**
     * Instantiate a new scope switcher.
     *
     * @param options The instantiation options for a ScopeSwitcher
     */
    constructor(options) {
        super();
        const { translator, model, tree, grid } = options;
        this._model = model;
        this._tree = tree;
        this._grid = grid;
        this._trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
    }
    /**
     * Render the scope switcher.
     */
    render() {
        return (react_index_js_default().createElement(index_js_.UseSignal, { signal: this._model.changed, initialSender: this._model }, () => (react_index_js_default().createElement(ScopeSwitcherComponent, { model: this._model, trans: this._trans, tree: this._tree, grid: this._grid }))));
    }
}
//# sourceMappingURL=scope.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/variables/tree.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * The body for tree of variables.
 */
class VariablesBodyTree extends index_js_.ReactWidget {
    /**
     * Instantiate a new Body for the tree of variables.
     *
     * @param options The instantiation options for a VariablesBodyTree.
     */
    constructor(options) {
        super();
        this._scope = '';
        this._scopes = [];
        this._filter = new Set();
        this._commands = options.commands;
        this._service = options.service;
        this._translator = options.translator;
        const model = (this.model = options.model);
        model.changed.connect(this._updateScopes, this);
        this.addClass('jp-DebuggerVariables-body');
    }
    /**
     * Render the VariablesBodyTree.
     */
    render() {
        var _a;
        const scope = (_a = this._scopes.find(scope => scope.name === this._scope)) !== null && _a !== void 0 ? _a : this._scopes[0];
        const handleSelectVariable = (variable) => {
            this.model.selectedVariable = variable;
        };
        if ((scope === null || scope === void 0 ? void 0 : scope.name) !== 'Globals') {
            this.addClass('jp-debuggerVariables-local');
        }
        else {
            this.removeClass('jp-debuggerVariables-local');
        }
        return scope ? (react_index_js_default().createElement((react_index_js_default()).Fragment, null,
            react_index_js_default().createElement(react_components_lib_index_js_.TreeView, { className: "jp-TreeView" },
                react_index_js_default().createElement(VariablesBranch, { key: scope.name, commands: this._commands, service: this._service, data: scope.variables, filter: this._filter, translator: this._translator, handleSelectVariable: handleSelectVariable })))) : (react_index_js_default().createElement("div", null));
    }
    /**
     * Set the variable filter list.
     */
    set filter(filter) {
        this._filter = filter;
        this.update();
    }
    /**
     * Set the current scope
     */
    set scope(scope) {
        this._scope = scope;
        this.update();
    }
    /**
     * Update the scopes and the tree of variables.
     *
     * @param model The variables model.
     */
    _updateScopes(model) {
        if (algorithm_dist_index_es6_js_.ArrayExt.shallowEqual(this._scopes, model.scopes)) {
            return;
        }
        this._scopes = model.scopes;
        this.update();
    }
}
/**
 * A React component to display a list of variables.
 *
 * @param {object} props The component props.
 * @param props.data An array of variables.
 * @param props.service The debugger service.
 * @param props.filter Optional variable filter list.
 */
const VariablesBranch = (props) => {
    const { commands, data, service, filter, translator, handleSelectVariable } = props;
    const [variables, setVariables] = (0,react_index_js_.useState)(data);
    (0,react_index_js_.useEffect)(() => {
        setVariables(data);
    }, [data]);
    return (react_index_js_default().createElement((react_index_js_default()).Fragment, null, variables
        .filter(variable => !(filter || new Set()).has(variable.evaluateName || ''))
        .map(variable => {
        const key = `${variable.name}-${variable.evaluateName}-${variable.type}-${variable.value}-${variable.variablesReference}`;
        return (react_index_js_default().createElement(VariableComponent, { key: key, commands: commands, data: variable, service: service, filter: filter, translator: translator, onSelect: handleSelectVariable }));
    })));
};
function _prepareDetail(variable) {
    if (variable.type === 'float' &&
        (variable.value == 'inf' || variable.value == '-inf')) {
        return variable.value;
    }
    const detail = convertType(variable);
    if (variable.type === 'float' && isNaN(detail)) {
        // silence React warning:
        // `Received NaN for the `children` attribute. If this is expected, cast the value to a string`
        return 'NaN';
    }
    return detail;
}
/**
 * A React component to display one node variable in tree.
 *
 * @param {object} props The component props.
 * @param props.data An array of variables.
 * @param props.service The debugger service.
 * @param props.filter Optional variable filter list.
 */
const VariableComponent = (props) => {
    var _a, _b;
    const { commands, data, service, filter, translator, onSelect } = props;
    const [variable] = (0,react_index_js_.useState)(data);
    const [showDetailsButton, setShowDetailsButton] = (0,react_index_js_.useState)(false);
    const [expanded, setExpanded] = (0,react_index_js_.useState)(false);
    const [variables, setVariables] = (0,react_index_js_.useState)(null);
    const trans = (0,react_index_js_.useMemo)(() => (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab'), [translator]);
    const onSelection = onSelect !== null && onSelect !== void 0 ? onSelect : (() => void 0);
    const expandable = (0,react_index_js_.useMemo)(() => variable.variablesReference !== 0 || variable.type === 'function', [variable.variablesReference, variable.type]);
    const details = (0,react_index_js_.useMemo)(() => _prepareDetail(variable), [variable]);
    const hasMimeRenderer = (0,react_index_js_.useMemo)(() => ![
        'special variables',
        'protected variables',
        'function variables',
        'class variables'
    ].includes(variable.name), [variable.name]);
    const disableMimeRenderer = (0,react_index_js_.useMemo)(() => {
        var _a;
        return !service.model.hasRichVariableRendering ||
            !commands.isEnabled(Debugger.CommandIDs.renderMimeVariable, {
                name: variable.name,
                frameID: (_a = service.model.callstack.frame) === null || _a === void 0 ? void 0 : _a.id
            });
    }, [
        service.model.hasRichVariableRendering,
        variable.name,
        (_a = service.model.callstack.frame) === null || _a === void 0 ? void 0 : _a.id
    ]);
    const fetchChildren = (0,react_index_js_.useCallback)(async () => {
        if (expandable && !variables) {
            setVariables(await service.inspectVariable(variable.variablesReference));
        }
    }, [expandable, service, variable.variablesReference, variables]);
    const onVariableClicked = (0,react_index_js_.useCallback)(async (event) => {
        const item = (0,index_js_.getTreeItemElement)(event.target);
        if (event.currentTarget !== item) {
            return;
        }
        if (!expandable) {
            return;
        }
        setExpanded(!expanded);
    }, [expandable, expanded]);
    const onSelectChange = (0,react_index_js_.useCallback)((event) => {
        if (event.currentTarget === event.detail && event.detail.selected) {
            onSelection(variable);
        }
    }, [variable]);
    const renderVariable = (0,react_index_js_.useCallback)(() => {
        var _a;
        commands
            .execute(Debugger.CommandIDs.renderMimeVariable, {
            name: variable.name,
            frameID: (_a = service.model.callstack.frame) === null || _a === void 0 ? void 0 : _a.id
        })
            .catch(reason => {
            console.error(`Failed to render variable ${variable === null || variable === void 0 ? void 0 : variable.name}`, reason);
        });
    }, [commands, variable.name, (_b = service.model.callstack.frame) === null || _b === void 0 ? void 0 : _b.id]);
    const onContextMenu = (0,react_index_js_.useCallback)((event) => {
        const item = (0,index_js_.getTreeItemElement)(event.target);
        if (event.currentTarget !== item) {
            return;
        }
        onSelection(variable);
    }, [variable]);
    return (react_index_js_default().createElement(react_components_lib_index_js_.TreeItem, { className: "jp-TreeItem nested", expanded: expanded, onSelect: onSelectChange, onExpand: fetchChildren, onClick: (e) => onVariableClicked(e), onContextMenu: onContextMenu, onKeyDown: event => {
            if (event.key == 'Enter') {
                if (hasMimeRenderer && showDetailsButton) {
                    onSelection(variable);
                    renderVariable();
                }
            }
        }, onFocus: event => {
            setShowDetailsButton(!event.defaultPrevented);
            event.preventDefault();
        }, onBlur: event => {
            setShowDetailsButton(false);
        }, onMouseOver: (event) => {
            setShowDetailsButton(!event.defaultPrevented);
            event.preventDefault();
        }, onMouseLeave: (event) => {
            setShowDetailsButton(false);
        } },
        react_index_js_default().createElement("span", { className: "jp-DebuggerVariables-name" }, variable.name),
        details != null && (react_index_js_default().createElement("span", { className: "jp-DebuggerVariables-detail" }, details)),
        hasMimeRenderer && showDetailsButton && (react_index_js_default().createElement(react_components_lib_index_js_.Button, { className: "jp-DebuggerVariables-renderVariable", appearance: "stealth", slot: "end", disabled: disableMimeRenderer, onClick: e => {
                e.stopPropagation();
                renderVariable();
            }, title: trans.__('Render variable: %1', variable === null || variable === void 0 ? void 0 : variable.name) },
            react_index_js_default().createElement(index_js_.searchIcon.react, { tag: null }))),
        variables ? (react_index_js_default().createElement(VariablesBranch, { key: variable.name, commands: commands, data: variables, service: service, filter: filter, translator: translator, handleSelectVariable: onSelect })) : (
        /* Trick to ensure collapse button is displayed
           when variables are not loaded yet */
        expandable && react_index_js_default().createElement(react_components_lib_index_js_.TreeItem, null))));
};
//# sourceMappingURL=tree.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/panels/variables/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * A Panel to show a variable explorer.
 */
class Variables extends index_js_.PanelWithToolbar {
    /**
     * Instantiate a new Variables Panel.
     *
     * @param options The instantiation options for a Variables Panel.
     */
    constructor(options) {
        super(options);
        const { model, service, commands, themeManager } = options;
        const translator = options.translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        this.title.label = trans.__('Variables');
        this.toolbar.addClass('jp-DebuggerVariables-toolbar');
        this.toolbar.node.setAttribute('aria-label', trans.__('Variables toolbar'));
        this._tree = new VariablesBodyTree({
            model,
            service,
            commands,
            translator
        });
        this._table = new VariablesBodyGrid({
            model,
            commands,
            themeManager,
            translator
        });
        this._table.hide();
        this.toolbar.addItem('scope-switcher', new ScopeSwitcher({
            translator,
            model,
            tree: this._tree,
            grid: this._table
        }));
        const onViewChange = () => {
            if (this._table.isHidden) {
                this._tree.hide();
                this._table.show();
                this.node.setAttribute('data-jp-table', 'true');
                markViewButtonSelection('table');
            }
            else {
                this._tree.show();
                this._table.hide();
                this.node.removeAttribute('data-jp-table');
                markViewButtonSelection('tree');
            }
            this.update();
        };
        const treeViewButton = new index_js_.ToolbarButton({
            icon: index_js_.treeViewIcon,
            className: 'jp-TreeView-Button',
            onClick: onViewChange,
            tooltip: trans.__('Tree View')
        });
        const tableViewButton = new index_js_.ToolbarButton({
            icon: index_js_.tableRowsIcon,
            className: 'jp-TableView-Button',
            onClick: onViewChange,
            tooltip: trans.__('Table View')
        });
        const markViewButtonSelection = (selectedView) => {
            tableViewButton.pressed = selectedView !== 'tree';
            treeViewButton.pressed = !tableViewButton.pressed;
        };
        markViewButtonSelection(this._table.isHidden ? 'tree' : 'table');
        this.toolbar.addItem('view-VariableTreeView', treeViewButton);
        this.toolbar.addItem('view-VariableTableView', tableViewButton);
        this.addWidget(this._tree);
        this.addWidget(this._table);
        this.addClass('jp-DebuggerVariables');
    }
    /**
     * Set the variable filter for both the tree and table views.
     */
    set filter(filter) {
        this._tree.filter = filter;
        this._table.filter = filter;
    }
    /**
     * A message handler invoked on a `'resize'` message.
     *
     * @param msg The Lumino message to process.
     */
    onResize(msg) {
        super.onResize(msg);
        this._resizeBody(msg);
    }
    /**
     * Resize the body.
     *
     * @param msg The resize message.
     */
    _resizeBody(msg) {
        const height = msg.height - this.toolbar.node.offsetHeight;
        this._tree.node.style.height = `${height}px`;
    }
}
/**
 * Convert a variable to a primitive type.
 *
 * @param variable The variable.
 */
const convertType = (variable) => {
    var _a, _b;
    const { type, value } = variable;
    switch (type) {
        case 'int':
            return parseInt(value, 10);
        case 'float':
            return parseFloat(value);
        case 'bool':
            return value;
        case 'str':
            if ((_b = (_a = variable.presentationHint) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b.includes('rawString')) {
                return value.slice(1, value.length - 1);
            }
            else {
                return value;
            }
        default:
            return type !== null && type !== void 0 ? type : value;
    }
};
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/sidebar.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * A debugger sidebar.
 */
class DebuggerSidebar extends index_js_.SidePanel {
    /**
     * Instantiate a new Debugger.Sidebar
     *
     * @param options The instantiation options for a Debugger.Sidebar
     */
    constructor(options) {
        const translator = options.translator || translation_lib_index_js_.nullTranslator;
        super({ translator });
        this.id = 'jp-debugger-sidebar';
        this.title.icon = index_js_.bugIcon;
        this.addClass('jp-DebuggerSidebar');
        const { callstackCommands, breakpointsCommands, editorServices, service, themeManager } = options;
        const model = service.model;
        this.variables = new Variables({
            model: model.variables,
            commands: callstackCommands.registry,
            service,
            themeManager,
            translator
        });
        this.callstack = new Callstack({
            commands: callstackCommands,
            model: model.callstack,
            translator
        });
        this.breakpoints = new Breakpoints({
            service,
            commands: breakpointsCommands,
            model: model.breakpoints,
            translator
        });
        this.sources = new Sources({
            model: model.sources,
            service,
            editorServices,
            translator
        });
        this.kernelSources = new KernelSources({
            model: model.kernelSources,
            service,
            translator
        });
        const header = new DebuggerSidebar.Header();
        this.header.addWidget(header);
        model.titleChanged.connect((_, title) => {
            header.title.label = title;
        });
        this.content.addClass('jp-DebuggerSidebar-body');
        this.addWidget(this.variables);
        this.addWidget(this.callstack);
        this.addWidget(this.breakpoints);
        this.addWidget(this.sources);
        this.addWidget(this.kernelSources);
    }
}
/**
 * A namespace for DebuggerSidebar statics
 */
(function (DebuggerSidebar) {
    /**
     * The header for a debugger sidebar.
     */
    class Header extends index_es6_js_.Widget {
        /**
         * Instantiate a new sidebar header.
         */
        constructor() {
            super({ node: sidebar_Private.createHeader() });
            this.title.changed.connect(_ => {
                this.node.textContent = this.title.label;
            });
        }
    }
    DebuggerSidebar.Header = Header;
})(DebuggerSidebar || (DebuggerSidebar = {}));
/**
 * A namespace for private module data.
 */
var sidebar_Private;
(function (Private) {
    /**
     * Create a sidebar header node.
     */
    function createHeader() {
        const title = document.createElement('h2');
        title.textContent = '-';
        title.classList.add('jp-text-truncated');
        return title;
    }
    Private.createHeader = createHeader;
})(sidebar_Private || (sidebar_Private = {}));
//# sourceMappingURL=sidebar.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/sources.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * The source and editor manager for a debugger instance.
 */
class DebuggerSources {
    /**
     * Create a new DebuggerSources instance.
     *
     * @param options The instantiation options for a DebuggerSources instance.
     */
    constructor(options) {
        var _a, _b, _c;
        this._config = options.config;
        this._shell = options.shell;
        this._notebookTracker = (_a = options.notebookTracker) !== null && _a !== void 0 ? _a : null;
        this._consoleTracker = (_b = options.consoleTracker) !== null && _b !== void 0 ? _b : null;
        this._editorTracker = (_c = options.editorTracker) !== null && _c !== void 0 ? _c : null;
        this._readOnlyEditorTracker = new lib_index_js_.WidgetTracker({ namespace: '@jupyterlab/debugger' });
    }
    /**
     * Returns an array of editors for a source matching the current debug
     * session by iterating through all the widgets in each of the supported
     * debugger types (i.e., consoles, files, notebooks).
     *
     * @param params - The editor search parameters.
     */
    find(params) {
        return [
            ...this._findInConsoles(params),
            ...this._findInEditors(params),
            ...this._findInNotebooks(params),
            ...this._findInReadOnlyEditors(params)
        ];
    }
    /**
     * Open a read-only editor in the main area.
     *
     * @param params The editor open parameters.
     */
    open(params) {
        const { editorWrapper, label, caption } = params;
        const widget = new lib_index_js_.MainAreaWidget({
            content: editorWrapper
        });
        widget.id = lib_index_js_.DOMUtils.createDomID();
        widget.title.label = label;
        widget.title.closable = true;
        widget.title.caption = caption;
        widget.title.icon = index_js_.textEditorIcon;
        this._shell.add(widget, 'main', { type: 'Debugger Sources' });
        void this._readOnlyEditorTracker.add(widget);
    }
    /**
     * Find relevant editors matching the search params in the notebook tracker.
     *
     * @param params - The editor search parameters.
     */
    _findInNotebooks(params) {
        if (!this._notebookTracker) {
            return [];
        }
        const { focus, kernel, path, source } = params;
        const editors = [];
        this._notebookTracker.forEach(notebookPanel => {
            const sessionContext = notebookPanel.sessionContext;
            if (path !== sessionContext.path) {
                return;
            }
            const notebook = notebookPanel.content;
            if (focus) {
                notebook.mode = 'command';
            }
            const cells = notebookPanel.content.widgets;
            cells.forEach((cell, i) => {
                // check the event is for the correct cell
                const code = cell.model.sharedModel.getSource();
                const codeId = this._getCodeId(code, kernel);
                if (!codeId) {
                    return;
                }
                if (source !== codeId) {
                    return;
                }
                if (focus) {
                    notebook.activeCellIndex = i;
                    if (notebook.activeCell) {
                        notebook
                            .scrollToItem(notebook.activeCellIndex, 'smart')
                            .catch(reason => {
                            // no-op
                        });
                    }
                    this._shell.activateById(notebookPanel.id);
                }
                editors.push(Object.freeze({
                    get: () => cell.editor,
                    reveal: () => notebook.scrollToItem(i, 'smart'),
                    src: cell.model.sharedModel
                }));
            });
        });
        return editors;
    }
    /**
     * Find relevant editors matching the search params in the console tracker.
     *
     * @param params - The editor search parameters.
     */
    _findInConsoles(params) {
        if (!this._consoleTracker) {
            return [];
        }
        const { focus, kernel, path, source } = params;
        const editors = [];
        this._consoleTracker.forEach(consoleWidget => {
            const sessionContext = consoleWidget.sessionContext;
            if (path !== sessionContext.path) {
                return;
            }
            const cells = consoleWidget.console.cells;
            for (const cell of cells) {
                const code = cell.model.sharedModel.getSource();
                const codeId = this._getCodeId(code, kernel);
                if (!codeId) {
                    break;
                }
                if (source !== codeId) {
                    break;
                }
                editors.push(Object.freeze({
                    get: () => cell.editor,
                    reveal: () => Promise.resolve(this._shell.activateById(consoleWidget.id)),
                    src: cell.model.sharedModel
                }));
                if (focus) {
                    this._shell.activateById(consoleWidget.id);
                }
            }
        });
        return editors;
    }
    /**
     * Find relevant editors matching the search params in the editor tracker.
     *
     * @param params - The editor search parameters.
     */
    _findInEditors(params) {
        if (!this._editorTracker) {
            return [];
        }
        const { focus, kernel, path, source } = params;
        const editors = [];
        this._editorTracker.forEach(doc => {
            const fileEditor = doc.content;
            if (path !== fileEditor.context.path) {
                return;
            }
            const editor = fileEditor.editor;
            if (!editor) {
                return;
            }
            const code = editor.model.sharedModel.getSource();
            const codeId = this._getCodeId(code, kernel);
            if (!codeId) {
                return;
            }
            if (source !== codeId) {
                return;
            }
            editors.push(Object.freeze({
                get: () => editor,
                reveal: () => Promise.resolve(this._shell.activateById(doc.id)),
                src: fileEditor.model.sharedModel
            }));
            if (focus) {
                this._shell.activateById(doc.id);
            }
        });
        return editors;
    }
    /**
     * Find relevant editors matching the search params in the read-only tracker.
     *
     * @param params - The editor search parameters.
     */
    _findInReadOnlyEditors(params) {
        const { focus, kernel, source } = params;
        const editors = [];
        this._readOnlyEditorTracker.forEach(widget => {
            var _a;
            const editor = (_a = widget.content) === null || _a === void 0 ? void 0 : _a.editor;
            if (!editor) {
                return;
            }
            const code = editor.model.sharedModel.getSource();
            const codeId = this._getCodeId(code, kernel);
            if (!codeId) {
                return;
            }
            if (widget.title.caption !== source && source !== codeId) {
                return;
            }
            editors.push(Object.freeze({
                get: () => editor,
                reveal: () => Promise.resolve(this._shell.activateById(widget.id)),
                src: editor.model.sharedModel
            }));
            if (focus) {
                this._shell.activateById(widget.id);
            }
        });
        return editors;
    }
    /**
     * Get the code id for a given source and kernel,
     * and handle the case of a kernel without parameters.
     *
     * @param code The source code.
     * @param kernel The name of the kernel.
     */
    _getCodeId(code, kernel) {
        try {
            return this._config.getCodeId(code, kernel);
        }
        catch (_a) {
            return '';
        }
    }
}
//# sourceMappingURL=sources.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/debugger.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.













/**
 * A namespace for `Debugger` statics.
 */
var Debugger;
(function (Debugger) {
    /**
     * Debugger configuration for all kernels.
     */
    class Config extends DebuggerConfig {
    }
    Debugger.Config = Config;
    /**
     * A handler for a CodeEditor.IEditor.
     */
    class EditorHandler extends editor_EditorHandler {
    }
    Debugger.EditorHandler = EditorHandler;
    /**
     * A handler for debugging a widget.
     */
    class Handler extends DebuggerHandler {
    }
    Debugger.Handler = Handler;
    /**
     * A model for a debugger.
     */
    class Model extends DebuggerModel {
    }
    Debugger.Model = Model;
    /**
     * A widget factory for read only editors.
     */
    class ReadOnlyEditorFactory extends factory_ReadOnlyEditorFactory {
    }
    Debugger.ReadOnlyEditorFactory = ReadOnlyEditorFactory;
    /**
     * The main IDebugger implementation.
     */
    class Service extends DebuggerService {
    }
    Debugger.Service = Service;
    /**
     * A concrete implementation of IDebugger.ISession.
     */
    class Session extends DebuggerSession {
    }
    Debugger.Session = Session;
    /**
     * The debugger sidebar UI.
     */
    class Sidebar extends DebuggerSidebar {
    }
    Debugger.Sidebar = Sidebar;
    /**
     * The source and editor manager for a debugger instance.
     */
    class Sources extends DebuggerSources {
    }
    Debugger.Sources = Sources;
    /**
     * A data grid that displays variables in a debugger session.
     */
    class VariablesGrid extends VariablesBodyGrid {
    }
    Debugger.VariablesGrid = VariablesGrid;
    /**
     * A widget to display data according to its mime type
     */
    class VariableRenderer extends VariableMimeRenderer {
    }
    Debugger.VariableRenderer = VariableRenderer;
    /**
     * The command IDs used by the debugger plugin.
     */
    let CommandIDs;
    (function (CommandIDs) {
        CommandIDs.debugContinue = 'debugger:continue';
        CommandIDs.terminate = 'debugger:terminate';
        CommandIDs.next = 'debugger:next';
        CommandIDs.showPanel = 'debugger:show-panel';
        CommandIDs.stepIn = 'debugger:stepIn';
        CommandIDs.stepOut = 'debugger:stepOut';
        CommandIDs.inspectVariable = 'debugger:inspect-variable';
        CommandIDs.renderMimeVariable = 'debugger:render-mime-variable';
        CommandIDs.evaluate = 'debugger:evaluate';
        CommandIDs.restartDebug = 'debugger:restart-debug';
        CommandIDs.pauseOnExceptions = 'debugger:pause-on-exceptions';
        CommandIDs.copyToClipboard = 'debugger:copy-to-clipboard';
        CommandIDs.copyToGlobals = 'debugger:copy-to-globals';
        CommandIDs.invokeConsole = 'debugger:invoke-console-completer';
        CommandIDs.selectConsole = 'debugger:select-console-completion';
        CommandIDs.executeConsole = 'debugger:run-in-console';
        CommandIDs.openSource = 'debugger:open-source';
    })(CommandIDs = Debugger.CommandIDs || (Debugger.CommandIDs = {}));
    /**
     * The debugger user interface icons.
     */
    let Icons;
    (function (Icons) {
        Icons.closeAllIcon = index_js_.closeAllIcon;
        Icons.evaluateIcon = index_js_.codeIcon;
        Icons.continueIcon = index_js_.runIcon;
        Icons.pauseIcon = index_js_.pauseIcon;
        Icons.stepIntoIcon = index_js_.stepIntoIcon;
        Icons.stepOutIcon = index_js_.stepOutIcon;
        Icons.stepOverIcon = index_js_.stepOverIcon;
        Icons.terminateIcon = index_js_.stopIcon;
        Icons.variableIcon = index_js_.variableIcon;
        Icons.viewBreakpointIcon = index_js_.viewBreakpointIcon;
        Icons.pauseOnExceptionsIcon = index_js_.pauseIcon;
    })(Icons = Debugger.Icons || (Debugger.Icons = {}));
    /**
     * The debugger dialog helpers.
     */
    let Dialogs;
    (function (Dialogs) {
        /**
         * Open a code prompt in a dialog.
         */
        Dialogs.getCode = DebuggerEvaluateDialog.getCode;
    })(Dialogs = Debugger.Dialogs || (Debugger.Dialogs = {}));
})(Debugger || (Debugger = {}));
//# sourceMappingURL=debugger.js.map

/***/ }),

/***/ 65200:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ DebuggerDisplayRegistry)
/* harmony export */ });
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * Registry that holds display providers for different source types.
 */
class DebuggerDisplayRegistry {
    constructor() {
        this._providers = [];
    }
    /**
     * Register a display provider.
     *
     * @param provider source display providder to register.
     */
    register(provider) {
        this._providers.push(provider);
    }
    /**
     * Try all providers. If any returns something more meaningful than `source.path`,
     * use that. Otherwise, fall back to `source.path`.
     */
    getDisplayName(source) {
        var _a;
        const path = (_a = source.path) !== null && _a !== void 0 ? _a : '';
        let index = path;
        for (const provider of this._providers) {
            if (!provider.canHandle(source)) {
                continue;
            }
            const name = provider.getDisplayName(source);
            // If provider returns something different or more descriptive than raw path
            if (name && name !== path) {
                index = name;
            }
        }
        return index;
    }
}
//# sourceMappingURL=displayregistry.js.map

/***/ }),

/***/ 36621:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  Debugger: () => (/* reexport */ lib_debugger/* Debugger */.q),
  DebuggerDisplayRegistry: () => (/* reexport */ displayregistry/* DebuggerDisplayRegistry */.M),
  IDebugger: () => (/* reexport */ IDebugger),
  IDebuggerConfig: () => (/* reexport */ IDebuggerConfig),
  IDebuggerDisplayRegistry: () => (/* reexport */ IDebuggerDisplayRegistry),
  IDebuggerHandler: () => (/* reexport */ IDebuggerHandler),
  IDebuggerSidebar: () => (/* reexport */ IDebuggerSidebar),
  IDebuggerSourceViewer: () => (/* reexport */ IDebuggerSourceViewer),
  IDebuggerSources: () => (/* reexport */ IDebuggerSources)
});

// EXTERNAL MODULE: ../node_modules/@jupyterlab/debugger/lib/debugger.js + 36 modules
var lib_debugger = __webpack_require__(12069);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/debugger/lib/displayregistry.js
var displayregistry = __webpack_require__(65200);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The visual debugger token.
 */
const IDebugger = new index_js_.Token('@jupyterlab/debugger:IDebugger', 'A debugger user interface.');
/**
 * The debugger configuration token.
 */
const IDebuggerConfig = new index_js_.Token('@jupyterlab/debugger:IDebuggerConfig', 'A service to handle the debugger configuration.');
/**
 * The debugger sources utility token.
 */
const IDebuggerSources = new index_js_.Token('@jupyterlab/debugger:IDebuggerSources', 'A service to display sources in debug mode.');
/**
 * The debugger sidebar token.
 */
const IDebuggerSidebar = new index_js_.Token('@jupyterlab/debugger:IDebuggerSidebar', 'A service for the debugger sidebar.');
/**
 * The debugger handler token.
 */
const IDebuggerHandler = new index_js_.Token('@jupyterlab/debugger:IDebuggerHandler', 'A service for handling notebook debugger.');
/**
 * The source viewer token.
 */
const IDebuggerSourceViewer = new index_js_.Token('@jupyterlab/debugger:IDebuggerSourceViewer', 'A debugger source viewer.');
/**
 * Debugger display registry token.
 */
const IDebuggerDisplayRegistry = new index_js_.Token('@jupyterlab/debugger:IDebuggerDisplayRegistry', 'A service for registering display labels for cells/files in the debugger.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/debugger/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module debugger
 */



//# sourceMappingURL=index.js.map

/***/ }),

/***/ 31958:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Grid: () => (/* binding */ Grid),
/* harmony export */   GridModel: () => (/* binding */ GridModel)
/* harmony export */ });
/* harmony import */ var _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32444);
/* harmony import */ var _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12069);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * A class wrapping the underlying variables datagrid.
 */
class Grid extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.Panel {
    /**
     * Instantiate a new VariablesGrid.
     *
     * @param options The instantiation options for a VariablesGrid.
     */
    constructor(options) {
        super();
        const { commands, model, themeManager } = options;
        this.model = model;
        const dataModel = new GridModel(options.translator);
        const grid = new _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__.DataGrid();
        const mouseHandler = new Private.MouseHandler();
        mouseHandler.doubleClicked.connect((_, hit) => commands.execute(___WEBPACK_IMPORTED_MODULE_4__/* .Debugger */ .q.CommandIDs.inspectVariable, {
            variableReference: dataModel.getVariableReference(hit.row),
            name: dataModel.getVariableName(hit.row)
        }));
        mouseHandler.selected.connect((_, hit) => {
            const { row } = hit;
            this.model.selectedVariable = {
                name: dataModel.getVariableName(row),
                value: dataModel.data('body', row, 1),
                type: dataModel.data('body', row, 2),
                variablesReference: dataModel.getVariableReference(row)
            };
        });
        grid.dataModel = dataModel;
        grid.keyHandler = new _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__.BasicKeyHandler();
        grid.mouseHandler = mouseHandler;
        grid.selectionModel = new _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__.BasicSelectionModel({
            dataModel
        });
        grid.stretchLastColumn = true;
        grid.node.style.height = '100%';
        this._grid = grid;
        // Compute the grid's styles based on the current theme.
        if (themeManager) {
            themeManager.themeChanged.connect(this._updateStyles, this);
        }
        this.addWidget(grid);
    }
    /**
     * Set the variable filter list.
     *
     * @param filter The variable filter to apply.
     */
    set filter(filter) {
        this._grid.dataModel.filter = filter;
        this.update();
    }
    /**
     * Set the scope for the variables data model.
     *
     * @param scope The scopes for the variables
     */
    set scope(scope) {
        this._grid.dataModel.scope = scope;
        this.update();
    }
    /**
     * Get the data model for the data grid.
     */
    get dataModel() {
        return this._grid.dataModel;
    }
    /**
     * Handle `after-attach` messages.
     *
     * @param message - The `after-attach` message.
     */
    onAfterAttach(message) {
        super.onAfterAttach(message);
        this._updateStyles();
    }
    /**
     * Update the computed style for the data grid on theme change.
     */
    _updateStyles() {
        const { style, textRenderer } = Private.computeStyle();
        this._grid.cellRenderers.update({}, textRenderer);
        this._grid.style = style;
    }
}
/**
 * A data grid model for variables.
 */
class GridModel extends _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__.DataModel {
    /**
     * Create grid model
     * @param translator optional translator
     */
    constructor(translator) {
        super();
        this._filter = new Set();
        this._scope = '';
        this._data = {
            name: [],
            type: [],
            value: [],
            variablesReference: []
        };
        this._trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator).load('jupyterlab');
    }
    /**
     * The variable filter list.
     */
    get filter() {
        return this._filter;
    }
    set filter(filter) {
        this._filter = filter;
    }
    /**
     * The current scope for the variables.
     */
    get scope() {
        return this._scope;
    }
    set scope(scope) {
        this._scope = scope;
    }
    /**
     * Get the row count for a particular region in the data grid.
     *
     * @param region The datagrid region.
     */
    rowCount(region) {
        return region === 'body' ? this._data.name.length : 1;
    }
    /**
     * Get the column count for a particular region in the data grid.
     *
     * @param region The datagrid region.
     */
    columnCount(region) {
        return region === 'body' ? 2 : 1;
    }
    /**
     * Get the data count for a particular region, row and column in the data grid.
     *
     * @param region The datagrid region.
     * @param row The datagrid row
     * @param column The datagrid column
     */
    data(region, row, column) {
        if (region === 'row-header') {
            return this._data.name[row];
        }
        if (region === 'column-header') {
            return column === 1 ? this._trans.__('Value') : this._trans.__('Type');
        }
        if (region === 'corner-header') {
            return this._trans.__('Name');
        }
        return column === 1 ? this._data.value[row] : this._data.type[row];
    }
    /**
     * Get the variable reference for a given row
     *
     * @param row The row in the datagrid.
     */
    getVariableReference(row) {
        return this._data.variablesReference[row];
    }
    /**
     * Get the variable name for a given row
     *
     * @param row The row in the datagrid.
     */
    getVariableName(row) {
        return this._data.name[row];
    }
    /**
     * Set the datagrid model data from the list of variables.
     *
     * @param scopes The list of variables.
     */
    setData(scopes) {
        var _a, _b;
        this._clearData();
        this.emitChanged({
            type: 'model-reset'
        });
        const scope = (_a = scopes.find(scope => scope.name === this._scope)) !== null && _a !== void 0 ? _a : scopes[0];
        const variables = (_b = scope === null || scope === void 0 ? void 0 : scope.variables) !== null && _b !== void 0 ? _b : [];
        const filtered = variables.filter(variable => variable.name && !this._filter.has(variable.name));
        filtered.forEach((variable, index) => {
            var _a;
            this._data.name[index] = variable.name;
            this._data.type[index] = (_a = variable.type) !== null && _a !== void 0 ? _a : '';
            this._data.value[index] = variable.value;
            this._data.variablesReference[index] = variable.variablesReference;
        });
        this.emitChanged({
            type: 'rows-inserted',
            region: 'body',
            index: 1,
            span: filtered.length
        });
    }
    /**
     * Clear all the data in the datagrid.
     */
    _clearData() {
        this._data = {
            name: [],
            type: [],
            value: [],
            variablesReference: []
        };
    }
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * Create a color palette element.
     */
    function createPalette() {
        const div = document.createElement('div');
        div.className = 'jp-DebuggerVariables-colorPalette';
        div.innerHTML = `
        <div class="jp-mod-void"></div>
        <div class="jp-mod-background"></div>
        <div class="jp-mod-header-background"></div>
        <div class="jp-mod-grid-line"></div>
        <div class="jp-mod-header-grid-line"></div>
        <div class="jp-mod-selection"></div>
        <div class="jp-mod-text"></div>
      `;
        return div;
    }
    /**
     * Compute the style and renderer for a data grid.
     */
    function computeStyle() {
        const palette = createPalette();
        document.body.appendChild(palette);
        let node;
        node = palette.querySelector('.jp-mod-void');
        const voidColor = getComputedStyle(node).color;
        node = palette.querySelector('.jp-mod-background');
        const backgroundColor = getComputedStyle(node).color;
        node = palette.querySelector('.jp-mod-header-background');
        const headerBackgroundColor = getComputedStyle(node).color;
        node = palette.querySelector('.jp-mod-grid-line');
        const gridLineColor = getComputedStyle(node).color;
        node = palette.querySelector('.jp-mod-header-grid-line');
        const headerGridLineColor = getComputedStyle(node).color;
        node = palette.querySelector('.jp-mod-selection');
        const selectionFillColor = getComputedStyle(node).color;
        node = palette.querySelector('.jp-mod-text');
        const textColor = getComputedStyle(node).color;
        document.body.removeChild(palette);
        return {
            style: {
                voidColor,
                backgroundColor,
                headerBackgroundColor,
                gridLineColor,
                headerGridLineColor,
                rowBackgroundColor: (i) => i % 2 === 0 ? voidColor : backgroundColor,
                selectionFillColor
            },
            textRenderer: new _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__.TextRenderer({
                font: '12px sans-serif',
                textColor,
                backgroundColor: '',
                verticalAlignment: 'center',
                horizontalAlignment: 'left'
            })
        };
    }
    Private.computeStyle = computeStyle;
    /**
     * A custom click handler to handle clicks on the variables grid.
     */
    class MouseHandler extends _lumino_datagrid__WEBPACK_IMPORTED_MODULE_0__.BasicMouseHandler {
        constructor() {
            super(...arguments);
            this._doubleClicked = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(this);
            this._selected = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(this);
        }
        /**
         * A signal emitted when the variables grid is double clicked.
         */
        get doubleClicked() {
            return this._doubleClicked;
        }
        /**
         * A signal emitted when the variables grid received mouse down or context menu event.
         */
        get selected() {
            return this._selected;
        }
        /**
         * Dispose of the resources held by the mouse handler.
         */
        dispose() {
            if (this.isDisposed) {
                return;
            }
            _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal.disconnectSender(this);
            super.dispose();
        }
        /**
         * Handle a mouse double-click event.
         *
         * @param grid The datagrid clicked.
         * @param event The mouse event.
         */
        onMouseDoubleClick(grid, event) {
            const hit = grid.hitTest(event.clientX, event.clientY);
            this._doubleClicked.emit(hit);
        }
        /**
         * Handle the mouse down event for the data grid.
         *
         * @param grid - The data grid of interest.
         *
         * @param event - The mouse down event of interest.
         */
        onMouseDown(grid, event) {
            // Unpack the event.
            let { clientX, clientY } = event;
            // Hit test the grid.
            let hit = grid.hitTest(clientX, clientY);
            this._selected.emit(hit);
            // Propagate event to Lumino DataGrid BasicMouseHandler.
            super.onMouseDown(grid, event);
        }
        /**
         * Handle the context menu event for the data grid.
         *
         * @param grid - The data grid of interest.
         *
         * @param event - The context menu event of interest.
         */
        onContextMenu(grid, event) {
            // Unpack the event.
            let { clientX, clientY } = event;
            // Hit test the grid.
            let hit = grid.hitTest(clientX, clientY);
            this._selected.emit(hit);
        }
    }
    Private.MouseHandler = MouseHandler;
})(Private || (Private = {}));
//# sourceMappingURL=gridpanel.js.map

/***/ }),

/***/ 8471:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ToolbarItems: () => (/* binding */ ToolbarItems),
  "default": () => (/* binding */ lib),
  downloadPlugin: () => (/* binding */ downloadPlugin),
  openBrowserTabPlugin: () => (/* binding */ openBrowserTabPlugin),
  pathStatusPlugin: () => (/* binding */ pathStatusPlugin),
  savingStatusPlugin: () => (/* binding */ savingStatusPlugin)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docmanager@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/docmanager/lib/index.js)
var docmanager_lib_index_js_ = __webpack_require__(64009);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager-extension/lib/recents.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




/**
 * A namespace for command IDs.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.clearRecents = 'docmanager:clear-recents';
})(CommandIDs || (CommandIDs = {}));
var PluginIDs;
(function (PluginIDs) {
    PluginIDs.recentsManager = '@jupyterlab/docmanager-extension:recents';
    PluginIDs.reopenClosed = '@jupyterlab/docmanager-extension:reopen-recently-closed';
    PluginIDs.mainPlugin = '@jupyterlab/docmanager-extension:plugin';
})(PluginIDs || (PluginIDs = {}));
const recentsManagerPlugin = {
    id: PluginIDs.recentsManager,
    description: 'Provides a manager of recently opened and closed documents.',
    autoStart: true,
    requires: [statedb_lib_index_js_.IStateDB],
    optional: [settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    provides: docmanager_lib_index_js_.IRecentsManager,
    activate: (app, stateDB, settingRegistry, translator) => {
        const { serviceManager } = app;
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        // Create the manager
        const recentsManager = new docmanager_lib_index_js_.RecentsManager({
            stateDB: stateDB,
            contents: serviceManager.contents
        });
        const updateSettings = (settings) => {
            recentsManager.maximalRecentsLength = settings.get('maxNumberRecents')
                .composite;
        };
        if (settingRegistry) {
            void Promise.all([
                app.restored,
                settingRegistry.load(PluginIDs.mainPlugin)
            ]).then(([_, settings]) => {
                settings.changed.connect(updateSettings);
                updateSettings(settings);
            });
        }
        app.commands.addCommand(CommandIDs.clearRecents, {
            execute: () => {
                recentsManager.clearRecents();
            },
            isEnabled: () => recentsManager.recentlyOpened.length != 0 ||
                recentsManager.recentlyClosed.length != 0,
            label: trans.__('Clear Recent Documents'),
            caption: trans.__('Clear the list of recently opened items.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        return recentsManager;
    }
};
//# sourceMappingURL=recents.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module docmanager-extension
 */















/**
 * The command IDs used by the document manager plugin.
 */
var lib_CommandIDs;
(function (CommandIDs) {
    CommandIDs.clone = 'docmanager:clone';
    CommandIDs.deleteFile = 'docmanager:delete-file';
    CommandIDs.newUntitled = 'docmanager:new-untitled';
    CommandIDs.open = 'docmanager:open';
    CommandIDs.openBrowserTab = 'docmanager:open-browser-tab';
    CommandIDs.reload = 'docmanager:reload';
    CommandIDs.rename = 'docmanager:rename';
    CommandIDs.del = 'docmanager:delete';
    CommandIDs.duplicate = 'docmanager:duplicate';
    CommandIDs.restoreCheckpoint = 'docmanager:restore-checkpoint';
    CommandIDs.save = 'docmanager:save';
    CommandIDs.saveAll = 'docmanager:save-all';
    CommandIDs.saveAs = 'docmanager:save-as';
    CommandIDs.download = 'docmanager:download';
    CommandIDs.toggleAutosave = 'docmanager:toggle-autosave';
    CommandIDs.showInFileBrowser = 'docmanager:show-in-file-browser';
})(lib_CommandIDs || (lib_CommandIDs = {}));
/**
 * The id of the document manager plugin.
 */
const docManagerPluginId = '@jupyterlab/docmanager-extension:plugin';
/**
 * A plugin to open documents in the main area.
 *
 */
const openerPlugin = {
    id: '@jupyterlab/docmanager-extension:opener',
    description: 'Provides the widget opener.',
    autoStart: true,
    provides: docmanager_lib_index_js_.IDocumentWidgetOpener,
    activate: (app) => {
        const { shell } = app;
        return new (class {
            constructor() {
                this._opened = new dist_index_es6_js_.Signal(this);
            }
            open(widget, options) {
                var _a;
                if (!widget.id) {
                    widget.id = `document-manager-${++Private.id}`;
                }
                widget.title.dataset = {
                    type: 'document-title',
                    ...widget.title.dataset
                };
                if (!widget.isAttached) {
                    shell.add(widget, 'main', options || {});
                }
                if ((_a = options === null || options === void 0 ? void 0 : options.activate) !== null && _a !== void 0 ? _a : true) {
                    shell.activateById(widget.id);
                }
                this._opened.emit(widget);
            }
            get opened() {
                return this._opened;
            }
        })();
    }
};
/**
 * A plugin to handle dirty states for open documents.
 */
const contextsPlugin = {
    id: '@jupyterlab/docmanager-extension:contexts',
    description: 'Adds the handling of opened documents dirty state.',
    autoStart: true,
    requires: [docmanager_lib_index_js_.IDocumentManager, docmanager_lib_index_js_.IDocumentWidgetOpener],
    optional: [index_js_.ILabStatus],
    activate: (app, docManager, widgetOpener, status) => {
        const contexts = new WeakSet();
        widgetOpener.opened.connect((_, widget) => {
            // Handle dirty state for open documents.
            const context = docManager.contextForWidget(widget);
            if (context && !contexts.has(context)) {
                if (status) {
                    handleContext(status, context);
                }
                contexts.add(context);
            }
        });
    }
};
/**
 * A plugin providing the default document manager.
 */
const manager = {
    id: '@jupyterlab/docmanager-extension:manager',
    description: 'Provides the document manager.',
    provides: docmanager_lib_index_js_.IDocumentManager,
    requires: [docmanager_lib_index_js_.IDocumentWidgetOpener],
    optional: [
        translation_lib_index_js_.ITranslator,
        index_js_.ILabStatus,
        lib_index_js_.ISessionContextDialogs,
        index_js_.JupyterLab.IInfo,
        docmanager_lib_index_js_.IRecentsManager,
        rendermime_lib_index_js_.IUrlResolverFactory,
        docmanager_lib_index_js_.IDocumentManagerDialogs
    ],
    activate: (app, widgetOpener, translator_, status, sessionDialogs_, info, recentsManager, urlResolverFactory, docManagerDialogs_) => {
        var _a;
        const { serviceManager: manager, docRegistry: registry } = app;
        const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
        const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new lib_index_js_.SessionContextDialogs({ translator });
        const docManagerDialogs = docManagerDialogs_ !== null && docManagerDialogs_ !== void 0 ? docManagerDialogs_ : new docmanager_lib_index_js_.DocumentManagerDialogs({ translator });
        const when = app.restored.then(() => void 0);
        const docManager = new docmanager_lib_index_js_.DocumentManager({
            registry,
            manager,
            opener: widgetOpener,
            when,
            setBusy: (_a = (status && (() => status.setBusy()))) !== null && _a !== void 0 ? _a : undefined,
            sessionDialogs,
            translator: translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator,
            isConnectedCallback: () => {
                if (info) {
                    return info.isConnected;
                }
                return true;
            },
            recentsManager: recentsManager !== null && recentsManager !== void 0 ? recentsManager : undefined,
            urlResolverFactory: urlResolverFactory !== null && urlResolverFactory !== void 0 ? urlResolverFactory : undefined,
            docManagerDialogs: docManagerDialogs
        });
        return docManager;
    }
};
/**
 * The default document manager provider commands and settings.
 */
const docManagerPlugin = {
    id: docManagerPluginId,
    description: 'Adds commands and settings to the document manager.',
    autoStart: true,
    requires: [docmanager_lib_index_js_.IDocumentManager, docmanager_lib_index_js_.IDocumentWidgetOpener, settingregistry_lib_index_js_.ISettingRegistry],
    optional: [translation_lib_index_js_.ITranslator, lib_index_js_.ICommandPalette, index_js_.ILabShell, docmanager_lib_index_js_.IDocumentManagerDialogs],
    activate: (app, docManager, widgetOpener, settingRegistry, translator, palette, labShell, dialogs) => {
        translator = translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const registry = app.docRegistry;
        // Register the file operations commands.
        addCommands(app, docManager, widgetOpener, settingRegistry, translator, labShell, palette, dialogs);
        // Keep up to date with the settings registry.
        const onSettingsUpdated = (settings) => {
            // Handle whether to autosave
            const autosave = settings.get('autosave').composite;
            docManager.autosave =
                autosave === true || autosave === false ? autosave : true;
            app.commands.notifyCommandChanged(lib_CommandIDs.toggleAutosave);
            const confirmClosingDocument = settings.get('confirmClosingDocument')
                .composite;
            docManager.confirmClosingDocument = confirmClosingDocument !== null && confirmClosingDocument !== void 0 ? confirmClosingDocument : true;
            // Handle autosave interval
            const autosaveInterval = settings.get('autosaveInterval').composite;
            docManager.autosaveInterval = autosaveInterval || 120;
            // Handle last modified timestamp check margin
            const lastModifiedCheckMargin = settings.get('lastModifiedCheckMargin')
                .composite;
            docManager.lastModifiedCheckMargin = lastModifiedCheckMargin || 500;
            const renameUntitledFile = settings.get('renameUntitledFileOnSave')
                .composite;
            docManager.renameUntitledFileOnSave = renameUntitledFile !== null && renameUntitledFile !== void 0 ? renameUntitledFile : true;
            // Handle default widget factory overrides.
            const defaultViewers = settings.get('defaultViewers').composite;
            const overrides = {};
            // Filter the defaultViewers and file types for existing ones.
            Object.keys(defaultViewers).forEach(ft => {
                if (!registry.getFileType(ft)) {
                    console.warn(`File Type ${ft} not found`);
                    return;
                }
                if (!registry.getWidgetFactory(defaultViewers[ft])) {
                    console.warn(`Document viewer ${defaultViewers[ft]} not found`);
                }
                overrides[ft] = defaultViewers[ft];
            });
            // Set the default factory overrides. If not provided, this has the
            // effect of unsetting any previous overrides.
            for (const ft of registry.fileTypes()) {
                try {
                    registry.setDefaultWidgetFactory(ft.name, overrides[ft.name]);
                }
                catch (_a) {
                    console.warn(`Failed to set default viewer ${overrides[ft.name]} for file type ${ft.name}`);
                }
            }
        };
        // Fetch the initial state of the settings.
        Promise.all([settingRegistry.load(docManagerPluginId), app.restored])
            .then(([settings]) => {
            settings.changed.connect(onSettingsUpdated);
            onSettingsUpdated(settings);
            const onStateChanged = (sender, change) => {
                if ([
                    'autosave',
                    'autosaveInterval',
                    'confirmClosingDocument',
                    'lastModifiedCheckMargin',
                    'renameUntitledFileOnSave'
                ].includes(change.name) &&
                    settings.get(change.name).composite !== change.newValue) {
                    settings.set(change.name, change.newValue).catch(reason => {
                        console.error(`Failed to set the setting '${change.name}':\n${reason}`);
                    });
                }
            };
            docManager.stateChanged.connect(onStateChanged);
        })
            .catch((reason) => {
            console.error(reason.message);
        });
        // Register a fetch transformer for the settings registry,
        // allowing us to dynamically populate a help string with the
        // available document viewers and file types for the default
        // viewer overrides.
        settingRegistry.transform(docManagerPluginId, {
            fetch: plugin => {
                // Get the available file types.
                const fileTypes = Array.from(registry.fileTypes())
                    .map(ft => ft.name)
                    .join('    \n');
                // Get the available widget factories.
                const factories = Array.from(registry.widgetFactories())
                    .map(f => f.name)
                    .join('    \n');
                // Generate the help string.
                const description = trans.__(`Overrides for the default viewers for file types.
Specify a mapping from file type name to document viewer name, for example:

defaultViewers: {
  markdown: "Markdown Preview"
}

If you specify non-existent file types or viewers, or if a viewer cannot
open a given file type, the override will not function.

Available viewers:
%1

Available file types:
%2`, factories, fileTypes);
                const schema = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                schema.properties.defaultViewers.description = description;
                return { ...plugin, schema };
            }
        });
        // If the document registry gains or loses a factory or file type,
        // regenerate the settings description with the available options.
        registry.changed.connect(() => settingRegistry.load(docManagerPluginId, true));
    }
};
/**
 * A plugin for adding a saving status item to the status bar.
 */
const savingStatusPlugin = {
    id: '@jupyterlab/docmanager-extension:saving-status',
    description: 'Adds a saving status indicator.',
    autoStart: true,
    requires: [docmanager_lib_index_js_.IDocumentManager, index_js_.ILabShell],
    optional: [translation_lib_index_js_.ITranslator, statusbar_lib_index_js_.IStatusBar],
    activate: (_, docManager, labShell, translator, statusBar) => {
        if (!statusBar) {
            // Automatically disable if statusbar missing
            return;
        }
        const saving = new docmanager_lib_index_js_.SavingStatus({
            docManager,
            translator: translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator
        });
        // Keep the currently active widget synchronized.
        saving.model.widget = labShell.currentWidget;
        labShell.currentChanged.connect(() => {
            saving.model.widget = labShell.currentWidget;
        });
        statusBar.registerStatusItem(savingStatusPlugin.id, {
            item: saving,
            align: 'middle',
            isActive: () => saving.model !== null && saving.model.status !== null,
            activeStateChanged: saving.model.stateChanged
        });
    }
};
/**
 * A plugin providing a file path widget to the status bar.
 */
const pathStatusPlugin = {
    id: '@jupyterlab/docmanager-extension:path-status',
    description: 'Adds a file path indicator in the status bar.',
    autoStart: true,
    requires: [docmanager_lib_index_js_.IDocumentManager, index_js_.ILabShell],
    optional: [statusbar_lib_index_js_.IStatusBar],
    activate: (_, docManager, labShell, statusBar) => {
        if (!statusBar) {
            // Automatically disable if statusbar missing
            return;
        }
        const path = new docmanager_lib_index_js_.PathStatus({ docManager });
        // Keep the file path widget up-to-date with the application active widget.
        path.model.widget = labShell.currentWidget;
        labShell.currentChanged.connect(() => {
            path.model.widget = labShell.currentWidget;
        });
        statusBar.registerStatusItem(pathStatusPlugin.id, {
            item: path,
            align: 'right',
            rank: 0
        });
    }
};
/**
 * A plugin providing download commands in the file menu and command palette.
 */
const downloadPlugin = {
    id: '@jupyterlab/docmanager-extension:download',
    description: 'Adds command to download files.',
    autoStart: true,
    requires: [docmanager_lib_index_js_.IDocumentManager],
    optional: [translation_lib_index_js_.ITranslator, lib_index_js_.ICommandPalette],
    activate: (app, docManager, translator, palette) => {
        var _a;
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const { commands, shell } = app;
        const isEnabled = () => {
            const { currentWidget } = shell;
            return !!(currentWidget && docManager.contextForWidget(currentWidget));
        };
        commands.addCommand(lib_CommandIDs.download, {
            label: trans.__('Download'),
            caption: trans.__('Download the file to your computer'),
            isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                // Checks that shell.currentWidget is valid:
                if (isEnabled()) {
                    const context = docManager.contextForWidget(shell.currentWidget);
                    if (!context) {
                        return (0,lib_index_js_.showDialog)({
                            title: trans.__('Cannot Download'),
                            body: trans.__('No context found for current widget!'),
                            buttons: [lib_index_js_.Dialog.okButton()]
                        });
                    }
                    return context.download();
                }
            }
        });
        (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {
            app.commands.notifyCommandChanged(lib_CommandIDs.download);
        });
        const category = trans.__('File Operations');
        if (palette) {
            palette.addItem({ command: lib_CommandIDs.download, category });
        }
    }
};
/**
 * A plugin providing open-browser-tab commands.
 *
 * This is its own plugin in case you would like to disable this feature.
 * e.g. jupyter labextension disable @jupyterlab/docmanager-extension:open-browser-tab
 *
 * Note: If disabling this, you may also want to disable:
 * @jupyterlab/filebrowser-extension:open-browser-tab
 */
const openBrowserTabPlugin = {
    id: '@jupyterlab/docmanager-extension:open-browser-tab',
    description: 'Adds command to open a browser tab.',
    autoStart: true,
    requires: [docmanager_lib_index_js_.IDocumentManager],
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, docManager, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const { commands } = app;
        commands.addCommand(lib_CommandIDs.openBrowserTab, {
            execute: args => {
                const path = typeof args['path'] === 'undefined' ? '' : args['path'];
                if (!path) {
                    return;
                }
                return docManager.services.contents.getDownloadUrl(path).then(url => {
                    const opened = window.open();
                    if (opened) {
                        opened.opener = null;
                        opened.location.href = url;
                    }
                    else {
                        throw new Error('Failed to open new browser tab.');
                    }
                });
            },
            iconClass: args => args['icon'] || '',
            label: () => trans.__('Open in New Browser Tab'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        path: {
                            type: 'string',
                            description: trans.__('The path of the file to open in browser tab')
                        },
                        icon: {
                            type: 'string',
                            description: trans.__('The icon class for the command')
                        }
                    },
                    required: ['path']
                }
            }
        });
    }
};
/**
 * A plugin that provides the default dialogs for three document management operations:
 * Rename, Confirm Close, and Save Before Close.
 *
 * To customize these dialogs, implement a custom plugin that provides the `IDocumentManagerDialogs` token.
 */
const dialogsPlugin = {
    id: '@jupyterlab/docmanager-extension:dialogs',
    description: 'Provides default dialogs for document management operations.',
    autoStart: true,
    provides: docmanager_lib_index_js_.IDocumentManagerDialogs,
    requires: [translation_lib_index_js_.ITranslator],
    activate: (app, translator) => {
        return new docmanager_lib_index_js_.DocumentManagerDialogs({ translator });
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    manager,
    docManagerPlugin,
    contextsPlugin,
    pathStatusPlugin,
    savingStatusPlugin,
    downloadPlugin,
    openBrowserTabPlugin,
    openerPlugin,
    recentsManagerPlugin,
    dialogsPlugin
];
/* harmony default export */ const lib = (plugins);
/**
 * Toolbar item factory
 */
var ToolbarItems;
(function (ToolbarItems) {
    /**
     * Create save button toolbar item.
     *
     */
    function createSaveButton(commands, fileChanged) {
        return (0,lib_index_js_.addCommandToolbarButtonClass)(lib_index_js_.ReactWidget.create(react_index_js_.createElement(lib_index_js_.UseSignal, { signal: fileChanged }, () => (react_index_js_.createElement(lib_index_js_.CommandToolbarButtonComponent, { commands: commands, id: lib_CommandIDs.save, label: '', args: { toolbar: true } })))));
    }
    ToolbarItems.createSaveButton = createSaveButton;
})(ToolbarItems || (ToolbarItems = {}));
/* Widget to display the revert to checkpoint confirmation. */
class RevertConfirmWidget extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new revert confirmation widget.
     */
    constructor(checkpoint, trans, fileType = 'notebook') {
        super({
            node: Private.createRevertConfirmNode(checkpoint, fileType, trans)
        });
    }
}
// Returns the file type for a widget.
function fileType(widget, docManager) {
    if (!widget) {
        return 'File';
    }
    const context = docManager.contextForWidget(widget);
    if (!context) {
        return '';
    }
    const fts = docManager.registry.getFileTypesForPath(context.path);
    return fts.length && fts[0].displayName ? fts[0].displayName : 'File';
}
/**
 * Add the file operations commands to the application's command registry.
 */
function addCommands(app, docManager, widgetOpener, settingRegistry, translator, labShell, palette, dialogs) {
    var _a;
    const trans = translator.load('jupyterlab');
    const { commands, shell } = app;
    const category = trans.__('File Operations');
    const isEnabled = () => {
        const { currentWidget } = shell;
        return !!(currentWidget && docManager.contextForWidget(currentWidget));
    };
    const isWritable = () => {
        var _a;
        const { currentWidget } = shell;
        if (!currentWidget) {
            return false;
        }
        const context = docManager.contextForWidget(currentWidget);
        return !!((_a = context === null || context === void 0 ? void 0 : context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable);
    };
    const readonlyNotification = (contextPath) => {
        return lib_index_js_.Notification.warning(trans.__(`%1 is read-only. Use "Save as…" instead.`, contextPath), { autoClose: 5000 });
    };
    // If inside a rich application like JupyterLab, add additional functionality.
    if (labShell) {
        if (!dialogs) {
            dialogs = new docmanager_lib_index_js_.DocumentManagerDialogs({ translator: translator });
        }
        addLabCommands(app, docManager, labShell, widgetOpener, translator, dialogs);
    }
    commands.addCommand(lib_CommandIDs.deleteFile, {
        label: () => `Delete ${fileType(shell.currentWidget, docManager)}`,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: 'The path of the file to delete'
                    }
                },
                required: ['path']
            }
        },
        execute: args => {
            const path = typeof args['path'] === 'undefined' ? '' : args['path'];
            if (!path) {
                const command = lib_CommandIDs.deleteFile;
                throw new Error(`A non-empty path is required for ${command}.`);
            }
            return docManager.deleteFile(path);
        }
    });
    commands.addCommand(lib_CommandIDs.newUntitled, {
        execute: async (args) => {
            const errorTitle = args['error'] || trans.__('Error');
            const path = typeof args['path'] === 'undefined' ? '' : args['path'];
            const options = {
                type: args['type'],
                path
            };
            if (args['type'] === 'file') {
                options.ext = args['ext'] || '.txt';
            }
            return docManager.services.contents
                .newUntitled(options)
                .catch(error => (0,lib_index_js_.showErrorMessage)(errorTitle, error));
        },
        label: args => args['label'] || `New ${args['type']}`,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    error: {
                        type: 'string',
                        description: 'The error title to display'
                    },
                    path: {
                        type: 'string',
                        description: 'The path where to create the file'
                    },
                    type: {
                        type: 'string',
                        description: 'The type of content to create',
                        enum: ['file', 'directory', 'notebook']
                    },
                    ext: {
                        type: 'string',
                        description: 'The file extension (for file type)'
                    },
                    label: {
                        type: 'string',
                        description: 'The label for the command'
                    }
                }
            }
        }
    });
    commands.addCommand(lib_CommandIDs.open, {
        execute: async (args) => {
            const path = typeof args['path'] === 'undefined' ? '' : args['path'];
            const factory = args['factory'] || void 0;
            const kernel = args === null || args === void 0 ? void 0 : args.kernel;
            const kernelPreference = args === null || args === void 0 ? void 0 : args.kernelPreference;
            const options = args['options'] || void 0;
            return docManager.services.contents
                .get(path, { content: false })
                .then(() => docManager.openOrReveal(path, factory, kernel, options, kernelPreference));
        },
        iconClass: args => args['icon'] || '',
        label: args => {
            var _a;
            return ((_a = (args['label'] || args['factory'])) !== null && _a !== void 0 ? _a : trans.__('Open the provided `path`.'));
        },
        mnemonic: args => args['mnemonic'] || -1,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: 'The path of the file to open'
                    },
                    factory: {
                        type: 'string',
                        description: 'The widget factory name'
                    },
                    kernel: {
                        type: 'object',
                        description: 'The kernel model to use'
                    },
                    kernelPreference: {
                        type: 'object',
                        description: 'Override kernel preferences, see [`IKernelPreference`](https://jupyterlab.readthedocs.io/en/stable/api/interfaces/apputils.ISessionContext.IKernelPreference.html) for possible values'
                    },
                    options: {
                        type: 'object',
                        description: 'Additional options for opening'
                    },
                    icon: {
                        type: 'string',
                        description: 'The icon class for the command'
                    },
                    label: {
                        type: 'string',
                        description: 'The label for the command'
                    },
                    mnemonic: {
                        type: 'number',
                        description: 'The mnemonic index for the command'
                    }
                }
            }
        }
    });
    commands.addCommand(lib_CommandIDs.reload, {
        label: () => trans.__('Reload %1 from Disk', fileType(shell.currentWidget, docManager)),
        caption: trans.__('Reload contents from disk'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            // Checks that shell.currentWidget is valid:
            if (!isEnabled()) {
                return;
            }
            const context = docManager.contextForWidget(shell.currentWidget);
            const type = fileType(shell.currentWidget, docManager);
            if (!context) {
                return (0,lib_index_js_.showDialog)({
                    title: trans.__('Cannot Reload'),
                    body: trans.__('No context found for current widget!'),
                    buttons: [lib_index_js_.Dialog.okButton()]
                });
            }
            if (context.model.dirty) {
                return (0,lib_index_js_.showDialog)({
                    title: trans.__('Reload %1 from Disk', type),
                    body: trans.__('Are you sure you want to reload the %1 from the disk?', type),
                    buttons: [
                        lib_index_js_.Dialog.cancelButton(),
                        lib_index_js_.Dialog.warnButton({ label: trans.__('Reload') })
                    ]
                }).then(result => {
                    if (result.button.accept && !context.isDisposed) {
                        return context.revert();
                    }
                });
            }
            else {
                if (!context.isDisposed) {
                    return context.revert();
                }
            }
        }
    });
    commands.addCommand(lib_CommandIDs.restoreCheckpoint, {
        label: () => trans.__('Revert %1 to Checkpoint…', fileType(shell.currentWidget, docManager)),
        caption: trans.__('Revert contents to previous checkpoint'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            // Checks that shell.currentWidget is valid:
            if (!isEnabled()) {
                return;
            }
            const context = docManager.contextForWidget(shell.currentWidget);
            if (!context) {
                return (0,lib_index_js_.showDialog)({
                    title: trans.__('Cannot Revert'),
                    body: trans.__('No context found for current widget!'),
                    buttons: [lib_index_js_.Dialog.okButton()]
                });
            }
            return context.listCheckpoints().then(async (checkpoints) => {
                const type = fileType(shell.currentWidget, docManager);
                if (checkpoints.length < 1) {
                    await (0,lib_index_js_.showErrorMessage)(trans.__('No checkpoints'), trans.__('No checkpoints are available for this %1.', type));
                    return;
                }
                const targetCheckpoint = checkpoints.length === 1
                    ? checkpoints[0]
                    : await Private.getTargetCheckpoint(checkpoints.reverse(), trans);
                if (!targetCheckpoint) {
                    return;
                }
                return (0,lib_index_js_.showDialog)({
                    title: trans.__('Revert %1 to checkpoint', type),
                    body: new RevertConfirmWidget(targetCheckpoint, trans, type),
                    buttons: [
                        lib_index_js_.Dialog.cancelButton(),
                        lib_index_js_.Dialog.warnButton({
                            label: trans.__('Revert'),
                            ariaLabel: trans.__('Revert to Checkpoint')
                        })
                    ]
                }).then(result => {
                    if (context.isDisposed) {
                        return;
                    }
                    if (result.button.accept) {
                        if (context.model.readOnly) {
                            return context.revert();
                        }
                        return context
                            .restoreCheckpoint(targetCheckpoint.id)
                            .then(() => context.revert());
                    }
                });
            });
        }
    });
    const caption = () => {
        if (shell.currentWidget) {
            if (!isWritable()) {
                return trans.__(`Document is read-only. "Save" is disabled; use "Save as…" instead`);
            }
        }
        return trans.__('Save and create checkpoint');
    };
    const saveInProgress = new WeakSet();
    commands.addCommand(lib_CommandIDs.save, {
        label: () => trans.__('Save %1', fileType(shell.currentWidget, docManager)),
        caption,
        icon: args => (args.toolbar ? ui_components_lib_index_js_.saveIcon : undefined),
        isEnabled: args => {
            if (args._luminoEvent) {
                return args._luminoEvent.type ===
                    'keybinding'
                    ? true
                    : isWritable();
            }
            else {
                return isWritable();
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether executed from toolbar'
                    },
                    _luminoEvent: {
                        type: 'object',
                        description: 'The lumino event object'
                    }
                }
            }
        },
        execute: async (args) => {
            var _a, _b, _c, _d, _e;
            // Checks that shell.currentWidget is valid:
            const widget = shell.currentWidget;
            const context = docManager.contextForWidget(widget);
            if (isEnabled()) {
                if (!context) {
                    return (0,lib_index_js_.showDialog)({
                        title: trans.__('Cannot Save'),
                        body: trans.__('No context found for current widget!'),
                        buttons: [lib_index_js_.Dialog.okButton()]
                    });
                }
                else {
                    if (saveInProgress.has(context)) {
                        return;
                    }
                    if (!((_a = context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable)) {
                        let type = (_b = args._luminoEvent) === null || _b === void 0 ? void 0 : _b.type;
                        if (args._luminoEvent && type === 'keybinding') {
                            readonlyNotification(context.path);
                            return;
                        }
                        else {
                            return (0,lib_index_js_.showDialog)({
                                title: trans.__('Cannot Save'),
                                body: trans.__('Document is read-only'),
                                buttons: [lib_index_js_.Dialog.okButton()]
                            });
                        }
                    }
                    saveInProgress.add(context);
                    const oldName = coreutils_lib_index_js_.PathExt.basename((_d = (_c = context.contentsModel) === null || _c === void 0 ? void 0 : _c.path) !== null && _d !== void 0 ? _d : '');
                    let newName = oldName;
                    if (docManager.renameUntitledFileOnSave &&
                        widget.isUntitled === true) {
                        const result = await lib_index_js_.InputDialog.getText({
                            title: trans.__('Rename file'),
                            okLabel: trans.__('Rename and Save'),
                            placeholder: trans.__('File name'),
                            text: oldName,
                            selectionRange: oldName.length - coreutils_lib_index_js_.PathExt.extname(oldName).length,
                            checkbox: {
                                label: trans.__('Do not ask for rename on first save.'),
                                caption: trans.__('If checked, you will not be asked to rename future untitled files when saving them.')
                            }
                        });
                        if (result.button.accept) {
                            newName = (_e = result.value) !== null && _e !== void 0 ? _e : oldName;
                            widget.isUntitled = false;
                            if (typeof result.isChecked === 'boolean') {
                                const currentSetting = (await settingRegistry.get(docManagerPluginId, 'renameUntitledFileOnSave')).composite;
                                if (result.isChecked === currentSetting) {
                                    settingRegistry
                                        .set(docManagerPluginId, 'renameUntitledFileOnSave', !result.isChecked)
                                        .catch(reason => {
                                        console.error(`Fail to set 'renameUntitledFileOnSave:\n${reason}`);
                                    });
                                }
                            }
                        }
                    }
                    try {
                        await context.save();
                        if (newName !== oldName) {
                            await context.rename(newName);
                        }
                        if (!(widget === null || widget === void 0 ? void 0 : widget.isDisposed)) {
                            await context.createCheckpoint();
                        }
                    }
                    catch (err) {
                        // If the save was canceled by user-action, do nothing.
                        if (err.name === 'ModalCancelError') {
                            return;
                        }
                        throw err;
                    }
                    finally {
                        saveInProgress.delete(context);
                    }
                }
            }
        }
    });
    commands.addCommand(lib_CommandIDs.saveAll, {
        label: () => trans.__('Save All'),
        caption: trans.__('Save all open documents'),
        isEnabled: () => {
            return (0,index_es6_js_.some)(shell.widgets('main'), w => { var _a, _b, _c; return (_c = (_b = (_a = docManager.contextForWidget(w)) === null || _a === void 0 ? void 0 : _a.contentsModel) === null || _b === void 0 ? void 0 : _b.writable) !== null && _c !== void 0 ? _c : false; });
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            var _a;
            const promises = [];
            const paths = new Set(); // Cache so we don't double save files.
            for (const widget of shell.widgets('main')) {
                const context = docManager.contextForWidget(widget);
                if (context && !paths.has(context.path)) {
                    if ((_a = context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable) {
                        paths.add(context.path);
                        promises.push(context.save());
                    }
                    else {
                        readonlyNotification(context.path);
                    }
                }
            }
            return Promise.all(promises);
        }
    });
    commands.addCommand(lib_CommandIDs.saveAs, {
        label: () => trans.__('Save %1 As…', fileType(shell.currentWidget, docManager)),
        caption: trans.__('Save with new path'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            // Checks that shell.currentWidget is valid:
            if (isEnabled()) {
                const context = docManager.contextForWidget(shell.currentWidget);
                if (!context) {
                    return (0,lib_index_js_.showDialog)({
                        title: trans.__('Cannot Save'),
                        body: trans.__('No context found for current widget!'),
                        buttons: [lib_index_js_.Dialog.okButton()]
                    });
                }
                const onChange = (sender, args) => {
                    if (args.type === 'save' &&
                        args.newValue &&
                        args.newValue.path !== context.path) {
                        void docManager.closeFile(context.path);
                        void commands.execute(lib_CommandIDs.open, {
                            path: args.newValue.path
                        });
                    }
                };
                docManager.services.contents.fileChanged.connect(onChange);
                void context
                    .saveAs()
                    .finally(() => docManager.services.contents.fileChanged.disconnect(onChange));
            }
        }
    });
    (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {
        [
            lib_CommandIDs.reload,
            lib_CommandIDs.restoreCheckpoint,
            lib_CommandIDs.save,
            lib_CommandIDs.saveAll,
            lib_CommandIDs.saveAs
        ].forEach(cmd => {
            app.commands.notifyCommandChanged(cmd);
        });
    });
    commands.addCommand(lib_CommandIDs.toggleAutosave, {
        label: trans.__('Autosave Documents'),
        isToggled: () => docManager.autosave,
        execute: () => {
            const value = !docManager.autosave;
            const key = 'autosave';
            return settingRegistry
                .set(docManagerPluginId, key, value)
                .catch((reason) => {
                console.error(`Failed to set ${docManagerPluginId}:${key} - ${reason.message}`);
            });
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    if (palette) {
        [
            lib_CommandIDs.reload,
            lib_CommandIDs.restoreCheckpoint,
            lib_CommandIDs.save,
            lib_CommandIDs.saveAs,
            lib_CommandIDs.toggleAutosave,
            lib_CommandIDs.duplicate
        ].forEach(command => {
            palette.addItem({ command, category });
        });
    }
}
function addLabCommands(app, docManager, labShell, widgetOpener, translator, dialogs) {
    const trans = translator.load('jupyterlab');
    const { commands } = app;
    // Returns the doc widget associated with the most recent contextmenu event.
    const contextMenuWidget = () => {
        var _a;
        const pathRe = /[Pp]ath:\s?(.*)\n?/;
        const test = (node) => { var _a; return !!((_a = node['title']) === null || _a === void 0 ? void 0 : _a.match(pathRe)); };
        const node = app.contextMenuHitTest(test);
        const pathMatch = node === null || node === void 0 ? void 0 : node['title'].match(pathRe);
        return ((_a = (pathMatch && docManager.findWidget(pathMatch[1], null))) !== null && _a !== void 0 ? _a : 
        // Fall back to active doc widget if path cannot be obtained from event.
        labShell.currentWidget);
    };
    // Returns `true` if the current widget has a document context.
    const isEnabled = () => {
        const { currentWidget } = labShell;
        return !!(currentWidget && docManager.contextForWidget(currentWidget));
    };
    commands.addCommand(lib_CommandIDs.clone, {
        label: () => trans.__('New View for %1', fileType(contextMenuWidget(), docManager)),
        isEnabled,
        execute: args => {
            const widget = contextMenuWidget();
            const options = args['options'] || {
                mode: 'split-right'
            };
            if (!widget) {
                return;
            }
            // Clone the widget.
            const child = docManager.cloneWidget(widget);
            if (child) {
                widgetOpener.open(child, options);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    options: {
                        type: 'object',
                        description: trans.__('Options for opening the cloned document')
                    }
                }
            }
        }
    });
    commands.addCommand(lib_CommandIDs.rename, {
        label: () => {
            let t = fileType(contextMenuWidget(), docManager);
            if (t) {
                t = ' ' + t;
            }
            return trans.__('Rename%1…', t);
        },
        isEnabled,
        execute: () => {
            // Implies contextMenuWidget() !== null
            if (isEnabled()) {
                const context = docManager.contextForWidget(contextMenuWidget());
                return dialogs.rename(context);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(lib_CommandIDs.duplicate, {
        label: () => trans.__('Duplicate %1', fileType(contextMenuWidget(), docManager)),
        isEnabled,
        execute: () => {
            if (isEnabled()) {
                const context = docManager.contextForWidget(contextMenuWidget());
                if (!context) {
                    return;
                }
                return docManager.duplicate(context.path);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(lib_CommandIDs.del, {
        label: () => trans.__('Delete %1', fileType(contextMenuWidget(), docManager)),
        isEnabled,
        execute: async () => {
            // Implies contextMenuWidget() !== null
            if (isEnabled()) {
                const context = docManager.contextForWidget(contextMenuWidget());
                if (!context) {
                    return;
                }
                const result = await (0,lib_index_js_.showDialog)({
                    title: trans.__('Delete'),
                    body: trans.__('Are you sure you want to delete %1', context.path),
                    buttons: [
                        lib_index_js_.Dialog.cancelButton(),
                        lib_index_js_.Dialog.warnButton({ label: trans.__('Delete') })
                    ]
                });
                if (result.button.accept) {
                    await app.commands.execute('docmanager:delete-file', {
                        path: context.path
                    });
                }
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(lib_CommandIDs.showInFileBrowser, {
        label: () => trans.__('Show in File Browser'),
        isEnabled,
        execute: async () => {
            const widget = contextMenuWidget();
            const context = widget && docManager.contextForWidget(widget);
            if (!context) {
                return;
            }
            // 'activate' is needed if this command is selected in the "open tabs" sidebar
            await commands.execute('filebrowser:activate', { path: context.path });
            await commands.execute('filebrowser:go-to-path', { path: context.path });
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    labShell.currentChanged.connect(() => {
        [
            lib_CommandIDs.clone,
            lib_CommandIDs.rename,
            lib_CommandIDs.duplicate,
            lib_CommandIDs.del,
            lib_CommandIDs.showInFileBrowser
        ].forEach(cmd => {
            app.commands.notifyCommandChanged(cmd);
        });
    });
}
/**
 * Handle dirty state for a context.
 */
function handleContext(status, context) {
    let disposable = null;
    const onStateChanged = (sender, args) => {
        if (args.name === 'dirty') {
            if (args.newValue === true) {
                if (!disposable) {
                    disposable = status.setDirty();
                }
            }
            else if (disposable) {
                disposable.dispose();
                disposable = null;
            }
        }
    };
    void context.ready.then(() => {
        context.model.stateChanged.connect(onStateChanged);
        if (context.model.dirty) {
            disposable = status.setDirty();
        }
    });
    context.disposed.connect(() => {
        if (disposable) {
            disposable.dispose();
        }
    });
}
/**
 * A namespace for private module data.
 */
var Private;
(function (Private) {
    /**
     * A counter for unique IDs.
     */
    Private.id = 0;
    function createRevertConfirmNode(checkpoint, fileType, trans) {
        const body = document.createElement('div');
        const confirmMessage = document.createElement('p');
        const confirmText = document.createTextNode(trans.__('Are you sure you want to revert the %1 to checkpoint? ', fileType));
        const cannotUndoText = document.createElement('strong');
        cannotUndoText.textContent = trans.__('This cannot be undone.');
        confirmMessage.appendChild(confirmText);
        confirmMessage.appendChild(cannotUndoText);
        const lastCheckpointMessage = document.createElement('p');
        const lastCheckpointText = document.createTextNode(trans.__('The checkpoint was last updated at: '));
        const lastCheckpointDate = document.createElement('p');
        const date = new Date(checkpoint.last_modified);
        lastCheckpointDate.style.textAlign = 'center';
        lastCheckpointDate.textContent =
            coreutils_lib_index_js_.Time.format(date) + ' (' + coreutils_lib_index_js_.Time.formatHuman(date) + ')';
        lastCheckpointMessage.appendChild(lastCheckpointText);
        lastCheckpointMessage.appendChild(lastCheckpointDate);
        body.appendChild(confirmMessage);
        body.appendChild(lastCheckpointMessage);
        return body;
    }
    Private.createRevertConfirmNode = createRevertConfirmNode;
    /**
     * Ask user for a checkpoint to revert to.
     */
    async function getTargetCheckpoint(checkpoints, trans) {
        // the id could be too long to show so use the index instead
        const indexSeparator = '.';
        const items = checkpoints.map((checkpoint, index) => {
            const isoDate = coreutils_lib_index_js_.Time.format(checkpoint.last_modified);
            const humanDate = coreutils_lib_index_js_.Time.formatHuman(checkpoint.last_modified);
            return `${index}${indexSeparator} ${isoDate} (${humanDate})`;
        });
        const selectedItem = (await lib_index_js_.InputDialog.getItem({
            items: items,
            title: trans.__('Choose a checkpoint')
        })).value;
        if (!selectedItem) {
            return;
        }
        const selectedIndex = selectedItem.split(indexSeparator, 1)[0];
        return checkpoints[parseInt(selectedIndex, 10)];
    }
    Private.getTargetCheckpoint = getTargetCheckpoint;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 91532:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_statusbar_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(546);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_rendermime_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45304);
/* harmony import */ var _jupyterlab_docregistry_style_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30507);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_docmanager_style_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81393);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */










/***/ }),

/***/ 37543:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  DocumentManager: () => (/* reexport */ DocumentManager),
  DocumentManagerDialogs: () => (/* reexport */ DocumentManagerDialogs),
  DocumentWidgetManager: () => (/* reexport */ DocumentWidgetManager),
  IDocumentManager: () => (/* reexport */ IDocumentManager),
  IDocumentManagerDialogs: () => (/* reexport */ IDocumentManagerDialogs),
  IDocumentWidgetOpener: () => (/* reexport */ IDocumentWidgetOpener),
  IRecentsManager: () => (/* reexport */ IRecentsManager),
  PathStatus: () => (/* reexport */ PathStatus),
  RecentsManager: () => (/* reexport */ RecentsManager),
  SaveHandler: () => (/* reexport */ SaveHandler),
  SavingStatus: () => (/* reexport */ SavingStatus),
  isValidFileName: () => (/* reexport */ isValidFileName),
  renameDialog: () => (/* reexport */ renameDialog),
  renameFile: () => (/* reexport */ renameFile),
  shouldOverwrite: () => (/* reexport */ shouldOverwrite)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/dialogs.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * The class name added to file dialogs.
 */
const FILE_DIALOG_CLASS = 'jp-FileDialog';
/**
 * The class name added for the new name label in the rename dialog
 */
const RENAME_NEW_NAME_TITLE_CLASS = 'jp-new-name-title';
/**
 * Default implementation of IDocumentManagerDialogs.
 */
class DocumentManagerDialogs {
    constructor(options = {}) {
        this._translator = options.translator || translation_lib_index_js_.nullTranslator;
    }
    /**
     * Show a dialog to rename a file.
     */
    async rename(context) {
        const trans = this._translator.load('jupyterlab');
        const localPath = context.localPath.split('/');
        const fileName = localPath.pop() || context.localPath;
        const handler = new RenameHandler(fileName, this._translator);
        const result = await (0,index_js_.showDialog)({
            title: trans.__('Rename File'),
            body: handler,
            buttons: [
                index_js_.Dialog.cancelButton(),
                index_js_.Dialog.okButton({
                    label: trans.__('Rename'),
                    ariaLabel: trans.__('Rename File')
                })
            ],
            focusNodeSelector: 'input'
        });
        if (!result.button.accept) {
            return null;
        }
        const newPath = result.value;
        if (!newPath || newPath === fileName) {
            return null;
        }
        if (!isValidFileName(newPath)) {
            void (0,index_js_.showErrorMessage)(trans.__('Rename Error'), Error(trans.__('"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"', result.value)));
            return null;
        }
        return context.rename(newPath);
    }
    /**
     * Show a dialog asking whether to close a document.
     */
    async confirmClose(options) {
        const trans = this._translator.load('jupyterlab');
        const { fileName, isDirty } = options;
        const buttons = [
            index_js_.Dialog.cancelButton(),
            index_js_.Dialog.okButton({
                label: isDirty ? trans.__('Close and save') : trans.__('Close'),
                ariaLabel: isDirty
                    ? trans.__('Close and save Document')
                    : trans.__('Close Document')
            })
        ];
        if (isDirty) {
            buttons.splice(1, 0, index_js_.Dialog.warnButton({
                label: trans.__('Close without saving'),
                ariaLabel: trans.__('Close Document without saving')
            }));
        }
        const confirm = await (0,index_js_.showDialog)({
            title: trans.__('Confirmation'),
            body: trans.__('Please confirm you want to close "%1".', fileName),
            checkbox: isDirty
                ? null
                : {
                    label: trans.__('Do not ask me again.'),
                    caption: trans.__('If checked, no confirmation to close a document will be asked in the future.')
                },
            buttons
        });
        const shouldClose = confirm.button.accept;
        const ignoreSave = isDirty ? confirm.button.displayType === 'warn' : true;
        const doNotAskAgain = confirm.isChecked === true;
        return { shouldClose, ignoreSave, doNotAskAgain };
    }
    /**
     * Show a dialog asking whether to save before closing a dirty document.
     */
    async saveBeforeClose(options) {
        const trans = this._translator.load('jupyterlab');
        const { fileName, writable } = options;
        const saveLabel = writable ? trans.__('Save') : trans.__('Save as');
        const result = await (0,index_js_.showDialog)({
            title: trans.__('Save your work'),
            body: trans.__('Save changes in "%1" before closing?', fileName),
            buttons: [
                index_js_.Dialog.cancelButton(),
                index_js_.Dialog.warnButton({
                    label: trans.__('Discard'),
                    ariaLabel: trans.__('Discard changes to file')
                }),
                index_js_.Dialog.okButton({ label: saveLabel })
            ]
        });
        const shouldClose = result.button.accept;
        const ignoreSave = result.button.displayType === 'warn';
        return { shouldClose, ignoreSave };
    }
}
/**
 * Rename a file with a dialog.
 *
 * @deprecated You should use {@link DocumentManagerDialogs.rename}
 */
function renameDialog(manager, context, translator, dialogs) {
    if (dialogs) {
        return dialogs.rename(context);
    }
    const newDialogs = new DocumentManagerDialogs({ translator: translator });
    return newDialogs.rename(context);
}
/**
 * Rename a file, asking for confirmation if it is overwriting another.
 */
function renameFile(manager, oldPath, newPath) {
    return manager.rename(oldPath, newPath).catch(error => {
        if (error.response.status !== 409) {
            // if it's not caused by an already existing file, rethrow
            throw error;
        }
        // otherwise, ask for confirmation
        return shouldOverwrite(newPath).then((value) => {
            if (value) {
                return manager.overwrite(oldPath, newPath);
            }
            return Promise.reject('File not renamed');
        });
    });
}
/**
 * Ask the user whether to overwrite a file.
 */
function shouldOverwrite(path, translator) {
    translator = translator || translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const options = {
        title: trans.__('Overwrite file?'),
        body: trans.__('"%1" already exists, overwrite?', path),
        buttons: [
            index_js_.Dialog.cancelButton(),
            index_js_.Dialog.warnButton({
                label: trans.__('Overwrite'),
                ariaLabel: trans.__('Overwrite Existing File')
            })
        ]
    };
    return (0,index_js_.showDialog)(options).then(result => {
        return Promise.resolve(result.button.accept);
    });
}
/**
 * Test whether a name is a valid file name
 *
 * Disallows "/", "\", and ":" in file names, as well as names with zero length.
 */
function isValidFileName(name) {
    const validNameExp = /[\/\\:]/;
    return name.length > 0 && !validNameExp.test(name);
}
/**
 * A widget used to rename a file.
 */
class RenameHandler extends index_es6_js_.Widget {
    /**
     * Construct a new "rename" dialog.
     */
    constructor(oldPath, translator) {
        super({ node: Private.createRenameNode(oldPath, translator) });
        this.addClass(FILE_DIALOG_CLASS);
        const ext = lib_index_js_.PathExt.extname(oldPath);
        const value = (this.inputNode.value = lib_index_js_.PathExt.basename(oldPath));
        this.inputNode.setSelectionRange(0, value.length - ext.length);
    }
    /**
     * Get the input text node.
     */
    get inputNode() {
        return this.node.getElementsByTagName('input')[0];
    }
    /**
     * Get the value of the widget.
     */
    getValue() {
        return this.inputNode.value;
    }
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * Create the node for a rename handler.
     */
    function createRenameNode(oldPath, translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const body = document.createElement('div');
        const existingLabel = document.createElement('label');
        existingLabel.textContent = trans.__('File Path');
        const existingPath = document.createElement('span');
        existingPath.textContent = oldPath;
        const nameTitle = document.createElement('label');
        nameTitle.textContent = trans.__('New Name');
        nameTitle.className = RENAME_NEW_NAME_TITLE_CLASS;
        const name = document.createElement('input');
        body.appendChild(existingLabel);
        body.appendChild(existingPath);
        body.appendChild(nameTitle);
        body.appendChild(name);
        return body;
    }
    Private.createRenameNode = createRenameNode;
})(Private || (Private = {}));
//# sourceMappingURL=dialogs.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/properties@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/properties/dist/index.es6.js)
var properties_dist_index_es6_js_ = __webpack_require__(10249);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var signaling_dist_index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/savehandler.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A class that manages the auto saving of a document.
 *
 * #### Notes
 * Implements https://github.com/ipython/ipython/wiki/IPEP-15:-Autosaving-the-IPython-Notebook.
 */
class SaveHandler {
    /**
     * Construct a new save handler.
     */
    constructor(options) {
        this._autosaveTimer = -1;
        this._minInterval = -1;
        this._interval = -1;
        this._isActive = false;
        this._inDialog = false;
        this._isDisposed = false;
        this._multiplier = 10;
        this._context = options.context;
        this._isConnectedCallback = options.isConnectedCallback || (() => true);
        const interval = options.saveInterval || 120;
        this._minInterval = interval * 1000;
        this._interval = this._minInterval;
        // Restart the timer when the contents model is updated.
        this._context.fileChanged.connect(this._setTimer, this);
        this._context.disposed.connect(this.dispose, this);
    }
    /**
     * The save interval used by the timer (in seconds).
     */
    get saveInterval() {
        return this._interval / 1000;
    }
    set saveInterval(value) {
        this._minInterval = this._interval = value * 1000;
        if (this._isActive) {
            this._setTimer();
        }
    }
    /**
     * Get whether the handler is active.
     */
    get isActive() {
        return this._isActive;
    }
    /**
     * Get whether the save handler is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the save handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        clearTimeout(this._autosaveTimer);
        signaling_dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Start the autosaver.
     */
    start() {
        this._isActive = true;
        this._setTimer();
    }
    /**
     * Stop the autosaver.
     */
    stop() {
        this._isActive = false;
        clearTimeout(this._autosaveTimer);
    }
    /**
     * Set the timer.
     */
    _setTimer() {
        clearTimeout(this._autosaveTimer);
        if (!this._isActive) {
            return;
        }
        this._autosaveTimer = window.setTimeout(() => {
            if (this._isConnectedCallback()) {
                this._save();
            }
            else {
                this._setTimer();
            }
        }, this._interval);
    }
    /**
     * Handle an autosave timeout.
     */
    _save() {
        var _a;
        const context = this._context;
        // Trigger the next update.
        this._setTimer();
        if (!context) {
            return;
        }
        // Bail if the model is not dirty or the file is not non-savable, or the dialog
        // is already showing.
        if (!((_a = context.canSave) !== null && _a !== void 0 ? _a : true) || !context.model.dirty || this._inDialog) {
            return;
        }
        const start = new Date().getTime();
        context
            .save()
            .then(() => {
            if (this.isDisposed) {
                return;
            }
            const duration = new Date().getTime() - start;
            // New save interval: higher of 10x save duration or min interval.
            this._interval = Math.max(this._multiplier * duration, this._minInterval);
            // Restart the update to pick up the new interval.
            this._setTimer();
        })
            .catch(err => {
            // If the user canceled the save, do nothing.
            const { name } = err;
            if (name === 'ModalCancelError' || name === 'ModalDuplicateError') {
                return;
            }
            // Otherwise, log the error.
            console.error('Error in Auto-Save', err.message);
        });
    }
}
//# sourceMappingURL=savehandler.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/widgetmanager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The class name added to document widgets.
 */
const DOCUMENT_CLASS = 'jp-Document';
/**
 * A class that maintains the lifecycle of file-backed widgets.
 */
class DocumentWidgetManager {
    /**
     * Construct a new document widget manager.
     */
    constructor(options) {
        this._activateRequested = new signaling_dist_index_es6_js_.Signal(this);
        this._confirmClosingTab = false;
        this._isDisposed = false;
        this._stateChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._registry = options.registry;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._recentsManager = options.recentsManager || null;
        this._dialogs = options.dialogs || null;
    }
    /**
     * A signal emitted when one of the documents is activated.
     */
    get activateRequested() {
        return this._activateRequested;
    }
    /**
     * Whether to ask confirmation to close a tab or not.
     */
    get confirmClosingDocument() {
        return this._confirmClosingTab;
    }
    set confirmClosingDocument(v) {
        if (this._confirmClosingTab !== v) {
            const oldValue = this._confirmClosingTab;
            this._confirmClosingTab = v;
            this._stateChanged.emit({
                name: 'confirmClosingDocument',
                oldValue,
                newValue: v
            });
        }
    }
    /**
     * Signal triggered when an attribute changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * Test whether the document widget manager is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the widget manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_dist_index_es6_js_.Signal.disconnectReceiver(this);
    }
    /**
     * Create a widget for a document and handle its lifecycle.
     *
     * @param factory - The widget factory.
     *
     * @param context - The document context object.
     *
     * @returns A widget created by the factory.
     *
     * @throws If the factory is not registered.
     */
    createWidget(factory, context) {
        const widget = factory.createNew(context);
        this._initializeWidget(widget, factory, context);
        return widget;
    }
    /**
     * When a new widget is created, we need to hook it up
     * with some signals, update the widget extensions (for
     * this kind of widget) in the docregistry, among
     * other things.
     */
    _initializeWidget(widget, factory, context) {
        widgetmanager_Private.factoryProperty.set(widget, factory);
        // Handle widget extensions.
        const disposables = new disposable_dist_index_es6_js_.DisposableSet();
        for (const extender of this._registry.widgetExtensions(factory.name)) {
            const disposable = extender.createNew(widget, context);
            if (disposable) {
                disposables.add(disposable);
            }
        }
        widgetmanager_Private.disposablesProperty.set(widget, disposables);
        widget.disposed.connect(this._onWidgetDisposed, this);
        this.adoptWidget(context, widget);
        context.fileChanged.connect(this._onFileChanged, this);
        context.pathChanged.connect(this._onPathChanged, this);
        void context.ready.then(() => {
            void this.setCaption(widget);
        });
    }
    /**
     * Install the message hook for the widget and add to list
     * of known widgets.
     *
     * @param context - The document context object.
     *
     * @param widget - The widget to adopt.
     */
    adoptWidget(context, widget) {
        const widgets = widgetmanager_Private.widgetsProperty.get(context);
        widgets.push(widget);
        messaging_dist_index_es6_js_.MessageLoop.installMessageHook(widget, this);
        widget.addClass(DOCUMENT_CLASS);
        widget.title.closable = true;
        widget.disposed.connect(this._widgetDisposed, this);
        widgetmanager_Private.contextProperty.set(widget, context);
    }
    /**
     * See if a widget already exists for the given context and widget name.
     *
     * @param context - The document context object.
     *
     * @returns The found widget, or `undefined`.
     *
     * #### Notes
     * This can be used to use an existing widget instead of opening
     * a new widget.
     */
    findWidget(context, widgetName) {
        const widgets = widgetmanager_Private.widgetsProperty.get(context);
        if (!widgets) {
            return undefined;
        }
        return (0,dist_index_es6_js_.find)(widgets, widget => {
            const factory = widgetmanager_Private.factoryProperty.get(widget);
            if (!factory) {
                return false;
            }
            return factory.name === widgetName;
        });
    }
    /**
     * Get the document context for a widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The context associated with the widget, or `undefined`.
     */
    contextForWidget(widget) {
        return widgetmanager_Private.contextProperty.get(widget);
    }
    /**
     * Clone a widget.
     *
     * @param widget - The source widget.
     *
     * @returns A new widget or `undefined`.
     *
     * #### Notes
     *  Uses the same widget factory and context as the source, or throws
     *  if the source widget is not managed by this manager.
     */
    cloneWidget(widget) {
        const context = widgetmanager_Private.contextProperty.get(widget);
        if (!context) {
            return undefined;
        }
        const factory = widgetmanager_Private.factoryProperty.get(widget);
        if (!factory) {
            return undefined;
        }
        const newWidget = factory.createNew(context, widget);
        this._initializeWidget(newWidget, factory, context);
        return newWidget;
    }
    /**
     * Close the widgets associated with a given context.
     *
     * @param context - The document context object.
     */
    closeWidgets(context) {
        const widgets = widgetmanager_Private.widgetsProperty.get(context);
        return Promise.all(widgets.map(widget => this.onClose(widget))).then(() => undefined);
    }
    /**
     * Dispose of the widgets associated with a given context
     * regardless of the widget's dirty state.
     *
     * @param context - The document context object.
     */
    deleteWidgets(context) {
        const widgets = widgetmanager_Private.widgetsProperty.get(context);
        return Promise.all(widgets.map(widget => this.onDelete(widget))).then(() => undefined);
    }
    /**
     * Filter a message sent to a message handler.
     *
     * @param handler - The target handler of the message.
     *
     * @param msg - The message dispatched to the handler.
     *
     * @returns `false` if the message should be filtered, of `true`
     *   if the message should be dispatched to the handler as normal.
     */
    messageHook(handler, msg) {
        switch (msg.type) {
            case 'close-request':
                void this.onClose(handler);
                return false;
            case 'activate-request': {
                const widget = handler;
                const context = this.contextForWidget(widget);
                if (context) {
                    context.ready
                        .then(() => {
                        // contentsModel is null until the context is ready
                        this._recordAsRecentlyOpened(widget, context.contentsModel);
                    })
                        .catch(() => {
                        console.warn('Could not record the recents status for', context);
                    });
                    this._activateRequested.emit(context.path);
                }
                break;
            }
            default:
                break;
        }
        return true;
    }
    /**
     * Set the caption for widget title.
     *
     * @param widget - The target widget.
     */
    async setCaption(widget) {
        const trans = this.translator.load('jupyterlab');
        const context = widgetmanager_Private.contextProperty.get(widget);
        if (!context) {
            return;
        }
        const model = context.contentsModel;
        if (!model) {
            widget.title.caption = '';
            return;
        }
        return context
            .listCheckpoints()
            .then((checkpoints) => {
            if (widget.isDisposed) {
                return;
            }
            const last = checkpoints[checkpoints.length - 1];
            const checkpoint = last ? lib_index_js_.Time.format(last.last_modified) : 'None';
            let caption = trans.__('Name: %1\nPath: %2\n', model.name, model.path);
            if (context.model.readOnly) {
                caption += trans.__('Read-only');
            }
            else {
                caption +=
                    trans.__('Last Saved: %1\n', lib_index_js_.Time.format(model.last_modified)) +
                        trans.__('Last Checkpoint: %1', checkpoint);
            }
            widget.title.caption = caption;
        });
    }
    /**
     * Handle `'close-request'` messages.
     *
     * @param widget - The target widget.
     *
     * @returns A promise that resolves with whether the widget was closed.
     */
    async onClose(widget) {
        var _a;
        // Handle dirty state.
        const [shouldClose, ignoreSave] = await this._maybeClose(widget, this.translator);
        if (widget.isDisposed) {
            return true;
        }
        if (shouldClose) {
            const context = widgetmanager_Private.contextProperty.get(widget);
            if (!ignoreSave) {
                if (!context) {
                    return true;
                }
                if ((_a = context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable) {
                    await context.save();
                }
                else {
                    const saveAsSuccessfull = await context.saveAs();
                    if (!saveAsSuccessfull) {
                        return false;
                    }
                }
            }
            if (context) {
                const result = await Promise.race([
                    context.ready,
                    new Promise(resolve => setTimeout(resolve, 3000, 'timeout'))
                ]);
                if (result === 'timeout') {
                    console.warn('Could not record the widget as recently closed because the context did not become ready in 3 seconds');
                }
                else {
                    // Note: `contentsModel` is null until the the context is ready;
                    // we have to handle it after `await` rather than in a `then`
                    // to ensure we record it as recent before the widget gets disposed.
                    this._recordAsRecentlyClosed(widget, context.contentsModel);
                }
            }
            if (widget.isDisposed) {
                return true;
            }
            widget.dispose();
        }
        return shouldClose;
    }
    /**
     * Dispose of widget regardless of widget's dirty state.
     *
     * @param widget - The target widget.
     */
    onDelete(widget) {
        widget.dispose();
        return Promise.resolve(void 0);
    }
    /**
     * Record the activated file, and its parent directory, as recently opened.
     */
    _recordAsRecentlyOpened(widget, model) {
        var _a;
        const recents = this._recentsManager;
        if (!recents) {
            // no-op
            return;
        }
        const path = model.path;
        const fileType = this._registry.getFileTypeForModel(model);
        const contentType = fileType.contentType;
        const factory = (_a = widgetmanager_Private.factoryProperty.get(widget)) === null || _a === void 0 ? void 0 : _a.name;
        recents.addRecent({ path, contentType, factory }, 'opened');
        // Add the containing directory, too
        if (contentType !== 'directory') {
            const parent = path.lastIndexOf('/') > 0 ? path.slice(0, path.lastIndexOf('/')) : '';
            recents.addRecent({ path: parent, contentType: 'directory' }, 'opened');
        }
    }
    /**
     * Record the activated file, and its parent directory, as recently opened.
     */
    _recordAsRecentlyClosed(widget, model) {
        var _a;
        const recents = this._recentsManager;
        if (!recents) {
            // no-op
            return;
        }
        const path = model.path;
        const fileType = this._registry.getFileTypeForModel(model);
        const contentType = fileType.contentType;
        const factory = (_a = widgetmanager_Private.factoryProperty.get(widget)) === null || _a === void 0 ? void 0 : _a.name;
        recents.addRecent({ path, contentType, factory }, 'closed');
    }
    /**
     * Ask the user whether to close an unsaved file.
     */
    async _maybeClose(widget, translator) {
        var _a, _b, _c;
        translator = translator || translation_lib_index_js_.nullTranslator;
        // Bail if the model is not dirty or other widgets are using the model.)
        const context = widgetmanager_Private.contextProperty.get(widget);
        if (!context) {
            return Promise.resolve([true, true]);
        }
        let widgets = widgetmanager_Private.widgetsProperty.get(context);
        if (!widgets) {
            return Promise.resolve([true, true]);
        }
        // Filter by whether the factories are read only.
        widgets = widgets.filter(widget => {
            const factory = widgetmanager_Private.factoryProperty.get(widget);
            if (!factory) {
                return false;
            }
            return factory.readOnly === false;
        });
        const fileName = widget.title.label;
        const factory = widgetmanager_Private.factoryProperty.get(widget);
        const isDirty = context.model.dirty &&
            widgets.length <= 1 &&
            !((_a = factory === null || factory === void 0 ? void 0 : factory.readOnly) !== null && _a !== void 0 ? _a : true);
        const dialogs = (_b = this._dialogs) !== null && _b !== void 0 ? _b : new DocumentManagerDialogs({ translator: translator });
        // Ask confirmation
        if (this.confirmClosingDocument) {
            const { shouldClose, ignoreSave, doNotAskAgain } = await dialogs.confirmClose({ fileName, isDirty });
            if (doNotAskAgain) {
                this.confirmClosingDocument = false;
            }
            return Promise.resolve([shouldClose, ignoreSave]);
        }
        else {
            if (!isDirty) {
                return Promise.resolve([true, true]);
            }
            const result = await (dialogs === null || dialogs === void 0 ? void 0 : dialogs.saveBeforeClose({
                fileName,
                writable: (_c = context.contentsModel) === null || _c === void 0 ? void 0 : _c.writable
            }));
            return [result.shouldClose, result.ignoreSave];
        }
    }
    /**
     * Handle the disposal of a widget.
     */
    _widgetDisposed(widget) {
        const context = widgetmanager_Private.contextProperty.get(widget);
        if (!context) {
            return;
        }
        const widgets = widgetmanager_Private.widgetsProperty.get(context);
        if (!widgets) {
            return;
        }
        // Remove the widget.
        dist_index_es6_js_.ArrayExt.removeFirstOf(widgets, widget);
        // Dispose of the context if this is the last widget using it.
        if (!widgets.length) {
            context.dispose();
        }
    }
    /**
     * Handle the disposal of a widget.
     */
    _onWidgetDisposed(widget) {
        const disposables = widgetmanager_Private.disposablesProperty.get(widget);
        disposables.dispose();
    }
    /**
     * Handle a file changed signal for a context.
     */
    _onFileChanged(context) {
        const widgets = widgetmanager_Private.widgetsProperty.get(context);
        for (const widget of widgets) {
            void this.setCaption(widget);
        }
    }
    /**
     * Handle a path changed signal for a context.
     */
    _onPathChanged(context) {
        const widgets = widgetmanager_Private.widgetsProperty.get(context);
        for (const widget of widgets) {
            void this.setCaption(widget);
        }
    }
}
/**
 * A private namespace for DocumentManager data.
 */
var widgetmanager_Private;
(function (Private) {
    /**
     * A private attached property for a widget context.
     */
    Private.contextProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'context',
        create: () => undefined
    });
    /**
     * A private attached property for a widget factory.
     */
    Private.factoryProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'factory',
        create: () => undefined
    });
    /**
     * A private attached property for the widgets associated with a context.
     */
    Private.widgetsProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'widgets',
        create: () => []
    });
    /**
     * A private attached property for a widget's disposables.
     */
    Private.disposablesProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'disposables',
        create: () => new disposable_dist_index_es6_js_.DisposableSet()
    });
})(widgetmanager_Private || (widgetmanager_Private = {}));
//# sourceMappingURL=widgetmanager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/manager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.











/**
 * The document manager.
 *
 * #### Notes
 * The document manager is used to register model and widget creators,
 * and the file browser uses the document manager to create widgets. The
 * document manager maintains a context for each path and model type that is
 * open, and a list of widgets for each context. The document manager is in
 * control of the proper closing and disposal of the widgets and contexts.
 */
class DocumentManager {
    /**
     * Construct a new document manager.
     */
    constructor(options) {
        var _a, _b;
        this._activateRequested = new signaling_dist_index_es6_js_.Signal(this);
        this._contexts = [];
        this._isDisposed = false;
        this._autosave = true;
        this._autosaveInterval = 120;
        this._lastModifiedCheckMargin = 500;
        this._renameUntitledFileOnSave = true;
        this._stateChanged = new signaling_dist_index_es6_js_.Signal(this);
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this.registry = options.registry;
        this.services = options.manager;
        this._docManagerDialogs =
            (_a = options.docManagerDialogs) !== null && _a !== void 0 ? _a : new DocumentManagerDialogs({ translator: this.translator });
        this._dialogs =
            (_b = options.sessionDialogs) !== null && _b !== void 0 ? _b : new index_js_.SessionContextDialogs({ translator: options.translator });
        this._isConnectedCallback = options.isConnectedCallback || (() => true);
        this._opener = options.opener;
        this._when = options.when || options.manager.ready;
        const widgetManager = new DocumentWidgetManager({
            registry: this.registry,
            translator: this.translator,
            recentsManager: options.recentsManager,
            dialogs: this._docManagerDialogs
        });
        widgetManager.activateRequested.connect(this._onActivateRequested, this);
        widgetManager.stateChanged.connect(this._onWidgetStateChanged, this);
        this._widgetManager = widgetManager;
        this._setBusy = options.setBusy;
        this._urlResolverFactory = options.urlResolverFactory;
    }
    /**
     * A signal emitted when one of the documents is activated.
     */
    get activateRequested() {
        return this._activateRequested;
    }
    /**
     * Whether to autosave documents.
     */
    get autosave() {
        return this._autosave;
    }
    set autosave(value) {
        if (this._autosave !== value) {
            const oldValue = this._autosave;
            this._autosave = value;
            // For each existing context, start/stop the autosave handler as needed.
            this._contexts.forEach(context => {
                const handler = manager_Private.saveHandlerProperty.get(context);
                if (!handler) {
                    return;
                }
                if (value === true && !handler.isActive) {
                    handler.start();
                }
                else if (value === false && handler.isActive) {
                    handler.stop();
                }
            });
            this._stateChanged.emit({
                name: 'autosave',
                oldValue,
                newValue: value
            });
        }
    }
    /**
     * Determines the time interval for autosave in seconds.
     */
    get autosaveInterval() {
        return this._autosaveInterval;
    }
    set autosaveInterval(value) {
        if (this._autosaveInterval !== value) {
            const oldValue = this._autosaveInterval;
            this._autosaveInterval = value;
            // For each existing context, set the save interval as needed.
            this._contexts.forEach(context => {
                const handler = manager_Private.saveHandlerProperty.get(context);
                if (!handler) {
                    return;
                }
                handler.saveInterval = value || 120;
            });
            this._stateChanged.emit({
                name: 'autosaveInterval',
                oldValue,
                newValue: value
            });
        }
    }
    /**
     * Whether to ask confirmation to close a tab or not.
     */
    get confirmClosingDocument() {
        return this._widgetManager.confirmClosingDocument;
    }
    set confirmClosingDocument(value) {
        if (this._widgetManager.confirmClosingDocument !== value) {
            const oldValue = this._widgetManager.confirmClosingDocument;
            this._widgetManager.confirmClosingDocument = value;
            this._stateChanged.emit({
                name: 'confirmClosingDocument',
                oldValue,
                newValue: value
            });
        }
    }
    /**
     * Defines max acceptable difference, in milliseconds, between last modified timestamps on disk and client
     */
    get lastModifiedCheckMargin() {
        return this._lastModifiedCheckMargin;
    }
    set lastModifiedCheckMargin(value) {
        if (this._lastModifiedCheckMargin !== value) {
            const oldValue = this._lastModifiedCheckMargin;
            this._lastModifiedCheckMargin = value;
            // For each existing context, update the margin value.
            this._contexts.forEach(context => {
                context.lastModifiedCheckMargin = value;
            });
            this._stateChanged.emit({
                name: 'lastModifiedCheckMargin',
                oldValue,
                newValue: value
            });
        }
    }
    /**
     * Whether to ask the user to rename untitled file on first manual save.
     */
    get renameUntitledFileOnSave() {
        return this._renameUntitledFileOnSave;
    }
    set renameUntitledFileOnSave(value) {
        if (this._renameUntitledFileOnSave !== value) {
            const oldValue = this._renameUntitledFileOnSave;
            this._renameUntitledFileOnSave = value;
            this._stateChanged.emit({
                name: 'renameUntitledFileOnSave',
                oldValue,
                newValue: value
            });
        }
    }
    /**
     * Signal triggered when an attribute changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * Get whether the document manager has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the document manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        // Clear any listeners for our signals.
        signaling_dist_index_es6_js_.Signal.clearData(this);
        // Close all the widgets for our contexts and dispose the widget manager.
        this._contexts.forEach(context => {
            return this._widgetManager.closeWidgets(context);
        });
        this._widgetManager.dispose();
        // Clear the context list.
        this._contexts.length = 0;
    }
    /**
     * Clone a widget.
     *
     * @param widget - The source widget.
     *
     * @returns A new widget or `undefined`.
     *
     * #### Notes
     *  Uses the same widget factory and context as the source, or returns
     *  `undefined` if the source widget is not managed by this manager.
     */
    cloneWidget(widget) {
        return this._widgetManager.cloneWidget(widget);
    }
    /**
     * Close all of the open documents.
     *
     * @returns A promise resolving when the widgets are closed.
     */
    closeAll() {
        return Promise.all(this._contexts.map(context => this._widgetManager.closeWidgets(context))).then(() => undefined);
    }
    /**
     * Close the widgets associated with a given path.
     *
     * @param path - The target path.
     *
     * @returns A promise resolving when the widgets are closed.
     */
    closeFile(path) {
        const close = this._contextsForPath(path).map(c => this._widgetManager.closeWidgets(c));
        return Promise.all(close).then(x => undefined);
    }
    /**
     * Get the document context for a widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The context associated with the widget, or `undefined` if no such
     * context exists.
     */
    contextForWidget(widget) {
        return this._widgetManager.contextForWidget(widget);
    }
    /**
     * Copy a file.
     *
     * @param fromFile - The full path of the original file.
     *
     * @param toDir - The full path to the target directory.
     *
     * @returns A promise which resolves to the contents of the file.
     */
    copy(fromFile, toDir) {
        return this.services.contents.copy(fromFile, toDir);
    }
    /**
     * Create a new file and return the widget used to view it.
     *
     * @param path - The file path to create.
     *
     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.
     *
     * @param kernel - An optional kernel name/id to override the default.
     *
     * @returns The created widget, or `undefined`.
     *
     * #### Notes
     * This function will return `undefined` if a valid widget factory
     * cannot be found.
     */
    createNew(path, widgetName = 'default', kernel) {
        return this._createOrOpenDocument('create', path, widgetName, kernel);
    }
    /**
     * Delete a file.
     *
     * @param path - The full path to the file to be deleted.
     *
     * @returns A promise which resolves when the file is deleted.
     *
     * #### Notes
     * If there is a running session associated with the file and no other
     * sessions are using the kernel, the session will be shut down.
     */
    deleteFile(path) {
        return this.services.sessions
            .stopIfNeeded(path)
            .then(() => {
            return this.services.contents.delete(path);
        })
            .then(() => {
            this._contextsForPath(path).forEach(context => this._widgetManager.deleteWidgets(context));
            return Promise.resolve(void 0);
        });
    }
    /**
     * Duplicate a file.
     *
     * @param path - The full path to the file to be duplicated.
     *
     * @returns A promise which resolves when the file is duplicated.
     */
    duplicate(path) {
        const basePath = lib_index_js_.PathExt.dirname(path);
        return this.services.contents.copy(path, basePath);
    }
    /**
     * See if a widget already exists for the given path and widget name.
     *
     * @param path - The file path to use.
     *
     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.
     *
     * @returns The found widget, or `undefined`.
     *
     * #### Notes
     * This can be used to find an existing widget instead of opening
     * a new widget.
     */
    findWidget(path, widgetName = 'default') {
        const newPath = lib_index_js_.PathExt.normalize(path);
        let widgetNames = [widgetName];
        if (widgetName === 'default') {
            const factory = this.registry.defaultWidgetFactory(newPath);
            if (!factory) {
                return undefined;
            }
            widgetNames = [factory.name];
        }
        else if (widgetName === null) {
            widgetNames = this.registry
                .preferredWidgetFactories(newPath)
                .map(f => f.name);
        }
        for (const context of this._contextsForPath(newPath)) {
            for (const widgetName of widgetNames) {
                if (widgetName !== null) {
                    const widget = this._widgetManager.findWidget(context, widgetName);
                    if (widget) {
                        return widget;
                    }
                }
            }
        }
        return undefined;
    }
    /**
     * Create a new untitled file.
     *
     * @param options - The file content creation options.
     */
    newUntitled(options) {
        if (options.type === 'file') {
            options.ext = options.ext || '.txt';
        }
        return this.services.contents.newUntitled(options);
    }
    /**
     * Open a file and return the widget used to view it.
     *
     * @param path - The file path to open.
     *
     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.
     *
     * @param kernel - An optional kernel name/id to override the default.
     *
     * @returns The created widget, or `undefined`.
     *
     * #### Notes
     * This function will return `undefined` if a valid widget factory
     * cannot be found.
     */
    open(path, widgetName = 'default', kernel, options, kernelPreference) {
        return this._createOrOpenDocument('open', path, widgetName, kernel, options, kernelPreference);
    }
    /**
     * Open a file and return the widget used to view it.
     * Reveals an already existing editor.
     *
     * @param path - The file path to open.
     *
     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.
     *
     * @param kernel - An optional kernel name/id to override the default.
     *
     * @returns The created widget, or `undefined`.
     *
     * #### Notes
     * This function will return `undefined` if a valid widget factory
     * cannot be found.
     */
    openOrReveal(path, widgetName = null, kernel, options, kernelPreference) {
        const widget = this.findWidget(path, widgetName);
        if (widget) {
            this._opener.open(widget, {
                type: widgetName || 'default',
                ...options
            });
            return widget;
        }
        return this.open(path, widgetName || 'default', kernel, options !== null && options !== void 0 ? options : {}, kernelPreference);
    }
    /**
     * Overwrite a file.
     *
     * @param oldPath - The full path to the original file.
     *
     * @param newPath - The full path to the new file.
     *
     * @returns A promise containing the new file contents model.
     */
    overwrite(oldPath, newPath) {
        // Cleanly overwrite the file by moving it, making sure the original does
        // not exist, and then renaming to the new path.
        const tempPath = `${newPath}.${dist_index_js_.UUID.uuid4()}`;
        const cb = () => this.rename(tempPath, newPath);
        return this.rename(oldPath, tempPath)
            .then(() => {
            return this.deleteFile(newPath);
        })
            .then(cb, cb);
    }
    /**
     * Rename a file or directory.
     *
     * @param oldPath - The full path to the original file.
     *
     * @param newPath - The full path to the new file.
     *
     * @returns A promise containing the new file contents model.  The promise
     * will reject if the newPath already exists.  Use [[overwrite]] to overwrite
     * a file.
     */
    rename(oldPath, newPath) {
        return this.services.contents.rename(oldPath, newPath);
    }
    /**
     * Find a context for a given path and factory name.
     */
    _findContext(path, factoryName) {
        const normalizedPath = this.services.contents.normalize(path);
        return (0,dist_index_es6_js_.find)(this._contexts, context => {
            return (context.path === normalizedPath && context.factoryName === factoryName);
        });
    }
    /**
     * Get the contexts for a given path.
     *
     * #### Notes
     * There may be more than one context for a given path if the path is open
     * with multiple model factories (for example, a notebook can be open with a
     * notebook model factory and a text model factory).
     */
    _contextsForPath(path) {
        const normalizedPath = this.services.contents.normalize(path);
        return this._contexts.filter(context => context.path === normalizedPath);
    }
    /**
     * Create a context from a path and a model factory.
     */
    _createContext(path, factory, kernelPreference, contentProviderId) {
        // TODO: Make it impossible to open two different contexts for the same
        // path. Or at least prompt the closing of all widgets associated with the
        // old context before opening the new context. This will make things much
        // more consistent for the users, at the cost of some confusion about what
        // models are and why sometimes they cannot open the same file in different
        // widgets that have different models.
        // Allow options to be passed when adding a sibling.
        const adopter = (widget, options) => {
            this._widgetManager.adoptWidget(context, widget);
            // TODO should we pass the type for layout customization
            this._opener.open(widget, options);
        };
        const context = new docregistry_lib_index_js_.Context({
            opener: adopter,
            manager: this.services,
            factory,
            path,
            kernelPreference,
            setBusy: this._setBusy,
            sessionDialogs: this._dialogs,
            lastModifiedCheckMargin: this._lastModifiedCheckMargin,
            translator: this.translator,
            contentProviderId,
            urlResolverFactory: this._urlResolverFactory
        });
        const handler = new SaveHandler({
            context,
            isConnectedCallback: this._isConnectedCallback,
            saveInterval: this.autosaveInterval
        });
        manager_Private.saveHandlerProperty.set(context, handler);
        void context.ready.then(() => {
            if (this.autosave) {
                handler.start();
            }
        });
        context.disposed.connect(this._onContextDisposed, this);
        this._contexts.push(context);
        return context;
    }
    /**
     * Handle a context disposal.
     */
    _onContextDisposed(context) {
        dist_index_es6_js_.ArrayExt.removeFirstOf(this._contexts, context);
    }
    /**
     * Get the widget factory for a given widget name.
     */
    _widgetFactoryFor(path, widgetName) {
        const { registry } = this;
        if (widgetName === 'default') {
            const factory = registry.defaultWidgetFactory(path);
            if (!factory) {
                return undefined;
            }
            widgetName = factory.name;
        }
        return registry.getWidgetFactory(widgetName);
    }
    /**
     * Creates a new document, or loads one from disk, depending on the `which` argument.
     * If `which==='create'`, then it creates a new document. If `which==='open'`,
     * then it loads the document from disk.
     *
     * The two cases differ in how the document context is handled, but the creation
     * of the widget and launching of the kernel are identical.
     */
    _createOrOpenDocument(which, path, widgetName = 'default', kernel, options, kernelPreference) {
        const widgetFactory = this._widgetFactoryFor(path, widgetName);
        if (!widgetFactory) {
            return undefined;
        }
        const modelName = widgetFactory.modelName || 'text';
        const factory = this.registry.getModelFactory(modelName);
        if (!factory) {
            return undefined;
        }
        // Handle the kernel preference.
        const preference = {
            ...this.registry.getKernelPreference(path, widgetFactory.name, kernel),
            ...kernelPreference
        };
        let context;
        let ready = Promise.resolve(undefined);
        // Handle the load-from-disk case
        if (which === 'open') {
            // Use an existing context if available.
            context = this._findContext(path, factory.name) || null;
            if (!context) {
                context = this._createContext(path, factory, preference, widgetFactory.contentProviderId);
                // Populate the model, either from disk or a
                // model backend.
                ready = this._when.then(() => context.initialize(false));
            }
        }
        else if (which === 'create') {
            context = this._createContext(path, factory, preference, widgetFactory.contentProviderId);
            // Immediately save the contents to disk.
            ready = this._when.then(() => context.initialize(true));
        }
        else {
            throw new Error(`Invalid argument 'which': ${which}`);
        }
        const widget = this._widgetManager.createWidget(widgetFactory, context);
        this._opener.open(widget, { type: widgetFactory.name, ...options });
        // If the initial opening of the context fails, dispose of the widget.
        ready.catch(err => {
            console.error(`Failed to initialize the context with '${factory.name}' for ${path}`, err);
            widget.close();
        });
        return widget;
    }
    /**
     * Handle an activateRequested signal from the widget manager.
     */
    _onActivateRequested(sender, args) {
        this._activateRequested.emit(args);
    }
    _onWidgetStateChanged(sender, args) {
        if (args.name === 'confirmClosingDocument') {
            this._stateChanged.emit(args);
        }
    }
}
/**
 * A namespace for private data.
 */
var manager_Private;
(function (Private) {
    /**
     * An attached property for a context save handler.
     */
    Private.saveHandlerProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'saveHandler',
        create: () => undefined
    });
})(manager_Private || (manager_Private = {}));
//# sourceMappingURL=manager.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/pathstatus.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A pure component for rendering a file path (or activity name).
 *
 * @param props - the props for the component.
 *
 * @returns a tsx component for a file path.
 */
function PathStatusComponent(props) {
    return react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { source: props.name, title: props.fullPath });
}
/**
 * A status bar item for the current file path (or activity name).
 */
class PathStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct a new PathStatus status item.
     */
    constructor(opts) {
        super(new PathStatus.Model(opts.docManager));
        this.node.title = this.model.path;
    }
    /**
     * Render the status item.
     */
    render() {
        return (react_index_js_default().createElement(PathStatusComponent, { fullPath: this.model.path, name: this.model.name }));
    }
}
/**
 * A namespace for PathStatus statics.
 */
(function (PathStatus) {
    /**
     * A VDomModel for rendering the PathStatus status item.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        /**
         * Construct a new model.
         *
         * @param docManager the application document manager. Used to check
         *   whether the current widget is a document.
         */
        constructor(docManager) {
            super();
            /**
             * React to a title change for the current widget.
             */
            this._onTitleChange = (title) => {
                const oldState = this._getAllState();
                this._name = title.label;
                this._triggerChange(oldState, this._getAllState());
            };
            /**
             * React to a path change for the current document.
             */
            this._onPathChange = (_documentModel, newPath) => {
                const oldState = this._getAllState();
                this._path = newPath;
                this._name = lib_index_js_.PathExt.basename(newPath);
                this._triggerChange(oldState, this._getAllState());
            };
            this._path = '';
            this._name = '';
            this._widget = null;
            this._docManager = docManager;
        }
        /**
         * The current path for the application.
         */
        get path() {
            return this._path;
        }
        /**
         * The name of the current activity.
         */
        get name() {
            return this._name;
        }
        /**
         * The current widget for the application.
         */
        get widget() {
            return this._widget;
        }
        set widget(widget) {
            const oldWidget = this._widget;
            if (oldWidget !== null) {
                const oldContext = this._docManager.contextForWidget(oldWidget);
                if (oldContext) {
                    oldContext.pathChanged.disconnect(this._onPathChange);
                }
                else {
                    oldWidget.title.changed.disconnect(this._onTitleChange);
                }
            }
            const oldState = this._getAllState();
            this._widget = widget;
            if (this._widget === null) {
                this._path = '';
                this._name = '';
            }
            else {
                const widgetContext = this._docManager.contextForWidget(this._widget);
                if (widgetContext) {
                    this._path = widgetContext.path;
                    this._name = lib_index_js_.PathExt.basename(widgetContext.path);
                    widgetContext.pathChanged.connect(this._onPathChange);
                }
                else {
                    this._path = '';
                    this._name = this._widget.title.label;
                    this._widget.title.changed.connect(this._onTitleChange);
                }
            }
            this._triggerChange(oldState, this._getAllState());
        }
        /**
         * Get the current state of the model.
         */
        _getAllState() {
            return [this._path, this._name];
        }
        /**
         * Trigger a state change to rerender.
         */
        _triggerChange(oldState, newState) {
            if (oldState[0] !== newState[0] || oldState[1] !== newState[1]) {
                this.stateChanged.emit(void 0);
            }
        }
    }
    PathStatus.Model = Model;
})(PathStatus || (PathStatus = {}));
//# sourceMappingURL=pathstatus.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/savingstatus.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A pure functional component for a Saving status item.
 *
 * @param props - the props for the component.
 *
 * @returns a tsx component for rendering the saving state.
 */
function SavingStatusComponent(props) {
    return react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { source: props.fileStatus });
}
/**
 * The amount of time (in ms) to retain the saving completed message
 * before hiding the status item.
 */
const SAVING_COMPLETE_MESSAGE_MILLIS = 2000;
/**
 * A VDomRenderer for a saving status item.
 */
class SavingStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Create a new SavingStatus item.
     */
    constructor(opts) {
        super(new SavingStatus.Model(opts.docManager));
        const translator = opts.translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        this._statusMap = {
            completed: trans.__('Saving completed'),
            started: trans.__('Saving started'),
            failed: trans.__('Saving failed')
        };
    }
    /**
     * Render the SavingStatus item.
     */
    render() {
        if (this.model === null || this.model.status === null) {
            return null;
        }
        else {
            return (react_index_js_default().createElement(SavingStatusComponent, { fileStatus: this._statusMap[this.model.status] }));
        }
    }
}
/**
 * A namespace for SavingStatus statics.
 */
(function (SavingStatus) {
    /**
     * A VDomModel for the SavingStatus item.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        /**
         * Create a new SavingStatus model.
         */
        constructor(docManager) {
            super();
            /**
             * React to a saving status change from the current document widget.
             */
            this._onStatusChange = (_, newStatus) => {
                this._status = newStatus;
                if (this._status === 'completed') {
                    setTimeout(() => {
                        this._status = null;
                        this.stateChanged.emit(void 0);
                    }, SAVING_COMPLETE_MESSAGE_MILLIS);
                    this.stateChanged.emit(void 0);
                }
                else {
                    this.stateChanged.emit(void 0);
                }
            };
            this._status = null;
            this._widget = null;
            this._status = null;
            this.widget = null;
            this._docManager = docManager;
        }
        /**
         * The current status of the model.
         */
        get status() {
            return this._status;
        }
        /**
         * The current widget for the model. Any widget can be assigned,
         * but it only has any effect if the widget is an IDocument widget
         * known to the application document manager.
         */
        get widget() {
            return this._widget;
        }
        set widget(widget) {
            var _a, _b;
            const oldWidget = this._widget;
            if (oldWidget !== null) {
                const oldContext = this._docManager.contextForWidget(oldWidget);
                if (oldContext) {
                    oldContext.saveState.disconnect(this._onStatusChange);
                }
                else if ((_a = this._widget.content) === null || _a === void 0 ? void 0 : _a.saveStateChanged) {
                    this._widget.content.saveStateChanged.disconnect(this._onStatusChange);
                }
            }
            this._widget = widget;
            if (this._widget === null) {
                this._status = null;
            }
            else {
                const widgetContext = this._docManager.contextForWidget(this._widget);
                if (widgetContext) {
                    widgetContext.saveState.connect(this._onStatusChange);
                }
                else if ((_b = this._widget.content) === null || _b === void 0 ? void 0 : _b.saveStateChanged) {
                    this._widget.content.saveStateChanged.connect(this._onStatusChange);
                }
            }
        }
    }
    SavingStatus.Model = Model;
})(SavingStatus || (SavingStatus = {}));
//# sourceMappingURL=savingstatus.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The document registry token.
 */
const IDocumentManager = new dist_index_js_.Token('@jupyterlab/docmanager:IDocumentManager', `A service for the manager for all
  documents used by the application. Use this if you want to open and close documents,
  create and delete files, and otherwise interact with the file system.`);
/**
 * The document widget opener token.
 */
const IDocumentWidgetOpener = new dist_index_js_.Token('@jupyterlab/docmanager:IDocumentWidgetOpener', `A service to open a widget.`);
/**
 * The recent documents database token.
 */
const IRecentsManager = new dist_index_js_.Token('@jupyterlab/docmanager:IRecentsManager', `A service providing information about recently opened and closed documents`);
/**
 * The document manager dialogs token.
 */
const IDocumentManagerDialogs = new dist_index_js_.Token('@jupyterlab/docmanager:IDocumentManagerDialogs', 'A service for displaying dialogs related to document management.');
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/recents.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * Manager for recently opened and closed documents.
 */
class RecentsManager {
    constructor(options) {
        this._recentsChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._recents = {
            opened: [],
            closed: []
        };
        this._isDisposed = false;
        this._maxRecentsLength = 10;
        this._saveDebouncer = new polling_dist_index_es6_js_.Debouncer(this._save.bind(this), 500);
        this._stateDB = options.stateDB;
        this._contentsManager = options.contents;
        this.updateRootDir();
        this._loadRecents().catch(r => {
            console.error(`Failed to load recent list from state:\n${r}`);
        });
    }
    /**
     * Whether the manager is disposed or not.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * List of recently opened items
     */
    get recentlyOpened() {
        const recents = this._recents.opened || [];
        return recents.filter(r => r.root === this._serverRoot);
    }
    /**
     * List of recently opened items
     */
    get recentlyClosed() {
        const recents = this._recents.closed || [];
        return recents.filter(r => r.root === this._serverRoot);
    }
    /**
     * Signal emitted when the recent list changes.
     */
    get changed() {
        return this._recentsChanged;
    }
    /**
     * Maximal number of recent items to list.
     */
    get maximalRecentsLength() {
        return this._maxRecentsLength;
    }
    set maximalRecentsLength(value) {
        this._maxRecentsLength = Math.round(Math.max(1, value));
        let changed = false;
        for (const type of ['opened', 'closed']) {
            if (this._recents[type].length > this._maxRecentsLength) {
                this._recents[type].length = this._maxRecentsLength;
                changed = true;
            }
        }
        if (changed) {
            this._recentsChanged.emit(undefined);
        }
    }
    /**
     * Dispose recent manager resources
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_dist_index_es6_js_.Signal.clearData(this);
        this._saveDebouncer.dispose();
    }
    /**
     * Add a new path to the recent list.
     */
    addRecent(document, event) {
        const recent = {
            ...document,
            root: this._serverRoot
        };
        const recents = this._recents[event];
        // Check if it's already present; if so remove it
        const existingIndex = recents.findIndex(r => r.path === document.path);
        if (existingIndex >= 0) {
            recents.splice(existingIndex, 1);
        }
        // Add to the front of the list
        recents.unshift(recent);
        this._setRecents(recents, event);
        this._recentsChanged.emit(undefined);
    }
    /**
     * Clear the recents list
     */
    clearRecents() {
        this._setRecents([], 'opened');
        this._setRecents([], 'closed');
        this._recentsChanged.emit(undefined);
    }
    /**
     * Remove the document from recents list.
     */
    removeRecent(document, event) {
        this._removeRecent(document.path, [event]);
    }
    /**
     * Check if the recent item is valid, remove if it from both lists if it is not.
     */
    async validate(recent) {
        const valid = await this._isValid(recent);
        if (!valid) {
            this._removeRecent(recent.path);
        }
        return valid;
    }
    /**
     * Set server root dir.
     *
     * Note: protected to allow unit-testing.
     */
    updateRootDir() {
        this._serverRoot = lib_index_js_.PageConfig.getOption('serverRoot');
    }
    /**
     * Remove a path from both lists (opened and closed).
     */
    _removeRecent(path, lists = ['opened', 'closed']) {
        let changed = false;
        for (const type of lists) {
            const recents = this._recents[type];
            const newRecents = recents.filter(r => path !== r.path);
            if (recents.length !== newRecents.length) {
                this._setRecents(newRecents, type);
                changed = true;
            }
        }
        if (changed) {
            this._recentsChanged.emit(undefined);
        }
    }
    /**
     * Check if the path of a given recent document exists.
     */
    async _isValid(recent) {
        var _a;
        try {
            await this._contentsManager.get(recent.path, { content: false });
        }
        catch (e) {
            if (((_a = e.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
                return false;
            }
        }
        return true;
    }
    /**
     * Set the recent list
     * @param recents The new recent list
     */
    _setRecents(recents, type) {
        this._recents[type] = recents
            .slice(0, this.maximalRecentsLength)
            .sort((a, b) => {
            if (a.root === b.root) {
                return 0;
            }
            else {
                return a.root !== this._serverRoot ? 1 : -1;
            }
        });
        this._saveDebouncer.invoke().catch(console.warn);
    }
    /**
     * Load the recent items from the state.
     */
    async _loadRecents() {
        const recents = (await this._stateDB.fetch(recents_Private.stateDBKey)) || {
            opened: [],
            closed: []
        };
        const allRecents = [...recents.opened, ...recents.closed];
        const invalidPaths = new Set(await this._getInvalidPaths(allRecents));
        for (const type of ['opened', 'closed']) {
            this._setRecents(recents[type].filter(r => !invalidPaths.has(r.path)), type);
        }
        this._recentsChanged.emit(undefined);
    }
    /**
     * Get the list of invalid path in recents.
     */
    async _getInvalidPaths(recents) {
        const invalidPathsOrNulls = await Promise.all(recents.map(async (r) => {
            if (await this._isValid(r)) {
                return null;
            }
            else {
                return r.path;
            }
        }));
        return invalidPathsOrNulls.filter(x => typeof x === 'string');
    }
    /**
     * Save the recent items to the state.
     */
    async _save() {
        try {
            await this._stateDB.save(recents_Private.stateDBKey, this._recents);
        }
        catch (e) {
            console.log('Saving recents failed', e);
        }
    }
}
var recents_Private;
(function (Private) {
    /**
     * Key reserved in the state database.
     */
    Private.stateDBKey = 'docmanager:recents';
})(recents_Private || (recents_Private = {}));
//# sourceMappingURL=recents.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docmanager/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module docmanager
 */








//# sourceMappingURL=index.js.map

/***/ }),

/***/ 81393:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_rendermime_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(45304);
/* harmony import */ var _jupyterlab_docregistry_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30507);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 92754:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ABCWidgetFactory: () => (/* reexport */ ABCWidgetFactory),
  Base64ModelFactory: () => (/* reexport */ Base64ModelFactory),
  Context: () => (/* reexport */ Context),
  DocumentModel: () => (/* reexport */ DocumentModel),
  DocumentRegistry: () => (/* reexport */ DocumentRegistry),
  DocumentWidget: () => (/* reexport */ DocumentWidget),
  MimeContent: () => (/* reexport */ MimeContent),
  MimeDocument: () => (/* reexport */ MimeDocument),
  MimeDocumentFactory: () => (/* reexport */ MimeDocumentFactory),
  TextModelFactory: () => (/* reexport */ TextModelFactory),
  createReadonlyLabel: () => (/* reexport */ createReadonlyLabel),
  getAvailableKernelFileTypes: () => (/* reexport */ getAvailableKernelFileTypes)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/lib/context.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * An implementation of a document context.
 *
 * This class is typically instantiated by the document manager.
 */
class Context {
    /**
     * Construct a new document context.
     */
    constructor(options) {
        var _a, _b;
        this._isReady = false;
        this._isDisposed = false;
        this._isPopulated = false;
        this._path = '';
        this._lineEnding = null;
        this._contentsModel = null;
        this._populatedPromise = new dist_index_js_.PromiseDelegate();
        this._pathChanged = new dist_index_es6_js_.Signal(this);
        this._fileChanged = new dist_index_es6_js_.Signal(this);
        this._saveState = new dist_index_es6_js_.Signal(this);
        this._disposed = new dist_index_es6_js_.Signal(this);
        this._lastModifiedCheckMargin = 500;
        this._conflictModalIsOpen = false;
        const manager = (this._manager = options.manager);
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._contentProviderId = options.contentProviderId;
        this._trans = this.translator.load('jupyterlab');
        this._factory = options.factory;
        this._dialogs =
            (_a = options.sessionDialogs) !== null && _a !== void 0 ? _a : new index_js_.SessionContextDialogs({ translator: options.translator });
        this._opener = options.opener || Private.noOp;
        this._path = this._manager.contents.normalize(options.path);
        this._lastModifiedCheckMargin = options.lastModifiedCheckMargin || 500;
        const localPath = this._manager.contents.localPath(this._path);
        const lang = this._factory.preferredLanguage(lib_index_js_.PathExt.basename(localPath));
        const sharedFactory = this._manager.contents.getSharedModelFactory(this._path, { contentProviderId: options.contentProviderId });
        const sharedModel = sharedFactory === null || sharedFactory === void 0 ? void 0 : sharedFactory.createNew({
            path: this._path,
            format: this._factory.fileFormat,
            contentType: this._factory.contentType,
            collaborative: this._factory.collaborative
        });
        this._model = this._factory.createNew({
            languagePreference: lang,
            sharedModel,
            collaborationEnabled: (_b = sharedFactory === null || sharedFactory === void 0 ? void 0 : sharedFactory.collaborative) !== null && _b !== void 0 ? _b : false
        });
        this._readyPromise = manager.ready.then(() => {
            return this._populatedPromise.promise;
        });
        const ext = lib_index_js_.PathExt.extname(this._path);
        this.sessionContext = new index_js_.SessionContext({
            kernelManager: manager.kernels,
            sessionManager: manager.sessions,
            specsManager: manager.kernelspecs,
            path: this._path,
            type: ext === '.ipynb' ? 'notebook' : 'file',
            name: lib_index_js_.PathExt.basename(localPath),
            kernelPreference: options.kernelPreference || { shouldStart: false },
            setBusy: options.setBusy
        });
        this.sessionContext.propertyChanged.connect(this._onSessionChanged, this);
        manager.contents.fileChanged.connect(this._onFileChanged, this);
        const urlResolverFactory = options.urlResolverFactory
            ? options.urlResolverFactory
            : {
                createResolver: (resolverOptions) => new rendermime_lib_index_js_.RenderMimeRegistry.UrlResolver(resolverOptions)
            };
        this._urlResolver = urlResolverFactory.createResolver({
            path: this._path,
            contents: manager.contents
        });
    }
    /**
     * A signal emitted when the path changes.
     */
    get pathChanged() {
        return this._pathChanged;
    }
    /**
     * A signal emitted when the model is saved or reverted.
     */
    get fileChanged() {
        return this._fileChanged;
    }
    /**
     * A signal emitted on the start and end of a saving operation.
     */
    get saveState() {
        return this._saveState;
    }
    /**
     * A signal emitted when the context is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Configurable margin used to detect document modification conflicts, in milliseconds
     */
    get lastModifiedCheckMargin() {
        return this._lastModifiedCheckMargin;
    }
    set lastModifiedCheckMargin(value) {
        this._lastModifiedCheckMargin = value;
    }
    /**
     * Get the model associated with the document.
     */
    get model() {
        return this._model;
    }
    /**
     * The current path associated with the document.
     */
    get path() {
        return this._path;
    }
    /**
     * The current local path associated with the document.
     * If the document is in the default notebook file browser,
     * this is the same as the path.
     */
    get localPath() {
        return this._manager.contents.localPath(this._path);
    }
    /**
     * The document metadata, stored as a services contents model.
     *
     * #### Notes
     * The contents model will be `null` until the context is populated.
     * It will not have a `content` field.
     */
    get contentsModel() {
        return this._contentsModel ? { ...this._contentsModel } : null;
    }
    /**
     * Get the model factory name.
     *
     * #### Notes
     * This is not part of the `IContext` API.
     */
    get factoryName() {
        return this.isDisposed ? '' : this._factory.name;
    }
    /**
     * Test whether the context is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the context.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.sessionContext.dispose();
        this._model.dispose();
        // Ensure we dispose the `sharedModel` as it may have been generated in the context
        // through the shared model factory.
        this._model.sharedModel.dispose();
        this._disposed.emit(void 0);
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Whether the context is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that is fulfilled when the context is ready.
     */
    get ready() {
        return this._readyPromise;
    }
    /**
     * Whether the document can be saved via the Contents API.
     */
    get canSave() {
        var _a;
        return !!(((_a = this._contentsModel) === null || _a === void 0 ? void 0 : _a.writable) && !this._model.collaborative);
    }
    /**
     * The url resolver for the context.
     */
    get urlResolver() {
        return this._urlResolver;
    }
    /**
     * Initialize the context.
     *
     * @param isNew - Whether it is a new file.
     *
     * @returns a promise that resolves upon initialization.
     */
    async initialize(isNew) {
        if (isNew) {
            await this._save();
        }
        else {
            await this._revert();
        }
        this.model.sharedModel.clearUndoHistory();
    }
    /**
     * Rename the document.
     *
     * @param newName - the new name for the document.
     */
    rename(newName) {
        return this.ready.then(() => {
            return this._manager.ready.then(() => {
                return this._rename(newName);
            });
        });
    }
    /**
     * Save the document contents to disk.
     */
    async save() {
        await this.ready;
        await this._save();
    }
    /**
     * Save the document to a different path chosen by the user.
     *
     * @returns A promise that resolves to `true` if the save operation was initiated.
     * Returns `false` if the user cancelled the operation.
     *
     * Note:
     * - If the save operation proceeds but fails due to an error in the content manager,
     *   the returned value will still be `true`.
     * - Consumers interested in the actual result of the save should listen to the
     *   {@link saveState} signal to be notified when the save succeeds or fails.
     */
    async saveAs() {
        await this.ready;
        const localPath = this._manager.contents.localPath(this.path);
        const newLocalPath = await Private.getSavePath(localPath);
        if (this.isDisposed || !newLocalPath) {
            return false;
        }
        const drive = this._manager.contents.driveName(this.path);
        const newPath = drive == '' ? newLocalPath : `${drive}:${newLocalPath}`;
        if (newPath === this._path) {
            await this.save();
            return true;
        }
        // Make sure the path does not exist.
        try {
            await this._manager.ready;
            await this._manager.contents.get(newPath, {
                contentProviderId: this._contentProviderId,
                content: false
            });
            await this._maybeOverWrite(newPath);
        }
        catch (err) {
            if (!err.response || err.response.status !== 404) {
                // Dialog rejection (user cancelled)
                if (!err.response) {
                    return false;
                }
                throw err;
            }
        }
        await this._finishSaveAs(newPath);
        return true;
    }
    /**
     * Download a file.
     *
     * @returns A promise which resolves when the file has begun
     *   downloading.
     */
    async download() {
        const url = await this._manager.contents.getDownloadUrl(this._path);
        const element = document.createElement('a');
        element.href = url;
        element.download = '';
        document.body.appendChild(element);
        element.click();
        document.body.removeChild(element);
        return void 0;
    }
    /**
     * Revert the document contents to disk contents.
     */
    async revert() {
        await this.ready;
        await this._revert();
    }
    /**
     * Create a checkpoint for the file.
     */
    createCheckpoint() {
        const contents = this._manager.contents;
        return this._manager.ready.then(() => {
            return contents.createCheckpoint(this._path);
        });
    }
    /**
     * Delete a checkpoint for the file.
     */
    deleteCheckpoint(checkpointId) {
        const contents = this._manager.contents;
        return this._manager.ready.then(() => {
            return contents.deleteCheckpoint(this._path, checkpointId);
        });
    }
    /**
     * Restore the file to a known checkpoint state.
     */
    restoreCheckpoint(checkpointId) {
        const contents = this._manager.contents;
        const path = this._path;
        return this._manager.ready.then(() => {
            if (checkpointId) {
                return contents.restoreCheckpoint(path, checkpointId);
            }
            return this.listCheckpoints().then(checkpoints => {
                if (this.isDisposed || !checkpoints.length) {
                    return;
                }
                checkpointId = checkpoints[checkpoints.length - 1].id;
                return contents.restoreCheckpoint(path, checkpointId);
            });
        });
    }
    /**
     * List available checkpoints for a file.
     */
    listCheckpoints() {
        const contents = this._manager.contents;
        return this._manager.ready.then(() => {
            return contents.listCheckpoints(this._path);
        });
    }
    /**
     * Add a sibling widget to the document manager.
     *
     * @param widget - The widget to add to the document manager.
     *
     * @param options - The desired options for adding the sibling.
     *
     * @returns A disposable used to remove the sibling if desired.
     *
     * #### Notes
     * It is assumed that the widget has the same model and context
     * as the original widget.
     */
    addSibling(widget, options = {}) {
        const opener = this._opener;
        if (opener) {
            opener(widget, options);
        }
        return new index_es6_js_.DisposableDelegate(() => {
            widget.close();
        });
    }
    /**
     * Handle a change on the contents manager.
     */
    _onFileChanged(sender, change) {
        var _a, _b, _c;
        if (change.type === 'save' && this._model.collaborative) {
            // Skip if the change isn't related to current file.
            if (((_a = this._contentsModel) === null || _a === void 0 ? void 0 : _a.path) !== ((_b = change.newValue) === null || _b === void 0 ? void 0 : _b.path)) {
                return;
            }
            // Update the contents model with the new values provided on save.
            // This is needed for save operations performed on the server-side
            // by the collaborative drive which needs to update the `hash`
            // of the content when it changes on the backend.
            this._updateContentsModel({
                ...this._contentsModel,
                ...change.newValue
            });
            return;
        }
        if (change.type !== 'rename') {
            return;
        }
        let oldPath = change.oldValue && change.oldValue.path;
        let newPath = change.newValue && change.newValue.path;
        if (newPath && this._path.indexOf(oldPath || '') === 0) {
            let changeModel = change.newValue;
            // When folder name changed, `oldPath` is `foo`, `newPath` is `bar` and `this._path` is `foo/test`,
            // we should update `foo/test` to `bar/test` as well
            if (oldPath !== this._path) {
                newPath = this._path.replace(new RegExp(`^${oldPath}/`), `${newPath}/`);
                oldPath = this._path;
                // Update client file model from folder change
                changeModel = {
                    last_modified: (_c = change.newValue) === null || _c === void 0 ? void 0 : _c.created,
                    path: newPath
                };
            }
            this._updateContentsModel({
                ...this._contentsModel,
                ...changeModel
            });
            this._updatePath(newPath);
        }
    }
    /**
     * Handle a change to a session property.
     */
    _onSessionChanged(sender, type) {
        if (type !== 'path') {
            return;
        }
        // The session uses local paths.
        // We need to convert it to a global path.
        const driveName = this._manager.contents.driveName(this.path);
        let newPath = this._manager.contents.localPath(this.sessionContext.session.path);
        if (driveName) {
            newPath = `${driveName}:${newPath}`;
        }
        this._updatePath(newPath);
    }
    /**
     * Update our contents model, without the content.
     */
    _updateContentsModel(model) {
        var _a, _b, _c, _d;
        const newModel = {
            path: model.path,
            name: model.name,
            type: model.type,
            writable: model.writable,
            created: model.created,
            last_modified: model.last_modified,
            mimetype: model.mimetype,
            format: model.format,
            hash: model.hash,
            hash_algorithm: model.hash_algorithm
        };
        const mod = (_b = (_a = this._contentsModel) === null || _a === void 0 ? void 0 : _a.last_modified) !== null && _b !== void 0 ? _b : null;
        const hash = (_d = (_c = this._contentsModel) === null || _c === void 0 ? void 0 : _c.hash) !== null && _d !== void 0 ? _d : null;
        this._contentsModel = newModel;
        if (
        // If neither modification date nor hash available, assume the file has changed
        (!mod && !hash) ||
            // Compare last_modified if no hash
            (!hash && newModel.last_modified !== mod) ||
            // Compare hash if available
            (hash && newModel.hash !== hash)) {
            this._fileChanged.emit(newModel);
        }
    }
    _updatePath(newPath) {
        var _a, _b, _c, _d;
        if (this._path === newPath) {
            return;
        }
        this._path = newPath;
        const localPath = this._manager.contents.localPath(newPath);
        const name = lib_index_js_.PathExt.basename(localPath);
        if (((_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path) !== newPath) {
            void ((_b = this.sessionContext.session) === null || _b === void 0 ? void 0 : _b.setPath(newPath));
        }
        if (((_c = this.sessionContext.session) === null || _c === void 0 ? void 0 : _c.name) !== name) {
            void ((_d = this.sessionContext.session) === null || _d === void 0 ? void 0 : _d.setName(name));
        }
        if (this._urlResolver.path !== newPath) {
            this._urlResolver.path = newPath;
        }
        if (this._contentsModel &&
            (this._contentsModel.path !== newPath ||
                this._contentsModel.name !== name)) {
            const contentsModel = {
                ...this._contentsModel,
                name: name,
                path: newPath
            };
            this._updateContentsModel(contentsModel);
        }
        this._pathChanged.emit(newPath);
    }
    /**
     * Handle an initial population.
     */
    async _populate() {
        this._isPopulated = true;
        this._isReady = true;
        this._populatedPromise.resolve(void 0);
        // Add a checkpoint if none exists and the file is writable.
        await this._maybeCheckpoint(false);
        if (this.isDisposed) {
            return;
        }
        // Update the kernel preference.
        const name = this._model.defaultKernelName ||
            this.sessionContext.kernelPreference.name;
        this.sessionContext.kernelPreference = {
            ...this.sessionContext.kernelPreference,
            name,
            language: this._model.defaultKernelLanguage
        };
        // Note: we don't wait on the session to initialize
        // so that the user can be shown the content before
        // any kernel has started.
        void this.sessionContext.initialize().then(shouldSelect => {
            if (shouldSelect) {
                void this._dialogs.selectKernel(this.sessionContext);
            }
        });
    }
    /**
     * Rename the document.
     *
     * @param newName - the new name for the document.
     */
    async _rename(newName) {
        const splitPath = this.localPath.split('/');
        splitPath[splitPath.length - 1] = newName;
        let newPath = lib_index_js_.PathExt.join(...splitPath);
        const driveName = this._manager.contents.driveName(this.path);
        if (driveName) {
            newPath = `${driveName}:${newPath}`;
        }
        // rename triggers a fileChanged which updates the contents model
        await this._manager.contents.rename(this.path, newPath);
    }
    /**
     * Save the document contents to disk.
     */
    async _save() {
        this._saveState.emit('started');
        const options = this._createSaveOptions();
        try {
            await this._manager.ready;
            const value = await this._maybeSave(options);
            if (this.isDisposed) {
                return;
            }
            this._model.dirty = false;
            this._updateContentsModel(value);
            if (!this._isPopulated) {
                await this._populate();
            }
            // Emit completion.
            this._saveState.emit('completed');
        }
        catch (err) {
            // If the save has been canceled by the user, throw the error
            // so that whoever called save() can decide what to do.
            const { name } = err;
            if (name === 'ModalCancelError' || name === 'ModalDuplicateError') {
                throw err;
            }
            // Otherwise show an error message and throw the error.
            const localPath = this._manager.contents.localPath(this._path);
            const file = lib_index_js_.PathExt.basename(localPath);
            void this._handleError(err, this._trans.__('File Save Error for %1', file));
            // Emit failure.
            this._saveState.emit('failed');
            throw err;
        }
    }
    /**
     * Revert the document contents to disk contents.
     *
     * @param initializeModel - call the model's initialization function after
     * deserializing the content.
     */
    _revert(initializeModel = false) {
        const opts = {
            type: this._factory.contentType,
            content: this._factory.fileFormat !== null,
            hash: this._factory.fileFormat !== null,
            ...(this._factory.fileFormat !== null
                ? { format: this._factory.fileFormat }
                : {}),
            contentProviderId: this._contentProviderId
        };
        const path = this._path;
        const model = this._model;
        return this._manager.ready
            .then(() => {
            return this._manager.contents.get(path, opts);
        })
            .then(contents => {
            if (this.isDisposed) {
                return;
            }
            if (contents.content) {
                if (contents.format === 'json') {
                    model.fromJSON(contents.content);
                }
                else {
                    let content = contents.content;
                    // Convert line endings if necessary, marking the file
                    // as dirty.
                    if (content.indexOf('\r\n') !== -1) {
                        this._lineEnding = '\r\n';
                        content = content.replace(/\r\n/g, '\n');
                    }
                    else if (content.indexOf('\r') !== -1) {
                        this._lineEnding = '\r';
                        content = content.replace(/\r/g, '\n');
                    }
                    else {
                        this._lineEnding = null;
                    }
                    model.fromString(content);
                }
            }
            this._updateContentsModel(contents);
            model.dirty = false;
            if (!this._isPopulated) {
                return this._populate();
            }
        })
            .catch(async (err) => {
            const localPath = this._manager.contents.localPath(this._path);
            const name = lib_index_js_.PathExt.basename(localPath);
            void this._handleError(err, this._trans.__('File Load Error for %1', name));
            throw err;
        });
    }
    /**
     * Save a file, dealing with conflicts.
     */
    _maybeSave(options) {
        const path = this._path;
        // Make sure the file has not changed on disk.
        const promise = this._manager.contents.get(path, {
            content: false,
            hash: true,
            contentProviderId: this._contentProviderId
        });
        return promise.then(model => {
            var _a, _b, _c, _d;
            if (this.isDisposed) {
                return Promise.reject(new Error('Disposed'));
            }
            // Since jupyter server may provide hash in model, we compare hash first
            const hashAvailable = ((_a = this.contentsModel) === null || _a === void 0 ? void 0 : _a.hash) !== undefined &&
                ((_b = this.contentsModel) === null || _b === void 0 ? void 0 : _b.hash) !== null &&
                model.hash !== undefined &&
                model.hash !== null;
            const hClient = (_c = this.contentsModel) === null || _c === void 0 ? void 0 : _c.hash;
            const hDisk = model.hash;
            if (hashAvailable && hClient !== hDisk) {
                console.warn(`Different hash found for ${this.path}`);
                return this._raiseConflict(model, options);
            }
            // When hash is not provided, we compare last_modified
            // We want to check last_modified (disk) > last_modified (client)
            // (our last save)
            // In some cases the filesystem reports an inconsistent time, so we allow buffer when comparing.
            const lastModifiedCheckMargin = this._lastModifiedCheckMargin;
            const modified = (_d = this.contentsModel) === null || _d === void 0 ? void 0 : _d.last_modified;
            const tClient = modified ? new Date(modified) : new Date();
            const tDisk = new Date(model.last_modified);
            if (!hashAvailable &&
                modified &&
                tDisk.getTime() - tClient.getTime() > lastModifiedCheckMargin) {
                console.warn(`Last saving performed ${tClient} ` +
                    `while the current file seems to have been saved ` +
                    `${tDisk}`);
                return this._raiseConflict(model, options);
            }
            return this._manager.contents
                .save(path, {
                ...options,
                contentProviderId: this._contentProviderId
            })
                .then(async (contentsModel) => {
                const model = await this._manager.contents.get(path, {
                    content: false,
                    hash: true,
                    contentProviderId: this._contentProviderId
                });
                return {
                    ...contentsModel,
                    hash: model.hash,
                    hash_algorithm: model.hash_algorithm
                };
            });
        }, err => {
            if (err.response && err.response.status === 404) {
                return this._manager.contents
                    .save(path, options)
                    .then(async (contentsModel) => {
                    const model = await this._manager.contents.get(path, {
                        content: false,
                        hash: true,
                        contentProviderId: this._contentProviderId
                    });
                    return {
                        ...contentsModel,
                        hash: model.hash,
                        hash_algorithm: model.hash_algorithm
                    };
                });
            }
            throw err;
        });
    }
    /**
     * Handle a save/load error with a dialog.
     */
    async _handleError(err, title) {
        await (0,index_js_.showErrorMessage)(title, err);
        return;
    }
    /**
     * Add a checkpoint if the file is writable.
     */
    _maybeCheckpoint(force) {
        let promise = Promise.resolve(void 0);
        if (!this.canSave) {
            return promise;
        }
        if (force) {
            promise = this.createCheckpoint().then( /* no-op */);
        }
        else {
            promise = this.listCheckpoints().then(checkpoints => {
                if (!this.isDisposed && !checkpoints.length && this.canSave) {
                    return this.createCheckpoint().then( /* no-op */);
                }
            });
        }
        return promise.catch(err => {
            // Handle a read-only folder.
            if (!err.response || err.response.status !== 403) {
                throw err;
            }
        });
    }
    /**
     * Handle a time conflict.
     */
    _raiseConflict(model, options) {
        if (this._conflictModalIsOpen) {
            const error = new Error('Modal is already displayed');
            error.name = 'ModalDuplicateError';
            return Promise.reject(error);
        }
        const body = this._trans.__(`"%1" has changed on disk since the last time it was opened or saved.
Do you want to overwrite the file on disk with the version open here,
or load the version on disk (revert)?`, this.path);
        const revertBtn = index_js_.Dialog.okButton({
            label: this._trans.__('Revert'),
            actions: ['revert']
        });
        const overwriteBtn = index_js_.Dialog.warnButton({
            label: this._trans.__('Overwrite'),
            actions: ['overwrite']
        });
        this._conflictModalIsOpen = true;
        return (0,index_js_.showDialog)({
            title: this._trans.__('File Changed'),
            body,
            buttons: [index_js_.Dialog.cancelButton(), revertBtn, overwriteBtn]
        }).then(result => {
            this._conflictModalIsOpen = false;
            if (this.isDisposed) {
                return Promise.reject(new Error('Disposed'));
            }
            if (result.button.actions.includes('overwrite')) {
                return this._manager.contents.save(this._path, {
                    ...options,
                    contentProviderId: this._contentProviderId
                });
            }
            if (result.button.actions.includes('revert')) {
                return this.revert().then(() => {
                    return model;
                });
            }
            const error = new Error('Cancel');
            error.name = 'ModalCancelError';
            return Promise.reject(error); // Otherwise cancel the save.
        });
    }
    /**
     * Handle a time conflict.
     */
    _maybeOverWrite(path) {
        const body = this._trans.__('"%1" already exists. Do you want to replace it?', path);
        const overwriteBtn = index_js_.Dialog.warnButton({
            label: this._trans.__('Overwrite'),
            accept: true
        });
        return (0,index_js_.showDialog)({
            title: this._trans.__('File Overwrite?'),
            body,
            buttons: [index_js_.Dialog.cancelButton(), overwriteBtn]
        }).then(result => {
            if (this.isDisposed) {
                return Promise.reject(new Error('Disposed'));
            }
            if (result.button.accept) {
                return this._manager.contents.delete(path).then(() => {
                    return this._finishSaveAs(path);
                });
            }
            else {
                return Promise.reject(new Error('Cancelled'));
            }
        });
    }
    /**
     * Finish a saveAs operation given a new path.
     */
    async _finishSaveAs(newPath) {
        this._saveState.emit('started');
        try {
            await this._manager.ready;
            const options = this._createSaveOptions();
            await this._manager.contents.save(newPath, options);
            await this._maybeCheckpoint(true);
            // Emit completion.
            this._saveState.emit('completed');
        }
        catch (err) {
            // If the save has been canceled by the user,
            // throw the error so that whoever called save()
            // can decide what to do.
            if (err.message === 'Cancel' ||
                err.message === 'Modal is already displayed') {
                throw err;
            }
            // Otherwise show an error message and throw the error.
            const localPath = this._manager.contents.localPath(this._path);
            const name = lib_index_js_.PathExt.basename(localPath);
            void this._handleError(err, this._trans.__('File Save Error for %1', name));
            // Emit failure.
            this._saveState.emit('failed');
            return;
        }
    }
    _createSaveOptions() {
        let content = null;
        if (this._factory.fileFormat === 'json') {
            content = this._model.toJSON();
        }
        else {
            content = this._model.toString();
            if (this._lineEnding) {
                content = content.replace(/\n/g, this._lineEnding);
            }
        }
        return {
            type: this._factory.contentType,
            format: this._factory.fileFormat,
            content
        };
    }
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * Get a new file path from the user.
     */
    function getSavePath(path, translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const saveBtn = index_js_.Dialog.okButton({ label: trans.__('Save'), accept: true });
        return (0,index_js_.showDialog)({
            title: trans.__('Save File As…'),
            body: new SaveWidget(path),
            buttons: [index_js_.Dialog.cancelButton(), saveBtn]
        }).then(result => {
            var _a;
            if (result.button.accept) {
                return (_a = result.value) !== null && _a !== void 0 ? _a : undefined;
            }
            return;
        });
    }
    Private.getSavePath = getSavePath;
    /**
     * A no-op function.
     */
    function noOp() {
        /* no-op */
    }
    Private.noOp = noOp;
    /*
     * A widget that gets a file path from a user.
     */
    class SaveWidget extends widgets_dist_index_es6_js_.Widget {
        /**
         * Construct a new save widget.
         */
        constructor(path) {
            super({ node: createSaveNode(path) });
        }
        /**
         * Get the value for the widget.
         */
        getValue() {
            return this.node.value;
        }
    }
    /**
     * Create the node for a save widget.
     */
    function createSaveNode(path) {
        const input = document.createElement('input');
        input.value = path;
        return input;
    }
})(Private || (Private = {}));
//# sourceMappingURL=context.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/lib/components.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * create readonly label toolbar item
 */
function createReadonlyLabel(panel, translator) {
    var _a;
    let trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
    return index_js_.ReactWidget.create(react_index_js_.createElement("div", null,
        react_index_js_.createElement("span", { className: "jp-ToolbarLabelComponent", title: trans.__(`Document is read-only. "Save" is disabled; use "Save as…" instead`) }, trans.__(`%1 is read-only`, (_a = panel.context.contentsModel) === null || _a === void 0 ? void 0 : _a.type))));
}
//# sourceMappingURL=components.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/lib/default.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * The default implementation of a document model.
 */
class DocumentModel extends codeeditor_lib_index_js_.CodeEditor.Model {
    /**
     * Construct a new document model.
     */
    constructor(options = {}) {
        var _a;
        super({ sharedModel: options.sharedModel });
        this._defaultLang = '';
        this._dirty = false;
        this._readOnly = false;
        this._contentChanged = new dist_index_es6_js_.Signal(this);
        this._stateChanged = new dist_index_es6_js_.Signal(this);
        this._defaultLang = (_a = options.languagePreference) !== null && _a !== void 0 ? _a : '';
        this._collaborationEnabled = !!options.collaborationEnabled;
        this.sharedModel.changed.connect(this._onStateChanged, this);
    }
    /**
     * A signal emitted when the document content changes.
     */
    get contentChanged() {
        return this._contentChanged;
    }
    /**
     * A signal emitted when the document state changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * The dirty state of the document.
     */
    get dirty() {
        return this._dirty;
    }
    set dirty(newValue) {
        const oldValue = this._dirty;
        if (newValue === oldValue) {
            return;
        }
        this._dirty = newValue;
        this.triggerStateChange({
            name: 'dirty',
            oldValue,
            newValue
        });
    }
    /**
     * The read only state of the document.
     */
    get readOnly() {
        return this._readOnly;
    }
    set readOnly(newValue) {
        if (newValue === this._readOnly) {
            return;
        }
        const oldValue = this._readOnly;
        this._readOnly = newValue;
        this.triggerStateChange({ name: 'readOnly', oldValue, newValue });
    }
    /**
     * The default kernel name of the document.
     *
     * #### Notes
     * This is a read-only property.
     */
    get defaultKernelName() {
        return '';
    }
    /**
     * The default kernel language of the document.
     *
     * #### Notes
     * This is a read-only property.
     */
    get defaultKernelLanguage() {
        return this._defaultLang;
    }
    /**
     * Whether the model is collaborative or not.
     */
    get collaborative() {
        return this._collaborationEnabled;
    }
    /**
     * Serialize the model to a string.
     */
    toString() {
        return this.sharedModel.getSource();
    }
    /**
     * Deserialize the model from a string.
     *
     * #### Notes
     * Should emit a [contentChanged] signal.
     */
    fromString(value) {
        this.sharedModel.setSource(value);
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        return JSON.parse(this.sharedModel.getSource() || 'null');
    }
    /**
     * Deserialize the model from JSON.
     *
     * #### Notes
     * Should emit a [contentChanged] signal.
     */
    fromJSON(value) {
        this.fromString(JSON.stringify(value));
    }
    /**
     * Initialize the model with its current state.
     */
    initialize() {
        return;
    }
    /**
     * Trigger a state change signal.
     */
    triggerStateChange(args) {
        this._stateChanged.emit(args);
    }
    /**
     * Trigger a content changed signal.
     */
    triggerContentChange() {
        this._contentChanged.emit(void 0);
        this.dirty = true;
    }
    _onStateChanged(sender, changes) {
        if (changes.sourceChange) {
            this.triggerContentChange();
        }
        if (changes.stateChange) {
            changes.stateChange.forEach(value => {
                if (value.name === 'dirty') {
                    // Setting `dirty` will trigger the state change.
                    // We always set `dirty` because the shared model state
                    // and the local attribute are synchronized one way shared model -> _dirty
                    this.dirty = value.newValue;
                }
                else if (value.oldValue !== value.newValue) {
                    this.triggerStateChange({
                        newValue: undefined,
                        oldValue: undefined,
                        ...value
                    });
                }
            });
        }
    }
}
/**
 * An implementation of a model factory for text files.
 */
class TextModelFactory {
    /**
     * Instantiates a TextModelFactory.
     */
    constructor(collaborative) {
        this._isDisposed = false;
        this._collaborative = collaborative !== null && collaborative !== void 0 ? collaborative : true;
    }
    /**
     * The name of the model type.
     *
     * #### Notes
     * This is a read-only property.
     */
    get name() {
        return 'text';
    }
    /**
     * The type of the file.
     *
     * #### Notes
     * This is a read-only property.
     */
    get contentType() {
        return 'file';
    }
    /**
     * The format of the file.
     *
     * This is a read-only property.
     */
    get fileFormat() {
        return 'text';
    }
    /**
     * Whether the model is collaborative or not.
     */
    get collaborative() {
        return this._collaborative;
    }
    /**
     * Get whether the model factory has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the model factory.
     */
    dispose() {
        this._isDisposed = true;
    }
    /**
     * Create a new model.
     *
     * @param options - Model options.
     *
     * @returns A new document model.
     */
    createNew(options = {}) {
        const collaborative = options.collaborationEnabled && this.collaborative;
        return new DocumentModel({
            ...options,
            collaborationEnabled: collaborative
        });
    }
    /**
     * Get the preferred kernel language given a file path.
     */
    preferredLanguage(path) {
        return '';
    }
}
/**
 * An implementation of a model factory for base64 files.
 */
class Base64ModelFactory extends TextModelFactory {
    /**
     * The name of the model type.
     *
     * #### Notes
     * This is a read-only property.
     */
    get name() {
        return 'base64';
    }
    /**
     * The type of the file.
     *
     * #### Notes
     * This is a read-only property.
     */
    get contentType() {
        return 'file';
    }
    /**
     * The format of the file.
     *
     * This is a read-only property.
     */
    get fileFormat() {
        return 'base64';
    }
}
/**
 * The default implementation of a widget factory.
 */
class ABCWidgetFactory {
    /**
     * Construct a new `ABCWidgetFactory`.
     */
    constructor(options) {
        this._isDisposed = false;
        this._widgetCreated = new dist_index_es6_js_.Signal(this);
        this._translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._name = options.name;
        this._label = options.label || options.name;
        this._readOnly = options.readOnly === undefined ? false : options.readOnly;
        this._defaultFor = options.defaultFor ? options.defaultFor.slice() : [];
        this._defaultRendered = (options.defaultRendered || []).slice();
        this._fileTypes = options.fileTypes.slice();
        this._modelName = options.modelName || 'text';
        this._preferKernel = !!options.preferKernel;
        this._canStartKernel = !!options.canStartKernel;
        this._shutdownOnClose = !!options.shutdownOnClose;
        this._autoStartDefault = !!options.autoStartDefault;
        this._toolbarFactory = options.toolbarFactory;
        this._contentProviderId = options.contentProviderId;
    }
    /**
     * A signal emitted when a widget is created.
     */
    get widgetCreated() {
        return this._widgetCreated;
    }
    /**
     * Get whether the model factory has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the document manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Whether the widget factory is read only.
     */
    get readOnly() {
        return this._readOnly;
    }
    /**
     * A unique name identifying of the widget.
     */
    get name() {
        return this._name;
    }
    /**
     * The label of the widget to display in dialogs.
     * If not given, name is used instead.
     */
    get label() {
        return this._label;
    }
    /**
     * The file types the widget can view.
     */
    get fileTypes() {
        return this._fileTypes.slice();
    }
    /**
     * The registered name of the model type used to create the widgets.
     */
    get modelName() {
        return this._modelName;
    }
    /**
     * The file types for which the factory should be the default.
     */
    get defaultFor() {
        return this._defaultFor.slice();
    }
    /**
     * The file types for which the factory should be the default for
     * rendering a document model, if different from editing.
     */
    get defaultRendered() {
        return this._defaultRendered.slice();
    }
    /**
     * Whether the widgets prefer having a kernel started.
     */
    get preferKernel() {
        return this._preferKernel;
    }
    /**
     * Whether the widgets can start a kernel when opened.
     */
    get canStartKernel() {
        return this._canStartKernel;
    }
    /**
     * The application language translator.
     */
    get translator() {
        return this._translator;
    }
    /**
     * Whether the kernel should be shutdown when the widget is closed.
     */
    get shutdownOnClose() {
        return this._shutdownOnClose;
    }
    set shutdownOnClose(value) {
        this._shutdownOnClose = value;
    }
    /**
     * Whether to automatically select the preferred kernel during a kernel start
     */
    get autoStartDefault() {
        return this._autoStartDefault;
    }
    set autoStartDefault(value) {
        this._autoStartDefault = value;
    }
    /**
     * Create a new widget given a document model and a context.
     *
     * #### Notes
     * It should emit the [widgetCreated] signal with the new widget.
     */
    createNew(context, source) {
        var _a;
        // Create the new widget
        const widget = this.createNewWidget(context, source);
        // Add toolbar
        (0,index_js_.setToolbar)(widget, (_a = this._toolbarFactory) !== null && _a !== void 0 ? _a : this.defaultToolbarFactory.bind(this));
        // Emit widget created signal
        this._widgetCreated.emit(widget);
        return widget;
    }
    /**
     * Identifier of the content provider required for the widget (if any).
     *
     * Throws Error if the content provider was already set.
     *
     * @experimental
     */
    get contentProviderId() {
        return this._contentProviderId;
    }
    set contentProviderId(value) {
        if (this._contentProviderId && value !== this._contentProviderId) {
            throw Error(`Cannot change content provider on factory with an existing provider: ${this._contentProviderId}`);
        }
        this._contentProviderId = value;
    }
    /**
     * Default factory for toolbar items to be added after the widget is created.
     */
    defaultToolbarFactory(widget) {
        return [];
    }
}
/**
 * The class name added to a dirty widget.
 */
const DIRTY_CLASS = 'jp-mod-dirty';
/**
 * A document widget implementation.
 */
class DocumentWidget extends index_js_.MainAreaWidget {
    constructor(options) {
        var _a;
        // Include the context ready promise in the widget reveal promise
        options.reveal = Promise.all([options.reveal, options.context.ready]);
        super(options);
        this._trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.context = options.context;
        // Handle context path changes
        this.context.pathChanged.connect(this._onPathChanged, this);
        this._onPathChanged(this.context, this.context.path);
        // Listen for changes in the dirty state.
        this.context.model.stateChanged.connect(this._onModelStateChanged, this);
        void this.context.ready.then(() => {
            this._handleDirtyState();
        });
        // listen for changes to the title object
        this.title.changed.connect(this._onTitleChanged, this);
    }
    /**
     * Set URI fragment identifier.
     */
    setFragment(fragment) {
        /* no-op */
    }
    /**
     * Handle a title change.
     */
    async _onTitleChanged(_sender) {
        const validNameExp = /[\/\\:]/;
        const name = this.title.label;
        // Use localPath to avoid the drive name
        const filename = this.context.localPath.split('/').pop() || this.context.localPath;
        if (name === filename) {
            return;
        }
        if (name.length > 0 && !validNameExp.test(name)) {
            const oldPath = this.context.path;
            await this.context.rename(name);
            if (this.context.path !== oldPath) {
                // Rename succeeded
                return;
            }
        }
        // Reset title if name is invalid or rename fails
        this.title.label = filename;
    }
    /**
     * Handle a path change.
     */
    _onPathChanged(sender, path) {
        this.title.label = lib_index_js_.PathExt.basename(sender.localPath);
        // The document is not untitled any more.
        this.isUntitled = false;
    }
    /**
     * Handle a change to the context model state.
     */
    _onModelStateChanged(sender, args) {
        var _a;
        if (args.name === 'dirty') {
            this._handleDirtyState();
        }
        if (!this.context.model.dirty) {
            if (((_a = this.context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable) === false) {
                const readOnlyIndicator = createReadonlyLabel(this);
                let roi = this.toolbar.insertBefore('kernelName', 'read-only-indicator', readOnlyIndicator);
                if (!roi) {
                    this.toolbar.addItem('read-only-indicator', readOnlyIndicator);
                }
            }
        }
    }
    /**
     * Handle the dirty state of the context model.
     */
    _handleDirtyState() {
        if (this.context.model.dirty &&
            !this.title.className.includes(DIRTY_CLASS)) {
            this.title.className += ` ${DIRTY_CLASS}`;
        }
        else {
            this.title.className = this.title.className.replace(DIRTY_CLASS, '');
        }
    }
}
//# sourceMappingURL=default.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/lib/mimedocument.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.









/**
 * A content widget for a rendered mimetype document.
 */
class MimeContent extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new widget.
     */
    constructor(options) {
        super();
        /**
         * A bound change callback.
         */
        this._changeCallback = (options) => {
            if (!options.data || !options.data[this.mimeType]) {
                return;
            }
            const data = options.data[this.mimeType];
            if (typeof data === 'string') {
                if (data !== this._context.model.toString()) {
                    this._context.model.fromString(data);
                }
            }
            else if (data !== null &&
                data !== undefined &&
                !dist_index_js_.JSONExt.deepEqual(data, this._context.model.toJSON())) {
                this._context.model.fromJSON(data);
            }
        };
        this._fragment = '';
        this._ready = new dist_index_js_.PromiseDelegate();
        this._isRendering = false;
        this._renderRequested = false;
        this.addClass('jp-MimeDocument');
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this.mimeType = options.mimeType;
        this._dataType = options.dataType || 'string';
        this._context = options.context;
        this.renderer = options.renderer;
        const layout = (this.layout = new widgets_dist_index_es6_js_.StackedLayout());
        layout.addWidget(this.renderer);
        this._context.ready
            .then(() => {
            return this._render();
        })
            .then(() => {
            // After rendering for the first time, send an activation request if we
            // are currently focused.
            if (this.node === document.activeElement) {
                // We want to synchronously send (not post) the activate message, while
                // we know this node still has focus.
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(this.renderer, widgets_dist_index_es6_js_.Widget.Msg.ActivateRequest);
            }
            // Throttle the rendering rate of the widget.
            this._monitor = new lib_index_js_.ActivityMonitor({
                signal: this._context.model.contentChanged,
                timeout: options.renderTimeout
            });
            this._monitor.activityStopped.connect(this.update, this);
            this._ready.resolve(undefined);
        })
            .catch(reason => {
            // Dispose the document if rendering fails.
            requestAnimationFrame(() => {
                this.dispose();
            });
            void (0,index_js_.showErrorMessage)(this._trans.__('Renderer Failure: %1', this._context.path), reason);
        });
    }
    /**
     * Print method. Deferred to the renderer.
     */
    [index_js_.Printing.symbol]() {
        return index_js_.Printing.getPrintFunction(this.renderer);
    }
    /**
     * A promise that resolves when the widget is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Set URI fragment identifier.
     */
    setFragment(fragment) {
        this._fragment = fragment;
        this.update();
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        if (this._monitor) {
            this._monitor.dispose();
        }
        this._monitor = null;
        super.dispose();
    }
    /**
     * Handle an `update-request` message to the widget.
     */
    onUpdateRequest(msg) {
        if (this._context.isReady) {
            void this._render();
            this._fragment = '';
        }
    }
    /**
     * Render the mime content.
     */
    async _render() {
        if (this.isDisposed) {
            return;
        }
        // Since rendering is async, we note render requests that happen while we
        // actually are rendering for a future rendering.
        if (this._isRendering) {
            this._renderRequested = true;
            return;
        }
        // Set up for this rendering pass.
        this._renderRequested = false;
        const context = this._context;
        const model = context.model;
        const data = {};
        if (this._dataType === 'string') {
            data[this.mimeType] = model.toString();
        }
        else {
            data[this.mimeType] = model.toJSON();
        }
        const mimeModel = new rendermime_lib_index_js_.MimeModel({
            data,
            callback: this._changeCallback,
            metadata: { fragment: this._fragment }
        });
        try {
            // Do the rendering asynchronously.
            this._isRendering = true;
            await this.renderer.renderModel(mimeModel);
            this._isRendering = false;
            // If there is an outstanding request to render, go ahead and render
            if (this._renderRequested) {
                return this._render();
            }
        }
        catch (reason) {
            // Dispose the document if rendering fails.
            requestAnimationFrame(() => {
                this.dispose();
            });
            void (0,index_js_.showErrorMessage)(this._trans.__('Renderer Failure: %1', context.path), reason);
        }
    }
}
/**
 * A document widget for mime content.
 */
class MimeDocument extends DocumentWidget {
    setFragment(fragment) {
        this.content.setFragment(fragment);
    }
}
/**
 * An implementation of a widget factory for a rendered mimetype document.
 */
class MimeDocumentFactory extends ABCWidgetFactory {
    /**
     * Construct a new mimetype widget factory.
     */
    constructor(options) {
        super(mimedocument_Private.createRegistryOptions(options));
        this._rendermime = options.rendermime;
        this._renderTimeout = options.renderTimeout || 1000;
        this._dataType = options.dataType || 'string';
        this._fileType = options.primaryFileType;
        this._factory = options.factory;
    }
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        var _a, _b;
        const ft = this._fileType;
        const mimeType = (ft === null || ft === void 0 ? void 0 : ft.mimeTypes.length)
            ? ft.mimeTypes[0]
            : codeeditor_lib_index_js_.IEditorMimeTypeService.defaultMimeType;
        const rendermime = this._rendermime.clone({
            resolver: context.urlResolver
        });
        let renderer;
        if (this._factory && this._factory.mimeTypes.includes(mimeType)) {
            renderer = this._factory.createRenderer({
                mimeType,
                resolver: rendermime.resolver,
                sanitizer: rendermime.sanitizer,
                linkHandler: rendermime.linkHandler,
                latexTypesetter: rendermime.latexTypesetter,
                markdownParser: rendermime.markdownParser
            });
        }
        else {
            renderer = rendermime.createRenderer(mimeType);
        }
        const content = new MimeContent({
            context,
            renderer,
            mimeType,
            renderTimeout: this._renderTimeout,
            dataType: this._dataType
        });
        content.title.icon = ft === null || ft === void 0 ? void 0 : ft.icon;
        content.title.iconClass = (_a = ft === null || ft === void 0 ? void 0 : ft.iconClass) !== null && _a !== void 0 ? _a : '';
        content.title.iconLabel = (_b = ft === null || ft === void 0 ? void 0 : ft.iconLabel) !== null && _b !== void 0 ? _b : '';
        const widget = new MimeDocument({ content, context });
        return widget;
    }
}
/**
 * The namespace for the module implementation details.
 */
var mimedocument_Private;
(function (Private) {
    /**
     * Create the document registry options.
     */
    function createRegistryOptions(options) {
        return {
            ...options,
            readOnly: true
        };
    }
    Private.createRegistryOptions = createRegistryOptions;
})(mimedocument_Private || (mimedocument_Private = {}));
//# sourceMappingURL=mimedocument.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/lib/registry.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * The document registry.
 */
class DocumentRegistry {
    /**
     * Construct a new document registry.
     */
    constructor(options = {}) {
        this._modelFactories = Object.create(null);
        this._widgetFactories = Object.create(null);
        this._defaultWidgetFactory = '';
        this._defaultWidgetFactoryOverrides = Object.create(null);
        this._defaultWidgetFactories = Object.create(null);
        this._defaultRenderedWidgetFactories = Object.create(null);
        this._widgetFactoriesForFileType = Object.create(null);
        this._fileTypes = [];
        this._extenders = Object.create(null);
        this._changed = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        const factory = options.textModelFactory;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        if (factory && factory.name !== 'text') {
            throw new Error('Text model factory must have the name `text`');
        }
        this._modelFactories['text'] = factory || new TextModelFactory(true);
        const fts = options.initialFileTypes ||
            DocumentRegistry.getDefaultFileTypes(this.translator);
        fts.forEach(ft => {
            const value = {
                ...DocumentRegistry.getFileTypeDefaults(this.translator),
                ...ft
            };
            this._fileTypes.push(value);
        });
    }
    /**
     * A signal emitted when the registry has changed.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Get whether the document registry has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the document registry.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        for (const modelName in this._modelFactories) {
            this._modelFactories[modelName].dispose();
        }
        for (const widgetName in this._widgetFactories) {
            this._widgetFactories[widgetName].dispose();
        }
        for (const widgetName in this._extenders) {
            this._extenders[widgetName].length = 0;
        }
        this._fileTypes.length = 0;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Add a widget factory to the registry.
     *
     * @param factory - The factory instance to register.
     *
     * @returns A disposable which will unregister the factory.
     *
     * #### Notes
     * If a factory with the given `'name'` is already registered,
     * a warning will be logged, and this will be a no-op.
     * If `'*'` is given as a default extension, the factory will be registered
     * as the global default.
     * If an extension or global default is already registered, this factory
     * will override the existing default.
     * The factory cannot be named an empty string or the string `'default'`.
     */
    addWidgetFactory(factory) {
        const name = factory.name.toLowerCase();
        if (!name || name === 'default') {
            throw Error('Invalid factory name');
        }
        if (this._widgetFactories[name]) {
            console.warn(`Duplicate registered factory ${name}`);
            return new index_es6_js_.DisposableDelegate(registry_Private.noOp);
        }
        this._widgetFactories[name] = factory;
        for (const ft of factory.defaultFor || []) {
            if (factory.fileTypes.indexOf(ft) === -1) {
                continue;
            }
            if (ft === '*') {
                this._defaultWidgetFactory = name;
            }
            else {
                this._defaultWidgetFactories[ft] = name;
            }
        }
        for (const ft of factory.defaultRendered || []) {
            if (factory.fileTypes.indexOf(ft) === -1) {
                continue;
            }
            this._defaultRenderedWidgetFactories[ft] = name;
        }
        // For convenience, store a mapping of file type name -> name
        for (const ft of factory.fileTypes) {
            if (!this._widgetFactoriesForFileType[ft]) {
                this._widgetFactoriesForFileType[ft] = [];
            }
            this._widgetFactoriesForFileType[ft].push(name);
        }
        this._changed.emit({
            type: 'widgetFactory',
            name,
            change: 'added'
        });
        return new index_es6_js_.DisposableDelegate(() => {
            delete this._widgetFactories[name];
            if (this._defaultWidgetFactory === name) {
                this._defaultWidgetFactory = '';
            }
            for (const ext of Object.keys(this._defaultWidgetFactories)) {
                if (this._defaultWidgetFactories[ext] === name) {
                    delete this._defaultWidgetFactories[ext];
                }
            }
            for (const ext of Object.keys(this._defaultRenderedWidgetFactories)) {
                if (this._defaultRenderedWidgetFactories[ext] === name) {
                    delete this._defaultRenderedWidgetFactories[ext];
                }
            }
            for (const ext of Object.keys(this._widgetFactoriesForFileType)) {
                algorithm_dist_index_es6_js_.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[ext], name);
                if (this._widgetFactoriesForFileType[ext].length === 0) {
                    delete this._widgetFactoriesForFileType[ext];
                }
            }
            for (const ext of Object.keys(this._defaultWidgetFactoryOverrides)) {
                if (this._defaultWidgetFactoryOverrides[ext] === name) {
                    delete this._defaultWidgetFactoryOverrides[ext];
                }
            }
            this._changed.emit({
                type: 'widgetFactory',
                name,
                change: 'removed'
            });
        });
    }
    /**
     * Add a model factory to the registry.
     *
     * @param factory - The factory instance.
     *
     * @returns A disposable which will unregister the factory.
     *
     * #### Notes
     * If a factory with the given `name` is already registered, or
     * the given factory is already registered, a warning will be logged
     * and this will be a no-op.
     */
    addModelFactory(factory) {
        const name = factory.name.toLowerCase();
        if (this._modelFactories[name]) {
            console.warn(`Duplicate registered factory ${name}`);
            return new index_es6_js_.DisposableDelegate(registry_Private.noOp);
        }
        this._modelFactories[name] = factory;
        this._changed.emit({
            type: 'modelFactory',
            name,
            change: 'added'
        });
        return new index_es6_js_.DisposableDelegate(() => {
            delete this._modelFactories[name];
            this._changed.emit({
                type: 'modelFactory',
                name,
                change: 'removed'
            });
        });
    }
    /**
     * Add a widget extension to the registry.
     *
     * @param widgetName - The name of the widget factory.
     *
     * @param extension - A widget extension.
     *
     * @returns A disposable which will unregister the extension.
     *
     * #### Notes
     * If the extension is already registered for the given
     * widget name, a warning will be logged and this will be a no-op.
     */
    addWidgetExtension(widgetName, extension) {
        widgetName = widgetName.toLowerCase();
        if (!(widgetName in this._extenders)) {
            this._extenders[widgetName] = [];
        }
        const extenders = this._extenders[widgetName];
        const index = algorithm_dist_index_es6_js_.ArrayExt.firstIndexOf(extenders, extension);
        if (index !== -1) {
            console.warn(`Duplicate registered extension for ${widgetName}`);
            return new index_es6_js_.DisposableDelegate(registry_Private.noOp);
        }
        this._extenders[widgetName].push(extension);
        this._changed.emit({
            type: 'widgetExtension',
            name: widgetName,
            change: 'added'
        });
        return new index_es6_js_.DisposableDelegate(() => {
            algorithm_dist_index_es6_js_.ArrayExt.removeFirstOf(this._extenders[widgetName], extension);
            this._changed.emit({
                type: 'widgetExtension',
                name: widgetName,
                change: 'removed'
            });
        });
    }
    /**
     * Add a file type to the document registry.
     *
     * @param fileType - The file type object to register.
     * @param factories - Optional factories to use for the file type.
     *
     * @returns A disposable which will unregister the command.
     *
     * #### Notes
     * These are used to populate the "Create New" dialog.
     *
     * If no default factory exists for the file type, the first factory will
     * be defined as default factory.
     */
    addFileType(fileType, factories) {
        const value = {
            ...DocumentRegistry.getFileTypeDefaults(this.translator),
            ...fileType,
            // fall back to fileIcon if needed
            ...(!(fileType.icon || fileType.iconClass) && { icon: ui_components_lib_index_js_.fileIcon })
        };
        this._fileTypes.push(value);
        // Add the filetype to the factory - filetype mapping
        //  We do not change the factory itself
        if (factories) {
            const fileTypeName = value.name.toLowerCase();
            factories
                .map(factory => factory.toLowerCase())
                .forEach(factory => {
                if (!this._widgetFactoriesForFileType[fileTypeName]) {
                    this._widgetFactoriesForFileType[fileTypeName] = [];
                }
                if (!this._widgetFactoriesForFileType[fileTypeName].includes(factory)) {
                    this._widgetFactoriesForFileType[fileTypeName].push(factory);
                }
            });
            if (!this._defaultWidgetFactories[fileTypeName]) {
                this._defaultWidgetFactories[fileTypeName] =
                    this._widgetFactoriesForFileType[fileTypeName][0];
            }
        }
        this._changed.emit({
            type: 'fileType',
            name: value.name,
            change: 'added'
        });
        return new index_es6_js_.DisposableDelegate(() => {
            algorithm_dist_index_es6_js_.ArrayExt.removeFirstOf(this._fileTypes, value);
            if (factories) {
                const fileTypeName = value.name.toLowerCase();
                for (const name of factories.map(factory => factory.toLowerCase())) {
                    algorithm_dist_index_es6_js_.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[fileTypeName], name);
                }
                if (this._defaultWidgetFactories[fileTypeName] ===
                    factories[0].toLowerCase()) {
                    delete this._defaultWidgetFactories[fileTypeName];
                }
            }
            this._changed.emit({
                type: 'fileType',
                name: fileType.name,
                change: 'removed'
            });
        });
    }
    /**
     * Get a list of the preferred widget factories.
     *
     * @param path - The file path to filter the results.
     *
     * @returns A new array of widget factories.
     *
     * #### Notes
     * Only the widget factories whose associated model factory have
     * been registered will be returned.
     * The first item is considered the default. The returned array
     * has widget factories in the following order:
     * - path-specific default factory
     * - path-specific default rendered factory
     * - global default factory
     * - all other path-specific factories
     * - all other global factories
     */
    preferredWidgetFactories(path) {
        const factories = new Set();
        // Get the ordered matching file types.
        const fts = this.getFileTypesForPath(lib_index_js_.PathExt.basename(path));
        // Start with any user overrides for the defaults.
        fts.forEach(ft => {
            if (ft.name in this._defaultWidgetFactoryOverrides) {
                factories.add(this._defaultWidgetFactoryOverrides[ft.name]);
            }
        });
        // Next add the file type default factories.
        fts.forEach(ft => {
            if (ft.name in this._defaultWidgetFactories) {
                factories.add(this._defaultWidgetFactories[ft.name]);
            }
        });
        // Add the file type default rendered factories.
        fts.forEach(ft => {
            if (ft.name in this._defaultRenderedWidgetFactories) {
                factories.add(this._defaultRenderedWidgetFactories[ft.name]);
            }
        });
        // Add the global default factory.
        if (this._defaultWidgetFactory) {
            factories.add(this._defaultWidgetFactory);
        }
        // Add the file type factories in registration order.
        for (const ft of fts) {
            if (ft.name in this._widgetFactoriesForFileType) {
                for (const n of this._widgetFactoriesForFileType[ft.name]) {
                    factories.add(n);
                }
            }
        }
        // Add the rest of the global factories, in registration order.
        if ('*' in this._widgetFactoriesForFileType) {
            for (const n of this._widgetFactoriesForFileType['*']) {
                factories.add(n);
            }
        }
        // Construct the return list, checking to make sure the corresponding
        // model factories are registered.
        const factoryList = [];
        for (const name of factories) {
            const factory = this._widgetFactories[name];
            if (!factory) {
                continue;
            }
            const modelName = factory.modelName || 'text';
            if (modelName in this._modelFactories) {
                factoryList.push(factory);
            }
        }
        return factoryList;
    }
    /**
     * Get the default rendered widget factory for a path.
     *
     * @param path - The path to for which to find a widget factory.
     *
     * @returns The default rendered widget factory for the path.
     *
     * ### Notes
     * If the widget factory has registered a separate set of `defaultRendered`
     * file types and there is a match in that set, this returns that.
     * Otherwise, this returns the same widget factory as
     * [[defaultWidgetFactory]].
     *
     * The user setting `defaultViewers` took precedence on this one too.
     */
    defaultRenderedWidgetFactory(path) {
        // Get the matching file types.
        const ftNames = this.getFileTypesForPath(lib_index_js_.PathExt.basename(path)).map(ft => ft.name);
        // Start with any user overrides for the defaults.
        for (const name in ftNames) {
            if (name in this._defaultWidgetFactoryOverrides) {
                return this._widgetFactories[this._defaultWidgetFactoryOverrides[name]];
            }
        }
        // Find if a there is a default rendered factory for this type.
        for (const name in ftNames) {
            if (name in this._defaultRenderedWidgetFactories) {
                return this._widgetFactories[this._defaultRenderedWidgetFactories[name]];
            }
        }
        // Fallback to the default widget factory
        return this.defaultWidgetFactory(path);
    }
    /**
     * Get the default widget factory for a path.
     *
     * @param path - An optional file path to filter the results.
     *
     * @returns The default widget factory for an path.
     *
     * #### Notes
     * This is equivalent to the first value in [[preferredWidgetFactories]].
     */
    defaultWidgetFactory(path) {
        if (!path) {
            return this._widgetFactories[this._defaultWidgetFactory];
        }
        return this.preferredWidgetFactories(path)[0];
    }
    /**
     * Set overrides for the default widget factory for a file type.
     *
     * Normally, a widget factory informs the document registry which file types
     * it should be the default for using the `defaultFor` option in the
     * IWidgetFactoryOptions. This function can be used to override that after
     * the fact.
     *
     * @param fileType The name of the file type.
     *
     * @param factory The name of the factory.
     *
     * #### Notes
     * If `factory` is undefined, then any override will be unset, and the
     * default factory will revert to the original value.
     *
     * If `factory` or `fileType` are not known to the docregistry, or
     * if `factory` cannot open files of type `fileType`, this will throw
     * an error.
     */
    setDefaultWidgetFactory(fileType, factory) {
        fileType = fileType.toLowerCase();
        if (!this.getFileType(fileType)) {
            throw Error(`Cannot find file type ${fileType}`);
        }
        if (!factory) {
            if (this._defaultWidgetFactoryOverrides[fileType]) {
                delete this._defaultWidgetFactoryOverrides[fileType];
            }
            return;
        }
        if (!this.getWidgetFactory(factory)) {
            throw Error(`Cannot find widget factory ${factory}`);
        }
        factory = factory.toLowerCase();
        const factories = this._widgetFactoriesForFileType[fileType];
        if (factory !== this._defaultWidgetFactory &&
            !(factories && factories.includes(factory))) {
            throw Error(`Factory ${factory} cannot view file type ${fileType}`);
        }
        this._defaultWidgetFactoryOverrides[fileType] = factory;
    }
    /**
     * Create an iterator over the widget factories that have been registered.
     *
     * @returns A new iterator of widget factories.
     */
    *widgetFactories() {
        for (const name in this._widgetFactories) {
            yield this._widgetFactories[name];
        }
    }
    /**
     * Create an iterator over the model factories that have been registered.
     *
     * @returns A new iterator of model factories.
     */
    *modelFactories() {
        for (const name in this._modelFactories) {
            yield this._modelFactories[name];
        }
    }
    /**
     * Create an iterator over the registered extensions for a given widget.
     *
     * @param widgetName - The name of the widget factory.
     *
     * @returns A new iterator over the widget extensions.
     */
    *widgetExtensions(widgetName) {
        widgetName = widgetName.toLowerCase();
        if (widgetName in this._extenders) {
            for (const extension of this._extenders[widgetName]) {
                yield extension;
            }
        }
    }
    /**
     * Create an iterator over the file types that have been registered.
     *
     * @returns A new iterator of file types.
     */
    *fileTypes() {
        for (const type of this._fileTypes) {
            yield type;
        }
    }
    /**
     * Get a widget factory by name.
     *
     * @param widgetName - The name of the widget factory.
     *
     * @returns A widget factory instance.
     */
    getWidgetFactory(widgetName) {
        return this._widgetFactories[widgetName.toLowerCase()];
    }
    /**
     * Get a model factory by name.
     *
     * @param name - The name of the model factory.
     *
     * @returns A model factory instance.
     */
    getModelFactory(name) {
        return this._modelFactories[name.toLowerCase()];
    }
    /**
     * Get a file type by name.
     */
    getFileType(name) {
        name = name.toLowerCase();
        return (0,algorithm_dist_index_es6_js_.find)(this._fileTypes, fileType => {
            return fileType.name.toLowerCase() === name;
        });
    }
    /**
     * Get a kernel preference.
     *
     * @param path - The file path.
     *
     * @param widgetName - The name of the widget factory.
     *
     * @param kernel - An optional existing kernel model.
     *
     * @returns A kernel preference.
     */
    getKernelPreference(path, widgetName, kernel) {
        widgetName = widgetName.toLowerCase();
        const widgetFactory = this._widgetFactories[widgetName];
        if (!widgetFactory) {
            return void 0;
        }
        const modelFactory = this.getModelFactory(widgetFactory.modelName || 'text');
        if (!modelFactory) {
            return void 0;
        }
        const language = modelFactory.preferredLanguage(lib_index_js_.PathExt.basename(path));
        const name = kernel && kernel.name;
        const id = kernel && kernel.id;
        return {
            id,
            name,
            language,
            shouldStart: widgetFactory.preferKernel,
            canStart: widgetFactory.canStartKernel,
            shutdownOnDispose: widgetFactory.shutdownOnClose,
            autoStartDefault: widgetFactory.autoStartDefault
        };
    }
    /**
     * Get the best file type given a contents model.
     *
     * @param model - The contents model of interest.
     *
     * @returns The best matching file type.
     */
    getFileTypeForModel(model) {
        let ft = null;
        if (model.name || model.path) {
            const name = model.name || lib_index_js_.PathExt.basename(model.path);
            const fts = this._getFileTypesForPath(name, model.type);
            if (fts.length > 0) {
                ft = fts[0];
            }
        }
        switch (model.type) {
            case 'directory':
                if (ft !== null && ft.contentType === 'directory') {
                    return ft;
                }
                return ((0,algorithm_dist_index_es6_js_.find)(this._fileTypes, ft => ft.contentType === 'directory') ||
                    DocumentRegistry.getDefaultDirectoryFileType(this.translator));
            case 'notebook':
                if (ft !== null && ft.contentType === 'notebook') {
                    return ft;
                }
                return ((0,algorithm_dist_index_es6_js_.find)(this._fileTypes, ft => ft.contentType === 'notebook') ||
                    DocumentRegistry.getDefaultNotebookFileType(this.translator));
            default:
                // Find the best matching extension.
                if (ft !== null) {
                    return ft;
                }
                return (this.getFileType('text') ||
                    DocumentRegistry.getDefaultTextFileType(this.translator));
        }
    }
    /**
     * Get the file types that match a file name.
     *
     * @param path - The path of the file.
     *
     * @returns An ordered list of matching file types.
     */
    getFileTypesForPath(path) {
        return this._getFileTypesForPath(path);
    }
    _getFileTypesForPath(path, type) {
        const fts = [];
        const name = lib_index_js_.PathExt.basename(path);
        // Look for a pattern match first.
        let ft = (0,algorithm_dist_index_es6_js_.find)(this._fileTypes, ft => {
            return !!((!type || ft.contentType == type) &&
                ft.pattern &&
                name.match(ft.pattern) !== null);
        });
        if (ft) {
            fts.push(ft);
        }
        // Then look by extension name, starting with the longest
        let ext = registry_Private.extname(name);
        while (ext.length > 1) {
            const ftSubset = this._fileTypes.filter(ft => 
            // In Private.extname, the extension is transformed to lower case
            (!type || ft.contentType == type) &&
                ft.extensions.map(extension => extension.toLowerCase()).includes(ext));
            fts.push(...ftSubset);
            ext = '.' + ext.split('.').slice(2).join('.');
        }
        return fts;
    }
}
/**
 * The namespace for the `DocumentRegistry` class statics.
 */
(function (DocumentRegistry) {
    /**
     * The defaults used for a file type.
     *
     * @param translator - The application language translator.
     *
     * @returns The default file type.
     */
    function getFileTypeDefaults(translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');
        return {
            name: 'default',
            displayName: trans.__('default'),
            extensions: [],
            mimeTypes: [],
            contentType: 'file',
            fileFormat: 'text'
        };
    }
    DocumentRegistry.getFileTypeDefaults = getFileTypeDefaults;
    /**
     * The default text file type used by the document registry.
     *
     * @param translator - The application language translator.
     *
     * @returns The default text file type.
     */
    function getDefaultTextFileType(translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');
        const fileTypeDefaults = getFileTypeDefaults(translator);
        return {
            ...fileTypeDefaults,
            name: 'text',
            displayName: trans.__('Text'),
            mimeTypes: ['text/plain'],
            extensions: ['.txt'],
            icon: ui_components_lib_index_js_.fileIcon
        };
    }
    DocumentRegistry.getDefaultTextFileType = getDefaultTextFileType;
    /**
     * The default notebook file type used by the document registry.
     *
     * @param translator - The application language translator.
     *
     * @returns The default notebook file type.
     */
    function getDefaultNotebookFileType(translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');
        return {
            ...getFileTypeDefaults(translator),
            name: 'notebook',
            displayName: trans.__('Notebook'),
            mimeTypes: ['application/x-ipynb+json'],
            extensions: ['.ipynb'],
            contentType: 'notebook',
            fileFormat: 'json',
            icon: ui_components_lib_index_js_.notebookIcon
        };
    }
    DocumentRegistry.getDefaultNotebookFileType = getDefaultNotebookFileType;
    /**
     * The default directory file type used by the document registry.
     *
     * @param translator - The application language translator.
     *
     * @returns The default directory file type.
     */
    function getDefaultDirectoryFileType(translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');
        return {
            ...getFileTypeDefaults(translator),
            name: 'directory',
            displayName: trans.__('Directory'),
            extensions: [],
            mimeTypes: ['text/directory'],
            contentType: 'directory',
            icon: ui_components_lib_index_js_.folderIcon
        };
    }
    DocumentRegistry.getDefaultDirectoryFileType = getDefaultDirectoryFileType;
    /**
     * The default file types used by the document registry.
     *
     * @param translator - The application language translator.
     *
     * @returns The default directory file types.
     */
    function getDefaultFileTypes(translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');
        return [
            getDefaultTextFileType(translator),
            getDefaultNotebookFileType(translator),
            getDefaultDirectoryFileType(translator),
            {
                name: 'markdown',
                displayName: trans.__('Markdown File'),
                extensions: ['.md'],
                mimeTypes: ['text/markdown'],
                icon: ui_components_lib_index_js_.markdownIcon
            },
            {
                name: 'PDF',
                displayName: trans.__('PDF File'),
                extensions: ['.pdf'],
                mimeTypes: ['application/pdf'],
                icon: ui_components_lib_index_js_.pdfIcon
            },
            {
                name: 'python',
                displayName: trans.__('Python File'),
                extensions: ['.py'],
                mimeTypes: ['text/x-python'],
                icon: ui_components_lib_index_js_.pythonIcon
            },
            {
                name: 'json',
                displayName: trans.__('JSON File'),
                extensions: ['.json'],
                mimeTypes: ['application/json'],
                icon: ui_components_lib_index_js_.jsonIcon
            },
            {
                name: 'jsonl',
                displayName: trans.__('JSONLines File'),
                extensions: ['.jsonl', '.ndjson'],
                mimeTypes: [
                    'text/jsonl',
                    'application/jsonl',
                    'application/json-lines'
                ],
                icon: ui_components_lib_index_js_.jsonIcon
            },
            {
                name: 'julia',
                displayName: trans.__('Julia File'),
                extensions: ['.jl'],
                mimeTypes: ['text/x-julia'],
                icon: ui_components_lib_index_js_.juliaIcon
            },
            {
                name: 'csv',
                displayName: trans.__('CSV File'),
                extensions: ['.csv'],
                mimeTypes: ['text/csv'],
                icon: ui_components_lib_index_js_.spreadsheetIcon
            },
            {
                name: 'tsv',
                displayName: trans.__('TSV File'),
                extensions: ['.tsv'],
                mimeTypes: ['text/csv'],
                icon: ui_components_lib_index_js_.spreadsheetIcon
            },
            {
                name: 'r',
                displayName: trans.__('R File'),
                mimeTypes: ['text/x-rsrc'],
                extensions: ['.R'],
                icon: ui_components_lib_index_js_.rKernelIcon
            },
            {
                name: 'yaml',
                displayName: trans.__('YAML File'),
                mimeTypes: ['text/x-yaml', 'text/yaml'],
                extensions: ['.yaml', '.yml'],
                icon: ui_components_lib_index_js_.yamlIcon
            },
            {
                name: 'svg',
                displayName: trans.__('Image'),
                mimeTypes: ['image/svg+xml'],
                extensions: ['.svg'],
                icon: ui_components_lib_index_js_.imageIcon,
                fileFormat: 'base64'
            },
            {
                name: 'tiff',
                displayName: trans.__('Image'),
                mimeTypes: ['image/tiff'],
                extensions: ['.tif', '.tiff'],
                icon: ui_components_lib_index_js_.imageIcon,
                fileFormat: 'base64'
            },
            {
                name: 'jpeg',
                displayName: trans.__('Image'),
                mimeTypes: ['image/jpeg'],
                extensions: ['.jpg', '.jpeg'],
                icon: ui_components_lib_index_js_.imageIcon,
                fileFormat: 'base64'
            },
            {
                name: 'gif',
                displayName: trans.__('Image'),
                mimeTypes: ['image/gif'],
                extensions: ['.gif'],
                icon: ui_components_lib_index_js_.imageIcon,
                fileFormat: 'base64'
            },
            {
                name: 'png',
                displayName: trans.__('Image'),
                mimeTypes: ['image/png'],
                extensions: ['.png'],
                icon: ui_components_lib_index_js_.imageIcon,
                fileFormat: 'base64'
            },
            {
                name: 'bmp',
                displayName: trans.__('Image'),
                mimeTypes: ['image/bmp'],
                extensions: ['.bmp'],
                icon: ui_components_lib_index_js_.imageIcon,
                fileFormat: 'base64'
            },
            {
                name: 'webp',
                displayName: trans.__('Image'),
                mimeTypes: ['image/webp'],
                extensions: ['.webp'],
                icon: ui_components_lib_index_js_.imageIcon,
                fileFormat: 'base64'
            },
            {
                name: 'aac',
                displayName: trans.__('Audio'),
                extensions: ['.aac'],
                mimeTypes: ['audio/aac'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'midi',
                displayName: trans.__('Audio'),
                extensions: ['.midi', '.mid'],
                mimeTypes: ['audio/midi', 'audio/x-midi'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'mp3',
                displayName: trans.__('Audio'),
                extensions: ['.mp3'],
                mimeTypes: ['audio/mpeg'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'wav',
                displayName: trans.__('Audio'),
                extensions: ['.wav'],
                mimeTypes: ['audio/wav', 'audio/x-wav'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'ogg',
                displayName: trans.__('Audio'),
                extensions: ['.ogg'],
                mimeTypes: ['audio/ogg'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'm4a',
                displayName: trans.__('Audio'),
                extensions: ['.m4a'],
                mimeTypes: ['audio/mp4'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'flac',
                displayName: trans.__('Audio'),
                extensions: ['.flac'],
                mimeTypes: ['audio/flac'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'opus',
                displayName: trans.__('Audio'),
                extensions: ['.opus'],
                mimeTypes: ['audio/opus'],
                icon: ui_components_lib_index_js_.audioIcon,
                fileFormat: 'base64'
            },
            {
                name: 'mp4',
                displayName: trans.__('Video'),
                extensions: ['.mp4'],
                mimeTypes: ['video/mp4'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: 'mpeg',
                displayName: trans.__('Video'),
                extensions: ['.mpeg'],
                mimeTypes: ['video/mpeg'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: 'webm',
                displayName: trans.__('Video'),
                extensions: ['.webm'],
                mimeTypes: ['video/webm'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: 'ogv',
                displayName: trans.__('Video'),
                extensions: ['.ogv', '.ogg'],
                mimeTypes: ['video/ogg'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: 'avi',
                displayName: trans.__('Video'),
                extensions: ['.avi'],
                mimeTypes: ['video/x-msvideo'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: 'mov',
                displayName: trans.__('Video'),
                extensions: ['.mov'],
                mimeTypes: ['video/quicktime'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: 'm4v',
                displayName: trans.__('Video'),
                extensions: ['.m4v'],
                mimeTypes: ['video/mp4', 'video/x-m4v'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: '3gp',
                displayName: trans.__('Video'),
                extensions: ['.3gp'],
                mimeTypes: ['video/3gpp'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            },
            {
                name: 'mkv',
                displayName: trans.__('Video'),
                extensions: ['.mkv'],
                mimeTypes: ['video/x-matroska'],
                fileFormat: 'base64',
                icon: ui_components_lib_index_js_.videoIcon
            }
        ];
    }
    DocumentRegistry.getDefaultFileTypes = getDefaultFileTypes;
})(DocumentRegistry || (DocumentRegistry = {}));
/**
 * A private namespace for DocumentRegistry data.
 */
var registry_Private;
(function (Private) {
    /**
     * Get the extension name of a path.
     *
     * @param path - string.
     *
     * #### Notes
     * Dotted filenames (e.g. `".table.json"` are allowed).
     */
    function extname(path) {
        const parts = lib_index_js_.PathExt.basename(path).split('.');
        parts.shift();
        const ext = '.' + parts.join('.');
        return ext.toLowerCase();
    }
    Private.extname = extname;
    /**
     * A no-op function.
     */
    function noOp() {
        /* no-op */
    }
    Private.noOp = noOp;
})(registry_Private || (registry_Private = {}));
//# sourceMappingURL=registry.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/lib/kernelfilestypes.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
/**
 * Use available kernels to determine which common file types should have 'Create New'
 * options in the Launcher, File Editor palette, File menu, FileBrowser etc..
 */
async function getAvailableKernelFileTypes(specsManager) {
    var _a, _b;
    const commonLanguageFileTypeData = new Map([
        [
            'python',
            [
                {
                    name: 'Python',
                    extensions: ['.py'],
                    icon: 'ui-components:python',
                    displayName: 'Python',
                    mimeTypes: ['text/plain']
                }
            ]
        ],
        [
            'julia',
            [
                {
                    name: 'Julia',
                    extensions: ['.jl'],
                    icon: 'ui-components:julia',
                    displayName: 'Julia',
                    mimeTypes: ['text/plain']
                }
            ]
        ],
        [
            'R',
            [
                {
                    name: 'R',
                    extensions: ['.r'],
                    icon: 'ui-components:r-kernel',
                    displayName: 'R',
                    mimeTypes: ['text/plain']
                }
            ]
        ]
    ]);
    await specsManager.ready;
    let fileTypes = new Set();
    const specs = (_b = (_a = specsManager.specs) === null || _a === void 0 ? void 0 : _a.kernelspecs) !== null && _b !== void 0 ? _b : {};
    Object.keys(specs).forEach(spec => {
        const specModel = specs[spec];
        if (specModel) {
            const exts = commonLanguageFileTypeData.get(specModel.language);
            exts === null || exts === void 0 ? void 0 : exts.forEach(ext => fileTypes.add(ext));
        }
    });
    return fileTypes;
}
//# sourceMappingURL=kernelfilestypes.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module docregistry
 */






//# sourceMappingURL=index.js.map

/***/ }),

/***/ 30507:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/docregistry/style/base.css
var base = __webpack_require__(52847);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 24212:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3894);
/* harmony import */ var _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_5__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module documentsearch-extension
 */






/**
 * Class added to widgets that can be searched (have a search provider).
 */
const SEARCHABLE_CLASS = 'jp-mod-searchable';
/**
 * Class added to widgets with open search view (not necessarily focused).
 */
const SEARCH_ACTIVE_CLASS = 'jp-mod-search-active';
var CommandIDs;
(function (CommandIDs) {
    /**
     * Start search in a document
     */
    CommandIDs.search = 'documentsearch:start';
    /**
     * Start search and replace in a document
     */
    CommandIDs.searchAndReplace = 'documentsearch:startWithReplace';
    /**
     * Find next search match
     */
    CommandIDs.findNext = 'documentsearch:highlightNext';
    /**
     * Find previous search match
     */
    CommandIDs.findPrevious = 'documentsearch:highlightPrevious';
    /**
     * End search in a document
     */
    CommandIDs.end = 'documentsearch:end';
    /**
     * Toggle search in selection
     */
    CommandIDs.toggleSearchInSelection = 'documentsearch:toggleSearchInSelection';
})(CommandIDs || (CommandIDs = {}));
const labShellWidgetListener = {
    id: '@jupyterlab/documentsearch-extension:labShellWidgetListener',
    description: 'Active search on valid document',
    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.ISearchProviderRegistry],
    autoStart: true,
    activate: (app, labShell, registry) => {
        // If a given widget is searchable, apply the searchable class.
        // If it's not searchable, remove the class.
        const transformWidgetSearchability = (widget) => {
            if (!widget) {
                return;
            }
            if (registry.hasProvider(widget)) {
                widget.addClass(SEARCHABLE_CLASS);
            }
            else {
                widget.removeClass(SEARCHABLE_CLASS);
            }
        };
        // Update searchability of the active widget when the registry
        // changes, in case a provider for the current widget was added
        // or removed
        registry.changed.connect(() => transformWidgetSearchability(labShell.activeWidget));
        // Apply the searchable class only to the active widget if it is actually
        // searchable. Remove the searchable class from a widget when it's
        // no longer active.
        labShell.activeChanged.connect((_, args) => {
            const oldWidget = args.oldValue;
            if (oldWidget) {
                oldWidget.removeClass(SEARCHABLE_CLASS);
            }
            transformWidgetSearchability(args.newValue);
        });
    }
};
/**
 * Exposes the current keybindings to search box view.
 */
class SearchKeyBindings {
    constructor(_commandRegistry) {
        this._commandRegistry = _commandRegistry;
        this._cache = this._buildCache();
        this._commandRegistry.keyBindingChanged.connect(this._rebuildCache, this);
    }
    get next() {
        return this._cache.next;
    }
    get previous() {
        return this._cache.previous;
    }
    get toggleSearchInSelection() {
        return this._cache.toggleSearchInSelection;
    }
    _rebuildCache() {
        this._cache = this._buildCache();
    }
    _buildCache() {
        const next = this._commandRegistry.keyBindings.find(binding => binding.command === CommandIDs.findNext);
        const previous = this._commandRegistry.keyBindings.find(binding => binding.command === CommandIDs.findPrevious);
        const toggleSearchInSelection = this._commandRegistry.keyBindings.find(binding => binding.command === CommandIDs.toggleSearchInSelection);
        return {
            next,
            previous,
            toggleSearchInSelection
        };
    }
    dispose() {
        this._commandRegistry.keyBindingChanged.disconnect(this._rebuildCache, this);
    }
}
/**
 * Initialization data for the document-search extension.
 */
const extension = {
    id: '@jupyterlab/documentsearch-extension:plugin',
    description: 'Provides the document search registry.',
    provides: _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.ISearchProviderRegistry,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__.ISettingRegistry],
    autoStart: true,
    activate: (app, translator, palette, settingRegistry) => {
        var _a;
        const trans = translator.load('jupyterlab');
        let searchDebounceTime = 500;
        let autoSearchInSelection = 'never';
        // Create registry
        const registry = new _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.SearchProviderRegistry(translator);
        const searchViews = new Map();
        if (settingRegistry) {
            const loadSettings = settingRegistry.load(extension.id);
            const updateSettings = (settings) => {
                searchDebounceTime = settings.get('searchDebounceTime')
                    .composite;
                autoSearchInSelection = settings.get('autoSearchInSelection')
                    .composite;
            };
            Promise.all([loadSettings, app.restored])
                .then(([settings]) => {
                updateSettings(settings);
                settings.changed.connect(settings => {
                    updateSettings(settings);
                });
            })
                .catch((reason) => {
                console.error(reason.message);
            });
        }
        const isEnabled = () => {
            const widget = app.shell.currentWidget;
            if (!widget) {
                return false;
            }
            return registry.hasProvider(widget);
        };
        const getSearchWidget = (widget) => {
            if (!widget) {
                return;
            }
            const widgetId = widget.id;
            let searchView = searchViews.get(widgetId);
            if (!searchView) {
                const searchProvider = registry.getProvider(widget);
                if (!searchProvider) {
                    return;
                }
                const searchModel = new _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.SearchDocumentModel(searchProvider, searchDebounceTime);
                const keyBingingsInfo = new SearchKeyBindings(app.commands);
                const newView = new _jupyterlab_documentsearch__WEBPACK_IMPORTED_MODULE_2__.SearchDocumentView(searchModel, translator, keyBingingsInfo);
                searchViews.set(widgetId, newView);
                // find next, previous and end are now enabled
                [
                    CommandIDs.findNext,
                    CommandIDs.findPrevious,
                    CommandIDs.end,
                    CommandIDs.toggleSearchInSelection
                ].forEach(id => {
                    app.commands.notifyCommandChanged(id);
                });
                /**
                 * Activate the target widget when the search panel is closing
                 */
                newView.closed.connect(() => {
                    if (!widget.isDisposed) {
                        widget.activate();
                        widget.removeClass(SEARCH_ACTIVE_CLASS);
                    }
                });
                /**
                 * Remove from mapping when the search view is disposed.
                 */
                newView.disposed.connect(() => {
                    if (!widget.isDisposed) {
                        widget.activate();
                        widget.removeClass(SEARCH_ACTIVE_CLASS);
                    }
                    searchViews.delete(widgetId);
                    // find next, previous and end are now disabled
                    [
                        CommandIDs.findNext,
                        CommandIDs.findPrevious,
                        CommandIDs.end,
                        CommandIDs.toggleSearchInSelection
                    ].forEach(id => {
                        app.commands.notifyCommandChanged(id);
                    });
                });
                /**
                 * Dispose resources when the widget is disposed.
                 */
                widget.disposed.connect(() => {
                    newView.dispose();
                    searchModel.dispose();
                    searchProvider.dispose();
                    keyBingingsInfo.dispose();
                });
                searchView = newView;
            }
            if (!searchView.isAttached) {
                _lumino_widgets__WEBPACK_IMPORTED_MODULE_5__.Widget.attach(searchView, widget.node);
                widget.addClass(SEARCH_ACTIVE_CLASS);
                if (widget instanceof _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MainAreaWidget) {
                    // Offset the position of the search widget to not cover the toolbar nor the content header.
                    // TODO this does not update once the search widget is displayed.
                    searchView.node.style.top = `${widget.toolbar.node.getBoundingClientRect().height +
                        widget.contentHeader.node.getBoundingClientRect().height}px`;
                }
                if (searchView.model.searchExpression) {
                    searchView.model.refresh();
                }
            }
            return searchView;
        };
        app.commands.addCommand(CommandIDs.search, {
            label: trans.__('Find…'),
            isEnabled: isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        searchText: {
                            type: 'string',
                            description: trans.__('The text to search for')
                        }
                    }
                }
            },
            execute: async (args) => {
                const searchWidget = getSearchWidget(app.shell.currentWidget);
                if (searchWidget) {
                    const searchText = args['searchText'];
                    if (searchText) {
                        searchWidget.setSearchText(searchText);
                    }
                    else {
                        searchWidget.setSearchText(searchWidget.model.suggestedInitialQuery);
                    }
                    const selectionState = searchWidget.model.selectionState;
                    let enableSelectionMode = false;
                    switch (autoSearchInSelection) {
                        case 'multiple-selected':
                            enableSelectionMode = selectionState === 'multiple';
                            break;
                        case 'any-selected':
                            enableSelectionMode =
                                selectionState === 'multiple' || selectionState === 'single';
                            break;
                        case 'never':
                            // no-op
                            break;
                    }
                    if (enableSelectionMode) {
                        await searchWidget.model.setFilter('selection', true);
                    }
                    searchWidget.focusSearchInput();
                }
            }
        });
        app.commands.addCommand(CommandIDs.searchAndReplace, {
            label: trans.__('Find and Replace…'),
            isEnabled: isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        searchText: {
                            type: 'string',
                            description: trans.__('The text to search for')
                        },
                        replaceText: {
                            type: 'string',
                            description: trans.__('The text to replace with')
                        }
                    }
                }
            },
            execute: args => {
                const searchWidget = getSearchWidget(app.shell.currentWidget);
                if (searchWidget) {
                    const searchText = args['searchText'];
                    if (searchText) {
                        searchWidget.setSearchText(searchText);
                    }
                    else {
                        searchWidget.setSearchText(searchWidget.model.suggestedInitialQuery);
                    }
                    const replaceText = args['replaceText'];
                    if (replaceText) {
                        searchWidget.setReplaceText(replaceText);
                    }
                    searchWidget.showReplace();
                    searchWidget.focusSearchInput();
                }
            }
        });
        app.commands.addCommand(CommandIDs.findNext, {
            label: trans.__('Find Next'),
            isEnabled: () => !!app.shell.currentWidget &&
                searchViews.has(app.shell.currentWidget.id),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: async () => {
                var _a;
                const currentWidget = app.shell.currentWidget;
                if (!currentWidget) {
                    return;
                }
                await ((_a = searchViews.get(currentWidget.id)) === null || _a === void 0 ? void 0 : _a.model.highlightNext());
            }
        });
        app.commands.addCommand(CommandIDs.findPrevious, {
            label: trans.__('Find Previous'),
            isEnabled: () => !!app.shell.currentWidget &&
                searchViews.has(app.shell.currentWidget.id),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: async () => {
                var _a;
                const currentWidget = app.shell.currentWidget;
                if (!currentWidget) {
                    return;
                }
                await ((_a = searchViews.get(currentWidget.id)) === null || _a === void 0 ? void 0 : _a.model.highlightPrevious());
            }
        });
        app.commands.addCommand(CommandIDs.end, {
            label: trans.__('End Search'),
            isEnabled: () => !!app.shell.currentWidget &&
                searchViews.has(app.shell.currentWidget.id),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: async () => {
                var _a;
                const currentWidget = app.shell.currentWidget;
                if (!currentWidget) {
                    return;
                }
                (_a = searchViews.get(currentWidget.id)) === null || _a === void 0 ? void 0 : _a.close();
            }
        });
        app.commands.addCommand(CommandIDs.toggleSearchInSelection, {
            label: trans.__('Search in Selection'),
            isEnabled: () => !!app.shell.currentWidget &&
                searchViews.has(app.shell.currentWidget.id) &&
                'selection' in
                    searchViews.get(app.shell.currentWidget.id).model.filtersDefinition,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: async () => {
                var _a;
                const currentWidget = app.shell.currentWidget;
                if (!currentWidget) {
                    return;
                }
                const model = (_a = searchViews.get(currentWidget.id)) === null || _a === void 0 ? void 0 : _a.model;
                if (!model) {
                    return;
                }
                const currentValue = model.filters['selection'];
                return model.setFilter('selection', !currentValue);
            }
        });
        (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {
            Object.values(CommandIDs).forEach(cmd => {
                app.commands.notifyCommandChanged(cmd);
            });
        });
        // Add the command to the palette.
        if (palette) {
            [
                CommandIDs.search,
                CommandIDs.findNext,
                CommandIDs.findPrevious,
                CommandIDs.end,
                CommandIDs.toggleSearchInSelection
            ].forEach(command => {
                palette.addItem({
                    command,
                    category: trans.__('Main Area')
                });
            });
        }
        // Provide the registry to the system.
        return registry;
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([extension, labShellWidgetListener]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 20603:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_documentsearch_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13737);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 36999:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  FOUND_CLASSES: () => (/* reexport */ FOUND_CLASSES),
  GenericSearchProvider: () => (/* reexport */ GenericSearchProvider),
  HTMLSearchEngine: () => (/* reexport */ HTMLSearchEngine),
  ISearchProviderRegistry: () => (/* reexport */ ISearchProviderRegistry),
  SearchDocumentModel: () => (/* reexport */ SearchDocumentModel),
  SearchDocumentView: () => (/* reexport */ SearchDocumentView),
  SearchProvider: () => (/* reexport */ SearchProvider),
  SearchProviderRegistry: () => (/* reexport */ SearchProviderRegistry),
  TextSearchEngine: () => (/* reexport */ TextSearchEngine)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/searchprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Abstract class implementing the search provider interface.
 */
class SearchProvider {
    /**
     * Constructor
     *
     * @param widget The widget to search in
     */
    constructor(widget) {
        this.widget = widget;
        this._stateChanged = new dist_index_es6_js_.Signal(this);
        this._filtersChanged = new dist_index_es6_js_.Signal(this);
        this._disposed = false;
    }
    /**
     * Signal indicating that something in the search has changed, so the UI should update
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * Signal indicating that filter definition changed.
     */
    get filtersChanged() {
        return this._filtersChanged;
    }
    /**
     * The current index of the selected match.
     */
    get currentMatchIndex() {
        return null;
    }
    /**
     * Whether the search provider is disposed or not.
     */
    get isDisposed() {
        return this._disposed;
    }
    /**
     * The number of matches.
     */
    get matchesCount() {
        return null;
    }
    /**
     * Dispose of the resources held by the search provider.
     *
     * #### Notes
     * If the object's `dispose` method is called more than once, all
     * calls made after the first will be a no-op.
     *
     * #### Undefined Behavior
     * It is undefined behavior to use any functionality of the object
     * after it has been disposed unless otherwise explicitly noted.
     */
    dispose() {
        if (this._disposed) {
            return;
        }
        this._disposed = true;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Get an initial query value if applicable so that it can be entered
     * into the search box as an initial query
     *
     * @returns Initial value used to populate the search box.
     */
    getInitialQuery() {
        return '';
    }
    /**
     * Get the filters for the given provider.
     *
     * @returns The filters.
     *
     * ### Notes
     * TODO For now it only supports boolean filters (represented with checkboxes)
     */
    getFilters() {
        return {};
    }
    /**
     * Utility for copying the letter case from old to new text.
     */
    static preserveCase(oldText, newText) {
        if (oldText.toUpperCase() === oldText) {
            return newText.toUpperCase();
        }
        if (oldText.toLowerCase() === oldText) {
            return newText.toLowerCase();
        }
        if (toSentenceCase(oldText) === oldText) {
            return toSentenceCase(newText);
        }
        return newText;
    }
}
/**
 * Capitalise first letter of provided word.
 */
function toSentenceCase([first = '', ...suffix]) {
    return first.toUpperCase() + '' + suffix.join('').toLowerCase();
}
//# sourceMappingURL=searchprovider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/providers/genericsearchprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


const FOUND_CLASSES = ['cm-string', 'cm-overlay', 'cm-searching'];
const SELECTED_CLASSES = ['CodeMirror-selectedtext', 'jp-current-match'];
/**
 * HTML search engine
 */
class HTMLSearchEngine {
    /**
     * Search for a `query` in a DOM tree.
     *
     * @param query Regular expression to search
     * @param rootNode DOM root node to search in
     * @returns The list of matches
     */
    static search(query, rootNode) {
        if (!(rootNode instanceof Node)) {
            console.warn('Unable to search with HTMLSearchEngine the provided object.', rootNode);
            return Promise.resolve([]);
        }
        if (!query.global) {
            query = new RegExp(query.source, query.flags + 'g');
        }
        const matches = [];
        const walker = document.createTreeWalker(rootNode, NodeFilter.SHOW_TEXT, {
            acceptNode: node => {
                // Filter subtrees of UNSUPPORTED_ELEMENTS and nodes that
                // do not contain our search text
                let parentElement = node.parentElement;
                while (parentElement !== rootNode) {
                    if (parentElement.nodeName in HTMLSearchEngine.UNSUPPORTED_ELEMENTS) {
                        return NodeFilter.FILTER_REJECT;
                    }
                    parentElement = parentElement.parentElement;
                }
                return query.test(node.textContent)
                    ? NodeFilter.FILTER_ACCEPT
                    : NodeFilter.FILTER_REJECT;
            }
        });
        let node = null;
        while ((node = walker.nextNode()) !== null) {
            // Reset query index
            query.lastIndex = 0;
            let match = null;
            while ((match = query.exec(node.textContent)) !== null) {
                matches.push({
                    text: match[0],
                    position: match.index,
                    node: node
                });
            }
        }
        return Promise.resolve(matches);
    }
}
/**
 * We choose opt out as most node types should be searched (e.g. script).
 * Even nodes like <data>, could have textContent we care about.
 *
 * Note:
 * We will be checking each node's nodeName attribute in the Node interface.
 * ref: https://dom.spec.whatwg.org/#dom-node-nodename
 *
 * Specifically for Element nodes, where nodeName is stated as the
 * 'HTML-uppercased qualified name'. However, that does not mean that HTML
 * elements qualified name is guaranteed to be uppercased even when the
 * content type is HTML, i.e. XML tags like <svg>. This only applies when the
 * node's namespace is in HTML and the node document is a HTML document.
 * ref: https://dom.spec.whatwg.org/#element-html-uppercased-qualified-name
 */
HTMLSearchEngine.UNSUPPORTED_ELEMENTS = {
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Document_metadata
    BASE: true,
    HEAD: true,
    LINK: true,
    META: true,
    STYLE: true,
    TITLE: true,
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Sectioning_root
    BODY: true,
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Content_sectioning
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Text_content
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Inline_text_semantics
    // Above is searched
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Image_and_multimedia
    AREA: true,
    AUDIO: true,
    IMG: true,
    MAP: true,
    TRACK: true,
    VIDEO: true,
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Embedded_content
    APPLET: true,
    EMBED: true,
    IFRAME: true,
    NOEMBED: true,
    OBJECT: true,
    PARAM: true,
    PICTURE: true,
    SOURCE: true,
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Scripting
    CANVAS: true,
    NOSCRIPT: true,
    SCRIPT: true,
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Demarcating_edits
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Table_content
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Forms
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Interactive_elements
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element#Web_Components
    // Above is searched
    /*
     * While XML tags local name is case sensitive, XHTML tags need to be
     * lowercased.
     * ref: https://www.w3.org/TR/xhtml1/#h-4.2
     *
     * Which in practice means I've seen SVG tags local name to be lowercased.
     * I don't believe enumerating all possible cases would be useful as such,
     * and similarly transforming the nodeName to uppercase would seem like
     * unnecessary overhead.
     */
    svg: true,
    SVG: true
};
/**
 * Generic DOM tree search provider.
 */
class GenericSearchProvider extends SearchProvider {
    constructor() {
        super(...arguments);
        /**
         * Set to true if the widget under search is read-only, false
         * if it is editable.  Will be used to determine whether to show
         * the replace option.
         */
        this.isReadOnly = true;
        this._matches = [];
        this._mutationObserver = new MutationObserver(this._onWidgetChanged.bind(this));
        this._markNodes = new Array();
    }
    /**
     * Report whether or not this provider has the ability to search on the given object
     */
    static isApplicable(domain) {
        return domain instanceof index_es6_js_.Widget;
    }
    /**
     * Instantiate a generic search provider for the widget.
     *
     * #### Notes
     * The widget provided is always checked using `isApplicable` before calling
     * this factory.
     *
     * @param widget The widget to search on
     * @param registry The search provider registry
     * @param translator [optional] The translator object
     *
     * @returns The search provider on the widget
     */
    static createNew(widget, registry, translator) {
        return new GenericSearchProvider(widget);
    }
    /**
     * The current index of the selected match.
     */
    get currentMatchIndex() {
        return this._currentMatchIndex >= 0 ? this._currentMatchIndex : null;
    }
    /**
     * The current match
     */
    get currentMatch() {
        var _a;
        return (_a = this._matches[this._currentMatchIndex]) !== null && _a !== void 0 ? _a : null;
    }
    /**
     * The current matches
     */
    get matches() {
        // Ensure that no other fn can overwrite matches index property
        // We shallow clone each node
        return this._matches
            ? this._matches.map(m => Object.assign({}, m))
            : this._matches;
    }
    /**
     * The number of matches.
     */
    get matchesCount() {
        return this._matches.length;
    }
    /**
     * Clear currently highlighted match.
     */
    clearHighlight() {
        if (this._currentMatchIndex >= 0) {
            const hit = this._markNodes[this._currentMatchIndex];
            hit.classList.remove(...SELECTED_CLASSES);
        }
        this._currentMatchIndex = -1;
        return Promise.resolve();
    }
    /**
     * Dispose of the resources held by the search provider.
     *
     * #### Notes
     * If the object's `dispose` method is called more than once, all
     * calls made after the first will be a no-op.
     *
     * #### Undefined Behavior
     * It is undefined behavior to use any functionality of the object
     * after it has been disposed unless otherwise explicitly noted.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.endQuery().catch(reason => {
            console.error(`Failed to end search query.`, reason);
        });
        super.dispose();
    }
    /**
     * Move the current match indicator to the next match.
     *
     * @param loop Whether to loop within the matches list.
     *
     * @returns A promise that resolves once the action has completed.
     */
    async highlightNext(loop) {
        var _a;
        return (_a = this._highlightNext(false, loop !== null && loop !== void 0 ? loop : true)) !== null && _a !== void 0 ? _a : undefined;
    }
    /**
     * Move the current match indicator to the previous match.
     *
     * @param loop Whether to loop within the matches list.
     *
     * @returns A promise that resolves once the action has completed.
     */
    async highlightPrevious(loop) {
        var _a;
        return (_a = this._highlightNext(true, loop !== null && loop !== void 0 ? loop : true)) !== null && _a !== void 0 ? _a : undefined;
    }
    /**
     * Replace the currently selected match with the provided text
     *
     * @param newText The replacement text
     * @param loop Whether to loop within the matches list.
     *
     * @returns A promise that resolves with a boolean indicating whether a replace occurred.
     */
    async replaceCurrentMatch(newText, loop) {
        return Promise.resolve(false);
    }
    /**
     * Replace all matches in the notebook with the provided text
     *
     * @param newText The replacement text
     *
     * @returns A promise that resolves with a boolean indicating whether a replace occurred.
     */
    async replaceAllMatches(newText) {
        // This is read only, but we could loosen this in theory for input boxes...
        return Promise.resolve(false);
    }
    /**
     * Initialize the search using the provided options.  Should update the UI
     * to highlight all matches and "select" whatever the first match should be.
     *
     * @param query A RegExp to be use to perform the search
     * @param filters Filter parameters to pass to provider
     */
    async startQuery(query, filters = {}) {
        await this.endQuery();
        this._query = query;
        if (query === null) {
            return Promise.resolve();
        }
        const matches = await HTMLSearchEngine.search(query, this.widget.node);
        // Transform the DOM
        let nodeIdx = 0;
        while (nodeIdx < matches.length) {
            let activeNode = matches[nodeIdx].node;
            let parent = activeNode.parentNode;
            let subMatches = [matches[nodeIdx]];
            while (++nodeIdx < matches.length &&
                matches[nodeIdx].node === activeNode) {
                subMatches.unshift(matches[nodeIdx]);
            }
            const markedNodes = subMatches.map(match => {
                // TODO: support tspan for svg when svg support is added
                const markedNode = document.createElement('mark');
                markedNode.classList.add(...FOUND_CLASSES);
                markedNode.textContent = match.text;
                const newNode = activeNode.splitText(match.position);
                newNode.textContent = newNode.textContent.slice(match.text.length);
                parent.insertBefore(markedNode, newNode);
                return markedNode;
            });
            // Insert node in reverse order as we replace from last to first
            // to maintain match position.
            for (let i = markedNodes.length - 1; i >= 0; i--) {
                this._markNodes.push(markedNodes[i]);
            }
        }
        // Watch for future changes:
        this._mutationObserver.observe(this.widget.node, 
        // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserverInit
        {
            attributes: false,
            characterData: true,
            childList: true,
            subtree: true
        });
        this._matches = matches;
    }
    /**
     * Clear the highlighted matches and any internal state.
     */
    async endQuery() {
        this._mutationObserver.disconnect();
        this._markNodes.forEach(el => {
            const parent = el.parentNode;
            parent.replaceChild(document.createTextNode(el.textContent), el);
            parent.normalize();
        });
        this._markNodes = [];
        this._matches = [];
        this._currentMatchIndex = -1;
    }
    _highlightNext(reverse, loop) {
        if (this._matches.length === 0) {
            return null;
        }
        if (this._currentMatchIndex === -1) {
            this._currentMatchIndex = reverse ? this.matches.length - 1 : 0;
        }
        else {
            const hit = this._markNodes[this._currentMatchIndex];
            hit.classList.remove(...SELECTED_CLASSES);
            this._currentMatchIndex = reverse
                ? this._currentMatchIndex - 1
                : this._currentMatchIndex + 1;
            if (loop &&
                (this._currentMatchIndex < 0 ||
                    this._currentMatchIndex >= this._matches.length)) {
                // Cheap way to make this a circular buffer
                this._currentMatchIndex =
                    (this._currentMatchIndex + this._matches.length) %
                        this._matches.length;
            }
        }
        if (this._currentMatchIndex >= 0 &&
            this._currentMatchIndex < this._matches.length) {
            const hit = this._markNodes[this._currentMatchIndex];
            hit.classList.add(...SELECTED_CLASSES);
            // If not in view, scroll just enough to see it
            if (!elementInViewport(hit)) {
                hit.scrollIntoView(reverse);
            }
            hit.focus();
            return this._matches[this._currentMatchIndex];
        }
        else {
            this._currentMatchIndex = -1;
            return null;
        }
    }
    async _onWidgetChanged(mutations, observer) {
        this._currentMatchIndex = -1;
        // This is typically cheap, but we do not control the rate of change or size of the output
        await this.startQuery(this._query);
        this._stateChanged.emit();
    }
}
function elementInViewport(el) {
    const boundingClientRect = el.getBoundingClientRect();
    return (boundingClientRect.top >= 0 &&
        boundingClientRect.bottom <=
            (window.innerHeight || document.documentElement.clientHeight) &&
        boundingClientRect.left >= 0 &&
        boundingClientRect.right <=
            (window.innerWidth || document.documentElement.clientWidth));
}
//# sourceMappingURL=genericsearchprovider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/providers/textprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * Search provider for text/plain
 */
const TextSearchEngine = {
    /**
     * Search for regular expression matches in a string.
     *
     * @param query Query regular expression
     * @param data String to look into
     * @returns List of matches
     */
    search(query, data) {
        // If data is not a string, try to JSON serialize the data.
        if (typeof data !== 'string') {
            try {
                data = JSON.stringify(data);
            }
            catch (reason) {
                console.warn('Unable to search with TextSearchEngine non-JSON serializable object.', reason, data);
                return Promise.resolve([]);
            }
        }
        if (!query.global) {
            query = new RegExp(query.source, query.flags + 'g');
        }
        const matches = new Array();
        let match = null;
        while ((match = query.exec(data)) !== null) {
            matches.push({
                text: match[0],
                position: match.index
            });
        }
        return Promise.resolve(matches);
    }
};
//# sourceMappingURL=textprovider.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/searchmodel.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Search in a document model.
 */
class SearchDocumentModel extends index_js_.VDomModel {
    /**
     * Search document model
     * @param searchProvider Provider for the current document
     * @param searchDebounceTime Debounce search time
     */
    constructor(searchProvider, searchDebounceTime) {
        super();
        this.searchProvider = searchProvider;
        this._caseSensitive = false;
        this._disposed = new dist_index_es6_js_.Signal(this);
        this._parsingError = '';
        this._preserveCase = false;
        this._initialQuery = '';
        this._filters = {};
        this._replaceText = '';
        this._searchActive = false;
        this._searchExpression = '';
        this._useRegex = false;
        this._wholeWords = false;
        this._filters = {};
        if (this.searchProvider.getFilters) {
            const filters = this.searchProvider.getFilters();
            for (const filter in filters) {
                this._filters[filter] = filters[filter].default;
            }
        }
        searchProvider.stateChanged.connect(this._onProviderStateChanged, this);
        this._searchDebouncer = new polling_dist_index_es6_js_.Debouncer(() => {
            this._updateSearch().catch(reason => {
                console.error('Failed to update search on document.', reason);
            });
        }, searchDebounceTime);
    }
    /**
     * Whether the search is case sensitive or not.
     */
    get caseSensitive() {
        return this._caseSensitive;
    }
    set caseSensitive(v) {
        if (this._caseSensitive !== v) {
            this._caseSensitive = v;
            this.stateChanged.emit();
            this.refresh();
        }
    }
    /**
     * Current highlighted match index.
     */
    get currentIndex() {
        return this.searchProvider.currentMatchIndex;
    }
    /**
     * A signal emitted when the object is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Filter values.
     */
    get filters() {
        return this._filters;
    }
    /**
     * Filter definitions for the current provider.
     */
    get filtersDefinition() {
        var _a, _b, _c;
        return (_c = (_b = (_a = this.searchProvider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : {};
    }
    /**
     * Filter definitions changed.
     */
    get filtersDefinitionChanged() {
        return this.searchProvider.filtersChanged || null;
    }
    /**
     * The initial query string.
     */
    get initialQuery() {
        return this._initialQuery;
    }
    set initialQuery(v) {
        // The value comes from user selection (set by search provider).
        this._initialQuery = v;
    }
    /**
     * Initial query as suggested by provider.
     *
     * A common choice is the text currently selected by the user.
     */
    get suggestedInitialQuery() {
        return this.searchProvider.getInitialQuery();
    }
    /**
     * Whether the selection includes a single item or multiple items;
     * this is used by the heuristic auto-enabling "search in selection" mode.
     *
     * Returns `undefined` if the provider does not expose this information.
     */
    get selectionState() {
        return this.searchProvider.getSelectionState
            ? this.searchProvider.getSelectionState()
            : undefined;
    }
    /**
     * Whether the document is read-only or not.
     */
    get isReadOnly() {
        return this.searchProvider.isReadOnly;
    }
    /**
     * Replace options support.
     */
    get replaceOptionsSupport() {
        return this.searchProvider.replaceOptionsSupport;
    }
    /**
     * Parsing regular expression error message.
     */
    get parsingError() {
        return this._parsingError;
    }
    /**
     * Whether to preserve case when replacing.
     */
    get preserveCase() {
        return this._preserveCase;
    }
    set preserveCase(v) {
        if (this._preserveCase !== v) {
            this._preserveCase = v;
            this.stateChanged.emit();
            this.refresh();
        }
    }
    /**
     * Replacement expression
     */
    get replaceText() {
        return this._replaceText;
    }
    set replaceText(v) {
        if (this._replaceText !== v) {
            this._replaceText = v;
            this.stateChanged.emit();
        }
    }
    /**
     * Search expression
     */
    get searchExpression() {
        return this._searchExpression;
    }
    set searchExpression(v) {
        if (this._searchExpression !== v) {
            this._searchExpression = v;
            this.stateChanged.emit();
            this.refresh();
        }
    }
    /**
     * Total number of matches.
     */
    get totalMatches() {
        return this.searchProvider.matchesCount;
    }
    /**
     * Whether to use regular expression or not.
     */
    get useRegex() {
        return this._useRegex;
    }
    set useRegex(v) {
        if (this._useRegex !== v) {
            this._useRegex = v;
            this.stateChanged.emit();
            this.refresh();
        }
    }
    /**
     * Whether to match whole words or not.
     */
    get wholeWords() {
        return this._wholeWords;
    }
    set wholeWords(v) {
        if (this._wholeWords !== v) {
            this._wholeWords = v;
            this.stateChanged.emit();
            this.refresh();
        }
    }
    /**
     * Dispose the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        if (this._searchExpression) {
            this.endQuery().catch(reason => {
                console.error(`Failed to end query '${this._searchExpression}.`, reason);
            });
        }
        this.searchProvider.stateChanged.disconnect(this._onProviderStateChanged, this);
        this._searchDebouncer.dispose();
        super.dispose();
    }
    /**
     * End the query.
     */
    async endQuery() {
        this._searchActive = false;
        await this.searchProvider.endQuery();
        this.stateChanged.emit();
    }
    /**
     * Highlight the next match.
     */
    async highlightNext() {
        await this.searchProvider.highlightNext();
        // Emit state change as the index needs to be updated
        this.stateChanged.emit();
    }
    /**
     * Highlight the previous match
     */
    async highlightPrevious() {
        await this.searchProvider.highlightPrevious();
        // Emit state change as the index needs to be updated
        this.stateChanged.emit();
    }
    /**
     * Refresh search
     */
    refresh() {
        this._searchDebouncer.invoke().catch(reason => {
            console.error('Failed to invoke search document debouncer.', reason);
        });
    }
    /**
     * Replace all matches.
     */
    async replaceAllMatches() {
        await this.searchProvider.replaceAllMatches(this._replaceText, {
            preserveCase: this.preserveCase,
            regularExpression: this.useRegex
        });
        // Emit state change as the index needs to be updated
        this.stateChanged.emit();
    }
    /**
     * Replace the current match.
     */
    async replaceCurrentMatch() {
        await this.searchProvider.replaceCurrentMatch(this._replaceText, true, {
            preserveCase: this.preserveCase,
            regularExpression: this.useRegex
        });
        // Emit state change as the index needs to be updated
        this.stateChanged.emit();
    }
    /**
     * Set the value of a given filter.
     *
     * @param name Filter name
     * @param v Filter value
     */
    async setFilter(name, v) {
        if (this._filters[name] !== v) {
            if (this.searchProvider.validateFilter) {
                this._filters[name] = await this.searchProvider.validateFilter(name, v);
                // If the value was changed
                if (this._filters[name] === v) {
                    this.stateChanged.emit();
                    this.refresh();
                }
            }
            else {
                this._filters[name] = v;
                this.stateChanged.emit();
                this.refresh();
            }
        }
    }
    async _updateSearch() {
        if (this._parsingError) {
            this._parsingError = '';
            this.stateChanged.emit();
        }
        try {
            const query = this.searchExpression
                ? Private.parseQuery(this.searchExpression, this.caseSensitive, this.useRegex, this.wholeWords)
                : null;
            if (query) {
                this._searchActive = true;
                await this.searchProvider.startQuery(query, this._filters);
            }
            else {
                this._searchActive = false;
                await this.searchProvider.endQuery();
            }
            // Emit state change as the index needs to be updated
            this.stateChanged.emit();
        }
        catch (reason) {
            this._parsingError = reason.toString();
            this.stateChanged.emit();
            console.error(`Failed to parse expression ${this.searchExpression}`, reason);
        }
    }
    _onProviderStateChanged() {
        if (this._searchActive) {
            this.refresh();
        }
    }
}
var Private;
(function (Private) {
    /**
     * Build the regular expression to use for searching.
     *
     * @param queryString Query string
     * @param caseSensitive Whether the search is case sensitive or not
     * @param regex Whether the expression is a regular expression
     * @returns The regular expression to use
     */
    function parseQuery(queryString, caseSensitive, regex, wholeWords) {
        const flag = caseSensitive ? 'gm' : 'gim';
        // escape regex characters in query if its a string search
        let queryText = regex
            ? queryString
            : queryString.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
        if (wholeWords) {
            queryText = '\\b' + queryText + '\\b';
        }
        const ret = new RegExp(queryText, flag);
        // If the empty string is hit, the search logic will freeze the browser tab
        //  Trying /^/ or /$/ on the codemirror search demo, does not find anything.
        //  So this is a limitation of the editor.
        if (ret.test('')) {
            return null;
        }
        return ret;
    }
    Private.parseQuery = parseQuery;
})(Private || (Private = {}));
//# sourceMappingURL=searchmodel.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/commands@~2.3.3 (singleton) (fallback: ../node_modules/@lumino/commands/dist/index.es6.js)
var commands_dist_index_es6_js_ = __webpack_require__(88532);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/searchview.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







const OVERLAY_CLASS = 'jp-DocumentSearch-overlay';
const OVERLAY_ROW_CLASS = 'jp-DocumentSearch-overlay-row';
const INPUT_CLASS = 'jp-DocumentSearch-input';
const INPUT_LABEL_CLASS = 'jp-DocumentSearch-input-label';
const INPUT_WRAPPER_CLASS = 'jp-DocumentSearch-input-wrapper';
const INPUT_BUTTON_CLASS_OFF = 'jp-DocumentSearch-input-button-off';
const INPUT_BUTTON_CLASS_ON = 'jp-DocumentSearch-input-button-on';
const INDEX_COUNTER_CLASS = 'jp-DocumentSearch-index-counter';
const UP_DOWN_BUTTON_WRAPPER_CLASS = 'jp-DocumentSearch-up-down-wrapper';
const UP_DOWN_BUTTON_CLASS = 'jp-DocumentSearch-up-down-button';
const FILTER_BUTTON_CLASS = 'jp-DocumentSearch-filter-button';
const FILTER_BUTTON_ENABLED_CLASS = 'jp-DocumentSearch-filter-button-enabled';
const REGEX_ERROR_CLASS = 'jp-DocumentSearch-regex-error';
const SEARCH_OPTIONS_CLASS = 'jp-DocumentSearch-search-options';
const SEARCH_FILTER_DISABLED_CLASS = 'jp-DocumentSearch-search-filter-disabled';
const SEARCH_FILTER_CLASS = 'jp-DocumentSearch-search-filter';
const REPLACE_BUTTON_CLASS = 'jp-DocumentSearch-replace-button';
const REPLACE_BUTTON_WRAPPER_CLASS = 'jp-DocumentSearch-replace-button-wrapper';
const REPLACE_WRAPPER_CLASS = 'jp-DocumentSearch-replace-wrapper-class';
const REPLACE_TOGGLE_CLASS = 'jp-DocumentSearch-replace-toggle';
const TOGGLE_WRAPPER = 'jp-DocumentSearch-toggle-wrapper';
const TOGGLE_PLACEHOLDER = 'jp-DocumentSearch-toggle-placeholder';
const BUTTON_CONTENT_CLASS = 'jp-DocumentSearch-button-content';
const BUTTON_WRAPPER_CLASS = 'jp-DocumentSearch-button-wrapper';
const SPACER_CLASS = 'jp-DocumentSearch-spacer';
function SearchInput(props) {
    const [rows, setRows] = (0,react_index_js_.useState)(1);
    const updateDimensions = (0,react_index_js_.useCallback)((event) => {
        var _a;
        const element = event
            ? event.target
            : (_a = props.inputRef) === null || _a === void 0 ? void 0 : _a.current;
        if (element) {
            const split = element.value.split(/\n/);
            // use the longest string out of all lines to compute the width.
            let longest = split.reduce((a, b) => (a.length > b.length ? a : b), '');
            if (element.parentNode && element.parentNode instanceof HTMLElement) {
                element.parentNode.dataset.value = longest;
            }
            setRows(split.length);
        }
    }, []);
    (0,react_index_js_.useEffect)(() => {
        var _a, _b;
        // For large part, `focusSearchInput()` is responsible for focusing and
        // selecting the search input, however when `initialValue` changes, this
        // triggers React re-render to update `defaultValue` (implemented via `key`)
        // which means that `focusSearchInput` is no longer effective as it has
        // already fired before the re-render, hence we use this conditional effect.
        (_b = (_a = props.inputRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.select();
        // After any change to initial value we also want to update rows in case if
        // multi-line text was selected.
        updateDimensions();
    }, [props.initialValue]);
    return (react_index_js_.createElement("label", { className: INPUT_LABEL_CLASS },
        react_index_js_.createElement("textarea", { onChange: e => {
                props.onChange(e);
                updateDimensions(e);
            }, onKeyDown: e => {
                props.onKeyDown(e);
                updateDimensions(e);
            }, rows: rows, placeholder: props.placeholder, className: INPUT_CLASS, 
            // Setting a key ensures that `defaultValue` will become updated
            // when the initial value changes.
            key: props.autoUpdate ? props.initialValue : null, tabIndex: 0, ref: props.inputRef, title: props.title, defaultValue: props.initialValue || props.lastSearchText, autoFocus: props.autoFocus })));
}
function SearchEntry(props) {
    var _a;
    const trans = ((_a = props.translator) !== null && _a !== void 0 ? _a : lib_index_js_.nullTranslator).load('jupyterlab');
    const caseButtonToggleClass = (0,index_js_.classes)(props.caseSensitive ? INPUT_BUTTON_CLASS_ON : INPUT_BUTTON_CLASS_OFF, BUTTON_CONTENT_CLASS);
    const regexButtonToggleClass = (0,index_js_.classes)(props.useRegex ? INPUT_BUTTON_CLASS_ON : INPUT_BUTTON_CLASS_OFF, BUTTON_CONTENT_CLASS);
    const wordButtonToggleClass = (0,index_js_.classes)(props.wholeWords ? INPUT_BUTTON_CLASS_ON : INPUT_BUTTON_CLASS_OFF, BUTTON_CONTENT_CLASS);
    const wrapperClass = INPUT_WRAPPER_CLASS;
    return (react_index_js_.createElement("div", { className: wrapperClass },
        react_index_js_.createElement(SearchInput, { placeholder: trans.__('Find'), onChange: e => props.onChange(e), onKeyDown: e => props.onKeydown(e), inputRef: props.inputRef, initialValue: props.initialSearchText, lastSearchText: props.lastSearchText, title: trans.__('Find'), autoFocus: true, autoUpdate: true }),
        react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => {
                props.onCaseSensitiveToggled();
            }, tabIndex: 0, title: trans.__('Match Case') },
            react_index_js_.createElement(index_js_.caseSensitiveIcon.react, { className: caseButtonToggleClass, tag: "span" })),
        react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => props.onWordToggled(), tabIndex: 0, title: trans.__('Match Whole Word') },
            react_index_js_.createElement(index_js_.wordIcon.react, { className: wordButtonToggleClass, tag: "span" })),
        react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => props.onRegexToggled(), tabIndex: 0, title: trans.__('Use Regular Expression') },
            react_index_js_.createElement(index_js_.regexIcon.react, { className: regexButtonToggleClass, tag: "span" }))));
}
function ReplaceEntry(props) {
    var _a, _b, _c;
    const trans = ((_a = props.translator) !== null && _a !== void 0 ? _a : lib_index_js_.nullTranslator).load('jupyterlab');
    const preserveCaseButtonToggleClass = (0,index_js_.classes)(props.preserveCase ? INPUT_BUTTON_CLASS_ON : INPUT_BUTTON_CLASS_OFF, BUTTON_CONTENT_CLASS);
    return (react_index_js_.createElement("div", { className: REPLACE_WRAPPER_CLASS },
        react_index_js_.createElement("div", { className: INPUT_WRAPPER_CLASS },
            react_index_js_.createElement(SearchInput, { placeholder: trans.__('Replace'), initialValue: (_b = props.replaceText) !== null && _b !== void 0 ? _b : '', onKeyDown: e => props.onReplaceKeydown(e), onChange: e => props.onChange(e), title: trans.__('Replace'), autoFocus: false, autoUpdate: false }),
            ((_c = props.replaceOptionsSupport) === null || _c === void 0 ? void 0 : _c.preserveCase) ? (react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => props.onPreserveCaseToggled(), title: trans.__('Preserve Case') },
                react_index_js_.createElement(index_js_.caseSensitiveIcon.react, { className: preserveCaseButtonToggleClass, tag: "span" }))) : null),
        react_index_js_.createElement("button", { className: REPLACE_BUTTON_WRAPPER_CLASS, onClick: () => props.onReplaceCurrent() },
            react_index_js_.createElement("span", { className: `${REPLACE_BUTTON_CLASS} ${BUTTON_CONTENT_CLASS}` }, trans.__('Replace'))),
        react_index_js_.createElement("button", { className: REPLACE_BUTTON_WRAPPER_CLASS, onClick: () => props.onReplaceAll() },
            react_index_js_.createElement("span", { className: `${REPLACE_BUTTON_CLASS} ${BUTTON_CONTENT_CLASS}` }, trans.__('Replace All')))));
}
function UpDownButtons(props) {
    var _a, _b;
    const nextBinding = (_a = props.keyBindings) === null || _a === void 0 ? void 0 : _a.next;
    const prevBinding = (_b = props.keyBindings) === null || _b === void 0 ? void 0 : _b.previous;
    const nextKeys = nextBinding
        ? commands_dist_index_es6_js_.CommandRegistry.formatKeystroke(nextBinding.keys)
        : '';
    const prevKeys = prevBinding
        ? commands_dist_index_es6_js_.CommandRegistry.formatKeystroke(prevBinding.keys)
        : '';
    const prevShortcut = prevKeys ? ` (${prevKeys})` : '';
    const nextShortcut = nextKeys ? ` (${nextKeys})` : '';
    const upButton = (react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => (props.isEnabled ? props.onHighlightPrevious() : false), tabIndex: 0, title: `${props.trans.__('Previous Match')}${prevShortcut}`, disabled: !props.isEnabled },
        react_index_js_.createElement(index_js_.caretUpEmptyThinIcon.react, { className: (0,index_js_.classes)(UP_DOWN_BUTTON_CLASS, BUTTON_CONTENT_CLASS), tag: "span" })));
    const downButton = (react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => (props.isEnabled ? props.onHighlightNext() : false), tabIndex: 0, title: `${props.trans.__('Next Match')}${nextShortcut}`, disabled: !props.isEnabled },
        react_index_js_.createElement(index_js_.caretDownEmptyThinIcon.react, { className: (0,index_js_.classes)(UP_DOWN_BUTTON_CLASS, BUTTON_CONTENT_CLASS), tag: "span" })));
    return (react_index_js_.createElement("div", { className: UP_DOWN_BUTTON_WRAPPER_CLASS },
        upButton,
        downButton));
}
function SearchIndices(props) {
    return (react_index_js_.createElement("div", { className: INDEX_COUNTER_CLASS }, props.totalMatches === 0
        ? '-/-'
        : `${props.currentIndex === null ? '-' : props.currentIndex + 1}/${props.totalMatches}`));
}
function FilterToggle(props) {
    let className = `${FILTER_BUTTON_CLASS} ${BUTTON_CONTENT_CLASS}`;
    if (props.visible) {
        className = `${className} ${FILTER_BUTTON_ENABLED_CLASS}`;
    }
    const icon = props.anyEnabled ? index_js_.filterDotIcon : index_js_.filterIcon;
    return (react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => props.toggleVisible(), tabIndex: 0, title: props.visible
            ? props.trans.__('Hide Search Filters')
            : props.trans.__('Show Search Filters') },
        react_index_js_.createElement(icon.react, { className: className, tag: "span", height: "20px", width: "20px" })));
}
function FilterSelection(props) {
    return (react_index_js_.createElement("label", { className: props.isEnabled
            ? SEARCH_FILTER_CLASS
            : `${SEARCH_FILTER_CLASS} ${SEARCH_FILTER_DISABLED_CLASS}`, title: props.description },
        react_index_js_.createElement("input", { type: "checkbox", className: "jp-mod-styled", disabled: !props.isEnabled, checked: props.value, onChange: props.onToggle }),
        props.title));
}
class SearchOverlay extends react_index_js_.Component {
    constructor(props) {
        super(props);
        this.translator = props.translator || lib_index_js_.nullTranslator;
    }
    _onSearchChange(event) {
        const searchText = event.target.value;
        this.props.onSearchChanged(searchText);
    }
    _onSearchKeydown(event) {
        if (event.keyCode === 13) {
            // Enter pressed
            event.stopPropagation();
            event.preventDefault();
            if (event.ctrlKey) {
                const textarea = event.target;
                this._insertNewLine(textarea);
                this.props.onSearchChanged(textarea.value);
            }
            else {
                event.shiftKey
                    ? this.props.onHighlightPrevious()
                    : this.props.onHighlightNext();
            }
        }
    }
    _onReplaceKeydown(event) {
        if (event.keyCode === 13) {
            // Enter pressed
            event.stopPropagation();
            event.preventDefault();
            if (event.ctrlKey) {
                this._insertNewLine(event.target);
            }
            else {
                this.props.onReplaceCurrent();
            }
        }
    }
    _insertNewLine(textarea) {
        const [start, end] = [textarea.selectionStart, textarea.selectionEnd];
        textarea.setRangeText('\n', start, end, 'end');
    }
    _onClose() {
        // Clean up and close widget.
        this.props.onClose();
    }
    _onReplaceToggled() {
        // Deactivate invalid replace filters
        if (!this.props.replaceEntryVisible) {
            for (const key in this.props.filtersDefinition) {
                const filter = this.props.filtersDefinition[key];
                if (!filter.supportReplace) {
                    this.props.onFilterChanged(key, false).catch(reason => {
                        console.error(`Fail to update filter value for ${filter.title}:\n${reason}`);
                    });
                }
            }
        }
        this.props.onReplaceEntryShown(!this.props.replaceEntryVisible);
    }
    _toggleFiltersVisibility() {
        this.props.onFiltersVisibilityChanged(!this.props.filtersVisible);
    }
    render() {
        var _a, _b, _c;
        const trans = this.translator.load('jupyterlab');
        const showReplace = !this.props.isReadOnly && this.props.replaceEntryVisible;
        const filters = this.props.filtersDefinition;
        const hasFilters = Object.keys(filters).length > 0;
        const filterToggle = hasFilters ? (react_index_js_.createElement(FilterToggle, { visible: this.props.filtersVisible, anyEnabled: Object.keys(filters).some(name => {
                var _a;
                const filter = filters[name];
                return (_a = this.props.filters[name]) !== null && _a !== void 0 ? _a : filter.default;
            }), toggleVisible: () => this._toggleFiltersVisibility(), trans: trans })) : null;
        const selectionBinding = (_a = this.props.keyBindings) === null || _a === void 0 ? void 0 : _a.toggleSearchInSelection;
        const selectionKeys = selectionBinding
            ? commands_dist_index_es6_js_.CommandRegistry.formatKeystroke(selectionBinding.keys)
            : '';
        const selectionKeyHint = selectionKeys ? ` (${selectionKeys})` : '';
        const filter = hasFilters ? (react_index_js_.createElement("div", { className: SEARCH_OPTIONS_CLASS }, Object.keys(filters).map(name => {
            var _a, _b;
            const filter = filters[name];
            const isEnabled = !showReplace || filter.supportReplace;
            // Show an alternate description, if one exists, when a filter is disabled in replace mode.
            const description = isEnabled
                ? filter.description
                : (_a = filter.disabledDescription) !== null && _a !== void 0 ? _a : filter.description;
            return (react_index_js_.createElement(FilterSelection, { key: name, title: filter.title, description: description + (name == 'selection' ? selectionKeyHint : ''), isEnabled: isEnabled, onToggle: async () => {
                    await this.props.onFilterChanged(name, !this.props.filters[name]);
                }, value: (_b = this.props.filters[name]) !== null && _b !== void 0 ? _b : filter.default }));
        }))) : null;
        const icon = this.props.replaceEntryVisible
            ? index_js_.caretDownIcon
            : index_js_.caretRightIcon;
        // TODO: Error messages from regex are not currently localizable.
        return (react_index_js_.createElement(react_index_js_.Fragment, null,
            react_index_js_.createElement("div", { className: OVERLAY_ROW_CLASS },
                this.props.isReadOnly ? (react_index_js_.createElement("div", { className: TOGGLE_PLACEHOLDER })) : (react_index_js_.createElement("button", { className: TOGGLE_WRAPPER, onClick: () => this._onReplaceToggled(), tabIndex: 0, title: showReplace
                        ? trans.__('Hide Replace')
                        : trans.__('Show Replace') },
                    react_index_js_.createElement(icon.react, { className: `${REPLACE_TOGGLE_CLASS} ${BUTTON_CONTENT_CLASS}`, tag: "span", elementPosition: "center", height: "20px", width: "20px" }))),
                react_index_js_.createElement(SearchEntry, { inputRef: this.props.searchInputRef, useRegex: this.props.useRegex, caseSensitive: this.props.caseSensitive, wholeWords: this.props.wholeWords, onCaseSensitiveToggled: this.props.onCaseSensitiveToggled, onRegexToggled: this.props.onRegexToggled, onWordToggled: this.props.onWordToggled, onKeydown: (e) => this._onSearchKeydown(e), onChange: (e) => this._onSearchChange(e), initialSearchText: this.props.initialSearchText, lastSearchText: this.props.lastSearchText, translator: this.translator }),
                filterToggle,
                react_index_js_.createElement(SearchIndices, { currentIndex: this.props.currentIndex, totalMatches: (_b = this.props.totalMatches) !== null && _b !== void 0 ? _b : 0 }),
                react_index_js_.createElement(UpDownButtons, { onHighlightPrevious: () => {
                        this.props.onHighlightPrevious();
                    }, onHighlightNext: () => {
                        this.props.onHighlightNext();
                    }, trans: trans, keyBindings: this.props.keyBindings, isEnabled: !!((_c = this.props.searchInputRef.current) === null || _c === void 0 ? void 0 : _c.value) }),
                react_index_js_.createElement("button", { className: BUTTON_WRAPPER_CLASS, onClick: () => this._onClose(), tabIndex: 0, title: trans.__('Close Search Box') },
                    react_index_js_.createElement(index_js_.closeIcon.react, { className: "jp-icon-hover", elementPosition: "center", height: "16px", width: "16px" }))),
            react_index_js_.createElement("div", { className: OVERLAY_ROW_CLASS }, showReplace ? (react_index_js_.createElement(react_index_js_.Fragment, null,
                react_index_js_.createElement(ReplaceEntry, { onPreserveCaseToggled: this.props.onPreserveCaseToggled, onReplaceKeydown: (e) => this._onReplaceKeydown(e), onChange: (e) => this.props.onReplaceChanged(e.target.value), onReplaceCurrent: () => this.props.onReplaceCurrent(), onReplaceAll: () => this.props.onReplaceAll(), replaceOptionsSupport: this.props.replaceOptionsSupport, replaceText: this.props.replaceText, preserveCase: this.props.preserveCase, translator: this.translator }),
                react_index_js_.createElement("div", { className: SPACER_CLASS }))) : null),
            this.props.filtersVisible ? filter : null,
            !!this.props.errorMessage && (react_index_js_.createElement("div", { className: REGEX_ERROR_CLASS }, this.props.errorMessage))));
    }
}
/**
 * Search document widget
 */
class SearchDocumentView extends index_js_.VDomRenderer {
    /**
     * Search document widget constructor.
     *
     * @param model Search document model
     * @param translator Application translator object
     * @param keyBindings Search keybindings
     *
     */
    constructor(model, translator, keyBindings) {
        super(model);
        this.translator = translator;
        this._showReplace = false;
        this._showFilters = false;
        this._closed = new dist_index_es6_js_.Signal(this);
        this.addClass(OVERLAY_CLASS);
        this._searchInput = react_index_js_.createRef();
        this._keyBindings = keyBindings;
    }
    /**
     * A signal emitted when the widget is closed.
     *
     * Closing the widget detached it from the DOM but does not dispose it.
     */
    get closed() {
        return this._closed;
    }
    /**
     * Focus search input.
     */
    focusSearchInput() {
        var _a;
        (_a = this._searchInput.current) === null || _a === void 0 ? void 0 : _a.select();
    }
    /**
     * Set the initial search text.
     */
    setSearchText(search) {
        this.model.initialQuery = search;
        // Only set the new search text to search expression if there is any
        // to avoid nullifying the one that was remembered from last time.
        if (search) {
            this.model.searchExpression = search;
        }
    }
    /**
     * Set the replace text
     *
     * It does not trigger a view update.
     */
    setReplaceText(replace) {
        this.model.replaceText = replace;
    }
    /**
     * Show the replacement input box.
     */
    showReplace() {
        this.setReplaceInputVisibility(true);
    }
    /**
     * A message handler invoked on a `'close-request'` message.
     *
     * #### Notes
     * On top of the default implementation emit closed signal and end model query.
     */
    onCloseRequest(msg) {
        super.onCloseRequest(msg);
        this._closed.emit();
        void this.model.endQuery();
    }
    setReplaceInputVisibility(v) {
        if (this._showReplace !== v) {
            this._showReplace = v;
            this.update();
        }
    }
    setFiltersVisibility(v) {
        if (this._showFilters !== v) {
            this._showFilters = v;
            this.update();
        }
    }
    render() {
        return this.model.filtersDefinitionChanged ? (react_index_js_.createElement(apputils_lib_index_js_.UseSignal, { signal: this.model.filtersDefinitionChanged }, () => this._renderOverlay())) : (this._renderOverlay());
    }
    _renderOverlay() {
        return (react_index_js_.createElement(SearchOverlay, { caseSensitive: this.model.caseSensitive, currentIndex: this.model.currentIndex, isReadOnly: this.model.isReadOnly, errorMessage: this.model.parsingError, filters: this.model.filters, filtersDefinition: this.model.filtersDefinition, preserveCase: this.model.preserveCase, replaceEntryVisible: this._showReplace, filtersVisible: this._showFilters, replaceOptionsSupport: this.model.replaceOptionsSupport, replaceText: this.model.replaceText, initialSearchText: this.model.initialQuery, lastSearchText: this.model.searchExpression, searchInputRef: this._searchInput, totalMatches: this.model.totalMatches, translator: this.translator, useRegex: this.model.useRegex, wholeWords: this.model.wholeWords, onCaseSensitiveToggled: () => {
                this.model.caseSensitive = !this.model.caseSensitive;
            }, onRegexToggled: () => {
                this.model.useRegex = !this.model.useRegex;
            }, onWordToggled: () => {
                this.model.wholeWords = !this.model.wholeWords;
            }, onFilterChanged: async (name, value) => {
                await this.model.setFilter(name, value);
            }, onFiltersVisibilityChanged: (v) => {
                this.setFiltersVisibility(v);
            }, onHighlightNext: () => {
                void this.model.highlightNext();
            }, onHighlightPrevious: () => {
                void this.model.highlightPrevious();
            }, onPreserveCaseToggled: () => {
                this.model.preserveCase = !this.model.preserveCase;
            }, onSearchChanged: (q) => {
                this.model.searchExpression = q;
            }, onClose: () => {
                this.close();
            }, onReplaceEntryShown: (v) => {
                this.setReplaceInputVisibility(v);
            }, onReplaceChanged: (q) => {
                this.model.replaceText = q;
            }, onReplaceCurrent: () => {
                void this.model.replaceCurrentMatch();
            }, onReplaceAll: () => {
                void this.model.replaceAllMatches();
            }, keyBindings: this._keyBindings }));
    }
}
//# sourceMappingURL=searchview.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/searchproviderregistry.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Search provider registry
 */
class SearchProviderRegistry {
    /**
     * Constructor
     *
     * @param translator Application translator object
     */
    constructor(translator = lib_index_js_.nullTranslator) {
        this.translator = translator;
        this._changed = new dist_index_es6_js_.Signal(this);
        this._providerMap = new Map();
    }
    /**
     * Add a provider to the registry.
     *
     * @param key - The provider key.
     * @returns A disposable delegate that, when disposed, deregisters the given search provider
     */
    add(key, provider) {
        this._providerMap.set(key, provider);
        this._changed.emit();
        return new disposable_dist_index_es6_js_.DisposableDelegate(() => {
            this._providerMap.delete(key);
            this._changed.emit();
        });
    }
    /**
     * Returns a matching provider for the widget.
     *
     * @param widget - The widget to search over.
     * @returns the search provider, or undefined if none exists.
     */
    getProvider(widget) {
        // iterate through all providers and ask each one if it can search on the
        // widget.
        for (const P of this._providerMap.values()) {
            if (P.isApplicable(widget)) {
                return P.createNew(widget, this.translator);
            }
        }
        return undefined;
    }
    /**
     * Whether the registry as a matching provider for the widget.
     *
     * @param widget - The widget to search over.
     * @returns Provider existence
     */
    hasProvider(widget) {
        for (const P of this._providerMap.values()) {
            if (P.isApplicable(widget)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Signal that emits when a new search provider has been registered
     * or removed.
     */
    get changed() {
        return this._changed;
    }
}
//# sourceMappingURL=searchproviderregistry.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The search provider registry token.
 */
const ISearchProviderRegistry = new dist_index_js_.Token('@jupyterlab/documentsearch:ISearchProviderRegistry', `A service for a registry of search
  providers for the application. Plugins can register their UI elements with this registry
  to provide find/replace support.`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module documentsearch
 */







//# sourceMappingURL=index.js.map

/***/ }),

/***/ 13737:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/documentsearch/style/base.css
var base = __webpack_require__(13994);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/documentsearch/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 22311:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_extensionmanager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43230);
/* harmony import */ var _jupyterlab_extensionmanager__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_extensionmanager__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module extensionmanager-extension
 */






const PLUGIN_ID = '@jupyterlab/extensionmanager-extension:plugin';
/**
 * IDs of the commands added by this extension.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.showPanel = 'extensionmanager:show-panel';
    CommandIDs.toggle = 'extensionmanager:toggle';
})(CommandIDs || (CommandIDs = {}));
/**
 * The extension manager plugin.
 */
const plugin = {
    id: PLUGIN_ID,
    description: 'Adds the extension manager plugin.',
    autoStart: true,
    requires: [_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__.ISettingRegistry],
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],
    activate: async (app, registry, translator, restorer, palette) => {
        const { commands, shell, serviceManager } = app;
        translator = translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.nullTranslator;
        const trans = translator.load('jupyterlab');
        const model = new _jupyterlab_extensionmanager__WEBPACK_IMPORTED_MODULE_2__.ListModel(serviceManager, translator);
        const createView = () => {
            const v = new _jupyterlab_extensionmanager__WEBPACK_IMPORTED_MODULE_2__.ExtensionsPanel({ model, translator: translator });
            v.id = 'extensionmanager.main-view';
            v.title.icon = _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__.extensionIcon;
            v.title.caption = trans.__('Extension Manager');
            v.node.setAttribute('role', 'region');
            v.node.setAttribute('aria-label', trans.__('Extension Manager section'));
            if (restorer) {
                restorer.add(v, v.id);
            }
            shell.add(v, 'left', { rank: 1000 });
            return v;
        };
        // Create a view by default, so it can be restored when loading the workspace.
        let view = createView();
        // If the extension is enabled or disabled,
        // add or remove it from the left area.
        Promise.all([app.restored, registry.load(PLUGIN_ID)])
            .then(([, settings]) => {
            model.isDisclaimed = settings.get('disclaimed').composite;
            model.isEnabled = settings.get('enabled').composite;
            model.stateChanged.connect(() => {
                if (model.isDisclaimed !==
                    settings.get('disclaimed').composite) {
                    settings.set('disclaimed', model.isDisclaimed).catch(reason => {
                        console.error(`Failed to set setting 'disclaimed'.\n${reason}`);
                    });
                }
                if (model.isEnabled !== settings.get('enabled').composite) {
                    settings.set('enabled', model.isEnabled).catch(reason => {
                        console.error(`Failed to set setting 'enabled'.\n${reason}`);
                    });
                }
            });
            if (model.isEnabled) {
                view = view !== null && view !== void 0 ? view : createView();
            }
            else {
                view === null || view === void 0 ? void 0 : view.dispose();
                view = null;
            }
            settings.changed.connect(async () => {
                model.isDisclaimed = settings.get('disclaimed').composite;
                model.isEnabled = settings.get('enabled').composite;
                app.commands.notifyCommandChanged(CommandIDs.toggle);
                if (model.isEnabled) {
                    if (view === null || !view.isAttached) {
                        const accepted = await Private.showWarning(trans);
                        if (!accepted) {
                            void settings.set('enabled', false);
                            return;
                        }
                    }
                    view = view !== null && view !== void 0 ? view : createView();
                }
                else {
                    view === null || view === void 0 ? void 0 : view.dispose();
                    view = null;
                }
            });
        })
            .catch(reason => {
            console.error(`Something went wrong when reading the settings.\n${reason}`);
        });
        commands.addCommand(CommandIDs.showPanel, {
            label: trans.__('Extension Manager'),
            execute: () => {
                if (view) {
                    shell.activateById(view.id);
                }
            },
            isVisible: () => model.isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.toggle, {
            label: trans.__('Enable Extension Manager'),
            execute: () => {
                if (registry) {
                    void registry.set(plugin.id, 'enabled', !model.isEnabled);
                }
            },
            isToggled: () => model.isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        if (palette) {
            palette.addItem({
                command: CommandIDs.toggle,
                category: trans.__('Extension Manager')
            });
        }
    }
};
/**
 * Export the plugin as the default.
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
/**
 * A namespace for module-private functions.
 */
var Private;
(function (Private) {
    /**
     * Show a warning dialog about extension security.
     *
     * @returns whether the user accepted the dialog.
     */
    async function showWarning(trans) {
        const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
            title: trans.__('Enable Extension Manager?'),
            body: trans.__(`Thanks for trying out JupyterLab's extension manager.
The JupyterLab development team is excited to have a robust
third-party extension community.
However, we cannot vouch for every extension,
and some may introduce security risks.
Do you want to continue?`),
            buttons: [
                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({ label: trans.__('Disable') }),
                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.warnButton({ label: trans.__('Enable') })
            ]
        });
        return result.button.accept;
    }
    Private.showWarning = showWarning;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 17066:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var widgets_style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/extensionmanager/style/base.css
var base = __webpack_require__(36559);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/extensionmanager/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/extensionmanager/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






;// CONCATENATED MODULE: ../node_modules/@jupyterlab/extensionmanager-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 59151:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ExtensionsPanel: () => (/* reexport */ ExtensionsPanel),
  ListModel: () => (/* reexport */ ListModel)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(75205);
// EXTERNAL MODULE: ../node_modules/semver/index.js
var semver = __webpack_require__(38873);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/extensionmanager/lib/dialog.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Show a dialog box reporting an error during installation of an extension.
 *
 * @param name The name of the extension
 * @param errorMessage Any error message giving details about the failure.
 */
function reportInstallError(name, errorMessage, translator) {
    translator = translator || translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const entries = [];
    entries.push(react_index_js_.createElement("p", null, trans.__(`An error occurred installing "${name}".`)));
    if (errorMessage) {
        entries.push(react_index_js_.createElement("p", null,
            react_index_js_.createElement("span", { className: "jp-extensionmanager-dialog-subheader" }, trans.__('Error message:'))), react_index_js_.createElement("pre", null, errorMessage.trim()));
    }
    const body = react_index_js_.createElement("div", { className: "jp-extensionmanager-dialog" }, entries);
    void (0,index_js_.showDialog)({
        title: trans.__('Extension Installation Error'),
        body,
        buttons: [index_js_.Dialog.warnButton({ label: trans.__('Ok') })]
    });
}
//# sourceMappingURL=dialog.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/extensionmanager/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/* global RequestInit */








/**
 * The server API path for querying/modifying installed extensions.
 */
const EXTENSION_API_PATH = 'lab/api/extensions';
/**
 * Model for an extension list.
 */
class ListModel extends ui_components_lib_index_js_.VDomModel {
    constructor(serviceManager, translator) {
        super();
        this.actionError = null;
        /**
         * Contains an error message if an error occurred when querying installed extensions.
         */
        this.installedError = null;
        /**
         * Contains an error message if an error occurred when searching for extensions.
         */
        this.searchError = null;
        /**
         * Whether a reload should be considered due to actions taken.
         */
        this.promptReload = false;
        this._isDisclaimed = false;
        this._isEnabled = false;
        this._isLoadingInstalledExtensions = false;
        this._isSearching = false;
        this._query = '';
        this._page = 1;
        this._pagination = 30;
        this._lastPage = 1;
        this._pendingActions = [];
        const metadata = JSON.parse(
        // The page config option may not be defined; e.g. in the federated example
        lib_index_js_.PageConfig.getOption('extensionManager') || '{}');
        this.name = metadata.name;
        this.canInstall = metadata.can_install;
        this.installPath = metadata.install_path;
        this.translator = translator || translation_lib_index_js_.nullTranslator;
        this._installed = [];
        this._lastSearchResult = [];
        this.serviceManager = serviceManager;
        this._debouncedSearch = new index_es6_js_.Debouncer(this.search.bind(this), 1000);
    }
    /**
     * A readonly array of the installed extensions.
     */
    get installed() {
        return this._installed;
    }
    /**
     * Whether the warning is disclaimed or not.
     */
    get isDisclaimed() {
        return this._isDisclaimed;
    }
    set isDisclaimed(v) {
        if (v !== this._isDisclaimed) {
            this._isDisclaimed = v;
            this.stateChanged.emit();
            void this._debouncedSearch.invoke();
        }
    }
    /**
     * Whether the extension manager is enabled or not.
     */
    get isEnabled() {
        return this._isEnabled;
    }
    set isEnabled(v) {
        if (v !== this._isEnabled) {
            this._isEnabled = v;
            this.stateChanged.emit();
        }
    }
    get isLoadingInstalledExtensions() {
        return this._isLoadingInstalledExtensions;
    }
    get isSearching() {
        return this._isSearching;
    }
    /**
     * A readonly array containing the latest search result
     */
    get searchResult() {
        return this._lastSearchResult;
    }
    /**
     * The search query.
     *
     * Setting its value triggers a new search.
     */
    get query() {
        return this._query;
    }
    set query(value) {
        if (this._query !== value) {
            this._query = value;
            this._page = 1;
            void this._debouncedSearch.invoke();
        }
    }
    /**
     * The current search page.
     *
     * Setting its value triggers a new search.
     *
     * ### Note
     * First page is 1.
     */
    get page() {
        return this._page;
    }
    set page(value) {
        if (this._page !== value) {
            this._page = value;
            void this._debouncedSearch.invoke();
        }
    }
    /**
     * The search pagination.
     *
     * Setting its value triggers a new search.
     */
    get pagination() {
        return this._pagination;
    }
    set pagination(value) {
        if (this._pagination !== value) {
            this._pagination = value;
            void this._debouncedSearch.invoke();
        }
    }
    /**
     * The last page of results in the current search.
     */
    get lastPage() {
        return this._lastPage;
    }
    /**
     * Dispose the extensions list model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._debouncedSearch.dispose();
        super.dispose();
    }
    /**
     * Whether there are currently any actions pending.
     */
    hasPendingActions() {
        return this._pendingActions.length > 0;
    }
    /**
     * Install an extension.
     *
     * @param entry An entry indicating which extension to install.
     * @param options Additional options for the action.
     */
    async install(entry, options = {}) {
        await this.performAction('install', entry, options).then(data => {
            if (data.status !== 'ok') {
                reportInstallError(entry.name, data.message, this.translator);
            }
            return this.update(true);
        });
    }
    /**
     * Uninstall an extension.
     *
     * @param entry An entry indicating which extension to uninstall.
     */
    async uninstall(entry) {
        if (!entry.installed) {
            throw new Error(`Not installed, cannot uninstall: ${entry.name}`);
        }
        await this.performAction('uninstall', entry);
        return this.update(true);
    }
    /**
     * Enable an extension.
     *
     * @param entry An entry indicating which extension to enable.
     */
    async enable(entry) {
        if (entry.enabled) {
            throw new Error(`Already enabled: ${entry.name}`);
        }
        await this.performAction('enable', entry);
        await this.refreshInstalled(true);
    }
    /**
     * Disable an extension.
     *
     * @param entry An entry indicating which extension to disable.
     */
    async disable(entry) {
        if (!entry.enabled) {
            throw new Error(`Already disabled: ${entry.name}`);
        }
        await this.performAction('disable', entry);
        await this.refreshInstalled(true);
    }
    /**
     * Refresh installed packages
     *
     * @param force Force refreshing the list of installed packages
     */
    async refreshInstalled(force = false) {
        this.installedError = null;
        this._isLoadingInstalledExtensions = true;
        this.stateChanged.emit();
        try {
            const [extensions] = await Private.requestAPI({
                refresh: force ? 1 : 0
            });
            this._installed = extensions.sort(Private.installedComparator);
        }
        catch (reason) {
            this.installedError = reason.toString();
        }
        finally {
            this._isLoadingInstalledExtensions = false;
            this.stateChanged.emit();
        }
    }
    /**
     * Search with current query.
     *
     * Sets searchError and totalEntries as appropriate.
     *
     * @returns The extensions matching the current query.
     */
    async search(force = false) {
        var _a, _b;
        if (!this.isDisclaimed) {
            return Promise.reject('Installation warning is not disclaimed.');
        }
        this.searchError = null;
        this._isSearching = true;
        this.stateChanged.emit();
        try {
            const [extensions, links] = await Private.requestAPI({
                query: (_a = this.query) !== null && _a !== void 0 ? _a : '',
                page: this.page,
                per_page: this.pagination,
                refresh: force ? 1 : 0
            });
            const lastURL = links['last'];
            if (lastURL) {
                const lastPage = lib_index_js_.URLExt.queryStringToObject((_b = lib_index_js_.URLExt.parse(lastURL).search) !== null && _b !== void 0 ? _b : '')['page'];
                if (lastPage) {
                    this._lastPage = parseInt(lastPage, 10);
                }
            }
            const installedNames = this._installed.map(pkg => pkg.name);
            this._lastSearchResult = extensions.filter(pkg => !installedNames.includes(pkg.name));
        }
        catch (reason) {
            this.searchError = reason.toString();
        }
        finally {
            this._isSearching = false;
            this.stateChanged.emit();
        }
    }
    /**
     * Update the current model.
     *
     * This will query the packages repository, and the notebook server.
     *
     * Emits the `stateChanged` signal on successful completion.
     */
    async update(force = false) {
        if (this.isDisclaimed) {
            // First refresh the installed list - so the search results are correctly filtered
            await this.refreshInstalled(force);
            await this.search();
        }
    }
    /**
     * Send a request to the server to perform an action on an extension.
     *
     * @param action A valid action to perform.
     * @param entry The extension to perform the action on.
     * @param actionOptions Additional options for the action.
     */
    performAction(action, entry, actionOptions = {}) {
        const bodyJson = {
            cmd: action,
            extension_name: entry.name
        };
        if (actionOptions.useVersion) {
            bodyJson['extension_version'] = actionOptions.useVersion;
        }
        const actionRequest = Private.requestAPI({}, {
            method: 'POST',
            body: JSON.stringify(bodyJson)
        });
        actionRequest.then(([reply]) => {
            const trans = this.translator.load('jupyterlab');
            if (reply.needs_restart.includes('server')) {
                void (0,index_js_.showDialog)({
                    title: trans.__('Information'),
                    body: trans.__('You will need to restart JupyterLab to apply the changes.'),
                    buttons: [index_js_.Dialog.okButton({ label: trans.__('Ok') })]
                });
            }
            else {
                const followUps = [];
                if (reply.needs_restart.includes('frontend')) {
                    followUps.push(
                    // @ts-expect-error isElectron is not a standard attribute
                    window.isElectron
                        ? trans.__('reload JupyterLab')
                        : trans.__('refresh the web page'));
                }
                if (reply.needs_restart.includes('kernel')) {
                    followUps.push(trans.__('install the extension in all kernels and restart them'));
                }
                void (0,index_js_.showDialog)({
                    title: trans.__('Information'),
                    body: trans.__('You will need to %1 to apply the changes.', followUps.join(trans.__(' and '))),
                    buttons: [index_js_.Dialog.okButton({ label: trans.__('Ok') })]
                });
            }
            this.actionError = null;
        }, reason => {
            this.actionError = reason.toString();
        });
        this.addPendingAction(actionRequest);
        return actionRequest.then(([reply]) => reply);
    }
    /**
     * Add a pending action.
     *
     * @param pending A promise that resolves when the action is completed.
     */
    addPendingAction(pending) {
        // Add to pending actions collection
        this._pendingActions.push(pending);
        // Ensure action is removed when resolved
        const remove = () => {
            const i = this._pendingActions.indexOf(pending);
            this._pendingActions.splice(i, 1);
            this.stateChanged.emit(undefined);
        };
        pending.then(remove, remove);
        // Signal changed state
        this.stateChanged.emit(undefined);
    }
}
/**
 * ListModel statics.
 */
(function (ListModel) {
    /**
     * Utility function to check whether an entry can be updated.
     *
     * @param entry The entry to check.
     */
    function entryHasUpdate(entry) {
        if (!entry.installed || !entry.latest_version) {
            return false;
        }
        return semver.lt(entry.installed_version, entry.latest_version);
    }
    ListModel.entryHasUpdate = entryHasUpdate;
})(ListModel || (ListModel = {}));
/**
 * A namespace for private functionality.
 */
var Private;
(function (Private) {
    /**
     * A comparator function that sorts installed extensions.
     *
     * In past it used to sort allowedExtensions orgs to the top,
     * which needs to be restored (or documentation updated).
     */
    function installedComparator(a, b) {
        return a.name.localeCompare(b.name);
    }
    Private.installedComparator = installedComparator;
    const LINK_PARSER = /<([^>]+)>; rel="([^"]+)",?/g;
    /**
     * Call the API extension
     *
     * @param queryArgs Query arguments
     * @param init Initial values for the request
     * @param serverSettings The server settings to use for the request
     * @returns The response body interpreted as JSON and the response link header
     */
    async function requestAPI(queryArgs = {}, init = {}, serverSettings) {
        var _a;
        // Make request to Jupyter API
        const settings = serverSettings !== null && serverSettings !== void 0 ? serverSettings : services_lib_index_js_.ServerConnection.makeSettings();
        const requestUrl = lib_index_js_.URLExt.join(settings.baseUrl, EXTENSION_API_PATH // API Namespace
        );
        let response;
        try {
            response = await services_lib_index_js_.ServerConnection.makeRequest(requestUrl + lib_index_js_.URLExt.objectToQueryString(queryArgs), init, settings);
        }
        catch (error) {
            throw new services_lib_index_js_.ServerConnection.NetworkError(error);
        }
        let data = await response.text();
        if (data.length > 0) {
            try {
                data = JSON.parse(data);
            }
            catch (error) {
                console.log('Not a JSON response body.', response);
            }
        }
        if (!response.ok) {
            throw new services_lib_index_js_.ServerConnection.ResponseError(response, data.message || data);
        }
        const link = (_a = response.headers.get('Link')) !== null && _a !== void 0 ? _a : '';
        const links = {};
        let match = null;
        while ((match = LINK_PARSER.exec(link)) !== null) {
            links[match[2]] = match[1];
        }
        return [data, links];
    }
    Private.requestAPI = requestAPI;
})(Private || (Private = {}));
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: ../node_modules/react-paginate/dist/react-paginate.js
var react_paginate = __webpack_require__(96389);
var react_paginate_default = /*#__PURE__*/__webpack_require__.n(react_paginate);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/extensionmanager/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




const BADGE_SIZE = 32;
const BADGE_QUERY_SIZE = Math.floor(devicePixelRatio * BADGE_SIZE);
function getExtensionGitHubUser(entry) {
    if (entry.homepage_url &&
        entry.homepage_url.startsWith('https://github.com/')) {
        return entry.homepage_url.split('/')[3];
    }
    else if (entry.repository_url &&
        entry.repository_url.startsWith('https://github.com/')) {
        return entry.repository_url.split('/')[3];
    }
    return null;
}
/**
 * VDOM for visualizing an extension entry.
 */
function ListEntry(props) {
    const { canFetch, entry, supportInstallation, trans } = props;
    const flagClasses = [];
    if (entry.status && ['ok', 'warning', 'error'].indexOf(entry.status) !== -1) {
        flagClasses.push(`jp-extensionmanager-entry-${entry.status}`);
    }
    const githubUser = canFetch ? getExtensionGitHubUser(entry) : null;
    if (!entry.allowed) {
        flagClasses.push(`jp-extensionmanager-entry-should-be-uninstalled`);
    }
    return (react_index_js_.createElement("li", { className: `jp-extensionmanager-entry ${flagClasses.join(' ')}`, style: { display: 'flex' } },
        react_index_js_.createElement("div", { style: { marginRight: '8px' } }, githubUser ? (react_index_js_.createElement("img", { src: `https://github.com/${githubUser}.png?size=${BADGE_QUERY_SIZE}`, style: { width: '32px', height: '32px' } })) : (react_index_js_.createElement("div", { style: { width: `${BADGE_SIZE}px`, height: `${BADGE_SIZE}px` } }))),
        react_index_js_.createElement("div", { className: "jp-extensionmanager-entry-description" },
            react_index_js_.createElement("div", { className: "jp-extensionmanager-entry-title" },
                react_index_js_.createElement("div", { className: "jp-extensionmanager-entry-name" }, entry.homepage_url ? (react_index_js_.createElement("a", { href: entry.homepage_url, target: "_blank", rel: "noopener noreferrer", title: trans.__('%1 extension home page', entry.name) }, entry.name)) : (react_index_js_.createElement("div", null, entry.name))),
                react_index_js_.createElement("div", { className: "jp-extensionmanager-entry-version" },
                    react_index_js_.createElement("div", { title: trans.__('Version: %1', entry.installed_version) }, entry.installed_version)),
                entry.installed && !entry.allowed && (react_index_js_.createElement(ui_components_lib_index_js_.ToolbarButtonComponent, { icon: ui_components_lib_index_js_.infoIcon, iconLabel: trans.__('%1 extension is not allowed anymore. Please uninstall it immediately or contact your administrator.', entry.name), onClick: () => window.open('https://jupyterlab.readthedocs.io/en/stable/user/extensions.html') })),
                entry.approved && (react_index_js_.createElement(ui_components_lib_index_js_.jupyterIcon.react, { className: "jp-extensionmanager-is-approved", top: "1px", height: "auto", width: "1em", title: trans.__('This extension is approved by your security team.') }))),
            react_index_js_.createElement("div", { className: "jp-extensionmanager-entry-content" },
                react_index_js_.createElement("div", { className: "jp-extensionmanager-entry-description" }, entry.description),
                props.performAction && (react_index_js_.createElement("div", { className: "jp-extensionmanager-entry-buttons" }, entry.installed ? (react_index_js_.createElement(react_index_js_.Fragment, null,
                    supportInstallation && (react_index_js_.createElement(react_index_js_.Fragment, null,
                        ListModel.entryHasUpdate(entry) && (react_index_js_.createElement(ui_components_lib_index_js_.Button, { onClick: () => props.performAction('install', entry, {
                                useVersion: entry.latest_version
                            }), title: trans.__('Update "%1" to "%2"', entry.name, entry.latest_version), minimal: true, small: true }, trans.__('Update to %1', entry.latest_version))),
                        react_index_js_.createElement(ui_components_lib_index_js_.Button, { onClick: () => props.performAction('uninstall', entry), title: trans.__('Uninstall "%1"', entry.name), minimal: true, small: true }, trans.__('Uninstall')))),
                    entry.enabled ? (react_index_js_.createElement(ui_components_lib_index_js_.Button, { onClick: () => props.performAction('disable', entry), title: trans.__('Disable "%1"', entry.name), minimal: true, small: true }, trans.__('Disable'))) : (react_index_js_.createElement(ui_components_lib_index_js_.Button, { onClick: () => props.performAction('enable', entry), title: trans.__('Enable "%1"', entry.name), minimal: true, small: true }, trans.__('Enable'))))) : (supportInstallation && (react_index_js_.createElement(ui_components_lib_index_js_.Button, { onClick: () => props.performAction('install', entry), title: trans.__('Install "%1"', entry.name), minimal: true, small: true }, trans.__('Install'))))))))));
}
/**
 * List view widget for extensions
 */
function ListView(props) {
    var _a;
    const { canFetch, performAction, supportInstallation, trans } = props;
    return (react_index_js_.createElement("div", { className: "jp-extensionmanager-listview-wrapper" },
        props.entries.length > 0 ? (react_index_js_.createElement("ul", { className: "jp-extensionmanager-listview" }, props.entries.map(entry => (react_index_js_.createElement(ListEntry, { key: entry.name, canFetch: canFetch, entry: entry, performAction: performAction, supportInstallation: supportInstallation, trans: trans }))))) : (react_index_js_.createElement("div", { key: "message", className: "jp-extensionmanager-listview-message" }, trans.__('No entries'))),
        props.numPages > 1 && (react_index_js_.createElement("div", { className: "jp-extensionmanager-pagination" },
            react_index_js_.createElement((react_paginate_default()), { previousLabel: '<', nextLabel: '>', breakLabel: "...", breakClassName: 'break', initialPage: ((_a = props.initialPage) !== null && _a !== void 0 ? _a : 1) - 1, pageCount: props.numPages, marginPagesDisplayed: 2, pageRangeDisplayed: 3, onPageChange: (data) => props.onPage(data.selected + 1), activeClassName: 'active' })))));
}
function ErrorMessage(props) {
    return react_index_js_.createElement("div", { className: "jp-extensionmanager-error" }, props.children);
}
class Header extends ui_components_lib_index_js_.ReactWidget {
    constructor(model, trans, searchInputRef) {
        super();
        this.model = model;
        this.trans = trans;
        this.searchInputRef = searchInputRef;
        model.stateChanged.connect(this.update, this);
        this.addClass('jp-extensionmanager-header');
    }
    render() {
        return (react_index_js_.createElement(react_index_js_.Fragment, null,
            react_index_js_.createElement("div", { className: "jp-extensionmanager-title" },
                react_index_js_.createElement("span", null, this.trans.__('%1 Manager', this.model.name)),
                this.model.installPath && (react_index_js_.createElement(ui_components_lib_index_js_.infoIcon.react, { className: "jp-extensionmanager-path", tag: "span", title: this.trans.__('Extension installation path: %1', this.model.installPath) }))),
            react_index_js_.createElement(ui_components_lib_index_js_.FilterBox, { placeholder: this.trans.__('Search extensions'), disabled: !this.model.isDisclaimed, updateFilter: (fn, query) => {
                    this.model.query = query !== null && query !== void 0 ? query : '';
                }, useFuzzyFilter: false, inputRef: this.searchInputRef }),
            react_index_js_.createElement("div", { className: `jp-extensionmanager-pending ${this.model.hasPendingActions() ? 'jp-mod-hasPending' : ''}` }),
            this.model.actionError && (react_index_js_.createElement(ErrorMessage, null,
                react_index_js_.createElement("p", null, this.trans.__('Error when performing an action.')),
                react_index_js_.createElement("p", null, this.trans.__('Reason given:')),
                react_index_js_.createElement("pre", null, this.model.actionError)))));
    }
}
class Warning extends ui_components_lib_index_js_.ReactWidget {
    constructor(model, trans) {
        super();
        this.model = model;
        this.trans = trans;
        this.addClass('jp-extensionmanager-disclaimer');
        model.stateChanged.connect(this.update, this);
    }
    render() {
        return (react_index_js_.createElement(react_index_js_.Fragment, null,
            react_index_js_.createElement("p", null,
                this.trans
                    .__(`The JupyterLab development team is excited to have a robust
third-party extension community. However, we do not review
third-party extensions, and some extensions may introduce security
risks or contain malicious code that runs on your machine. Moreover in order
to work, this panel needs to fetch data from web services. Do you agree to
activate this feature?`),
                react_index_js_.createElement("br", null),
                react_index_js_.createElement("a", { href: "https://jupyterlab.readthedocs.io/en/stable/privacy_policies.html", target: "_blank", rel: "noreferrer" }, this.trans.__('Please read the privacy policy.'))),
            this.model.isDisclaimed ? (react_index_js_.createElement(ui_components_lib_index_js_.Button, { className: "jp-extensionmanager-disclaimer-disable", onClick: (e) => {
                    this.model.isDisclaimed = false;
                }, title: this.trans.__('This will withdraw your consent.') }, this.trans.__('No'))) : (react_index_js_.createElement("div", null,
                react_index_js_.createElement(ui_components_lib_index_js_.Button, { className: "jp-extensionmanager-disclaimer-enable", onClick: () => {
                        this.model.isDisclaimed = true;
                    } }, this.trans.__('Yes')),
                react_index_js_.createElement(ui_components_lib_index_js_.Button, { className: "jp-extensionmanager-disclaimer-disable", onClick: () => {
                        this.model.isEnabled = false;
                    }, title: this.trans.__('This will disable the extension manager panel; including the listing of installed extension.') }, this.trans.__('No, disable'))))));
    }
}
class InstalledList extends ui_components_lib_index_js_.ReactWidget {
    constructor(model, trans) {
        super();
        this.model = model;
        this.trans = trans;
        model.stateChanged.connect(this.update, this);
    }
    render() {
        return (react_index_js_.createElement(react_index_js_.Fragment, null, this.model.installedError !== null ? (react_index_js_.createElement(ErrorMessage, null, `Error querying installed extensions${this.model.installedError ? `: ${this.model.installedError}` : '.'}`)) : this.model.isLoadingInstalledExtensions ? (react_index_js_.createElement("div", { className: "jp-extensionmanager-loader" }, this.trans.__('Updating extensions list…'))) : (react_index_js_.createElement(ListView, { canFetch: this.model.isDisclaimed, entries: this.model.installed.filter(pkg => new RegExp(this.model.query.toLowerCase()).test(pkg.name)), numPages: 1, trans: this.trans, onPage: value => {
                /* no-op */
            }, performAction: this.model.isDisclaimed ? this.onAction.bind(this) : null, supportInstallation: this.model.canInstall && this.model.isDisclaimed }))));
    }
    /**
     * Callback handler for when the user wants to perform an action on an extension.
     *
     * @param action The action to perform.
     * @param entry The entry to perform the action on.
     * @param actionOptions Additional options for the action.
     */
    onAction(action, entry, actionOptions = {}) {
        switch (action) {
            case 'install':
                return this.model.install(entry, actionOptions);
            case 'uninstall':
                return this.model.uninstall(entry);
            case 'enable':
                return this.model.enable(entry);
            case 'disable':
                return this.model.disable(entry);
            default:
                throw new Error(`Invalid action: ${action}`);
        }
    }
}
class SearchResult extends ui_components_lib_index_js_.ReactWidget {
    constructor(model, trans) {
        super();
        this.model = model;
        this.trans = trans;
        model.stateChanged.connect(this.update, this);
    }
    /**
     * Callback handler for the user changes the page of the search result pagination.
     *
     * @param value The pagination page number.
     */
    onPage(value) {
        this.model.page = value;
    }
    /**
     * Callback handler for when the user wants to perform an action on an extension.
     *
     * @param action The action to perform.
     * @param entry The entry to perform the action on.
     * @param actionOptions Additional options for the action.
     */
    onAction(action, entry, actionOptions = {}) {
        switch (action) {
            case 'install':
                return this.model.install(entry, actionOptions);
            case 'uninstall':
                return this.model.uninstall(entry);
            case 'enable':
                return this.model.enable(entry);
            case 'disable':
                return this.model.disable(entry);
            default:
                throw new Error(`Invalid action: ${action}`);
        }
    }
    render() {
        return (react_index_js_.createElement(react_index_js_.Fragment, null, this.model.searchError !== null ? (react_index_js_.createElement(ErrorMessage, null, `Error searching for extensions${this.model.searchError ? `: ${this.model.searchError}` : '.'}`)) : this.model.isSearching ? (react_index_js_.createElement("div", { className: "jp-extensionmanager-loader" }, this.trans.__('Updating extensions list…'))) : (react_index_js_.createElement(ListView, { canFetch: this.model.isDisclaimed, entries: this.model.searchResult, initialPage: this.model.page, numPages: this.model.lastPage, onPage: value => {
                this.onPage(value);
            }, performAction: this.model.isDisclaimed ? this.onAction.bind(this) : null, supportInstallation: this.model.canInstall && this.model.isDisclaimed, trans: this.trans }))));
    }
    update() {
        this.title.label = this.model.query
            ? this.trans.__('Search Results')
            : this.trans.__('Discover');
        super.update();
    }
}
class ExtensionsPanel extends ui_components_lib_index_js_.SidePanel {
    constructor(options) {
        const { model, translator } = options;
        super({ translator });
        this._wasInitialized = false;
        this._wasDisclaimed = true;
        this.model = model;
        this._searchInputRef = react_index_js_.createRef();
        this.addClass('jp-extensionmanager-view');
        this.trans = translator.load('jupyterlab');
        this.header.addWidget(new Header(model, this.trans, this._searchInputRef));
        const warning = new Warning(model, this.trans);
        warning.title.label = this.trans.__('Warning');
        this.addWidget(warning);
        const installed = new ui_components_lib_index_js_.PanelWithToolbar();
        installed.addClass('jp-extensionmanager-installedlist');
        installed.toolbar.node.setAttribute('aria-label', this.trans.__('Extensions panel toolbar'));
        installed.title.label = this.trans.__('Installed');
        installed.toolbar.addItem('refresh', new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.refreshIcon,
            onClick: () => {
                model.refreshInstalled(true).catch(reason => {
                    console.error(`Failed to refresh the installed extensions list:\n${reason}`);
                });
            },
            tooltip: this.trans.__('Refresh extensions list')
        }));
        installed.addWidget(new InstalledList(model, this.trans));
        this.addWidget(installed);
        if (this.model.canInstall) {
            const searchResults = new SearchResult(model, this.trans);
            searchResults.addClass('jp-extensionmanager-searchresults');
            this.addWidget(searchResults);
        }
        this._wasDisclaimed = this.model.isDisclaimed;
        if (this.model.isDisclaimed) {
            this.content.collapse(0);
            this.content.layout.setRelativeSizes([0, 1, 1]);
        }
        else {
            // If warning is not disclaimed expand only the warning panel
            this.content.expand(0);
            this.content.collapse(1);
            this.content.collapse(2);
        }
        this.model.stateChanged.connect(this._onStateChanged, this);
    }
    /**
     * Dispose of the widget and its descendant widgets.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.model.stateChanged.disconnect(this._onStateChanged, this);
        super.dispose();
    }
    /**
     * Handle the DOM events for the extension manager search bar.
     *
     * @param event - The DOM event sent to the extension manager search bar.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the search bar's DOM node.
     * It should not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'focus':
            case 'blur':
                this._toggleFocused();
                break;
            default:
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('focus', this, true);
        this.node.addEventListener('blur', this, true);
        super.onBeforeAttach(msg);
    }
    onBeforeShow(msg) {
        if (!this._wasInitialized) {
            this._wasInitialized = true;
            this.model.refreshInstalled().catch(reason => {
                console.log(`Failed to refresh installed extension list:\n${reason}`);
            });
        }
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        super.onAfterDetach(msg);
        this.node.removeEventListener('focus', this, true);
        this.node.removeEventListener('blur', this, true);
    }
    /**
     * A message handler invoked on an `'activate-request'` message.
     */
    onActivateRequest(msg) {
        if (this.isAttached) {
            const input = this._searchInputRef.current;
            if (input) {
                // Cover the cases, mainly on initial startup, where the input ref is not an input element
                if (input.focus) {
                    input.focus();
                }
                if (input.select) {
                    input.select();
                }
            }
        }
        super.onActivateRequest(msg);
    }
    _onStateChanged() {
        if (!this._wasDisclaimed && this.model.isDisclaimed) {
            this.content.collapse(0);
            this.content.expand(1);
            this.content.expand(2);
        }
        this._wasDisclaimed = this.model.isDisclaimed;
    }
    /**
     * Toggle the focused modifier based on the input node focus state.
     */
    _toggleFocused() {
        const focused = document.activeElement === this._searchInputRef.current;
        this.toggleClass('lm-mod-focused', focused);
    }
}
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/extensionmanager/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module extensionmanager
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 30893:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   fileUploadStatus: () => (/* binding */ fileUploadStatus)
/* harmony export */ });
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61533);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(64009);
/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(34992);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29543);
/* harmony import */ var _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(43988);
/* harmony import */ var _jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99055);
/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(78839);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(88532);
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_lumino_commands__WEBPACK_IMPORTED_MODULE_13__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module filebrowser-extension
 */














/**
 * Toolbar factory for the top toolbar in the widget
 */
const FILE_BROWSER_FACTORY = 'FileBrowser';
const FILE_BROWSER_PLUGIN_ID = '@jupyterlab/filebrowser-extension:browser';
/**
 * The command IDs used by the file browser plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.copy = 'filebrowser:copy';
    CommandIDs.copyDownloadLink = 'filebrowser:copy-download-link';
    CommandIDs.cut = 'filebrowser:cut';
    CommandIDs.del = 'filebrowser:delete';
    CommandIDs.download = 'filebrowser:download';
    CommandIDs.duplicate = 'filebrowser:duplicate';
    CommandIDs.selectAll = 'filebrowser:select-all';
    // For main browser only.
    CommandIDs.hideBrowser = 'filebrowser:hide-main';
    CommandIDs.goToPath = 'filebrowser:go-to-path';
    CommandIDs.goUp = 'filebrowser:go-up';
    CommandIDs.openPath = 'filebrowser:open-path';
    CommandIDs.openUrl = 'filebrowser:open-url';
    CommandIDs.open = 'filebrowser:open';
    CommandIDs.openBrowserTab = 'filebrowser:open-browser-tab';
    CommandIDs.paste = 'filebrowser:paste';
    CommandIDs.createNewDirectory = 'filebrowser:create-new-directory';
    CommandIDs.createNewFile = 'filebrowser:create-new-file';
    CommandIDs.createNewMarkdownFile = 'filebrowser:create-new-markdown-file';
    CommandIDs.refresh = 'filebrowser:refresh';
    CommandIDs.rename = 'filebrowser:rename';
    // For main browser only.
    CommandIDs.copyShareableLink = 'filebrowser:share-main';
    // For main browser only.
    CommandIDs.copyPath = 'filebrowser:copy-path';
    CommandIDs.showBrowser = 'filebrowser:activate';
    CommandIDs.shutdown = 'filebrowser:shutdown';
    // For main browser only.
    CommandIDs.toggleBrowser = 'filebrowser:toggle-main';
    CommandIDs.toggleFileFilter = 'filebrowser:toggle-file-filter';
    CommandIDs.toggleNavigateToCurrentDirectory = 'filebrowser:toggle-navigate-to-current-directory';
    CommandIDs.toggleLastModified = 'filebrowser:toggle-last-modified';
    CommandIDs.toggleShowFullPath = 'filebrowser:toggle-show-full-path';
    CommandIDs.toggleFileSize = 'filebrowser:toggle-file-size';
    CommandIDs.toggleSortNotebooksFirst = 'filebrowser:toggle-sort-notebooks-first';
    CommandIDs.toggleHiddenFiles = 'filebrowser:toggle-hidden-files';
    CommandIDs.toggleSingleClick = 'filebrowser:toggle-single-click-navigation';
    CommandIDs.toggleFileCheckboxes = 'filebrowser:toggle-file-checkboxes';
})(CommandIDs || (CommandIDs = {}));
/**
 * The file browser namespace token.
 */
const namespace = 'filebrowser';
/**
 * The default file browser extension.
 */
const browser = {
    id: FILE_BROWSER_PLUGIN_ID,
    description: 'Set up the default file browser commands and state restoration',
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IDefaultFileBrowser, _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    optional: [
        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__.ILayoutRestorer,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_7__.ISettingRegistry,
        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__.ITreePathUpdater,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.ICommandPalette
    ],
    provides: _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserCommands,
    autoStart: true,
    activate: async (app, defaultFileBrowser, factory, translator, restorer, settingRegistry, treePathUpdater, commandPalette) => {
        const browser = defaultFileBrowser;
        // Let the application restorer track the primary file browser (that is
        // automatically created) for restoration of application state (e.g. setting
        // the file browser as the current side bar widget).
        //
        // All other file browsers created by using the factory function are
        // responsible for their own restoration behavior, if any.
        if (restorer) {
            restorer.add(browser, namespace);
        }
        // Navigate to preferred-dir trait if found
        const preferredPath = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.getOption('preferredPath');
        if (preferredPath) {
            await browser.model.cd(preferredPath);
        }
        addCommands(app, browser, factory, translator, settingRegistry, commandPalette);
        void Promise.all([app.restored, browser.model.restored]).then(() => {
            if (treePathUpdater) {
                browser.model.pathChanged.connect((sender, args) => {
                    treePathUpdater(args.newValue);
                });
            }
        });
        return {
            openPath: CommandIDs.openPath
        };
    }
};
/**
 * Handle the file browser settings taking into account user defined settings.
 */
const browserSettings = {
    id: '@jupyterlab/filebrowser-extension:settings',
    description: 'Set up the default file browser settings',
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IDefaultFileBrowser],
    optional: [_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_7__.ISettingRegistry],
    autoStart: true,
    activate: (app, browser, settingRegistry) => {
        if (settingRegistry) {
            void settingRegistry.load(FILE_BROWSER_PLUGIN_ID).then(settings => {
                /**
                 * File browser default configuration.
                 */
                const defaultFileBrowserConfig = {
                    navigateToCurrentDirectory: false,
                    singleClickNavigation: false,
                    showLastModifiedColumn: true,
                    showFileSizeColumn: false,
                    showHiddenFiles: false,
                    showFileCheckboxes: false,
                    sortNotebooksFirst: false,
                    showFullPath: false,
                    allowFileUploads: true
                };
                function onSettingsChanged(settings) {
                    let key;
                    for (key in defaultFileBrowserConfig) {
                        const value = settings.get(key).composite;
                        browser[key] = value;
                    }
                    const breadcrumbs = settings.get('breadcrumbs')
                        .composite;
                    browser.minimumBreadcrumbsLeftItems = breadcrumbs.minimumLeftItems;
                    browser.minimumBreadcrumbsRightItems = breadcrumbs.minimumRightItems;
                    const filterDirectories = settings.get('filterDirectories')
                        .composite;
                    const useFuzzyFilter = settings.get('useFuzzyFilter')
                        .composite;
                    browser.model.filterDirectories = filterDirectories;
                    browser.model.useFuzzyFilter = useFuzzyFilter;
                }
                settings.changed.connect(onSettingsChanged);
                onSettingsChanged(settings);
            });
        }
    }
};
/**
 * The default file browser factory provider.
 */
const factory = {
    id: '@jupyterlab/filebrowser-extension:factory',
    description: 'Provides the file browser factory.',
    provides: _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory,
    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_4__.IDocumentManager, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    optional: [_jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_8__.IStateDB, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__.JupyterLab.IInfo],
    activate: async (app, docManager, translator, stateDB, info) => {
        const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.WidgetTracker({ namespace });
        const createFileBrowser = (id, options = {}) => {
            var _a, _b;
            const state = options.state === null
                ? undefined
                : options.state || stateDB || undefined;
            const model = new _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.FilterFileBrowserModel({
                translator: translator,
                auto: (_a = options.auto) !== null && _a !== void 0 ? _a : true,
                manager: docManager,
                driveName: options.driveName || '',
                refreshInterval: options.refreshInterval,
                refreshStandby: () => {
                    if (info) {
                        return !info.isConnected || 'when-hidden';
                    }
                    return 'when-hidden';
                },
                state,
                allowFileUploads: (_b = options.allowFileUploads) !== null && _b !== void 0 ? _b : true
            });
            const restore = options.restore;
            const widget = new _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.FileBrowser({ id, model, restore, translator, state });
            // Track the newly created file browser.
            void tracker.add(widget);
            return widget;
        };
        return { createFileBrowser, tracker };
    }
};
/**
 * The default file browser factory provider.
 */
const defaultFileBrowser = {
    id: '@jupyterlab/filebrowser-extension:default-file-browser',
    description: 'Provides the default file browser',
    provides: _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IDefaultFileBrowser,
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__.IRouter, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__.JupyterFrontEnd.ITreeResolver, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__.ILabShell, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    activate: async (app, fileBrowserFactory, router, tree, labShell, translator) => {
        const { commands } = app;
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.nullTranslator).load('jupyterlab');
        // Manually restore and load the default file browser.
        const defaultBrowser = fileBrowserFactory.createFileBrowser('filebrowser', {
            auto: false,
            restore: false
        });
        // Set attributes when adding the browser to the UI
        defaultBrowser.node.setAttribute('role', 'region');
        defaultBrowser.node.setAttribute('aria-label', trans.__('File Browser Section'));
        defaultBrowser.title.icon = _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.folderIcon;
        // Show the current file browser shortcut in its title.
        const updateBrowserTitle = () => {
            const binding = app.commands.keyBindings.find(b => b.command === CommandIDs.toggleBrowser);
            if (binding) {
                const ks = binding.keys.map(_lumino_commands__WEBPACK_IMPORTED_MODULE_13__.CommandRegistry.formatKeystroke).join(', ');
                defaultBrowser.title.caption = trans.__('File Browser (%1)', ks);
            }
            else {
                defaultBrowser.title.caption = trans.__('File Browser');
            }
        };
        updateBrowserTitle();
        app.commands.keyBindingChanged.connect(() => {
            updateBrowserTitle();
        });
        void Private.restoreBrowser(defaultBrowser, commands, router, tree, app, labShell);
        return defaultBrowser;
    }
};
/**
 * A plugin providing download + copy download link commands in the context menu.
 *
 * Disabling this plugin will NOT disable downloading files from the server.
 * Users will still be able to retrieve files from the file download URLs the
 * server provides.
 */
const downloadPlugin = {
    id: '@jupyterlab/filebrowser-extension:download',
    description: 'Adds the download file commands. Disabling this plugin will NOT disable downloading files from the server, if the user enters the appropriate download URLs.',
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    autoStart: true,
    activate: (app, factory, translator) => {
        const trans = translator.load('jupyterlab');
        const { commands } = app;
        const { tracker } = factory;
        commands.addCommand(CommandIDs.download, {
            execute: () => {
                const widget = tracker.currentWidget;
                if (widget) {
                    return widget.download();
                }
            },
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.downloadIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Download'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.copyDownloadLink, {
            execute: () => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                return widget.model.manager.services.contents
                    .getDownloadUrl(widget.selectedItems().next().value.path)
                    .then(url => {
                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copyToSystem(url);
                });
            },
            isVisible: () => 
            // So long as this command only handles one file at time, don't show it
            // if multiple files are selected.
            !!tracker.currentWidget &&
                Array.from(tracker.currentWidget.selectedItems()).length === 1,
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.copyIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Copy Download Link'),
            mnemonic: 0,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
    }
};
/**
 * A plugin providing the context menu entries for creating Python/R/Julia files.
 */
const createNewLanguageFilePlugin = {
    id: '@jupyterlab/filebrowser-extension:create-new-language-file',
    description: 'Adds context menu entries for creating Python/R/Julia files',
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    autoStart: true,
    activate: async (app, translator) => {
        const trans = translator.load('jupyterlab');
        let filebrowsermenuDisposables = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__.DisposableSet();
        const specsManager = app.serviceManager.kernelspecs;
        const updateFileBrowserContextMenu = async () => {
            var _a, _b;
            if (filebrowsermenuDisposables) {
                filebrowsermenuDisposables.dispose();
                filebrowsermenuDisposables = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__.DisposableSet();
            }
            const updatedFileTypes = await (0,_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_5__.getAvailableKernelFileTypes)(specsManager);
            for (const filetype of updatedFileTypes) {
                filebrowsermenuDisposables.add(app.contextMenu.addItem({
                    command: CommandIDs.createNewFile,
                    selector: '.jp-DirListing-content',
                    args: {
                        ext: filetype.extensions[0],
                        label: trans.__('New %1 File', filetype.displayName),
                        iconName: (_b = (_a = filetype.icon) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''
                    },
                    rank: 52
                }));
            }
        };
        specsManager.specsChanged.connect(updateFileBrowserContextMenu);
        updateFileBrowserContextMenu().catch(console.warn);
    }
};
/**
 * A plugin to add the file browser widget to an ILabShell
 */
const browserWidget = {
    id: '@jupyterlab/filebrowser-extension:widget',
    description: 'Adds the file browser to the application shell.',
    requires: [
        _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_4__.IDocumentManager,
        _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IDefaultFileBrowser,
        _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_7__.ISettingRegistry,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.IToolbarWidgetRegistry,
        _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator,
        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_1__.ILabShell,
        _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserCommands
    ],
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.ICommandPalette],
    autoStart: true,
    activate: (app, docManager, browser, factory, settingRegistry, toolbarRegistry, translator, labShell, 
    // Wait until file browser commands are ready before activating file browser widget
    fileBrowserCommands, commandPalette) => {
        const { commands } = app;
        const { tracker } = factory;
        const trans = translator.load('jupyterlab');
        // Top-level toolbar
        toolbarRegistry.addFactory(FILE_BROWSER_FACTORY, 'uploader', (browser) => new _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.Uploader({ model: browser.model, translator }));
        (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.setToolbar)(browser, (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.createToolbarFactory)(toolbarRegistry, settingRegistry, FILE_BROWSER_FACTORY, browserWidget.id, translator));
        labShell.add(browser, 'left', { rank: 100, type: 'File Browser' });
        commands.addCommand(CommandIDs.toggleBrowser, {
            label: trans.__('File Browser'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                if (browser.isHidden) {
                    return commands.execute(CommandIDs.showBrowser, void 0);
                }
                return commands.execute(CommandIDs.hideBrowser, void 0);
            }
        });
        commands.addCommand(CommandIDs.showBrowser, {
            label: trans.__('Open the file browser for the provided `path`.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        path: {
                            type: 'string',
                            description: trans.__('The path to open in the file browser')
                        }
                    }
                }
            },
            execute: args => {
                const path = args.path || '';
                const browserForPath = Private.getBrowserForPath(path, browser, factory);
                // Check for browser not found
                if (!browserForPath) {
                    return;
                }
                // Shortcut if we are using the main file browser
                if (browser === browserForPath) {
                    labShell.activateById(browser.id);
                    return;
                }
                else {
                    const areas = ['left', 'right'];
                    for (const area of areas) {
                        for (const widget of labShell.widgets(area)) {
                            if (widget.contains(browserForPath)) {
                                labShell.activateById(widget.id);
                                return;
                            }
                        }
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.hideBrowser, {
            label: trans.__('Hide the file browser.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                const widget = tracker.currentWidget;
                if (widget && !widget.isHidden) {
                    labShell.collapseLeft();
                }
            }
        });
        commands.addCommand(CommandIDs.toggleNavigateToCurrentDirectory, {
            label: trans.__('Show Active File in File Browser'),
            isToggled: () => browser.navigateToCurrentDirectory,
            execute: () => {
                const value = !browser.navigateToCurrentDirectory;
                const key = 'navigateToCurrentDirectory';
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set navigateToCurrentDirectory setting`);
                });
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        if (commandPalette) {
            commandPalette.addItem({
                command: CommandIDs.toggleNavigateToCurrentDirectory,
                category: trans.__('File Operations')
            });
        }
        // If the layout is a fresh session without saved data and not in single document
        // mode, open file browser.
        void labShell.restored.then(layout => {
            if (layout.fresh && labShell.mode !== 'single-document') {
                void commands.execute(CommandIDs.showBrowser, void 0);
            }
        });
        void Promise.all([app.restored, browser.model.restored]).then(() => {
            // Whether to automatically navigate to a document's current directory
            labShell.currentChanged.connect(async (_, change) => {
                if (browser.navigateToCurrentDirectory && change.newValue) {
                    const { newValue } = change;
                    const context = docManager.contextForWidget(newValue);
                    if (context) {
                        const { path } = context;
                        try {
                            await Private.navigateToPath(path, browser, factory, translator);
                        }
                        catch (reason) {
                            console.warn(`${CommandIDs.goToPath} failed to open: ${path}`, reason);
                        }
                    }
                }
            });
        });
    }
};
/**
 * The default file browser share-file plugin
 *
 * This extension adds a "Copy Shareable Link" command that generates a copy-
 * pastable URL. This url can be used to open a particular file in JupyterLab,
 * handy for emailing links or bookmarking for reference.
 *
 * If you need to change how this link is generated (for instance, to copy a
 * /user-redirect URL for JupyterHub), disable this plugin and replace it
 * with another implementation.
 */
const shareFile = {
    id: '@jupyterlab/filebrowser-extension:share-file',
    description: 'Adds the "Copy Shareable Link" command; useful for JupyterHub deployment for example.',
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    autoStart: true,
    activate: (app, factory, translator) => {
        const trans = translator.load('jupyterlab');
        const { commands } = app;
        const { tracker } = factory;
        commands.addCommand(CommandIDs.copyShareableLink, {
            execute: () => {
                const widget = tracker.currentWidget;
                const model = widget === null || widget === void 0 ? void 0 : widget.selectedItems().next();
                if (model === undefined || model.done) {
                    return;
                }
                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copyToSystem(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.getUrl({
                    workspace: _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.defaultWorkspace,
                    treePath: model.value.path,
                    toShare: true
                }));
            },
            isVisible: () => !!tracker.currentWidget &&
                Array.from(tracker.currentWidget.selectedItems()).length === 1,
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.linkIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Copy Shareable Link'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
    }
};
/**
 * The "Open With" context menu.
 *
 * This is its own plugin in case you would like to disable this feature.
 * e.g. jupyter labextension disable @jupyterlab/filebrowser-extension:open-with
 */
const openWithPlugin = {
    id: '@jupyterlab/filebrowser-extension:open-with',
    description: 'Adds the open-with feature allowing an user to pick the non-preferred document viewer.',
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory],
    autoStart: true,
    activate: (app, factory) => {
        const { docRegistry } = app;
        const { tracker } = factory;
        let items = [];
        function updateOpenWithMenu(contextMenu) {
            var _a, _b;
            const openWith = (_b = (_a = contextMenu.menu.items.find(item => {
                var _a;
                return item.type === 'submenu' &&
                    ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-contextmenu-open-with';
            })) === null || _a === void 0 ? void 0 : _a.submenu) !== null && _b !== void 0 ? _b : null;
            if (!openWith) {
                return; // Bail early if the open with menu is not displayed
            }
            // clear the current menu items
            items.forEach(item => item.dispose());
            items.length = 0;
            // Ensure that the menu is empty
            openWith.clearItems();
            // get the widget factories that could be used to open all of the items
            // in the current filebrowser selection
            const factories = tracker.currentWidget
                ? Private.OpenWith.intersection((0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_12__.map)(tracker.currentWidget.selectedItems(), i => {
                    return Private.OpenWith.getFactories(docRegistry, i);
                }))
                : new Set();
            // make new menu items from the widget factories
            items = [...factories].map(factory => openWith.addItem({
                args: { factory: factory.name, label: factory.label || factory.name },
                command: CommandIDs.open
            }));
        }
        app.contextMenu.opened.connect(updateOpenWithMenu);
    }
};
/**
 * The "Open in New Browser Tab" context menu.
 *
 * This is its own plugin in case you would like to disable this feature.
 * e.g. jupyter labextension disable @jupyterlab/filebrowser-extension:open-browser-tab
 *
 * Note: If disabling this, you may also want to disable:
 * @jupyterlab/docmanager-extension:open-browser-tab
 */
const openBrowserTabPlugin = {
    id: '@jupyterlab/filebrowser-extension:open-browser-tab',
    description: 'Adds the open-in-new-browser-tab features.',
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    autoStart: true,
    activate: (app, factory, translator) => {
        const { commands } = app;
        const trans = translator.load('jupyterlab');
        const { tracker } = factory;
        commands.addCommand(CommandIDs.openBrowserTab, {
            execute: args => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                const mode = args['mode'];
                return Promise.all(Array.from((0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_12__.map)(widget.selectedItems(), item => {
                    if (mode === 'single-document') {
                        const url = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.getUrl({
                            mode: 'single-document',
                            treePath: item.path
                        });
                        const opened = window.open();
                        if (opened) {
                            opened.opener = null;
                            opened.location.href = url;
                        }
                        else {
                            throw new Error('Failed to open new browser tab.');
                        }
                    }
                    else {
                        return commands.execute('docmanager:open-browser-tab', {
                            path: item.path
                        });
                    }
                })));
            },
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.addIcon.bindprops({ stylesheet: 'menuItem' }),
            label: args => args['mode'] === 'single-document'
                ? trans.__('Open in Simple Mode')
                : trans.__('Open in New Browser Tab'),
            mnemonic: 0,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        mode: {
                            type: 'string',
                            description: trans.__('Mode for opening files (e.g., single-document)')
                        }
                    }
                }
            }
        });
    }
};
/**
 * A plugin providing file upload status.
 */
const fileUploadStatus = {
    id: '@jupyterlab/filebrowser-extension:file-upload-status',
    description: 'Adds a file upload status widget.',
    autoStart: true,
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IFileBrowserFactory, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    optional: [_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_9__.IStatusBar],
    activate: (app, browser, translator, statusBar) => {
        if (!statusBar) {
            // Automatically disable if statusbar missing
            return;
        }
        const item = new _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.FileUploadStatus({
            tracker: browser.tracker,
            translator
        });
        statusBar.registerStatusItem('@jupyterlab/filebrowser-extension:file-upload-status', {
            item,
            align: 'middle',
            isActive: () => {
                return !!item.model && item.model.items.length > 0;
            },
            activeStateChanged: item.model.stateChanged
        });
    }
};
/**
 * A plugin to open files from remote URLs
 */
const openUrlPlugin = {
    id: '@jupyterlab/filebrowser-extension:open-url',
    description: 'Adds the feature "Open files from remote URLs".',
    autoStart: true,
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IDefaultFileBrowser, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.ICommandPalette],
    activate: (app, browser, translator, palette) => {
        const { commands } = app;
        const trans = translator.load('jupyterlab');
        const command = CommandIDs.openUrl;
        commands.addCommand(command, {
            label: args => args.url ? trans.__('Open %1', args.url) : trans.__('Open from URL…'),
            caption: args => args.url ? trans.__('Open %1', args.url) : trans.__('Open from URL'),
            execute: async (args) => {
                var _a, _b, _c;
                let url = (_a = args === null || args === void 0 ? void 0 : args.url) !== null && _a !== void 0 ? _a : '';
                if (!url) {
                    url =
                        (_b = (await _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.InputDialog.getText({
                            label: trans.__('URL'),
                            placeholder: 'https://example.com/path/to/file',
                            title: trans.__('Open URL'),
                            okLabel: trans.__('Open')
                        })).value) !== null && _b !== void 0 ? _b : undefined;
                }
                if (!url) {
                    return;
                }
                let type = '';
                let blob;
                // fetch the file from the URL
                try {
                    const req = await fetch(url);
                    blob = await req.blob();
                    type = (_c = req.headers.get('Content-Type')) !== null && _c !== void 0 ? _c : '';
                }
                catch (reason) {
                    if (reason.response && reason.response.status !== 200) {
                        reason.message = trans.__('Could not open URL: %1', url);
                    }
                    return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.showErrorMessage)(trans.__('Cannot fetch'), reason);
                }
                // upload the content of the file to the server
                try {
                    const name = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PathExt.basename(url);
                    const file = new File([blob], name, { type });
                    const model = await browser.model.upload(file);
                    return commands.execute('docmanager:open', {
                        path: model.path
                    });
                }
                catch (error) {
                    return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.showErrorMessage)(trans._p('showErrorMessage', 'Upload Error'), error);
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        url: {
                            type: 'string',
                            description: trans.__('URL of the file to open')
                        }
                    }
                }
            }
        });
        if (palette) {
            palette.addItem({
                command,
                category: trans.__('File Operations')
            });
        }
    }
};
const notifyUploadPlugin = {
    id: '@jupyterlab/filebrowser-extension:notify-upload',
    requires: [_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.IDefaultFileBrowser, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_7__.ISettingRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_10__.ITranslator],
    description: 'Adds feature to auto-open supported files after upload',
    autoStart: true,
    activate: async (app, defaultBrowser, settingRegistry, translator) => {
        const trans = translator.load('jupyterlab');
        // load and watch settings
        const settings = await settingRegistry.load(FILE_BROWSER_PLUGIN_ID);
        let autoOpen = settings.get('autoOpenUploads').composite;
        let maxSize = settings.get('maxAutoOpenSizeMB').composite * 1024 * 1024;
        settings.changed.connect(() => {
            autoOpen = settings.get('autoOpenUploads').composite;
            maxSize =
                settings.get('maxAutoOpenSizeMB').composite * 1024 * 1024;
        });
        // attach to the Uploader after restore
        void app.restored.then(() => {
            const widgets = Array.from(defaultBrowser.toolbar.children());
            const uploader = widgets.find(w => w instanceof _jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.Uploader);
            if (!uploader) {
                console.warn('Uploader widget not found');
                return;
            }
            uploader.filesUploaded.connect((_sender, models) => {
                // single-file case
                // Get all allowed extensions
                const allFileTypes = Array.from(app.docRegistry.fileTypes());
                const allExtensions = allFileTypes.reduce((acc, ft) => {
                    if (ft.extensions) {
                        for (const ext of ft.extensions) {
                            acc.push(ext.toLowerCase());
                        }
                    }
                    return acc;
                }, []);
                // Check if the uploaded file has an allowed extension
                const fileName = models[0].name.toLowerCase();
                const isAllowedFileType = allExtensions.some(ext => fileName.endsWith(ext));
                if (models.length === 1 &&
                    (models[0].type === 'notebook' || models[0].type === 'file')) {
                    const file = models[0];
                    if (autoOpen &&
                        file.size &&
                        file.size <= maxSize &&
                        isAllowedFileType) {
                        // open immediately
                        app.commands
                            .execute('docmanager:open', { path: file.path })
                            .catch(err => {
                            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.showErrorMessage)(`Opening ${file.name} failed`, err);
                        });
                    }
                    else {
                        // notify and offer an "Open" button
                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Notification.emit(trans.__('Uploaded %1%2', file.name, file.size ? ` (${(0,_jupyterlab_filebrowser__WEBPACK_IMPORTED_MODULE_6__.formatFileSize)(file.size, 1, 1024)})` : ''), 'info', {
                            autoClose: 5000,
                            actions: [
                                {
                                    label: trans.__('Open File'),
                                    callback: () => {
                                        void app.commands
                                            .execute('docmanager:open', { path: file.path })
                                            .catch(err => {
                                            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.showErrorMessage)(`Could not open ${file.name}`, err);
                                        });
                                    }
                                }
                            ]
                        });
                    }
                }
                else {
                    // multi-file case
                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Notification.emit(trans.__('Upload complete (%1 files)', models.length), 'info', {
                        autoClose: 5000,
                        actions: [
                            {
                                label: trans.__('Open All'),
                                callback: () => {
                                    models.forEach(m => void app.commands
                                        .execute('docmanager:open', { path: m.path })
                                        .catch(err => {
                                        void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.showErrorMessage)(`Could not open ${m.path}`, err);
                                    }));
                                }
                            }
                        ]
                    });
                }
            });
        });
    }
};
/**
 * Add the main file browser commands to the application's command registry.
 */
function addCommands(app, browser, factory, translator, settingRegistry, commandPalette) {
    const trans = translator.load('jupyterlab');
    const { docRegistry: registry, commands } = app;
    const { tracker } = factory;
    const deleteToTrash = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.getOption('delete_to_trash') === 'true';
    commands.addCommand(CommandIDs.del, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.delete();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.closeIcon.bindprops({ stylesheet: 'menuItem' }),
        label: deleteToTrash ? trans.__('Move to Trash') : trans.__('Delete'),
        mnemonic: 0,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.copy, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.copy();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.copyIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Copy'),
        mnemonic: 0,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.cut, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.cut();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.cutIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Cut'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.duplicate, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.duplicate();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.copyIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Duplicate'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.selectAll, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.selectAll();
            }
        },
        label: trans.__('Select All'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.goToPath, {
        label: trans.__('Update the file browser to display the provided `path`.'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: trans.__('The path to navigate to')
                    },
                    dontShowBrowser: {
                        type: 'boolean',
                        description: trans.__('Whether to avoid showing the browser')
                    }
                }
            }
        },
        execute: async (args) => {
            var _a;
            const path = args.path || '';
            const showBrowser = !((_a = args === null || args === void 0 ? void 0 : args.dontShowBrowser) !== null && _a !== void 0 ? _a : false);
            try {
                const item = await Private.navigateToPath(path, browser, factory, translator);
                if (item.type !== 'directory' && showBrowser) {
                    const browserForPath = Private.getBrowserForPath(path, browser, factory);
                    if (browserForPath) {
                        browserForPath.clearSelectedItems();
                        const parts = path.split('/');
                        const name = parts[parts.length - 1];
                        if (name) {
                            await browserForPath.selectItemByName(name);
                        }
                    }
                }
            }
            catch (reason) {
                console.warn(`${CommandIDs.goToPath} failed to go to: ${path}`, reason);
            }
            if (showBrowser) {
                return commands.execute(CommandIDs.showBrowser, { path });
            }
        }
    });
    commands.addCommand(CommandIDs.goUp, {
        label: 'go up',
        execute: async () => {
            const browserForPath = Private.getBrowserForPath('', browser, factory);
            if (!browserForPath) {
                return;
            }
            const { model } = browserForPath;
            await model.restored;
            void browserForPath.goUp();
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.openPath, {
        label: args => args.path ? trans.__('Open %1', args.path) : trans.__('Open from Path…'),
        caption: args => args.path ? trans.__('Open %1', args.path) : trans.__('Open from path'),
        execute: async (args) => {
            var _a;
            let path;
            if (args === null || args === void 0 ? void 0 : args.path) {
                path = args.path;
            }
            else {
                path =
                    (_a = (await _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.InputDialog.getText({
                        label: trans.__('Path'),
                        placeholder: '/path/relative/to/jlab/root',
                        title: trans.__('Open Path'),
                        okLabel: trans.__('Open')
                    })).value) !== null && _a !== void 0 ? _a : undefined;
            }
            if (!path) {
                return;
            }
            try {
                const trailingSlash = path !== '/' && path.endsWith('/');
                if (trailingSlash) {
                    // The normal contents service errors on paths ending in slash
                    path = path.slice(0, path.length - 1);
                }
                const browserForPath = Private.getBrowserForPath(path, browser, factory);
                const { services } = browserForPath.model.manager;
                const item = await services.contents.get(path, {
                    content: false
                });
                if (trailingSlash && item.type !== 'directory') {
                    throw new Error(`Path ${path}/ is not a directory`);
                }
                await commands.execute(CommandIDs.goToPath, {
                    path,
                    dontShowBrowser: args.dontShowBrowser
                });
                if (item.type === 'directory') {
                    return;
                }
                return commands.execute('docmanager:open', { path });
            }
            catch (reason) {
                if (reason.response && reason.response.status === 404) {
                    reason.message = trans.__('Could not find path: %1', path);
                }
                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.showErrorMessage)(trans.__('Cannot open'), reason);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: trans.__('Path to the file or directory to open')
                    },
                    dontShowBrowser: {
                        type: 'boolean',
                        description: trans.__('Whether to avoid showing the file browser')
                    }
                }
            }
        }
    });
    // Add the openPath command to the command palette
    if (commandPalette) {
        commandPalette.addItem({
            command: CommandIDs.openPath,
            category: trans.__('File Operations')
        });
    }
    commands.addCommand(CommandIDs.open, {
        execute: args => {
            const factory = args['factory'] || void 0;
            const widget = tracker.currentWidget;
            if (!widget) {
                return;
            }
            const { contents } = widget.model.manager.services;
            return Promise.all(Array.from((0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_12__.map)(widget.selectedItems(), item => {
                if (item.type === 'directory') {
                    const localPath = contents.localPath(item.path);
                    return widget.model.cd(`/${localPath}`);
                }
                return commands.execute('docmanager:open', {
                    factory: factory,
                    path: item.path,
                    kernelPreference: args['kernelPreference']
                });
            })));
        },
        icon: args => {
            var _a;
            const factory = args['factory'] || void 0;
            if (factory) {
                // if an explicit factory is passed...
                const ft = registry.getFileType(factory);
                // ...set an icon if the factory name corresponds to a file type name...
                // ...or leave the icon blank
                return (_a = ft === null || ft === void 0 ? void 0 : ft.icon) === null || _a === void 0 ? void 0 : _a.bindprops({ stylesheet: 'menuItem' });
            }
            else {
                return _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.folderIcon.bindprops({ stylesheet: 'menuItem' });
            }
        },
        label: args => (args['label'] || args['factory'] || trans.__('Open')),
        mnemonic: 0,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    factory: {
                        type: 'string',
                        description: trans.__('The name of the widget factory to use')
                    },
                    label: {
                        type: 'string',
                        description: trans.__('The label to display for the command')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.paste, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.paste();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.pasteIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Paste'),
        mnemonic: 0,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.createNewDirectory, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.createNewDirectory();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.newFolderIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('New Folder'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.createNewFile, {
        execute: (args) => {
            var _a;
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.createNewFile({ ext: (_a = args.ext) !== null && _a !== void 0 ? _a : 'txt' });
            }
        },
        icon: (args) => {
            return args.iconName
                ? _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.LabIcon.resolve({ icon: args.iconName })
                : _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.textEditorIcon.bindprops({ stylesheet: 'menuItem' });
        },
        label: (args) => {
            var _a;
            return trans.__((_a = args.label) !== null && _a !== void 0 ? _a : 'New File');
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    label: {
                        type: 'string',
                        default: 'New File',
                        description: trans.__('The command label.')
                    },
                    iconName: {
                        type: 'string',
                        description: trans.__('The command icon.')
                    },
                    ext: {
                        type: 'string',
                        default: 'txt',
                        description: trans.__('The file extension.')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.createNewMarkdownFile, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.createNewFile({ ext: 'md' });
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.markdownIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('New Markdown File'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.refresh, {
        execute: args => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.model.refresh();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.refreshIcon.bindprops({ stylesheet: 'menuItem' }),
        caption: trans.__('Refresh the file browser.'),
        label: trans.__('Refresh File List'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.rename, {
        execute: args => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.rename();
            }
        },
        isVisible: () => 
        // So long as this command only handles one file at time, don't show it
        // if multiple files are selected.
        !!tracker.currentWidget &&
            Array.from(tracker.currentWidget.selectedItems()).length === 1,
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.editIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Rename'),
        mnemonic: 0,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.copyPath, {
        execute: () => {
            var _a;
            const widget = tracker.currentWidget;
            if (!widget) {
                return;
            }
            const item = widget.selectedItems().next();
            if (item.done) {
                return;
            }
            if (_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.getOption('copyAbsolutePath') === 'true') {
                const absolutePath = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PathExt.joinWithLeadingSlash((_a = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.getOption('serverRoot')) !== null && _a !== void 0 ? _a : '', item.value.path);
                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copyToSystem(absolutePath);
            }
            else {
                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copyToSystem(item.value.path);
            }
        },
        isVisible: () => 
        // So long as this command only handles one file at time, don't show it
        // if multiple files are selected.
        !!tracker.currentWidget &&
            Array.from(tracker.currentWidget.selectedItems()).length === 1,
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.fileIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Copy Path'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.shutdown, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (widget) {
                return widget.shutdownKernels();
            }
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.stopIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Shut Down Kernel'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleFileFilter, {
        execute: () => {
            // Update toggled state, then let the toolbar button update
            browser.showFileFilter = !browser.showFileFilter;
            commands.notifyCommandChanged(CommandIDs.toggleFileFilter);
        },
        isToggled: () => {
            const toggled = browser.showFileFilter;
            return toggled;
        },
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_11__.filterIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Toggle File Filter'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleLastModified, {
        label: trans.__('Show Last Modified Column'),
        isToggled: () => browser.showLastModifiedColumn,
        execute: () => {
            const value = !browser.showLastModifiedColumn;
            const key = 'showLastModifiedColumn';
            if (settingRegistry) {
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set ${key} setting`);
                });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleShowFullPath, {
        label: trans.__('Show Full Path'),
        isToggled: () => browser.showFullPath,
        execute: () => {
            const value = !browser.showFullPath;
            const key = 'showFullPath';
            if (settingRegistry) {
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set ${key} setting`);
                });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleSortNotebooksFirst, {
        label: trans.__('Sort Notebooks Above Files'),
        isToggled: () => browser.sortNotebooksFirst,
        execute: () => {
            const value = !browser.sortNotebooksFirst;
            const key = 'sortNotebooksFirst';
            if (settingRegistry) {
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set ${key} setting`);
                });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleFileSize, {
        label: trans.__('Show File Size Column'),
        isToggled: () => browser.showFileSizeColumn,
        execute: () => {
            const value = !browser.showFileSizeColumn;
            const key = 'showFileSizeColumn';
            if (settingRegistry) {
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set ${key} setting`);
                });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleSingleClick, {
        label: trans.__('Enable Single Click Navigation'),
        isToggled: () => browser.singleClickNavigation,
        execute: () => {
            const value = !browser.singleClickNavigation;
            const key = 'singleClickNavigation';
            if (settingRegistry) {
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set singleClickNavigation setting`);
                });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleHiddenFiles, {
        label: trans.__('Show Hidden Files'),
        isToggled: () => browser.showHiddenFiles,
        isVisible: () => _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PageConfig.getOption('allow_hidden_files') === 'true',
        execute: () => {
            const value = !browser.showHiddenFiles;
            const key = 'showHiddenFiles';
            if (settingRegistry) {
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set showHiddenFiles setting`);
                });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleFileCheckboxes, {
        label: trans.__('Show File Checkboxes'),
        isToggled: () => browser.showFileCheckboxes,
        execute: () => {
            const value = !browser.showFileCheckboxes;
            const key = 'showFileCheckboxes';
            if (settingRegistry) {
                return settingRegistry
                    .set(FILE_BROWSER_PLUGIN_ID, key, value)
                    .catch((reason) => {
                    console.error(`Failed to set showFileCheckboxes setting`);
                });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
}
/**
 * Export the plugins as default.
 */
const plugins = [
    factory,
    defaultFileBrowser,
    browser,
    browserSettings,
    shareFile,
    fileUploadStatus,
    downloadPlugin,
    browserWidget,
    openWithPlugin,
    openBrowserTabPlugin,
    openUrlPlugin,
    notifyUploadPlugin,
    createNewLanguageFilePlugin
];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);
/**
 * A namespace for private module data.
 */
var Private;
(function (Private) {
    /**
     * Get browser object given file path.
     */
    function getBrowserForPath(path, browser, factory) {
        const { tracker } = factory;
        const driveName = browser.model.manager.services.contents.driveName(path);
        if (driveName) {
            const browserForPath = tracker.find(_path => _path.model.driveName === driveName);
            if (!browserForPath) {
                // warn that no filebrowser could be found for this driveName
                console.warn(`${CommandIDs.goToPath} failed to find filebrowser for path: ${path}`);
                return;
            }
            return browserForPath;
        }
        // if driveName is empty, assume the main filebrowser
        return browser;
    }
    Private.getBrowserForPath = getBrowserForPath;
    /**
     * Navigate to a path or the path containing a file.
     */
    async function navigateToPath(path, browser, factory, translator) {
        const trans = translator.load('jupyterlab');
        const browserForPath = Private.getBrowserForPath(path, browser, factory);
        if (!browserForPath) {
            throw new Error(trans.__('No browser for path'));
        }
        const { services } = browserForPath.model.manager;
        const localPath = services.contents.localPath(path);
        await services.ready;
        const item = await services.contents.get(path, { content: false });
        const { model } = browserForPath;
        await model.restored;
        if (item.type === 'directory') {
            await model.cd(`/${localPath}`);
        }
        else {
            await model.cd(`/${_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_3__.PathExt.dirname(localPath)}`);
        }
        return item;
    }
    Private.navigateToPath = navigateToPath;
    /**
     * Restores file browser state and overrides state if tree resolver resolves.
     */
    async function restoreBrowser(browser, commands, router, tree, app, labShell) {
        const restoring = 'jp-mod-restoring';
        browser.addClass(restoring);
        if (!router) {
            await browser.model.restore(browser.id);
            await browser.model.refresh();
            browser.removeClass(restoring);
            return;
        }
        const listener = async () => {
            router.routed.disconnect(listener);
            const paths = await (tree === null || tree === void 0 ? void 0 : tree.paths);
            if ((paths === null || paths === void 0 ? void 0 : paths.file) || (paths === null || paths === void 0 ? void 0 : paths.browser)) {
                // Restore the model without populating it.
                await browser.model.restore(browser.id, false);
                if (paths.file) {
                    await commands.execute(CommandIDs.openPath, {
                        path: paths.file,
                        dontShowBrowser: true
                    });
                }
                if (paths.browser) {
                    await commands.execute(CommandIDs.openPath, {
                        path: paths.browser,
                        dontShowBrowser: true
                    });
                }
            }
            else {
                await browser.model.restore(browser.id);
                await browser.model.refresh();
            }
            browser.removeClass(restoring);
            if (labShell === null || labShell === void 0 ? void 0 : labShell.isEmpty('main')) {
                void commands.execute('launcher:create');
            }
        };
        router.routed.connect(listener);
    }
    Private.restoreBrowser = restoreBrowser;
    let OpenWith;
    (function (OpenWith) {
        /**
         * Get the factories for the selected item
         *
         * @param docRegistry Application document registry
         * @param item Selected item model
         * @returns Available factories for the model
         */
        function getFactories(docRegistry, item) {
            const factories = docRegistry.preferredWidgetFactories(item.path);
            const notebookFactory = docRegistry.getWidgetFactory('notebook');
            if (notebookFactory &&
                item.type === 'notebook' &&
                factories.indexOf(notebookFactory) === -1) {
                factories.unshift(notebookFactory);
            }
            return factories;
        }
        OpenWith.getFactories = getFactories;
        /**
         * Return the intersection of multiple iterables.
         *
         * @param iterables Iterator of iterables
         * @returns Set of common elements to all iterables
         */
        function intersection(iterables) {
            let accumulator = undefined;
            for (const current of iterables) {
                // Initialize accumulator.
                if (accumulator === undefined) {
                    accumulator = new Set(current);
                    continue;
                }
                // Return early if empty.
                if (accumulator.size === 0) {
                    return accumulator;
                }
                // Keep the intersection of accumulator and current.
                let intersection = new Set();
                for (const value of current) {
                    if (accumulator.has(value)) {
                        intersection.add(value);
                    }
                }
                accumulator = intersection;
            }
            return accumulator !== null && accumulator !== void 0 ? accumulator : new Set();
        }
        OpenWith.intersection = intersection;
    })(OpenWith = Private.OpenWith || (Private.OpenWith = {}));
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 39380:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js + 1 modules
var statusbar_style = __webpack_require__(546);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docmanager/style/index.js
var docmanager_style = __webpack_require__(81393);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/filebrowser/style/index.js + 1 modules
var filebrowser_style = __webpack_require__(40360);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/filebrowser-extension/style/base.css
var base = __webpack_require__(15272);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */












/***/ }),

/***/ 39341:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  BreadCrumbs: () => (/* reexport */ BreadCrumbs),
  CHUNK_SIZE: () => (/* reexport */ CHUNK_SIZE),
  DirListing: () => (/* reexport */ DirListing),
  FileBrowser: () => (/* reexport */ FileBrowser),
  FileBrowserModel: () => (/* reexport */ FileBrowserModel),
  FileDialog: () => (/* reexport */ FileDialog),
  FileUploadStatus: () => (/* reexport */ FileUploadStatus),
  FilterFileBrowserModel: () => (/* reexport */ FilterFileBrowserModel),
  IDefaultFileBrowser: () => (/* reexport */ IDefaultFileBrowser),
  IFileBrowserCommands: () => (/* reexport */ IFileBrowserCommands),
  IFileBrowserFactory: () => (/* reexport */ IFileBrowserFactory),
  LARGE_FILE_SIZE: () => (/* reexport */ LARGE_FILE_SIZE),
  TogglableHiddenFileBrowserModel: () => (/* reexport */ TogglableHiddenFileBrowserModel),
  Uploader: () => (/* reexport */ Uploader),
  formatFileSize: () => (/* reexport */ formatFileSize)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docmanager@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/docmanager/lib/index.js)
var docmanager_lib_index_js_ = __webpack_require__(64009);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/crumbs.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * The class name added to the breadcrumb node.
 */
const BREADCRUMB_CLASS = 'jp-BreadCrumbs';
/**
 * The class name for the breadcrumbs home node
 */
const BREADCRUMB_ROOT_CLASS = 'jp-BreadCrumbs-home';
/**
 * The class name for the breadcrumbs preferred node
 */
const BREADCRUMB_PREFERRED_CLASS = 'jp-BreadCrumbs-preferred';
/**
 * The class name added to the breadcrumb node.
 */
const BREADCRUMB_ITEM_CLASS = 'jp-BreadCrumbs-item';
/**
 * The class name for the breadcrumbs ellipsis node
 */
const BREADCRUMB_ELLIPSIS_CLASS = 'jp-BreadCrumbs-ellipsis';
/**
 * The mime type for a contents drag object.
 */
const CONTENTS_MIME = 'application/x-jupyter-icontents';
/**
 * The class name added to drop targets.
 */
const DROP_TARGET_CLASS = 'jp-mod-dropTarget';
/**
 * A class which hosts folder breadcrumbs.
 */
class BreadCrumbs extends dist_index_es6_js_.Widget {
    /**
     * Construct a new file browser crumb widget.
     *
     * @param options Constructor options.
     */
    constructor(options) {
        var _a, _b;
        super();
        this._previousState = null;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._model = options.model;
        this._fullPath = options.fullPath || false;
        this._minimumLeftItems = (_a = options.minimumLeftItems) !== null && _a !== void 0 ? _a : 0;
        this._minimumRightItems = (_b = options.minimumRightItems) !== null && _b !== void 0 ? _b : 2;
        this.addClass(BREADCRUMB_CLASS);
        this._crumbs = Private.createCrumbs();
        const hasPreferred = lib_index_js_.PageConfig.getOption('preferredPath');
        this._hasPreferred = hasPreferred && hasPreferred !== '/' ? true : false;
        if (this._hasPreferred) {
            this.node.appendChild(this._crumbs[Private.Crumb.Preferred]);
        }
        this.node.appendChild(this._crumbs[Private.Crumb.Home]);
        this._model.refreshed.connect(this.update, this);
    }
    /**
     * Handle the DOM events for the bread crumbs.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'click':
                this._evtClick(event);
                break;
            case 'lm-dragenter':
                this._evtDragEnter(event);
                break;
            case 'lm-dragleave':
                this._evtDragLeave(event);
                break;
            case 'lm-dragover':
                this._evtDragOver(event);
                break;
            case 'lm-drop':
                this._evtDrop(event);
                break;
            default:
                return;
        }
    }
    /**
     * Whether to show the full path in the breadcrumbs
     */
    get fullPath() {
        return this._fullPath;
    }
    set fullPath(value) {
        this._fullPath = value;
    }
    /**
     * Number of items to show on left of ellipsis
     */
    get minimumLeftItems() {
        return this._minimumLeftItems;
    }
    set minimumLeftItems(value) {
        this._minimumLeftItems = value;
    }
    /**
     * Number of items to show on right of ellipsis
     */
    get minimumRightItems() {
        return this._minimumRightItems;
    }
    set minimumRightItems(value) {
        this._minimumRightItems = value;
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        this.update();
        const node = this.node;
        node.addEventListener('click', this);
        node.addEventListener('lm-dragenter', this);
        node.addEventListener('lm-dragleave', this);
        node.addEventListener('lm-dragover', this);
        node.addEventListener('lm-drop', this);
    }
    /**
     * A message handler invoked on a `'before-detach'` message.
     */
    onBeforeDetach(msg) {
        super.onBeforeDetach(msg);
        const node = this.node;
        node.removeEventListener('click', this);
        node.removeEventListener('lm-dragenter', this);
        node.removeEventListener('lm-dragleave', this);
        node.removeEventListener('lm-dragover', this);
        node.removeEventListener('lm-drop', this);
    }
    /**
     * A handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        // Update the breadcrumb list.
        const contents = this._model.manager.services.contents;
        const localPath = contents.localPath(this._model.path);
        const state = {
            path: localPath,
            hasPreferred: this._hasPreferred,
            fullPath: this._fullPath,
            minimumLeftItems: this._minimumLeftItems,
            minimumRightItems: this._minimumRightItems
        };
        if (this._previousState && dist_index_js_.JSONExt.deepEqual(state, this._previousState)) {
            return;
        }
        this._previousState = state;
        Private.updateCrumbs(this._crumbs, state);
    }
    /**
     * Handle the `'click'` event for the widget.
     */
    _evtClick(event) {
        // Do nothing if it's not a left mouse press.
        if (event.button !== 0) {
            return;
        }
        // Find a valid click target.
        let node = event.target;
        while (node && node !== this.node) {
            if (node.classList.contains(BREADCRUMB_PREFERRED_CLASS)) {
                const preferredPath = lib_index_js_.PageConfig.getOption('preferredPath');
                const path = preferredPath ? '/' + preferredPath : preferredPath;
                this._model
                    .cd(path)
                    .catch(error => (0,index_js_.showErrorMessage)(this._trans.__('Open Error'), error));
                // Stop the event propagation.
                event.preventDefault();
                event.stopPropagation();
                return;
            }
            if (node.classList.contains(BREADCRUMB_ITEM_CLASS) ||
                node.classList.contains(BREADCRUMB_ROOT_CLASS)) {
                let destination;
                if (node.classList.contains(BREADCRUMB_ROOT_CLASS)) {
                    destination = '/';
                }
                else {
                    destination = `/${node.dataset.path}`;
                }
                if (destination) {
                    this._model
                        .cd(destination)
                        .catch(error => (0,index_js_.showErrorMessage)(this._trans.__('Open Error'), error));
                }
                // Stop the event propagation.
                event.preventDefault();
                event.stopPropagation();
                return;
            }
            node = node.parentElement;
        }
    }
    /**
     * Handle the `'lm-dragenter'` event for the widget.
     */
    _evtDragEnter(event) {
        if (event.mimeData.hasData(CONTENTS_MIME)) {
            const breadcrumbElements = this._getBreadcrumbElements();
            let index = -1;
            let target = event.target;
            while (target && target !== this.node) {
                index = breadcrumbElements.indexOf(target);
                if (index !== -1) {
                    break;
                }
                target = target.parentElement;
            }
            if (index !== -1) {
                const hitElement = breadcrumbElements[index];
                // Don't allow dropping on the current path
                const currentPath = this._model.manager.services.contents.localPath(this._model.path);
                if (hitElement.dataset.path !== currentPath) {
                    hitElement.classList.add(DROP_TARGET_CLASS);
                    event.preventDefault();
                    event.stopPropagation();
                }
            }
        }
    }
    /**
     * Handle the `'lm-dragleave'` event for the widget.
     */
    _evtDragLeave(event) {
        event.preventDefault();
        event.stopPropagation();
        const dropTarget = index_js_.DOMUtils.findElement(this.node, DROP_TARGET_CLASS);
        if (dropTarget) {
            dropTarget.classList.remove(DROP_TARGET_CLASS);
        }
    }
    /**
     * Handle the `'lm-dragover'` event for the widget.
     */
    _evtDragOver(event) {
        event.preventDefault();
        event.stopPropagation();
        event.dropAction = event.proposedAction;
        const dropTarget = index_js_.DOMUtils.findElement(this.node, DROP_TARGET_CLASS);
        if (dropTarget) {
            dropTarget.classList.remove(DROP_TARGET_CLASS);
        }
        const breadcrumbElements = this._getBreadcrumbElements();
        let index = -1;
        let target = event.target;
        while (target && target !== this.node) {
            index = breadcrumbElements.indexOf(target);
            if (index !== -1) {
                break;
            }
            target = target.parentElement;
        }
        if (index !== -1) {
            breadcrumbElements[index].classList.add(DROP_TARGET_CLASS);
        }
    }
    /**
     * Handle the `'lm-drop'` event for the widget.
     */
    _evtDrop(event) {
        event.preventDefault();
        event.stopPropagation();
        if (event.proposedAction === 'none') {
            event.dropAction = 'none';
            return;
        }
        if (!event.mimeData.hasData(CONTENTS_MIME)) {
            return;
        }
        event.dropAction = event.proposedAction;
        let target = event.target;
        while (target && target.parentElement) {
            if (target.classList.contains(DROP_TARGET_CLASS)) {
                target.classList.remove(DROP_TARGET_CLASS);
                break;
            }
            target = target.parentElement;
        }
        let destinationPath = null;
        if (target.classList.contains(BREADCRUMB_ROOT_CLASS)) {
            destinationPath = '/';
        }
        else if (target.classList.contains(BREADCRUMB_PREFERRED_CLASS)) {
            const preferredPath = lib_index_js_.PageConfig.getOption('preferredPath');
            destinationPath = preferredPath ? '/' + preferredPath : '/';
        }
        else if (target.dataset.path) {
            destinationPath = target.dataset.path;
        }
        if (!destinationPath) {
            return;
        }
        const model = this._model;
        const manager = model.manager;
        // Move all of the items.
        const promises = [];
        const oldPaths = event.mimeData.getData(CONTENTS_MIME);
        for (const oldPath of oldPaths) {
            const name = lib_index_js_.PathExt.basename(oldPath);
            const newPath = lib_index_js_.PathExt.join(destinationPath, name);
            promises.push((0,docmanager_lib_index_js_.renameFile)(manager, oldPath, newPath));
        }
        void Promise.all(promises).catch(err => {
            return (0,index_js_.showErrorMessage)(this._trans.__('Move Error'), err);
        });
    }
    /**
     * Get all breadcrumb elements that can be drop targets.
     */
    _getBreadcrumbElements() {
        const elements = [];
        const children = this.node.children;
        for (let i = 0; i < children.length; i++) {
            const child = children[i];
            if ((child.classList.contains(BREADCRUMB_ITEM_CLASS) ||
                child.classList.contains(BREADCRUMB_ROOT_CLASS) ||
                child.classList.contains(BREADCRUMB_PREFERRED_CLASS)) &&
                !child.classList.contains(BREADCRUMB_ELLIPSIS_CLASS)) {
                elements.push(child);
            }
        }
        return elements;
    }
}
/**
 * The namespace for the crumbs private data.
 */
var Private;
(function (Private) {
    /**
     * Breadcrumb item list enum.
     */
    let Crumb;
    (function (Crumb) {
        Crumb[Crumb["Home"] = 0] = "Home";
        Crumb[Crumb["Ellipsis"] = 1] = "Ellipsis";
        Crumb[Crumb["Preferred"] = 2] = "Preferred";
    })(Crumb = Private.Crumb || (Private.Crumb = {}));
    /**
     * Populate the breadcrumb node.
     */
    function updateCrumbs(breadcrumbs, state) {
        const node = breadcrumbs[0].parentNode;
        // Remove all but the home or preferred node.
        const firstChild = node.firstChild;
        while (firstChild && firstChild.nextSibling) {
            node.removeChild(firstChild.nextSibling);
        }
        if (state.hasPreferred) {
            node.appendChild(breadcrumbs[Crumb.Home]);
            node.appendChild(createCrumbSeparator());
        }
        else {
            node.appendChild(createCrumbSeparator());
        }
        const parts = state.path.split('/').filter(part => part !== '');
        if (!state.fullPath && parts.length > 0) {
            const minimumLeftItems = state.minimumLeftItems;
            const minimumRightItems = state.minimumRightItems;
            // Check if we need ellipsis
            if (parts.length > minimumLeftItems + minimumRightItems) {
                // Add left items
                for (let i = 0; i < minimumLeftItems; i++) {
                    const elemPath = parts.slice(0, i + 1).join('/');
                    const elem = createBreadcrumbElement(parts[i], elemPath);
                    node.appendChild(elem);
                    node.appendChild(createCrumbSeparator());
                }
                // Add ellipsis
                node.appendChild(breadcrumbs[Crumb.Ellipsis]);
                const hiddenStartIndex = minimumLeftItems;
                const hiddenEndIndex = parts.length - minimumRightItems;
                const hiddenParts = parts.slice(hiddenStartIndex, hiddenEndIndex);
                const hiddenFolders = hiddenParts.join('/');
                const hiddenPath = hiddenParts.length > 0
                    ? parts.slice(0, hiddenEndIndex).join('/')
                    : parts.slice(0, minimumLeftItems).join('/');
                breadcrumbs[Crumb.Ellipsis].title = hiddenFolders;
                breadcrumbs[Crumb.Ellipsis].dataset.path = hiddenPath;
                node.appendChild(createCrumbSeparator());
                // Add right items
                const rightStartIndex = parts.length - minimumRightItems;
                for (let i = rightStartIndex; i < parts.length; i++) {
                    const elemPath = parts.slice(0, i + 1).join('/');
                    const elem = createBreadcrumbElement(parts[i], elemPath);
                    node.appendChild(elem);
                    node.appendChild(createCrumbSeparator());
                }
            }
            else {
                for (let i = 0; i < parts.length; i++) {
                    const elemPath = parts.slice(0, i + 1).join('/');
                    const elem = createBreadcrumbElement(parts[i], elemPath);
                    node.appendChild(elem);
                    node.appendChild(createCrumbSeparator());
                }
            }
        }
        else if (state.fullPath && parts.length > 0) {
            for (let i = 0; i < parts.length; i++) {
                const elemPath = parts.slice(0, i + 1).join('/');
                const elem = createBreadcrumbElement(parts[i], elemPath);
                node.appendChild(elem);
                const separator = document.createElement('span');
                separator.textContent = '/';
                node.appendChild(separator);
            }
        }
    }
    Private.updateCrumbs = updateCrumbs;
    /**
     * Create a breadcrumb element for a path part.
     */
    function createBreadcrumbElement(pathPart, fullPath) {
        const elem = document.createElement('span');
        elem.className = BREADCRUMB_ITEM_CLASS;
        elem.textContent = pathPart;
        elem.title = fullPath;
        elem.dataset.path = fullPath;
        return elem;
    }
    /**
     * Create the breadcrumb nodes.
     */
    function createCrumbs() {
        const home = ui_components_lib_index_js_.folderIcon.element({
            className: BREADCRUMB_ROOT_CLASS,
            tag: 'span',
            title: lib_index_js_.PageConfig.getOption('serverRoot') || 'Jupyter Server Root',
            stylesheet: 'breadCrumb'
        });
        home.dataset.path = '/';
        const ellipsis = ui_components_lib_index_js_.ellipsesIcon.element({
            className: `${BREADCRUMB_ITEM_CLASS} ${BREADCRUMB_ELLIPSIS_CLASS}`,
            tag: 'span',
            stylesheet: 'breadCrumb'
        });
        const preferredPath = lib_index_js_.PageConfig.getOption('preferredPath');
        const path = preferredPath ? '/' + preferredPath : preferredPath;
        const preferred = ui_components_lib_index_js_.homeIcon.element({
            className: BREADCRUMB_PREFERRED_CLASS,
            tag: 'span',
            title: path || 'Jupyter Preferred Path',
            stylesheet: 'breadCrumb'
        });
        preferred.dataset.path = path || '/';
        return [home, ellipsis, preferred];
    }
    Private.createCrumbs = createCrumbs;
    /**
     * Create the breadcrumb separator nodes.
     */
    function createCrumbSeparator() {
        const item = document.createElement('span');
        item.textContent = '/';
        return item;
    }
    Private.createCrumbSeparator = createCrumbSeparator;
})(Private || (Private = {}));
//# sourceMappingURL=crumbs.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var domutils_dist_index_es6_js_ = __webpack_require__(19451);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/dragdrop@~2.1.8 (singleton) (fallback: ../node_modules/@lumino/dragdrop/dist/index.es6.js)
var dragdrop_dist_index_es6_js_ = __webpack_require__(58980);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/virtualdom@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/virtualdom/dist/index.es6.js)
var virtualdom_dist_index_es6_js_ = __webpack_require__(17197);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/listing.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.















/**
 * The class name added to DirListing widget.
 */
const DIR_LISTING_CLASS = 'jp-DirListing';
/**
 * The class name added to a dir listing header node.
 */
const HEADER_CLASS = 'jp-DirListing-header';
/**
 * The class name added to a dir listing list header cell.
 */
const HEADER_ITEM_CLASS = 'jp-DirListing-headerItem';
/**
 * The class name added to a header cell text node.
 */
const HEADER_ITEM_TEXT_CLASS = 'jp-DirListing-headerItemText';
/**
 * The class name added to a header cell icon node.
 */
const HEADER_ITEM_ICON_CLASS = 'jp-DirListing-headerItemIcon';
/**
 * The class name added to the dir listing content node.
 */
const CONTENT_CLASS = 'jp-DirListing-content';
/**
 * The class name added to dir listing content item.
 */
const ITEM_CLASS = 'jp-DirListing-item';
/**
 * The class name added to the listing item text cell.
 */
const ITEM_TEXT_CLASS = 'jp-DirListing-itemText';
/**
 * The class name added to the listing item text cell.
 */
const ITEM_NAME_COLUMN_CLASS = 'jp-DirListing-itemName';
/**
 * The class name added to the listing item icon cell.
 */
const ITEM_ICON_CLASS = 'jp-DirListing-itemIcon';
/**
 * The class name added to the listing item modified cell.
 */
const ITEM_MODIFIED_CLASS = 'jp-DirListing-itemModified';
/**
 * The class name added to the listing item file size cell.
 */
const ITEM_FILE_SIZE_CLASS = 'jp-DirListing-itemFileSize';
/**
 * The class name added to the label element that wraps each item's checkbox and
 * the header's check-all checkbox.
 */
const CHECKBOX_WRAPPER_CLASS = 'jp-DirListing-checkboxWrapper';
/**
 * The class name added to the dir listing editor node.
 */
const EDITOR_CLASS = 'jp-DirListing-editor';
/**
 * The class name added to the name column header cell.
 */
const NAME_ID_CLASS = 'jp-id-name';
/**
 * The class name added to the modified column header cell.
 */
const MODIFIED_ID_CLASS = 'jp-id-modified';
/**
 * The class name added to the file size column header cell.
 */
const FILE_SIZE_ID_CLASS = 'jp-id-filesize';
/**
 * The mime type for a contents drag object.
 */
const listing_CONTENTS_MIME = 'application/x-jupyter-icontents';
/**
 * The mime type for a rich contents drag object.
 */
const CONTENTS_MIME_RICH = 'application/x-jupyter-icontentsrich';
/**
 * The class name added to drop targets.
 */
const listing_DROP_TARGET_CLASS = 'jp-mod-dropTarget';
/**
 * The class name added to selected rows.
 */
const SELECTED_CLASS = 'jp-mod-selected';
/**
 * The class name added to drag state icons to add space between the icon and the file name
 */
const DRAG_ICON_CLASS = 'jp-DragIcon';
/**
 * The class name added to column resize handle.
 */
const RESIZE_HANDLE_CLASS = 'jp-DirListing-resizeHandle';
/**
 * The class name added to the widget when there are items on the clipboard.
 */
const CLIPBOARD_CLASS = 'jp-mod-clipboard';
/**
 * The class name added to cut rows.
 */
const CUT_CLASS = 'jp-mod-cut';
/**
 * The class name added when there are more than one selected rows.
 */
const MULTI_SELECTED_CLASS = 'jp-mod-multiSelected';
/**
 * The class name added to indicate running notebook.
 */
const RUNNING_CLASS = 'jp-mod-running';
/**
 * The class name added to indicate the active element.
 */
const ACTIVE_CLASS = 'jp-mod-active';
/**
 * The class name added for a descending sort.
 */
const DESCENDING_CLASS = 'jp-mod-descending';
/**
 * The maximum duration between two key presses when selecting files by prefix.
 */
const PREFIX_APPEND_DURATION = 1000;
/**
 * The default width of the resize handle.
 */
const DEFAULT_HANDLE_WIDTH = 5;
/**
 * The threshold in pixels to start a drag event.
 */
const DRAG_THRESHOLD = 5;
/**
 * A boolean indicating whether the platform is Mac.
 */
const IS_MAC = !!navigator.platform.match(/Mac/i);
/**
 * The factory MIME type supported by lumino dock panels.
 */
const FACTORY_MIME = 'application/vnd.lumino.widget-factory';
/**
 * A widget which hosts a file list area.
 */
class DirListing extends dist_index_es6_js_.Widget {
    /**
     * Construct a new file browser directory listing widget.
     *
     * @param options The constructor options
     */
    constructor(options) {
        var _a;
        super({
            node: (options.renderer || DirListing.defaultRenderer).createNode()
        });
        this._items = [];
        this._sortedItems = [];
        this._sortState = {
            direction: 'ascending',
            key: 'name'
        };
        this._onItemOpened = new index_es6_js_.Signal(this);
        this._selectionChanged = new index_es6_js_.Signal(this);
        this._drag = null;
        this._dragData = null;
        this._resizeData = null;
        this._selectTimer = -1;
        this._isCut = false;
        this._prevPath = '';
        this._clipboard = [];
        this._softSelection = '';
        this.selection = Object.create(null);
        this._searchPrefix = '';
        this._searchPrefixTimer = -1;
        this._inRename = false;
        this._isDirty = false;
        this._hiddenColumns = new Set();
        this._columnSizes = {
            name: null,
            file_size: null,
            is_selected: null,
            last_modified: null
        };
        this._sortNotebooksFirst = false;
        this._allowSingleClick = false;
        this._allowDragDropUpload = true;
        // _focusIndex should never be set outside the range [0, this._items.length - 1]
        this._focusIndex = 0;
        this._allUploaded = new index_es6_js_.Signal(this);
        this._width = null;
        this._state = null;
        this._contentScrollbarWidth = 0;
        this._contentSizeObserver = new ResizeObserver(this._onContentResize.bind(this));
        this._paddingWidth = 0;
        this._handleWidth = DEFAULT_HANDLE_WIDTH;
        this._lastRenderedState = new WeakMap();
        this.addClass(DIR_LISTING_CLASS);
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._model = options.model;
        this._model.fileChanged.connect(this._onFileChanged, this);
        this._model.refreshed.connect(this._onModelRefreshed, this);
        this._model.pathChanged.connect(this._onPathChanged, this);
        this._editNode = document.createElement('input');
        this._editNode.className = EDITOR_CLASS;
        this._manager = this._model.manager;
        this._renderer = options.renderer || DirListing.defaultRenderer;
        this._state = options.state || null;
        this._allowDragDropUpload = (_a = options.allowDragDropUpload) !== null && _a !== void 0 ? _a : true;
        this._handleOpenFile =
            options.handleOpenFile ||
                ((path) => {
                    this._manager.openOrReveal(path);
                });
        // Get the width of the "modified" column
        this._updateModifiedSize(this.node);
        const headerNode = index_js_.DOMUtils.findElement(this.node, HEADER_CLASS);
        // hide the file size column by default
        this._hiddenColumns.add('file_size');
        this._renderer.populateHeaderNode(headerNode, this.translator, this._hiddenColumns, this._columnSizes);
        this._manager.activateRequested.connect(this._onActivateRequested, this);
    }
    /**
     * Dispose of the resources held by the directory listing.
     */
    dispose() {
        this._items.length = 0;
        this._sortedItems.length = 0;
        this._clipboard.length = 0;
        super.dispose();
    }
    /**
     * Get the model used by the listing.
     */
    get model() {
        return this._model;
    }
    /**
     * Get the dir listing header node.
     *
     * #### Notes
     * This is the node which holds the header cells.
     *
     * Modifying this node directly can lead to undefined behavior.
     */
    get headerNode() {
        return index_js_.DOMUtils.findElement(this.node, HEADER_CLASS);
    }
    /**
     * Get the dir listing content node.
     *
     * #### Notes
     * This is the node which holds the item nodes.
     *
     * Modifying this node directly can lead to undefined behavior.
     */
    get contentNode() {
        return index_js_.DOMUtils.findElement(this.node, CONTENT_CLASS);
    }
    /**
     * The renderer instance used by the directory listing.
     */
    get renderer() {
        return this._renderer;
    }
    /**
     * The current sort state.
     */
    get sortState() {
        return this._sortState;
    }
    /**
     * A signal fired when an item is opened.
     */
    get onItemOpened() {
        return this._onItemOpened;
    }
    /**
     * A signal fired when the selection changes.
     */
    get selectionChanged() {
        return this._selectionChanged;
    }
    /**
     * Create an iterator over the listing's selected items.
     *
     * @returns A new iterator over the listing's selected items.
     */
    selectedItems() {
        const items = this._sortedItems;
        return (0,algorithm_dist_index_es6_js_.filter)(items, item => this.selection[item.path]);
    }
    /**
     * Create an iterator over the listing's sorted items.
     *
     * @returns A new iterator over the listing's sorted items.
     */
    sortedItems() {
        return this._sortedItems[Symbol.iterator]();
    }
    /**
     * Sort the items using a sort condition.
     */
    sort(state) {
        this._sortedItems = listing_Private.sort(this.model.items(), state, this._sortNotebooksFirst, this.translator);
        this._sortState = state;
        this.update();
    }
    /**
     * Rename the first currently selected item.
     *
     * @returns A promise that resolves with the new name of the item.
     */
    rename() {
        return this._doRename();
    }
    /**
     * Cut the selected items.
     */
    cut() {
        this._isCut = true;
        this._copy();
        this.update();
    }
    /**
     * Copy the selected items.
     */
    copy() {
        this._copy();
    }
    /**
     * Paste the items from the clipboard.
     *
     * @returns A promise that resolves when the operation is complete.
     */
    paste() {
        if (!this._clipboard.length) {
            this._isCut = false;
            return Promise.resolve(undefined);
        }
        const basePath = this._model.path;
        const promises = [];
        for (const path of this._clipboard) {
            if (this._isCut) {
                const localPath = this._manager.services.contents.localPath(path);
                const parts = localPath.split('/');
                const name = parts[parts.length - 1];
                const newPath = lib_index_js_.PathExt.join(basePath, name);
                promises.push(this._model.manager.rename(path, newPath));
            }
            else {
                promises.push(this._model.manager.copy(path, basePath));
            }
        }
        // Remove any cut modifiers.
        for (const item of this._items) {
            item.classList.remove(CUT_CLASS);
        }
        this._clipboard.length = 0;
        this._isCut = false;
        this.removeClass(CLIPBOARD_CLASS);
        return Promise.all(promises)
            .then(() => {
            return undefined;
        })
            .catch(error => {
            void (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Paste Error'), error);
        });
    }
    /**
     * Delete the currently selected item(s).
     *
     * @returns A promise that resolves when the operation is complete.
     */
    async delete() {
        const deleteToTrash = lib_index_js_.PageConfig.getOption('delete_to_trash') === 'true';
        const items = this._sortedItems.filter(item => this.selection[item.path]);
        if (!items.length) {
            return;
        }
        const moveToTrashActionMessage = this._trans.__('Are you sure you want to move to trash: %1?', items[0].name);
        const deleteActionMessage = this._trans.__('Are you sure you want to permanently delete: %1?', items[0].name);
        const moveToTrashItemsActionMessage = this._trans._n('Are you sure you want to move to trash the %1 selected item?', 'Are you sure you want to move to trash the %1 selected items?', items.length);
        const deleteActionItemsMessage = this._trans._n('Are you sure you want to permanently delete the %1 selected item?', 'Are you sure you want to permanently delete the %1 selected items?', items.length);
        const actionMessage = deleteToTrash
            ? moveToTrashActionMessage
            : deleteActionMessage;
        const itemsActionMessage = deleteToTrash
            ? moveToTrashItemsActionMessage
            : deleteActionItemsMessage;
        const actionName = deleteToTrash
            ? this._trans.__('Move to Trash')
            : this._trans.__('Delete');
        const message = items.length === 1 ? actionMessage : itemsActionMessage;
        const result = await (0,index_js_.showDialog)({
            title: actionName,
            body: message,
            buttons: [
                index_js_.Dialog.cancelButton({ label: this._trans.__('Cancel') }),
                index_js_.Dialog.warnButton({ label: actionName })
            ],
            // By default focus on "Cancel" to protect from accidental deletion
            // ("delete" and "Enter" are next to each other on many keyboards).
            defaultButton: 0
        });
        if (!this.isDisposed && result.button.accept) {
            await this._delete(items.map(item => item.path));
        }
        // Re-focus
        let focusIndex = this._focusIndex;
        const lastIndexAfterDelete = this._sortedItems.length - items.length - 1;
        if (focusIndex > lastIndexAfterDelete) {
            // If the focus index after deleting items is out of bounds, set it to the
            // last item.
            focusIndex = Math.max(0, lastIndexAfterDelete);
        }
        this._focusItem(focusIndex);
    }
    /**
     * Duplicate the currently selected item(s).
     *
     * @returns A promise that resolves when the operation is complete.
     */
    duplicate() {
        const basePath = this._model.path;
        const promises = [];
        for (const item of this.selectedItems()) {
            if (item.type !== 'directory') {
                promises.push(this._model.manager.copy(item.path, basePath));
            }
        }
        return Promise.all(promises)
            .then(() => {
            return undefined;
        })
            .catch(error => {
            void (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Duplicate file'), error);
        });
    }
    /**
     * Select all listing items in the current directory.
     */
    async selectAll() {
        const items = this._model.items();
        const newSelection = {};
        for (const item of items) {
            newSelection[item.path] = true;
        }
        this.selection = newSelection;
        this._selectionChanged.emit();
        this.update();
    }
    /**
     * Download the currently selected item(s).
     */
    async download() {
        await Promise.all(Array.from(this.selectedItems())
            .filter(item => item.type !== 'directory')
            .map(item => this._model.download(item.path)));
    }
    /**
     * Restore the state of the file browser listing.
     *
     * @param id - The unique ID that is used to construct a state database key.
     *
     */
    async restore(id) {
        const key = `file-browser-${id}:columns`;
        const state = this._state;
        this._stateColumnsKey = key;
        if (!state) {
            return;
        }
        try {
            const columns = await state.fetch(key);
            if (!columns) {
                return;
            }
            const sizes = columns['sizes'];
            if (!sizes) {
                return;
            }
            for (const [key, size] of Object.entries(sizes)) {
                this._columnSizes[key] = size;
            }
            this._updateColumnSizes();
        }
        catch (error) {
            await state.remove(key);
        }
    }
    /**
     * Shut down kernels on the applicable currently selected items.
     *
     * @returns A promise that resolves when the operation is complete.
     */
    shutdownKernels() {
        const model = this._model;
        const items = this._sortedItems;
        const paths = items.map(item => item.path);
        const promises = Array.from(this._model.sessions())
            .filter(session => {
            const index = algorithm_dist_index_es6_js_.ArrayExt.firstIndexOf(paths, session.path);
            return this.selection[items[index].path];
        })
            .map(session => model.manager.services.sessions.shutdown(session.id));
        return Promise.all(promises)
            .then(() => {
            return undefined;
        })
            .catch(error => {
            void (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Shut down kernel'), error);
        });
    }
    /**
     * Select next item.
     *
     * @param keepExisting - Whether to keep the current selection and add to it.
     */
    selectNext(keepExisting = false) {
        let index = -1;
        const selected = Object.keys(this.selection);
        const items = this._sortedItems;
        if (selected.length === 1 || keepExisting) {
            // Select the next item.
            const path = selected[selected.length - 1];
            index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(items, value => value.path === path);
            index += 1;
            if (index === this._items.length) {
                index = 0;
            }
        }
        else if (selected.length === 0) {
            // Select the first item.
            index = 0;
        }
        else {
            // Select the last selected item.
            const path = selected[selected.length - 1];
            index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(items, value => value.path === path);
        }
        if (index !== -1) {
            this._selectItem(index, keepExisting);
            domutils_dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(this.contentNode, this._items[index]);
        }
    }
    /**
     * Select previous item.
     *
     * @param keepExisting - Whether to keep the current selection and add to it.
     */
    selectPrevious(keepExisting = false) {
        let index = -1;
        const selected = Object.keys(this.selection);
        const items = this._sortedItems;
        if (selected.length === 1 || keepExisting) {
            // Select the previous item.
            const path = selected[0];
            index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(items, value => value.path === path);
            index -= 1;
            if (index === -1) {
                index = this._items.length - 1;
            }
        }
        else if (selected.length === 0) {
            // Select the last item.
            index = this._items.length - 1;
        }
        else {
            // Select the first selected item.
            const path = selected[0];
            index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(items, value => value.path === path);
        }
        if (index !== -1) {
            this._selectItem(index, keepExisting);
            domutils_dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(this.contentNode, this._items[index]);
        }
    }
    /**
     * Select the first item that starts with prefix being typed.
     */
    selectByPrefix() {
        const prefix = this._searchPrefix.toLowerCase();
        const items = this._sortedItems;
        const index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(items, value => {
            return value.name.toLowerCase().substr(0, prefix.length) === prefix;
        });
        if (index !== -1) {
            this._selectItem(index, false);
            domutils_dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(this.contentNode, this._items[index]);
        }
    }
    /**
     * Get whether an item is selected by name.
     *
     * @param name - The name of of the item.
     *
     * @returns Whether the item is selected.
     */
    isSelected(name) {
        const items = this._sortedItems;
        return (Array.from((0,algorithm_dist_index_es6_js_.filter)(items, item => item.name === name && this.selection[item.path])).length !== 0);
    }
    /**
     * Find a model given a click.
     *
     * @param event - The mouse event.
     *
     * @returns The model for the selected file.
     */
    modelForClick(event) {
        const items = this._sortedItems;
        const index = listing_Private.hitTestNodes(this._items, event);
        if (index !== -1) {
            return items[index];
        }
        return undefined;
    }
    /**
     * Clear the selected items.
     */
    clearSelectedItems(emit = true) {
        this.selection = Object.create(null);
        if (emit) {
            this._selectionChanged.emit();
        }
    }
    /**
     * Select an item by name.
     *
     * @param name - The name of the item to select.
     * @param focus - Whether to move focus to the selected item.
     *
     * @returns A promise that resolves when the name is selected.
     */
    async selectItemByName(name, focus = false) {
        return this._selectItemByName(name, focus);
    }
    /**
     * Select an item by name.
     *
     * @param name - The name of the item to select.
     * @param focus - Whether to move focus to the selected item.
     * @param force - Whether to proceed with selection even if the file was already selected.
     *
     * @returns A promise that resolves when the name is selected.
     */
    async _selectItemByName(name, focus = false, force = false) {
        if (!force && this.isSelected(name)) {
            // Avoid API polling and DOM updates if already selected
            return;
        }
        // Make sure the file is available.
        await this.model.refresh();
        if (this.isDisposed) {
            throw new Error('File browser is disposed.');
        }
        const items = this._sortedItems;
        const index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(items, value => value.name === name);
        if (index === -1) {
            throw new Error('Item does not exist.');
        }
        this._selectItem(index, false, focus);
        messaging_dist_index_es6_js_.MessageLoop.sendMessage(this, dist_index_es6_js_.Widget.Msg.UpdateRequest);
        domutils_dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(this.contentNode, this._items[index]);
    }
    /**
     * Handle the DOM events for the directory listing.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'mousedown':
                this._evtMousedown(event);
                break;
            case 'mouseup':
                this._evtMouseup(event);
                break;
            case 'mousemove':
                this._evtMousemove(event);
                break;
            case 'keydown':
                this.evtKeydown(event);
                break;
            case 'click':
                this._evtClick(event);
                break;
            case 'dblclick':
                this.evtDblClick(event);
                break;
            case 'dragenter':
            case 'dragover':
                // Only show visual feedback if drag and drop upload is enabled
                if (this._allowDragDropUpload) {
                    this.addClass('jp-mod-native-drop');
                }
                event.preventDefault();
                break;
            case 'dragleave':
            case 'dragend':
                this.removeClass('jp-mod-native-drop');
                break;
            case 'drop':
                this.removeClass('jp-mod-native-drop');
                this.evtNativeDrop(event);
                break;
            case 'scroll':
                this._evtScroll(event);
                break;
            case 'lm-dragenter':
                this.evtDragEnter(event);
                break;
            case 'lm-dragleave':
                this.evtDragLeave(event);
                break;
            case 'lm-dragover':
                this.evtDragOver(event);
                break;
            case 'lm-drop':
                this.evtDrop(event);
                break;
            default:
                break;
        }
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        const node = this.node;
        this._width = this._computeContentWidth();
        const content = index_js_.DOMUtils.findElement(node, CONTENT_CLASS);
        node.addEventListener('mousedown', this);
        node.addEventListener('keydown', this);
        node.addEventListener('click', this);
        node.addEventListener('dblclick', this);
        this._contentSizeObserver.observe(content);
        content.addEventListener('dragenter', this);
        content.addEventListener('dragover', this);
        content.addEventListener('dragleave', this);
        content.addEventListener('dragend', this);
        content.addEventListener('drop', this);
        content.addEventListener('scroll', this);
        content.addEventListener('lm-dragenter', this);
        content.addEventListener('lm-dragleave', this);
        content.addEventListener('lm-dragover', this);
        content.addEventListener('lm-drop', this);
        this._updateColumnSizes();
    }
    /**
     * A message handler invoked on a `'before-detach'` message.
     */
    onBeforeDetach(msg) {
        super.onBeforeDetach(msg);
        const node = this.node;
        const content = index_js_.DOMUtils.findElement(node, CONTENT_CLASS);
        node.removeEventListener('mousedown', this);
        node.removeEventListener('keydown', this);
        node.removeEventListener('click', this);
        node.removeEventListener('dblclick', this);
        this._contentSizeObserver.disconnect();
        content.removeEventListener('scroll', this);
        content.removeEventListener('dragover', this);
        content.removeEventListener('dragover', this);
        content.removeEventListener('dragleave', this);
        content.removeEventListener('dragend', this);
        content.removeEventListener('drop', this);
        content.removeEventListener('lm-dragenter', this);
        content.removeEventListener('lm-dragleave', this);
        content.removeEventListener('lm-dragover', this);
        content.removeEventListener('lm-drop', this);
        document.removeEventListener('mousemove', this, true);
        document.removeEventListener('mouseup', this, true);
    }
    /**
     * A message handler invoked on an `'after-show'` message.
     */
    onAfterShow(msg) {
        if (this._isDirty) {
            // Update the sorted items.
            this.sort(this.sortState);
            this.update();
        }
    }
    _onContentResize() {
        const content = index_js_.DOMUtils.findElement(this.node, CONTENT_CLASS);
        const scrollbarWidth = content.offsetWidth - content.clientWidth;
        if (scrollbarWidth != this._contentScrollbarWidth) {
            this._contentScrollbarWidth = scrollbarWidth;
            this._width = this._computeContentWidth();
            this._updateColumnSizes();
        }
    }
    _computeContentWidth(width = null) {
        if (!width) {
            width = this.node.getBoundingClientRect().width;
        }
        this._paddingWidth = parseFloat(window
            .getComputedStyle(this.node)
            .getPropertyValue('--jp-dirlisting-padding-width'));
        const handle = this.node.querySelector(`.${RESIZE_HANDLE_CLASS}`);
        this._handleWidth = handle
            ? handle.getBoundingClientRect().width
            : DEFAULT_HANDLE_WIDTH;
        return width - this._paddingWidth * 2 - this._contentScrollbarWidth;
    }
    /**
     * Update the modified column's size
     */
    _updateModifiedSize(node) {
        var _a, _b;
        // Look for the modified column's header
        const modified = index_js_.DOMUtils.findElement(node, MODIFIED_ID_CLASS);
        this._modifiedWidth =
            (_b = (_a = this._columnSizes['last_modified']) !== null && _a !== void 0 ? _a : modified === null || modified === void 0 ? void 0 : modified.getBoundingClientRect().width) !== null && _b !== void 0 ? _b : 83;
        this._modifiedStyle =
            this._modifiedWidth < 100
                ? 'narrow'
                : this._modifiedWidth > 120
                    ? 'long'
                    : 'short';
    }
    /**
     * Rerender item nodes' modified dates, if the modified style has changed.
     */
    _updateModifiedStyleAndSize() {
        const oldModifiedStyle = this._modifiedStyle;
        // Update both size and style
        this._updateModifiedSize(this.node);
        if (oldModifiedStyle !== this._modifiedStyle) {
            this.updateModified(this._sortedItems, this._items);
        }
    }
    /**
     * Update only the modified dates.
     */
    updateModified(items, nodes) {
        items.forEach((item, i) => {
            const node = nodes[i];
            if (node && item.last_modified) {
                const modified = index_js_.DOMUtils.findElement(node, ITEM_MODIFIED_CLASS);
                if (this.renderer.updateItemModified !== undefined) {
                    this.renderer.updateItemModified(modified, item.last_modified, this._modifiedStyle);
                }
                else {
                    DirListing.defaultRenderer.updateItemModified(modified, item.last_modified, this._modifiedStyle);
                }
            }
        });
    }
    // Update item nodes based on widget state.
    updateNodes(items, nodes, sizeOnly = false) {
        var _a;
        items.forEach((item, i) => {
            const node = nodes[i];
            if (sizeOnly && this.renderer.updateItemSize) {
                if (!node) {
                    // short-circuit in case if node is not yet ready
                    return;
                }
                return this.renderer.updateItemSize(node, item, this._modifiedStyle, this._columnSizes);
            }
            const ft = this._manager.registry.getFileTypeForModel(item);
            this.renderer.updateItemNode(node, item, ft, this.translator, this._hiddenColumns, this.selection[item.path], this._modifiedStyle, this._columnSizes);
            if (this.selection[item.path] &&
                this._isCut &&
                this._model.path === this._prevPath) {
                node.classList.add(CUT_CLASS);
            }
            // add metadata to the node
            node.setAttribute('data-isdir', item.type === 'directory' ? 'true' : 'false');
        });
        // Handle the selectors on the widget node.
        const selected = Object.keys(this.selection).length;
        if (selected) {
            this.addClass(SELECTED_CLASS);
            if (selected > 1) {
                this.addClass(MULTI_SELECTED_CLASS);
            }
        }
        // Handle file session statuses.
        const paths = items.map(item => item.path);
        for (const session of this._model.sessions()) {
            const index = algorithm_dist_index_es6_js_.ArrayExt.firstIndexOf(paths, session.path);
            const node = nodes[index];
            // Node may have been filtered out.
            if (node) {
                let name = (_a = session.kernel) === null || _a === void 0 ? void 0 : _a.name;
                const specs = this._model.specs;
                node.classList.add(RUNNING_CLASS);
                if (specs && name) {
                    const spec = specs.kernelspecs[name];
                    name = spec ? spec.display_name : this._trans.__('unknown');
                }
                // Update node title only if it has changed.
                const prevState = this._lastRenderedState.get(node);
                if (prevState !== node.title) {
                    node.title = this._trans.__('%1\nKernel: %2', node.title, name);
                    this._lastRenderedState.set(node, node.title);
                }
            }
        }
    }
    /**
     * A handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        this._isDirty = false;
        // Fetch common variables.
        const items = this._sortedItems;
        const nodes = this._items;
        // If we didn't get any item yet, we'll need to resize once items are added
        const needsResize = nodes.length === 0;
        const content = index_js_.DOMUtils.findElement(this.node, CONTENT_CLASS);
        const renderer = this._renderer;
        this.removeClass(MULTI_SELECTED_CLASS);
        this.removeClass(SELECTED_CLASS);
        // Remove any excess item nodes.
        while (nodes.length > items.length) {
            content.removeChild(nodes.pop());
        }
        // Add any missing item nodes.
        while (nodes.length < items.length) {
            const node = renderer.createItemNode(this._hiddenColumns, this._columnSizes);
            node.classList.add(ITEM_CLASS);
            nodes.push(node);
            content.appendChild(node);
        }
        nodes.forEach((node, i) => {
            // Remove extra classes from the nodes.
            node.classList.remove(SELECTED_CLASS);
            node.classList.remove(RUNNING_CLASS);
            node.classList.remove(CUT_CLASS);
            // Uncheck each file checkbox
            const checkbox = renderer.getCheckboxNode(node);
            if (checkbox) {
                checkbox.checked = false;
            }
            // Handle `tabIndex` & `role`
            const nameNode = renderer.getNameNode(node);
            if (nameNode) {
                // Must check if the name node is there because it gets replaced by the
                // edit node when editing the name of the file or directory.
                if (i === this._focusIndex) {
                    nameNode.setAttribute('tabIndex', '0');
                    nameNode.setAttribute('role', 'button');
                }
                else {
                    nameNode.setAttribute('tabIndex', '-1');
                    nameNode.removeAttribute('role');
                }
            }
        });
        // Put the check-all checkbox in the header into the correct state
        const checkAllCheckbox = renderer.getCheckboxNode(this.headerNode);
        if (checkAllCheckbox) {
            const totalSelected = Object.keys(this.selection).length;
            const allSelected = items.length > 0 && totalSelected === items.length;
            const someSelected = !allSelected && totalSelected > 0;
            checkAllCheckbox.checked = allSelected;
            checkAllCheckbox.indeterminate = someSelected;
            // Stash the state in data attributes so we can access them in the click
            // handler (because in the click handler, checkbox.checked and
            // checkbox.indeterminate do not hold the previous value; they hold the
            // next value).
            checkAllCheckbox.dataset.checked = String(allSelected);
            checkAllCheckbox.dataset.indeterminate = String(someSelected);
            const trans = this.translator.load('jupyterlab');
            checkAllCheckbox === null || checkAllCheckbox === void 0 ? void 0 : checkAllCheckbox.setAttribute('aria-label', allSelected || someSelected
                ? trans.__('Deselect all files and directories')
                : trans.__('Select all files and directories'));
        }
        this.updateNodes(items, nodes);
        if (needsResize) {
            this._width = this._computeContentWidth();
            this._updateColumnSizes();
        }
        this._prevPath = this._model.path;
    }
    onResize(msg) {
        const { width } = msg.width === -1 ? this.node.getBoundingClientRect() : msg;
        this._width = this._computeContentWidth(width);
        this._updateColumnSizes();
    }
    setColumnVisibility(name, visible) {
        if (visible) {
            this._hiddenColumns.delete(name);
        }
        else {
            this._hiddenColumns.add(name);
        }
        this.headerNode.innerHTML = '';
        this._renderer.populateHeaderNode(this.headerNode, this.translator, this._hiddenColumns, this._columnSizes);
        this._updateColumnSizes();
    }
    _updateColumnSizes(doNotGrowBeforeInclusive = null) {
        // Adjust column sizes so that they add up to the total width available, preserving ratios
        const visibleColumns = this._visibleColumns
            .map(column => ({
            ...column,
            element: index_js_.DOMUtils.findElement(this.node, column.className)
        }))
            .filter(column => {
            // While all visible column will have an element, some extensions like jupyter-unfold
            // do not render columns even if user requests them to be visible; this filter exists
            // to ensure backward compatibility with such extensions and may be removed in the future.
            return column.element;
        });
        // read from DOM
        let total = 0;
        for (const column of visibleColumns) {
            let size = this._columnSizes[column.id];
            if (size === null) {
                size = column.element.getBoundingClientRect().width;
            }
            // restrict the minimum and maximum width
            size = Math.max(size, column.minWidth);
            if (this._width) {
                let reservedForOtherColumns = 0;
                for (const other of visibleColumns) {
                    if (other.id === column.id) {
                        continue;
                    }
                    reservedForOtherColumns += other.minWidth;
                }
                size = Math.min(size, this._width - reservedForOtherColumns);
            }
            this._columnSizes[column.id] = size;
            total += size;
        }
        // Ensure that total fits
        if (this._width) {
            // Distribute the excess/shortfall over the columns which should stretch.
            const excess = this._width - total;
            let growAllowed = doNotGrowBeforeInclusive === null;
            const growColumns = visibleColumns.filter(c => {
                if (growAllowed) {
                    return true;
                }
                if (c.id === doNotGrowBeforeInclusive) {
                    growAllowed = true;
                }
                return false;
            });
            const totalWeight = growColumns
                .map(c => c.grow)
                .reduce((a, b) => a + b, 0);
            for (const column of growColumns) {
                // The value of `growBy` will be negative when the down-sizing
                const growBy = (excess * column.grow) / totalWeight;
                this._columnSizes[column.id] = this._columnSizes[column.id] + growBy;
            }
        }
        const resizeHandles = this.node.getElementsByClassName(RESIZE_HANDLE_CLASS);
        const resizableColumns = visibleColumns.map(column => listing_Private.isResizable(column));
        // Write to DOM
        let i = 0;
        for (const column of visibleColumns) {
            let size = this._columnSizes[column.id];
            if (listing_Private.isResizable(column) && size) {
                size -=
                    (this._handleWidth * resizeHandles.length) / resizableColumns.length;
                // if this is first resizable or last resizable column
                if (i === 0 || i === resizableColumns.length - 1) {
                    size += this._paddingWidth;
                }
                i += 1;
            }
            column.element.style.width = size === null ? '' : size + 'px';
        }
        this._updateModifiedStyleAndSize();
        // Refresh sizes on the per item widths
        if (this.isVisible) {
            const items = this._items;
            if (items.length !== 0) {
                this.updateNodes(this._sortedItems, this._items, true);
            }
        }
        if (this._state && this._stateColumnsKey) {
            void this._state.save(this._stateColumnsKey, {
                sizes: this._columnSizes
            });
        }
    }
    get _visibleColumns() {
        return DirListing.columns.filter(column => { var _a; return column.id === 'name' || !((_a = this._hiddenColumns) === null || _a === void 0 ? void 0 : _a.has(column.id)); });
    }
    _setColumnSize(name, size) {
        var _a;
        const previousSize = this._columnSizes[name];
        if (previousSize && size && size > previousSize) {
            // check if we can resize up
            let total = 0;
            let before = true;
            for (const column of this._visibleColumns) {
                if (column.id === name) {
                    // add proposed size for the current columns
                    total += size;
                    before = false;
                    continue;
                }
                if (before) {
                    // add size as-is for columns before
                    const element = index_js_.DOMUtils.findElement(this.node, column.className);
                    total +=
                        (_a = this._columnSizes[column.id]) !== null && _a !== void 0 ? _a : element.getBoundingClientRect().width;
                }
                else {
                    // add minimum acceptable size for columns after
                    total += column.minWidth;
                }
            }
            if (this._width && total > this._width) {
                // up sizing is no longer possible
                return;
            }
        }
        this._columnSizes[name] = size;
        this._updateColumnSizes(name);
    }
    /**
     * Update the setting to sort notebooks above files.
     * This sorts the items again if the internal value is modified.
     */
    setNotebooksFirstSorting(isEnabled) {
        let previousValue = this._sortNotebooksFirst;
        this._sortNotebooksFirst = isEnabled;
        if (this._sortNotebooksFirst !== previousValue) {
            this.sort(this._sortState);
        }
    }
    /**
     * Update the setting to allow single click navigation.
     * This enables opening files/directories with a single click.
     */
    setAllowSingleClickNavigation(isEnabled) {
        this._allowSingleClick = isEnabled;
    }
    /**
     * Update the setting to allow drag and drop upload.
     * This enables uploading files via drag and drop.
     */
    setAllowDragDropUpload(isEnabled) {
        this._allowDragDropUpload = isEnabled;
    }
    /**
     * Would this click (or other event type) hit the checkbox by default?
     */
    isWithinCheckboxHitArea(event) {
        let element = event.target;
        while (element) {
            if (element.classList.contains(CHECKBOX_WRAPPER_CLASS)) {
                return true;
            }
            element = element.parentElement;
        }
        return false;
    }
    /**
     * Handle the `'click'` event for the widget.
     */
    _evtClick(event) {
        const target = event.target;
        const header = this.headerNode;
        const renderer = this._renderer;
        if (header.contains(target)) {
            const checkbox = renderer.getCheckboxNode(header);
            if (checkbox && this.isWithinCheckboxHitArea(event)) {
                const previouslyUnchecked = checkbox.dataset.indeterminate === 'false' &&
                    checkbox.dataset.checked === 'false';
                // The only time a click on the check-all checkbox should check all is
                // when it was previously unchecked; otherwise, if the checkbox was
                // either checked (all selected) or indeterminate (some selected), the
                // click should clear all.
                if (previouslyUnchecked) {
                    // Select all items
                    this._sortedItems.forEach((item) => (this.selection[item.path] = true));
                    this._selectionChanged.emit();
                }
                else {
                    // Unselect all items
                    this.clearSelectedItems();
                }
                this.update();
            }
            else {
                const state = this.renderer.handleHeaderClick(header, event);
                if (state) {
                    this.sort(state);
                }
            }
            return;
        }
        else {
            // Focus the selected file on click to ensure a couple of things:
            // 1. If a user clicks on the item node, its name node will receive focus.
            // 2. If a user clicks on blank space in the directory listing, the
            //    previously focussed item will be focussed.
            this._focusItem(this._focusIndex);
        }
        if (this._allowSingleClick) {
            this.evtDblClick(event);
        }
    }
    /**
     * Handle the `'scroll'` event for the widget.
     */
    _evtScroll(event) {
        this.headerNode.scrollLeft = this.contentNode.scrollLeft;
    }
    /**
     * Handle the `'mousedown'` event for the widget.
     */
    _evtMousedown(event) {
        // Bail if clicking within the edit node
        if (event.target === this._editNode) {
            return;
        }
        // Blur the edit node if necessary.
        if (this._editNode.parentNode) {
            if (this._editNode !== event.target) {
                this._editNode.focus();
                this._editNode.blur();
                clearTimeout(this._selectTimer);
            }
            else {
                return;
            }
        }
        let index = listing_Private.hitTestNodes(this._items, event);
        if (index === -1) {
            // Left mouse press for drag or resize start.
            if (event.button === 0) {
                const resizeHandle = event.target;
                if (resizeHandle instanceof HTMLElement &&
                    resizeHandle.classList.contains(RESIZE_HANDLE_CLASS)) {
                    const columnId = resizeHandle.dataset.column;
                    if (!columnId) {
                        throw Error('Column resize handle is missing data-column attribute');
                    }
                    const column = DirListing.columns.find(c => c.id === columnId);
                    if (!column) {
                        throw Error(`Column with identifier ${columnId} not found`);
                    }
                    const element = index_js_.DOMUtils.findElement(this.node, column.className);
                    resizeHandle.classList.add(ACTIVE_CLASS);
                    const cursorOverride = dragdrop_dist_index_es6_js_.Drag.overrideCursor('col-resize');
                    this._resizeData = {
                        pressX: event.clientX,
                        column: columnId,
                        initialSize: element.getBoundingClientRect().width,
                        overrides: new disposable_dist_index_es6_js_.DisposableDelegate(() => {
                            cursorOverride.dispose();
                            resizeHandle.classList.remove(ACTIVE_CLASS);
                        })
                    };
                    document.addEventListener('mouseup', this, true);
                    document.addEventListener('mousemove', this, true);
                    return;
                }
            }
            return;
        }
        this.handleFileSelect(event);
        if (event.button !== 0) {
            clearTimeout(this._selectTimer);
        }
        // Check for clearing a context menu.
        const newContext = (IS_MAC && event.ctrlKey) || event.button === 2;
        if (newContext) {
            return;
        }
        // Left mouse press for drag or resize start.
        if (event.button === 0) {
            this._dragData = {
                pressX: event.clientX,
                pressY: event.clientY,
                index: index
            };
            document.addEventListener('mouseup', this, true);
            document.addEventListener('mousemove', this, true);
        }
    }
    /**
     * Handle the `'mouseup'` event for the widget.
     */
    _evtMouseup(event) {
        // Handle any soft selection from the previous mouse down.
        if (this._softSelection) {
            const altered = event.metaKey || event.shiftKey || event.ctrlKey;
            // See if we need to clear the other selection.
            if (!altered && event.button === 0) {
                this.clearSelectedItems();
                this.selection[this._softSelection] = true;
                this._selectionChanged.emit();
                this.update();
            }
            this._softSelection = '';
        }
        // Re-focus. This is needed because nodes corresponding to files selected in
        // mousedown handler will not retain the focus as mousedown event is always
        // followed by a blur/focus event.
        if (event.button === 0) {
            this._focusItem(this._focusIndex);
        }
        // Remove the resize listeners if necessary.
        if (this._resizeData) {
            this._resizeData.overrides.dispose();
            this._resizeData = null;
            document.removeEventListener('mousemove', this, true);
            document.removeEventListener('mouseup', this, true);
            return;
        }
        // Remove the drag listeners if necessary.
        if (event.button !== 0 || !this._drag) {
            document.removeEventListener('mousemove', this, true);
            document.removeEventListener('mouseup', this, true);
            return;
        }
        event.preventDefault();
        event.stopPropagation();
    }
    /**
     * Handle the `'mousemove'` event for the widget.
     */
    _evtMousemove(event) {
        event.preventDefault();
        event.stopPropagation();
        if (this._resizeData) {
            const { initialSize, column, pressX } = this._resizeData;
            this._setColumnSize(column, initialSize + event.clientX - pressX);
            return;
        }
        // Bail if we are the one dragging.
        if (this._drag || !this._dragData) {
            return;
        }
        // Check for a drag initialization.
        const data = this._dragData;
        const dx = Math.abs(event.clientX - data.pressX);
        const dy = Math.abs(event.clientY - data.pressY);
        if (dx < DRAG_THRESHOLD && dy < DRAG_THRESHOLD) {
            return;
        }
        this._startDrag(data.index, event.clientX, event.clientY);
    }
    /**
     * Handle the opening of an item.
     */
    handleOpen(item) {
        this._onItemOpened.emit(item);
        if (item.type === 'directory') {
            const localPath = this._manager.services.contents.localPath(item.path);
            this._model
                .cd(`/${localPath}`)
                .catch(error => (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Open directory'), error));
        }
        else {
            const path = item.path;
            this._handleOpenFile(path);
        }
    }
    /**
     * Calculate the next focus index, given the current focus index and a
     * direction, keeping within the bounds of the directory listing.
     *
     * @param index Current focus index
     * @param direction -1 (up) or 1 (down)
     * @returns The next focus index, which could be the same as the current focus
     * index if at the boundary.
     */
    _getNextFocusIndex(index, direction) {
        const nextIndex = index + direction;
        if (nextIndex === -1 || nextIndex === this._items.length) {
            // keep focus index within bounds
            return index;
        }
        else {
            return nextIndex;
        }
    }
    /**
     * Handle the up or down arrow key.
     *
     * @param event The keyboard event
     * @param direction -1 (up) or 1 (down)
     */
    _handleArrowY(event, direction) {
        // We only handle the `ctrl` and `shift` modifiers. If other modifiers are
        // present, then do nothing.
        if (event.altKey || event.metaKey) {
            return;
        }
        // If folder is empty, there's nothing to do with the up/down key.
        if (!this._items.length) {
            return;
        }
        // Don't handle the arrow key press if it's not on directory item. This
        // avoids a confusing user experience that can result from when the user
        // moves the selection and focus index apart (via ctrl + up/down). The last
        // selected item remains highlighted but the last focussed item loses its
        // focus ring if it's not actively focussed.  This forces the user to
        // visibly reveal the last focussed item before moving the focus.
        if (!event.target.classList.contains(ITEM_TEXT_CLASS)) {
            return;
        }
        event.stopPropagation();
        event.preventDefault();
        const focusIndex = this._focusIndex;
        let nextFocusIndex = this._getNextFocusIndex(focusIndex, direction);
        // The following if-block allows the first press of the down arrow to select
        // the first (rather than the second) file/directory in the list. This is
        // the situation when the page first loads or when a user changes directory.
        if (direction > 0 &&
            focusIndex === 0 &&
            !event.ctrlKey &&
            Object.keys(this.selection).length === 0) {
            nextFocusIndex = 0;
        }
        // Shift key indicates multi-selection. Either the user is trying to grow
        // the selection, or shrink it.
        if (event.shiftKey) {
            this._handleMultiSelect(nextFocusIndex);
        }
        else if (!event.ctrlKey) {
            // If neither the shift nor ctrl keys were used with the up/down arrow,
            // then we treat it as a normal, unmodified key press and select the
            // next item.
            this._selectItem(nextFocusIndex, event.shiftKey, false /* focus = false because we call focus method directly following this */);
        }
        this._focusItem(nextFocusIndex);
        this.update();
    }
    /**
     * cd ..
     *
     * Go up one level in the directory tree.
     */
    async goUp() {
        const model = this.model;
        if (model.path === model.rootPath) {
            return;
        }
        try {
            await model.cd('..');
        }
        catch (reason) {
            console.warn(`Failed to go to parent directory of ${model.path}`, reason);
        }
    }
    /**
     * Handle the `'keydown'` event for the widget.
     */
    evtKeydown(event) {
        // Do not handle any keydown events here if in the middle of a file rename.
        if (this._inRename) {
            return;
        }
        switch (event.keyCode) {
            case 13: {
                // Enter
                // Do nothing if any modifier keys are pressed.
                if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {
                    return;
                }
                event.preventDefault();
                event.stopPropagation();
                for (const item of this.selectedItems()) {
                    this.handleOpen(item);
                }
                return;
            }
            case 38:
                // Up arrow
                this._handleArrowY(event, -1);
                return;
            case 40:
                // Down arrow
                this._handleArrowY(event, 1);
                return;
            case 32: {
                // Space
                if (event.ctrlKey) {
                    // Follow the Windows and Ubuntu convention: you must press `ctrl` +
                    // `space` in order to toggle whether an item is selected.
                    // However, do not handle if any other modifiers were pressed.
                    if (event.metaKey || event.shiftKey || event.altKey) {
                        return;
                    }
                    // Make sure the ctrl+space key stroke was on a valid, focussed target.
                    const node = this._items[this._focusIndex];
                    if (!(
                    // Event must have occurred within a node whose item can be toggled.
                    (node.contains(event.target) &&
                        // That node must also contain the currently focussed element.
                        node.contains(document.activeElement)))) {
                        return;
                    }
                    event.stopPropagation();
                    // Prevent default, otherwise the container will scroll.
                    event.preventDefault();
                    // Toggle item selected
                    const { path } = this._sortedItems[this._focusIndex];
                    if (this.selection[path]) {
                        delete this.selection[path];
                    }
                    else {
                        this.selection[path] = true;
                    }
                    this._selectionChanged.emit();
                    this.update();
                    // Key was handled, so return.
                    return;
                }
                break;
            }
        }
        // Detects printable characters typed by the user.
        // Not all browsers support .key, but it discharges us from reconstructing
        // characters from key codes.
        if (event.key !== undefined &&
            event.key.length === 1 &&
            // Don't gobble up the space key on the check-all checkbox (which the
            // browser treats as a click event).
            !((event.key === ' ' || event.keyCode === 32) &&
                event.target.type === 'checkbox')) {
            if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {
                return;
            }
            this._searchPrefix += event.key;
            clearTimeout(this._searchPrefixTimer);
            this._searchPrefixTimer = window.setTimeout(() => {
                this._searchPrefix = '';
            }, PREFIX_APPEND_DURATION);
            this.selectByPrefix();
            event.stopPropagation();
            event.preventDefault();
        }
    }
    /**
     * Handle the `'dblclick'` event for the widget.
     */
    evtDblClick(event) {
        // Do nothing if it's not a left mouse press.
        if (event.button !== 0) {
            return;
        }
        // Do nothing if any modifier keys are pressed.
        if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {
            return;
        }
        // Do nothing if the double click is on a checkbox. (Otherwise a rapid
        // check-uncheck on the checkbox will cause the adjacent file/folder to
        // open, which is probably not what the user intended.)
        if (this.isWithinCheckboxHitArea(event)) {
            return;
        }
        // Stop the event propagation.
        event.preventDefault();
        event.stopPropagation();
        clearTimeout(this._selectTimer);
        this._editNode.blur();
        // Find a valid double click target.
        const target = event.target;
        const i = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(this._items, node => node.contains(target));
        if (i === -1) {
            return;
        }
        const item = this._sortedItems[i];
        this.handleOpen(item);
    }
    /**
     * Handle the `drop` event for the widget.
     */
    evtNativeDrop(event) {
        var _a, _b, _c;
        // Prevent navigation
        event.preventDefault();
        // Check if drag and drop upload is disabled
        if (!this._allowDragDropUpload) {
            return;
        }
        const items = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.items;
        if (!items) {
            // Fallback to simple upload of files (if any)
            const files = (_b = event.dataTransfer) === null || _b === void 0 ? void 0 : _b.files;
            if (!files || files.length === 0) {
                return;
            }
            const promises = [];
            for (const file of files) {
                const promise = this._model.upload(file);
                promises.push(promise);
            }
            Promise.all(promises)
                .then(() => this._allUploaded.emit())
                .catch(err => {
                console.error('Error while uploading files: ', err);
            });
            return;
        }
        const uploadEntry = async (entry, path) => {
            if (listing_Private.isDirectoryEntry(entry)) {
                const dirPath = await listing_Private.createDirectory(this._model.manager, path, entry.name);
                const directoryReader = entry.createReader();
                const allEntries = await listing_Private.collectEntries(directoryReader);
                for (const childEntry of allEntries) {
                    await uploadEntry(childEntry, dirPath);
                }
            }
            else if (listing_Private.isFileEntry(entry)) {
                const file = await listing_Private.readFile(entry);
                await this._model.upload(file, path);
            }
        };
        const promises = [];
        for (const item of items) {
            const entry = listing_Private.defensiveGetAsEntry(item);
            if (!entry) {
                continue;
            }
            const promise = uploadEntry(entry, (_c = this._model.path) !== null && _c !== void 0 ? _c : '/');
            promises.push(promise);
        }
        Promise.all(promises)
            .then(() => this._allUploaded.emit())
            .catch(err => {
            console.error('Error while uploading files: ', err);
        });
    }
    /**
     * Signal emitted on when all files were uploaded after native drag.
     */
    get allUploaded() {
        return this._allUploaded;
    }
    /**
     * Handle the `'lm-dragenter'` event for the widget.
     */
    evtDragEnter(event) {
        if (event.mimeData.hasData(listing_CONTENTS_MIME)) {
            const index = listing_Private.hitTestNodes(this._items, event);
            if (index === -1) {
                return;
            }
            const item = this._sortedItems[index];
            if (item.type !== 'directory' || this.selection[item.path]) {
                return;
            }
            const target = event.target;
            target.classList.add(listing_DROP_TARGET_CLASS);
            event.preventDefault();
            event.stopPropagation();
        }
    }
    /**
     * Handle the `'lm-dragleave'` event for the widget.
     */
    evtDragLeave(event) {
        event.preventDefault();
        event.stopPropagation();
        const dropTarget = index_js_.DOMUtils.findElement(this.node, listing_DROP_TARGET_CLASS);
        if (dropTarget) {
            dropTarget.classList.remove(listing_DROP_TARGET_CLASS);
        }
    }
    /**
     * Handle the `'lm-dragover'` event for the widget.
     */
    evtDragOver(event) {
        event.preventDefault();
        event.stopPropagation();
        event.dropAction = event.proposedAction;
        const dropTarget = index_js_.DOMUtils.findElement(this.node, listing_DROP_TARGET_CLASS);
        if (dropTarget) {
            dropTarget.classList.remove(listing_DROP_TARGET_CLASS);
        }
        const index = listing_Private.hitTestNodes(this._items, event);
        this._items[index].classList.add(listing_DROP_TARGET_CLASS);
    }
    /**
     * Handle the `'lm-drop'` event for the widget.
     */
    evtDrop(event) {
        event.preventDefault();
        event.stopPropagation();
        clearTimeout(this._selectTimer);
        if (event.proposedAction === 'none') {
            event.dropAction = 'none';
            return;
        }
        if (!event.mimeData.hasData(listing_CONTENTS_MIME)) {
            return;
        }
        let target = event.target;
        while (target && target.parentElement) {
            if (target.classList.contains(listing_DROP_TARGET_CLASS)) {
                target.classList.remove(listing_DROP_TARGET_CLASS);
                break;
            }
            target = target.parentElement;
        }
        // Get the path based on the target node.
        const index = algorithm_dist_index_es6_js_.ArrayExt.firstIndexOf(this._items, target);
        const items = this._sortedItems;
        let basePath = this._model.path;
        if (items[index].type === 'directory') {
            basePath = lib_index_js_.PathExt.join(basePath, items[index].name);
        }
        const manager = this._manager;
        // Handle the items.
        const promises = [];
        const paths = event.mimeData.getData(listing_CONTENTS_MIME);
        if (event.ctrlKey && event.proposedAction === 'move') {
            event.dropAction = 'copy';
        }
        else {
            event.dropAction = event.proposedAction;
        }
        for (const path of paths) {
            const localPath = manager.services.contents.localPath(path);
            const name = lib_index_js_.PathExt.basename(localPath);
            const newPath = lib_index_js_.PathExt.join(basePath, name);
            // Skip files that are not moving.
            if (newPath === path) {
                continue;
            }
            if (event.dropAction === 'copy') {
                promises.push(manager.copy(path, basePath));
            }
            else {
                promises.push((0,docmanager_lib_index_js_.renameFile)(manager, path, newPath));
            }
        }
        Promise.all(promises).catch(error => {
            void (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Error while copying/moving files'), error);
        });
    }
    /**
     * Start a drag event.
     */
    _startDrag(index, clientX, clientY) {
        let selectedPaths = Object.keys(this.selection);
        const source = this._items[index];
        const items = this._sortedItems;
        let selectedItems;
        let item;
        // If the source node is not selected, use just that node.
        if (!source.classList.contains(SELECTED_CLASS)) {
            item = items[index];
            selectedPaths = [item.path];
            selectedItems = [item];
        }
        else {
            const path = selectedPaths[0];
            item = items.find(value => value.path === path);
            selectedItems = this.selectedItems();
        }
        if (!item) {
            return;
        }
        // Create the drag image.
        const ft = this._manager.registry.getFileTypeForModel(item);
        const dragImage = this.renderer.createDragImage(source, selectedPaths.length, this._trans, ft);
        // Set up the drag event.
        this._drag = new dragdrop_dist_index_es6_js_.Drag({
            dragImage,
            mimeData: new dist_index_js_.MimeData(),
            supportedActions: 'move',
            proposedAction: 'move'
        });
        this._drag.mimeData.setData(listing_CONTENTS_MIME, selectedPaths);
        // Add thunks for getting mime data content.
        // We thunk the content so we don't try to make a network call
        // when it's not needed. E.g. just moving files around
        // in a filebrowser
        const services = this.model.manager.services;
        for (const item of selectedItems) {
            this._drag.mimeData.setData(CONTENTS_MIME_RICH, {
                model: item,
                withContent: async () => {
                    return await services.contents.get(item.path);
                }
            });
        }
        if (item && item.type !== 'directory') {
            const otherPaths = selectedPaths.slice(1).reverse();
            this._drag.mimeData.setData(FACTORY_MIME, () => {
                if (!item) {
                    return;
                }
                const path = item.path;
                let widget = this._manager.findWidget(path);
                if (!widget) {
                    widget = this._manager.open(item.path);
                }
                if (otherPaths.length) {
                    const firstWidgetPlaced = new dist_index_js_.PromiseDelegate();
                    void firstWidgetPlaced.promise.then(() => {
                        let prevWidget = widget;
                        otherPaths.forEach(path => {
                            const options = {
                                ref: prevWidget === null || prevWidget === void 0 ? void 0 : prevWidget.id,
                                mode: 'tab-after'
                            };
                            prevWidget = this._manager.openOrReveal(path, void 0, void 0, options);
                            this._manager.openOrReveal(item.path);
                        });
                    });
                    firstWidgetPlaced.resolve(void 0);
                }
                return widget;
            });
        }
        // Start the drag and remove the mousemove and mouseup listeners.
        document.removeEventListener('mousemove', this, true);
        document.removeEventListener('mouseup', this, true);
        clearTimeout(this._selectTimer);
        void this._drag.start(clientX, clientY).then(action => {
            this._drag = null;
            clearTimeout(this._selectTimer);
        });
    }
    /**
     * Handle selection on a file node.
     */
    handleFileSelect(event) {
        // Fetch common variables.
        const items = this._sortedItems;
        const index = listing_Private.hitTestNodes(this._items, event);
        clearTimeout(this._selectTimer);
        if (index === -1) {
            return;
        }
        // Clear any existing soft selection.
        this._softSelection = '';
        const path = items[index].path;
        const selected = Object.keys(this.selection);
        const isLeftClickOnCheckbox = event.button === 0 &&
            // On Mac, a left-click with the ctrlKey is treated as a right-click.
            !(IS_MAC && event.ctrlKey) &&
            this.isWithinCheckboxHitArea(event);
        // Handle toggling.
        if ((IS_MAC && event.metaKey) ||
            (!IS_MAC && event.ctrlKey) ||
            isLeftClickOnCheckbox) {
            if (this.selection[path]) {
                delete this.selection[path];
            }
            else {
                this.selection[path] = true;
            }
            this._selectionChanged.emit();
            this._focusItem(index);
            // Handle multiple select.
        }
        else if (event.shiftKey) {
            this._handleMultiSelect(index);
            this._focusItem(index);
            // Handle a 'soft' selection
        }
        else if (path in this.selection && selected.length > 1) {
            this._softSelection = path;
            // Default to selecting the only the item.
        }
        else {
            // Select only the given item.
            return this._selectItem(index, false, true);
        }
        this.update();
    }
    /**
     * (Re-)focus an item in the directory listing.
     *
     * @param index The index of the item node to focus
     */
    _focusItem(index) {
        const items = this._items;
        if (items.length === 0) {
            // Focus the top node if the folder is empty and therefore there are no
            // items inside the folder to focus.
            this._focusIndex = 0;
            this.node.focus();
            return;
        }
        this._focusIndex = index;
        const node = items[index];
        const nameNode = this.renderer.getNameNode(node);
        if (nameNode) {
            // Make the filename text node focusable so that it receives keyboard
            // events; text node was specifically chosen to receive shortcuts because
            // it gets substituted with input element during file name edits which
            // conveniently deactivates irrelevant shortcuts.
            nameNode.tabIndex = 0;
            nameNode.focus();
        }
    }
    /**
     * Are all of the items between two provided indices selected?
     *
     * The items at the indices are not considered.
     *
     * @param j Index of one item.
     * @param k Index of another item. Note: may be less or greater than first
     *          index.
     * @returns True if and only if all items between the j and k are selected.
     *          Returns undefined if j and k are the same.
     */
    _allSelectedBetween(j, k) {
        if (j === k) {
            return;
        }
        const [start, end] = j < k ? [j + 1, k] : [k + 1, j];
        return this._sortedItems
            .slice(start, end)
            .reduce((result, item) => result && this.selection[item.path], true);
    }
    /**
     * Handle a multiple select on a file item node.
     */
    _handleMultiSelect(index) {
        const items = this._sortedItems;
        const fromIndex = this._focusIndex;
        const target = items[index];
        let shouldAdd = true;
        if (index === fromIndex) {
            // This follows the convention in Ubuntu and Windows, which is to allow
            // the focussed item to gain but not lose selected status on shift-click.
            // (MacOS is irrelevant here because MacOS Finder has no notion of a
            // focused-but-not-selected state.)
            if (!this.selection[target.path]) {
                this.selection[target.path] = true;
                this._selectionChanged.emit();
            }
            return;
        }
        // If the target and all items in-between are selected, then we assume that
        // the user is trying to shrink rather than grow the group of selected
        // items.
        if (this.selection[target.path]) {
            // However, there is a special case when the distance between the from-
            // and to- index is just one (for example, when the user is pressing the
            // shift key plus arrow-up/down). If and only if the situation looks like
            // the following when going down (or reverse when going up) ...
            //
            // - [ante-anchor / previous item] unselected (or boundary)
            // - [anchor / currently focussed item / item at from-index] selected
            // - [target / next item / item at to-index] selected
            //
            // ... then we shrink the selection / unselect the currently focussed
            // item.
            if (Math.abs(index - fromIndex) === 1) {
                const anchor = items[fromIndex];
                const anteAnchor = items[fromIndex + (index < fromIndex ? 1 : -1)];
                if (
                // Currently focussed item is selected
                this.selection[anchor.path] &&
                    // Item on other side of focussed item (away from target) is either a
                    // boundary or unselected
                    (!anteAnchor || !this.selection[anteAnchor.path])) {
                    delete this.selection[anchor.path];
                    this._selectionChanged.emit();
                }
            }
            else if (this._allSelectedBetween(fromIndex, index)) {
                shouldAdd = false;
            }
        }
        // Select (or unselect) the rows between chosen index (target) and the last
        // focussed.
        const step = fromIndex < index ? 1 : -1;
        let selectionModified = false;
        for (let i = fromIndex; i !== index + step; i += step) {
            if (shouldAdd) {
                if (i === fromIndex) {
                    // Do not change the selection state of the starting (fromIndex) item.
                    continue;
                }
                if (!this.selection[items[i].path]) {
                    this.selection[items[i].path] = true;
                    selectionModified = true;
                }
            }
            else {
                if (i === index) {
                    // Do not unselect the target item.
                    continue;
                }
                if (this.selection[items[i].path]) {
                    delete this.selection[items[i].path];
                    selectionModified = true;
                }
            }
        }
        if (selectionModified) {
            this._selectionChanged.emit();
        }
    }
    /**
     * Copy the selected items, and optionally cut as well.
     */
    _copy() {
        this._clipboard.length = 0;
        for (const item of this.selectedItems()) {
            this._clipboard.push(item.path);
        }
    }
    /**
     * Delete the files with the given paths.
     */
    async _delete(paths) {
        await Promise.all(paths.map(path => this._model.manager.deleteFile(path).catch(err => {
            void (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Delete Failed'), err);
        })));
    }
    /**
     * Allow the user to rename item on a given row.
     */
    async _doRename() {
        this._inRename = true;
        const selectedPaths = Object.keys(this.selection);
        // Bail out if nothing has been selected.
        if (selectedPaths.length === 0) {
            this._inRename = false;
            return Promise.resolve('');
        }
        // Figure out which selected path to use for the rename.
        const items = this._sortedItems;
        let { path } = items[this._focusIndex];
        if (!this.selection[path]) {
            // If the currently focused item is not selected, then choose the last
            // selected item.
            path = selectedPaths.slice(-1)[0];
        }
        // Get the corresponding model, nodes, and file name.
        const index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(items, value => value.path === path);
        const row = this._items[index];
        const item = items[index];
        const nameNode = this.renderer.getNameNode(row);
        const original = item.name;
        // Seed the text input with current file name, and select and focus it.
        this._editNode.value = original;
        this._selectItem(index, false, true);
        // Wait for user input
        const newName = await listing_Private.userInputForRename(nameNode, this._editNode, original);
        // Check if the widget was disposed during the `await`.
        if (this.isDisposed) {
            this._inRename = false;
            throw new Error('File browser is disposed.');
        }
        let finalFilename = newName;
        if (!newName || newName === original) {
            finalFilename = original;
        }
        else if (!(0,docmanager_lib_index_js_.isValidFileName)(newName)) {
            void (0,index_js_.showErrorMessage)(this._trans.__('Rename Error'), Error(this._trans._p('showErrorMessage', '"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"', newName)));
            finalFilename = original;
        }
        else {
            // Attempt rename at the file system level.
            const manager = this._manager;
            const oldPath = lib_index_js_.PathExt.join(this._model.path, original);
            const newPath = lib_index_js_.PathExt.join(this._model.path, newName);
            try {
                await (0,docmanager_lib_index_js_.renameFile)(manager, oldPath, newPath);
            }
            catch (error) {
                if (error !== 'File not renamed') {
                    void (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Rename Error'), error);
                }
                finalFilename = original;
            }
            // Check if the widget was disposed during the `await`.
            if (this.isDisposed) {
                this._inRename = false;
                throw new Error('File browser is disposed.');
            }
        }
        // If nothing else has been selected, then select the renamed file. In
        // other words, don't select the renamed file if the user has clicked
        // away to some other file.
        if (!this.isDisposed &&
            Object.keys(this.selection).length === 1 &&
            // We haven't updated the instance yet to reflect the rename, so unless
            // the user or something else has updated the selection, the original file
            // path and not the new file path will be in `this.selection`.
            this.selection[item.path]) {
            try {
                await this._selectItemByName(finalFilename, true, true);
            }
            catch (_a) {
                // do nothing
                console.warn('After rename, failed to select file', finalFilename);
            }
        }
        this._inRename = false;
        return finalFilename;
    }
    /**
     * Select a given item.
     */
    _selectItem(index, keepExisting, focus = true) {
        // Selected the given row(s)
        const items = this._sortedItems;
        if (!keepExisting) {
            this.clearSelectedItems();
        }
        const path = items[index].path;
        this.selection[path] = true;
        this._selectionChanged.emit();
        if (focus) {
            this._focusItem(index);
        }
        this.update();
    }
    /**
     * Handle the `refreshed` signal from the model.
     */
    _onModelRefreshed() {
        // Update the selection.
        const existing = Object.keys(this.selection);
        this.clearSelectedItems(false);
        for (const item of this._model.items()) {
            const path = item.path;
            if (existing.indexOf(path) !== -1) {
                this.selection[path] = true;
            }
        }
        if (this.isVisible) {
            // Update the sorted items.
            this.sort(this.sortState);
        }
        else {
            this._isDirty = true;
        }
    }
    /**
     * Handle a `pathChanged` signal from the model.
     */
    _onPathChanged() {
        // Reset the selection.
        this.clearSelectedItems();
        // Update the sorted items.
        this.sort(this.sortState);
        // Reset focus. But wait until the DOM has been updated (hence
        // `requestAnimationFrame`).
        requestAnimationFrame(() => {
            this._focusItem(0);
        });
    }
    /**
     * Handle a `fileChanged` signal from the model.
     */
    _onFileChanged(sender, args) {
        const newValue = args.newValue;
        if (!newValue) {
            return;
        }
        const name = newValue.name;
        if (args.type !== 'new' || !name) {
            return;
        }
        void this.selectItemByName(name).catch(() => {
            /* Ignore if file does not exist. */
        });
    }
    /**
     * Handle an `activateRequested` signal from the manager.
     */
    _onActivateRequested(sender, args) {
        const dirname = lib_index_js_.PathExt.dirname(args);
        if (dirname !== this._model.path) {
            return;
        }
        const basename = lib_index_js_.PathExt.basename(args);
        this.selectItemByName(basename).catch(() => {
            /* Ignore if file does not exist. */
        });
    }
}
/**
 * The namespace for the `DirListing` class statics.
 */
(function (DirListing) {
    /**
     * Column definitions.
     */
    DirListing.columns = [
        {
            id: 'is_selected',
            className: CHECKBOX_WRAPPER_CLASS,
            itemClassName: CHECKBOX_WRAPPER_CLASS,
            minWidth: 18,
            resizable: false,
            sortable: false,
            grow: 0
        },
        {
            id: 'name',
            className: NAME_ID_CLASS,
            itemClassName: ITEM_NAME_COLUMN_CLASS,
            minWidth: 60,
            resizable: true,
            sortable: true,
            caretSide: 'right',
            grow: 3
        },
        {
            id: 'last_modified',
            className: MODIFIED_ID_CLASS,
            itemClassName: ITEM_MODIFIED_CLASS,
            minWidth: 60,
            resizable: true,
            sortable: true,
            caretSide: 'left',
            grow: 1
        },
        {
            id: 'file_size',
            className: FILE_SIZE_ID_CLASS,
            itemClassName: ITEM_FILE_SIZE_CLASS,
            minWidth: 60,
            resizable: true,
            sortable: true,
            caretSide: 'left',
            grow: 0.5
        }
    ];
    /**
     * The default implementation of an `IRenderer`.
     */
    class Renderer {
        constructor() {
            /**
             * Factories for individual parts of the item.
             */
            this.itemFactories = {
                name: () => {
                    const name = document.createElement('span');
                    const icon = document.createElement('span');
                    const text = document.createElement('span');
                    icon.className = ITEM_ICON_CLASS;
                    text.className = ITEM_TEXT_CLASS;
                    name.className = ITEM_NAME_COLUMN_CLASS;
                    name.appendChild(icon);
                    name.appendChild(text);
                    return name;
                },
                last_modified: () => {
                    const modified = document.createElement('span');
                    modified.className = ITEM_MODIFIED_CLASS;
                    return modified;
                },
                file_size: () => {
                    const fileSize = document.createElement('span');
                    fileSize.className = ITEM_FILE_SIZE_CLASS;
                    return fileSize;
                },
                is_selected: () => this.createCheckboxWrapperNode()
            };
            /**
             * Register of most recent arguments for last modified column update.
             */
            this._modifiedColumnLastUpdate = new WeakMap();
            this._lastRenderedState = new WeakMap();
        }
        /**
         * Create the DOM node for a dir listing.
         */
        createNode() {
            const node = document.createElement('div');
            const header = document.createElement('div');
            const content = document.createElement('ul');
            // Allow the node to scroll while dragging items.
            content.setAttribute('data-lm-dragscroll', 'true');
            content.className = CONTENT_CLASS;
            header.className = HEADER_CLASS;
            node.appendChild(header);
            node.appendChild(content);
            // Set to -1 to allow calling this.node.focus().
            node.tabIndex = -1;
            return node;
        }
        /**
         * Populate and empty header node for a dir listing.
         *
         * @param node - The header node to populate.
         */
        populateHeaderNode(node, translator, hiddenColumns, columnsSizes) {
            translator = translator || translation_lib_index_js_.nullTranslator;
            const trans = translator.load('jupyterlab');
            const elementCreators = {
                name: () => this.createHeaderItemNode(trans.__('Name')),
                last_modified: () => this._createHeaderItemNodeWithSizes({
                    small: trans.__('Modified'),
                    large: trans.__('Last Modified')
                }),
                file_size: () => this._createHeaderItemNodeWithSizes({
                    small: trans.__('Size'),
                    large: trans.__('File Size')
                }),
                is_selected: () => this.createCheckboxWrapperNode({
                    alwaysVisible: true,
                    headerNode: true
                })
            };
            const visibleColumns = DirListing.columns.filter(column => column.id === 'name' || !(hiddenColumns === null || hiddenColumns === void 0 ? void 0 : hiddenColumns.has(column.id)));
            for (const column of visibleColumns) {
                const createElement = elementCreators[column.id];
                const element = createElement();
                element.classList.add(column.className);
                const isLastVisible = column.id === visibleColumns[visibleColumns.length - 1].id;
                if (columnsSizes) {
                    const size = columnsSizes[column.id];
                    if (!isLastVisible) {
                        element.style.width = size + 'px';
                    }
                }
                node.appendChild(element);
                if (listing_Private.isResizable(column) && !isLastVisible) {
                    const resizer = document.createElement('div');
                    resizer.classList.add(RESIZE_HANDLE_CLASS);
                    resizer.dataset.column = column.id;
                    node.appendChild(resizer);
                }
            }
            const name = index_js_.DOMUtils.findElement(node, NAME_ID_CLASS);
            name.classList.add(SELECTED_CLASS);
            // set the initial caret icon
            listing_Private.updateCaret(index_js_.DOMUtils.findElement(name, HEADER_ITEM_ICON_CLASS), 'right', 'up');
        }
        /**
         * Handle a header click.
         *
         * @param node - A node populated by [[populateHeaderNode]].
         *
         * @param event - A click event on the node.
         *
         * @returns The sort state of the header after the click event.
         */
        handleHeaderClick(node, event) {
            const state = { direction: 'ascending', key: 'name' };
            const target = event.target;
            const sortableColumns = DirListing.columns.filter(listing_Private.isSortable);
            for (const column of sortableColumns) {
                const header = node.querySelector(`.${column.className}`);
                if (!header) {
                    // skip if the column is hidden
                    continue;
                }
                if (header.contains(target)) {
                    state.key = column.id;
                    const headerIcon = index_js_.DOMUtils.findElement(header, HEADER_ITEM_ICON_CLASS);
                    if (header.classList.contains(SELECTED_CLASS)) {
                        if (!header.classList.contains(DESCENDING_CLASS)) {
                            state.direction = 'descending';
                            header.classList.add(DESCENDING_CLASS);
                            listing_Private.updateCaret(headerIcon, column.caretSide, 'down');
                        }
                        else {
                            header.classList.remove(DESCENDING_CLASS);
                            listing_Private.updateCaret(headerIcon, column.caretSide, 'up');
                        }
                    }
                    else {
                        header.classList.remove(DESCENDING_CLASS);
                        listing_Private.updateCaret(headerIcon, column.caretSide, 'up');
                    }
                    header.classList.add(SELECTED_CLASS);
                    for (const otherColumn of sortableColumns) {
                        if (otherColumn.id === column.id) {
                            continue;
                        }
                        const otherHeader = node.querySelector(`.${otherColumn.className}`);
                        if (!otherHeader) {
                            // skip if hidden
                            continue;
                        }
                        otherHeader.classList.remove(SELECTED_CLASS);
                        otherHeader.classList.remove(DESCENDING_CLASS);
                        const otherHeaderIcon = index_js_.DOMUtils.findElement(otherHeader, HEADER_ITEM_ICON_CLASS);
                        listing_Private.updateCaret(otherHeaderIcon, otherColumn.caretSide);
                    }
                    return state;
                }
            }
            return state;
        }
        /**
         * Create a new item node for a dir listing.
         *
         * @returns A new DOM node to use as a content item.
         */
        createItemNode(hiddenColumns, columnsSizes) {
            const node = document.createElement('li');
            for (const column of DirListing.columns) {
                if (column.id != 'name' && (hiddenColumns === null || hiddenColumns === void 0 ? void 0 : hiddenColumns.has(column.id))) {
                    continue;
                }
                const createElement = this.itemFactories[column.id];
                const element = createElement();
                node.appendChild(element);
                if (columnsSizes) {
                    const size = columnsSizes[column.id];
                    element.style.width = size + 'px';
                }
            }
            return node;
        }
        /**
         * Creates a node containing a checkbox.
         *
         * We wrap the checkbox in a label element in order to increase its hit
         * area. This is because the padding of the checkbox itself cannot be
         * increased via CSS, as the CSS/form compatibility table at the following
         * url from MDN shows:
         * https://developer.mozilla.org/en-US/docs/Learn/Forms/Property_compatibility_table_for_form_controls#check_boxes_and_radio_buttons
         *
         * @param [options]
         * @params options.alwaysVisible Should the checkbox be visible even when
         * not hovered?
         * @returns A new DOM node that contains a checkbox.
         */
        createCheckboxWrapperNode(options) {
            // Wrap the checkbox in a label element in order to increase its hit area.
            const labelWrapper = document.createElement('label');
            labelWrapper.classList.add(CHECKBOX_WRAPPER_CLASS);
            const checkbox = document.createElement('input');
            checkbox.type = 'checkbox';
            // Prevent the user from clicking (via mouse, keyboard, or touch) the
            // checkbox since other code handles the mouse and keyboard events and
            // controls the checked state of the checkbox.
            if (!(options === null || options === void 0 ? void 0 : options.headerNode)) {
                checkbox.addEventListener('click', event => {
                    event.preventDefault();
                });
            }
            // The individual file checkboxes are visible on hover, but the header
            // check-all checkbox is always visible.
            if (options === null || options === void 0 ? void 0 : options.alwaysVisible) {
                labelWrapper.classList.add('jp-mod-visible');
            }
            else {
                // Disable tabbing to all other checkboxes.
                checkbox.tabIndex = -1;
            }
            labelWrapper.appendChild(checkbox);
            return labelWrapper;
        }
        /**
         * Update an item's last modified date.
         *
         * @param modified - Element containing the file's last modified date.
         *
         * @param modifiedDate - String representation of the last modified date.
         *
         * @param modifiedStyle - The date style for the modified column: narrow, short, or long
         */
        updateItemModified(modified, modifiedDate, modifiedStyle) {
            // Formatting dates is expensive (0.1-0.2ms per call,
            // so over 150 files can easily already choke the renderer),
            // let's do the bare minimum check of comparing if an update
            // is needed using a last update cache:
            const previousUpdate = this._modifiedColumnLastUpdate.get(modified);
            if ((previousUpdate === null || previousUpdate === void 0 ? void 0 : previousUpdate.date) === modifiedDate &&
                (previousUpdate === null || previousUpdate === void 0 ? void 0 : previousUpdate.style) === modifiedStyle) {
                return;
            }
            const parsedDate = new Date(modifiedDate);
            // Render the date in one of multiple formats, depending on the container's size
            const modText = lib_index_js_.Time.formatHuman(parsedDate, modifiedStyle);
            const modTitle = lib_index_js_.Time.format(parsedDate);
            modified.textContent = modText;
            modified.title = modTitle;
            this._modifiedColumnLastUpdate.set(modified, {
                date: modifiedDate,
                style: modifiedStyle
            });
        }
        /**
         * Update an item node to reflect the current state of a model.
         *
         * @param node - A node created by [[createItemNode]].
         *
         * @param model - The model object to use for the item state.
         *
         * @param fileType - The file type of the item, if applicable.
         *
         */
        updateItemNode(node, model, fileType, translator, hiddenColumns, selected, modifiedStyle, columnsSizes) {
            if (selected) {
                node.classList.add(SELECTED_CLASS);
            }
            fileType =
                fileType || docregistry_lib_index_js_.DocumentRegistry.getDefaultTextFileType(translator);
            const { icon, iconClass, name } = fileType;
            translator = translator || translation_lib_index_js_.nullTranslator;
            const trans = translator.load('jupyterlab');
            const prevState = this._lastRenderedState.get(node);
            const newState = JSON.stringify({
                name: model.name,
                selected,
                lastModified: model.last_modified,
                modifiedStyle,
                hiddenColumns,
                columnsSizes,
                fileSize: model.size
            });
            const checkboxWrapper = index_js_.DOMUtils.findElement(node, CHECKBOX_WRAPPER_CLASS);
            const checkbox = checkboxWrapper === null || checkboxWrapper === void 0 ? void 0 : checkboxWrapper.querySelector('input[type="checkbox"]');
            if (checkbox)
                checkbox.checked = selected !== null && selected !== void 0 ? selected : false;
            if (prevState === newState)
                return;
            this._lastRenderedState.set(node, newState);
            const iconContainer = index_js_.DOMUtils.findElement(node, ITEM_ICON_CLASS);
            const text = index_js_.DOMUtils.findElement(node, ITEM_TEXT_CLASS);
            const nameColumn = index_js_.DOMUtils.findElement(node, ITEM_NAME_COLUMN_CLASS);
            let modified = index_js_.DOMUtils.findElement(node, ITEM_MODIFIED_CLASS);
            let fileSize = index_js_.DOMUtils.findElement(node, ITEM_FILE_SIZE_CLASS);
            const showFileCheckboxes = !(hiddenColumns === null || hiddenColumns === void 0 ? void 0 : hiddenColumns.has('is_selected'));
            if (checkboxWrapper && !showFileCheckboxes) {
                node.removeChild(checkboxWrapper);
            }
            else if (showFileCheckboxes && !checkboxWrapper) {
                const checkboxWrapper = this.createCheckboxWrapperNode();
                nameColumn.insertAdjacentElement('beforebegin', checkboxWrapper);
            }
            const showModified = !(hiddenColumns === null || hiddenColumns === void 0 ? void 0 : hiddenColumns.has('last_modified'));
            if (modified && !showModified) {
                node.removeChild(modified);
            }
            else if (showModified && !modified) {
                modified = this.itemFactories.last_modified();
                nameColumn.insertAdjacentElement('afterend', modified);
            }
            const showFileSize = !(hiddenColumns === null || hiddenColumns === void 0 ? void 0 : hiddenColumns.has('file_size'));
            if (fileSize && !showFileSize) {
                node.removeChild(fileSize);
            }
            else if (showFileSize && !fileSize) {
                fileSize = this.itemFactories.file_size();
                (modified !== null && modified !== void 0 ? modified : nameColumn).insertAdjacentElement('afterend', fileSize);
            }
            // render the file item's icon
            requestAnimationFrame(() => {
                ui_components_lib_index_js_.LabIcon.resolveElement({
                    icon,
                    iconClass: (0,ui_components_lib_index_js_.classes)(iconClass, 'jp-Icon'),
                    container: iconContainer,
                    className: ITEM_ICON_CLASS,
                    stylesheet: 'listing'
                });
            });
            let hoverText = trans.__('Name: %1', model.name);
            // add file size to pop up if its available
            if (model.size !== null && model.size !== undefined) {
                const fileSizeText = formatFileSize(model.size, 1, 1024);
                if (fileSize) {
                    fileSize.textContent = fileSizeText;
                }
                hoverText += trans.__('\nSize: %1', formatFileSize(model.size, 1, 1024));
            }
            else if (fileSize) {
                fileSize.textContent = '';
            }
            if (model.path) {
                const dirname = lib_index_js_.PathExt.dirname(model.path);
                if (dirname) {
                    hoverText += trans.__('\nPath: %1', dirname.substr(0, 50));
                    if (dirname.length > 50) {
                        hoverText += '...';
                    }
                }
            }
            if (model.created) {
                hoverText += trans.__('\nCreated: %1', lib_index_js_.Time.format(new Date(model.created)));
            }
            if (model.last_modified) {
                hoverText += trans.__('\nModified: %1', lib_index_js_.Time.format(new Date(model.last_modified)));
            }
            hoverText += trans.__('\nWritable: %1', model.writable);
            node.title = hoverText;
            node.setAttribute('data-file-type', name);
            if (model.name.startsWith('.')) {
                node.setAttribute('data-is-dot', 'true');
            }
            else {
                node.removeAttribute('data-is-dot');
            }
            // If an item is being edited currently, its text node is unavailable.
            const indices = !model.indices ? [] : model.indices;
            let highlightedName = algorithm_dist_index_es6_js_.StringExt.highlight(model.name, indices, virtualdom_dist_index_es6_js_.h.mark);
            if (text) {
                virtualdom_dist_index_es6_js_.VirtualDOM.render(virtualdom_dist_index_es6_js_.h.span(highlightedName), text);
            }
            // Adds an aria-label to the checkbox element.
            if (checkbox) {
                let ariaLabel;
                if (fileType.contentType === 'directory') {
                    ariaLabel = selected
                        ? trans.__('Deselect directory "%1"', highlightedName)
                        : trans.__('Select directory "%1"', highlightedName);
                }
                else {
                    ariaLabel = selected
                        ? trans.__('Deselect file "%1"', highlightedName)
                        : trans.__('Select file "%1"', highlightedName);
                }
                checkbox.setAttribute('aria-label', ariaLabel);
                checkbox.checked = selected !== null && selected !== void 0 ? selected : false;
            }
            this.updateItemSize(node, model, modifiedStyle, columnsSizes);
        }
        /**
         * Update size of item nodes, assuming that model has not changed.
         */
        updateItemSize(node, model, modifiedStyle, columnsSizes) {
            if (columnsSizes) {
                for (const column of DirListing.columns) {
                    const element = index_js_.DOMUtils.findElement(node, column.itemClassName);
                    if (!element) {
                        continue;
                    }
                    const sizeSpec = columnsSizes[column.id];
                    const newWidth = sizeSpec === null ? '' : sizeSpec + 'px';
                    if (newWidth !== element.style.width) {
                        element.style.width = newWidth;
                    }
                }
            }
            let modified = index_js_.DOMUtils.findElement(node, ITEM_MODIFIED_CLASS);
            if (model.last_modified && modified) {
                this.updateItemModified(modified, model.last_modified, modifiedStyle !== null && modifiedStyle !== void 0 ? modifiedStyle : 'short');
            }
        }
        /**
         * Get the node containing the file name.
         *
         * @param node - A node created by [[createItemNode]].
         *
         * @returns The node containing the file name.
         */
        getNameNode(node) {
            return index_js_.DOMUtils.findElement(node, ITEM_TEXT_CLASS);
        }
        /**
         * Get the checkbox input element node.
         *
         * @param node A node created by [[createItemNode]] or
         * [[createHeaderItemNode]]
         *
         * @returns The checkbox node.
         */
        getCheckboxNode(node) {
            return node.querySelector(`.${CHECKBOX_WRAPPER_CLASS} input[type=checkbox]`);
        }
        /**
         * Create a drag image for an item.
         *
         * @param node - A node created by [[createItemNode]].
         *
         * @param count - The number of items being dragged.
         *
         * @param fileType - The file type of the item, if applicable.
         *
         * @returns An element to use as the drag image.
         */
        createDragImage(node, count, trans, fileType) {
            const dragImage = node.cloneNode(true);
            const icon = index_js_.DOMUtils.findElement(dragImage, ITEM_ICON_CLASS);
            // Hide additional columns from the drag image to keep it unobtrusive.
            const extraColumns = DirListing.columns.filter(column => column.id !== 'name');
            for (const extraColumn of extraColumns) {
                const columnElement = index_js_.DOMUtils.findElement(dragImage, extraColumn.itemClassName);
                if (!columnElement) {
                    // We can only remove columns which are rendered.
                    continue;
                }
                dragImage.removeChild(columnElement);
            }
            if (!fileType) {
                icon.textContent = '';
                icon.className = '';
            }
            else {
                icon.textContent = fileType.iconLabel || '';
                icon.className = fileType.iconClass || '';
            }
            icon.classList.add(DRAG_ICON_CLASS);
            if (count > 1) {
                const nameNode = index_js_.DOMUtils.findElement(dragImage, ITEM_TEXT_CLASS);
                nameNode.textContent = trans._n('%1 Item', '%1 Items', count);
            }
            return dragImage;
        }
        /**
         * Create a node for a header item.
         */
        createHeaderItemNode(label) {
            const node = document.createElement('div');
            const text = document.createElement('span');
            const icon = document.createElement('span');
            node.className = HEADER_ITEM_CLASS;
            text.className = HEADER_ITEM_TEXT_CLASS;
            icon.className = HEADER_ITEM_ICON_CLASS;
            text.textContent = label;
            node.appendChild(text);
            node.appendChild(icon);
            return node;
        }
        /**
         * Create a node for a header item with multiple sizes.
         */
        _createHeaderItemNodeWithSizes(labels) {
            const node = document.createElement('div');
            node.className = HEADER_ITEM_CLASS;
            const icon = document.createElement('span');
            icon.className = HEADER_ITEM_ICON_CLASS;
            for (let k of Object.keys(labels)) {
                const text = document.createElement('span');
                text.classList.add(HEADER_ITEM_TEXT_CLASS, HEADER_ITEM_TEXT_CLASS + '-' + k);
                text.textContent = labels[k];
                node.appendChild(text);
            }
            node.appendChild(icon);
            return node;
        }
    }
    DirListing.Renderer = Renderer;
    /**
     * The default `IRenderer` instance.
     */
    DirListing.defaultRenderer = new Renderer();
})(DirListing || (DirListing = {}));
/**
 * The namespace for the listing private data.
 */
var listing_Private;
(function (Private) {
    /**
     * Handle editing text on a node.
     *
     * @returns Boolean indicating whether the name changed.
     */
    function userInputForRename(text, edit, original) {
        const parent = text.parentElement;
        parent.replaceChild(edit, text);
        edit.focus();
        const index = edit.value.lastIndexOf('.');
        if (index === -1) {
            edit.setSelectionRange(0, edit.value.length);
        }
        else {
            edit.setSelectionRange(0, index);
        }
        return new Promise(resolve => {
            edit.onblur = () => {
                parent.replaceChild(text, edit);
                resolve(edit.value);
            };
            edit.onkeydown = (event) => {
                switch (event.keyCode) {
                    case 13: // Enter
                        event.stopPropagation();
                        event.preventDefault();
                        edit.blur();
                        break;
                    case 27: // Escape
                        event.stopPropagation();
                        event.preventDefault();
                        edit.value = original;
                        edit.blur();
                        // Put focus back on the text node. That way the user can, for
                        // example, press the keyboard shortcut to go back into edit mode,
                        // and it will work.
                        text.focus();
                        break;
                    default:
                        break;
                }
            };
        });
    }
    Private.userInputForRename = userInputForRename;
    /**
     * Sort a list of items by sort state as a new array.
     */
    function sort(items, state, sortNotebooksFirst = false, translator) {
        const copy = Array.from(items);
        const reverse = state.direction === 'descending' ? 1 : -1;
        /**
         * Compares two items and returns whether they should have a fixed priority.
         * The fixed priority enables to always sort the directories above the other files. And to sort the notebook above other files if the `sortNotebooksFirst` is true.
         */
        function isPriorityOverridden(a, b) {
            if (sortNotebooksFirst) {
                return a.type !== b.type;
            }
            return (a.type === 'directory') !== (b.type === 'directory');
        }
        /**
         * Returns the priority of a file.
         */
        function getPriority(item) {
            if (item.type === 'directory') {
                return 2;
            }
            if (item.type === 'notebook' && sortNotebooksFirst) {
                return 1;
            }
            return 0;
        }
        /**
         * Compare two items by their name using `translator.languageCode`, with fallback to `navigator.language`.
         */
        function compareByName(a, b) {
            var _a;
            // Wokaround for Chromium invalid language code on CI, see
            // https://github.com/jupyterlab/jupyterlab/issues/17079
            const navigatorLanguage = navigator.language.split('@')[0];
            const languageCode = ((_a = translator.languageCode) !== null && _a !== void 0 ? _a : navigatorLanguage).replace('_', '-');
            try {
                return a.name.localeCompare(b.name, languageCode, {
                    numeric: true,
                    sensitivity: 'base'
                });
            }
            catch (e) {
                console.warn(`localeCompare failed to compare ${a.name} and ${b.name} under languageCode: ${languageCode}`);
                return a.name.localeCompare(b.name, navigatorLanguage, {
                    numeric: true,
                    sensitivity: 'base'
                });
            }
        }
        function compare(compare) {
            return (a, b) => {
                // Group directory first, then notebooks, then files
                if (isPriorityOverridden(a, b)) {
                    return getPriority(b) - getPriority(a);
                }
                const compared = compare(a, b);
                if (compared !== 0) {
                    return compared * reverse;
                }
                // Default sorting is alphabetical ascending
                return compareByName(a, b);
            };
        }
        if (state.key === 'last_modified') {
            // Sort by last modified
            copy.sort(compare((a, b) => {
                return (new Date(a.last_modified).getTime() -
                    new Date(b.last_modified).getTime());
            }));
        }
        else if (state.key === 'file_size') {
            // Sort by size
            copy.sort(compare((a, b) => {
                var _a, _b;
                return ((_a = b.size) !== null && _a !== void 0 ? _a : 0) - ((_b = a.size) !== null && _b !== void 0 ? _b : 0);
            }));
        }
        else {
            // Sort by name
            copy.sort(compare((a, b) => {
                return compareByName(b, a);
            }));
        }
        return copy;
    }
    Private.sort = sort;
    /**
     * Check if the column is resizable.
     */
    Private.isResizable = (column) => {
        return 'resizable' in column && column.resizable;
    };
    /**
     * Check if the column is sortable.
     */
    Private.isSortable = (column) => {
        return 'sortable' in column && column.sortable;
    };
    /**
     * Get the index of the node at a client position, or `-1`.
     */
    function hitTestNodes(nodes, event) {
        return algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(nodes, node => domutils_dist_index_es6_js_.ElementExt.hitTest(node, event.clientX, event.clientY) ||
            event.target === node);
    }
    Private.hitTestNodes = hitTestNodes;
    /**
     * Update an inline svg caret icon in a node.
     */
    function updateCaret(container, float, state) {
        if (state) {
            (state === 'down' ? ui_components_lib_index_js_.caretDownIcon : ui_components_lib_index_js_.caretUpIcon).element({
                container,
                tag: 'span',
                stylesheet: 'listingHeaderItem'
            });
            if (float === 'left') {
                container.style.order = '-1';
            }
            else {
                container.style.order = '';
            }
        }
        else {
            ui_components_lib_index_js_.LabIcon.remove(container);
            container.className = HEADER_ITEM_ICON_CLASS;
        }
    }
    Private.updateCaret = updateCaret;
    async function createDirectory(manager, path, name) {
        const model = await manager.newUntitled({
            path: path,
            type: 'directory'
        });
        const tmpDirPath = lib_index_js_.PathExt.join(path, model.name);
        const dirPath = lib_index_js_.PathExt.join(path, name);
        try {
            await manager.rename(tmpDirPath, dirPath);
        }
        catch (e) {
            // The `dirPath` already exists, remove the temporary new directory
            await manager.deleteFile(tmpDirPath);
        }
        return dirPath;
    }
    Private.createDirectory = createDirectory;
    function isDirectoryEntry(entry) {
        return entry.isDirectory;
    }
    Private.isDirectoryEntry = isDirectoryEntry;
    function isFileEntry(entry) {
        return entry.isFile;
    }
    Private.isFileEntry = isFileEntry;
    function defensiveGetAsEntry(item) {
        if (item.webkitGetAsEntry) {
            return item.webkitGetAsEntry();
        }
        if ('getAsEntry' in item) {
            // See https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry
            return item['getAsEntry']();
        }
        return null;
    }
    Private.defensiveGetAsEntry = defensiveGetAsEntry;
    function readEntries(reader) {
        return new Promise((resolve, reject) => reader.readEntries(resolve, reject));
    }
    function readFile(entry) {
        return new Promise((resolve, reject) => entry.file(resolve, reject));
    }
    Private.readFile = readFile;
    async function collectEntries(reader) {
        // Spec requires calling `readEntries` until these are exhausted;
        // in practice this is only required in Chromium-based browsers for >100 files.
        // https://issues.chromium.org/issues/41110876
        const allEntries = [];
        let done = false;
        while (!done) {
            const entries = await readEntries(reader);
            if (entries.length === 0) {
                done = true;
            }
            else {
                allEntries.push(...entries);
            }
        }
        return allEntries;
    }
    Private.collectEntries = collectEntries;
})(listing_Private || (listing_Private = {}));
/**
 * Format bytes to human readable string.
 */
function formatFileSize(bytes, decimalPoint, k) {
    // https://www.codexworld.com/how-to/convert-file-size-bytes-kb-mb-gb-javascript/
    if (bytes === 0) {
        return '0 B';
    }
    const dm = decimalPoint || 2;
    const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
    const i = Math.floor(Math.log(bytes) / Math.log(k));
    if (i >= 0 && i < sizes.length) {
        return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
    }
    else {
        return String(bytes);
    }
}
//# sourceMappingURL=listing.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/browser.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.










/**
 * The class name added to file browsers.
 */
const FILE_BROWSER_CLASS = 'jp-FileBrowser';
/**
 * The class name added to file browser panel (gather filter, breadcrumbs and listing).
 */
const FILE_BROWSER_PANEL_CLASS = 'jp-FileBrowser-Panel';
/**
 * The class name added to the filebrowser crumbs node.
 */
const CRUMBS_CLASS = 'jp-FileBrowser-crumbs';
/**
 * The class name added to the filebrowser toolbar node.
 */
const TOOLBAR_CLASS = 'jp-FileBrowser-toolbar';
/**
 * The class name added to the filebrowser filter toolbar node.
 */
const FILTER_TOOLBAR_CLASS = 'jp-FileBrowser-filterToolbar';
/**
 * The class name added to the filebrowser listing node.
 */
const LISTING_CLASS = 'jp-FileBrowser-listing';
/**
 * The class name added to the filebrowser filterbox node.
 */
const FILTERBOX_CLASS = 'jp-FileBrowser-filterBox';
/**
 * A widget which hosts a file browser.
 *
 * The widget uses the Jupyter Contents API to retrieve contents,
 * and presents itself as a flat list of files and directories with
 * breadcrumbs.
 */
class FileBrowser extends ui_components_lib_index_js_.SidePanel {
    /**
     * Construct a new file browser.
     *
     * @param options - The file browser options.
     */
    constructor(options) {
        var _a;
        super({ content: new dist_index_es6_js_.Panel(), translator: options.translator });
        this._directoryPending = null;
        this._filePending = null;
        this._fileFilterRef = (0,react_index_js_.createRef)();
        this._allowSingleClick = false;
        this._showFileCheckboxes = false;
        this._showFileFilter = false;
        this._showFileSizeColumn = false;
        this._showHiddenFiles = false;
        this._showLastModifiedColumn = true;
        this._sortNotebooksFirst = false;
        this._allowFileUploads = true;
        this._selectionChanged = new index_es6_js_.Signal(this);
        this.addClass(FILE_BROWSER_CLASS);
        this.toolbar.addClass(TOOLBAR_CLASS);
        this.id = options.id;
        const translator = (this.translator = (_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator);
        const model = (this.model = options.model);
        const renderer = options.renderer;
        model.connectionFailure.connect(this._onConnectionFailure, this);
        this._manager = model.manager;
        this.toolbar.node.setAttribute('aria-label', this._trans.__('file browser'));
        // File browser widgets container
        this.mainPanel = new dist_index_es6_js_.Panel();
        this.mainPanel.addClass(FILE_BROWSER_PANEL_CLASS);
        this.mainPanel.title.label = this._trans.__('File Browser');
        this.crumbs = new BreadCrumbs({ model, translator });
        this.crumbs.addClass(CRUMBS_CLASS);
        // The filter toolbar appears immediately below the breadcrumbs and above the directory listing.
        const searcher = (0,ui_components_lib_index_js_.FilenameSearcher)({
            updateFilter: (filterFn, query) => {
                this.model.setFilter(value => {
                    return filterFn(value.name.toLowerCase());
                });
            },
            useFuzzyFilter: this.model.useFuzzyFilter,
            placeholder: this._trans.__('Filter files by name'),
            forceRefresh: false,
            showIcon: false,
            inputRef: this._fileFilterRef,
            filterSettingsChanged: this.model.filterSettingsChanged
        });
        searcher.addClass(FILTERBOX_CLASS);
        this.filterToolbar = new ui_components_lib_index_js_.Toolbar();
        this.filterToolbar.addClass(FILTER_TOOLBAR_CLASS);
        this.filterToolbar.node.setAttribute('aria-label', this._trans.__('File browser toolbar'));
        this.filterToolbar.addItem('fileNameSearcher', searcher);
        this.filterToolbar.setHidden(!this.showFileFilter);
        this.listing = this.createDirListing({
            model,
            renderer,
            translator,
            state: options.state,
            handleOpenFile: options.handleOpenFile
        });
        this.listing.addClass(LISTING_CLASS);
        this.listing.selectionChanged.connect(() => {
            this._selectionChanged.emit();
        });
        this.mainPanel.addWidget(this.crumbs);
        this.mainPanel.addWidget(this.filterToolbar);
        this.mainPanel.addWidget(this.listing);
        this.addWidget(this.mainPanel);
        if (options.restore !== false) {
            void model.restore(this.id);
        }
        // restore listing regardless of the restore option
        void this.listing.restore(this.id);
    }
    /**
     * Whether to show active file in file browser
     */
    get navigateToCurrentDirectory() {
        return this._navigateToCurrentDirectory;
    }
    set navigateToCurrentDirectory(value) {
        this._navigateToCurrentDirectory = value;
    }
    /**
     * Whether to show the last modified column
     */
    get showLastModifiedColumn() {
        return this._showLastModifiedColumn;
    }
    set showLastModifiedColumn(value) {
        if (this.listing.setColumnVisibility) {
            this.listing.setColumnVisibility('last_modified', value);
            this._showLastModifiedColumn = value;
        }
        else {
            console.warn('Listing does not support toggling column visibility');
        }
    }
    /**
     * Number of directory items to show on the left side of the ellipsis in breadcrumbs.
     */
    get minimumBreadcrumbsLeftItems() {
        return this.crumbs.minimumLeftItems;
    }
    set minimumBreadcrumbsLeftItems(value) {
        this.crumbs.minimumLeftItems = value;
    }
    /**
     * Number of directory items to show on the right side of the ellipsis in breadcrumbs.
     */
    get minimumBreadcrumbsRightItems() {
        return this.crumbs.minimumRightItems;
    }
    set minimumBreadcrumbsRightItems(value) {
        this.crumbs.minimumRightItems = value;
    }
    /**
     * Whether to show the full path in the breadcrumbs
     */
    get showFullPath() {
        return this.crumbs.fullPath;
    }
    set showFullPath(value) {
        this.crumbs.fullPath = value;
    }
    /**
     * Whether to show the file size column
     */
    get showFileSizeColumn() {
        return this._showFileSizeColumn;
    }
    set showFileSizeColumn(value) {
        if (this.listing.setColumnVisibility) {
            this.listing.setColumnVisibility('file_size', value);
            this._showFileSizeColumn = value;
        }
        else {
            console.warn('Listing does not support toggling column visibility');
        }
    }
    /**
     * Whether to show hidden files
     */
    get showHiddenFiles() {
        return this._showHiddenFiles;
    }
    set showHiddenFiles(value) {
        this.model.showHiddenFiles(value);
        this._showHiddenFiles = value;
    }
    /**
     * Whether to show checkboxes next to files and folders
     */
    get showFileCheckboxes() {
        return this._showFileCheckboxes;
    }
    set showFileCheckboxes(value) {
        if (this.listing.setColumnVisibility) {
            this.listing.setColumnVisibility('is_selected', value);
            this._showFileCheckboxes = value;
        }
        else {
            console.warn('Listing does not support toggling column visibility');
        }
    }
    /**
     * Whether to show a text box to filter files by name.
     */
    get showFileFilter() {
        return this._showFileFilter;
    }
    set showFileFilter(value) {
        var _a;
        // If the old value was true and the new value is false, clear the filter
        const oldValue = this.showFileFilter;
        if (oldValue && !value) {
            // Clear the search box input
            if (this._fileFilterRef.current) {
                this._fileFilterRef.current.value = '';
            }
            // Set a filter that doesn't exclude anything.
            this.model.setFilter(value => {
                return {};
            });
            this.model.refresh().catch(console.warn);
        }
        this._showFileFilter = value;
        // Update widget visibility
        this.filterToolbar.setHidden(!this.showFileFilter);
        if (this.showFileFilter) {
            (_a = this._fileFilterRef.current) === null || _a === void 0 ? void 0 : _a.focus();
        }
    }
    /**
     * Whether to sort notebooks above other files
     */
    get sortNotebooksFirst() {
        return this._sortNotebooksFirst;
    }
    set sortNotebooksFirst(value) {
        if (this.listing.setNotebooksFirstSorting) {
            this.listing.setNotebooksFirstSorting(value);
            this._sortNotebooksFirst = value;
        }
        else {
            console.warn('Listing does not support sorting notebooks first');
        }
    }
    /**
     * Whether to allow single click files and directories
     */
    get singleClickNavigation() {
        return this._allowSingleClick;
    }
    set singleClickNavigation(value) {
        if (this.listing.setAllowSingleClickNavigation) {
            this.listing.setAllowSingleClickNavigation(value);
            this._allowSingleClick = value;
        }
        else {
            console.warn('Listing does not support single click navigation');
        }
    }
    /**
     * Whether to allow upload of files.
     */
    get allowFileUploads() {
        return this._allowFileUploads;
    }
    set allowFileUploads(value) {
        this.model.allowFileUploads = value;
        if (this.listing.setAllowDragDropUpload) {
            this.listing.setAllowDragDropUpload(value);
            this._allowFileUploads = value;
        }
        else {
            console.warn('Listing does not support setting upload');
        }
    }
    /**
     * Create an iterator over the listing's selected items.
     *
     * @returns A new iterator over the listing's selected items.
     */
    selectedItems() {
        return this.listing.selectedItems();
    }
    /**
     * A signal emitted when the selection changes in the file browser.
     */
    get selectionChanged() {
        return this._selectionChanged;
    }
    /**
     * Select an item by name.
     *
     * @param name - The name of the item to select.
     */
    async selectItemByName(name) {
        await this.listing.selectItemByName(name);
    }
    clearSelectedItems() {
        this.listing.clearSelectedItems();
    }
    /**
     * Rename the first currently selected item.
     *
     * @returns A promise that resolves with the new name of the item.
     */
    rename() {
        return this.listing.rename();
    }
    /**
     * Cut the selected items.
     */
    cut() {
        this.listing.cut();
    }
    /**
     * Copy the selected items.
     */
    copy() {
        this.listing.copy();
    }
    /**
     * Paste the items from the clipboard.
     *
     * @returns A promise that resolves when the operation is complete.
     */
    paste() {
        return this.listing.paste();
    }
    async _createNew(options) {
        // normalize the path if the file is created from a custom drive
        if (options.path) {
            const localPath = this._manager.services.contents.localPath(options.path);
            options.path = this._toDrivePath(this.model.driveName, localPath);
        }
        try {
            const model = await this._manager.newUntitled(options);
            await this.listing.selectItemByName(model.name, true);
            await this.rename();
            return model;
        }
        catch (err) {
            void (0,index_js_.showErrorMessage)(this._trans.__('Error'), err);
            throw err;
        }
    }
    /**
     * Create a new directory
     */
    async createNewDirectory() {
        if (this._directoryPending) {
            return this._directoryPending;
        }
        this._directoryPending = this._createNew({
            path: this.model.path,
            type: 'directory'
        });
        try {
            return await this._directoryPending;
        }
        finally {
            this._directoryPending = null;
        }
    }
    /**
     * Create a new file
     */
    async createNewFile(options) {
        if (this._filePending) {
            return this._filePending;
        }
        this._filePending = this._createNew({
            path: this.model.path,
            type: 'file',
            ext: options.ext
        });
        try {
            return await this._filePending;
        }
        finally {
            this._filePending = null;
        }
    }
    /**
     * Delete the currently selected item(s).
     *
     * @returns A promise that resolves when the operation is complete.
     */
    delete() {
        return this.listing.delete();
    }
    /**
     * Duplicate the currently selected item(s).
     *
     * @returns A promise that resolves when the operation is complete.
     */
    duplicate() {
        return this.listing.duplicate();
    }
    /**
     * Select all listing items.
     */
    selectAll() {
        return this.listing.selectAll();
    }
    /**
     * Download the currently selected item(s).
     */
    download() {
        return this.listing.download();
    }
    /**
     * cd ..
     *
     * Go up one level in the directory tree.
     */
    async goUp() {
        return this.listing.goUp();
    }
    /**
     * Shut down kernels on the applicable currently selected items.
     *
     * @returns A promise that resolves when the operation is complete.
     */
    shutdownKernels() {
        return this.listing.shutdownKernels();
    }
    /**
     * Select next item.
     */
    selectNext() {
        this.listing.selectNext();
    }
    /**
     * Select previous item.
     */
    selectPrevious() {
        this.listing.selectPrevious();
    }
    /**
     * Find a model given a click.
     *
     * @param event - The mouse event.
     *
     * @returns The model for the selected file.
     */
    modelForClick(event) {
        return this.listing.modelForClick(event);
    }
    /**
     * Create the underlying DirListing instance.
     *
     * @param options - The DirListing constructor options.
     *
     * @returns The created DirListing instance.
     */
    createDirListing(options) {
        return new DirListing(options);
    }
    /**
     * Handle a connection lost signal from the model.
     */
    _onConnectionFailure(sender, args) {
        if (args instanceof services_lib_index_js_.ServerConnection.ResponseError &&
            args.response.status === 404) {
            const title = this._trans.__('Directory not found');
            args.message = this._trans.__('Directory not found: "%1"', this.model.path);
            void (0,index_js_.showErrorMessage)(title, args);
        }
    }
    /**
     * Given a drive name and a local path, return the full
     * drive path which includes the drive name and the local path.
     *
     * @param driveName the name of the drive
     * @param localPath the local path on the drive.
     *
     * @returns the full drive path
     */
    _toDrivePath(driveName, localPath) {
        if (driveName === '') {
            return localPath;
        }
        else {
            return `${driveName}:${lib_index_js_.PathExt.removeSlash(localPath)}`;
        }
    }
}
//# sourceMappingURL=browser.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The default duration of the auto-refresh in ms
 */
const DEFAULT_REFRESH_INTERVAL = 10000;
/**
 * The maximum upload size (in bytes) for notebook version < 5.1.0
 */
const LARGE_FILE_SIZE = 15 * 1024 * 1024;
/**
 * The size (in bytes) of the biggest chunk we should upload at once.
 */
const CHUNK_SIZE = 1024 * 1024;
/**
 * An implementation of a file browser model.
 *
 * #### Notes
 * All paths parameters without a leading `'/'` are interpreted as relative to
 * the current directory.  Supports `'../'` syntax.
 */
class FileBrowserModel {
    /**
     * Construct a new file browser model.
     */
    constructor(options) {
        var _a, _b;
        this._connectionFailure = new index_es6_js_.Signal(this);
        this._fileChanged = new index_es6_js_.Signal(this);
        this._items = [];
        this._key = '';
        this._pathChanged = new index_es6_js_.Signal(this);
        this._paths = new Set();
        this._pending = null;
        this._pendingPath = null;
        this._refreshed = new index_es6_js_.Signal(this);
        this._sessions = [];
        this._state = null;
        this._isDisposed = false;
        this._restored = new dist_index_js_.PromiseDelegate();
        this._uploads = [];
        this._uploadChanged = new index_es6_js_.Signal(this);
        this.manager = options.manager;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._driveName = options.driveName || '';
        this._allowFileUploads = (_a = options.allowFileUploads) !== null && _a !== void 0 ? _a : true;
        this._model = {
            path: this.rootPath,
            name: lib_index_js_.PathExt.basename(this.rootPath),
            type: 'directory',
            content: undefined,
            writable: false,
            created: 'unknown',
            last_modified: 'unknown',
            mimetype: 'text/plain',
            format: 'text'
        };
        this._state = options.state || null;
        const refreshInterval = options.refreshInterval || DEFAULT_REFRESH_INTERVAL;
        const { services } = options.manager;
        services.contents.fileChanged.connect(this.onFileChanged, this);
        services.sessions.runningChanged.connect(this.onRunningChanged, this);
        this._unloadEventListener = (e) => {
            if (this._uploads.length > 0) {
                const confirmationMessage = this._trans.__('Files still uploading');
                e.returnValue = confirmationMessage;
                return confirmationMessage;
            }
        };
        window.addEventListener('beforeunload', this._unloadEventListener);
        this._poll = new polling_dist_index_es6_js_.Poll({
            auto: (_b = options.auto) !== null && _b !== void 0 ? _b : true,
            name: '@jupyterlab/filebrowser:Model',
            factory: () => this.cd('.'),
            frequency: {
                interval: refreshInterval,
                backoff: true,
                max: 300 * 1000
            },
            standby: options.refreshStandby || 'when-hidden'
        });
    }
    /**
     * A signal emitted when the file browser model loses connection.
     */
    get connectionFailure() {
        return this._connectionFailure;
    }
    /**
     * The drive name that gets prepended to the path.
     */
    get driveName() {
        return this._driveName;
    }
    /**
     * A promise that resolves when the model is first restored.
     */
    get restored() {
        return this._restored.promise;
    }
    /**
     * Get the file path changed signal.
     */
    get fileChanged() {
        return this._fileChanged;
    }
    /**
     * Get the current path.
     */
    get path() {
        return this._model ? this._model.path : '';
    }
    /**
     * Get the root path
     */
    get rootPath() {
        return this._driveName ? this._driveName + ':' : '';
    }
    /**
     * A signal emitted when the path changes.
     */
    get pathChanged() {
        return this._pathChanged;
    }
    /**
     * A signal emitted when the directory listing is refreshed.
     */
    get refreshed() {
        return this._refreshed;
    }
    /**
     * Get the kernel spec models.
     */
    get specs() {
        return this.manager.services.kernelspecs.specs;
    }
    /**
     * Get whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * A signal emitted when an upload progresses.
     */
    get uploadChanged() {
        return this._uploadChanged;
    }
    /**
     * Create an iterator over the status of all in progress uploads.
     */
    uploads() {
        return this._uploads[Symbol.iterator]();
    }
    /**
     * Dispose of the resources held by the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        window.removeEventListener('beforeunload', this._unloadEventListener);
        this._isDisposed = true;
        this._poll.dispose();
        this._sessions.length = 0;
        this._items.length = 0;
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Create an iterator over the model's items.
     *
     * @returns A new iterator over the model's items.
     */
    items() {
        return this._items[Symbol.iterator]();
    }
    /**
     * Create an iterator over the active sessions in the directory.
     *
     * @returns A new iterator over the model's active sessions.
     */
    sessions() {
        return this._sessions[Symbol.iterator]();
    }
    /**
     * Force a refresh of the directory contents.
     */
    async refresh() {
        await this._poll.refresh();
        await this._poll.tick;
        this._refreshed.emit(void 0);
    }
    /**
     * Change directory.
     *
     * @param path The path to the file or directory.
     *
     * @returns A promise with the contents of the directory.
     */
    async cd(path = '.') {
        if (path !== '.') {
            path = this.manager.services.contents.resolvePath(this._model.path, path);
        }
        else {
            path = this._pendingPath || this._model.path;
        }
        if (this._pending) {
            // Collapse requests to the same directory.
            if (path === this._pendingPath) {
                return this._pending;
            }
            // Otherwise wait for the pending request to complete before continuing.
            await this._pending;
        }
        const oldValue = this.path;
        const options = { content: true };
        this._pendingPath = path;
        if (oldValue !== path) {
            this._sessions.length = 0;
        }
        const services = this.manager.services;
        this._pending = services.contents
            .get(path, options)
            .then(contents => {
            if (this.isDisposed) {
                return;
            }
            this.handleContents(contents);
            this._pendingPath = null;
            this._pending = null;
            if (oldValue !== path) {
                // If there is a state database and a unique key, save the new path.
                // We don't need to wait on the save to continue.
                if (this._state && this._key) {
                    void this._state.save(this._key, { path });
                }
                this._pathChanged.emit({
                    name: 'path',
                    oldValue,
                    newValue: path
                });
            }
            this.onRunningChanged(services.sessions, services.sessions.running());
            this._refreshed.emit(void 0);
        })
            .catch(error => {
            this._pendingPath = null;
            this._pending = null;
            if (error.response && error.response.status === 404 && path !== '/') {
                error.message = this._trans.__('Directory not found: "%1"', this._model.path);
                console.error(error);
                this._connectionFailure.emit(error);
                return this.cd('/');
            }
            else {
                this._connectionFailure.emit(error);
            }
        });
        return this._pending;
    }
    /**
     * Download a file.
     *
     * @param path - The path of the file to be downloaded.
     *
     * @returns A promise which resolves when the file has begun
     *   downloading.
     */
    async download(path) {
        const url = await this.manager.services.contents.getDownloadUrl(path);
        const element = document.createElement('a');
        element.href = url;
        element.download = '';
        document.body.appendChild(element);
        element.click();
        document.body.removeChild(element);
        return void 0;
    }
    /**
     * Restore the state of the file browser.
     *
     * @param id - The unique ID that is used to construct a state database key.
     *
     * @param populate - If `false`, the restoration ID will be set but the file
     * browser state will not be fetched from the state database.
     *
     * @returns A promise when restoration is complete.
     *
     * #### Notes
     * This function will only restore the model *once*. If it is called multiple
     * times, all subsequent invocations are no-ops.
     */
    async restore(id, populate = true) {
        const { manager } = this;
        const key = `file-browser-${id}:cwd`;
        const state = this._state;
        const restored = !!this._key;
        if (restored) {
            return;
        }
        // Set the file browser key for state database fetch/save.
        this._key = key;
        if (!populate || !state) {
            this._restored.resolve(undefined);
            return;
        }
        await manager.services.ready;
        try {
            const value = await state.fetch(key);
            if (!value) {
                this._restored.resolve(undefined);
                return;
            }
            const path = value['path'];
            // need to return to root path if preferred dir is set
            if (path) {
                await this.cd('/');
            }
            const localPath = manager.services.contents.localPath(path);
            await manager.services.contents.get(path);
            await this.cd(localPath);
        }
        catch (error) {
            await state.remove(key);
        }
        this._restored.resolve(undefined);
    }
    /**
     * Whether uploads are allowed.
     */
    get allowFileUploads() {
        return this._allowFileUploads;
    }
    set allowFileUploads(value) {
        this._allowFileUploads = value;
    }
    /**
     * Upload a `File` object.
     *
     * @param file - The `File` object to upload.
     * @param path - The directory into which the file should be uploaded; defaults to current directory.
     *
     * @returns A promise containing the new file contents model.
     *
     * #### Notes
     * On Notebook version < 5.1.0, this will fail to upload files that are too
     * big to be sent in one request to the server. On newer versions, or on
     * Jupyter Server, it will ask for confirmation then upload the file in 1 MB
     * chunks.
     */
    async upload(file, path) {
        // Check if upload is allowed
        if (!this._allowFileUploads) {
            throw new Error(this._trans.__('File uploads are disabled'));
        }
        // We do not support Jupyter Notebook version less than 4, and Jupyter
        // Server advertises itself as version 1 and supports chunked
        // uploading. We assume any version less than 4.0.0 to be Jupyter Server
        // instead of Jupyter Notebook.
        const serverVersion = lib_index_js_.PageConfig.getNotebookVersion();
        const supportsChunked = serverVersion < [4, 0, 0] /* Jupyter Server */ ||
            serverVersion >= [5, 1, 0]; /* Jupyter Notebook >= 5.1.0 */
        const largeFile = file.size > LARGE_FILE_SIZE;
        if (largeFile && !supportsChunked) {
            const msg = this._trans.__('Cannot upload file (>%1 MB). %2', LARGE_FILE_SIZE / (1024 * 1024), file.name);
            console.warn(msg);
            throw msg;
        }
        const err = 'File not uploaded';
        if (largeFile && !(await this._shouldUploadLarge(file))) {
            throw 'Cancelled large file upload';
        }
        await this._uploadCheckDisposed();
        await this.refresh();
        await this._uploadCheckDisposed();
        if (this._items.find(i => i.name === file.name) &&
            !(await (0,docmanager_lib_index_js_.shouldOverwrite)(file.name))) {
            throw err;
        }
        await this._uploadCheckDisposed();
        const chunkedUpload = supportsChunked && file.size > CHUNK_SIZE;
        return await this._upload(file, chunkedUpload, path);
    }
    async _shouldUploadLarge(file) {
        const { button } = await (0,index_js_.showDialog)({
            title: this._trans.__('Large file size warning'),
            body: this._trans.__('The file size is %1 MB. Do you still want to upload it?', Math.round(file.size / (1024 * 1024))),
            buttons: [
                index_js_.Dialog.cancelButton({ label: this._trans.__('Cancel') }),
                index_js_.Dialog.warnButton({ label: this._trans.__('Upload') })
            ]
        });
        return button.accept;
    }
    /**
     * Perform the actual upload.
     */
    async _upload(file, chunked, uploadPath) {
        // Gather the file model parameters.
        let path = typeof uploadPath === 'undefined' ? this._model.path : uploadPath;
        path = path ? path + '/' + file.name : file.name;
        const name = file.name;
        const type = 'file';
        const format = 'base64';
        const uploadInner = async (blob, chunk) => {
            await this._uploadCheckDisposed();
            const reader = new FileReader();
            reader.readAsDataURL(blob);
            await new Promise((resolve, reject) => {
                reader.onload = resolve;
                reader.onerror = event => reject(`Failed to upload "${file.name}":` + event);
            });
            await this._uploadCheckDisposed();
            // remove header https://stackoverflow.com/a/24289420/907060
            const content = reader.result.split(',')[1];
            const model = {
                type,
                format,
                name,
                chunk,
                content
            };
            return await this.manager.services.contents.save(path, model);
        };
        if (!chunked) {
            try {
                return await uploadInner(file);
            }
            catch (err) {
                algorithm_dist_index_es6_js_.ArrayExt.removeFirstWhere(this._uploads, uploadIndex => {
                    return file.name === uploadIndex.path;
                });
                throw err;
            }
        }
        let finalModel;
        let upload = { path, progress: 0 };
        this._uploadChanged.emit({
            name: 'start',
            newValue: upload,
            oldValue: null
        });
        for (let start = 0; !finalModel; start += CHUNK_SIZE) {
            const end = start + CHUNK_SIZE;
            const lastChunk = end >= file.size;
            const chunk = lastChunk ? -1 : end / CHUNK_SIZE;
            const newUpload = { path, progress: start / file.size };
            this._uploads.splice(this._uploads.indexOf(upload));
            this._uploads.push(newUpload);
            this._uploadChanged.emit({
                name: 'update',
                newValue: newUpload,
                oldValue: upload
            });
            upload = newUpload;
            let currentModel;
            try {
                currentModel = await uploadInner(file.slice(start, end), chunk);
            }
            catch (err) {
                algorithm_dist_index_es6_js_.ArrayExt.removeFirstWhere(this._uploads, uploadIndex => {
                    return file.name === uploadIndex.path;
                });
                this._uploadChanged.emit({
                    name: 'failure',
                    newValue: upload,
                    oldValue: null
                });
                throw err;
            }
            if (lastChunk) {
                finalModel = currentModel;
            }
        }
        this._uploads.splice(this._uploads.indexOf(upload));
        this._uploadChanged.emit({
            name: 'finish',
            newValue: null,
            oldValue: upload
        });
        return finalModel;
    }
    _uploadCheckDisposed() {
        if (this.isDisposed) {
            return Promise.reject('Filemanager disposed. File upload canceled');
        }
        return Promise.resolve();
    }
    /**
     * Handle an updated contents model.
     */
    handleContents(contents) {
        // Update our internal data.
        this._model = {
            name: contents.name,
            path: contents.path,
            type: contents.type,
            content: undefined,
            writable: contents.writable,
            created: contents.created,
            last_modified: contents.last_modified,
            size: contents.size,
            mimetype: contents.mimetype,
            format: contents.format
        };
        this._items = contents.content;
        this._paths.clear();
        contents.content.forEach((model) => {
            this._paths.add(model.path);
        });
    }
    /**
     * Handle a change to the running sessions.
     */
    onRunningChanged(sender, models) {
        this._populateSessions(models);
        this._refreshed.emit(void 0);
    }
    /**
     * Handle a change on the contents manager.
     */
    onFileChanged(sender, change) {
        const path = this._model.path;
        const { sessions } = this.manager.services;
        const { oldValue, newValue } = change;
        const prefix = this.driveName.length > 0 ? this.driveName + ':' : '';
        const value = oldValue &&
            oldValue.path &&
            prefix + lib_index_js_.PathExt.dirname(oldValue.path) === path
            ? oldValue
            : newValue &&
                newValue.path &&
                prefix + lib_index_js_.PathExt.dirname(newValue.path) === path
                ? newValue
                : undefined;
        // If either the old value or the new value is in the current path, update.
        if (value) {
            void this._poll.refresh();
            this._populateSessions(sessions.running());
            this._fileChanged.emit(change);
            return;
        }
    }
    /**
     * Populate the model's sessions collection.
     */
    _populateSessions(models) {
        this._sessions.length = 0;
        for (const model of models) {
            if (this._paths.has(model.path)) {
                this._sessions.push(model);
            }
        }
    }
}
/**
 * File browser model where hidden files inclusion can be toggled on/off.
 */
class TogglableHiddenFileBrowserModel extends FileBrowserModel {
    constructor(options) {
        super(options);
        this._includeHiddenFiles = options.includeHiddenFiles || false;
    }
    /**
     * Create an iterator over the model's items filtering hidden files out if necessary.
     *
     * @returns A new iterator over the model's items.
     */
    items() {
        return this._includeHiddenFiles
            ? super.items()
            : (0,algorithm_dist_index_es6_js_.filter)(super.items(), value => !value.name.startsWith('.'));
    }
    /**
     * Set the inclusion of hidden files. Triggers a model refresh.
     */
    showHiddenFiles(value) {
        this._includeHiddenFiles = value;
        void this.refresh();
    }
}
/**
 * File browser model with optional filter on element.
 */
class FilterFileBrowserModel extends TogglableHiddenFileBrowserModel {
    constructor(options) {
        var _a, _b, _c;
        super(options);
        this._filterSettingsChanged = new index_es6_js_.Signal(this);
        this._filter =
            (_a = options.filter) !== null && _a !== void 0 ? _a : (model => {
                return {};
            });
        this._filterDirectories = (_b = options.filterDirectories) !== null && _b !== void 0 ? _b : true;
        this._useFuzzyFilter = (_c = options.useFuzzyFilter) !== null && _c !== void 0 ? _c : true;
    }
    /**
     * Whether to filter directories.
     */
    get filterDirectories() {
        return this._filterDirectories;
    }
    set filterDirectories(value) {
        this._filterDirectories = value;
    }
    /**
     * Whether to apply fuzzy filter.
     */
    get useFuzzyFilter() {
        return this._useFuzzyFilter;
    }
    set useFuzzyFilter(value) {
        if (this._useFuzzyFilter === value) {
            return;
        }
        this._useFuzzyFilter = value;
        this._filterSettingsChanged.emit({ useFuzzyFilter: value });
    }
    /**
     * Signal for settings changed
     */
    get filterSettingsChanged() {
        return this._filterSettingsChanged;
    }
    /**
     * Create an iterator over the filtered model's items.
     *
     * @returns A new iterator over the model's items.
     */
    items() {
        return (0,algorithm_dist_index_es6_js_.filter)(super.items(), value => {
            if (!this._filterDirectories && value.type === 'directory') {
                return true;
            }
            else {
                const filtered = this._filter(value);
                value.indices = filtered === null || filtered === void 0 ? void 0 : filtered.indices;
                return !!filtered;
            }
        });
    }
    setFilter(filter) {
        this._filter = filter;
        void this.refresh();
    }
}
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/opendialog.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The class name added to open file dialog
 */
const OPEN_DIALOG_CLASS = 'jp-Open-Dialog';
/**
 * The class name added to (optional) label in the file dialog
 */
const OPEN_DIALOG_LABEL_CLASS = 'jp-Open-Dialog-label';
/**
 * Namespace for file dialog
 */
var FileDialog;
(function (FileDialog) {
    /**
     * Create and show a open files dialog.
     *
     * Note: if nothing is selected when `getValue` will return the browser
     * model current path.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted.
     */
    async function getOpenFiles(options) {
        const dialog = new OpenDialog(options);
        return dialog.launch();
    }
    FileDialog.getOpenFiles = getOpenFiles;
    /**
     * Create and show a open directory dialog.
     *
     * Note: if nothing is selected when `getValue` will return the browser
     * model current path.
     *
     * @param options - The dialog setup options.
     *
     * @returns A promise that resolves with whether the dialog was accepted.
     */
    function getExistingDirectory(options) {
        return getOpenFiles({
            ...options,
            filter: model => {
                return model.type === 'directory' ? {} : null;
            }
        });
    }
    FileDialog.getExistingDirectory = getExistingDirectory;
})(FileDialog || (FileDialog = {}));
class OpenDialog extends index_js_.Dialog {
    constructor(options) {
        const translator = options.translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const handleOpenFile = () => {
            // Resolve the dialog with current filebrowser selection
            this.resolve();
        };
        const openDialog = new OpenDialogBody(options.manager, options.filter, translator, options.defaultPath, options.label, true, handleOpenFile);
        super({
            title: options.title,
            buttons: [
                index_js_.Dialog.cancelButton(),
                index_js_.Dialog.okButton({
                    label: trans.__('Select')
                })
            ],
            focusNodeSelector: options.focusNodeSelector,
            host: options.host,
            renderer: options.renderer,
            body: openDialog
        });
    }
}
/**
 * Open dialog widget
 */
class OpenDialogBody extends dist_index_es6_js_.Widget {
    constructor(manager, filter, translator, defaultPath, label, filterDirectories, handleOpenFile) {
        super();
        this._ready = new dist_index_js_.PromiseDelegate();
        translator = translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        this.addClass(OPEN_DIALOG_CLASS);
        opendialog_Private.createFilteredFileBrowser('filtered-file-browser-dialog', manager, filter, {}, translator, defaultPath, filterDirectories, handleOpenFile)
            .then(browser => {
            this._browser = browser;
            // Add toolbar items
            (0,index_js_.setToolbar)(this._browser, (browser) => [
                {
                    name: 'new-folder',
                    widget: new index_js_.ToolbarButton({
                        icon: ui_components_lib_index_js_.newFolderIcon,
                        onClick: () => {
                            void browser.createNewDirectory();
                        },
                        tooltip: trans.__('New Folder')
                    })
                },
                {
                    name: 'refresher',
                    widget: new index_js_.ToolbarButton({
                        icon: ui_components_lib_index_js_.refreshIcon,
                        onClick: () => {
                            browser.model.refresh().catch(reason => {
                                console.error('Failed to refresh file browser in open dialog.', reason);
                            });
                        },
                        tooltip: trans.__('Refresh File List')
                    })
                }
            ]);
            // Build the sub widgets
            const layout = new dist_index_es6_js_.PanelLayout();
            if (label) {
                const labelWidget = new dist_index_es6_js_.Widget();
                labelWidget.addClass(OPEN_DIALOG_LABEL_CLASS);
                labelWidget.node.textContent = label;
                layout.addWidget(labelWidget);
            }
            layout.addWidget(this._browser);
            /**
             * Dispose browser model when OpenDialogBody
             * is disposed.
             */
            this.dispose = () => {
                if (this.isDisposed) {
                    return;
                }
                this._browser.model.dispose();
                super.dispose();
            };
            // Set Widget content
            this.layout = layout;
            this._ready.resolve();
        })
            .catch(reason => {
            console.error('Error while creating file browser in open dialog', reason);
            this._ready.reject(void 0);
        });
    }
    /**
     * Get the selected items.
     */
    getValue() {
        const selection = Array.from(this._browser.selectedItems());
        if (selection.length === 0) {
            // Return current path
            return [
                {
                    path: this._browser.model.path,
                    name: lib_index_js_.PathExt.basename(this._browser.model.path),
                    type: 'directory',
                    content: undefined,
                    writable: false,
                    created: 'unknown',
                    last_modified: 'unknown',
                    mimetype: 'text/plain',
                    format: 'text'
                }
            ];
        }
        else {
            return selection;
        }
    }
    /**
     * A promise that resolves when openDialog is successfully created.
     */
    get ready() {
        return this._ready.promise;
    }
}
var opendialog_Private;
(function (Private) {
    /**
     * Create a new file browser instance.
     *
     * @param id - The widget/DOM id of the file browser.
     *
     * @param manager - A document manager instance.
     *
     * @param filter - function to filter file browser item.
     *
     * @param options - The optional file browser configuration object.
     *
     * #### Notes
     * The ID parameter is used to set the widget ID. It is also used as part of
     * the unique key necessary to store the file browser's restoration data in
     * the state database if that functionality is enabled.
     *
     * If, after the file browser has been generated by the factory, the ID of the
     * resulting widget is changed by client code, the restoration functionality
     * will not be disrupted as long as there are no ID collisions, i.e., as long
     * as the initial ID passed into the factory is used for only one file browser
     * instance.
     */
    Private.createFilteredFileBrowser = async (id, manager, filter, options = {}, translator, defaultPath, filterDirectories, handleOpenFile) => {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const model = new FilterFileBrowserModel({
            manager,
            filter,
            translator,
            driveName: options.driveName,
            refreshInterval: options.refreshInterval,
            filterDirectories
        });
        const widget = new FileBrowser({
            id,
            model,
            translator,
            handleOpenFile
        });
        if (defaultPath) {
            await widget.model.cd(defaultPath);
        }
        return widget;
    };
})(opendialog_Private || (opendialog_Private = {}));
//# sourceMappingURL=opendialog.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The file browser factory token.
 */
const IFileBrowserFactory = new dist_index_js_.Token('@jupyterlab/filebrowser:IFileBrowserFactory', `A factory object that creates file browsers.
  Use this if you want to create your own file browser (e.g., for a custom storage backend),
  or to interact with other file browsers that have been created by extensions.`);
/**
 * The default file browser token.
 */
const IDefaultFileBrowser = new dist_index_js_.Token('@jupyterlab/filebrowser:IDefaultFileBrowser', 'A service for the default file browser.');
/**
 * The token that indicates the default file browser commands are loaded.
 */
const IFileBrowserCommands = new dist_index_js_.Token('@jupyterlab/filebrowser:IFileBrowserCommands', 'A token to ensure file browser commands are loaded.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/upload.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A widget which provides an upload button.
 */
class Uploader extends ui_components_lib_index_js_.ToolbarButton {
    /**
     * Construct a new file browser buttons widget.
     */
    constructor(options) {
        super({
            icon: ui_components_lib_index_js_.fileUploadIcon,
            label: options.label,
            onClick: () => {
                this._input.click();
            },
            tooltip: upload_Private.translateToolTip(options.translator),
            enabled: options.model.allowFileUploads
        });
        /**
         * The 'change' handler for the input field.
         */
        this._onInputChanged = () => {
            const files = Array.prototype.slice.call(this._input.files);
            const pending = files.map(file => this.fileBrowserModel.upload(file));
            void Promise.all(pending)
                .then(models => {
                // emit the batch
                this._filesUploaded.emit(models);
            })
                .catch(error => {
                void (0,index_js_.showErrorMessage)(this._trans._p('showErrorMessage', 'Upload Error'), error);
            });
        };
        /**
         * The 'click' handler for the input field.
         */
        this._onInputClicked = () => {
            // In order to allow repeated uploads of the same file (with delete in between),
            // we need to clear the input value to trigger a change event.
            this._input.value = '';
        };
        this._input = upload_Private.createUploadInput();
        this._filesUploaded = new index_es6_js_.Signal(this);
        this.fileBrowserModel = options.model;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._input.onclick = this._onInputClicked;
        this._input.onchange = this._onInputChanged;
        this.addClass('jp-id-upload');
    }
    /**
     * A signal emitted with file info when a batch of upload completes.
     */
    get filesUploaded() {
        return this._filesUploaded;
    }
}
/**
 * The namespace for module private data.
 */
var upload_Private;
(function (Private) {
    /**
     * Create the upload input node for a file buttons widget.
     */
    function createUploadInput() {
        const input = document.createElement('input');
        input.type = 'file';
        input.multiple = true;
        return input;
    }
    Private.createUploadInput = createUploadInput;
    /**
     * Translate upload tooltip.
     */
    function translateToolTip(translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        return trans.__('Upload Files');
    }
    Private.translateToolTip = translateToolTip;
})(upload_Private || (upload_Private = {}));
//# sourceMappingURL=upload.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/uploadstatus.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
//





/**
 * Half-spacing between items in the overall status item.
 */
const HALF_SPACING = 4;
/**
 * A pure function component for a FileUpload status item.
 *
 * @param props the props for the component.
 *
 * @returns a tsx component for the file upload status.
 */
function FileUploadComponent(props) {
    const translator = props.translator || translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    return (react_index_js_default().createElement(statusbar_lib_index_js_.GroupItem, { spacing: HALF_SPACING },
        react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { source: trans.__('Uploading…') }),
        react_index_js_default().createElement(statusbar_lib_index_js_.ProgressBar, { percentage: props.upload })));
}
/**
 * The time for which to show the "Complete!" message after uploading.
 */
const UPLOAD_COMPLETE_MESSAGE_MILLIS = 2000;
/**
 * Status bar item to display file upload progress.
 */
class FileUploadStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct a new FileUpload status item.
     */
    constructor(opts) {
        super(new FileUploadStatus.Model(opts.tracker.currentWidget && opts.tracker.currentWidget.model));
        this._onBrowserChange = (tracker, browser) => {
            if (browser === null) {
                this.model.browserModel = null;
            }
            else {
                this.model.browserModel = browser.model;
            }
        };
        this.translator = opts.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._tracker = opts.tracker;
        this._tracker.currentChanged.connect(this._onBrowserChange);
    }
    /**
     * Render the FileUpload status.
     */
    render() {
        const uploadPaths = this.model.items;
        if (uploadPaths.length > 0) {
            const item = this.model.items[0];
            if (item.complete) {
                return react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { source: this._trans.__('Complete!') });
            }
            else {
                return (react_index_js_default().createElement(FileUploadComponent, { upload: this.model.items[0].progress, translator: this.translator }));
            }
        }
        else {
            return react_index_js_default().createElement(FileUploadComponent, { upload: 100, translator: this.translator });
        }
    }
    dispose() {
        super.dispose();
        this._tracker.currentChanged.disconnect(this._onBrowserChange);
    }
}
/**
 * A namespace for FileUpload class statics.
 */
(function (FileUploadStatus) {
    /**
     * The VDomModel for the FileUpload renderer.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        /**
         * Construct a new model.
         */
        constructor(browserModel) {
            super();
            /**
             * Handle an uploadChanged event in the filebrowser model.
             */
            this._uploadChanged = (browse, uploads) => {
                if (uploads.name === 'start') {
                    this._items.push({
                        path: uploads.newValue.path,
                        progress: uploads.newValue.progress * 100,
                        complete: false
                    });
                }
                else if (uploads.name === 'update') {
                    const idx = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(this._items, val => val.path === uploads.oldValue.path);
                    if (idx !== -1) {
                        this._items[idx].progress = uploads.newValue.progress * 100;
                    }
                }
                else if (uploads.name === 'finish') {
                    const finishedItem = algorithm_dist_index_es6_js_.ArrayExt.findFirstValue(this._items, val => val.path === uploads.oldValue.path);
                    if (finishedItem) {
                        finishedItem.complete = true;
                        setTimeout(() => {
                            algorithm_dist_index_es6_js_.ArrayExt.removeFirstOf(this._items, finishedItem);
                            this.stateChanged.emit(void 0);
                        }, UPLOAD_COMPLETE_MESSAGE_MILLIS);
                    }
                }
                else if (uploads.name === 'failure') {
                    algorithm_dist_index_es6_js_.ArrayExt.removeFirstWhere(this._items, val => val.path === uploads.newValue.path);
                }
                else
                    return;
                this.stateChanged.emit(void 0);
            };
            this._items = [];
            this._browserModel = null;
            this.browserModel = browserModel;
        }
        /**
         * The currently uploading items.
         */
        get items() {
            return this._items;
        }
        /**
         * The current file browser model.
         */
        get browserModel() {
            return this._browserModel;
        }
        set browserModel(browserModel) {
            const oldBrowserModel = this._browserModel;
            if (oldBrowserModel) {
                oldBrowserModel.uploadChanged.disconnect(this._uploadChanged);
            }
            this._browserModel = browserModel;
            this._items = [];
            if (this._browserModel !== null) {
                this._browserModel.uploadChanged.connect(this._uploadChanged);
            }
            this.stateChanged.emit(void 0);
        }
    }
    FileUploadStatus.Model = Model;
})(FileUploadStatus || (FileUploadStatus = {}));
//# sourceMappingURL=uploadstatus.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module filebrowser
 */








//# sourceMappingURL=index.js.map

/***/ }),

/***/ 40360:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@lumino/dragdrop/style/index.js + 1 modules
var dragdrop_style = __webpack_require__(49868);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docmanager/style/index.js
var docmanager_style = __webpack_require__(81393);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/filebrowser/style/base.css
var base = __webpack_require__(34893);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/filebrowser/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */










/***/ }),

/***/ 97603:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  Commands: () => (/* reexport */ Commands),
  "default": () => (/* binding */ lib),
  tabSpaceStatus: () => (/* binding */ tabSpaceStatus)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codemirror@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codemirror/lib/index.js)
var codemirror_lib_index_js_ = __webpack_require__(84088);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/completer@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/completer/lib/index.js)
var completer_lib_index_js_ = __webpack_require__(27709);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/console@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/console/lib/index.js)
var console_lib_index_js_ = __webpack_require__(69897);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/documentsearch@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/documentsearch/lib/index.js)
var documentsearch_lib_index_js_ = __webpack_require__(3894);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/filebrowser@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/filebrowser/lib/index.js)
var filebrowser_lib_index_js_ = __webpack_require__(29543);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/fileeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/fileeditor/lib/index.js)
var fileeditor_lib_index_js_ = __webpack_require__(82591);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/launcher@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/launcher/lib/index.js)
var launcher_lib_index_js_ = __webpack_require__(62961);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/lsp@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/lsp/lib/index.js)
var lsp_lib_index_js_ = __webpack_require__(84259);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/mainmenu@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/mainmenu/lib/index.js)
var mainmenu_lib_index_js_ = __webpack_require__(38911);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/toc@^6.5.6 (strict) (fallback: ../node_modules/@jupyterlab/toc/lib/index.js)
var toc_lib_index_js_ = __webpack_require__(74853);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @codemirror/commands@^6.10.2 (strict) (fallback: ../node_modules/@codemirror/commands/dist/index.js)
var dist_index_js_ = __webpack_require__(55942);
// EXTERNAL MODULE: consume shared module (default) @codemirror/search@^6.6.0 (strict) (fallback: ../node_modules/@codemirror/search/dist/index.js)
var search_dist_index_js_ = __webpack_require__(76724);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(61533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor-extension/lib/commands.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.









const autoClosingBracketsNotebook = 'notebook:toggle-autoclosing-brackets';
const autoClosingBracketsConsole = 'console:toggle-autoclosing-brackets';
/**
 * The command IDs used by the fileeditor plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.createNew = 'fileeditor:create-new';
    CommandIDs.createNewMarkdown = 'fileeditor:create-new-markdown-file';
    CommandIDs.changeFontSize = 'fileeditor:change-font-size';
    CommandIDs.lineNumbers = 'fileeditor:toggle-line-numbers';
    CommandIDs.currentLineNumbers = 'fileeditor:toggle-current-line-numbers';
    CommandIDs.lineWrap = 'fileeditor:toggle-line-wrap';
    CommandIDs.currentLineWrap = 'fileeditor:toggle-current-line-wrap';
    CommandIDs.changeTabs = 'fileeditor:change-tabs';
    CommandIDs.matchBrackets = 'fileeditor:toggle-match-brackets';
    CommandIDs.currentMatchBrackets = 'fileeditor:toggle-current-match-brackets';
    CommandIDs.autoClosingBrackets = 'fileeditor:toggle-autoclosing-brackets';
    CommandIDs.autoClosingBracketsUniversal = 'fileeditor:toggle-autoclosing-brackets-universal';
    CommandIDs.createConsole = 'fileeditor:create-console';
    CommandIDs.replaceSelection = 'fileeditor:replace-selection';
    CommandIDs.restartConsole = 'fileeditor:restart-console';
    CommandIDs.runCode = 'fileeditor:run-code';
    CommandIDs.runAllCode = 'fileeditor:run-all';
    CommandIDs.markdownPreview = 'fileeditor:markdown-preview';
    CommandIDs.undo = 'fileeditor:undo';
    CommandIDs.redo = 'fileeditor:redo';
    CommandIDs.cut = 'fileeditor:cut';
    CommandIDs.copy = 'fileeditor:copy';
    CommandIDs.paste = 'fileeditor:paste';
    CommandIDs.selectAll = 'fileeditor:select-all';
    CommandIDs.invokeCompleter = 'completer:invoke-file';
    CommandIDs.selectCompleter = 'completer:select-file';
    CommandIDs.openCodeViewer = 'code-viewer:open';
    CommandIDs.changeTheme = 'fileeditor:change-theme';
    CommandIDs.changeLanguage = 'fileeditor:change-language';
    CommandIDs.find = 'fileeditor:find';
    CommandIDs.goToLine = 'fileeditor:go-to-line';
})(CommandIDs || (CommandIDs = {}));
/**
 * The name of the factory that creates editor widgets.
 */
const FACTORY = 'Editor';
/**
 * A utility class for adding commands and menu items,
 * for use by the File Editor extension or other Editor extensions.
 */
var Commands;
(function (Commands) {
    let config = {};
    let scrollPastEnd = true;
    /**
     * Accessor function that returns the createConsole function for use by Create Console commands
     */
    function getCreateConsoleFunction(commands, languages) {
        return async function createConsole(widget, args) {
            var _a, _b, _c;
            const options = args || {};
            const console = await commands.execute('console:create', {
                activate: options['activate'],
                name: (_a = widget.context.contentsModel) === null || _a === void 0 ? void 0 : _a.name,
                path: widget.context.path,
                // Default value is an empty string -> using OR operator
                preferredLanguage: widget.context.model.defaultKernelLanguage ||
                    ((_c = (_b = languages.findByFileName(widget.context.path)) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : ''),
                ref: widget.id,
                insertMode: 'split-bottom'
            });
            widget.context.pathChanged.connect((sender, value) => {
                var _a;
                console.session.setPath(value);
                console.session.setName((_a = widget.context.contentsModel) === null || _a === void 0 ? void 0 : _a.name);
            });
        };
    }
    /**
     * Update the setting values.
     */
    function updateSettings(settings, commands) {
        var _a;
        config =
            (_a = settings.get('editorConfig').composite) !== null && _a !== void 0 ? _a : {};
        scrollPastEnd = settings.get('scrollPastEnd').composite;
        // Trigger a refresh of the rendered commands
        commands.notifyCommandChanged(CommandIDs.lineNumbers);
        commands.notifyCommandChanged(CommandIDs.currentLineNumbers);
        commands.notifyCommandChanged(CommandIDs.lineWrap);
        commands.notifyCommandChanged(CommandIDs.currentLineWrap);
        commands.notifyCommandChanged(CommandIDs.changeTabs);
        commands.notifyCommandChanged(CommandIDs.matchBrackets);
        commands.notifyCommandChanged(CommandIDs.currentMatchBrackets);
        commands.notifyCommandChanged(CommandIDs.autoClosingBrackets);
        commands.notifyCommandChanged(CommandIDs.changeLanguage);
    }
    Commands.updateSettings = updateSettings;
    /**
     * Update the settings of the current tracker instances.
     */
    function updateTracker(tracker) {
        tracker.forEach(widget => {
            updateWidget(widget.content);
        });
    }
    Commands.updateTracker = updateTracker;
    /**
     * Update the settings of a widget.
     * Skip global settings for transient editor specific configs.
     */
    function updateWidget(widget) {
        const editor = widget.editor;
        editor.setOptions({ ...config, scrollPastEnd });
        widget.toggleClass('jp-mod-scrollPastEnd', scrollPastEnd);
    }
    Commands.updateWidget = updateWidget;
    /**
     * Wrapper function for adding the default File Editor commands
     */
    function addCommands(commands, settingRegistry, trans, id, isEnabled, tracker, defaultBrowser, extensions, languages, consoleTracker, sessionDialogs, shell) {
        var _a;
        /**
         * Add a command to change font size for File Editor
         */
        commands.addCommand(CommandIDs.changeFontSize, {
            execute: args => {
                var _a;
                const delta = Number(args['delta']);
                if (Number.isNaN(delta)) {
                    console.error(`${CommandIDs.changeFontSize}: delta arg must be a number`);
                    return;
                }
                const style = window.getComputedStyle(document.documentElement);
                const cssSize = parseInt(style.getPropertyValue('--jp-code-font-size'), 10);
                if (!config.customStyles) {
                    config.customStyles = {};
                }
                const currentSize = ((_a = config['customStyles']['fontSize']) !== null && _a !== void 0 ? _a : extensions.baseConfiguration['customStyles']['fontSize']) ||
                    cssSize;
                config.customStyles.fontSize = currentSize + delta;
                return settingRegistry
                    .set(id, 'editorConfig', config)
                    .catch((reason) => {
                    console.error(`Failed to set ${id}: ${reason.message}`);
                });
            },
            label: args => {
                var _a;
                const delta = Number((_a = args.delta) !== null && _a !== void 0 ? _a : 0);
                if (delta > 0) {
                    return args.isMenu
                        ? trans.__('Increase Text Editor Font Size')
                        : trans.__('Increase Font Size');
                }
                else if (delta < 0) {
                    return args.isMenu
                        ? trans.__('Decrease Text Editor Font Size')
                        : trans.__('Decrease Font Size');
                }
                else {
                    return trans.__('Change Font Size');
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        delta: {
                            type: 'number',
                            description: trans.__('The font size change delta (positive to increase, negative to decrease)')
                        },
                        isMenu: {
                            type: 'boolean',
                            description: trans.__('Whether the command is called from a menu context')
                        }
                    },
                    required: ['delta']
                }
            }
        });
        /**
         * Add the Line Numbers command
         */
        commands.addCommand(CommandIDs.lineNumbers, {
            execute: async () => {
                var _a;
                config.lineNumbers = !((_a = config.lineNumbers) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.lineNumbers);
                try {
                    return await settingRegistry.set(id, 'editorConfig', config);
                }
                catch (reason) {
                    console.error(`Failed to set ${id}: ${reason.message}`);
                }
            },
            isEnabled,
            isToggled: () => { var _a; return (_a = config.lineNumbers) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.lineNumbers; },
            label: trans.__('Show Line Numbers'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.currentLineNumbers, {
            label: trans.__('Show Line Numbers'),
            caption: trans.__('Show the line numbers for the current file.'),
            execute: () => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                const lineNumbers = !widget.content.editor.getOption('lineNumbers');
                widget.content.editor.setOption('lineNumbers', lineNumbers);
            },
            isEnabled,
            isToggled: () => {
                var _a;
                const widget = tracker.currentWidget;
                return ((_a = widget === null || widget === void 0 ? void 0 : widget.content.editor.getOption('lineNumbers')) !== null && _a !== void 0 ? _a : false);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add the Word Wrap command
         */
        commands.addCommand(CommandIDs.lineWrap, {
            execute: async (args) => {
                var _a;
                config.lineWrap = (_a = args['mode']) !== null && _a !== void 0 ? _a : false;
                try {
                    return await settingRegistry.set(id, 'editorConfig', config);
                }
                catch (reason) {
                    console.error(`Failed to set ${id}: ${reason.message}`);
                }
            },
            isEnabled,
            isToggled: args => {
                var _a, _b;
                const lineWrap = (_a = args['mode']) !== null && _a !== void 0 ? _a : false;
                return (lineWrap ===
                    ((_b = config.lineWrap) !== null && _b !== void 0 ? _b : extensions.baseConfiguration.lineWrap));
            },
            label: trans.__('Word Wrap'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        mode: {
                            type: 'boolean',
                            description: trans.__('Whether to enable word wrap')
                        }
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.currentLineWrap, {
            label: trans.__('Wrap Words'),
            caption: trans.__('Wrap words for the current file.'),
            execute: () => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                const oldValue = widget.content.editor.getOption('lineWrap');
                widget.content.editor.setOption('lineWrap', !oldValue);
            },
            isEnabled,
            isToggled: () => {
                var _a;
                const widget = tracker.currentWidget;
                return ((_a = widget === null || widget === void 0 ? void 0 : widget.content.editor.getOption('lineWrap')) !== null && _a !== void 0 ? _a : false);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add command for changing tabs size or type in File Editor
         */
        commands.addCommand(CommandIDs.changeTabs, {
            label: args => {
                var _a;
                if (args.size) {
                    // Use a context to differentiate with string set as plural in 3.x
                    return trans._p('v4', 'Spaces: %1', (_a = args.size) !== null && _a !== void 0 ? _a : '');
                }
                else {
                    return trans.__('Indent with Tab');
                }
            },
            execute: async (args) => {
                var _a;
                config.indentUnit =
                    args['size'] !== undefined
                        ? ((_a = args['size']) !== null && _a !== void 0 ? _a : '4').toString()
                        : 'Tab';
                try {
                    return await settingRegistry.set(id, 'editorConfig', config);
                }
                catch (reason) {
                    console.error(`Failed to set ${id}: ${reason.message}`);
                }
            },
            isToggled: args => {
                var _a;
                const currentIndentUnit = (_a = config.indentUnit) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.indentUnit;
                return args['size']
                    ? args['size'] === currentIndentUnit
                    : 'Tab' == currentIndentUnit;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        size: {
                            type: 'string',
                            description: trans.__('The number of spaces for indentation (or Tab for tab indentation)')
                        }
                    }
                }
            }
        });
        /**
         * Add the Match Brackets command
         */
        commands.addCommand(CommandIDs.matchBrackets, {
            execute: async () => {
                var _a;
                config.matchBrackets = !((_a = config.matchBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.matchBrackets);
                try {
                    return await settingRegistry.set(id, 'editorConfig', config);
                }
                catch (reason) {
                    console.error(`Failed to set ${id}: ${reason.message}`);
                }
            },
            label: trans.__('Match Brackets'),
            isEnabled,
            isToggled: () => { var _a; return (_a = config.matchBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.matchBrackets; },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.currentMatchBrackets, {
            label: trans.__('Match Brackets'),
            caption: trans.__('Change match brackets for the current file.'),
            execute: () => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                const matchBrackets = !widget.content.editor.getOption('matchBrackets');
                widget.content.editor.setOption('matchBrackets', matchBrackets);
            },
            isEnabled,
            isToggled: () => {
                var _a;
                const widget = tracker.currentWidget;
                return ((_a = widget === null || widget === void 0 ? void 0 : widget.content.editor.getOption('matchBrackets')) !== null && _a !== void 0 ? _a : false);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add the Auto Close Brackets for Text Editor command
         */
        commands.addCommand(CommandIDs.autoClosingBrackets, {
            execute: async (args) => {
                var _a, _b;
                config.autoClosingBrackets = !!((_a = args['force']) !== null && _a !== void 0 ? _a : !((_b = config.autoClosingBrackets) !== null && _b !== void 0 ? _b : extensions.baseConfiguration.autoClosingBrackets));
                try {
                    return await settingRegistry.set(id, 'editorConfig', config);
                }
                catch (reason) {
                    console.error(`Failed to set ${id}: ${reason.message}`);
                }
            },
            label: trans.__('Auto Close Brackets in Text Editor'),
            isToggled: () => {
                var _a;
                return (_a = config.autoClosingBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.autoClosingBrackets;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        force: {
                            type: 'boolean',
                            description: trans.__('Force enable/disable auto closing brackets')
                        }
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.autoClosingBracketsUniversal, {
            execute: () => {
                const anyToggled = commands.isToggled(CommandIDs.autoClosingBrackets) ||
                    commands.isToggled(autoClosingBracketsNotebook) ||
                    commands.isToggled(autoClosingBracketsConsole);
                // if any auto closing brackets options is toggled, toggle both off
                if (anyToggled) {
                    void commands.execute(CommandIDs.autoClosingBrackets, {
                        force: false
                    });
                    void commands.execute(autoClosingBracketsNotebook, { force: false });
                    void commands.execute(autoClosingBracketsConsole, { force: false });
                }
                else {
                    // both are off, turn them on
                    void commands.execute(CommandIDs.autoClosingBrackets, {
                        force: true
                    });
                    void commands.execute(autoClosingBracketsNotebook, { force: true });
                    void commands.execute(autoClosingBracketsConsole, { force: true });
                }
            },
            label: trans.__('Auto Close Brackets'),
            isToggled: () => commands.isToggled(CommandIDs.autoClosingBrackets) ||
                commands.isToggled(autoClosingBracketsNotebook) ||
                commands.isToggled(autoClosingBracketsConsole),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Create a menu for the editor.
         */
        commands.addCommand(CommandIDs.changeTheme, {
            label: args => {
                var _a, _b, _c, _d;
                return (_d = (_c = (_b = ((_a = args.displayName) !== null && _a !== void 0 ? _a : args.theme)) !== null && _b !== void 0 ? _b : config.theme) !== null && _c !== void 0 ? _c : extensions.baseConfiguration.theme) !== null && _d !== void 0 ? _d : trans.__('Editor Theme');
            },
            execute: async (args) => {
                var _a;
                config.theme = (_a = args['theme']) !== null && _a !== void 0 ? _a : config.theme;
                try {
                    return await settingRegistry.set(id, 'editorConfig', config);
                }
                catch (reason) {
                    console.error(`Failed to set theme - ${reason.message}`);
                }
            },
            isToggled: args => { var _a; return args['theme'] === ((_a = config.theme) !== null && _a !== void 0 ? _a : extensions.baseConfiguration.theme); },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        theme: {
                            type: 'string',
                            description: trans.__('The theme name to change to')
                        },
                        displayName: {
                            type: 'string',
                            description: trans.__('The display name of the theme')
                        }
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.find, {
            label: trans.__('Find…'),
            execute: () => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                const editor = widget.content.editor;
                editor.execCommand(search_dist_index_js_.findNext);
            },
            isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.goToLine, {
            label: trans.__('Go to Line…'),
            execute: args => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                const editor = widget.content.editor;
                const line = args['line'];
                const column = args['column'];
                if (line !== undefined || column !== undefined) {
                    editor.setCursorPosition({
                        line: (line !== null && line !== void 0 ? line : 1) - 1,
                        column: (column !== null && column !== void 0 ? column : 1) - 1
                    });
                }
                else {
                    editor.execCommand(search_dist_index_js_.gotoLine);
                }
            },
            isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        line: {
                            type: 'number',
                            description: trans.__('The line number to go to (1-indexed)')
                        },
                        column: {
                            type: 'number',
                            description: trans.__('The column number to go to (1-indexed)')
                        }
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.changeLanguage, {
            label: args => {
                var _a, _b;
                return (_b = ((_a = args['displayName']) !== null && _a !== void 0 ? _a : args['name'])) !== null && _b !== void 0 ? _b : trans.__('Change editor language.');
            },
            execute: args => {
                var _a;
                const name = args['name'];
                const widget = tracker.currentWidget;
                if (name && widget) {
                    const spec = languages.findByName(name);
                    if (spec) {
                        if (Array.isArray(spec.mime)) {
                            widget.content.model.mimeType =
                                (_a = spec.mime[0]) !== null && _a !== void 0 ? _a : codeeditor_lib_index_js_.IEditorMimeTypeService.defaultMimeType;
                        }
                        else {
                            widget.content.model.mimeType = spec.mime;
                        }
                    }
                }
            },
            isEnabled,
            isToggled: args => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return false;
                }
                const mime = widget.content.model.mimeType;
                const spec = languages.findByMIME(mime);
                const name = spec && spec.name;
                return args['name'] === name;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        name: {
                            type: 'string',
                            description: trans.__('The language name to change to')
                        },
                        displayName: {
                            type: 'string',
                            description: trans.__('The display name of the language')
                        }
                    }
                }
            }
        });
        /**
         * Add the replace selection for text editor command
         */
        commands.addCommand(CommandIDs.replaceSelection, {
            execute: args => {
                var _a, _b;
                const text = args['text'] || '';
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                (_b = (_a = widget.content.editor).replaceSelection) === null || _b === void 0 ? void 0 : _b.call(_a, text);
            },
            isEnabled,
            label: trans.__('Replace Selection in Editor'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        text: {
                            type: 'string',
                            description: trans.__('The text to replace the current selection with')
                        }
                    }
                }
            }
        });
        /**
         * Add the Create Console for Editor command
         */
        commands.addCommand(CommandIDs.createConsole, {
            execute: args => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                return getCreateConsoleFunction(commands, languages)(widget, args);
            },
            isEnabled,
            icon: ui_components_lib_index_js_.consoleIcon,
            label: trans.__('Create Console for Editor'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Restart the Console Kernel linked to the current Editor
         */
        commands.addCommand(CommandIDs.restartConsole, {
            execute: async () => {
                var _a;
                const current = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!current || consoleTracker === null) {
                    return;
                }
                const widget = consoleTracker.find(widget => { var _a; return ((_a = widget.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path) === current.context.path; });
                if (widget) {
                    return sessionDialogs.restart(widget.sessionContext);
                }
            },
            label: trans.__('Restart Kernel'),
            isEnabled: () => consoleTracker !== null && isEnabled(),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add the Run Code command
         */
        commands.addCommand(CommandIDs.runCode, {
            execute: () => {
                var _a, _b;
                // Run the appropriate code, taking into account a ```fenced``` code block.
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                let code = '';
                const editor = widget.editor;
                const path = widget.context.path;
                const extension = coreutils_lib_index_js_.PathExt.extname(path);
                const selection = editor.getSelection();
                const { start, end } = selection;
                let selected = start.column !== end.column || start.line !== end.line;
                if (selected) {
                    // Get the selected code from the editor.
                    const start = editor.getOffsetAt(selection.start);
                    const end = editor.getOffsetAt(selection.end);
                    code = editor.model.sharedModel.getSource().substring(start, end);
                }
                else if (coreutils_lib_index_js_.MarkdownCodeBlocks.isMarkdown(extension)) {
                    const text = editor.model.sharedModel.getSource();
                    const blocks = coreutils_lib_index_js_.MarkdownCodeBlocks.findMarkdownCodeBlocks(text);
                    for (const block of blocks) {
                        if (block.startLine <= start.line && start.line <= block.endLine) {
                            code = block.code;
                            selected = true;
                            break;
                        }
                    }
                }
                if (!selected) {
                    // no selection, submit whole line and advance
                    code = editor.getLine(selection.start.line);
                    const cursor = editor.getCursorPosition();
                    const nextLine = editor.getLine(cursor.line + 1);
                    if (cursor.line + 1 === editor.lineCount) {
                        const text = editor.model.sharedModel.getSource();
                        editor.model.sharedModel.setSource(text + '\n');
                    }
                    editor.setCursorPosition({
                        line: cursor.line + 1,
                        column: (_b = nextLine === null || nextLine === void 0 ? void 0 : nextLine.length) !== null && _b !== void 0 ? _b : 0 // Place cursor at end of line if line has content else place at start of line
                    });
                }
                const activate = false;
                if (code) {
                    return commands.execute('console:inject', { activate, code, path });
                }
                else {
                    return Promise.resolve(void 0);
                }
            },
            isEnabled,
            label: trans.__('Run Selected Code'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add the Run All Code command
         */
        commands.addCommand(CommandIDs.runAllCode, {
            execute: () => {
                var _a;
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                let code = '';
                const editor = widget.editor;
                const text = editor.model.sharedModel.getSource();
                const path = widget.context.path;
                const extension = coreutils_lib_index_js_.PathExt.extname(path);
                if (coreutils_lib_index_js_.MarkdownCodeBlocks.isMarkdown(extension)) {
                    // For Markdown files, run only code blocks.
                    const blocks = coreutils_lib_index_js_.MarkdownCodeBlocks.findMarkdownCodeBlocks(text);
                    for (const block of blocks) {
                        code += block.code;
                    }
                }
                else {
                    code = text;
                }
                const activate = false;
                if (code) {
                    return commands.execute('console:inject', { activate, code, path });
                }
                else {
                    return Promise.resolve(void 0);
                }
            },
            isEnabled,
            label: trans.__('Run All Code'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add markdown preview command
         */
        commands.addCommand(CommandIDs.markdownPreview, {
            execute: () => {
                const widget = tracker.currentWidget;
                if (!widget) {
                    return;
                }
                const path = widget.context.path;
                return commands.execute('markdownviewer:open', {
                    path,
                    options: {
                        mode: 'split-right'
                    }
                });
            },
            isVisible: () => {
                const widget = tracker.currentWidget;
                return ((widget && coreutils_lib_index_js_.PathExt.extname(widget.context.path) === '.md') || false);
            },
            icon: ui_components_lib_index_js_.markdownIcon,
            label: trans.__('Show Markdown Preview'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add the New File command
         *
         * Defaults to Text/.txt if file type data is not specified
         */
        commands.addCommand(CommandIDs.createNew, {
            label: args => {
                var _a, _b;
                if (args.isPalette) {
                    return (_a = args.paletteLabel) !== null && _a !== void 0 ? _a : trans.__('New Text File');
                }
                return (_b = args.launcherLabel) !== null && _b !== void 0 ? _b : trans.__('Text File');
            },
            caption: args => { var _a; return (_a = args.caption) !== null && _a !== void 0 ? _a : trans.__('Create a new text file'); },
            icon: args => {
                var _a;
                return args.isPalette
                    ? undefined
                    : ui_components_lib_index_js_.LabIcon.resolve({
                        icon: (_a = args.iconName) !== null && _a !== void 0 ? _a : ui_components_lib_index_js_.textEditorIcon
                    });
            },
            execute: args => {
                var _a, _b;
                const cwd = args.cwd || ((_a = defaultBrowser === null || defaultBrowser === void 0 ? void 0 : defaultBrowser.model.path) !== null && _a !== void 0 ? _a : '.');
                return createNew(commands, cwd, (_b = args.fileExt) !== null && _b !== void 0 ? _b : 'txt');
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        cwd: {
                            type: 'string',
                            description: trans.__('The current working directory path')
                        },
                        fileExt: {
                            type: 'string',
                            description: trans.__('The file extension for the new file')
                        },
                        isPalette: {
                            type: 'boolean',
                            description: 'Whether the command is being called from the command palette'
                        },
                        paletteLabel: {
                            type: 'string',
                            description: trans.__('The label to show in the command palette')
                        },
                        launcherLabel: {
                            type: 'string',
                            description: trans.__('The label to show in the launcher')
                        },
                        caption: {
                            type: 'string',
                            description: trans.__('The caption for the command')
                        },
                        iconName: {
                            type: 'string',
                            description: trans.__('The name of the icon to use')
                        }
                    }
                }
            }
        });
        /**
         * Add the New Markdown File command
         */
        commands.addCommand(CommandIDs.createNewMarkdown, {
            label: args => args['isPalette']
                ? trans.__('New Markdown File')
                : trans.__('Markdown File'),
            caption: trans.__('Create a new markdown file'),
            icon: args => (args['isPalette'] ? undefined : ui_components_lib_index_js_.markdownIcon),
            execute: args => {
                var _a;
                const cwd = args['cwd'] || ((_a = defaultBrowser === null || defaultBrowser === void 0 ? void 0 : defaultBrowser.model.path) !== null && _a !== void 0 ? _a : '.');
                return createNew(commands, cwd, 'md');
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        cwd: {
                            type: 'string',
                            description: trans.__('The current working directory path')
                        },
                        isPalette: {
                            type: 'boolean',
                            description: 'Whether the command is being called from the command palette'
                        }
                    }
                }
            }
        });
        /**
         * Add undo command
         */
        commands.addCommand(CommandIDs.undo, {
            execute: () => {
                var _a;
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                widget.editor.undo();
            },
            isEnabled: () => {
                var _a;
                if (!isEnabled()) {
                    return false;
                }
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return false;
                }
                return widget.editor.model.sharedModel.canUndo();
            },
            icon: ui_components_lib_index_js_.undoIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Undo'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add redo command
         */
        commands.addCommand(CommandIDs.redo, {
            execute: () => {
                var _a;
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                widget.editor.redo();
            },
            isEnabled: () => {
                var _a;
                if (!isEnabled()) {
                    return false;
                }
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return false;
                }
                return widget.editor.model.sharedModel.canRedo();
            },
            icon: ui_components_lib_index_js_.redoIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Redo'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add cut command
         */
        commands.addCommand(CommandIDs.cut, {
            execute: () => {
                var _a;
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                const editor = widget.editor;
                const text = getTextSelection(editor);
                lib_index_js_.Clipboard.copyToSystem(text);
                editor.replaceSelection && editor.replaceSelection('');
            },
            isEnabled: () => {
                var _a;
                if (!isEnabled()) {
                    return false;
                }
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return false;
                }
                // Enable command if there is a text selection in the editor
                return isSelected(widget.editor);
            },
            icon: ui_components_lib_index_js_.cutIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Cut'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add copy command
         */
        commands.addCommand(CommandIDs.copy, {
            execute: () => {
                var _a;
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                const editor = widget.editor;
                const text = getTextSelection(editor);
                lib_index_js_.Clipboard.copyToSystem(text);
            },
            isEnabled: () => {
                var _a;
                if (!isEnabled()) {
                    return false;
                }
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return false;
                }
                // Enable command if there is a text selection in the editor
                return isSelected(widget.editor);
            },
            icon: ui_components_lib_index_js_.copyIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Copy'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add paste command
         */
        commands.addCommand(CommandIDs.paste, {
            execute: async () => {
                var _a;
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                const editor = widget.editor;
                // Get data from clipboard
                const clipboard = window.navigator.clipboard;
                const clipboardData = await clipboard.readText();
                if (clipboardData) {
                    // Paste data to the editor
                    editor.replaceSelection && editor.replaceSelection(clipboardData);
                }
            },
            isEnabled: () => { var _a; return Boolean(isEnabled() && ((_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content)); },
            icon: ui_components_lib_index_js_.pasteIcon.bindprops({ stylesheet: 'menuItem' }),
            label: trans.__('Paste'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        /**
         * Add select all command
         */
        commands.addCommand(CommandIDs.selectAll, {
            execute: () => {
                var _a;
                const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
                if (!widget) {
                    return;
                }
                const editor = widget.editor;
                editor.execCommand(dist_index_js_.selectAll);
            },
            isEnabled: () => { var _a; return Boolean(isEnabled() && ((_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content)); },
            label: trans.__('Select All'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        // All commands with isEnabled defined directly or in a semantic commands
        const commandIds = [
            CommandIDs.lineNumbers,
            CommandIDs.currentLineNumbers,
            CommandIDs.lineWrap,
            CommandIDs.currentLineWrap,
            CommandIDs.matchBrackets,
            CommandIDs.currentMatchBrackets,
            CommandIDs.find,
            CommandIDs.goToLine,
            CommandIDs.changeLanguage,
            CommandIDs.replaceSelection,
            CommandIDs.createConsole,
            CommandIDs.restartConsole,
            CommandIDs.runCode,
            CommandIDs.runAllCode,
            CommandIDs.undo,
            CommandIDs.redo,
            CommandIDs.cut,
            CommandIDs.copy,
            CommandIDs.paste,
            CommandIDs.selectAll,
            CommandIDs.createConsole
        ];
        const notify = () => {
            commandIds.forEach(id => commands.notifyCommandChanged(id));
        };
        tracker.currentChanged.connect(notify);
        (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);
    }
    Commands.addCommands = addCommands;
    function addCompleterCommands(commands, editorTracker, manager, translator) {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        commands.addCommand(CommandIDs.invokeCompleter, {
            label: trans.__('Display the completion helper.'),
            execute: () => {
                const id = editorTracker.currentWidget && editorTracker.currentWidget.id;
                if (id) {
                    return manager.invoke(id);
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(CommandIDs.selectCompleter, {
            label: trans.__('Select the completion suggestion.'),
            execute: () => {
                const id = editorTracker.currentWidget && editorTracker.currentWidget.id;
                if (id) {
                    return manager.select(id);
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addKeyBinding({
            command: CommandIDs.selectCompleter,
            keys: ['Enter'],
            selector: '.jp-FileEditor .jp-mod-completer-active'
        });
    }
    Commands.addCompleterCommands = addCompleterCommands;
    /**
     * Helper function to check if there is a text selection in the editor
     */
    function isSelected(editor) {
        const selectionObj = editor.getSelection();
        const { start, end } = selectionObj;
        const selected = start.column !== end.column || start.line !== end.line;
        return selected;
    }
    /**
     * Helper function to get text selection from the editor
     */
    function getTextSelection(editor) {
        const selectionObj = editor.getSelection();
        const start = editor.getOffsetAt(selectionObj.start);
        const end = editor.getOffsetAt(selectionObj.end);
        const text = editor.model.sharedModel.getSource().substring(start, end);
        return text;
    }
    /**
     * Function to create a new untitled text file, given the current working directory.
     */
    async function createNew(commands, cwd, ext = 'txt') {
        const model = await commands.execute('docmanager:new-untitled', {
            path: cwd,
            type: 'file',
            ext
        });
        if (model != undefined) {
            const widget = (await commands.execute('docmanager:open', {
                path: model.path,
                factory: FACTORY
            }));
            widget.isUntitled = true;
            return widget;
        }
    }
    /**
     * Wrapper function for adding the default launcher items for File Editor
     */
    function addLauncherItems(launcher, trans) {
        addCreateNewToLauncher(launcher, trans);
        addCreateNewMarkdownToLauncher(launcher, trans);
    }
    Commands.addLauncherItems = addLauncherItems;
    /**
     * Add Create New Text File to the Launcher
     */
    function addCreateNewToLauncher(launcher, trans) {
        launcher.add({
            command: CommandIDs.createNew,
            category: trans.__('Other'),
            rank: 1
        });
    }
    Commands.addCreateNewToLauncher = addCreateNewToLauncher;
    /**
     * Add Create New Markdown to the Launcher
     */
    function addCreateNewMarkdownToLauncher(launcher, trans) {
        launcher.add({
            command: CommandIDs.createNewMarkdown,
            category: trans.__('Other'),
            rank: 2
        });
    }
    Commands.addCreateNewMarkdownToLauncher = addCreateNewMarkdownToLauncher;
    /**
     * Add ___ File items to the Launcher for common file types associated with available kernels
     * Returns a DisposableSet containing all added items
     */
    function addKernelLanguageLauncherItems(launcher, trans, availableKernelFileTypes) {
        var _a, _b;
        const disposables = new dist_index_es6_js_.DisposableSet();
        for (const filetype of availableKernelFileTypes) {
            disposables.add(launcher.add({
                command: CommandIDs.createNew,
                category: trans.__('Other'),
                rank: 3,
                args: {
                    fileExt: filetype.extensions[0],
                    iconName: (_b = (_a = filetype.icon) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',
                    launcherLabel: trans.__('%1 File', filetype.displayName),
                    paletteLabel: trans.__('New %1 File', filetype.displayName),
                    caption: trans.__('Create a new %1 File', filetype.displayName)
                }
            }));
        }
        return disposables;
    }
    Commands.addKernelLanguageLauncherItems = addKernelLanguageLauncherItems;
    /**
     * Wrapper function for adding the default items to the File Editor palette
     */
    function addPaletteItems(palette, trans) {
        addChangeTabsCommandsToPalette(palette, trans);
        addCreateNewCommandToPalette(palette, trans);
        addCreateNewMarkdownCommandToPalette(palette, trans);
        addChangeFontSizeCommandsToPalette(palette, trans);
    }
    Commands.addPaletteItems = addPaletteItems;
    /**
     * Add commands to change the tab indentation to the File Editor palette
     */
    function addChangeTabsCommandsToPalette(palette, trans) {
        const paletteCategory = trans.__('Text Editor');
        const args = {
            size: 4
        };
        const command = CommandIDs.changeTabs;
        palette.addItem({ command, args, category: paletteCategory });
        for (const size of [1, 2, 4, 8]) {
            const args = {
                size
            };
            palette.addItem({ command, args, category: paletteCategory });
        }
    }
    Commands.addChangeTabsCommandsToPalette = addChangeTabsCommandsToPalette;
    /**
     * Add a Create New File command to the File Editor palette
     */
    function addCreateNewCommandToPalette(palette, trans) {
        const paletteCategory = trans.__('Text Editor');
        palette.addItem({
            command: CommandIDs.createNew,
            args: { isPalette: true },
            category: paletteCategory
        });
    }
    Commands.addCreateNewCommandToPalette = addCreateNewCommandToPalette;
    /**
     * Add a Create New Markdown command to the File Editor palette
     */
    function addCreateNewMarkdownCommandToPalette(palette, trans) {
        const paletteCategory = trans.__('Text Editor');
        palette.addItem({
            command: CommandIDs.createNewMarkdown,
            args: { isPalette: true },
            category: paletteCategory
        });
    }
    Commands.addCreateNewMarkdownCommandToPalette = addCreateNewMarkdownCommandToPalette;
    /**
     * Add commands to change the font size to the File Editor palette
     */
    function addChangeFontSizeCommandsToPalette(palette, trans) {
        const paletteCategory = trans.__('Text Editor');
        const command = CommandIDs.changeFontSize;
        let args = { delta: 1 };
        palette.addItem({ command, args, category: paletteCategory });
        args = { delta: -1 };
        palette.addItem({ command, args, category: paletteCategory });
    }
    Commands.addChangeFontSizeCommandsToPalette = addChangeFontSizeCommandsToPalette;
    /**
     * Add New ___ File commands to the File Editor palette for common file types associated with available kernels
     * Returns a DisposableSet containing all added items
     */
    function addKernelLanguagePaletteItems(palette, trans, availableKernelFileTypes) {
        var _a, _b;
        const disposables = new dist_index_es6_js_.DisposableSet();
        const paletteCategory = trans.__('Text Editor');
        for (const filetype of availableKernelFileTypes) {
            disposables.add(palette.addItem({
                command: CommandIDs.createNew,
                args: {
                    fileExt: filetype.extensions[0],
                    iconName: (_b = (_a = filetype.icon) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',
                    launcherLabel: trans.__('%1 File', filetype.displayName),
                    paletteLabel: trans.__('New %1 File', filetype.displayName),
                    caption: trans.__('Create a new %1 File', filetype.displayName),
                    isPalette: true
                },
                category: paletteCategory
            }));
        }
        return disposables;
    }
    Commands.addKernelLanguagePaletteItems = addKernelLanguagePaletteItems;
    /**
     * Wrapper function for adding the default menu items for File Editor
     */
    function addMenuItems(menu, tracker, consoleTracker, isEnabled) {
        // Add undo/redo hooks to the edit menu.
        menu.editMenu.undoers.redo.add({
            id: CommandIDs.redo,
            isEnabled
        });
        menu.editMenu.undoers.undo.add({
            id: CommandIDs.undo,
            isEnabled
        });
        // Add editor view options.
        menu.viewMenu.editorViewers.toggleLineNumbers.add({
            id: CommandIDs.currentLineNumbers,
            isEnabled
        });
        menu.viewMenu.editorViewers.toggleMatchBrackets.add({
            id: CommandIDs.currentMatchBrackets,
            isEnabled
        });
        menu.viewMenu.editorViewers.toggleWordWrap.add({
            id: CommandIDs.currentLineWrap,
            isEnabled
        });
        // Add a console creator the the file menu.
        menu.fileMenu.consoleCreators.add({
            id: CommandIDs.createConsole,
            isEnabled
        });
        // Add a code runner to the run menu.
        if (consoleTracker) {
            addCodeRunnersToRunMenu(menu, consoleTracker, isEnabled);
        }
    }
    Commands.addMenuItems = addMenuItems;
    /**
     * Add Create New ___ File commands to the File menu for common file types associated with available kernels
     * Returns a DisposableSet containing all added items
     */
    function addKernelLanguageMenuItems(menu, trans, availableKernelFileTypes) {
        var _a, _b;
        const disposables = new dist_index_es6_js_.DisposableSet();
        for (const filetype of availableKernelFileTypes) {
            disposables.add(menu.fileMenu.newMenu.addItem({
                command: CommandIDs.createNew,
                args: {
                    fileExt: filetype.extensions[0],
                    iconName: (_b = (_a = filetype.icon) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',
                    launcherLabel: trans.__('%1 File', filetype.displayName),
                    paletteLabel: trans.__('New %1 File', filetype.displayName),
                    caption: trans.__('Create a new %1 File', filetype.displayName)
                },
                rank: 31
            }));
        }
        return disposables;
    }
    Commands.addKernelLanguageMenuItems = addKernelLanguageMenuItems;
    /**
     * Add a File Editor code runner to the Run menu
     */
    function addCodeRunnersToRunMenu(menu, consoleTracker, isEnabled) {
        const isEnabled_ = (current) => isEnabled() &&
            current.context &&
            !!consoleTracker.find(widget => { var _a; return ((_a = widget.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path) === current.context.path; });
        menu.runMenu.codeRunners.restart.add({
            id: CommandIDs.restartConsole,
            isEnabled: isEnabled_
        });
        menu.runMenu.codeRunners.run.add({
            id: CommandIDs.runCode,
            isEnabled: isEnabled_
        });
        menu.runMenu.codeRunners.runAll.add({
            id: CommandIDs.runAllCode,
            isEnabled: isEnabled_
        });
    }
    Commands.addCodeRunnersToRunMenu = addCodeRunnersToRunMenu;
    function addOpenCodeViewerCommand(app, editorServices, tracker, trans) {
        const openCodeViewer = async (args) => {
            var _a;
            const func = editorServices.factoryService.newDocumentEditor;
            const factory = options => {
                return func(options);
            };
            // Derive mimetype from extension
            let mimetype = args.mimeType;
            if (!mimetype && args.extension) {
                mimetype = editorServices.mimeTypeService.getMimeTypeByFilePath(`temp.${args.extension.replace(/\\.$/, '')}`);
            }
            const widget = codeeditor_lib_index_js_.CodeViewerWidget.createCodeViewer({
                factory,
                content: args.content,
                mimeType: mimetype
            });
            widget.title.label = args.label || trans.__('Code Viewer');
            widget.title.caption = widget.title.label;
            // Get the fileType based on the mimetype to determine the icon
            const fileType = (0,index_es6_js_.find)(app.docRegistry.fileTypes(), fileType => mimetype ? fileType.mimeTypes.includes(mimetype) : false);
            widget.title.icon = (_a = fileType === null || fileType === void 0 ? void 0 : fileType.icon) !== null && _a !== void 0 ? _a : ui_components_lib_index_js_.textEditorIcon;
            if (args.widgetId) {
                widget.id = args.widgetId;
            }
            const main = new lib_index_js_.MainAreaWidget({ content: widget });
            await tracker.add(main);
            app.shell.add(main, 'main');
            return widget;
        };
        app.commands.addCommand(CommandIDs.openCodeViewer, {
            label: trans.__('Open Code Viewer'),
            execute: (args) => {
                return openCodeViewer(args);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        content: {
                            type: 'string',
                            description: trans.__('The content to display in the code viewer')
                        },
                        label: {
                            type: 'string',
                            description: trans.__('The label for the code viewer')
                        },
                        mimeType: {
                            type: 'string',
                            description: trans.__('The MIME type of the content')
                        },
                        extension: {
                            type: 'string',
                            description: trans.__('The file extension to derive MIME type from')
                        },
                        widgetId: {
                            type: 'string',
                            description: trans.__('The ID to assign to the widget')
                        }
                    },
                    required: ['content']
                }
            }
        });
    }
    Commands.addOpenCodeViewerCommand = addOpenCodeViewerCommand;
})(Commands || (Commands = {}));
//# sourceMappingURL=commands.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor-extension/lib/syntaxstatus.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */





/**
 * The JupyterLab plugin for the EditorSyntax status item.
 */
const editorSyntaxStatus = {
    id: '@jupyterlab/fileeditor-extension:editor-syntax-status',
    description: 'Adds a file editor syntax status widget.',
    autoStart: true,
    requires: [fileeditor_lib_index_js_.IEditorTracker, codemirror_lib_index_js_.IEditorLanguageRegistry, index_js_.ILabShell, translation_lib_index_js_.ITranslator],
    optional: [statusbar_lib_index_js_.IStatusBar],
    activate: (app, tracker, languages, labShell, translator, statusBar) => {
        if (!statusBar) {
            // Automatically disable if statusbar missing
            return;
        }
        const item = new fileeditor_lib_index_js_.EditorSyntaxStatus({
            commands: app.commands,
            languages,
            translator
        });
        labShell.currentChanged.connect(() => {
            const current = labShell.currentWidget;
            if (current && tracker.has(current) && item.model) {
                item.model.editor = current.content.editor;
            }
        });
        statusBar.registerStatusItem(editorSyntaxStatus.id, {
            item,
            align: 'left',
            rank: 0,
            isActive: () => !!labShell.currentWidget &&
                !!tracker.currentWidget &&
                labShell.currentWidget === tracker.currentWidget
        });
    }
};
//# sourceMappingURL=syntaxstatus.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module fileeditor-extension
 */























/**
 * The editor tracker extension.
 */
const lib_plugin = {
    activate,
    id: '@jupyterlab/fileeditor-extension:plugin',
    description: 'Provides the file editor widget tracker.',
    requires: [
        fileeditor_lib_index_js_.IEditorWidgetFactory,
        codeeditor_lib_index_js_.IEditorServices,
        codemirror_lib_index_js_.IEditorExtensionRegistry,
        codemirror_lib_index_js_.IEditorLanguageRegistry,
        codemirror_lib_index_js_.IEditorThemeRegistry,
        settingregistry_lib_index_js_.ISettingRegistry
    ],
    optional: [
        filebrowser_lib_index_js_.IDefaultFileBrowser,
        console_lib_index_js_.IConsoleTracker,
        lib_index_js_.ICommandPalette,
        launcher_lib_index_js_.ILauncher,
        mainmenu_lib_index_js_.IMainMenu,
        index_js_.ILayoutRestorer,
        lib_index_js_.ISessionContextDialogs,
        toc_lib_index_js_.ITableOfContentsRegistry,
        translation_lib_index_js_.ITranslator,
        ui_components_lib_index_js_.IFormRendererRegistry,
        rendermime_lib_index_js_.IMarkdownParser
    ],
    provides: fileeditor_lib_index_js_.IEditorTracker,
    autoStart: true
};
/**
 * The widget factory extension.
 */
const widgetFactory = {
    id: '@jupyterlab/fileeditor-extension:widget-factory',
    description: 'Provides the factory for creating file editors.',
    autoStart: true,
    requires: [codeeditor_lib_index_js_.IEditorServices, settingregistry_lib_index_js_.ISettingRegistry],
    optional: [lib_index_js_.IToolbarWidgetRegistry, translation_lib_index_js_.ITranslator],
    provides: fileeditor_lib_index_js_.IEditorWidgetFactory,
    activate: (app, editorServices, settingRegistry, toolbarRegistry, translator_) => {
        const id = lib_plugin.id;
        const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        let toolbarFactory;
        if (toolbarRegistry) {
            toolbarFactory = (0,lib_index_js_.createToolbarFactory)(toolbarRegistry, settingRegistry, FACTORY, id, translator);
        }
        const factory = new fileeditor_lib_index_js_.FileEditorFactory({
            editorServices,
            factoryOptions: {
                name: FACTORY,
                label: trans.__('Editor'),
                fileTypes: ['markdown', '*'], // Explicitly add the markdown fileType so
                defaultFor: ['markdown', '*'], // it outranks the defaultRendered viewer.
                toolbarFactory,
                translator
            }
        });
        app.docRegistry.addWidgetFactory(factory);
        return factory;
    }
};
/**
 * A plugin that provides a status item allowing the user to
 * switch tabs vs spaces and tab widths for text editors.
 */
const tabSpaceStatus = {
    id: '@jupyterlab/fileeditor-extension:tab-space-status',
    description: 'Adds a file editor indentation status widget.',
    autoStart: true,
    requires: [
        fileeditor_lib_index_js_.IEditorTracker,
        codemirror_lib_index_js_.IEditorExtensionRegistry,
        settingregistry_lib_index_js_.ISettingRegistry,
        translation_lib_index_js_.ITranslator
    ],
    optional: [statusbar_lib_index_js_.IStatusBar],
    activate: (app, editorTracker, extensions, settingRegistry, translator, statusBar) => {
        const trans = translator.load('jupyterlab');
        if (!statusBar) {
            // Automatically disable if statusbar missing
            return;
        }
        // Create a menu for switching tabs vs spaces.
        const menu = new ui_components_lib_index_js_.MenuSvg({ commands: app.commands });
        const command = 'fileeditor:change-tabs';
        const { shell } = app;
        const args = {
            name: trans.__('Indent with Tab')
        };
        menu.addItem({ command, args });
        for (const size of ['1', '2', '4', '8']) {
            const args = {
                size,
                // Use a context to differentiate with string set as plural in 3.x
                name: trans._p('v4', 'Spaces: %1', size)
            };
            menu.addItem({ command, args });
        }
        // Create the status item.
        const item = new fileeditor_lib_index_js_.TabSpaceStatus({ menu, translator });
        // Keep a reference to the code editor config from the settings system.
        const updateIndentUnit = (settings) => {
            var _a, _b, _c;
            item.model.indentUnit =
                (_c = (_b = (_a = settings.get('editorConfig').composite) === null || _a === void 0 ? void 0 : _a.indentUnit) !== null && _b !== void 0 ? _b : extensions.baseConfiguration.indentUnit) !== null && _c !== void 0 ? _c : null;
        };
        void Promise.all([
            settingRegistry.load('@jupyterlab/fileeditor-extension:plugin'),
            app.restored
        ]).then(([settings]) => {
            updateIndentUnit(settings);
            settings.changed.connect(updateIndentUnit);
        });
        // Add the status item.
        statusBar.registerStatusItem('@jupyterlab/fileeditor-extension:tab-space-status', {
            item,
            align: 'right',
            rank: 1,
            isActive: () => {
                return (!!shell.currentWidget && editorTracker.has(shell.currentWidget));
            }
        });
    }
};
/**
 * Cursor position.
 */
const lineColStatus = {
    id: '@jupyterlab/fileeditor-extension:cursor-position',
    description: 'Adds a file editor cursor position status widget.',
    activate: (app, tracker, positionModel) => {
        positionModel.addEditorProvider((widget) => Promise.resolve(widget && tracker.has(widget)
            ? widget.content.editor
            : null));
    },
    requires: [fileeditor_lib_index_js_.IEditorTracker, codeeditor_lib_index_js_.IPositionModel],
    autoStart: true
};
const completerPlugin = {
    id: '@jupyterlab/fileeditor-extension:completer',
    description: 'Adds the completer capability to the file editor.',
    requires: [fileeditor_lib_index_js_.IEditorTracker],
    optional: [completer_lib_index_js_.ICompletionProviderManager, translation_lib_index_js_.ITranslator, lib_index_js_.ISanitizer],
    activate: activateFileEditorCompleterService,
    autoStart: true
};
/**
 * A plugin to search file editors
 */
const searchProvider = {
    id: '@jupyterlab/fileeditor-extension:search',
    description: 'Adds search capability to the file editor.',
    requires: [documentsearch_lib_index_js_.ISearchProviderRegistry],
    autoStart: true,
    activate: (app, registry) => {
        registry.add('jp-fileeditorSearchProvider', fileeditor_lib_index_js_.FileEditorSearchProvider);
    }
};
const languageServerPlugin = {
    id: '@jupyterlab/fileeditor-extension:language-server',
    description: 'Adds Language Server capability to the file editor.',
    requires: [
        fileeditor_lib_index_js_.IEditorTracker,
        lsp_lib_index_js_.ILSPDocumentConnectionManager,
        lsp_lib_index_js_.ILSPFeatureManager,
        lsp_lib_index_js_.ILSPCodeExtractorsManager,
        lsp_lib_index_js_.IWidgetLSPAdapterTracker
    ],
    activate: activateFileEditorLanguageServer,
    autoStart: true
};
/**
 * Export the plugins as default.
 */
const plugins = [
    widgetFactory,
    lib_plugin,
    lineColStatus,
    completerPlugin,
    languageServerPlugin,
    searchProvider,
    editorSyntaxStatus,
    tabSpaceStatus
];
/* harmony default export */ const lib = (plugins);
/**
 * Activate the editor tracker plugin.
 */
function activate(app, factory, editorServices, extensions, languages, themes, settingRegistry, fileBrowser, consoleTracker, palette, launcher, menu, restorer, sessionDialogs_, tocRegistry, translator_, formRegistry, parser) {
    const id = lib_plugin.id;
    const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
    const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new lib_index_js_.SessionContextDialogs({ translator });
    const trans = translator.load('jupyterlab');
    const namespace = 'editor';
    const { commands, restored, shell } = app;
    const tracker = new lib_index_js_.WidgetTracker({
        namespace
    });
    const isEnabled = () => tracker.currentWidget !== null &&
        tracker.currentWidget === shell.currentWidget;
    let launcherDisposables = null;
    let paletteDisposables = null;
    let menuDisposables = null;
    const updateKernelFileTypeComponents = (fileTypes) => {
        // Dispose of previous entries if they exist
        if (launcherDisposables) {
            launcherDisposables.dispose();
            launcherDisposables = null;
        }
        if (paletteDisposables) {
            paletteDisposables.dispose();
            paletteDisposables = null;
        }
        if (menuDisposables) {
            menuDisposables.dispose();
            menuDisposables = null;
        }
        if (launcher) {
            launcherDisposables = Commands.addKernelLanguageLauncherItems(launcher, trans, fileTypes);
        }
        if (palette) {
            paletteDisposables = Commands.addKernelLanguagePaletteItems(palette, trans, fileTypes);
        }
        if (menu) {
            menuDisposables = Commands.addKernelLanguageMenuItems(menu, trans, fileTypes);
        }
    };
    // Update if new specs are added later
    const specsManager = app.serviceManager.kernelspecs;
    specsManager.specsChanged.connect(async () => {
        try {
            const updatedFileTypes = await (0,docregistry_lib_index_js_.getAvailableKernelFileTypes)(app.serviceManager.kernelspecs);
            updateKernelFileTypeComponents(updatedFileTypes);
        }
        catch (error) {
            console.error('Error updating kernel file types:', error);
        }
    });
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: 'docmanager:open',
            args: widget => ({ path: widget.context.path, factory: FACTORY }),
            name: widget => widget.context.path
        });
    }
    // Add a console creator to the File menu
    // Fetch the initial state of the settings.
    Promise.all([settingRegistry.load(id), restored])
        .then(([settings]) => {
        var _a, _b, _c;
        // As the menu are defined in the settings we must ensure they are loaded
        // before updating dynamically the submenu
        if (menu) {
            const languageMenu = (_a = menu.viewMenu.items.find(item => {
                var _a;
                return item.type === 'submenu' &&
                    ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-view-codemirror-language';
            })) === null || _a === void 0 ? void 0 : _a.submenu;
            if (languageMenu) {
                languages
                    .getLanguages()
                    .sort((a, b) => {
                    const aName = a.name;
                    const bName = b.name;
                    return aName.localeCompare(bName);
                })
                    .forEach(spec => {
                    // Avoid mode name with a curse word.
                    if (spec.name.toLowerCase().indexOf('brainf') === 0) {
                        return;
                    }
                    languageMenu.addItem({
                        command: CommandIDs.changeLanguage,
                        args: { ...spec } // TODO: Casting to `any` until lumino typings are fixed
                    });
                });
            }
            const themeMenu = (_b = menu.settingsMenu.items.find(item => {
                var _a;
                return item.type === 'submenu' &&
                    ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-settings-codemirror-theme';
            })) === null || _b === void 0 ? void 0 : _b.submenu;
            if (themeMenu) {
                for (const theme of themes.themes) {
                    themeMenu.addItem({
                        command: CommandIDs.changeTheme,
                        args: {
                            theme: theme.name,
                            displayName: (_c = theme.displayName) !== null && _c !== void 0 ? _c : theme.name
                        }
                    });
                }
            }
            // Add go to line capabilities to the edit menu.
            menu.editMenu.goToLiners.add({
                id: CommandIDs.goToLine,
                isEnabled: (w) => tracker.currentWidget !== null && tracker.has(w)
            });
        }
        Commands.updateSettings(settings, commands);
        Commands.updateTracker(tracker);
        settings.changed.connect(() => {
            Commands.updateSettings(settings, commands);
            Commands.updateTracker(tracker);
        });
    })
        .catch((reason) => {
        console.error(reason.message);
        Commands.updateTracker(tracker);
    });
    if (formRegistry) {
        const CMRenderer = formRegistry.getRenderer('@jupyterlab/codemirror-extension:plugin.defaultConfig');
        if (CMRenderer) {
            formRegistry.addRenderer('@jupyterlab/fileeditor-extension:plugin.editorConfig', CMRenderer);
        }
    }
    factory.widgetCreated.connect((sender, widget) => {
        // Notify the widget tracker if restore data needs to update.
        widget.context.pathChanged.connect(() => {
            void tracker.save(widget);
        });
        void tracker.add(widget);
        Commands.updateWidget(widget.content);
    });
    // Handle the settings of new widgets.
    tracker.widgetAdded.connect((sender, widget) => {
        Commands.updateWidget(widget.content);
    });
    Commands.addCommands(app.commands, settingRegistry, trans, id, isEnabled, tracker, fileBrowser, extensions, languages, consoleTracker, sessionDialogs, app.shell);
    const codeViewerTracker = new lib_index_js_.WidgetTracker({
        namespace: 'codeviewer'
    });
    // Handle state restoration for code viewers
    if (restorer) {
        void restorer.restore(codeViewerTracker, {
            command: CommandIDs.openCodeViewer,
            args: widget => ({
                content: widget.content.content,
                label: widget.content.title.label,
                mimeType: widget.content.mimeType,
                widgetId: widget.content.id
            }),
            name: widget => widget.content.id
        });
    }
    Commands.addOpenCodeViewerCommand(app, editorServices, codeViewerTracker, trans);
    // Add a launcher item if the launcher is available.
    if (launcher) {
        Commands.addLauncherItems(launcher, trans);
    }
    if (palette) {
        Commands.addPaletteItems(palette, trans);
    }
    if (menu) {
        Commands.addMenuItems(menu, tracker, consoleTracker, isEnabled);
    }
    (0,docregistry_lib_index_js_.getAvailableKernelFileTypes)(app.serviceManager.kernelspecs)
        .then(updateKernelFileTypeComponents)
        .catch((reason) => {
        console.error(reason.message);
    });
    if (tocRegistry) {
        tocRegistry.add(new fileeditor_lib_index_js_.LaTeXTableOfContentsFactory(tracker));
        tocRegistry.add(new fileeditor_lib_index_js_.MarkdownTableOfContentsFactory(tracker, parser));
        tocRegistry.add(new fileeditor_lib_index_js_.PythonTableOfContentsFactory(tracker));
    }
    return tracker;
}
/**
 * Activate the completer service for file editor.
 */
function activateFileEditorCompleterService(app, editorTracker, manager, translator, appSanitizer) {
    if (!manager) {
        return;
    }
    Commands.addCompleterCommands(app.commands, editorTracker, manager, translator);
    const sessionManager = app.serviceManager.sessions;
    const sanitizer = appSanitizer !== null && appSanitizer !== void 0 ? appSanitizer : new lib_index_js_.Sanitizer();
    const _activeSessions = new Map();
    const updateCompleter = async (_, widget) => {
        const completerContext = {
            editor: widget.content.editor,
            widget
        };
        await manager.updateCompleter(completerContext);
        const onRunningChanged = (_, models) => {
            const oldSession = _activeSessions.get(widget.id);
            // Search for a matching path.
            const model = (0,index_es6_js_.find)(models, m => m.path === widget.context.path);
            if (model) {
                // If there is a matching path, but it is the same
                // session as we previously had, do nothing.
                if (oldSession && oldSession.id === model.id) {
                    return;
                }
                // Otherwise, dispose of the old session and reset to
                // a new CompletionConnector.
                if (oldSession) {
                    _activeSessions.delete(widget.id);
                    oldSession.dispose();
                }
                const session = sessionManager.connectTo({ model });
                const newCompleterContext = {
                    editor: widget.content.editor,
                    widget,
                    session,
                    sanitizer
                };
                manager.updateCompleter(newCompleterContext).catch(console.error);
                _activeSessions.set(widget.id, session);
            }
            else {
                // If we didn't find a match, make sure
                // the connector is the contextConnector and
                // dispose of any previous connection.
                if (oldSession) {
                    _activeSessions.delete(widget.id);
                    oldSession.dispose();
                }
            }
        };
        onRunningChanged(sessionManager, Array.from(sessionManager.running()));
        sessionManager.runningChanged.connect(onRunningChanged);
        widget.disposed.connect(() => {
            sessionManager.runningChanged.disconnect(onRunningChanged);
            const session = _activeSessions.get(widget.id);
            if (session) {
                _activeSessions.delete(widget.id);
                session.dispose();
            }
        });
    };
    editorTracker.widgetAdded.connect(updateCompleter);
    manager.activeProvidersChanged.connect(() => {
        editorTracker.forEach(editorWidget => {
            updateCompleter(editorTracker, editorWidget).catch(console.error);
        });
    });
}
function activateFileEditorLanguageServer(app, editors, connectionManager, featureManager, extractorManager, adapterTracker) {
    editors.widgetAdded.connect(async (_, editor) => {
        const adapter = new fileeditor_lib_index_js_.FileEditorAdapter(editor, {
            connectionManager,
            featureManager,
            foreignCodeExtractorsManager: extractorManager,
            docRegistry: app.docRegistry
        });
        adapterTracker.add(adapter);
    });
}
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 9755:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_statusbar_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(546);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_codeeditor_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7526);
/* harmony import */ var _jupyterlab_rendermime_style_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45304);
/* harmony import */ var _jupyterlab_docregistry_style_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30507);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_documentsearch_style_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(13737);
/* harmony import */ var _jupyterlab_codemirror_style_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(32871);
/* harmony import */ var _jupyterlab_completer_style_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(76576);
/* harmony import */ var _jupyterlab_filebrowser_style_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(40360);
/* harmony import */ var _jupyterlab_toc_style_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91302);
/* harmony import */ var _jupyterlab_console_style_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(42249);
/* harmony import */ var _jupyterlab_lsp_style_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(27844);
/* harmony import */ var _jupyterlab_fileeditor_style_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(44696);
/* harmony import */ var _jupyterlab_launcher_style_index_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(22640);
/* harmony import */ var _jupyterlab_mainmenu_style_index_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(70022);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */




















/***/ }),

/***/ 31833:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  EditorSyntaxStatus: () => (/* reexport */ EditorSyntaxStatus),
  EditorTableOfContentsFactory: () => (/* reexport */ EditorTableOfContentsFactory),
  FileEditor: () => (/* reexport */ FileEditor),
  FileEditorAdapter: () => (/* reexport */ FileEditorAdapter),
  FileEditorFactory: () => (/* reexport */ FileEditorFactory),
  FileEditorSearchProvider: () => (/* reexport */ FileEditorSearchProvider),
  FileEditorWidget: () => (/* reexport */ FileEditorWidget),
  IEditorTracker: () => (/* reexport */ IEditorTracker),
  IEditorWidgetFactory: () => (/* reexport */ IEditorWidgetFactory),
  LaTeXTableOfContentsFactory: () => (/* reexport */ LaTeXTableOfContentsFactory),
  LaTeXTableOfContentsModel: () => (/* reexport */ LaTeXTableOfContentsModel),
  MarkdownTableOfContentsFactory: () => (/* reexport */ MarkdownTableOfContentsFactory),
  MarkdownTableOfContentsModel: () => (/* reexport */ MarkdownTableOfContentsModel),
  PythonTableOfContentsFactory: () => (/* reexport */ PythonTableOfContentsFactory),
  PythonTableOfContentsModel: () => (/* reexport */ PythonTableOfContentsModel),
  TabSpaceStatus: () => (/* reexport */ TabSpaceStatus)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/lsp@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/lsp/lib/index.js)
var lib_index_js_ = __webpack_require__(84259);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/fileeditorlspadapter.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



class FileEditorAdapter extends lib_index_js_.WidgetLSPAdapter {
    constructor(editorWidget, options) {
        const { docRegistry, ...others } = options;
        super(editorWidget, others);
        this._readyDelegate = new dist_index_js_.PromiseDelegate();
        this.editor = editorWidget.content;
        this._docRegistry = docRegistry;
        // Ensure editor uniqueness
        this._virtualEditor = Object.freeze({
            getEditor: () => this.editor.editor,
            ready: () => Promise.resolve(this.editor.editor),
            reveal: () => Promise.resolve(this.editor.editor)
        });
        Promise.all([this.editor.context.ready, this.connectionManager.ready])
            .then(async () => {
            await this.initOnceReady();
            this._readyDelegate.resolve();
            this._editorAdded.emit({
                editor: this._virtualEditor
            });
        })
            .catch(console.error);
    }
    /**
     * Promise that resolves once the adapter is initialized
     */
    get ready() {
        return this._readyDelegate.promise;
    }
    /**
     * Get current path of the document.
     */
    get documentPath() {
        return this.widget.context.path;
    }
    /**
     * Get the mime type of the document.
     */
    get mimeType() {
        var _a;
        const mimeTypeFromModel = this.editor.model.mimeType;
        const codeMirrorMimeType = Array.isArray(mimeTypeFromModel)
            ? (_a = mimeTypeFromModel[0]) !== null && _a !== void 0 ? _a : index_js_.IEditorMimeTypeService.defaultMimeType
            : mimeTypeFromModel;
        const contentsModel = this.editor.context.contentsModel;
        // when MIME type is not known it defaults to 'text/plain',
        // so if it is different we can accept it as it is
        if (codeMirrorMimeType != index_js_.IEditorMimeTypeService.defaultMimeType) {
            return codeMirrorMimeType;
        }
        else if (contentsModel) {
            // a script that does not have a MIME type known by the editor
            // (no syntax highlight mode), can still be known by the document
            // registry (and this is arguably easier to extend).
            let fileType = this._docRegistry.getFileTypeForModel(contentsModel);
            return fileType.mimeTypes[0];
        }
        else {
            // "text/plain" this is
            return codeMirrorMimeType;
        }
    }
    /**
     * Get the file extension of the document.
     */
    get languageFileExtension() {
        let parts = this.documentPath.split('.');
        return parts[parts.length - 1];
    }
    /**
     * Get the CM editor
     */
    get ceEditor() {
        return this.editor.editor;
    }
    /**
     * Get the activated CM editor.
     */
    get activeEditor() {
        return this._virtualEditor;
    }
    /**
     * Get the inner HTMLElement of the document widget.
     */
    get wrapperElement() {
        return this.widget.node;
    }
    /**
     * Get current path of the document.
     */
    get path() {
        return this.widget.context.path;
    }
    /**
     *  Get the list of CM editors in the document, there is only one editor
     * in the case of file editor.
     */
    get editors() {
        var _a, _b;
        return [
            {
                ceEditor: this._virtualEditor,
                type: 'code',
                value: (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.model.sharedModel.getSource()) !== null && _b !== void 0 ? _b : ''
            }
        ];
    }
    /**
     * Dispose the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._editorRemoved.emit({
            editor: this._virtualEditor
        });
        this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection);
        super.dispose();
    }
    /**
     * Generate the virtual document associated with the document.
     */
    createVirtualDocument() {
        return new lib_index_js_.VirtualDocument({
            language: this.language,
            foreignCodeExtractors: this.options.foreignCodeExtractorsManager,
            path: this.documentPath,
            fileExtension: this.languageFileExtension,
            // notebooks are continuous, each cell is dependent on the previous one
            standalone: true,
            // notebooks are not supported by LSP servers
            hasLspSupportedFile: true
        });
    }
    /**
     * Get the index of editor from the cursor position in the virtual
     * document. Since there is only one editor, this method always return
     * 0
     * @deprecated This is error-prone and will be removed in JupyterLab 5.0, use `getEditorIndex()` with `virtualDocument.getEditorAtVirtualLine(position)` instead.
     *
     * @param position - the position of cursor in the virtual document.
     * @return  {number} - index of the virtual editor
     */
    getEditorIndexAt(position) {
        return 0;
    }
    /**
     * Get the index of input editor
     *
     * @param ceEditor - instance of the code editor
     */
    getEditorIndex(ceEditor) {
        return 0;
    }
    /**
     * Get the wrapper of input editor.
     *
     * @param ceEditor
     * @return  {HTMLElement}
     */
    getEditorWrapper(ceEditor) {
        return this.wrapperElement;
    }
    /**
     * Initialization function called once the editor and the LSP connection
     * manager is ready. This function will create the virtual document and
     * connect various signals.
     */
    async initOnceReady() {
        this.initVirtual();
        // connect the document, but do not open it as the adapter will handle this
        // after registering all features
        await this.connectDocument(this.virtualDocument, false);
        this.editor.model.mimeTypeChanged.connect(this.reloadConnection, this);
    }
}
//# sourceMappingURL=fileeditorlspadapter.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codemirror@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codemirror/lib/index.js)
var codemirror_lib_index_js_ = __webpack_require__(84088);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * The data attribute added to a widget that can run code.
 */
const CODE_RUNNER = 'jpCodeRunner';
/**
 * The data attribute added to a widget that can undo.
 */
const UNDOER = 'jpUndoer';
/**
 * A widget for editors.
 */
class FileEditor extends index_es6_js_.Widget {
    /**
     * Construct a new editor widget.
     */
    constructor(options) {
        super();
        this._ready = new dist_index_js_.PromiseDelegate();
        this.addClass('jp-FileEditor');
        const context = (this._context = options.context);
        this._mimeTypeService = options.mimeTypeService;
        const editorWidget = (this._editorWidget = new index_js_.CodeEditorWrapper({
            factory: options.factory,
            model: context.model,
            editorOptions: {
                config: FileEditor.defaultEditorConfig
            }
        }));
        this._editorWidget.addClass('jp-FileEditorCodeWrapper');
        this._editorWidget.node.dataset[CODE_RUNNER] = 'true';
        this._editorWidget.node.dataset[UNDOER] = 'true';
        this.editor = editorWidget.editor;
        this.model = editorWidget.model;
        const scrollPastEnd = FileEditor.defaultEditorConfig.scrollPastEnd;
        this.toggleClass('jp-mod-scrollPastEnd', scrollPastEnd);
        void context.ready.then(() => {
            this._onContextReady();
        });
        // Listen for changes to the path.
        this._onPathChanged();
        context.pathChanged.connect(this._onPathChanged, this);
        const layout = (this.layout = new index_es6_js_.StackedLayout());
        layout.addWidget(editorWidget);
    }
    /**
     * Get the context for the editor widget.
     */
    get context() {
        return this._context;
    }
    /**
     * A promise that resolves when the file editor is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the widget's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        if (!this.model) {
            return;
        }
        switch (event.type) {
            case 'mousedown':
                this._ensureFocus();
                break;
            default:
                break;
        }
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        const node = this.node;
        node.addEventListener('mousedown', this);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        const node = this.node;
        node.removeEventListener('mousedown', this);
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        this._ensureFocus();
    }
    /**
     * Ensure that the widget has focus.
     */
    _ensureFocus() {
        if (!this.editor.hasFocus()) {
            this.editor.focus();
        }
    }
    /**
     * Handle actions that should be taken when the context is ready.
     */
    _onContextReady() {
        if (this.isDisposed) {
            return;
        }
        // Prevent the initial loading from disk from being in the editor history.
        this.editor.clearHistory();
        // Resolve the ready promise.
        this._ready.resolve(undefined);
    }
    /**
     * Handle a change to the path.
     */
    _onPathChanged() {
        const editor = this.editor;
        const localPath = this._context.localPath;
        editor.model.mimeType =
            this._mimeTypeService.getMimeTypeByFilePath(localPath);
    }
}
/**
 * The namespace for editor widget statics.
 */
(function (FileEditor) {
    /**
     * File editor default configuration.
     */
    FileEditor.defaultEditorConfig = {
        lineNumbers: true,
        scrollPastEnd: true
    };
})(FileEditor || (FileEditor = {}));
/**
 * A document widget for file editor widgets.
 */
class FileEditorWidget extends docregistry_lib_index_js_.DocumentWidget {
    /**
     * Set URI fragment identifier for text files
     */
    async setFragment(fragment) {
        const parsedFragments = fragment.split('=');
        // TODO: expand to allow more schemes of Fragment Identification Syntax
        // reference: https://datatracker.ietf.org/doc/html/rfc5147#section-3
        if (parsedFragments[0] !== '#line') {
            return;
        }
        const positionOrRange = parsedFragments[1];
        let firstLine;
        if (positionOrRange.includes(',')) {
            // Only respect range start for now.
            firstLine = positionOrRange.split(',')[0] || '0';
        }
        else {
            firstLine = positionOrRange;
        }
        // Reveal the line
        return this.context.ready.then(() => {
            const position = {
                line: parseInt(firstLine, 10),
                column: 0
            };
            this.content.editor.setCursorPosition(position);
            this.content.editor.revealPosition(position);
        });
    }
}
/**
 * A widget factory for editors.
 */
class FileEditorFactory extends docregistry_lib_index_js_.ABCWidgetFactory {
    /**
     * Construct a new editor widget factory.
     */
    constructor(options) {
        super(options.factoryOptions);
        this._services = options.editorServices;
    }
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        const func = this._services.factoryService.newDocumentEditor;
        const factory = options => {
            // Use same id as document factory
            return func(options);
        };
        const content = new FileEditor({
            factory,
            context,
            mimeTypeService: this._services.mimeTypeService
        });
        content.title.icon = ui_components_lib_index_js_.textEditorIcon;
        const widget = new FileEditorWidget({ content, context });
        return widget;
    }
}
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/searchprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * File editor search provider
 */
class FileEditorSearchProvider extends codemirror_lib_index_js_.EditorSearchProvider {
    /**
     * Constructor
     * @param widget File editor panel
     */
    constructor(widget) {
        super();
        this.widget = widget;
        this._searchActive = false;
    }
    get isReadOnly() {
        return this.editor.getOption('readOnly');
    }
    /**
     * Support for options adjusting replacement behavior.
     */
    get replaceOptionsSupport() {
        return {
            preserveCase: true
        };
    }
    /**
     * Text editor
     */
    get editor() {
        return this.widget.content.editor;
    }
    /**
     * Editor content model
     */
    get model() {
        return this.widget.content.model;
    }
    async startQuery(query, filters) {
        this._searchActive = true;
        await super.startQuery(query, filters);
        await this.highlightNext(true, {
            from: 'selection-start',
            scroll: false,
            select: false
        });
    }
    /**
     * Stop the search and clean any UI elements.
     */
    async endQuery() {
        this._searchActive = false;
        await super.endQuery();
    }
    /**
     * Callback on source change
     *
     * @param emitter Source of the change
     * @param changes Source change
     */
    async onSharedModelChanged(emitter, changes) {
        if (this._searchActive) {
            return super.onSharedModelChanged(emitter, changes);
        }
    }
    /**
     * Instantiate a search provider for the widget.
     *
     * #### Notes
     * The widget provided is always checked using `isApplicable` before calling
     * this factory.
     *
     * @param widget The widget to search on
     * @param translator [optional] The translator object
     *
     * @returns The search provider on the widget
     */
    static createNew(widget, translator) {
        return new FileEditorSearchProvider(widget);
    }
    /**
     * Report whether or not this provider has the ability to search on the given object
     */
    static isApplicable(domain) {
        return (domain instanceof apputils_lib_index_js_.MainAreaWidget &&
            domain.content instanceof FileEditor &&
            domain.content.editor instanceof codemirror_lib_index_js_.CodeMirrorEditor);
    }
    /**
     * Get an initial query value if applicable so that it can be entered
     * into the search box as an initial query
     *
     * @returns Initial value used to populate the search box.
     */
    getInitialQuery() {
        const cm = this.editor;
        const selection = cm.state.sliceDoc(cm.state.selection.main.from, cm.state.selection.main.to);
        return selection;
    }
}
//# sourceMappingURL=searchprovider.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/syntaxstatus.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */






/**
 * A pure function that returns a tsx component for an editor syntax item.
 *
 * @param props the props for the component.
 *
 * @returns an editor syntax component.
 */
function EditorSyntaxComponent(props) {
    return (react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { role: "button", "aria-haspopup": true, tabIndex: 0, source: props.language, onClick: props.handleClick, onKeyDown: (event) => {
            if (event.key === 'Enter' || event.key === ' ') {
                props.handleClick();
            }
        } }));
}
/**
 * StatusBar item to change the language syntax highlighting of the file editor.
 */
class EditorSyntaxStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct a new VDomRenderer for the status item.
     */
    constructor(options) {
        var _a;
        super(new EditorSyntaxStatus.Model(options.languages));
        /**
         * Create a menu for selecting the language of the editor.
         */
        this._handleClick = () => {
            const languageMenu = new index_es6_js_.Menu({ commands: this._commands });
            const command = 'fileeditor:change-language';
            if (this._popup) {
                this._popup.dispose();
            }
            this.model.languages
                .getLanguages()
                .sort((a, b) => {
                var _a, _b;
                const aName = (_a = a.displayName) !== null && _a !== void 0 ? _a : a.name;
                const bName = (_b = b.displayName) !== null && _b !== void 0 ? _b : b.name;
                return aName.localeCompare(bName);
            })
                .forEach(spec => {
                var _a;
                if (spec.name.toLowerCase().indexOf('brainf') === 0) {
                    return;
                }
                const args = {
                    name: spec.name,
                    displayName: (_a = spec.displayName) !== null && _a !== void 0 ? _a : spec.name
                };
                languageMenu.addItem({
                    command,
                    args
                });
            });
            this._popup = (0,statusbar_lib_index_js_.showPopup)({
                body: languageMenu,
                anchor: this,
                align: 'left'
            });
        };
        this._popup = null;
        this._commands = options.commands;
        this.translator = (_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator;
        const trans = this.translator.load('jupyterlab');
        this.addClass('jp-mod-highlighted');
        this.title.caption = trans.__('Change text editor syntax highlighting');
    }
    /**
     * Render the status item.
     */
    render() {
        if (!this.model) {
            return null;
        }
        return (react_index_js_default().createElement(EditorSyntaxComponent, { language: this.model.language, handleClick: this._handleClick }));
    }
}
/**
 * A namespace for EditorSyntax statics.
 */
(function (EditorSyntaxStatus) {
    /**
     * A VDomModel for the current editor/mode combination.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        constructor(languages) {
            super();
            this.languages = languages;
            /**
             * If the editor mode changes, update the model.
             */
            this._onMIMETypeChange = (mode, change) => {
                var _a;
                const oldLanguage = this._language;
                const spec = this.languages.findByMIME(change.newValue);
                this._language = (_a = spec === null || spec === void 0 ? void 0 : spec.name) !== null && _a !== void 0 ? _a : index_js_.IEditorMimeTypeService.defaultMimeType;
                this._triggerChange(oldLanguage, this._language);
            };
            this._language = '';
            this._editor = null;
        }
        /**
         * The current editor language. If no editor is present,
         * returns the empty string.
         */
        get language() {
            return this._language;
        }
        /**
         * The current editor for the application editor tracker.
         */
        get editor() {
            return this._editor;
        }
        set editor(editor) {
            var _a;
            const oldEditor = this._editor;
            if (oldEditor !== null) {
                oldEditor.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);
            }
            const oldLanguage = this._language;
            this._editor = editor;
            if (this._editor === null) {
                this._language = '';
            }
            else {
                const spec = this.languages.findByMIME(this._editor.model.mimeType);
                this._language = (_a = spec === null || spec === void 0 ? void 0 : spec.name) !== null && _a !== void 0 ? _a : index_js_.IEditorMimeTypeService.defaultMimeType;
                this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange);
            }
            this._triggerChange(oldLanguage, this._language);
        }
        /**
         * Trigger a rerender of the model.
         */
        _triggerChange(oldState, newState) {
            if (oldState !== newState) {
                this.stateChanged.emit(void 0);
            }
        }
    }
    EditorSyntaxStatus.Model = Model;
})(EditorSyntaxStatus || (EditorSyntaxStatus = {}));
//# sourceMappingURL=syntaxstatus.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/tabspacestatus.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A pure functional component for rendering the TabSpace status.
 */
function TabSpaceComponent(props) {
    const translator = props.translator || translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const description = typeof props.tabSpace === 'number'
        ? trans.__('Spaces')
        : trans.__('Tab Indent');
    return (react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { role: "button", "aria-haspopup": true, tabIndex: 0, onClick: props.handleClick, onKeyDown: (event) => {
            if (event.key === 'Enter' || event.key === ' ') {
                props.handleClick();
            }
        }, source: typeof props.tabSpace === 'number'
            ? `${description}: ${props.tabSpace}`
            : description, title: trans.__('Change the indentation…') }));
}
/**
 * A VDomRenderer for a tabs vs. spaces status item.
 */
class TabSpaceStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Create a new tab/space status item.
     */
    constructor(options) {
        super(new TabSpaceStatus.Model());
        this._popup = null;
        this._menu = options.menu;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this.addClass('jp-mod-highlighted');
    }
    /**
     * Render the TabSpace status item.
     */
    render() {
        var _a;
        if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.indentUnit)) {
            return null;
        }
        else {
            const tabSpace = this.model.indentUnit === 'Tab'
                ? null
                : parseInt(this.model.indentUnit, 10);
            return (react_index_js_default().createElement(TabSpaceComponent, { tabSpace: tabSpace, handleClick: () => this._handleClick(), translator: this.translator }));
        }
    }
    /**
     * Handle a click on the status item.
     */
    _handleClick() {
        const menu = this._menu;
        if (this._popup) {
            this._popup.dispose();
        }
        menu.aboutToClose.connect(this._menuClosed, this);
        this._popup = (0,statusbar_lib_index_js_.showPopup)({
            body: menu,
            anchor: this,
            align: 'right'
        });
        // Update the menu items
        menu.update();
    }
    _menuClosed() {
        this.removeClass('jp-mod-clicked');
    }
}
/**
 * A namespace for TabSpace statics.
 */
(function (TabSpaceStatus) {
    /**
     * A VDomModel for the TabSpace status item.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        /**
         * Code editor indentation unit
         */
        get indentUnit() {
            return this._indentUnit;
        }
        set indentUnit(v) {
            if (v !== this._indentUnit) {
                this._indentUnit = v;
                this.stateChanged.emit();
            }
        }
    }
    TabSpaceStatus.Model = Model;
})(TabSpaceStatus || (TabSpaceStatus = {}));
//# sourceMappingURL=tabspacestatus.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/toc@^6.5.6 (strict) (fallback: ../node_modules/@jupyterlab/toc/lib/index.js)
var toc_lib_index_js_ = __webpack_require__(74853);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/toc/factory.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Base table of contents model factory for file editor
 */
class EditorTableOfContentsFactory extends toc_lib_index_js_.TableOfContentsFactory {
    /**
     * Create a new table of contents model for the widget
     *
     * @param widget - widget
     * @param configuration - Table of contents configuration
     * @returns The table of contents model
     */
    createNew(widget, configuration) {
        const model = super.createNew(widget, configuration);
        const onActiveHeadingChanged = (model, heading) => {
            if (heading) {
                widget.content.editor.setCursorPosition({
                    line: heading.line,
                    column: 0
                });
            }
        };
        model.activeHeadingChanged.connect(onActiveHeadingChanged);
        widget.disposed.connect(() => {
            model.activeHeadingChanged.disconnect(onActiveHeadingChanged);
        });
        return model;
    }
}
//# sourceMappingURL=factory.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/toc/latex.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * Maps LaTeX section headings to HTML header levels.
 *
 * ## Notes
 *
 * -   As `part` and `chapter` section headings appear to be less common, assign them to heading level 1.
 *
 * @private
 */
const LATEX_LEVELS = {
    part: 1, // Only available for report and book classes
    chapter: 1, // Only available for report and book classes
    section: 1,
    subsection: 2,
    subsubsection: 3,
    paragraph: 4,
    subparagraph: 5
};
/**
 * Regular expression to create the outline
 */
const SECTIONS = /^\s*\\(section|subsection|subsubsection){(.+)}/;
/**
 * Table of content model for LaTeX files.
 */
class LaTeXTableOfContentsModel extends toc_lib_index_js_.TableOfContentsModel {
    /**
     * Type of document supported by the model.
     *
     * #### Notes
     * A `data-document-type` attribute with this value will be set
     * on the tree view `.jp-TableOfContents-content[data-document-type="..."]`
     */
    get documentType() {
        return 'latex';
    }
    /**
     * List of configuration options supported by the model.
     */
    get supportedOptions() {
        return ['maximalDepth', 'numberHeaders'];
    }
    /**
     * Produce the headings for a document.
     *
     * @returns The list of new headings or `null` if nothing needs to be updated.
     */
    getHeadings() {
        if (!this.isActive) {
            return Promise.resolve(null);
        }
        // Split the text into lines:
        const lines = this.widget.content.model.sharedModel
            .getSource()
            .split('\n');
        const levels = new Array();
        let previousLevel = levels.length;
        const headings = new Array();
        for (let i = 0; i < lines.length; i++) {
            const match = lines[i].match(SECTIONS);
            if (match) {
                const level = LATEX_LEVELS[match[1]];
                if (level <= this.configuration.maximalDepth) {
                    const prefix = toc_lib_index_js_.TableOfContentsUtils.getPrefix(level, previousLevel, levels, {
                        ...this.configuration,
                        // Force base numbering and numbering first level
                        baseNumbering: 1,
                        numberingH1: true
                    });
                    previousLevel = level;
                    headings.push({
                        text: match[2],
                        prefix: prefix,
                        level,
                        line: i
                    });
                }
            }
        }
        return Promise.resolve(headings);
    }
}
/**
 * Table of content model factory for LaTeX files.
 */
class LaTeXTableOfContentsFactory extends EditorTableOfContentsFactory {
    /**
     * Whether the factory can handle the widget or not.
     *
     * @param widget - widget
     * @returns boolean indicating a ToC can be generated
     */
    isApplicable(widget) {
        var _a, _b;
        const isApplicable = super.isApplicable(widget);
        if (isApplicable) {
            let mime = (_b = (_a = widget.content) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.mimeType;
            return mime && (mime === 'text/x-latex' || mime === 'text/x-stex');
        }
        return false;
    }
    /**
     * Create a new table of contents model for the widget
     *
     * @param widget - widget
     * @param configuration - Table of contents configuration
     * @returns The table of contents model
     */
    _createNew(widget, configuration) {
        return new LaTeXTableOfContentsModel(widget, configuration);
    }
}
//# sourceMappingURL=latex.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/toc/markdown.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * Table of content model for Markdown files.
 */
class MarkdownTableOfContentsModel extends toc_lib_index_js_.TableOfContentsModel {
    constructor(widget, configuration, parser = null) {
        super(widget, configuration);
        this.widget = widget;
        this.parser = parser;
    }
    /**
     * Type of document supported by the model.
     *
     * #### Notes
     * A `data-document-type` attribute with this value will be set
     * on the tree view `.jp-TableOfContents-content[data-document-type="..."]`
     */
    get documentType() {
        return 'markdown';
    }
    /**
     * Produce the headings for a document.
     *
     * @returns The list of new headings or `null` if nothing needs to be updated.
     */
    async getHeadings() {
        if (!this.isActive) {
            return Promise.resolve(null);
        }
        const content = this.widget.content.model.sharedModel.getSource();
        const headings = toc_lib_index_js_.TableOfContentsUtils.filterHeadings(await toc_lib_index_js_.TableOfContentsUtils.Markdown.parseHeadings(content, this.parser), {
            ...this.configuration,
            // Force removing numbering as they cannot be displayed
            // in the document
            numberHeaders: false
        });
        return headings;
    }
}
/**
 * Table of content model factory for Markdown files.
 */
class MarkdownTableOfContentsFactory extends EditorTableOfContentsFactory {
    constructor(tracker, parser = null) {
        super(tracker);
        this.parser = parser;
    }
    /**
     * Whether the factory can handle the widget or not.
     *
     * @param widget - widget
     * @returns boolean indicating a ToC can be generated
     */
    isApplicable(widget) {
        var _a, _b;
        const isApplicable = super.isApplicable(widget);
        if (isApplicable) {
            let mime = (_b = (_a = widget.content) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.mimeType;
            return mime && toc_lib_index_js_.TableOfContentsUtils.Markdown.isMarkdown(mime);
        }
        return false;
    }
    /**
     * Create a new table of contents model for the widget
     *
     * @param widget - widget
     * @param configuration - Table of contents configuration
     * @returns The table of contents model
     */
    _createNew(widget, configuration) {
        return new MarkdownTableOfContentsModel(widget, configuration, this.parser);
    }
}
//# sourceMappingURL=markdown.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/toc/python.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * Regular expression to create the outline
 */
let KEYWORDS;
try {
    // https://github.com/tc39/proposal-regexp-match-indices was accepted
    // in May 2021 (https://github.com/tc39/proposals/blob/main/finished-proposals.md)
    // So we will fallback to the polyfill regexp-match-indices if not available
    KEYWORDS = new RegExp('^\\s*(class |def |async def |from |import )', 'd');
}
catch (_a) {
    KEYWORDS = new RegExp('^\\s*(class |def |async def |from |import )');
}
/**
 * Table of content model for Python files.
 */
class PythonTableOfContentsModel extends toc_lib_index_js_.TableOfContentsModel {
    /**
     * Type of document supported by the model.
     *
     * #### Notes
     * A `data-document-type` attribute with this value will be set
     * on the tree view `.jp-TableOfContents-content[data-document-type="..."]`
     */
    get documentType() {
        return 'python';
    }
    /**
     * Produce the headings for a document.
     *
     * @returns The list of new headings or `null` if nothing needs to be updated.
     */
    async getHeadings() {
        if (!this.isActive) {
            return Promise.resolve(null);
        }
        // Split the text into lines:
        const lines = this.widget.content.model.sharedModel
            .getSource()
            .split('\n');
        // Iterate over the lines to get the heading level and text for each line:
        let headings = new Array();
        let processingImports = false;
        let indent = 1;
        let lineIdx = -1;
        for (const line of lines) {
            lineIdx++;
            let hasKeyword;
            if (KEYWORDS.flags.includes('d')) {
                hasKeyword = KEYWORDS.exec(line);
            }
            else {
                const { default: execWithIndices } = await __webpack_require__.e(/* import() */ 2913).then(__webpack_require__.t.bind(__webpack_require__, 32913, 23));
                hasKeyword = execWithIndices(KEYWORDS, line);
            }
            if (hasKeyword) {
                // Index 0 contains the spaces, index 1 is the keyword group
                const [start] = hasKeyword.indices[1];
                if (indent === 1 && start > 0) {
                    indent = start;
                }
                const isImport = ['from ', 'import '].includes(hasKeyword[1]);
                if (isImport && processingImports) {
                    continue;
                }
                processingImports = isImport;
                const level = 1 + start / indent;
                if (level > this.configuration.maximalDepth) {
                    continue;
                }
                headings.push({
                    text: line.slice(start),
                    level,
                    line: lineIdx
                });
            }
        }
        return Promise.resolve(headings);
    }
}
/**
 * Table of content model factory for Python files.
 */
class PythonTableOfContentsFactory extends EditorTableOfContentsFactory {
    /**
     * Whether the factory can handle the widget or not.
     *
     * @param widget - widget
     * @returns boolean indicating a ToC can be generated
     */
    isApplicable(widget) {
        var _a, _b;
        const isApplicable = super.isApplicable(widget);
        if (isApplicable) {
            let mime = (_b = (_a = widget.content) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.mimeType;
            return (mime &&
                (mime === 'application/x-python-code' || mime === 'text/x-python'));
        }
        return false;
    }
    /**
     * Create a new table of contents model for the widget
     *
     * @param widget - widget
     * @param configuration - Table of contents configuration
     * @returns The table of contents model
     */
    _createNew(widget, configuration) {
        return new PythonTableOfContentsModel(widget, configuration);
    }
}
//# sourceMappingURL=python.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/toc/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The editor tracker token.
 */
const IEditorTracker = new dist_index_js_.Token('@jupyterlab/fileeditor:IEditorTracker', `A widget tracker for file editors.
  Use this if you want to be able to iterate over and interact with file editors
  created by the application.`);
/**
 * The editor widget factory token.
 */
const IEditorWidgetFactory = new dist_index_js_.Token('@jupyterlab/fileeditor:IEditorWidgetFactory', 'A factory for creating file editors.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module fileeditor
 */







//# sourceMappingURL=index.js.map

/***/ }),

/***/ 44696:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/documentsearch/style/index.js + 1 modules
var documentsearch_style = __webpack_require__(13737);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/lsp/style/index.js
var lsp_style = __webpack_require__(27844);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/toc/style/index.js + 1 modules
var toc_style = __webpack_require__(91302);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/fileeditor/style/base.css
var base = __webpack_require__(58765);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/fileeditor/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */














/***/ }),

/***/ 30360:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38911);
/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(78156);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module help-extension
 */







/**
 * The command IDs used by the help plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.open = 'help:open';
    CommandIDs.about = 'help:about';
    CommandIDs.activate = 'help:activate';
    CommandIDs.close = 'help:close';
    CommandIDs.show = 'help:show';
    CommandIDs.hide = 'help:hide';
    CommandIDs.jupyterForum = 'help:jupyter-forum';
    // Commands kept for backwards compatibility after the move to the apputils-extension
    CommandIDs.licenses = 'help:licenses';
    CommandIDs.licenseReport = 'help:license-report';
    CommandIDs.refreshLicenses = 'help:licenses-refresh';
})(CommandIDs || (CommandIDs = {}));
/**
 * A flag denoting whether the application is loaded over HTTPS.
 */
const LAB_IS_SECURE = window.location.protocol === 'https:';
/**
 * The class name added to the help widget.
 */
const HELP_CLASS = 'jp-Help';
/**
 * A plugin to keep licenses commands that were previously defined in the help-extension.
 * This is mostly for backwards compatibility, in case some other plugins were manually executing these commands.
 */
const licensesCommands = {
    id: '@jupyterlab/help-extension:licenses-commands',
    autoStart: true,
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],
    description: 'Add licenses commands for backwards compatibility.',
    activate: (app, translator) => {
        const { commands } = app;
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.nullTranslator).load('jupyterlab');
        const licensesText = trans.__('Licenses');
        const downloadAsText = trans.__('Download All Licenses');
        const refreshLicenses = trans.__('Refresh Licenses');
        const apputilsLicencesCommand = 'apputils:licenses';
        commands.addCommand(CommandIDs.licenses, {
            label: licensesText,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: args => {
                console.warn(`The command ${CommandIDs.licenses} is deprecated, use ${apputilsLicencesCommand} instead.`);
                return commands.execute(apputilsLicencesCommand, args);
            }
        });
        const apputilsLicenseReportCommand = 'apputils:license-report';
        commands.addCommand(CommandIDs.licenseReport, {
            label: downloadAsText,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: args => {
                console.warn(`The command ${CommandIDs.licenseReport} is deprecated, use ${apputilsLicenseReportCommand} instead.`);
                return commands.execute(apputilsLicenseReportCommand, args);
            }
        });
        const apputilsRefreshLicensesCommand = 'apputils:licenses-refresh';
        commands.addCommand(CommandIDs.refreshLicenses, {
            label: refreshLicenses,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: args => {
                console.warn(`The command ${CommandIDs.refreshLicenses} is deprecated, use ${apputilsRefreshLicensesCommand} instead.`);
                return commands.execute(apputilsRefreshLicensesCommand, args);
            }
        });
    }
};
/**
 * Add a command to show an About dialog.
 */
const about = {
    id: '@jupyterlab/help-extension:about',
    description: 'Adds a "About" dialog feature.',
    autoStart: true,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],
    activate: (app, translator, palette) => {
        const { commands } = app;
        const trans = translator.load('jupyterlab');
        const category = trans.__('Help');
        commands.addCommand(CommandIDs.about, {
            label: trans.__('About %1', app.name),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                // Create the header of the about dialog
                const versionNumber = trans.__('Version %1', app.version);
                const versionInfo = (react__WEBPACK_IMPORTED_MODULE_6__.createElement("span", { className: "jp-About-version-info" },
                    react__WEBPACK_IMPORTED_MODULE_6__.createElement("span", { className: "jp-About-version" }, versionNumber)));
                const title = (react__WEBPACK_IMPORTED_MODULE_6__.createElement("span", { className: "jp-About-header" },
                    react__WEBPACK_IMPORTED_MODULE_6__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__.jupyterIcon.react, { margin: "7px 9.5px", height: "auto", width: "58px" }),
                    react__WEBPACK_IMPORTED_MODULE_6__.createElement("div", { className: "jp-About-header-info" },
                        react__WEBPACK_IMPORTED_MODULE_6__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__.jupyterlabWordmarkIcon.react, { height: "auto", width: "196px" }),
                        versionInfo)));
                // Create the body of the about dialog
                const jupyterURL = 'https://jupyter.org/about.html';
                const contributorsURL = 'https://github.com/jupyterlab/jupyterlab/graphs/contributors';
                const externalLinks = (react__WEBPACK_IMPORTED_MODULE_6__.createElement("span", { className: "jp-About-externalLinks" },
                    react__WEBPACK_IMPORTED_MODULE_6__.createElement("a", { href: contributorsURL, target: "_blank", rel: "noopener noreferrer", className: "jp-Button-flat" }, trans.__('CONTRIBUTOR LIST')),
                    react__WEBPACK_IMPORTED_MODULE_6__.createElement("a", { href: jupyterURL, target: "_blank", rel: "noopener noreferrer", className: "jp-Button-flat" }, trans.__('ABOUT PROJECT JUPYTER'))));
                const copyright = (react__WEBPACK_IMPORTED_MODULE_6__.createElement("span", { className: "jp-About-copyright" }, trans.__('© %1-%2 Project Jupyter Contributors', 2015, 2025)));
                const body = (react__WEBPACK_IMPORTED_MODULE_6__.createElement("div", { className: "jp-About-body" },
                    externalLinks,
                    copyright));
                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
                    title,
                    body,
                    buttons: [
                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({
                            label: trans.__('Close')
                        })
                    ]
                });
            }
        });
        if (palette) {
            palette.addItem({ command: CommandIDs.about, category });
        }
    }
};
/**
 * A plugin to add a command to open the Jupyter Forum.
 */
const jupyterForum = {
    id: '@jupyterlab/help-extension:jupyter-forum',
    description: 'Adds command to open the Jupyter Forum website.',
    autoStart: true,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],
    activate: (app, translator, palette) => {
        const { commands } = app;
        const trans = translator.load('jupyterlab');
        const category = trans.__('Help');
        commands.addCommand(CommandIDs.jupyterForum, {
            label: trans.__('Jupyter Forum'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                window.open('https://discourse.jupyter.org/c/jupyterlab');
            }
        });
        if (palette) {
            palette.addItem({ command: CommandIDs.jupyterForum, category });
        }
    }
};
/**
 * A plugin to open resources in IFrames or new browser tabs.
 */
const open = {
    id: '@jupyterlab/help-extension:open',
    description: 'Add command to open websites as panel or browser tab.',
    autoStart: true,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
    activate: (app, translator, restorer) => {
        const { commands, shell } = app;
        const trans = translator.load('jupyterlab');
        const namespace = 'help-doc';
        const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({ namespace });
        let counter = 0;
        /**
         * Create a new HelpWidget widget.
         */
        function newHelpWidget(url, text) {
            // Allow scripts and forms so that things like
            // readthedocs can use their search functionality.
            // We *don't* allow same origin requests, which
            // can prevent some content from being loaded onto the
            // help pages.
            const content = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__.IFrame({
                sandbox: ['allow-scripts', 'allow-forms'],
                loading: 'lazy'
            });
            content.url = url;
            content.addClass(HELP_CLASS);
            content.title.label = text;
            content.id = `${namespace}-${++counter}`;
            const widget = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MainAreaWidget({ content });
            widget.addClass('jp-Help');
            return widget;
        }
        commands.addCommand(CommandIDs.open, {
            label: args => {
                var _a;
                return (_a = args['text']) !== null && _a !== void 0 ? _a : trans.__('Open the provided `url` in a tab.');
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        url: {
                            type: 'string',
                            description: 'The URL to open'
                        },
                        text: {
                            type: 'string',
                            description: 'The text label for the tab'
                        },
                        newBrowserTab: {
                            type: 'boolean',
                            description: 'Whether to open in a new browser tab'
                        }
                    },
                    required: ['url']
                }
            },
            execute: args => {
                const url = args['url'];
                const text = args['text'];
                const newBrowserTab = args['newBrowserTab'] || false;
                // If help resource will generate a mixed content error, load externally.
                if (newBrowserTab ||
                    (LAB_IS_SECURE && _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.parse(url).protocol !== 'https:')) {
                    window.open(url);
                    return;
                }
                const widget = newHelpWidget(url, text);
                void tracker.add(widget);
                shell.add(widget, 'main');
                return widget;
            }
        });
        // Handle state restoration.
        if (restorer) {
            void restorer.restore(tracker, {
                command: CommandIDs.open,
                args: widget => ({
                    url: widget.content.url,
                    text: widget.content.title.label
                }),
                name: widget => widget.content.url
            });
        }
    }
};
/**
 * A plugin to add a list of resources to the help menu.
 */
const resources = {
    id: '@jupyterlab/help-extension:resources',
    description: 'Adds menu entries to Jupyter reference documentation websites.',
    autoStart: true,
    requires: [_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_3__.IMainMenu, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],
    activate: (app, mainMenu, translator, labShell, palette) => {
        const trans = translator.load('jupyterlab');
        const category = trans.__('Help');
        const { commands, serviceManager } = app;
        const resources = [
            {
                text: trans.__('JupyterLab Reference'),
                url: 'https://jupyterlab.readthedocs.io/en/stable/'
            },
            {
                text: trans.__('JupyterLab FAQ'),
                url: 'https://jupyterlab.readthedocs.io/en/stable/getting_started/faq.html'
            },
            {
                text: trans.__('Jupyter Reference'),
                url: 'https://jupyter.org/documentation'
            },
            {
                text: trans.__('Markdown Reference'),
                url: 'https://commonmark.org/help/'
            }
        ];
        resources.sort((a, b) => {
            return a.text.localeCompare(b.text);
        });
        // Populate the Help menu.
        const helpMenu = mainMenu.helpMenu;
        const resourcesGroup = resources.map(args => ({
            args,
            command: CommandIDs.open
        }));
        helpMenu.addGroup(resourcesGroup, 10);
        // Generate a cache of the kernel help links.
        const kernelInfoCache = new Map();
        const onSessionRunningChanged = (m, sessions) => {
            var _a;
            // If a new session has been added, it is at the back
            // of the session list. If one has changed or stopped,
            // it does not hurt to check it.
            if (!sessions.length) {
                return;
            }
            const sessionModel = sessions[sessions.length - 1];
            if (!sessionModel.kernel ||
                kernelInfoCache.has(sessionModel.kernel.name)) {
                return;
            }
            const session = serviceManager.sessions.connectTo({
                model: sessionModel,
                kernelConnectionOptions: { handleComms: false }
            });
            void ((_a = session.kernel) === null || _a === void 0 ? void 0 : _a.info.then(kernelInfo => {
                var _a, _b;
                const name = session.kernel.name;
                // Check the cache second time so that, if two callbacks get scheduled,
                // they don't try to add the same commands.
                if (kernelInfoCache.has(name)) {
                    return;
                }
                const spec = (_b = (_a = serviceManager.kernelspecs) === null || _a === void 0 ? void 0 : _a.specs) === null || _b === void 0 ? void 0 : _b.kernelspecs[name];
                if (!spec) {
                    return;
                }
                // Set the Kernel Info cache.
                kernelInfoCache.set(name, kernelInfo);
                // Utility function to check if the current widget
                // has registered itself with the help menu.
                let usesKernel = false;
                const onCurrentChanged = async () => {
                    const kernel = await commands.execute('helpmenu:get-kernel');
                    usesKernel = (kernel === null || kernel === void 0 ? void 0 : kernel.name) === name;
                };
                // Set the status for the current widget
                onCurrentChanged().catch(error => {
                    console.error('Failed to get the kernel for the current widget.', error);
                });
                if (labShell) {
                    // Update status when current widget changes
                    labShell.currentChanged.connect(onCurrentChanged);
                }
                const isEnabled = () => usesKernel;
                // Add the kernel banner to the Help Menu.
                const bannerCommand = `help-menu-${name}:banner`;
                const kernelName = spec.display_name;
                const kernelIconUrl = spec.resources['logo-svg'] || spec.resources['logo-64x64'];
                commands.addCommand(bannerCommand, {
                    label: trans.__('About the %1 Kernel', kernelName),
                    isVisible: isEnabled,
                    isEnabled,
                    execute: () => {
                        // Create the header of the about dialog
                        const headerLogo = (react__WEBPACK_IMPORTED_MODULE_6__.createElement("img", { src: kernelIconUrl, alt: trans.__('Kernel Icon') }));
                        const title = (react__WEBPACK_IMPORTED_MODULE_6__.createElement("span", { className: "jp-About-header" },
                            headerLogo,
                            react__WEBPACK_IMPORTED_MODULE_6__.createElement("div", { className: "jp-About-header-info" }, kernelName)));
                        const banner = react__WEBPACK_IMPORTED_MODULE_6__.createElement("pre", null, kernelInfo.banner);
                        const body = react__WEBPACK_IMPORTED_MODULE_6__.createElement("div", { className: "jp-About-body" }, banner);
                        return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
                            title,
                            body,
                            buttons: [
                                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({
                                    label: trans.__('Close')
                                })
                            ]
                        });
                    }
                });
                helpMenu.addGroup([{ command: bannerCommand }], 20);
                // Add the kernel info help_links to the Help menu.
                const kernelGroup = [];
                (kernelInfo.help_links || []).forEach(link => {
                    const commandId = `help-menu-${name}:${link.text}`;
                    commands.addCommand(commandId, {
                        label: commands.label(CommandIDs.open, link),
                        isVisible: isEnabled,
                        isEnabled,
                        execute: () => {
                            return commands.execute(CommandIDs.open, link);
                        }
                    });
                    kernelGroup.push({ command: commandId });
                });
                helpMenu.addGroup(kernelGroup, 21);
            }).then(() => {
                // Dispose of the session object since we no longer need it.
                session.dispose();
            }));
        };
        // Create menu items for currently running sessions
        for (const model of serviceManager.sessions.running()) {
            onSessionRunningChanged(serviceManager.sessions, [model]);
        }
        serviceManager.sessions.runningChanged.connect(onSessionRunningChanged);
        if (palette) {
            resources.forEach(args => {
                palette.addItem({ args, command: CommandIDs.open, category });
            });
            palette.addItem({
                args: { reload: true },
                command: 'apputils:reset',
                category
            });
        }
    }
};
const plugins = [
    about,
    jupyterForum,
    licensesCommands,
    open,
    resources
];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 82164:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/mainmenu/style/index.js
var mainmenu_style = __webpack_require__(70022);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/help-extension/style/base.css
var base = __webpack_require__(9378);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/help-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/help-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








/***/ }),

/***/ 56962:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_htmlviewer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3125);
/* harmony import */ var _jupyterlab_htmlviewer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_htmlviewer__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module htmlviewer-extension
 */






const HTML_VIEWER_PLUGIN_ID = '@jupyterlab/htmlviewer-extension:plugin';
/**
 * Factory name
 */
const FACTORY = 'HTML Viewer';
/**
 * Command IDs used by the plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.trustHTML = 'htmlviewer:trust-html';
})(CommandIDs || (CommandIDs = {}));
/**
 * The HTML file handler extension.
 */
const htmlPlugin = {
    activate: activateHTMLViewer,
    id: HTML_VIEWER_PLUGIN_ID,
    description: 'Adds HTML file viewer and provides its tracker.',
    provides: _jupyterlab_htmlviewer__WEBPACK_IMPORTED_MODULE_2__.IHTMLViewerTracker,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator],
    optional: [
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette,
        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__.ISettingRegistry,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.IToolbarWidgetRegistry
    ],
    autoStart: true
};
/**
 * Activate the HTMLViewer extension.
 */
function activateHTMLViewer(app, translator, palette, restorer, settingRegistry, toolbarRegistry) {
    let toolbarFactory;
    const trans = translator.load('jupyterlab');
    if (toolbarRegistry) {
        toolbarRegistry.addFactory(FACTORY, 'refresh', widget => _jupyterlab_htmlviewer__WEBPACK_IMPORTED_MODULE_2__.ToolbarItems.createRefreshButton(widget, translator));
        toolbarRegistry.addFactory(FACTORY, 'trust', widget => _jupyterlab_htmlviewer__WEBPACK_IMPORTED_MODULE_2__.ToolbarItems.createTrustButton(widget, translator));
        if (settingRegistry) {
            toolbarFactory = (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.createToolbarFactory)(toolbarRegistry, settingRegistry, FACTORY, htmlPlugin.id, translator);
        }
    }
    // Add an HTML file type to the docregistry.
    const ft = {
        name: 'html',
        contentType: 'file',
        fileFormat: 'text',
        displayName: trans.__('HTML File'),
        extensions: ['.html'],
        mimeTypes: ['text/html'],
        icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_5__.html5Icon
    };
    app.docRegistry.addFileType(ft);
    // Create a new viewer factory.
    const factory = new _jupyterlab_htmlviewer__WEBPACK_IMPORTED_MODULE_2__.HTMLViewerFactory({
        name: FACTORY,
        label: trans.__('HTML Viewer'),
        fileTypes: ['html'],
        defaultFor: ['html'],
        readOnly: true,
        toolbarFactory,
        translator
    });
    // Create a widget tracker for HTML documents.
    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
        namespace: 'htmlviewer'
    });
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: 'docmanager:open',
            args: widget => ({ path: widget.context.path, factory: 'HTML Viewer' }),
            name: widget => widget.context.path
        });
    }
    let trustByDefault = false;
    if (settingRegistry) {
        const loadSettings = settingRegistry.load(HTML_VIEWER_PLUGIN_ID);
        const updateSettings = (settings) => {
            trustByDefault = settings.get('trustByDefault').composite;
        };
        Promise.all([loadSettings, app.restored])
            .then(([settings]) => {
            updateSettings(settings);
            settings.changed.connect(settings => {
                updateSettings(settings);
            });
        })
            .catch((reason) => {
            console.error(reason.message);
        });
    }
    app.docRegistry.addWidgetFactory(factory);
    factory.widgetCreated.connect((sender, widget) => {
        var _a, _b;
        // Track the widget.
        void tracker.add(widget);
        // Notify the widget tracker if restore data needs to update.
        widget.context.pathChanged.connect(() => {
            void tracker.save(widget);
        });
        // Notify the application when the trust state changes so it
        // can update any renderings of the trust command.
        widget.trustedChanged.connect(() => {
            app.commands.notifyCommandChanged(CommandIDs.trustHTML);
        });
        widget.trusted = trustByDefault;
        widget.title.icon = ft.icon;
        widget.title.iconClass = (_a = ft.iconClass) !== null && _a !== void 0 ? _a : '';
        widget.title.iconLabel = (_b = ft.iconLabel) !== null && _b !== void 0 ? _b : '';
    });
    // Add a command to trust the active HTML document,
    // allowing script executions in its context.
    app.commands.addCommand(CommandIDs.trustHTML, {
        label: trans.__('Trust HTML File'),
        caption: trans.__(`Whether the HTML file is trusted.
    Trusting the file allows scripts to run in it,
    which may result in security risks.
    Only enable for files you trust.`),
        isEnabled: () => !!tracker.currentWidget,
        isToggled: () => {
            const current = tracker.currentWidget;
            if (!current) {
                return false;
            }
            const sandbox = current.content.sandbox;
            return sandbox.indexOf('allow-scripts') !== -1;
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            const current = tracker.currentWidget;
            if (!current) {
                return;
            }
            current.trusted = !current.trusted;
        }
    });
    tracker.currentChanged.connect(() => {
        app.commands.notifyCommandChanged(CommandIDs.trustHTML);
    });
    if (palette) {
        palette.addItem({
            command: CommandIDs.trustHTML,
            category: trans.__('File Operations')
        });
    }
    return tracker;
}
/**
 * Export the plugins as default.
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (htmlPlugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 94938:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var widgets_style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/htmlviewer/style/base.css
var base = __webpack_require__(35440);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/htmlviewer/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/htmlviewer/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







;// CONCATENATED MODULE: ../node_modules/@jupyterlab/htmlviewer-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 35325:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  HTMLViewer: () => (/* reexport */ HTMLViewer),
  HTMLViewerFactory: () => (/* reexport */ HTMLViewerFactory),
  IHTMLViewerTracker: () => (/* reexport */ IHTMLViewerTracker),
  ToolbarItems: () => (/* reexport */ ToolbarItems)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/htmlviewer/lib/tokens.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/**
 * The HTML viewer tracker token.
 */
const IHTMLViewerTracker = new index_js_.Token('@jupyterlab/htmlviewer:IHTMLViewerTracker', `A widget tracker for rendered HTML documents.
  Use this if you want to be able to iterate over and interact with HTML documents
  viewed by the application.`);
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/htmlviewer/lib/widget.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/






/**
 * The timeout to wait for change activity to have ceased before rendering.
 */
const RENDER_TIMEOUT = 1000;
/**
 * The CSS class to add to the HTMLViewer Widget.
 */
const CSS_CLASS = 'jp-HTMLViewer';
const UNTRUSTED_LINK_STYLE = (options) => `<style>
a[target="_blank"],
area[target="_blank"],
form[target="_blank"],
button[formtarget="_blank"],
input[formtarget="_blank"][type="image"],
input[formtarget="_blank"][type="submit"] {
  cursor: not-allowed !important;
}
a[target="_blank"]:hover::after,
area[target="_blank"]:hover::after,
form[target="_blank"]:hover::after,
button[formtarget="_blank"]:hover::after,
input[formtarget="_blank"][type="image"]:hover::after,
input[formtarget="_blank"][type="submit"]:hover::after {
  content: "${options.warning}";
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  border: 2px solid #e65100;
  background-color: #ffb74d;
  color: black;
  font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', helvetica, arial, sans-serif;
  text-align: center;
}
</style>`;
/**
 * A viewer widget for HTML documents.
 *
 * #### Notes
 * The iframed HTML document can pose a potential security risk,
 * since it can execute Javascript, and make same-origin requests
 * to the server, thereby executing arbitrary Javascript.
 *
 * Here, we sandbox the iframe so that it can't execute Javascript
 * or launch any popups. We allow one exception: 'allow-same-origin'
 * requests, so that local HTML documents can access CSS, images,
 * etc from the files system.
 */
class HTMLViewer extends docregistry_lib_index_js_.DocumentWidget {
    /**
     * Create a new widget for rendering HTML.
     */
    constructor(options) {
        super({
            ...options,
            content: new ui_components_lib_index_js_.IFrame({
                sandbox: Private.common,
                loading: 'lazy'
            })
        });
        this._renderPending = false;
        this._parser = new DOMParser();
        this._monitor = null;
        this._objectUrl = '';
        this._trustedChanged = new index_es6_js_.Signal(this);
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this.content.addClass(CSS_CLASS);
        void this.context.ready.then(() => {
            this.update();
            // Throttle the rendering rate of the widget.
            this._monitor = new lib_index_js_.ActivityMonitor({
                signal: this.context.model.contentChanged,
                timeout: RENDER_TIMEOUT
            });
            this._monitor.activityStopped.connect(this.update, this);
        });
    }
    /**
     * Whether the HTML document is trusted. If trusted,
     * it can execute Javascript in the iframe sandbox.
     */
    get trusted() {
        return this.content.sandbox.indexOf('allow-scripts') !== -1;
    }
    set trusted(value) {
        if (this.trusted === value) {
            return;
        }
        if (value) {
            this.content.sandbox = [...Private.common, ...Private.trusted];
        }
        else {
            this.content.sandbox = [...Private.common, ...Private.untrusted];
        }
        this.update(); // Force a refresh.
        this._trustedChanged.emit(value);
    }
    /**
     * Emitted when the trust state of the document changes.
     */
    get trustedChanged() {
        return this._trustedChanged;
    }
    /**
     * Dispose of resources held by the html viewer.
     */
    dispose() {
        if (this._objectUrl) {
            try {
                URL.revokeObjectURL(this._objectUrl);
            }
            catch (error) {
                /* no-op */
            }
        }
        super.dispose();
    }
    /**
     * Handle and update request.
     */
    onUpdateRequest() {
        if (this._renderPending) {
            return;
        }
        this._renderPending = true;
        void this._renderModel().then(() => (this._renderPending = false));
    }
    /**
     * Render HTML in IFrame into this widget's node.
     */
    async _renderModel() {
        let data = this.context.model.toString();
        data = await this._setupDocument(data);
        // Set the new iframe url.
        const blob = new Blob([data], { type: 'text/html' });
        const oldUrl = this._objectUrl;
        this._objectUrl = URL.createObjectURL(blob);
        this.content.url = this._objectUrl;
        // Release reference to any previous object url.
        if (oldUrl) {
            try {
                URL.revokeObjectURL(oldUrl);
            }
            catch (error) {
                /* no-op */
            }
        }
        return;
    }
    /**
     * Set a <base> element in the HTML string so that the iframe
     * can correctly dereference relative links.
     */
    async _setupDocument(data) {
        const doc = this._parser.parseFromString(data, 'text/html');
        let base = doc.querySelector('base');
        if (!base) {
            base = doc.createElement('base');
            doc.head.insertBefore(base, doc.head.firstChild);
        }
        const path = this.context.path;
        const baseUrl = await this.context.urlResolver.getDownloadUrl(path);
        // Set the base href, plus a fake name for the url of this
        // document. The fake name doesn't really matter, as long
        // as the document can dereference relative links to resources
        // (e.g. CSS and scripts).
        base.href = baseUrl;
        base.target = '_self';
        // Inject dynamic style for links if the document is not trusted
        if (!this.trusted) {
            const trans = this.translator.load('jupyterlab');
            const warning = trans.__('Action disabled as the file is not trusted.');
            doc.body.insertAdjacentHTML('beforeend', UNTRUSTED_LINK_STYLE({ warning }));
        }
        return doc.documentElement.innerHTML;
    }
}
/**
 * A widget factory for HTMLViewers.
 */
class HTMLViewerFactory extends docregistry_lib_index_js_.ABCWidgetFactory {
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        return new HTMLViewer({ context });
    }
    /**
     * Default factory for toolbar items to be added after the widget is created.
     */
    defaultToolbarFactory(widget) {
        return [
            // Make a refresh button for the toolbar.
            {
                name: 'refresh',
                widget: ToolbarItems.createRefreshButton(widget, this.translator)
            },
            // Make a trust button for the toolbar.
            {
                name: 'trust',
                widget: ToolbarItems.createTrustButton(widget, this.translator)
            }
        ];
    }
}
/**
 * A namespace for toolbar items generator
 */
var ToolbarItems;
(function (ToolbarItems) {
    /**
     * Create the refresh button
     *
     * @param widget HTML viewer widget
     * @param translator Application translator object
     * @returns Toolbar item button
     */
    function createRefreshButton(widget, translator) {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.refreshIcon,
            onClick: async () => {
                if (!widget.context.model.dirty) {
                    await widget.context.revert();
                    widget.update();
                }
            },
            tooltip: trans.__('Rerender HTML Document')
        });
    }
    ToolbarItems.createRefreshButton = createRefreshButton;
    /**
     * Create the trust button
     *
     * @param document HTML viewer widget
     * @param translator Application translator object
     * @returns Toolbar item button
     */
    function createTrustButton(document, translator) {
        return ui_components_lib_index_js_.ReactWidget.create(react_index_js_.createElement(Private.TrustButtonComponent, { htmlDocument: document, translator: translator }));
    }
    ToolbarItems.createTrustButton = createTrustButton;
})(ToolbarItems || (ToolbarItems = {}));
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * Sandbox exceptions for all HTML.
     */
    Private.common = ['allow-same-origin'];
    /**
     * Sandbox exceptions for untrusted HTML.
     */
    Private.untrusted = [];
    /**
     * Sandbox exceptions for trusted HTML.
     */
    Private.trusted = [
        'allow-scripts',
        'allow-popups'
    ];
    /**
     * React component for a trusted button.
     *
     * This wraps the ToolbarButtonComponent and watches for trust changes.
     */
    function TrustButtonComponent(props) {
        const translator = props.translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        return (react_index_js_.createElement(ui_components_lib_index_js_.UseSignal, { signal: props.htmlDocument.trustedChanged, initialSender: props.htmlDocument }, () => (react_index_js_.createElement(ui_components_lib_index_js_.ToolbarButtonComponent, { className: "", onClick: () => (props.htmlDocument.trusted = !props.htmlDocument.trusted), tooltip: trans.__(`Whether the HTML file is trusted.
Trusting the file allows opening pop-ups and running scripts
which may result in security risks.
Only enable for files you trust.`), label: props.htmlDocument.trusted
                ? trans.__('Distrust HTML')
                : trans.__('Trust HTML') }))));
    }
    Private.TrustButtonComponent = TrustButtonComponent;
})(Private || (Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/htmlviewer/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module htmlviewer
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 56893:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CommandIDs: () => (/* binding */ CommandIDs),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module hub-extension
 */




/**
 * The command IDs used by the plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.controlPanel = 'hub:control-panel';
    CommandIDs.logout = 'hub:logout';
    CommandIDs.restart = 'hub:restart';
})(CommandIDs || (CommandIDs = {}));
/**
 * Activate the jupyterhub extension.
 */
function activateHubExtension(app, paths, translator, palette) {
    const trans = translator.load('jupyterlab');
    const hubHost = paths.urls.hubHost || '';
    const hubPrefix = paths.urls.hubPrefix || '';
    const hubUser = paths.urls.hubUser || '';
    const hubServerName = paths.urls.hubServerName || '';
    const baseUrl = paths.urls.base;
    // Bail if not running on JupyterHub.
    if (!hubPrefix) {
        return;
    }
    console.debug('hub-extension: Found configuration ', {
        hubHost: hubHost,
        hubPrefix: hubPrefix
    });
    // If hubServerName is set, use JupyterHub 1.0 URL.
    const spawnBase = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(hubPrefix, 'spawn');
    let restartUrl = hubHost + spawnBase;
    if (hubServerName) {
        const suffix = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(spawnBase, hubUser, hubServerName);
        if (!suffix.startsWith(spawnBase)) {
            throw new Error('Can only be used for spawn requests');
        }
        restartUrl = hubHost + suffix;
    }
    const { commands } = app;
    commands.addCommand(CommandIDs.restart, {
        label: trans.__('Restart Server'),
        caption: trans.__('Request that the Hub restart this server'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            window.open(restartUrl, '_blank');
        }
    });
    commands.addCommand(CommandIDs.controlPanel, {
        label: trans.__('Hub Control Panel'),
        caption: trans.__('Open the Hub control panel in a new browser tab'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            window.open(hubHost + _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(hubPrefix, 'home'), '_blank');
        }
    });
    commands.addCommand(CommandIDs.logout, {
        label: trans.__('Log Out'),
        caption: trans.__('Log out of the Hub'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            window.location.href = hubHost + _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.URLExt.join(baseUrl, 'logout');
        }
    });
    // Add palette items.
    if (palette) {
        const category = trans.__('Hub');
        palette.addItem({ category, command: CommandIDs.controlPanel });
        palette.addItem({ category, command: CommandIDs.logout });
    }
}
/**
 * Initialization data for the hub-extension.
 */
const hubExtension = {
    activate: activateHubExtension,
    id: '@jupyterlab/hub-extension:plugin',
    description: 'Registers commands related to the hub server',
    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],
    autoStart: true
};
/**
 * Plugin to load menu description based on settings file
 */
const hubExtensionMenu = {
    activate: () => void 0,
    id: '@jupyterlab/hub-extension:menu',
    description: 'Adds hub related commands to the menu.',
    autoStart: true
};
/**
 * The default JupyterLab connection lost provider. This may be overridden
 * to provide custom behavior when a connection to the server is lost.
 *
 * If the application is being deployed within a JupyterHub context,
 * this will provide a dialog that prompts the user to restart the server.
 * Otherwise, it shows an error dialog.
 */
const connectionlost = {
    id: '@jupyterlab/hub-extension:connectionlost',
    description: 'Provides a service to be notified when the connection to the hub server is lost.',
    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab.IInfo],
    activate: (app, paths, translator, info) => {
        const trans = translator.load('jupyterlab');
        const hubPrefix = paths.urls.hubPrefix || '';
        const baseUrl = paths.urls.base;
        // Return the default error message if not running on JupyterHub.
        if (!hubPrefix) {
            return _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ConnectionLost;
        }
        // If we are running on JupyterHub, return a dialog
        // that prompts the user to restart their server.
        let showingError = false;
        const onConnectionLost = async (manager, err) => {
            if (showingError) {
                return;
            }
            showingError = true;
            if (info) {
                info.isConnected = false;
            }
            const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
                title: trans.__('Server unavailable or unreachable'),
                body: trans.__('Your server at %1 is not running.\nWould you like to restart it?', baseUrl),
                buttons: [
                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton({ label: trans.__('Restart') }),
                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({ label: trans.__('Dismiss') })
                ]
            });
            if (info) {
                info.isConnected = true;
            }
            showingError = false;
            if (result.button.accept) {
                await app.commands.execute(CommandIDs.restart);
            }
        };
        return onConnectionLost;
    },
    autoStart: true,
    provides: _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.IConnectionLost
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([
    hubExtension,
    hubExtensionMenu,
    connectionlost
]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 53555:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67663);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */




/***/ }),

/***/ 56139:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93316);
/* harmony import */ var _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module imageviewer-extension
 */




/**
 * The command IDs used by the image widget plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.resetImage = 'imageviewer:reset-image';
    CommandIDs.zoomIn = 'imageviewer:zoom-in';
    CommandIDs.zoomOut = 'imageviewer:zoom-out';
    CommandIDs.flipHorizontal = 'imageviewer:flip-horizontal';
    CommandIDs.flipVertical = 'imageviewer:flip-vertical';
    CommandIDs.rotateClockwise = 'imageviewer:rotate-clockwise';
    CommandIDs.rotateCounterclockwise = 'imageviewer:rotate-counterclockwise';
    CommandIDs.invertColors = 'imageviewer:invert-colors';
})(CommandIDs || (CommandIDs = {}));
/**
 * The list of file types for images.
 */
const FILE_TYPES = ['png', 'gif', 'jpeg', 'bmp', 'ico', 'tiff'];
/**
 * The name of the factory that creates image widgets.
 */
const FACTORY = 'Image';
/**
 * The name of the factory that creates image widgets.
 */
const TEXT_FACTORY = 'Image (Text)';
/**
 * The list of file types for images with optional text modes.
 */
const TEXT_FILE_TYPES = ['svg', 'xbm'];
/**
 * The test pattern for text file types in paths.
 */
const TEXT_FILE_REGEX = new RegExp(`[.](${TEXT_FILE_TYPES.join('|')})$`);
/**
 * The image file handler extension.
 */
const plugin = {
    activate,
    description: 'Adds image viewer and provide its tracker.',
    id: '@jupyterlab/imageviewer-extension:plugin',
    provides: _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__.IImageTracker,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
    autoStart: true
};
/**
 * Export the plugin as default.
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
/**
 * Activate the image widget extension.
 */
function activate(app, translator, palette, restorer) {
    const trans = translator.load('jupyterlab');
    const namespace = 'image-widget';
    function onWidgetCreated(sender, widget) {
        var _a, _b;
        // Notify the widget tracker if restore data needs to update.
        widget.context.pathChanged.connect(() => {
            void tracker.save(widget);
        });
        void tracker.add(widget);
        const types = app.docRegistry.getFileTypesForPath(widget.context.path);
        if (types.length > 0) {
            widget.title.icon = types[0].icon;
            widget.title.iconClass = (_a = types[0].iconClass) !== null && _a !== void 0 ? _a : '';
            widget.title.iconLabel = (_b = types[0].iconLabel) !== null && _b !== void 0 ? _b : '';
        }
    }
    const factory = new _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__.ImageViewerFactory({
        name: FACTORY,
        label: trans.__('Image'),
        modelName: 'base64',
        fileTypes: [...FILE_TYPES, ...TEXT_FILE_TYPES],
        defaultFor: FILE_TYPES,
        readOnly: true
    });
    const textFactory = new _jupyterlab_imageviewer__WEBPACK_IMPORTED_MODULE_2__.ImageViewerFactory({
        name: TEXT_FACTORY,
        label: trans.__('Image (Text)'),
        modelName: 'text',
        fileTypes: TEXT_FILE_TYPES,
        defaultFor: TEXT_FILE_TYPES,
        readOnly: true
    });
    [factory, textFactory].forEach(factory => {
        app.docRegistry.addWidgetFactory(factory);
        factory.widgetCreated.connect(onWidgetCreated);
    });
    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
        namespace
    });
    if (restorer) {
        // Handle state restoration.
        void restorer.restore(tracker, {
            command: 'docmanager:open',
            args: widget => ({
                path: widget.context.path,
                factory: TEXT_FILE_REGEX.test(widget.context.path)
                    ? TEXT_FACTORY
                    : FACTORY
            }),
            name: widget => widget.context.path
        });
    }
    addCommands(app, tracker, translator);
    if (palette) {
        const category = trans.__('Image Viewer');
        [
            CommandIDs.zoomIn,
            CommandIDs.zoomOut,
            CommandIDs.resetImage,
            CommandIDs.rotateClockwise,
            CommandIDs.rotateCounterclockwise,
            CommandIDs.flipHorizontal,
            CommandIDs.flipVertical,
            CommandIDs.invertColors
        ].forEach(command => {
            palette.addItem({ command, category });
        });
    }
    return tracker;
}
/**
 * Add the commands for the image widget.
 */
function addCommands(app, tracker, translator) {
    var _a;
    const trans = translator.load('jupyterlab');
    const { commands, shell } = app;
    /**
     * Whether there is an active image viewer.
     */
    function isEnabled() {
        return (tracker.currentWidget !== null &&
            tracker.currentWidget === shell.currentWidget);
    }
    commands.addCommand(CommandIDs.zoomIn, {
        execute: zoomIn,
        label: trans.__('Zoom In'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.zoomOut, {
        execute: zoomOut,
        label: trans.__('Zoom Out'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.resetImage, {
        execute: resetImage,
        label: trans.__('Reset Image'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.rotateClockwise, {
        execute: rotateClockwise,
        label: trans.__('Rotate Clockwise'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.rotateCounterclockwise, {
        execute: rotateCounterclockwise,
        label: trans.__('Rotate Counterclockwise'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.flipHorizontal, {
        execute: flipHorizontal,
        label: trans.__('Flip image horizontally'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.flipVertical, {
        execute: flipVertical,
        label: trans.__('Flip image vertically'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.invertColors, {
        execute: invertColors,
        label: trans.__('Invert Colors'),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    const notify = () => {
        Object.values(CommandIDs).forEach(id => commands.notifyCommandChanged(id));
    };
    // All commands with isEnabled defined directly or in a semantic commands
    tracker.currentChanged.connect(notify);
    (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);
    function zoomIn() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.scale = widget.scale > 1 ? widget.scale + 0.5 : widget.scale * 2;
        }
    }
    function zoomOut() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.scale = widget.scale > 1 ? widget.scale - 0.5 : widget.scale / 2;
        }
    }
    function resetImage() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.scale = 1;
            widget.colorinversion = 0;
            widget.resetRotationFlip();
        }
    }
    function rotateClockwise() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.rotateClockwise();
        }
    }
    function rotateCounterclockwise() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.rotateCounterclockwise();
        }
    }
    function flipHorizontal() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.flipHorizontal();
        }
    }
    function flipVertical() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.flipVertical();
        }
    }
    function invertColors() {
        var _a;
        const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (widget) {
            widget.colorinversion += 1;
            widget.colorinversion %= 2;
        }
    }
}
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 86258:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var widgets_style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/imageviewer/style/base.css
var base = __webpack_require__(86134);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/imageviewer/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/imageviewer/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






;// CONCATENATED MODULE: ../node_modules/@jupyterlab/imageviewer-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 67900:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  IImageTracker: () => (/* reexport */ IImageTracker),
  ImageViewer: () => (/* reexport */ ImageViewer),
  ImageViewerFactory: () => (/* reexport */ ImageViewerFactory)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/imageviewer/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The image tracker token.
 */
const IImageTracker = new index_js_.Token('@jupyterlab/imageviewer:IImageTracker', `A widget tracker for images.
  Use this if you want to be able to iterate over and interact with images
  viewed by the application.`);
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/imageviewer/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * The class name added to a imageviewer.
 */
const IMAGE_CLASS = 'jp-ImageViewer';
/**
 * A widget for images.
 */
class ImageViewer extends index_es6_js_.Widget {
    /**
     * Construct a new image widget.
     */
    constructor(context) {
        super();
        this._scale = 1;
        this._matrix = [1, 0, 0, 1];
        this._colorinversion = 0;
        this._ready = new index_js_.PromiseDelegate();
        this.context = context;
        this.node.tabIndex = 0;
        this.addClass(IMAGE_CLASS);
        this._img = document.createElement('img');
        this.node.appendChild(this._img);
        this._onTitleChanged();
        context.pathChanged.connect(this._onTitleChanged, this);
        void context.ready.then(() => {
            if (this.isDisposed) {
                return;
            }
            const contents = context.contentsModel;
            this._mimeType = contents.mimetype;
            this._render();
            context.model.contentChanged.connect(this.update, this);
            context.fileChanged.connect(this.update, this);
            this._ready.resolve(void 0);
        });
    }
    /**
     * Print in iframe.
     */
    [apputils_lib_index_js_.Printing.symbol]() {
        return () => apputils_lib_index_js_.Printing.printWidget(this);
    }
    /**
     * A promise that resolves when the image viewer is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * The scale factor for the image.
     */
    get scale() {
        return this._scale;
    }
    set scale(value) {
        if (value === this._scale) {
            return;
        }
        this._scale = value;
        this._updateStyle();
    }
    /**
     * The color inversion of the image.
     */
    get colorinversion() {
        return this._colorinversion;
    }
    set colorinversion(value) {
        if (value === this._colorinversion) {
            return;
        }
        this._colorinversion = value;
        this._updateStyle();
    }
    /**
     * Dispose of resources held by the image viewer.
     */
    dispose() {
        if (this._img.src) {
            URL.revokeObjectURL(this._img.src || '');
        }
        super.dispose();
    }
    /**
     * Reset rotation and flip transformations.
     */
    resetRotationFlip() {
        this._matrix = [1, 0, 0, 1];
        this._updateStyle();
    }
    /**
     * Rotate the image counter-clockwise (left).
     */
    rotateCounterclockwise() {
        this._matrix = Private.prod(this._matrix, Private.rotateCounterclockwiseMatrix);
        this._updateStyle();
    }
    /**
     * Rotate the image clockwise (right).
     */
    rotateClockwise() {
        this._matrix = Private.prod(this._matrix, Private.rotateClockwiseMatrix);
        this._updateStyle();
    }
    /**
     * Flip the image horizontally.
     */
    flipHorizontal() {
        this._matrix = Private.prod(this._matrix, Private.flipHMatrix);
        this._updateStyle();
    }
    /**
     * Flip the image vertically.
     */
    flipVertical() {
        this._matrix = Private.prod(this._matrix, Private.flipVMatrix);
        this._updateStyle();
    }
    /**
     * Handle `update-request` messages for the widget.
     */
    onUpdateRequest(msg) {
        if (this.isDisposed || !this.context.isReady) {
            return;
        }
        this._render();
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        this.node.focus();
    }
    /**
     * Handle a change to the title.
     */
    _onTitleChanged() {
        this.title.label = lib_index_js_.PathExt.basename(this.context.localPath);
    }
    /**
     * Render the widget content.
     */
    _render() {
        const context = this.context;
        const cm = context.contentsModel;
        if (!cm) {
            return;
        }
        const oldurl = this._img.src || '';
        let content = context.model.toString();
        if (cm.format === 'base64') {
            this._img.src = `data:${this._mimeType};base64,${content}`;
        }
        else {
            const a = new Blob([content], { type: this._mimeType });
            this._img.src = URL.createObjectURL(a);
        }
        URL.revokeObjectURL(oldurl);
    }
    /**
     * Update the image CSS style, including the transform and filter.
     */
    _updateStyle() {
        const [a, b, c, d] = this._matrix;
        const [tX, tY] = Private.prodVec(this._matrix, [1, 1]);
        const transform = `matrix(${a}, ${b}, ${c}, ${d}, 0, 0) translate(${tX < 0 ? -100 : 0}%, ${tY < 0 ? -100 : 0}%) `;
        this._img.style.transform = `scale(${this._scale}) ${transform}`;
        this._img.style.filter = `invert(${this._colorinversion})`;
    }
}
/**
 * A widget factory for images.
 */
class ImageViewerFactory extends docregistry_lib_index_js_.ABCWidgetFactory {
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        const content = new ImageViewer(context);
        const widget = new docregistry_lib_index_js_.DocumentWidget({ content, context });
        return widget;
    }
}
/**
 * A namespace for image widget private data.
 */
var Private;
(function (Private) {
    /**
     * Multiply 2x2 matrices.
     */
    function prod([a11, a12, a21, a22], [b11, b12, b21, b22]) {
        return [
            a11 * b11 + a12 * b21,
            a11 * b12 + a12 * b22,
            a21 * b11 + a22 * b21,
            a21 * b12 + a22 * b22
        ];
    }
    Private.prod = prod;
    /**
     * Multiply a 2x2 matrix and a 2x1 vector.
     */
    function prodVec([a11, a12, a21, a22], [b1, b2]) {
        return [a11 * b1 + a12 * b2, a21 * b1 + a22 * b2];
    }
    Private.prodVec = prodVec;
    /**
     * Clockwise rotation transformation matrix.
     */
    Private.rotateClockwiseMatrix = [0, 1, -1, 0];
    /**
     * Counter-clockwise rotation transformation matrix.
     */
    Private.rotateCounterclockwiseMatrix = [0, -1, 1, 0];
    /**
     * Horizontal flip transformation matrix.
     */
    Private.flipHMatrix = [-1, 0, 0, 1];
    /**
     * Vertical flip transformation matrix.
     */
    Private.flipVMatrix = [1, 0, 0, -1];
})(Private || (Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/imageviewer/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module imageviewer
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 65733:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   APPLICATION_JAVASCRIPT_MIMETYPE: () => (/* binding */ APPLICATION_JAVASCRIPT_MIMETYPE),
/* harmony export */   ExperimentalRenderedJavascript: () => (/* binding */ ExperimentalRenderedJavascript),
/* harmony export */   TEXT_JAVASCRIPT_MIMETYPE: () => (/* binding */ TEXT_JAVASCRIPT_MIMETYPE),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   rendererFactory: () => (/* binding */ rendererFactory)
/* harmony export */ });
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61832);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module javascript-extension
 */

const TEXT_JAVASCRIPT_MIMETYPE = 'text/javascript';
const APPLICATION_JAVASCRIPT_MIMETYPE = 'application/javascript';
function evalInContext(code, element, document, window) {
    // eslint-disable-next-line
    return eval(code);
}
class ExperimentalRenderedJavascript extends _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__.RenderedJavaScript {
    render(model) {
        const trans = this.translator.load('jupyterlab');
        const renderJavascript = () => {
            try {
                const data = model.data[this.mimeType];
                if (data) {
                    evalInContext(data, this.node, document, window);
                }
                return Promise.resolve();
            }
            catch (error) {
                return Promise.reject(error);
            }
        };
        if (!model.trusted) {
            // If output is not trusted or if arbitrary Javascript execution is not enabled, render an informative error message
            const pre = document.createElement('pre');
            pre.textContent = trans.__('Are you sure that you want to run arbitrary Javascript within your JupyterLab session?');
            const button = document.createElement('button');
            button.textContent = trans.__('Run');
            this.node.appendChild(pre);
            this.node.appendChild(button);
            button.onclick = event => {
                this.node.textContent = '';
                void renderJavascript();
            };
            return Promise.resolve();
        }
        return renderJavascript();
    }
}
/**
 * A mime renderer factory for text/javascript data.
 */
const rendererFactory = {
    safe: false,
    mimeTypes: [TEXT_JAVASCRIPT_MIMETYPE, APPLICATION_JAVASCRIPT_MIMETYPE],
    createRenderer: options => new ExperimentalRenderedJavascript(options)
};
const extension = {
    id: '@jupyterlab/javascript-extension:factory',
    description: 'Adds renderer for JavaScript content.',
    rendererFactory,
    rank: 0,
    dataType: 'string'
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (extension);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 11575:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/javascript-extension/style/base.css
var base = __webpack_require__(95602);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/javascript-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/javascript-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 82138:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Component: () => (/* binding */ Component)
/* harmony export */ });
/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84088);
/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lezer_highlight__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92209);
/* harmony import */ var _lezer_highlight__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78156);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react_highlight_words__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5464);
/* harmony import */ var react_highlight_words__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_highlight_words__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react_json_tree__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(94478);
/* harmony import */ var style_mod__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4434);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.









/**
 * Get the CodeMirror style for a given tag.
 */
function getStyle(tag) {
    var _a;
    return (_a = _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_0__.jupyterHighlightStyle.style([tag])) !== null && _a !== void 0 ? _a : '';
}
/**
 * A component that renders JSON data as a collapsible tree.
 */
class Component extends react__WEBPACK_IMPORTED_MODULE_5__.Component {
    constructor() {
        super(...arguments);
        this.state = { filter: '', value: '' };
        this.timer = 0;
        this.handleChange = (event) => {
            const { value } = event.target;
            this.setState({ value });
            window.clearTimeout(this.timer);
            this.timer = window.setTimeout(() => {
                this.setState({ filter: value });
            }, 300);
        };
    }
    componentDidMount() {
        style_mod__WEBPACK_IMPORTED_MODULE_7__/* .StyleModule */ .V.mount(document, _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_0__.jupyterHighlightStyle.module);
    }
    render() {
        const translator = this.props.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator;
        const trans = translator.load('jupyterlab');
        const { data, metadata, forwardedRef } = this.props;
        const root = metadata && metadata.root ? metadata.root : 'root';
        const keyPaths = this.state.filter
            ? filterPaths(data, this.state.filter, [root])
            : [root];
        return (react__WEBPACK_IMPORTED_MODULE_5__.createElement("div", { className: "container", ref: forwardedRef },
            react__WEBPACK_IMPORTED_MODULE_5__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.InputGroup, { className: "filter", type: "text", placeholder: trans.__('Find…'), onChange: this.handleChange, value: this.state.value, rightIcon: "ui-components:search" }),
            react__WEBPACK_IMPORTED_MODULE_5__.createElement(react_json_tree__WEBPACK_IMPORTED_MODULE_8__/* .JSONTree */ .L, { data: data, collectionLimit: 100, theme: {
                    extend: theme,
                    valueLabel: getStyle(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__.tags.variableName),
                    valueText: getStyle(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__.tags.string),
                    nestedNodeItemString: getStyle(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__.tags.comment)
                }, invertTheme: false, keyPath: [root], getItemString: (type, data, itemType, itemString) => Array.isArray(data) ? (
                // Always display array type and the number of items i.e. "[] 2 items".
                react__WEBPACK_IMPORTED_MODULE_5__.createElement("span", null,
                    itemType,
                    " ",
                    itemString)) : Object.keys(data).length === 0 ? (
                // Only display object type when it's empty i.e. "{}".
                react__WEBPACK_IMPORTED_MODULE_5__.createElement("span", null, itemType)) : (null // Upstream typings don't accept null, but it should be ok
                ), labelRenderer: ([label, type]) => {
                    return (react__WEBPACK_IMPORTED_MODULE_5__.createElement("span", { className: getStyle(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__.tags.keyword) },
                        react__WEBPACK_IMPORTED_MODULE_5__.createElement((react_highlight_words__WEBPACK_IMPORTED_MODULE_6___default()), { searchWords: [this.state.filter], textToHighlight: `${label}`, highlightClassName: "jp-mod-selected" })));
                }, valueRenderer: raw => {
                    let className = getStyle(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__.tags.string);
                    if (typeof raw === 'number') {
                        className = getStyle(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__.tags.number);
                    }
                    if (raw === 'true' || raw === 'false') {
                        className = getStyle(_lezer_highlight__WEBPACK_IMPORTED_MODULE_3__.tags.keyword);
                    }
                    return (react__WEBPACK_IMPORTED_MODULE_5__.createElement("span", { className: className },
                        react__WEBPACK_IMPORTED_MODULE_5__.createElement((react_highlight_words__WEBPACK_IMPORTED_MODULE_6___default()), { searchWords: [this.state.filter], textToHighlight: `${raw}`, highlightClassName: "jp-mod-selected" })));
                }, shouldExpandNodeInitially: (keyPath, data, level) => metadata && metadata.expanded
                    ? true
                    : keyPaths.join(',').includes(keyPath.join(',')) })));
    }
}
// Provide an invalid theme object (this is on purpose!) to invalidate the
// react-json-tree's inline styles that override CodeMirror CSS classes
const theme = {
    scheme: 'jupyter',
    base00: 'invalid',
    base01: 'invalid',
    base02: 'invalid',
    base03: 'invalid',
    base04: 'invalid',
    base05: 'invalid',
    base06: 'invalid',
    base07: 'invalid',
    base08: 'invalid',
    base09: 'invalid',
    base0A: 'invalid',
    base0B: 'invalid',
    base0C: 'invalid',
    base0D: 'invalid',
    base0E: 'invalid',
    base0F: 'invalid',
    author: 'invalid'
};
function objectIncludes(data, query) {
    return JSON.stringify(data).includes(query);
}
function filterPaths(data, query, parent = ['root']) {
    if (_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.isArray(data)) {
        return data.reduce((result, item, index) => {
            if (item && typeof item === 'object' && objectIncludes(item, query)) {
                return [
                    ...result,
                    [index, ...parent].join(','),
                    ...filterPaths(item, query, [index, ...parent])
                ];
            }
            return result;
        }, []);
    }
    if (_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.isObject(data)) {
        return Object.keys(data).reduce((result, key) => {
            const item = data[key];
            if (item &&
                typeof item === 'object' &&
                (key.includes(query) || objectIncludes(item, query))) {
                return [
                    ...result,
                    [key, ...parent].join(','),
                    ...filterPaths(item, query, [key, ...parent])
                ];
            }
            return result;
        }, []);
    }
    return [];
}
//# sourceMappingURL=component.js.map

/***/ }),

/***/ 60690:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MIME_TYPE: () => (/* binding */ MIME_TYPE),
/* harmony export */   MIME_TYPES_JSONL: () => (/* binding */ MIME_TYPES_JSONL),
/* harmony export */   RenderedJSON: () => (/* binding */ RenderedJSON),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   rendererFactory: () => (/* binding */ rendererFactory)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78156);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37634);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module json-extension
 */





/**
 * The CSS class to add to the JSON Widget.
 */
const CSS_CLASS = 'jp-RenderedJSON';
/**
 * The MIME type for JSON.
 */
const MIME_TYPE = 'application/json';
// NOTE: not standardized yet
const MIME_TYPES_JSONL = [
    'text/jsonl',
    'application/jsonl',
    'application/json-lines'
];
/**
 * A renderer for JSON data.
 */
class RenderedJSON extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.Widget {
    /**
     * Create a new widget for rendering JSON.
     */
    constructor(options) {
        super();
        this._rootDOM = null;
        this.addClass(CSS_CLASS);
        this.addClass('CodeMirror');
        this._mimeType = options.mimeType;
        this.translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator;
    }
    [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Printing.symbol]() {
        return () => _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Printing.printWidget(this);
    }
    /**
     * Render JSON into this widget's node.
     */
    async renderModel(model) {
        const { Component } = await Promise.all(/* import() */[__webpack_require__.e(4144), __webpack_require__.e(9619), __webpack_require__.e(2215), __webpack_require__.e(2331), __webpack_require__.e(4088), __webpack_require__.e(2209), __webpack_require__.e(4984)]).then(__webpack_require__.bind(__webpack_require__, 82138));
        let data;
        // handle if json-lines format
        if (MIME_TYPES_JSONL.indexOf(this._mimeType) >= 0) {
            // convert into proper json
            const lines = (model.data[this._mimeType] || '')
                .trim()
                .split(/\n/);
            data = JSON.parse(`[${lines.join(',')}]`);
        }
        else {
            data = (model.data[this._mimeType] || {});
        }
        const metadata = (model.metadata[this._mimeType] || {});
        if (this._rootDOM === null) {
            this._rootDOM = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_4__/* .createRoot */ .s)(this.node);
        }
        return new Promise((resolve, reject) => {
            this._rootDOM.render(react__WEBPACK_IMPORTED_MODULE_3__.createElement(Component, { data: data, metadata: metadata, translator: this.translator, forwardedRef: () => resolve() }));
        });
    }
    /**
     * Called before the widget is detached from the DOM.
     */
    onBeforeDetach(msg) {
        // Unmount the component so it can tear down.
        if (this._rootDOM) {
            this._rootDOM.unmount();
            this._rootDOM = null;
        }
    }
}
/**
 * A mime renderer factory for JSON data.
 */
const rendererFactory = {
    safe: true,
    mimeTypes: [MIME_TYPE, ...MIME_TYPES_JSONL],
    createRenderer: options => new RenderedJSON(options)
};
const extensions = [
    {
        id: '@jupyterlab/json-extension:factory',
        description: 'Adds renderer for JSON content.',
        rendererFactory,
        rank: 0,
        dataType: 'json',
        documentWidgetFactoryOptions: {
            name: 'JSON',
            // TODO: how to translate label of the factory?
            primaryFileType: 'json',
            fileTypes: ['json', 'notebook', 'geojson'],
            defaultFor: ['json']
        }
    },
    {
        id: '@jupyterlab/json-lines-extension:factory',
        description: 'Adds renderer for JSONLines content.',
        rendererFactory,
        rank: 0,
        dataType: 'string',
        documentWidgetFactoryOptions: {
            name: 'JSONLines',
            primaryFileType: 'jsonl',
            fileTypes: ['jsonl', 'ndjson'],
            defaultFor: ['jsonl', 'ndjson']
        }
    }
];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (extensions);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 10887:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/json-extension/style/base.css
var base = __webpack_require__(20946);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/json-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/json-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








/***/ }),

/***/ 68771:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ILauncher: () => (/* reexport */ ILauncher),
  Launcher: () => (/* reexport */ Launcher),
  LauncherModel: () => (/* reexport */ LauncherModel)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/launcher/lib/tokens.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/**
 * The launcher token.
 */
const ILauncher = new index_js_.Token('@jupyterlab/launcher:ILauncher', `A service for the application activity launcher.
  Use this to add your extension activities to the launcher panel.`);
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/properties@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/properties/dist/index.es6.js)
var properties_dist_index_es6_js_ = __webpack_require__(10249);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/launcher/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The class name added to Launcher instances.
 */
const LAUNCHER_CLASS = 'jp-Launcher';
/**
 * LauncherModel keeps track of the path to working directory and has a list of
 * LauncherItems, which the Launcher will render.
 */
class LauncherModel extends ui_components_lib_index_js_.VDomModel {
    constructor() {
        super(...arguments);
        this.itemsList = [];
    }
    /**
     * Add a command item to the launcher, and trigger re-render event for parent
     * widget.
     *
     * @param options - The specification options for a launcher item.
     *
     * @returns A disposable that will remove the item from Launcher, and trigger
     * re-render event for parent widget.
     *
     */
    add(options) {
        // Create a copy of the options to circumvent mutations to the original.
        const item = Private.createItem(options);
        this.itemsList.push(item);
        this.stateChanged.emit(void 0);
        return new dist_index_es6_js_.DisposableDelegate(() => {
            index_es6_js_.ArrayExt.removeFirstOf(this.itemsList, item);
            this.stateChanged.emit(void 0);
        });
    }
    /**
     * Return an iterator of launcher items.
     */
    items() {
        return this.itemsList[Symbol.iterator]();
    }
}
/**
 * A virtual-DOM-based widget for the Launcher.
 */
class Launcher extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct a new launcher widget.
     */
    constructor(options) {
        super(options.model);
        this._pending = false;
        this._cwd = '';
        this._cwd = options.cwd;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._callback = options.callback;
        this._commands = options.commands;
        this.addClass(LAUNCHER_CLASS);
    }
    /**
     * The cwd of the launcher.
     */
    get cwd() {
        return this._cwd;
    }
    set cwd(value) {
        this._cwd = value;
        this.update();
    }
    /**
     * Whether there is a pending item being launched.
     */
    get pending() {
        return this._pending;
    }
    set pending(value) {
        this._pending = value;
    }
    /**
     * Render the launcher to virtual DOM nodes.
     */
    render() {
        // Bail if there is no model.
        if (!this.model) {
            return null;
        }
        const knownCategories = [
            this._trans.__('Notebook'),
            this._trans.__('Console'),
            this._trans.__('Other')
        ];
        const kernelCategories = [
            this._trans.__('Notebook'),
            this._trans.__('Console')
        ];
        // First group-by categories
        const categories = Object.create(null);
        for (const item of this.model.items()) {
            const cat = item.category || this._trans.__('Other');
            if (!(cat in categories)) {
                categories[cat] = [];
            }
            categories[cat].push(item);
        }
        // Within each category sort by rank
        for (const cat in categories) {
            categories[cat] = categories[cat].sort((a, b) => {
                return Private.sortCmp(a, b, this._cwd, this._commands);
            });
        }
        // Variable to help create sections
        const sections = [];
        let section;
        // Assemble the final ordered list of categories, beginning with
        // KNOWN_CATEGORIES.
        const orderedCategories = [];
        for (const cat of knownCategories) {
            orderedCategories.push(cat);
        }
        for (const cat in categories) {
            if (knownCategories.indexOf(cat) === -1) {
                orderedCategories.push(cat);
            }
        }
        // Now create the sections for each category
        orderedCategories.forEach(cat => {
            if (!categories[cat]) {
                return;
            }
            const item = categories[cat][0];
            const args = { ...item.args, cwd: this.cwd };
            const kernel = kernelCategories.indexOf(cat) > -1;
            const iconClass = this._commands.iconClass(item.command, args);
            const icon = this._commands.icon(item.command, args);
            if (cat in categories) {
                section = (react_index_js_.createElement("div", { className: "jp-Launcher-section", key: cat },
                    react_index_js_.createElement("div", { className: "jp-Launcher-sectionHeader" },
                        react_index_js_.createElement(ui_components_lib_index_js_.LabIcon.resolveReact, { icon: icon, iconClass: (0,ui_components_lib_index_js_.classes)(iconClass, 'jp-Icon-cover'), stylesheet: "launcherSection", "aria-hidden": "true" }),
                        react_index_js_.createElement("h2", { className: "jp-Launcher-sectionTitle" }, cat)),
                    react_index_js_.createElement("div", { className: "jp-Launcher-cardContainer" }, Array.from((0,index_es6_js_.map)(categories[cat], (item) => {
                        return Card(kernel, item, this, this._commands, this._trans, this._callback);
                    })))));
                sections.push(section);
            }
        });
        // Wrap the sections in body and content divs.
        return (react_index_js_.createElement("div", { className: "jp-Launcher-body" },
            react_index_js_.createElement("div", { className: "jp-Launcher-content" },
                react_index_js_.createElement("div", { className: "jp-Launcher-cwd" },
                    react_index_js_.createElement("h3", null, this.cwd)),
                sections)));
    }
}
/**
 * A pure tsx component for a launcher card.
 *
 * @param kernel - whether the item takes uses a kernel.
 *
 * @param item - the launcher item to render.
 *
 * @param launcher - the Launcher instance to which this is added.
 *
 * @param commands - the command registry holding the command of item.
 *
 * @param trans - the translation bundle.
 *
 * @returns a vdom `VirtualElement` for the launcher card.
 */
function Card(kernel, item, launcher, commands, trans, launcherCallback) {
    // Get some properties of the command
    const command = item.command;
    const args = { ...item.args, cwd: launcher.cwd };
    const caption = commands.caption(command, args);
    const label = commands.label(command, args);
    const title = kernel ? label : caption || label;
    // Build the onclick handler.
    const onclick = () => {
        // If an item has already been launched,
        // don't try to launch another.
        if (launcher.pending === true) {
            return;
        }
        launcher.pending = true;
        void commands
            .execute(command, {
            ...item.args,
            cwd: launcher.cwd
        })
            .then(value => {
            launcher.pending = false;
            if (value instanceof widgets_dist_index_es6_js_.Widget) {
                launcherCallback(value);
            }
        })
            .catch(err => {
            console.error(err);
            launcher.pending = false;
            void (0,lib_index_js_.showErrorMessage)(trans._p('Error', 'Launcher Error'), err);
        });
    };
    // With tabindex working, you can now pick a kernel by tabbing around and
    // pressing Enter.
    const onkeypress = (event) => {
        if (event.key === 'Enter') {
            onclick();
        }
    };
    const iconClass = commands.iconClass(command, args);
    const icon = commands.icon(command, args);
    // Return the VDOM element.
    return (react_index_js_.createElement("div", { className: "jp-LauncherCard", title: title, role: "button", onClick: onclick, onKeyDown: onkeypress, tabIndex: 0, "data-category": item.category || trans.__('Other'), key: Private.keyProperty.get(item) },
        react_index_js_.createElement("div", { className: "jp-LauncherCard-icon" }, kernel ? (item.kernelIconUrl ? (react_index_js_.createElement("img", { src: item.kernelIconUrl, className: "jp-Launcher-kernelIcon", alt: title })) : (react_index_js_.createElement("div", { className: "jp-LauncherCard-noKernelIcon" }, label[0].toUpperCase()))) : (react_index_js_.createElement(ui_components_lib_index_js_.LabIcon.resolveReact, { icon: icon, iconClass: (0,ui_components_lib_index_js_.classes)(iconClass, 'jp-Icon-cover'), stylesheet: "launcherCard" }))),
        react_index_js_.createElement("div", { className: "jp-LauncherCard-label", title: title },
            react_index_js_.createElement("p", null, label))));
}
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * An incrementing counter for keys.
     */
    let id = 0;
    /**
     * An attached property for an item's key.
     */
    Private.keyProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'key',
        create: () => id++
    });
    /**
     * Create a fully specified item given item options.
     */
    function createItem(options) {
        return {
            ...options,
            category: options.category || '',
            rank: options.rank !== undefined ? options.rank : Infinity
        };
    }
    Private.createItem = createItem;
    /**
     * A sort comparison function for a launcher item.
     */
    function sortCmp(a, b, cwd, commands) {
        // First, compare by rank.
        const r1 = a.rank;
        const r2 = b.rank;
        if (r1 !== r2 && r1 !== undefined && r2 !== undefined) {
            return r1 < r2 ? -1 : 1; // Infinity safe
        }
        // Finally, compare by display name.
        const aLabel = commands.label(a.command, { ...a.args, cwd });
        const bLabel = commands.label(b.command, { ...b.args, cwd });
        return aLabel.localeCompare(bLabel);
    }
    Private.sortCmp = sortCmp;
})(Private || (Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/launcher/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module launcher
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 22640:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/launcher/style/base.css
var base = __webpack_require__(97750);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/launcher/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/launcher/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 64171:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  LogLevelSwitcher: () => (/* binding */ LogLevelSwitcher),
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/logconsole@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/logconsole/lib/index.js)
var logconsole_lib_index_js_ = __webpack_require__(72006);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole-extension/lib/status.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * A pure functional component for a Log Console status item.
 *
 * @param props - the props for the component.
 *
 * @returns a tsx component for rendering the Log Console status.
 */
function LogConsoleStatusComponent(props) {
    const translator = props.translator || translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    let title = '';
    if (props.newMessages > 0) {
        title = trans.__('%1 new messages, %2 log entries for %3', props.newMessages, props.logEntries, props.source);
    }
    else {
        title += trans.__('%1 log entries for %2', props.logEntries, props.source);
    }
    return (react_index_js_default().createElement(statusbar_lib_index_js_.GroupItem, { role: "button", tabIndex: 0, spacing: 0, onClick: props.handleClick, onKeyDown: (event) => {
            if (event.key === 'Enter' || event.key === ' ') {
                props.handleClick();
            }
        }, title: title },
        react_index_js_default().createElement(ui_components_lib_index_js_.listIcon.react, { top: '2px', stylesheet: 'statusBar' }),
        props.newMessages > 0 ? react_index_js_default().createElement(statusbar_lib_index_js_.TextItem, { source: props.newMessages }) : react_index_js_default().createElement((react_index_js_default()).Fragment, null)));
}
/**
 * A VDomRenderer widget for displaying the status of Log Console logs.
 */
class LogConsoleStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct the log console status widget.
     *
     * @param options - The status widget initialization options.
     */
    constructor(options) {
        super(new LogConsoleStatus.Model(options.loggerRegistry));
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._handleClick = options.handleClick;
        this.addClass('jp-mod-highlighted');
        this.addClass('jp-LogConsoleStatusItem');
    }
    /**
     * Render the log console status item.
     */
    render() {
        if (this.model === null || this.model.version === 0) {
            return null;
        }
        const { flashEnabled, messages, source, version, versionDisplayed, versionNotified } = this.model;
        if (source !== null && flashEnabled && version > versionNotified) {
            this._flashHighlight();
            this.model.sourceNotified(source, version);
        }
        else if (source !== null && flashEnabled && version > versionDisplayed) {
            this._showHighlighted();
        }
        else {
            this._clearHighlight();
        }
        return (react_index_js_default().createElement(LogConsoleStatusComponent, { handleClick: this._handleClick, logEntries: messages, newMessages: version - versionDisplayed, source: this.model.source, translator: this.translator }));
    }
    _flashHighlight() {
        this._showHighlighted();
        // To make sure the browser triggers the animation, we remove the class,
        // wait for an animation frame, then add it back
        this.removeClass('jp-LogConsole-flash');
        requestAnimationFrame(() => {
            this.addClass('jp-LogConsole-flash');
        });
    }
    _showHighlighted() {
        this.addClass('jp-mod-selected');
    }
    _clearHighlight() {
        this.removeClass('jp-LogConsole-flash');
        this.removeClass('jp-mod-selected');
    }
}
/**
 * A namespace for Log Console log status.
 */
(function (LogConsoleStatus) {
    /**
     * A VDomModel for the LogConsoleStatus item.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        /**
         * Create a new LogConsoleStatus model.
         *
         * @param loggerRegistry - The logger registry providing the logs.
         */
        constructor(loggerRegistry) {
            super();
            /**
             * A signal emitted when the flash enablement changes.
             */
            this.flashEnabledChanged = new index_es6_js_.Signal(this);
            this._flashEnabled = true;
            this._source = null;
            /**
             * The view status of each source.
             *
             * #### Notes
             * Keys are source names, value is a list of two numbers. The first
             * represents the version of the messages that was last displayed to the
             * user, the second represents the version that we last notified the user
             * about.
             */
            this._sourceVersion = new Map();
            this._loggerRegistry = loggerRegistry;
            this._loggerRegistry.registryChanged.connect(this._handleLogRegistryChange, this);
            this._handleLogRegistryChange();
        }
        /**
         * Number of messages currently in the current source.
         */
        get messages() {
            if (this._source === null) {
                return 0;
            }
            const logger = this._loggerRegistry.getLogger(this._source);
            return logger.length;
        }
        /**
         * The number of messages ever stored by the current source.
         */
        get version() {
            if (this._source === null) {
                return 0;
            }
            const logger = this._loggerRegistry.getLogger(this._source);
            return logger.version;
        }
        /**
         * The name of the active log source
         */
        get source() {
            return this._source;
        }
        set source(name) {
            if (this._source === name) {
                return;
            }
            this._source = name;
            // refresh rendering
            this.stateChanged.emit();
        }
        /**
         * The last source version that was displayed.
         */
        get versionDisplayed() {
            var _a, _b;
            if (this._source === null) {
                return 0;
            }
            return (_b = (_a = this._sourceVersion.get(this._source)) === null || _a === void 0 ? void 0 : _a.lastDisplayed) !== null && _b !== void 0 ? _b : 0;
        }
        /**
         * The last source version we notified the user about.
         */
        get versionNotified() {
            var _a, _b;
            if (this._source === null) {
                return 0;
            }
            return (_b = (_a = this._sourceVersion.get(this._source)) === null || _a === void 0 ? void 0 : _a.lastNotified) !== null && _b !== void 0 ? _b : 0;
        }
        /**
         * Flag to toggle flashing when new logs added.
         */
        get flashEnabled() {
            return this._flashEnabled;
        }
        set flashEnabled(enabled) {
            if (this._flashEnabled === enabled) {
                return;
            }
            this._flashEnabled = enabled;
            this.flashEnabledChanged.emit();
            // refresh rendering
            this.stateChanged.emit();
        }
        /**
         * Record the last source version displayed to the user.
         *
         * @param source - The name of the log source.
         * @param version - The version of the log that was displayed.
         *
         * #### Notes
         * This will also update the last notified version so that the last
         * notified version is always at least the last displayed version.
         */
        sourceDisplayed(source, version) {
            if (source === null || version === null) {
                return;
            }
            const versions = this._sourceVersion.get(source);
            let change = false;
            if (versions.lastDisplayed < version) {
                versions.lastDisplayed = version;
                change = true;
            }
            if (versions.lastNotified < version) {
                versions.lastNotified = version;
                change = true;
            }
            if (change && source === this._source) {
                this.stateChanged.emit();
            }
        }
        /**
         * Record a source version we notified the user about.
         *
         * @param source - The name of the log source.
         * @param version - The version of the log.
         */
        sourceNotified(source, version) {
            if (source === null) {
                return;
            }
            const versions = this._sourceVersion.get(source);
            if (versions.lastNotified < version) {
                versions.lastNotified = version;
                if (source === this._source) {
                    this.stateChanged.emit();
                }
            }
        }
        _handleLogRegistryChange() {
            const loggers = this._loggerRegistry.getLoggers();
            for (const logger of loggers) {
                if (!this._sourceVersion.has(logger.source)) {
                    logger.contentChanged.connect(this._handleLogContentChange, this);
                    this._sourceVersion.set(logger.source, {
                        lastDisplayed: 0,
                        lastNotified: 0
                    });
                }
            }
        }
        _handleLogContentChange({ source }, change) {
            if (source === this._source) {
                this.stateChanged.emit();
            }
        }
    }
    LogConsoleStatus.Model = Model;
})(LogConsoleStatus || (LogConsoleStatus = {}));
//# sourceMappingURL=status.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module logconsole-extension
 */












const LOG_CONSOLE_FACTORY = 'LogConsole';
const LOG_CONSOLE_PLUGIN_ID = '@jupyterlab/logconsole-extension:plugin';
/**
 * The command IDs used by the plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.addCheckpoint = 'logconsole:add-checkpoint';
    CommandIDs.clear = 'logconsole:clear';
    CommandIDs.open = 'logconsole:open';
    CommandIDs.setLevel = 'logconsole:set-level';
})(CommandIDs || (CommandIDs = {}));
/**
 * The Log Console extension.
 */
const logConsolePlugin = {
    activate: activateLogConsole,
    id: LOG_CONSOLE_PLUGIN_ID,
    description: 'Provides the logger registry.',
    provides: logconsole_lib_index_js_.ILoggerRegistry,
    requires: [rendermime_lib_index_js_.IRenderMimeRegistry, translation_lib_index_js_.ITranslator],
    optional: [
        index_js_.ILabShell,
        lib_index_js_.ICommandPalette,
        index_js_.ILayoutRestorer,
        statusbar_lib_index_js_.IStatusBar,
        settingregistry_lib_index_js_.ISettingRegistry,
        lib_index_js_.IToolbarWidgetRegistry
    ],
    autoStart: true
};
/**
 * Activate the Log Console extension.
 */
function activateLogConsole(app, rendermime, translator, labShell, palette, restorer, statusBar, settingRegistry, toolbarRegistry) {
    const trans = translator.load('jupyterlab');
    let logConsoleWidget = null;
    let logConsolePanel = null;
    let toolbarFactory;
    if (settingRegistry && toolbarRegistry) {
        toolbarFactory = (0,lib_index_js_.createToolbarFactory)(toolbarRegistry, settingRegistry, LOG_CONSOLE_FACTORY, LOG_CONSOLE_PLUGIN_ID, translator);
        toolbarRegistry.addFactory(LOG_CONSOLE_FACTORY, 'set-level', (panel) => new LogLevelSwitcher(panel.content, translator));
    }
    const loggerRegistry = new logconsole_lib_index_js_.LoggerRegistry({
        defaultRendermime: rendermime,
        // The maxLength is reset below from settings
        maxLength: 1000
    });
    const tracker = new lib_index_js_.WidgetTracker({
        namespace: 'logconsole'
    });
    if (restorer) {
        void restorer.restore(tracker, {
            command: CommandIDs.open,
            name: () => 'logconsole'
        });
    }
    const status = new LogConsoleStatus({
        loggerRegistry: loggerRegistry,
        handleClick: () => {
            var _a;
            if (!logConsoleWidget) {
                createLogConsoleWidget({
                    insertMode: 'split-bottom',
                    ref: (_a = app.shell.currentWidget) === null || _a === void 0 ? void 0 : _a.id
                });
            }
            else {
                app.shell.activateById(logConsoleWidget.id);
            }
        },
        translator
    });
    const getCurrentWidgetPath = () => {
        const currentWidget = app.shell.currentWidget;
        if (labShell === null || labShell === void 0 ? void 0 : labShell.currentPath) {
            return labShell.currentPath;
        }
        // For other shells, set the source to the current widget path
        if (currentWidget && currentWidget instanceof docregistry_lib_index_js_.DocumentWidget) {
            return currentWidget.context.path;
        }
        return null;
    };
    const createLogConsoleWidget = (options = {}) => {
        var _a, _b;
        logConsolePanel = new logconsole_lib_index_js_.LogConsolePanel(loggerRegistry, translator);
        logConsolePanel.source = (_b = (_a = options.source) !== null && _a !== void 0 ? _a : getCurrentWidgetPath()) !== null && _b !== void 0 ? _b : null;
        logConsoleWidget = new lib_index_js_.MainAreaWidget({ content: logConsolePanel });
        logConsoleWidget.addClass('jp-LogConsole');
        logConsoleWidget.title.closable = true;
        logConsoleWidget.title.icon = ui_components_lib_index_js_.listIcon;
        logConsoleWidget.title.label = trans.__('Log Console');
        if (toolbarFactory) {
            (0,lib_index_js_.setToolbar)(logConsoleWidget, toolbarFactory);
        }
        const notifyCommands = () => {
            app.commands.notifyCommandChanged(CommandIDs.addCheckpoint);
            app.commands.notifyCommandChanged(CommandIDs.clear);
            app.commands.notifyCommandChanged(CommandIDs.open);
            app.commands.notifyCommandChanged(CommandIDs.setLevel);
        };
        logConsolePanel.sourceChanged.connect(() => {
            notifyCommands();
        });
        logConsolePanel.sourceDisplayed.connect((panel, { source, version }) => {
            status.model.sourceDisplayed(source, version);
        });
        logConsoleWidget.disposed.connect(() => {
            logConsoleWidget = null;
            logConsolePanel = null;
            notifyCommands();
        });
        app.shell.add(logConsoleWidget, 'down', {
            ref: options.ref,
            mode: options.insertMode,
            type: 'Log Console'
        });
        void tracker.add(logConsoleWidget);
        app.shell.activateById(logConsoleWidget.id);
        logConsoleWidget.update();
        notifyCommands();
    };
    app.commands.addCommand(CommandIDs.open, {
        label: trans.__('Show Log Console'),
        execute: (options = {}) => {
            // Toggle the display
            if (logConsoleWidget) {
                logConsoleWidget.dispose();
            }
            else {
                createLogConsoleWidget(options);
            }
        },
        isToggled: () => {
            return logConsoleWidget !== null;
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    source: {
                        type: 'string',
                        description: trans.__('The source for the log console')
                    },
                    insertMode: {
                        type: 'string',
                        description: trans.__('The insert mode for the dock layout')
                    },
                    ref: {
                        type: 'string',
                        description: trans.__('The reference widget')
                    }
                }
            }
        }
    });
    app.commands.addCommand(CommandIDs.addCheckpoint, {
        execute: () => {
            var _a;
            (_a = logConsolePanel === null || logConsolePanel === void 0 ? void 0 : logConsolePanel.logger) === null || _a === void 0 ? void 0 : _a.checkpoint();
        },
        icon: ui_components_lib_index_js_.addIcon,
        isEnabled: () => !!logConsolePanel && logConsolePanel.source !== null,
        label: trans.__('Add Checkpoint'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    app.commands.addCommand(CommandIDs.clear, {
        execute: () => {
            var _a;
            (_a = logConsolePanel === null || logConsolePanel === void 0 ? void 0 : logConsolePanel.logger) === null || _a === void 0 ? void 0 : _a.clear();
        },
        icon: ui_components_lib_index_js_.clearIcon,
        isEnabled: () => !!logConsolePanel && logConsolePanel.source !== null,
        label: trans.__('Clear Log'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    function toTitleCase(value) {
        return value.length === 0 ? value : value[0].toUpperCase() + value.slice(1);
    }
    app.commands.addCommand(CommandIDs.setLevel, {
        // TODO: find good icon class
        execute: (args) => {
            if (logConsolePanel === null || logConsolePanel === void 0 ? void 0 : logConsolePanel.logger) {
                logConsolePanel.logger.level = args.level;
            }
        },
        isEnabled: () => !!logConsolePanel && logConsolePanel.source !== null,
        label: args => args['level']
            ? trans.__('Set Log Level to %1', toTitleCase(args.level))
            : trans.__('Set log level to `level`.'),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    level: {
                        type: 'string',
                        enum: ['Critical', 'Error', 'Warning', 'Info', 'Debug'],
                        description: trans.__('The log level to set')
                    }
                },
                required: ['level']
            }
        }
    });
    if (palette) {
        palette.addItem({
            command: CommandIDs.open,
            category: trans.__('Main Area')
        });
    }
    if (statusBar) {
        statusBar.registerStatusItem('@jupyterlab/logconsole-extension:status', {
            item: status,
            align: 'left',
            isActive: () => { var _a; return ((_a = status.model) === null || _a === void 0 ? void 0 : _a.version) > 0; },
            activeStateChanged: status.model.stateChanged
        });
    }
    function setSource(source) {
        if (logConsolePanel) {
            logConsolePanel.source = source;
        }
        status.model.source = source;
    }
    void app.restored.then(() => {
        var _a;
        // Set source only after app is restored in order to allow restorer to
        // restore previous source first, which may set the renderer
        if (labShell) {
            labShell.currentPathChanged.connect((_, { newValue }) => setSource(newValue));
            setSource((_a = labShell.currentPath) !== null && _a !== void 0 ? _a : null);
        }
        else {
            setSource(getCurrentWidgetPath());
        }
    });
    if (settingRegistry) {
        const updateSettings = (settings) => {
            loggerRegistry.maxLength = settings.get('maxLogEntries')
                .composite;
            status.model.flashEnabled = settings.get('flash').composite;
            loggerRegistry.defaultLogLevel = settings.get('defaultLogLevel')
                .composite;
        };
        Promise.all([settingRegistry.load(LOG_CONSOLE_PLUGIN_ID), app.restored])
            .then(([settings]) => {
            updateSettings(settings);
            settings.changed.connect(settings => {
                updateSettings(settings);
            });
        })
            .catch((reason) => {
            console.error(reason.message);
        });
    }
    return loggerRegistry;
}
/**
 * A toolbar widget that switches log levels.
 */
class LogLevelSwitcher extends ui_components_lib_index_js_.ReactWidget {
    /**
     * Construct a new log level switcher.
     */
    constructor(widget, translator) {
        super();
        /**
         * Handle `change` events for the HTMLSelect component.
         */
        this.handleChange = (event) => {
            if (this._logConsole.logger) {
                this._logConsole.logger.level = event.target.value;
            }
            this.update();
        };
        /**
         * Handle `keydown` events for the HTMLSelect component.
         */
        this.handleKeyDown = (event) => {
            if (event.keyCode === 13) {
                this._logConsole.activate();
            }
        };
        this._id = `level-${dist_index_js_.UUID.uuid4()}`;
        this.translator = translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this.addClass('jp-LogConsole-toolbarLogLevel');
        this._logConsole = widget;
        if (widget.source) {
            this.update();
        }
        widget.sourceChanged.connect(this._updateSource, this);
    }
    _updateSource(sender, { oldValue, newValue }) {
        // Transfer stateChanged handler to new source logger
        if (oldValue !== null) {
            const logger = sender.loggerRegistry.getLogger(oldValue);
            logger.stateChanged.disconnect(this.update, this);
        }
        if (newValue !== null) {
            const logger = sender.loggerRegistry.getLogger(newValue);
            logger.stateChanged.connect(this.update, this);
        }
        this.update();
    }
    render() {
        const logger = this._logConsole.logger;
        return (react_index_js_.createElement(react_index_js_.Fragment, null,
            react_index_js_.createElement("label", { htmlFor: this._id, className: logger === null
                    ? 'jp-LogConsole-toolbarLogLevel-disabled'
                    : undefined }, this._trans.__('Log Level:')),
            react_index_js_.createElement(ui_components_lib_index_js_.HTMLSelect, { id: this._id, className: "jp-LogConsole-toolbarLogLevelDropdown", onChange: this.handleChange, onKeyDown: this.handleKeyDown, value: logger === null || logger === void 0 ? void 0 : logger.level, "aria-label": this._trans.__('Log level'), disabled: logger === null, options: logger === null
                    ? []
                    : [
                        [this._trans.__('Critical'), 'Critical'],
                        [this._trans.__('Error'), 'Error'],
                        [this._trans.__('Warning'), 'Warning'],
                        [this._trans.__('Info'), 'Info'],
                        [this._trans.__('Debug'), 'Debug']
                    ].map(data => ({
                        label: data[0],
                        value: data[1].toLowerCase()
                    })) })));
    }
}
/* harmony default export */ const lib = (logConsolePlugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 86088:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js + 1 modules
var statusbar_style = __webpack_require__(546);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/logconsole/style/index.js + 1 modules
var logconsole_style = __webpack_require__(71960);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/logconsole-extension/style/base.css
var base = __webpack_require__(40151);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */












/***/ }),

/***/ 2089:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ILoggerRegistry: () => (/* reexport */ ILoggerRegistry),
  LogConsolePanel: () => (/* reexport */ LogConsolePanel),
  LogOutputModel: () => (/* reexport */ LogOutputModel),
  Logger: () => (/* reexport */ Logger),
  LoggerOutputAreaModel: () => (/* reexport */ LoggerOutputAreaModel),
  LoggerRegistry: () => (/* reexport */ LoggerRegistry),
  ScrollingWidget: () => (/* reexport */ ScrollingWidget)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/outputarea@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/outputarea/lib/index.js)
var index_js_ = __webpack_require__(70315);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole/lib/logger.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Log Output Model with timestamp which provides
 * item information for Output Area Model.
 */
class LogOutputModel extends lib_index_js_.OutputModel {
    /**
     * Construct a LogOutputModel.
     *
     * @param options - The model initialization options.
     */
    constructor(options) {
        super(options);
        this.timestamp = new Date(options.value.timestamp);
        this.level = options.value.level;
    }
}
/**
 * Implementation of `IContentFactory` for Output Area Model
 * which creates LogOutputModel instances.
 */
class LogConsoleModelContentFactory extends index_js_.OutputAreaModel.ContentFactory {
    /**
     * Create a rendermime output model from notebook output.
     */
    createOutputModel(options) {
        return new LogOutputModel(options);
    }
}
/**
 * Output Area Model implementation which is able to
 * limit number of outputs stored.
 */
class LoggerOutputAreaModel extends index_js_.OutputAreaModel {
    constructor({ maxLength, ...options }) {
        super(options);
        this.maxLength = maxLength;
    }
    /**
     * Add an output, which may be combined with previous output.
     *
     * @returns The total number of outputs.
     *
     * #### Notes
     * The output bundle is copied. Contiguous stream outputs of the same `name`
     * are combined. The oldest outputs are possibly removed to ensure the total
     * number of outputs is at most `.maxLength`.
     */
    add(output) {
        super.add(output);
        this._applyMaxLength();
        return this.length;
    }
    /**
     * Whether an output should combine with the previous output.
     *
     * We combine if the two outputs are in the same second, which is the
     * resolution for our time display.
     */
    shouldCombine(options) {
        const { value, lastModel } = options;
        const oldSeconds = Math.trunc(lastModel.timestamp.getTime() / 1000);
        const newSeconds = Math.trunc(value.timestamp / 1000);
        return oldSeconds === newSeconds;
    }
    /**
     * Get an item at the specified index.
     */
    get(index) {
        return super.get(index);
    }
    /**
     * Maximum number of outputs to store in the model.
     */
    get maxLength() {
        return this._maxLength;
    }
    set maxLength(value) {
        this._maxLength = value;
        this._applyMaxLength();
    }
    /**
     * Manually apply length limit.
     */
    _applyMaxLength() {
        if (this.list.length > this._maxLength) {
            this.list.removeRange(0, this.list.length - this._maxLength);
        }
    }
}
/**
 * A concrete implementation of ILogger.
 */
class Logger {
    /**
     * Construct a Logger.
     *
     * @param options Constructor options
     */
    constructor(options) {
        var _a;
        this._isDisposed = false;
        this._contentChanged = new index_es6_js_.Signal(this);
        this._stateChanged = new index_es6_js_.Signal(this);
        this._rendermime = null;
        this._version = 0;
        this.source = options.source;
        this.outputAreaModel = new LoggerOutputAreaModel({
            contentFactory: new LogConsoleModelContentFactory(),
            maxLength: options.maxLength
        });
        this._level = (_a = options.level) !== null && _a !== void 0 ? _a : 'warning';
    }
    /**
     * The maximum number of outputs stored.
     *
     * #### Notes
     * Oldest entries will be trimmed to ensure the length is at most
     * `.maxLength`.
     */
    get maxLength() {
        return this.outputAreaModel.maxLength;
    }
    set maxLength(value) {
        this.outputAreaModel.maxLength = value;
    }
    /**
     * The level of outputs logged
     */
    get level() {
        return this._level;
    }
    set level(newValue) {
        const oldValue = this._level;
        if (oldValue === newValue) {
            return;
        }
        this._level = newValue;
        this._log({
            output: {
                output_type: 'display_data',
                data: {
                    'text/plain': `Log level set to ${newValue}`
                }
            },
            level: 'metadata'
        });
        this._stateChanged.emit({ name: 'level', oldValue, newValue });
    }
    /**
     * Number of outputs logged.
     */
    get length() {
        return this.outputAreaModel.length;
    }
    /**
     * A signal emitted when the list of log messages changes.
     */
    get contentChanged() {
        return this._contentChanged;
    }
    /**
     * A signal emitted when the log state changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * Rendermime to use when rendering outputs logged.
     */
    get rendermime() {
        return this._rendermime;
    }
    set rendermime(value) {
        if (value !== this._rendermime) {
            const oldValue = this._rendermime;
            const newValue = (this._rendermime = value);
            this._stateChanged.emit({ name: 'rendermime', oldValue, newValue });
        }
    }
    /**
     * The number of messages that have ever been stored.
     */
    get version() {
        return this._version;
    }
    /**
     * Log an output to logger.
     *
     * @param log - The output to be logged.
     */
    log(log) {
        // Filter by our current log level
        if (Private.LogLevel[log.level] <
            Private.LogLevel[this._level]) {
            return;
        }
        let output = null;
        switch (log.type) {
            case 'text':
                output = {
                    output_type: 'display_data',
                    data: {
                        'text/plain': log.data
                    }
                };
                break;
            case 'html':
                output = {
                    output_type: 'display_data',
                    data: {
                        'text/html': log.data
                    }
                };
                break;
            case 'output':
                output = log.data;
                break;
            default:
                break;
        }
        if (output) {
            this._log({
                output,
                level: log.level
            });
        }
    }
    /**
     * Clear all outputs logged.
     */
    clear() {
        this.outputAreaModel.clear(false);
        this._contentChanged.emit('clear');
    }
    /**
     * Add a checkpoint to the log.
     */
    checkpoint() {
        this._log({
            output: {
                output_type: 'display_data',
                data: {
                    'text/html': '<hr/>'
                }
            },
            level: 'metadata'
        });
    }
    /**
     * Whether the logger is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose the logger.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.clear();
        this._rendermime = null;
        index_es6_js_.Signal.clearData(this);
    }
    _log(options) {
        // First, make sure our version reflects the new message so things
        // triggering from the signals below have the correct version.
        this._version++;
        // Next, trigger any displays of the message
        this.outputAreaModel.add({
            ...options.output,
            timestamp: Date.now(),
            level: options.level
        });
        // Finally, tell people that the message was appended (and possibly
        // already displayed).
        this._contentChanged.emit('append');
    }
}
/**
 * The namespace for Logger class private statics.
 */
var Private;
(function (Private) {
    /**
     * The log level enum.
     */
    let LogLevel;
    (function (LogLevel) {
        LogLevel[LogLevel["debug"] = 0] = "debug";
        LogLevel[LogLevel["info"] = 1] = "info";
        LogLevel[LogLevel["warning"] = 2] = "warning";
        LogLevel[LogLevel["error"] = 3] = "error";
        LogLevel[LogLevel["critical"] = 4] = "critical";
        LogLevel[LogLevel["metadata"] = 5] = "metadata";
    })(LogLevel = Private.LogLevel || (Private.LogLevel = {}));
})(Private || (Private = {}));
//# sourceMappingURL=logger.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole/lib/registry.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A concrete implementation of ILoggerRegistry.
 */
class LoggerRegistry {
    /**
     * Construct a LoggerRegistry.
     *
     * @param options.defaultRendermime - Default rendermime to render outputs
     * with when logger is not supplied with one.
     */
    constructor(options) {
        var _a;
        this._loggers = new Map();
        this._registryChanged = new index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._defaultRendermime = options.defaultRendermime;
        this._maxLength = options.maxLength;
        this._defaultLogLevel = (_a = options.defaultLogLevel) !== null && _a !== void 0 ? _a : 'warning';
    }
    /**
     * Get the logger for the specified source.
     *
     * @param source - The name of the log source.
     *
     * @returns The logger for the specified source.
     */
    getLogger(source) {
        const loggers = this._loggers;
        let logger = loggers.get(source);
        if (logger) {
            return logger;
        }
        logger = new Logger({
            source,
            maxLength: this.maxLength,
            level: this.defaultLogLevel
        });
        logger.rendermime = this._defaultRendermime;
        loggers.set(source, logger);
        this._registryChanged.emit('append');
        return logger;
    }
    /**
     * Get all loggers registered.
     *
     * @returns The array containing all registered loggers.
     */
    getLoggers() {
        return Array.from(this._loggers.values());
    }
    /**
     * A signal emitted when the logger registry changes.
     */
    get registryChanged() {
        return this._registryChanged;
    }
    /**
     * The max length for loggers.
     */
    get maxLength() {
        return this._maxLength;
    }
    set maxLength(value) {
        this._maxLength = value;
        this._loggers.forEach(logger => {
            logger.maxLength = value;
        });
    }
    /**
     * The default log level for new loggers.
     * The new value will be applied to new loggers only.
     */
    get defaultLogLevel() {
        return this._defaultLogLevel;
    }
    set defaultLogLevel(value) {
        this._defaultLogLevel = value;
    }
    /**
     * Whether the register is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose the registry and all loggers.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._loggers.forEach(x => x.dispose());
        index_es6_js_.Signal.clearData(this);
    }
}
//# sourceMappingURL=registry.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The Logger Registry token.
 */
const ILoggerRegistry = new dist_index_js_.Token('@jupyterlab/logconsole:ILoggerRegistry', 'A service providing a logger infrastructure.');
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




function toTitleCase(value) {
    return value.length === 0 ? value : value[0].toUpperCase() + value.slice(1);
}
/**
 * Log console output prompt implementation
 */
class LogConsoleOutputPrompt extends dist_index_es6_js_.Widget {
    constructor() {
        super();
        this._timestampNode = document.createElement('div');
        this.node.append(this._timestampNode);
    }
    /**
     * Date & time when output is logged.
     */
    set timestamp(value) {
        this._timestamp = value;
        this._timestampNode.innerHTML = this._timestamp.toLocaleTimeString();
        this.update();
    }
    /**
     * Log level
     */
    set level(value) {
        this._level = value;
        this.node.dataset.logLevel = value;
        this.update();
    }
    update() {
        if (this._level !== undefined && this._timestamp !== undefined) {
            this.node.title = `${this._timestamp.toLocaleString()}; ${toTitleCase(this._level)} level`;
        }
    }
}
/**
 * Output Area implementation displaying log outputs
 * with prompts showing log timestamps.
 */
class LogConsoleOutputArea extends index_js_.OutputArea {
    /**
     * Create an output item with a prompt and actual output
     */
    createOutputItem(model) {
        const panel = super.createOutputItem(model);
        if (panel === null) {
            // Could not render model
            return null;
        }
        // first widget in panel is prompt of type LoggerOutputPrompt
        const prompt = panel.widgets[0];
        prompt.timestamp = model.timestamp;
        prompt.level = model.level;
        return panel;
    }
    /**
     * Handle an input request from a kernel by doing nothing.
     */
    onInputRequest(msg, future) {
        return;
    }
}
/**
 * Implementation of `IContentFactory` for Output Area
 * which creates custom output prompts.
 */
class LogConsoleContentFactory extends index_js_.OutputArea.ContentFactory {
    /**
     * Create the output prompt for the widget.
     */
    createOutputPrompt() {
        return new LogConsoleOutputPrompt();
    }
}
/**
 * Implements a panel which supports pinning the position to the end if it is
 * scrolled to the end.
 *
 * #### Notes
 * This is useful for log viewing components or chat components that append
 * elements at the end. We would like to automatically scroll when the user
 * has scrolled to the bottom, but not change the scrolling when the user has
 * changed the scroll position.
 */
class ScrollingWidget extends dist_index_es6_js_.Widget {
    constructor({ content, ...options }) {
        super(options);
        this._observer = null;
        this.addClass('jp-Scrolling');
        const layout = (this.layout = new dist_index_es6_js_.PanelLayout());
        layout.addWidget(content);
        this._content = content;
        this._sentinel = document.createElement('div');
        this.node.appendChild(this._sentinel);
    }
    /**
     * The content widget.
     */
    get content() {
        return this._content;
    }
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        // defer so content gets a chance to attach first
        requestAnimationFrame(() => {
            this._sentinel.scrollIntoView();
            this._scrollHeight = this.node.scrollHeight;
        });
        // Set up intersection observer for the sentinel
        if (typeof IntersectionObserver !== 'undefined') {
            this._observer = new IntersectionObserver(args => {
                this._handleScroll(args);
            }, { root: this.node, threshold: 1 });
            this._observer.observe(this._sentinel);
        }
    }
    onBeforeDetach(msg) {
        if (this._observer) {
            this._observer.disconnect();
        }
    }
    onAfterShow(msg) {
        if (this._tracking) {
            this._sentinel.scrollIntoView();
        }
    }
    _handleScroll([entry]) {
        if (entry.isIntersecting) {
            this._tracking = true;
        }
        else if (this.isVisible) {
            const currentHeight = this.node.scrollHeight;
            if (currentHeight === this._scrollHeight) {
                // Likely the user scrolled manually
                this._tracking = false;
            }
            else {
                // We assume we scrolled because our size changed, so scroll to the end.
                this._sentinel.scrollIntoView();
                this._scrollHeight = currentHeight;
                this._tracking = true;
            }
        }
    }
}
/**
 * A StackedPanel implementation that creates Output Areas
 * for each log source and activates as source is switched.
 */
class LogConsolePanel extends dist_index_es6_js_.StackedPanel {
    /**
     * Construct a LogConsolePanel instance.
     *
     * @param loggerRegistry - The logger registry that provides
     * logs to be displayed.
     */
    constructor(loggerRegistry, translator) {
        super();
        this._outputAreas = new Map();
        this._source = null;
        this._sourceChanged = new index_es6_js_.Signal(this);
        this._sourceDisplayed = new index_es6_js_.Signal(this);
        this._loggersWatched = new Set();
        this.translator = translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._loggerRegistry = loggerRegistry;
        this.addClass('jp-LogConsolePanel');
        loggerRegistry.registryChanged.connect((sender, args) => {
            this._bindLoggerSignals();
        }, this);
        this._bindLoggerSignals();
        this._placeholder = new dist_index_es6_js_.Widget();
        this._placeholder.addClass('jp-LogConsoleListPlaceholder');
        this.addWidget(this._placeholder);
    }
    /**
     * The logger registry providing the logs.
     */
    get loggerRegistry() {
        return this._loggerRegistry;
    }
    /**
     * The current logger.
     */
    get logger() {
        if (this.source === null) {
            return null;
        }
        return this.loggerRegistry.getLogger(this.source);
    }
    /**
     * The log source displayed
     */
    get source() {
        return this._source;
    }
    set source(name) {
        if (name === this._source) {
            return;
        }
        const oldValue = this._source;
        const newValue = (this._source = name);
        this._showOutputFromSource(newValue);
        this._handlePlaceholder();
        this._sourceChanged.emit({ oldValue, newValue, name: 'source' });
    }
    /**
     * The source version displayed.
     */
    get sourceVersion() {
        const source = this.source;
        return source !== null
            ? this._loggerRegistry.getLogger(source).version
            : null;
    }
    /**
     * Signal for source changes
     */
    get sourceChanged() {
        return this._sourceChanged;
    }
    /**
     * Signal for source changes
     */
    get sourceDisplayed() {
        return this._sourceDisplayed;
    }
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        this._updateOutputAreas();
        this._showOutputFromSource(this._source);
        this._handlePlaceholder();
    }
    onAfterShow(msg) {
        super.onAfterShow(msg);
        if (this.source !== null) {
            this._sourceDisplayed.emit({
                source: this.source,
                version: this.sourceVersion
            });
        }
    }
    _bindLoggerSignals() {
        const loggers = this._loggerRegistry.getLoggers();
        for (const logger of loggers) {
            if (this._loggersWatched.has(logger.source)) {
                continue;
            }
            logger.contentChanged.connect((sender, args) => {
                this._updateOutputAreas();
                this._handlePlaceholder();
            }, this);
            logger.stateChanged.connect((sender, change) => {
                if (change.name !== 'rendermime') {
                    return;
                }
                const viewId = `source:${sender.source}`;
                const outputArea = this._outputAreas.get(viewId);
                if (outputArea) {
                    if (change.newValue) {
                        // cast away readonly
                        outputArea.rendermime = change.newValue;
                    }
                    else {
                        outputArea.dispose();
                    }
                }
            }, this);
            this._loggersWatched.add(logger.source);
        }
    }
    _showOutputFromSource(source) {
        // If the source is null, pick a unique name so all output areas hide.
        const viewId = source === null ? 'null source' : `source:${source}`;
        this._outputAreas.forEach((outputArea, name) => {
            var _a, _b;
            // Show/hide the output area parents, the scrolling windows.
            if (outputArea.id === viewId) {
                (_a = outputArea.parent) === null || _a === void 0 ? void 0 : _a.show();
                if (outputArea.isVisible) {
                    this._sourceDisplayed.emit({
                        source: this.source,
                        version: this.sourceVersion
                    });
                }
            }
            else {
                (_b = outputArea.parent) === null || _b === void 0 ? void 0 : _b.hide();
            }
        });
        const title = source === null
            ? this._trans.__('Log Console')
            : this._trans.__('Log: %1', source);
        this.title.label = title;
        this.title.caption = title;
    }
    _handlePlaceholder() {
        if (this.source === null) {
            this._placeholder.node.textContent = this._trans.__('No source selected.');
            this._placeholder.show();
        }
        else if (this._loggerRegistry.getLogger(this.source).length === 0) {
            this._placeholder.node.textContent = this._trans.__('No log messages.');
            this._placeholder.show();
        }
        else {
            this._placeholder.hide();
            this._placeholder.node.textContent = '';
        }
    }
    _updateOutputAreas() {
        const loggerIds = new Set();
        const loggers = this._loggerRegistry.getLoggers();
        for (const logger of loggers) {
            const source = logger.source;
            const viewId = `source:${source}`;
            loggerIds.add(viewId);
            // add view for logger if not exist
            if (!this._outputAreas.has(viewId)) {
                const outputArea = new LogConsoleOutputArea({
                    rendermime: logger.rendermime,
                    contentFactory: new LogConsoleContentFactory(),
                    model: logger.outputAreaModel
                });
                outputArea.id = viewId;
                // Attach the output area so it is visible, so the accounting
                // functions below record the outputs actually displayed.
                const w = new ScrollingWidget({
                    content: outputArea
                });
                this.addWidget(w);
                this._outputAreas.set(viewId, outputArea);
                // This is where the source object is associated with the output area.
                // We capture the source from this environment in the closure.
                const outputUpdate = (sender) => {
                    // If the current log console panel source is the source associated
                    // with this output area, and the output area is visible, then emit
                    // the logConsolePanel source displayed signal.
                    if (this.source === source && sender.isVisible) {
                        // We assume that the output area has been updated to the current
                        // version of the source.
                        this._sourceDisplayed.emit({
                            source: this.source,
                            version: this.sourceVersion
                        });
                    }
                };
                // Notify messages were displayed any time the output area is updated
                // and update for any outputs rendered on construction.
                outputArea.outputLengthChanged.connect(outputUpdate, this);
                // Since the output area was attached above, we can rely on its
                // visibility to account for the messages displayed.
                outputUpdate(outputArea);
            }
        }
        // remove output areas that do not have corresponding loggers anymore
        const viewIds = this._outputAreas.keys();
        for (const viewId of viewIds) {
            if (!loggerIds.has(viewId)) {
                const outputArea = this._outputAreas.get(viewId);
                outputArea === null || outputArea === void 0 ? void 0 : outputArea.dispose();
                this._outputAreas.delete(viewId);
            }
        }
    }
}
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module logconsole
 */




//# sourceMappingURL=index.js.map

/***/ }),

/***/ 71960:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/outputarea/style/index.js + 1 modules
var outputarea_style = __webpack_require__(76941);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/logconsole/style/base.css
var base = __webpack_require__(56728);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/logconsole/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 83466:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  RunningLanguageServer: () => (/* binding */ RunningLanguageServer),
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/lsp@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/lsp/lib/index.js)
var index_js_ = __webpack_require__(84259);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/running@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/running/lib/index.js)
var lib_index_js_ = __webpack_require__(64008);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(75205);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp-extension/lib/renderer.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





const SETTING_NAME = 'languageServers';
const SERVER_SETTINGS = 'configuration';
/**
 * The React component of the setting field
 */
function BuildSettingForm(props) {
    const { [SERVER_SETTINGS]: serverSettingsSchema, ...otherSettingsSchema } = props.schema;
    const { [SERVER_SETTINGS]: serverSettings, serverName, ...otherSettings } = props.settings;
    const [currentServerName, setCurrentServerName] = (0,react_index_js_.useState)(serverName);
    /**
     * Callback on server name field change event
     */
    const onServerNameChange = (e) => {
        props.updateSetting
            .invoke(props.serverHash, {
            serverName: e.target.value
        })
            .catch(console.error);
        setCurrentServerName(e.target.value);
    };
    const serverSettingWithType = {};
    Object.entries(serverSettings).forEach(([key, value]) => {
        const newProps = {
            property: key,
            type: typeof value,
            value
        };
        serverSettingWithType[dist_index_js_.UUID.uuid4()] = newProps;
    });
    const [propertyMap, setPropertyMap] = (0,react_index_js_.useState)(serverSettingWithType);
    const defaultOtherSettings = {};
    Object.entries(otherSettingsSchema).forEach(([key, value]) => {
        if (key in otherSettings) {
            defaultOtherSettings[key] = otherSettings[key];
        }
        else {
            defaultOtherSettings[key] = value['default'];
        }
    });
    const [otherSettingsComposite, setOtherSettingsComposite] = (0,react_index_js_.useState)(defaultOtherSettings);
    /**
     * Callback on additional setting field change event
     */
    const onOtherSettingsChange = (property, value, type) => {
        let settingValue = value;
        if (type === 'number') {
            settingValue = parseFloat(value);
        }
        const newProps = {
            ...otherSettingsComposite,
            [property]: settingValue
        };
        props.updateSetting.invoke(props.serverHash, newProps).catch(console.error);
        setOtherSettingsComposite(newProps);
    };
    /**
     * Callback on `Add property` button click event.
     */
    const addProperty = () => {
        const hash = dist_index_js_.UUID.uuid4();
        const newMap = {
            ...propertyMap,
            [hash]: { property: '', type: 'string', value: '' }
        };
        const payload = {};
        Object.values(newMap).forEach(value => {
            payload[value.property] = value.value;
        });
        props.updateSetting
            .invoke(props.serverHash, {
            [SERVER_SETTINGS]: payload
        })
            .catch(console.error);
        setPropertyMap(newMap);
    };
    /**
     * Callback on `Remove property` button click event.
     */
    const removeProperty = (entryHash) => {
        const newMap = {};
        Object.entries(propertyMap).forEach(([hash, value]) => {
            if (hash !== entryHash) {
                newMap[hash] = value;
            }
            const payload = {};
            Object.values(newMap).forEach(value => {
                payload[value.property] = value.value;
            });
            props.updateSetting
                .invoke(props.serverHash, {
                [SERVER_SETTINGS]: payload
            })
                .catch(console.error);
            setPropertyMap(newMap);
        });
    };
    /**
     * Save setting to the setting registry on field change event.
     */
    const setProperty = (hash, property) => {
        if (hash in propertyMap) {
            const newMap = { ...propertyMap, [hash]: property };
            const payload = {};
            Object.values(newMap).forEach(value => {
                payload[value.property] = value.value;
            });
            setPropertyMap(newMap);
            props.updateSetting
                .invoke(props.serverHash, {
                [SERVER_SETTINGS]: payload
            })
                .catch(console.error);
        }
    };
    const debouncedSetProperty = new dist_index_es6_js_.Debouncer(setProperty);
    const textInputId = (0,react_index_js_.useRef)(apputils_lib_index_js_.DOMUtils.createDomID() + '-line-number-input');
    return (react_index_js_default().createElement("div", { className: "array-item" },
        react_index_js_default().createElement("div", { className: "form-group " },
            react_index_js_default().createElement("div", { className: "jp-FormGroup-content" },
                react_index_js_default().createElement("div", { className: "jp-objectFieldWrapper" },
                    react_index_js_default().createElement("fieldset", null,
                        react_index_js_default().createElement("div", { className: "form-group small-field" },
                            react_index_js_default().createElement("div", { className: "jp-modifiedIndicator jp-errorIndicator" }),
                            react_index_js_default().createElement("div", { className: "jp-FormGroup-content" },
                                react_index_js_default().createElement("label", { htmlFor: textInputId.current, className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem" }, props.trans.__('Server name:')),
                                react_index_js_default().createElement("div", { className: "jp-inputFieldWrapper jp-FormGroup-contentItem" },
                                    react_index_js_default().createElement("input", { id: textInputId.current, className: "form-control", type: "text", required: true, value: currentServerName, onChange: e => {
                                            onServerNameChange(e);
                                        } })),
                                react_index_js_default().createElement("div", { className: "validationErrors" },
                                    react_index_js_default().createElement("div", null,
                                        react_index_js_default().createElement("ul", { className: "error-detail bs-callout bs-callout-info" },
                                            react_index_js_default().createElement("li", { className: "text-danger" }, props.trans.__('is a required property'))))))),
                        Object.entries(otherSettingsSchema).map(([property, value], idx) => {
                            return (react_index_js_default().createElement("div", { key: `${idx}-${property}`, className: "form-group small-field" },
                                react_index_js_default().createElement("div", { className: "jp-FormGroup-content" },
                                    react_index_js_default().createElement("h3", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem" }, value.title),
                                    react_index_js_default().createElement("div", { className: "jp-inputFieldWrapper jp-FormGroup-contentItem" },
                                        react_index_js_default().createElement("input", { className: "form-control", placeholder: "", type: value.type, value: otherSettingsComposite[property], onChange: e => onOtherSettingsChange(property, e.target.value, value.type) })),
                                    react_index_js_default().createElement("div", { className: "jp-FormGroup-description" }, value.description),
                                    react_index_js_default().createElement("div", { className: "validationErrors" }))));
                        }),
                        react_index_js_default().createElement("fieldset", null,
                            react_index_js_default().createElement("legend", null, serverSettingsSchema['title']),
                            Object.entries(propertyMap).map(([hash, property]) => {
                                return (react_index_js_default().createElement(PropertyFrom, { key: hash, hash: hash, property: property, removeProperty: removeProperty, setProperty: debouncedSetProperty }));
                            }),
                            react_index_js_default().createElement("span", null, serverSettingsSchema['description'])))))),
        react_index_js_default().createElement("div", { className: "jp-ArrayOperations" },
            react_index_js_default().createElement("button", { className: "jp-mod-styled jp-mod-reject", onClick: addProperty }, props.trans.__('Add property')),
            react_index_js_default().createElement("button", { className: "jp-mod-styled jp-mod-warn jp-FormGroup-removeButton", onClick: () => props.removeSetting(props.serverHash) }, props.trans.__('Remove server')))));
}
function PropertyFrom(props) {
    const [state, setState] = (0,react_index_js_.useState)({ ...props.property });
    const TYPE_MAP = { string: 'text', number: 'number', boolean: 'checkbox' };
    const removeItem = () => {
        props.removeProperty(props.hash);
    };
    const changeName = (newName) => {
        const newState = { ...state, property: newName };
        props.setProperty.invoke(props.hash, newState).catch(console.error);
        setState(newState);
    };
    const changeValue = (newValue, type) => {
        let value = newValue;
        if (type === 'number') {
            value = parseFloat(newValue);
        }
        const newState = { ...state, value };
        props.setProperty.invoke(props.hash, newState).catch(console.error);
        setState(newState);
    };
    const changeType = (newType) => {
        let value;
        if (newType === 'boolean') {
            value = false;
        }
        else if (newType === 'number') {
            value = 0;
        }
        else {
            value = '';
        }
        const newState = { ...state, type: newType, value };
        setState(newState);
        props.setProperty.invoke(props.hash, newState).catch(console.error);
    };
    return (react_index_js_default().createElement("div", { key: props.hash, className: "form-group small-field" },
        react_index_js_default().createElement("div", { className: "jp-FormGroup-content jp-LSPExtension-FormGroup-content" },
            react_index_js_default().createElement("input", { className: "form-control", type: "text", required: true, placeholder: 'Property name', value: state.property, onChange: e => {
                    changeName(e.target.value);
                } }),
            react_index_js_default().createElement("select", { className: "form-control", value: state.type, onChange: e => changeType(e.target.value) },
                react_index_js_default().createElement("option", { value: "string" }, "String"),
                react_index_js_default().createElement("option", { value: "number" }, "Number"),
                react_index_js_default().createElement("option", { value: "boolean" }, "Boolean")),
            react_index_js_default().createElement("input", { className: "form-control", type: TYPE_MAP[state.type], required: false, placeholder: 'Property value', value: state.type !== 'boolean' ? state.value : undefined, checked: state.type === 'boolean' ? state.value : undefined, onChange: state.type !== 'boolean'
                    ? e => changeValue(e.target.value, state.type)
                    : e => changeValue(e.target.checked, state.type) }),
            react_index_js_default().createElement("button", { className: "jp-mod-minimal jp-Button", onClick: removeItem },
                react_index_js_default().createElement(ui_components_lib_index_js_.closeIcon.react, null)))));
}
/**
 * React setting component
 */
class SettingRenderer extends (react_index_js_default()).Component {
    constructor(props) {
        super(props);
        /**
         * Remove a setting item by its hash
         *
         * @param hash - hash of the item to be removed.
         */
        this.removeSetting = (hash) => {
            if (hash in this.state.items) {
                const items = {};
                for (const key in this.state.items) {
                    if (key !== hash) {
                        items[key] = this.state.items[key];
                    }
                }
                this.setState(old => {
                    return { ...old, items };
                }, () => {
                    this.saveServerSetting();
                });
            }
        };
        /**
         * Update a setting item by its hash
         *
         * @param hash - hash of the item to be updated.
         * @param newSetting - new setting value.
         */
        this.updateSetting = (hash, newSetting) => {
            if (hash in this.state.items) {
                const items = {};
                for (const key in this.state.items) {
                    if (key === hash) {
                        items[key] = { ...this.state.items[key], ...newSetting };
                    }
                    else {
                        items[key] = this.state.items[key];
                    }
                }
                this.setState(old => {
                    return { ...old, items };
                }, () => {
                    this.saveServerSetting();
                });
            }
        };
        /**
         * Add setting item to the setting component.
         */
        this.addServerSetting = () => {
            let index = 0;
            let key = 'newKey';
            while (Object.values(this.state.items)
                .map(val => val.serverName)
                .includes(key)) {
                index += 1;
                key = `newKey-${index}`;
            }
            this.setState(old => ({
                ...old,
                items: {
                    ...old.items,
                    [dist_index_js_.UUID.uuid4()]: { ...this._defaultSetting, serverName: key }
                }
            }), () => {
                this.saveServerSetting();
            });
        };
        /**
         * Save the value of setting items to the setting registry.
         */
        this.saveServerSetting = () => {
            const settings = {};
            Object.values(this.state.items).forEach(item => {
                const { serverName, ...setting } = item;
                settings[serverName] = setting;
            });
            this._setting.set(SETTING_NAME, settings).catch(console.error);
        };
        this._setting = props.formContext.settings;
        this._trans = props.translator.load('jupyterlab');
        const schema = this._setting.schema['definitions'];
        this._defaultSetting = schema['languageServer']['default'];
        this._schema = schema['languageServer']['properties'];
        const title = props.schema.title;
        const desc = props.schema.description;
        const settings = props.formContext.settings;
        const compositeData = settings.get(SETTING_NAME).composite;
        let items = {};
        if (compositeData) {
            Object.entries(compositeData).forEach(([key, value]) => {
                if (value) {
                    const hash = dist_index_js_.UUID.uuid4();
                    items[hash] = { serverName: key, ...value };
                }
            });
        }
        this.state = { title, desc, items };
        this._debouncedUpdateSetting = new dist_index_es6_js_.Debouncer(this.updateSetting.bind(this));
    }
    render() {
        return (react_index_js_default().createElement("div", null,
            react_index_js_default().createElement("fieldset", null,
                react_index_js_default().createElement("legend", null, this.state.title),
                react_index_js_default().createElement("p", { className: "field-description" }, this.state.desc),
                react_index_js_default().createElement("div", { className: "field field-array field-array-of-object" }, Object.entries(this.state.items).map(([hash, value], idx) => {
                    return (react_index_js_default().createElement(BuildSettingForm, { key: `${idx}-${hash}`, trans: this._trans, removeSetting: this.removeSetting, updateSetting: this._debouncedUpdateSetting, serverHash: hash, settings: value, schema: this._schema }));
                })),
                react_index_js_default().createElement("div", null,
                    react_index_js_default().createElement("button", { style: { margin: 2 }, className: "jp-mod-styled jp-mod-reject", onClick: this.addServerSetting }, this._trans.__('Add server'))))));
    }
}
/**
 * Custom setting renderer for language server extension.
 */
function renderServerSetting(props, translator) {
    return react_index_js_default().createElement(SettingRenderer, { ...props, translator: translator });
}
//# sourceMappingURL=renderer.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module lsp-extension
 */







const lib_plugin = {
    activate,
    id: '@jupyterlab/lsp-extension:plugin',
    description: 'Provides the language server connection manager.',
    requires: [translation_lib_index_js_.ITranslator, index_js_.IWidgetLSPAdapterTracker],
    optional: [lib_index_js_.IRunningSessionManagers],
    provides: index_js_.ILSPDocumentConnectionManager,
    autoStart: true
};
const featurePlugin = {
    id: '@jupyterlab/lsp-extension:feature',
    description: 'Provides the language server feature manager.',
    activate: () => new index_js_.FeatureManager(),
    provides: index_js_.ILSPFeatureManager,
    autoStart: true
};
const settingsPlugin = {
    activate: activateSettings,
    id: '@jupyterlab/lsp-extension:settings',
    description: 'Provides the language server settings.',
    requires: [index_js_.ILSPDocumentConnectionManager, settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    optional: [ui_components_lib_index_js_.IFormRendererRegistry],
    autoStart: true
};
const codeExtractorManagerPlugin = {
    id: '@jupyterlab/lsp-extension:code-extractor-manager',
    autoStart: true,
    description: 'Provides the code extractor manager.',
    provides: index_js_.ILSPCodeExtractorsManager,
    activate: app => {
        const extractorManager = new index_js_.CodeExtractorsManager();
        const markdownCellExtractor = new index_js_.TextForeignCodeExtractor({
            language: 'markdown',
            isStandalone: false,
            file_extension: 'md',
            cellType: ['markdown']
        });
        extractorManager.register(markdownCellExtractor, null);
        const rawCellExtractor = new index_js_.TextForeignCodeExtractor({
            language: 'text',
            isStandalone: false,
            file_extension: 'txt',
            cellType: ['raw']
        });
        extractorManager.register(rawCellExtractor, null);
        return extractorManager;
    }
};
/**
 * Activate the lsp plugin.
 */
function activate(app, translator, tracker, runningSessionManagers) {
    const languageServerManager = new index_js_.LanguageServerManager({
        settings: app.serviceManager.serverSettings
    });
    const connectionManager = new index_js_.DocumentConnectionManager({
        languageServerManager,
        adapterTracker: tracker
    });
    // Add a sessions manager if the running extension is available
    if (runningSessionManagers) {
        addRunningSessionManager(runningSessionManagers, connectionManager, translator);
    }
    return connectionManager;
}
/**
 * Activate the lsp settings plugin.
 */
function activateSettings(app, connectionManager, settingRegistry, translator, settingRendererRegistry) {
    const LANGUAGE_SERVERS = 'languageServers';
    const languageServerManager = connectionManager.languageServerManager;
    const updateOptions = (settings) => {
        const options = settings.composite;
        const languageServerSettings = (options.languageServers ||
            {});
        if (options.activate === 'on' && !languageServerManager.isEnabled) {
            languageServerManager.enable().catch(console.error);
        }
        else if (options.activate === 'off' && languageServerManager.isEnabled) {
            languageServerManager.disable();
            return;
        }
        connectionManager.initialConfigurations = languageServerSettings;
        // TODO: if priorities changed reset connections
        connectionManager.updateConfiguration(languageServerSettings);
        connectionManager.updateServerConfigurations(languageServerSettings);
        connectionManager.updateLogging(options.logAllCommunication, options.setTrace);
    };
    settingRegistry.transform(lib_plugin.id, {
        fetch: plugin => {
            const schema = plugin.schema.properties;
            const defaultValue = {};
            languageServerManager.sessions.forEach((_, key) => {
                defaultValue[key] = { rank: 50, configuration: {} };
            });
            schema[LANGUAGE_SERVERS]['default'] = defaultValue;
            return plugin;
        },
        compose: plugin => {
            const properties = plugin.schema.properties;
            const user = plugin.data.user;
            const serverDefaultSettings = properties[LANGUAGE_SERVERS]['default'];
            const serverUserSettings = user[LANGUAGE_SERVERS];
            let serverComposite = { ...serverDefaultSettings };
            if (serverUserSettings) {
                serverComposite = { ...serverComposite, ...serverUserSettings };
            }
            const composite = {
                [LANGUAGE_SERVERS]: serverComposite
            };
            Object.entries(properties).forEach(([key, value]) => {
                if (key !== LANGUAGE_SERVERS) {
                    if (key in user) {
                        composite[key] = user[key];
                    }
                    else {
                        composite[key] = value.default;
                    }
                }
            });
            plugin.data.composite = composite;
            return plugin;
        }
    });
    languageServerManager.sessionsChanged.connect(async () => {
        await settingRegistry.load(lib_plugin.id, true);
    });
    settingRegistry
        .load(lib_plugin.id)
        .then(settings => {
        updateOptions(settings);
        settings.changed.connect(() => {
            updateOptions(settings);
        });
        languageServerManager.disable();
    })
        .catch((reason) => {
        console.error(reason.message);
    });
    if (settingRendererRegistry) {
        const renderer = {
            fieldRenderer: (props) => {
                return renderServerSetting(props, translator);
            }
        };
        settingRendererRegistry.addRenderer(`${lib_plugin.id}.${LANGUAGE_SERVERS}`, renderer);
    }
}
class RunningLanguageServer {
    constructor(connection, manager) {
        this._connection = new WeakSet([connection]);
        this._manager = manager;
        this._serverIdentifier = connection.serverIdentifier;
        this._serverLanguage = connection.serverLanguage;
    }
    /**
     * This is no-op because we do not do anything on server click event
     */
    open() {
        /** no-op */
    }
    icon() {
        return ui_components_lib_index_js_.pythonIcon;
    }
    label() {
        var _a, _b;
        return `${(_a = this._serverIdentifier) !== null && _a !== void 0 ? _a : ''} (${(_b = this._serverLanguage) !== null && _b !== void 0 ? _b : ''})`;
    }
    shutdown() {
        for (const [key, value] of this._manager.connections.entries()) {
            if (this._connection.has(value)) {
                const { uri } = this._manager.documents.get(key);
                this._manager.unregisterDocument(uri);
            }
        }
        this._manager.disconnect(this._serverIdentifier);
    }
}
/**
 * Add the running terminal manager to the running panel.
 */
function addRunningSessionManager(managers, lsManager, translator) {
    const trans = translator.load('jupyterlab');
    const signal = new index_es6_js_.Signal(lsManager);
    lsManager.connected.connect(() => signal.emit(lsManager));
    lsManager.disconnected.connect(() => signal.emit(lsManager));
    lsManager.closed.connect(() => signal.emit(lsManager));
    lsManager.documentsChanged.connect(() => signal.emit(lsManager));
    let currentRunning = [];
    managers.add({
        name: trans.__('Language servers'),
        supportsMultipleViews: false,
        running: () => {
            const connections = new Set([...lsManager.connections.values()]);
            currentRunning = [...connections].map(conn => new RunningLanguageServer(conn, lsManager));
            return currentRunning;
        },
        shutdownAll: () => {
            currentRunning.forEach(item => {
                item.shutdown();
            });
        },
        refreshRunning: () => {
            return void 0;
        },
        runningChanged: signal,
        shutdownLabel: trans.__('Shut Down'),
        shutdownAllLabel: trans.__('Shut Down All'),
        shutdownAllConfirmationText: trans.__('Are you sure you want to permanently shut down all running language servers?')
    });
}
const adapterTrackerPlugin = {
    id: '@jupyterlab/lsp-extension:tracker',
    description: 'Provides the tracker of `WidgetLSPAdapter`.',
    autoStart: true,
    provides: index_js_.IWidgetLSPAdapterTracker,
    activate: (app) => {
        return new index_js_.WidgetLSPAdapterTracker({ shell: app.shell });
    }
};
/**
 * Export the plugin as default.
 */
/* harmony default export */ const lib = ([
    lib_plugin,
    featurePlugin,
    settingsPlugin,
    codeExtractorManagerPlugin,
    adapterTrackerPlugin
]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 26449:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/lsp/style/index.js
var lsp_style = __webpack_require__(27844);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/running/style/index.js + 1 modules
var running_style = __webpack_require__(37133);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/lsp-extension/style/base.css
var base = __webpack_require__(32037);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 96254:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CodeExtractorsManager: () => (/* reexport */ CodeExtractorsManager),
  DefaultMap: () => (/* reexport */ DefaultMap),
  DocumentConnectionManager: () => (/* reexport */ DocumentConnectionManager),
  EditorAdapter: () => (/* reexport */ EditorAdapter),
  FeatureManager: () => (/* reexport */ FeatureManager),
  ILSPCodeExtractorsManager: () => (/* reexport */ ILSPCodeExtractorsManager),
  ILSPDocumentConnectionManager: () => (/* reexport */ ILSPDocumentConnectionManager),
  ILSPFeatureManager: () => (/* reexport */ ILSPFeatureManager),
  ILanguageServerManager: () => (/* reexport */ ILanguageServerManager),
  IWidgetLSPAdapterTracker: () => (/* reexport */ IWidgetLSPAdapterTracker),
  LanguageServerManager: () => (/* reexport */ LanguageServerManager),
  Method: () => (/* reexport */ Method),
  ProtocolCoordinates: () => (/* reexport */ ProtocolCoordinates),
  TextForeignCodeExtractor: () => (/* reexport */ TextForeignCodeExtractor),
  UpdateManager: () => (/* reexport */ UpdateManager),
  VirtualDocument: () => (/* reexport */ VirtualDocument),
  VirtualDocumentInfo: () => (/* reexport */ VirtualDocumentInfo),
  WidgetLSPAdapter: () => (/* reexport */ WidgetLSPAdapter),
  WidgetLSPAdapterTracker: () => (/* reexport */ WidgetLSPAdapterTracker),
  collectDocuments: () => (/* reexport */ collectDocuments),
  expandDottedPaths: () => (/* reexport */ expandDottedPaths),
  expandPath: () => (/* reexport */ expandPath),
  isEqual: () => (/* reexport */ isEqual),
  isWithinRange: () => (/* reexport */ isWithinRange),
  offsetAtPosition: () => (/* reexport */ offsetAtPosition),
  positionAtOffset: () => (/* reexport */ positionAtOffset),
  sleep: () => (/* reexport */ sleep),
  untilReady: () => (/* reexport */ untilReady)
});

// EXTERNAL MODULE: ../node_modules/lodash.mergewith/index.js
var lodash_mergewith = __webpack_require__(95282);
var lodash_mergewith_default = /*#__PURE__*/__webpack_require__.n(lodash_mergewith);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/adapters/editorAdapter.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The CodeEditor.IEditor adapter.
 */
class EditorAdapter {
    /**
     * Instantiate a new EditorAdapter.
     *
     * @param options The instantiation options for a EditorAdapter.
     */
    constructor(options) {
        this._widgetAdapter = options.widgetAdapter;
        this._extensions = options.extensions;
        void options.editor.ready().then(editor => {
            this._injectExtensions(options.editor);
        });
    }
    /**
     * Dispose the handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.isDisposed = true;
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Setup the editor.
     */
    _injectExtensions(editor) {
        const codeEditor = editor.getEditor();
        if (!codeEditor || codeEditor.isDisposed) {
            return;
        }
        this._extensions.forEach(factory => {
            const ext = factory.factory({
                path: this._widgetAdapter.widget.context.path,
                editor: editor,
                widgetAdapter: this._widgetAdapter,
                model: codeEditor.model,
                inline: true
            });
            if (!ext) {
                return;
            }
            codeEditor.injectExtension(ext.instance(codeEditor));
        });
    }
}
//# sourceMappingURL=editorAdapter.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/adapters/adapter.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





const createButton = index_js_.Dialog.createButton;
/**
 * The values should follow the https://microsoft.github.io/language-server-protocol/specification guidelines
 */
const MIME_TYPE_LANGUAGE_MAP = {
    'text/x-rsrc': 'r',
    'text/x-r-source': 'r',
    // currently there are no LSP servers for IPython we are aware of
    'text/x-ipython': 'python'
};
/**
 * Foreign code: low level adapter is not aware of the presence of foreign languages;
 * it operates on the virtual document and must not attempt to infer the language dependencies
 * as this would make the logic of inspections caching impossible to maintain, thus the WidgetAdapter
 * has to handle that, keeping multiple connections and multiple virtual documents.
 */
class WidgetLSPAdapter {
    // note: it could be using namespace/IOptions pattern,
    // but I do not know how to make it work with the generic type T
    // (other than using 'any' in the IOptions interface)
    constructor(widget, options) {
        this.widget = widget;
        this.options = options;
        /**
         * Signal emitted when the adapter is connected.
         */
        this._adapterConnected = new index_es6_js_.Signal(this);
        /**
         * Signal emitted when the active editor have changed.
         */
        this._activeEditorChanged = new index_es6_js_.Signal(this);
        /**
         * Signal emitted when an editor is changed.
         */
        this._editorAdded = new index_es6_js_.Signal(this);
        /**
         * Signal emitted when an editor is removed.
         */
        this._editorRemoved = new index_es6_js_.Signal(this);
        /**
         * Signal emitted when the adapter is disposed.
         */
        this._disposed = new index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._virtualDocument = null;
        this._connectionManager = options.connectionManager;
        this._isConnected = false;
        this._trans = (options.translator || lib_index_js_.nullTranslator).load('jupyterlab');
        // set up signal connections
        this.widget.context.saveState.connect(this.onSaveState, this);
        this.connectionManager.closed.connect(this.onConnectionClosed, this);
        this.widget.disposed.connect(this.dispose, this);
        this._editorToAdapter = new WeakMap();
        this.editorAdded.connect(this._onEditorAdded, this);
        this.editorRemoved.connect(this._onEditorRemoved, this);
        this._connectionManager.languageServerManager.sessionsChanged.connect(this._onLspSessionOrFeatureChanged, this);
        this.options.featureManager.featureRegistered.connect(this._onLspSessionOrFeatureChanged, this);
    }
    /**
     * Check if the adapter is disposed
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Check if the document contains multiple editors
     */
    get hasMultipleEditors() {
        return this.editors.length > 1;
    }
    /**
     * Get the ID of the internal widget.
     */
    get widgetId() {
        return this.widget.id;
    }
    /**
     * Get the language identifier of the document
     */
    get language() {
        // the values should follow https://microsoft.github.io/language-server-protocol/specification guidelines,
        // see the table in https://microsoft.github.io/language-server-protocol/specification#textDocumentItem
        if (MIME_TYPE_LANGUAGE_MAP.hasOwnProperty(this.mimeType)) {
            return MIME_TYPE_LANGUAGE_MAP[this.mimeType];
        }
        else {
            let withoutParameters = this.mimeType.split(';')[0];
            let [type, subtype] = withoutParameters.split('/');
            if (type === 'application' || type === 'text') {
                if (subtype.startsWith('x-')) {
                    return subtype.substring(2);
                }
                else {
                    return subtype;
                }
            }
            else {
                return this.mimeType;
            }
        }
    }
    /**
     * Signal emitted when the adapter is connected.
     */
    get adapterConnected() {
        return this._adapterConnected;
    }
    /**
     * Signal emitted when the active editor have changed.
     */
    get activeEditorChanged() {
        return this._activeEditorChanged;
    }
    /**
     * Signal emitted when the adapter is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Signal emitted when the an editor is changed.
     */
    get editorAdded() {
        return this._editorAdded;
    }
    /**
     * Signal emitted when the an editor is removed.
     */
    get editorRemoved() {
        return this._editorRemoved;
    }
    /**
     * The virtual document is connected or not
     */
    get isConnected() {
        return this._isConnected;
    }
    /**
     * The LSP document and connection manager instance.
     */
    get connectionManager() {
        return this._connectionManager;
    }
    /**
     * The translator provider.
     */
    get trans() {
        return this._trans;
    }
    /**
     * Promise that resolves once the document is updated
     */
    get updateFinished() {
        return this._updateFinished;
    }
    /**
     * Internal virtual document of the adapter.
     */
    get virtualDocument() {
        return this._virtualDocument;
    }
    /**
     * Callback on connection closed event.
     */
    onConnectionClosed(_, { virtualDocument }) {
        if (virtualDocument === this.virtualDocument) {
            this.dispose();
        }
    }
    /**
     * Dispose the adapter.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this.editorAdded.disconnect(this._onEditorAdded, this);
        this.editorRemoved.disconnect(this._onEditorRemoved, this);
        this._connectionManager.languageServerManager.sessionsChanged.disconnect(this._onLspSessionOrFeatureChanged, this);
        this.options.featureManager.featureRegistered.disconnect(this._onLspSessionOrFeatureChanged, this);
        this._isDisposed = true;
        this.disconnect();
        this._virtualDocument = null;
        this._disposed.emit();
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Disconnect virtual document from the language server.
     */
    disconnect() {
        var _a, _b;
        const uri = (_a = this.virtualDocument) === null || _a === void 0 ? void 0 : _a.uri;
        const { model } = this.widget.context;
        if (uri) {
            this.connectionManager.unregisterDocument(uri);
        }
        model.contentChanged.disconnect(this._onContentChanged, this);
        // pretend that all editors were removed to trigger the disconnection of even handlers
        // they will be connected again on new connection
        for (let { ceEditor: editor } of this.editors) {
            this._editorRemoved.emit({
                editor: editor
            });
        }
        (_b = this.virtualDocument) === null || _b === void 0 ? void 0 : _b.dispose();
    }
    /**
     * Update the virtual document.
     */
    updateDocuments() {
        if (this._isDisposed) {
            console.warn('Cannot update documents: adapter disposed');
            return Promise.reject('Cannot update documents: adapter disposed');
        }
        return this.virtualDocument.updateManager.updateDocuments(this.editors);
    }
    /**
     * Callback called on the document changed event.
     */
    documentChanged(virtualDocument, document, isInit = false) {
        if (this._isDisposed) {
            console.warn('Cannot swap document: adapter disposed');
            return;
        }
        // TODO only send the difference, using connection.sendSelectiveChange()
        let connection = this.connectionManager.connections.get(virtualDocument.uri);
        if (!(connection === null || connection === void 0 ? void 0 : connection.isReady)) {
            console.log('Skipping document update signal: connection not ready');
            return;
        }
        connection.sendFullTextChange(virtualDocument.value, virtualDocument.documentInfo);
    }
    // equivalent to triggering didClose and didOpen, as per syncing specification,
    // but also reloads the connection; used during file rename (or when it was moved)
    reloadConnection() {
        // ignore premature calls (before the editor was initialized)
        if (this.virtualDocument === null) {
            return;
        }
        // disconnect all existing connections (and dispose adapters)
        this.disconnect();
        // recreate virtual document using current path and language
        // as virtual editor assumes it gets the virtual document at init,
        // just dispose virtual editor (which disposes virtual document too)
        // and re-initialize both virtual editor and document
        this.initVirtual();
        // reconnect
        this.connectDocument(this.virtualDocument, true).catch(console.warn);
    }
    /**
     * Callback on document saved event.
     */
    onSaveState(context, state) {
        // ignore premature calls (before the editor was initialized)
        if (this.virtualDocument === null) {
            return;
        }
        if (state === 'completed') {
            // note: must only be send to the appropriate connections as
            // some servers (Julia) break if they receive save notification
            // for a document that was not opened before, see:
            // https://github.com/jupyter-lsp/jupyterlab-lsp/issues/490
            const documentsToSave = [this.virtualDocument];
            for (let virtualDocument of documentsToSave) {
                let connection = this.connectionManager.connections.get(virtualDocument.uri);
                if (!connection) {
                    continue;
                }
                connection.sendSaved(virtualDocument.documentInfo);
                for (let foreign of virtualDocument.foreignDocuments.values()) {
                    documentsToSave.push(foreign);
                }
            }
        }
    }
    /**
     * Connect the virtual document with the language server.
     */
    async onConnected(data) {
        let { virtualDocument } = data;
        this._adapterConnected.emit(data);
        this._isConnected = true;
        try {
            await this.updateDocuments();
        }
        catch (reason) {
            console.warn('Could not update documents', reason);
            return;
        }
        // refresh the document on the LSP server
        this.documentChanged(virtualDocument, virtualDocument, true);
        data.connection.serverNotifications['$/logTrace'].connect((connection, message) => {
            console.log(data.connection.serverIdentifier, 'trace', virtualDocument.uri, message);
        });
        data.connection.serverNotifications['window/logMessage'].connect((connection, message) => {
            console.log(connection.serverIdentifier + ': ' + message.message);
        });
        data.connection.serverNotifications['window/showMessage'].connect((connection, message) => {
            void (0,index_js_.showDialog)({
                title: this.trans.__('Message from ') + connection.serverIdentifier,
                body: message.message
            });
        });
        data.connection.serverRequests['window/showMessageRequest'].setHandler(async (params) => {
            const actionItems = params.actions;
            const buttons = actionItems
                ? actionItems.map(action => {
                    return createButton({
                        label: action.title
                    });
                })
                : [createButton({ label: this.trans.__('Dismiss') })];
            const result = await (0,index_js_.showDialog)({
                title: this.trans.__('Message from ') + data.connection.serverIdentifier,
                body: params.message,
                buttons: buttons
            });
            const choice = buttons.indexOf(result.button);
            if (choice === -1) {
                return null;
            }
            if (actionItems) {
                return actionItems[choice];
            }
            return null;
        });
    }
    /**
     * Opens a connection for the document. The connection may or may
     * not be initialized, yet, and depending on when this is called, the client
     * may not be fully connected.
     *
     * @param virtualDocument a VirtualDocument
     * @param sendOpen whether to open the document immediately
     */
    async connectDocument(virtualDocument, sendOpen = false) {
        virtualDocument.foreignDocumentOpened.connect(this.onForeignDocumentOpened, this);
        const connectionContext = await this._connect(virtualDocument).catch(console.error);
        if (connectionContext && connectionContext.connection) {
            virtualDocument.changed.connect(this.documentChanged, this);
            if (sendOpen) {
                connectionContext.connection.sendOpenWhenReady(virtualDocument.documentInfo);
            }
        }
    }
    /**
     * Create the virtual document using current path and language.
     */
    initVirtual() {
        var _a;
        (_a = this._virtualDocument) === null || _a === void 0 ? void 0 : _a.dispose();
        this._virtualDocument = this.createVirtualDocument();
        this._onLspSessionOrFeatureChanged();
    }
    /**
     * Handler for opening a document contained in a parent document. The assumption
     * is that the editor already exists for this, and as such the document
     * should be queued for immediate opening.
     *
     * @param host the VirtualDocument that contains the VirtualDocument in another language
     * @param context information about the foreign VirtualDocument
     */
    async onForeignDocumentOpened(host, context) {
        const { foreignDocument } = context;
        await this.connectDocument(foreignDocument, true);
        foreignDocument.foreignDocumentClosed.connect(this._onForeignDocumentClosed, this);
    }
    _onEditorAdded(sender, change) {
        const { editor } = change;
        const editorAdapter = new EditorAdapter({
            editor: editor,
            widgetAdapter: this,
            extensions: this.options.featureManager.extensionFactories()
        });
        this._editorToAdapter.set(editor, editorAdapter);
    }
    _onEditorRemoved(sender, change) {
        const { editor } = change;
        const adapter = this._editorToAdapter.get(editor);
        adapter === null || adapter === void 0 ? void 0 : adapter.dispose();
        this._editorToAdapter.delete(editor);
    }
    /**
     * Callback called when a foreign document is closed,
     * the associated signals with this virtual document
     * are disconnected.
     */
    _onForeignDocumentClosed(_, context) {
        const { foreignDocument } = context;
        foreignDocument.foreignDocumentClosed.disconnect(this._onForeignDocumentClosed, this);
        foreignDocument.foreignDocumentOpened.disconnect(this.onForeignDocumentOpened, this);
        foreignDocument.changed.disconnect(this.documentChanged, this);
    }
    /**
     * Detect the capabilities for the document type then
     * open the websocket connection with the language server.
     */
    async _connect(virtualDocument) {
        let language = virtualDocument.language;
        let capabilities = {
            textDocument: {
                synchronization: {
                    dynamicRegistration: true,
                    willSave: false,
                    didSave: true,
                    willSaveWaitUntil: false
                }
            },
            workspace: {
                didChangeConfiguration: {
                    dynamicRegistration: true
                }
            }
        };
        capabilities = lodash_mergewith_default()(capabilities, this.options.featureManager.clientCapabilities());
        let options = {
            capabilities,
            virtualDocument,
            language,
            hasLspSupportedFile: virtualDocument.hasLspSupportedFile
        };
        let connection = await this.connectionManager.connect(options);
        if (connection) {
            await this.onConnected({ virtualDocument, connection });
            return {
                connection,
                virtualDocument
            };
        }
        else {
            return undefined;
        }
    }
    /**
     * Handle content changes and update all virtual documents after a change.
     *
     * #### Notes
     * Update to the state of a notebook may be done without a notice on the
     * CodeMirror level, e.g. when a cell is deleted. Therefore a
     * JupyterLab-specific signal is watched instead.
     *
     * While by not using the change event of CodeMirror editors we lose an easy
     * way to send selective (range) updates this can be still implemented by
     * comparison of before/after states of the virtual documents, which is
     * more resilient and editor-independent.
     */
    async _onContentChanged(_) {
        // Update the virtual documents.
        // Sending the updates to LSP is out of scope here.
        const promise = this.updateDocuments();
        if (!promise) {
            console.warn('Could not update documents');
            return;
        }
        this._updateFinished = promise.catch(console.warn);
        await this.updateFinished;
    }
    /**
     * Check if the virtual document should be updated on content
     * changed signal. Returns `true` if two following conditions are
     * are satisfied:
     *  - The LSP feature is enabled.
     *  - The LSP features list is not empty.
     */
    _shouldUpdateVirtualDocument() {
        const { languageServerManager } = this.connectionManager;
        return (languageServerManager.isEnabled &&
            this.options.featureManager.features.length > 0);
    }
    /**
     * Connect the virtual document update handler with the content
     * updated signal.This method is invoked at startup and when
     * the LSP server status changed or when a LSP feature is registered.
     */
    _onLspSessionOrFeatureChanged() {
        if (!this._virtualDocument) {
            return;
        }
        const { model } = this.widget.context;
        if (this._shouldUpdateVirtualDocument()) {
            model.contentChanged.connect(this._onContentChanged, this);
        }
        else {
            model.contentChanged.disconnect(this._onContentChanged, this);
        }
    }
}
//# sourceMappingURL=adapter.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/adapters/tracker.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A class that keeps track of widget adapter instances.
 *
 * @typeparam T - The type of widget being tracked. Defaults to `WidgetLSPAdapter`.
 */
class WidgetLSPAdapterTracker {
    /**
     * Create a new widget tracker.
     *
     * @param options - The instantiation options for a widget tracker.
     */
    constructor(options) {
        this._isDisposed = false;
        this._current = null;
        this._adapters = new Set();
        this._adapterAdded = new index_es6_js_.Signal(this);
        this._adapterUpdated = new index_es6_js_.Signal(this);
        this._currentChanged = new index_es6_js_.Signal(this);
        const shell = (this._shell = options.shell);
        shell.currentChanged.connect((_, args) => {
            let newValue = args.newValue;
            if (!newValue || !(newValue instanceof docregistry_lib_index_js_.DocumentWidget)) {
                return;
            }
            const adapter = this.find(value => value.widget === newValue);
            if (!adapter) {
                return;
            }
            this._current = adapter;
            this._currentChanged.emit(adapter);
        });
    }
    /**
     * A signal emitted when the current adapter changes.
     */
    get currentChanged() {
        return this._currentChanged;
    }
    /**
     * The current adapter is the most recently focused or added adapter.
     *
     * #### Notes
     * It is the most recently focused adapter, or the most recently added
     * adapter if no adapter has taken focus.
     */
    get currentAdapter() {
        return this._current;
    }
    /**
     * The number of adapter held by the tracker.
     */
    get size() {
        return this._adapters.size;
    }
    /**
     * A signal emitted when an adapter is added.
     */
    get adapterAdded() {
        return this._adapterAdded;
    }
    /**
     * A signal emitted when an adapter is updated.
     */
    get adapterUpdated() {
        return this._adapterUpdated;
    }
    /**
     * Add a new adapter to the tracker.
     *
     * @param adapter - The adapter being added.
     *
     * #### Notes.
     * The newly added adapter becomes the current adapter unless the shell
     * already had a DocumentWidget as the activeWidget.
     */
    add(adapter) {
        if (adapter.isDisposed) {
            const warning = 'A disposed object cannot be added.';
            console.warn(warning, adapter);
            throw new Error(warning);
        }
        if (this._adapters.has(adapter)) {
            const warning = 'This object already exists in the pool.';
            console.warn(warning, adapter);
            throw new Error(warning);
        }
        this._adapters.add(adapter);
        this._adapterAdded.emit(adapter);
        adapter.disposed.connect(() => {
            this._adapters.delete(adapter);
            if (adapter === this._current) {
                this._current = null;
                this._currentChanged.emit(this._current);
            }
        }, this);
        // Only update the current adapter, when there is no shell.activeWidget
        // or the active widget is not a DocumentWidget
        // We will be able to use other panels while keeping the current adapter.
        const active = this._shell.activeWidget;
        if (!active || !(active instanceof docregistry_lib_index_js_.DocumentWidget)) {
            this._current = adapter;
            this._currentChanged.emit(adapter);
        }
    }
    /**
     * Test whether the tracker is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the tracker.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._adapters.clear();
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Find the first adapter in the tracker that satisfies a filter function.
     *
     * @param fn The filter function to call on each adapter.
     *
     * #### Notes
     * If no adapter is found, the value returned is `undefined`.
     */
    find(fn) {
        const values = this._adapters.values();
        for (const value of values) {
            if (fn(value)) {
                return value;
            }
        }
        return undefined;
    }
    /**
     * Iterate through each adapter in the tracker.
     *
     * @param fn - The function to call on each adapter.
     */
    forEach(fn) {
        this._adapters.forEach(fn);
    }
    /**
     * Filter the adapter in the tracker based on a predicate.
     *
     * @param fn - The function by which to filter.
     */
    filter(fn) {
        const filtered = [];
        this.forEach(value => {
            if (fn(value)) {
                filtered.push(value);
            }
        });
        return filtered;
    }
    /**
     * Check if this tracker has the specified adapter.
     *
     * @param adapter - The adapter whose existence is being checked.
     */
    has(adapter) {
        return this._adapters.has(adapter);
    }
}
//# sourceMappingURL=tracker.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/adapters/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

var ILanguageServerManager;
(function (ILanguageServerManager) {
    /**
     * LSP endpoint prefix.
     */
    ILanguageServerManager.URL_NS = 'lsp';
})(ILanguageServerManager || (ILanguageServerManager = {}));
/**
 * @alpha
 *
 * The virtual documents and language server connections manager
 * Require this token in your extension to access the associated virtual
 * document and LS connection of opened documents.
 *
 */
const ILSPDocumentConnectionManager = new dist_index_js_.Token('@jupyterlab/lsp:ILSPDocumentConnectionManager', 'Provides the virtual documents and language server connections service.');
/**
 * @alpha
 *
 * The language server feature manager. Require this token in your extension
 * to register the client capabilities implemented by your extension.
 *
 */
const ILSPFeatureManager = new dist_index_js_.Token('@jupyterlab/lsp:ILSPFeatureManager', 'Provides the language server feature manager. This token is required to register new client capabilities.');
/**
 * @alpha
 *
 * The code extractor manager. Require this token in your extension to
 * register new code extractors. Code extractor allows creating multiple
 * virtual documents from an opened document.
 *
 */
const ILSPCodeExtractorsManager = new dist_index_js_.Token('@jupyterlab/lsp:ILSPCodeExtractorsManager', 'Provides the code extractor manager. This token is required in your extension to register code extractor allowing the creation of multiple virtual document from an opened document.');
/**
 * @alpha
 *
 * The WidgetLSPAdapter tracker. Require this token in your extension to
 * track WidgetLSPAdapters.
 *
 */
const IWidgetLSPAdapterTracker = new dist_index_js_.Token('@jupyterlab/lsp:IWidgetLSPAdapterTracker', 'Provides the WidgetLSPAdapter tracker. This token is required in your extension to track WidgetLSPAdapters.');
/**
 * Method strings are reproduced here because a non-typing import of
 * `vscode-languageserver-protocol` is ridiculously expensive.
 */
var Method;
(function (Method) {
    /** Server notifications */
    let ServerNotification;
    (function (ServerNotification) {
        ServerNotification["PUBLISH_DIAGNOSTICS"] = "textDocument/publishDiagnostics";
        ServerNotification["SHOW_MESSAGE"] = "window/showMessage";
        ServerNotification["LOG_TRACE"] = "$/logTrace";
        ServerNotification["LOG_MESSAGE"] = "window/logMessage";
    })(ServerNotification = Method.ServerNotification || (Method.ServerNotification = {}));
    /** Client notifications */
    let ClientNotification;
    (function (ClientNotification) {
        ClientNotification["DID_CHANGE"] = "textDocument/didChange";
        ClientNotification["DID_CHANGE_CONFIGURATION"] = "workspace/didChangeConfiguration";
        ClientNotification["DID_OPEN"] = "textDocument/didOpen";
        ClientNotification["DID_SAVE"] = "textDocument/didSave";
        ClientNotification["INITIALIZED"] = "initialized";
        ClientNotification["SET_TRACE"] = "$/setTrace";
    })(ClientNotification = Method.ClientNotification || (Method.ClientNotification = {}));
    /** Server requests */
    let ServerRequest;
    (function (ServerRequest) {
        ServerRequest["REGISTER_CAPABILITY"] = "client/registerCapability";
        ServerRequest["SHOW_MESSAGE_REQUEST"] = "window/showMessageRequest";
        ServerRequest["UNREGISTER_CAPABILITY"] = "client/unregisterCapability";
        ServerRequest["WORKSPACE_CONFIGURATION"] = "workspace/configuration";
    })(ServerRequest = Method.ServerRequest || (Method.ServerRequest = {}));
    /** Client requests */
    let ClientRequest;
    (function (ClientRequest) {
        ClientRequest["CODE_ACTION"] = "textDocument/codeAction";
        ClientRequest["COMPLETION"] = "textDocument/completion";
        ClientRequest["COMPLETION_ITEM_RESOLVE"] = "completionItem/resolve";
        ClientRequest["DEFINITION"] = "textDocument/definition";
        ClientRequest["DOCUMENT_COLOR"] = "textDocument/documentColor";
        ClientRequest["DOCUMENT_HIGHLIGHT"] = "textDocument/documentHighlight";
        ClientRequest["DOCUMENT_SYMBOL"] = "textDocument/documentSymbol";
        ClientRequest["HOVER"] = "textDocument/hover";
        ClientRequest["IMPLEMENTATION"] = "textDocument/implementation";
        ClientRequest["INITIALIZE"] = "initialize";
        ClientRequest["REFERENCES"] = "textDocument/references";
        ClientRequest["RENAME"] = "textDocument/rename";
        ClientRequest["SIGNATURE_HELP"] = "textDocument/signatureHelp";
        ClientRequest["TYPE_DEFINITION"] = "textDocument/typeDefinition";
        ClientRequest["LINKED_EDITING_RANGE"] = "textDocument/linkedEditingRange";
        ClientRequest["INLINE_VALUE"] = "textDocument/inlineValue";
        ClientRequest["INLAY_HINT"] = "textDocument/inlayHint";
        ClientRequest["WORKSPACE_SYMBOL"] = "workspace/symbol";
        ClientRequest["WORKSPACE_SYMBOL_RESOLVE"] = "workspaceSymbol/resolve";
        ClientRequest["FORMATTING"] = "textDocument/formatting";
        ClientRequest["RANGE_FORMATTING"] = "textDocument/rangeFormatting";
    })(ClientRequest = Method.ClientRequest || (Method.ClientRequest = {}));
})(Method || (Method = {}));
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/utils.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Helper to wait for timeout.
 *
 * @param  timeout - time out in ms
 */
async function sleep(timeout) {
    return new Promise(resolve => {
        setTimeout(() => {
            resolve();
        }, timeout);
    });
}
/**
 * Wait for an event by pooling the `isReady` function.
 */
function untilReady(isReady, maxRetrials = 35, interval = 50, intervalModifier = (i) => i) {
    return (async () => {
        let i = 0;
        while (isReady() !== true) {
            i += 1;
            if (maxRetrials !== -1 && i > maxRetrials) {
                throw Error('Too many retrials');
            }
            interval = intervalModifier(interval);
            await sleep(interval);
        }
        return isReady;
    })();
}
/**
 * Convert dotted path into dictionary.
 */
function expandDottedPaths(obj) {
    const settings = [];
    for (let key in obj) {
        const parsed = expandPath(key.split('.'), obj[key]);
        settings.push(parsed);
    }
    return lodash_mergewith_default()({}, ...settings);
}
/**
 * The docs for many language servers show settings in the
 * VSCode format, e.g.: "pyls.plugins.pyflakes.enabled"
 *
 * VSCode converts that dot notation to JSON behind the scenes,
 * as the language servers themselves don't accept that syntax.
 */
const expandPath = (path, value) => {
    const obj = Object.create(null);
    let curr = obj;
    path.forEach((prop, i) => {
        curr[prop] = Object.create(null);
        if (i === path.length - 1) {
            curr[prop] = value;
        }
        else {
            curr = curr[prop];
        }
    });
    return obj;
};
/**
 * An extended map which will create value for key on the fly.
 */
class DefaultMap extends Map {
    constructor(defaultFactory, entries) {
        super(entries);
        this.defaultFactory = defaultFactory;
    }
    get(k) {
        return this.getOrCreate(k);
    }
    getOrCreate(k, ...args) {
        if (this.has(k)) {
            return super.get(k);
        }
        else {
            let v = this.defaultFactory(k, ...args);
            this.set(k, v);
            return v;
        }
    }
}
//# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/ws-connection/server-capability-registration.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
/**
 * Register the capabilities with the server capabilities provider
 *
 * @param serverCapabilities - server capabilities provider.
 * @param registration -  capabilities to be registered.
 * @return - the new server capabilities provider
 */
function registerServerCapability(serverCapabilities, registration) {
    const serverCapabilitiesCopy = JSON.parse(JSON.stringify(serverCapabilities));
    const { method, registerOptions } = registration;
    const providerName = method.substring(13) + 'Provider';
    if (providerName) {
        if (!registerOptions) {
            serverCapabilitiesCopy[providerName] = true;
        }
        else {
            serverCapabilitiesCopy[providerName] = JSON.parse(JSON.stringify(registerOptions));
        }
    }
    else {
        console.warn('Could not register server capability.', registration);
        return null;
    }
    return serverCapabilitiesCopy;
}
/**
 * Unregister the capabilities with the server capabilities provider
 *
 * @param serverCapabilities - server capabilities provider.
 * @param registration -  capabilities to be unregistered.
 * @return - the new server capabilities provider
 */
function unregisterServerCapability(serverCapabilities, unregistration) {
    const serverCapabilitiesCopy = JSON.parse(JSON.stringify(serverCapabilities));
    const { method } = unregistration;
    const providerName = method.substring(13) + 'Provider';
    delete serverCapabilitiesCopy[providerName];
    return serverCapabilitiesCopy;
}

//# sourceMappingURL=server-capability-registration.js.map
// EXTERNAL MODULE: ../node_modules/vscode-ws-jsonrpc/lib/index.js + 7 modules
var lib = __webpack_require__(86800);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/ws-connection/ws-connection.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
// Disclaimer/acknowledgement: Fragments are based on https://github.com/wylieconlon/lsp-editor-adapter,
// which is copyright of wylieconlon and contributors and ISC licenced.
// ISC licence is, quote, "functionally equivalent to the simplified BSD and MIT licenses,
// but without language deemed unnecessary following the Berne Convention." (Wikipedia).
// Introduced modifications are BSD licenced, copyright JupyterLab development team.



class LspWsConnection {
    constructor(options) {
        /**
         * Map to track opened virtual documents..
         */
        this.openedUris = new Map();
        /**
         * The connection is connected?
         */
        this._isConnected = false;
        /**
         * The connection is initialized?
         */
        this._isInitialized = false;
        /**
         * Array of LSP callback disposables, it is used to
         * clear the callbacks when the connection is disposed.
         */
        this._disposables = [];
        this._disposed = new index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._rootUri = options.rootUri;
    }
    /**
     * Is the language server is connected?
     */
    get isConnected() {
        return this._isConnected;
    }
    /**
     * Is the language server is initialized?
     */
    get isInitialized() {
        return this._isInitialized;
    }
    /**
     * Is the language server is connected and initialized?
     */
    get isReady() {
        return this._isConnected && this._isInitialized;
    }
    /**
     * A signal emitted when the connection is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Check if the connection is disposed
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Initialize a connection over a web socket that speaks the LSP protocol
     */
    connect(socket) {
        this.socket = socket;
        (0,lib.listen)({
            webSocket: this.socket,
            logger: new lib.ConsoleLogger(),
            onConnection: (connection) => {
                connection.listen();
                this._isConnected = true;
                this.connection = connection;
                this.sendInitialize();
                const registerCapabilityDisposable = this.connection.onRequest('client/registerCapability', (params) => {
                    params.registrations.forEach((capabilityRegistration) => {
                        try {
                            this.serverCapabilities = registerServerCapability(this.serverCapabilities, capabilityRegistration);
                        }
                        catch (err) {
                            console.error(err);
                        }
                    });
                });
                this._disposables.push(registerCapabilityDisposable);
                const unregisterCapabilityDisposable = this.connection.onRequest('client/unregisterCapability', (params) => {
                    params.unregisterations.forEach((capabilityUnregistration) => {
                        this.serverCapabilities = unregisterServerCapability(this.serverCapabilities, capabilityUnregistration);
                    });
                });
                this._disposables.push(unregisterCapabilityDisposable);
                const disposable = this.connection.onClose(() => {
                    this._isConnected = false;
                });
                this._disposables.push(disposable);
            }
        });
    }
    /**
     * Close the connection
     */
    close() {
        if (this.connection) {
            this.connection.dispose();
        }
        this.openedUris.clear();
        this.socket.close();
    }
    /**
     * The initialize request telling the server which options the client supports
     */
    sendInitialize() {
        if (!this._isConnected) {
            return;
        }
        this.openedUris.clear();
        const message = this.initializeParams();
        this.connection
            .sendRequest('initialize', message)
            .then(params => {
            this.onServerInitialized(params);
        }, e => {
            console.warn('LSP websocket connection initialization failure', e);
        });
    }
    /**
     * Inform the server that the document was opened
     */
    sendOpen(documentInfo) {
        const textDocumentMessage = {
            textDocument: {
                uri: documentInfo.uri,
                languageId: documentInfo.languageId,
                text: documentInfo.text,
                version: documentInfo.version
            }
        };
        this.connection
            .sendNotification('textDocument/didOpen', textDocumentMessage)
            .catch(console.error);
        this.openedUris.set(documentInfo.uri, true);
        this.sendChange(documentInfo);
    }
    /**
     * Sends the full text of the document to the server
     */
    sendChange(documentInfo) {
        if (!this.isReady) {
            return;
        }
        if (!this.openedUris.get(documentInfo.uri)) {
            this.sendOpen(documentInfo);
            return;
        }
        const textDocumentChange = {
            textDocument: {
                uri: documentInfo.uri,
                version: documentInfo.version
            },
            contentChanges: [{ text: documentInfo.text }]
        };
        this.connection
            .sendNotification('textDocument/didChange', textDocumentChange)
            .catch(console.error);
        documentInfo.version++;
    }
    /**
     * Send save notification to the server.
     */
    sendSaved(documentInfo) {
        if (!this.isReady) {
            return;
        }
        const textDocumentChange = {
            textDocument: {
                uri: documentInfo.uri,
                version: documentInfo.version
            },
            text: documentInfo.text
        };
        this.connection
            .sendNotification('textDocument/didSave', textDocumentChange)
            .catch(console.error);
    }
    /**
     * Send configuration change to the server.
     */
    sendConfigurationChange(settings) {
        if (!this.isReady) {
            return;
        }
        this.connection
            .sendNotification('workspace/didChangeConfiguration', settings)
            .catch(console.error);
    }
    /**
     * Dispose the connection.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._disposables.forEach(disposable => {
            disposable.dispose();
        });
        this._disposed.emit();
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Callback called when the server is initialized.
     */
    onServerInitialized(params) {
        this._isInitialized = true;
        this.serverCapabilities = params.capabilities;
        this.connection.sendNotification('initialized', {}).catch(console.error);
        this.connection
            .sendNotification('workspace/didChangeConfiguration', {
            settings: {}
        })
            .catch(console.error);
    }
    /**
     * Initialization parameters to be sent to the language server.
     * Subclasses should override this when adding more features.
     */
    initializeParams() {
        return {
            capabilities: {},
            processId: null,
            rootUri: this._rootUri,
            workspaceFolders: null
        };
    }
}
//# sourceMappingURL=ws-connection.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/connection.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * Helper class to handle client request
 */
class ClientRequestHandler {
    constructor(connection, method, emitter) {
        this.connection = connection;
        this.method = method;
        this.emitter = emitter;
    }
    request(params) {
        // TODO check if is ready?
        this.emitter.log(MessageKind.clientRequested, {
            method: this.method,
            message: params
        });
        return this.connection
            .sendRequest(this.method, params)
            .then((result) => {
            this.emitter.log(MessageKind.resultForClient, {
                method: this.method,
                message: params
            });
            return result;
        });
    }
}
/**
 * Helper class to handle server responses
 */
class ServerRequestHandler {
    constructor(connection, method, emitter) {
        this.connection = connection;
        this.method = method;
        this.emitter = emitter;
        // on request accepts "thenable"
        this.connection.onRequest(method, this._handle.bind(this));
        this._handler = null;
    }
    setHandler(handler) {
        this._handler = handler;
    }
    clearHandler() {
        this._handler = null;
    }
    _handle(request) {
        this.emitter.log(MessageKind.serverRequested, {
            method: this.method,
            message: request
        });
        if (!this._handler) {
            return new Promise(() => undefined);
        }
        return this._handler(request, this.emitter).then(result => {
            this.emitter.log(MessageKind.responseForServer, {
                method: this.method,
                message: result
            });
            return result;
        });
    }
}
const Provider = {
    TEXT_DOCUMENT_SYNC: 'textDocumentSync',
    COMPLETION: 'completionProvider',
    HOVER: 'hoverProvider',
    SIGNATURE_HELP: 'signatureHelpProvider',
    DECLARATION: 'declarationProvider',
    DEFINITION: 'definitionProvider',
    TYPE_DEFINITION: 'typeDefinitionProvider',
    IMPLEMENTATION: 'implementationProvider',
    REFERENCES: 'referencesProvider',
    DOCUMENT_HIGHLIGHT: 'documentHighlightProvider',
    DOCUMENT_SYMBOL: 'documentSymbolProvider',
    CODE_ACTION: 'codeActionProvider',
    CODE_LENS: 'codeLensProvider',
    DOCUMENT_LINK: 'documentLinkProvider',
    COLOR: 'colorProvider',
    DOCUMENT_FORMATTING: 'documentFormattingProvider',
    DOCUMENT_RANGE_FORMATTING: 'documentRangeFormattingProvider',
    DOCUMENT_ON_TYPE_FORMATTING: 'documentOnTypeFormattingProvider',
    RENAME: 'renameProvider',
    FOLDING_RANGE: 'foldingRangeProvider',
    EXECUTE_COMMAND: 'executeCommandProvider',
    SELECTION_RANGE: 'selectionRangeProvider',
    WORKSPACE_SYMBOL: 'workspaceSymbolProvider',
    WORKSPACE: 'workspace'
};
/**
 * Create a map between the request method and its handler
 */
function createMethodMap(methods, handlerFactory) {
    const result = {};
    for (let method of Object.values(methods)) {
        result[method] = handlerFactory(method);
    }
    return result;
}
var MessageKind;
(function (MessageKind) {
    MessageKind[MessageKind["clientNotifiedServer"] = 0] = "clientNotifiedServer";
    MessageKind[MessageKind["serverNotifiedClient"] = 1] = "serverNotifiedClient";
    MessageKind[MessageKind["serverRequested"] = 2] = "serverRequested";
    MessageKind[MessageKind["clientRequested"] = 3] = "clientRequested";
    MessageKind[MessageKind["resultForClient"] = 4] = "resultForClient";
    MessageKind[MessageKind["responseForServer"] = 5] = "responseForServer";
})(MessageKind || (MessageKind = {}));
class LSPConnection extends LspWsConnection {
    constructor(options) {
        super(options);
        /**
         * Is the connection is closed manually?
         */
        this._closingManually = false;
        this._closeSignal = new index_es6_js_.Signal(this);
        this._errorSignal = new index_es6_js_.Signal(this);
        this._serverInitialized = new index_es6_js_.Signal(this);
        this._options = options;
        this.logAllCommunication = false;
        this.serverIdentifier = options.serverIdentifier;
        this.serverLanguage = options.languageId;
        this.documentsToOpen = [];
        this.clientNotifications =
            this.constructNotificationHandlers(Method.ClientNotification);
        this.serverNotifications =
            this.constructNotificationHandlers(Method.ServerNotification);
    }
    /**
     * Signal emitted when the connection is closed.
     */
    get closeSignal() {
        return this._closeSignal;
    }
    /**
     * Signal emitted when the connection receives an error
     * message.
     */
    get errorSignal() {
        return this._errorSignal;
    }
    /**
     * Signal emitted when the connection is initialized.
     */
    get serverInitialized() {
        return this._serverInitialized;
    }
    /**
     * Dispose the connection.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        if (this.serverRequests) {
            // `serverRequests` may be undefined if dispose is called during initialization sequence
            Object.values(this.serverRequests).forEach(request => request.clearHandler());
        }
        this.close();
        super.dispose();
    }
    /**
     * Helper to print the logs to logger, for now we are using
     * directly the browser's console.
     */
    log(kind, message) {
        if (this.logAllCommunication) {
            console.log(kind, message);
        }
    }
    /**
     * Send the open request to the backend when the server is
     * ready.
     */
    sendOpenWhenReady(documentInfo) {
        if (this.isReady) {
            this.sendOpen(documentInfo);
        }
        else {
            this.documentsToOpen.push(documentInfo);
        }
    }
    /**
     * Send the document changes to the server.
     */
    sendSelectiveChange(changeEvent, documentInfo) {
        this._sendChange([changeEvent], documentInfo);
    }
    /**
     * Send all changes to the server.
     */
    sendFullTextChange(text, documentInfo) {
        this._sendChange([{ text }], documentInfo);
    }
    /**
     * Check if a capability is available in the server capabilities.
     */
    provides(capability) {
        return !!(this.serverCapabilities && this.serverCapabilities[capability]);
    }
    /**
     * Close the connection to the server.
     */
    close() {
        try {
            this._closingManually = true;
            super.close();
        }
        catch (e) {
            this._closingManually = false;
        }
    }
    /**
     * Initialize a connection over a web socket that speaks the LSP.
     */
    connect(socket) {
        super.connect(socket);
        untilReady(() => {
            return this.isConnected;
        }, -1)
            .then(() => {
            const disposable = this.connection.onClose(() => {
                this._isConnected = false;
                this._closeSignal.emit(this._closingManually);
            });
            this._disposables.push(disposable);
        })
            .catch(() => {
            console.error('Could not connect onClose signal');
        });
    }
    /**
     * Get send request to the server to get completion results
     * from a completion item
     */
    async getCompletionResolve(completionItem) {
        if (!this.isReady) {
            return;
        }
        return this.connection.sendRequest('completionItem/resolve', completionItem);
    }
    /**
     * Generate the notification handlers
     */
    constructNotificationHandlers(methods) {
        const factory = () => new index_es6_js_.Signal(this);
        return createMethodMap(methods, factory);
    }
    /**
     * Generate the client request handler
     */
    constructClientRequestHandler(methods) {
        return createMethodMap(methods, method => new ClientRequestHandler(this.connection, method, this));
    }
    /**
     * Generate the server response handler
     */
    constructServerRequestHandler(methods) {
        return createMethodMap(methods, method => new ServerRequestHandler(this.connection, method, this));
    }
    /**
     * Initialization parameters to be sent to the language server.
     * Subclasses can overload this when adding more features.
     */
    initializeParams() {
        return {
            ...super.initializeParams(),
            capabilities: this._options.capabilities,
            initializationOptions: null,
            processId: null,
            workspaceFolders: null
        };
    }
    /**
     * Callback called when the server is initialized.
     */
    onServerInitialized(params) {
        this.afterInitialized();
        super.onServerInitialized(params);
        while (this.documentsToOpen.length) {
            this.sendOpen(this.documentsToOpen.pop());
        }
        this._serverInitialized.emit(this.serverCapabilities);
    }
    /**
     * Once the server is initialized, this method generates the
     * client and server handlers
     */
    afterInitialized() {
        const disposable = this.connection.onError(e => this._errorSignal.emit(e));
        this._disposables.push(disposable);
        for (const method of Object.values(Method.ServerNotification)) {
            const signal = this.serverNotifications[method];
            const disposable = this.connection.onNotification(method, params => {
                this.log(MessageKind.serverNotifiedClient, {
                    method,
                    message: params
                });
                signal.emit(params);
            });
            this._disposables.push(disposable);
        }
        for (const method of Object.values(Method.ClientNotification)) {
            const signal = this.clientNotifications[method];
            signal.connect((emitter, params) => {
                this.log(MessageKind.clientNotifiedServer, {
                    method,
                    message: params
                });
                this.connection.sendNotification(method, params).catch(console.error);
            });
        }
        this.clientRequests = this.constructClientRequestHandler(Method.ClientRequest);
        this.serverRequests = this.constructServerRequestHandler(Method.ServerRequest);
        this.serverRequests['client/registerCapability'].setHandler(async (params) => {
            params.registrations.forEach((capabilityRegistration) => {
                try {
                    const updatedCapabilities = registerServerCapability(this.serverCapabilities, capabilityRegistration);
                    if (updatedCapabilities === null) {
                        console.error(`Failed to register server capability: ${capabilityRegistration}`);
                        return;
                    }
                    this.serverCapabilities = updatedCapabilities;
                }
                catch (err) {
                    console.error(err);
                }
            });
        });
        this.serverRequests['client/unregisterCapability'].setHandler(async (params) => {
            params.unregisterations.forEach((capabilityUnregistration) => {
                this.serverCapabilities = unregisterServerCapability(this.serverCapabilities, capabilityUnregistration);
            });
        });
        this.serverRequests['workspace/configuration'].setHandler(async (params) => {
            return params.items.map(item => {
                // LSP: "If the client can’t provide a configuration setting for a given scope
                // then `null` needs to be present in the returned array."
                // for now we do not support configuration, but yaml server does not respect
                // client capability so we have a handler just for that
                return null;
            });
        });
    }
    /**
     * Send the document changed data to the server.
     */
    _sendChange(changeEvents, documentInfo) {
        if (!this.isReady) {
            return;
        }
        if (documentInfo.uri.length === 0) {
            return;
        }
        if (!this.openedUris.get(documentInfo.uri)) {
            this.sendOpen(documentInfo);
        }
        const textDocumentChange = {
            textDocument: {
                uri: documentInfo.uri,
                version: documentInfo.version
            },
            contentChanges: changeEvents
        };
        this.connection
            .sendNotification('textDocument/didChange', textDocumentChange)
            .catch(console.error);
        documentInfo.version++;
    }
}
//# sourceMappingURL=connection.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/connection_manager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * Each Widget with a document (whether file or a notebook) has the same DocumentConnectionManager
 * (see JupyterLabWidgetAdapter). Using id_path instead of uri led to documents being overwritten
 * as two identical id_paths could be created for two different notebooks.
 */
class DocumentConnectionManager {
    constructor(options) {
        /**
         * Fired the first time a connection is opened. These _should_ be the only
         * invocation of `.on` (once remaining LSPFeature.connection_handlers are made
         * singletons).
         */
        this.onNewConnection = (connection) => {
            const errorSignalSlot = (_, e) => {
                console.error(e);
                let error = e.length && e.length >= 1 ? e[0] : new Error();
                if (error.message.indexOf('code = 1005') !== -1) {
                    console.error(`Connection failed for ${connection}`);
                    this._forEachDocumentOfConnection(connection, virtualDocument => {
                        console.error('disconnecting ' + virtualDocument.uri);
                        this._closed.emit({ connection, virtualDocument });
                        this._ignoredLanguages.add(virtualDocument.language);
                        console.error(`Cancelling further attempts to connect ${virtualDocument.uri} and other documents for this language (no support from the server)`);
                    });
                }
                else if (error.message.indexOf('code = 1006') !== -1) {
                    console.error('Connection closed by the server');
                }
                else {
                    console.error('Connection error:', e);
                }
            };
            connection.errorSignal.connect(errorSignalSlot);
            const serverInitializedSlot = () => {
                // Initialize using settings stored in the SettingRegistry
                this._forEachDocumentOfConnection(connection, virtualDocument => {
                    // TODO: is this still necessary, e.g. for status bar to update responsively?
                    this._initialized.emit({ connection, virtualDocument });
                });
                this.updateServerConfigurations(this.initialConfigurations);
            };
            connection.serverInitialized.connect(serverInitializedSlot);
            const closeSignalSlot = (_, closedManually) => {
                if (!closedManually) {
                    console.error('Connection unexpectedly disconnected');
                }
                else {
                    console.log('Connection closed');
                    this._forEachDocumentOfConnection(connection, virtualDocument => {
                        this._closed.emit({ connection, virtualDocument });
                    });
                }
            };
            connection.closeSignal.connect(closeSignalSlot);
        };
        this._initialized = new index_es6_js_.Signal(this);
        this._connected = new index_es6_js_.Signal(this);
        this._disconnected = new index_es6_js_.Signal(this);
        this._closed = new index_es6_js_.Signal(this);
        this._documentsChanged = new index_es6_js_.Signal(this);
        this.connections = new Map();
        this.documents = new Map();
        this.adapters = new Map();
        this._ignoredLanguages = new Set();
        this.languageServerManager = options.languageServerManager;
        Private.setLanguageServerManager(options.languageServerManager);
        options.adapterTracker.adapterAdded.connect((_, adapter) => {
            const path = adapter.widget.context.path;
            this.registerAdapter(path, adapter);
        });
    }
    /**
     * Signal emitted when the manager is initialized.
     */
    get initialized() {
        return this._initialized;
    }
    /**
     * Signal emitted when the manager is connected to the server
     */
    get connected() {
        return this._connected;
    }
    /**
     * Connection temporarily lost or could not be fully established; a re-connection will be attempted;
     */
    get disconnected() {
        return this._disconnected;
    }
    /**
     * Connection was closed permanently and no-reconnection will be attempted, e.g.:
     *  - there was a serious server error
     *  - user closed the connection,
     *  - re-connection attempts exceeded,
     */
    get closed() {
        return this._closed;
    }
    /**
     * Signal emitted when the document is changed.
     */
    get documentsChanged() {
        return this._documentsChanged;
    }
    /**
     * Promise resolved when the language server manager is ready.
     */
    get ready() {
        return Private.getLanguageServerManager().ready;
    }
    /**
     * Helper to connect various virtual document signal with callbacks of
     * this class.
     *
     * @param  virtualDocument - virtual document to be connected.
     */
    connectDocumentSignals(virtualDocument) {
        virtualDocument.foreignDocumentOpened.connect(this.onForeignDocumentOpened, this);
        virtualDocument.foreignDocumentClosed.connect(this.onForeignDocumentClosed, this);
        this.documents.set(virtualDocument.uri, virtualDocument);
        this._documentsChanged.emit(this.documents);
    }
    /**
     * Helper to disconnect various virtual document signal with callbacks of
     * this class.
     *
     * @param  virtualDocument - virtual document to be disconnected.
     */
    disconnectDocumentSignals(virtualDocument, emit = true) {
        virtualDocument.foreignDocumentOpened.disconnect(this.onForeignDocumentOpened, this);
        virtualDocument.foreignDocumentClosed.disconnect(this.onForeignDocumentClosed, this);
        this.documents.delete(virtualDocument.uri);
        for (const foreign of virtualDocument.foreignDocuments.values()) {
            this.disconnectDocumentSignals(foreign, false);
        }
        if (emit) {
            this._documentsChanged.emit(this.documents);
        }
    }
    /**
     * Handle foreign document opened event.
     */
    onForeignDocumentOpened(_host, context) {
        /** no-op */
    }
    /**
     * Handle foreign document closed event.
     */
    onForeignDocumentClosed(_host, context) {
        const { foreignDocument } = context;
        this.unregisterDocument(foreignDocument.uri, false);
        this.disconnectDocumentSignals(foreignDocument);
    }
    /**
     * @deprecated
     *
     * Register a widget adapter with this manager
     *
     * @param  path - path to the inner document of the adapter
     * @param  adapter - the adapter to be registered
     */
    registerAdapter(path, adapter) {
        this.adapters.set(path, adapter);
        adapter.widget.context.pathChanged.connect((context, newPath) => {
            this.adapters.delete(path);
            this.adapters.set(newPath, adapter);
        });
        adapter.disposed.connect(() => {
            if (adapter.virtualDocument) {
                this.documents.delete(adapter.virtualDocument.uri);
            }
            this.adapters.delete(path);
        });
    }
    /**
     * Handles the settings that do not require an existing connection
     * with a language server (or can influence to which server the
     * connection will be created, e.g. `rank`).
     *
     * This function should be called **before** initialization of servers.
     */
    updateConfiguration(allServerSettings) {
        this.languageServerManager.setConfiguration(allServerSettings);
    }
    /**
     * Handles the settings that the language servers accept using
     * `onDidChangeConfiguration` messages, which should be passed under
     * the "serverSettings" keyword in the setting registry.
     * Other configuration options are handled by `updateConfiguration` instead.
     *
     * This function should be called **after** initialization of servers.
     */
    updateServerConfigurations(allServerSettings) {
        let languageServerId;
        for (languageServerId in allServerSettings) {
            if (!allServerSettings.hasOwnProperty(languageServerId)) {
                continue;
            }
            const rawSettings = allServerSettings[languageServerId];
            const parsedSettings = expandDottedPaths(rawSettings.configuration || {});
            const serverSettings = {
                settings: parsedSettings
            };
            Private.updateServerConfiguration(languageServerId, serverSettings);
        }
    }
    /**
     * Retry to connect to the server each `reconnectDelay` seconds
     * and for `retrialsLeft` times.
     * TODO: presently no longer referenced. A failing connection would close
     * the socket, triggering the language server on the other end to exit.
     */
    async retryToConnect(options, reconnectDelay, retrialsLeft = -1) {
        let { virtualDocument } = options;
        if (this._ignoredLanguages.has(virtualDocument.language)) {
            return;
        }
        let interval = reconnectDelay * 1000;
        let success = false;
        while (retrialsLeft !== 0 && !success) {
            await this.connect(options)
                .then(() => {
                success = true;
            })
                .catch(e => {
                console.warn(e);
            });
            console.log('will attempt to re-connect in ' + interval / 1000 + ' seconds');
            await sleep(interval);
            // gradually increase the time delay, up to 5 sec
            interval = interval < 5 * 1000 ? interval + 500 : interval;
        }
    }
    /**
     * Disconnect the connection to the language server of the requested
     * language.
     */
    disconnect(languageId) {
        Private.disconnect(languageId);
    }
    /**
     * Create a new connection to the language server
     * @return A promise of the LSP connection
     */
    async connect(options, firstTimeoutSeconds = 30, secondTimeoutMinutes = 5) {
        let connection = await this._connectSocket(options);
        let { virtualDocument } = options;
        if (!connection) {
            return;
        }
        if (!connection.isReady) {
            try {
                // user feedback hinted that 40 seconds was too short and some users are willing to wait more;
                // to make the best of both worlds we first check frequently (6.6 times a second) for the first
                // 30 seconds, and show the warning early in case if something is wrong; we then continue retrying
                // for another 5 minutes, but only once per second.
                await untilReady(() => connection.isReady, Math.round((firstTimeoutSeconds * 1000) / 150), 150);
            }
            catch (_a) {
                console.log(`Connection to ${virtualDocument.uri} timed out after ${firstTimeoutSeconds} seconds, will continue retrying for another ${secondTimeoutMinutes} minutes`);
                try {
                    await untilReady(() => connection.isReady, 60 * secondTimeoutMinutes, 1000);
                }
                catch (_b) {
                    console.log(`Connection to ${virtualDocument.uri} timed out again after ${secondTimeoutMinutes} minutes, giving up`);
                    return;
                }
            }
        }
        this._connected.emit({ connection, virtualDocument });
        return connection;
    }
    /**
     * Disconnect the signals of requested virtual document URI.
     */
    unregisterDocument(uri, emit = true) {
        const connection = this.connections.get(uri);
        if (connection) {
            this.connections.delete(uri);
            const allConnection = new Set(this.connections.values());
            if (!allConnection.has(connection)) {
                this.disconnect(connection.serverIdentifier);
                connection.dispose();
            }
            if (emit) {
                this._documentsChanged.emit(this.documents);
            }
        }
    }
    /**
     * Enable or disable the logging of language server communication.
     */
    updateLogging(logAllCommunication, setTrace) {
        for (const connection of this.connections.values()) {
            connection.logAllCommunication = logAllCommunication;
            if (setTrace !== null) {
                connection.clientNotifications['$/setTrace'].emit({ value: setTrace });
            }
        }
    }
    /**
     * Create the LSP connection for requested virtual document.
     *
     * @return  Return the promise of the LSP connection.
     */
    async _connectSocket(options) {
        let { language, capabilities, virtualDocument } = options;
        this.connectDocumentSignals(virtualDocument);
        const uris = DocumentConnectionManager.solveUris(virtualDocument, language);
        const matchingServers = this.languageServerManager.getMatchingServers({
            language
        });
        // for now use only the server with the highest rank.
        const languageServerId = matchingServers.length === 0 ? null : matchingServers[0];
        // lazily load 1) the underlying library (1.5mb) and/or 2) a live WebSocket-
        // like connection: either already connected or potentially in the process
        // of connecting.
        if (!uris) {
            return;
        }
        const connection = await Private.connection(language, languageServerId, uris, this.onNewConnection, capabilities);
        // if connecting for the first time, all documents subsequent documents will
        // be re-opened and synced
        this.connections.set(virtualDocument.uri, connection);
        return connection;
    }
    /**
     * Helper to apply callback on all documents of a connection.
     */
    _forEachDocumentOfConnection(connection, callback) {
        for (const [virtualDocumentUri, currentConnection] of this.connections.entries()) {
            if (connection !== currentConnection) {
                continue;
            }
            callback(this.documents.get(virtualDocumentUri));
        }
    }
}
(function (DocumentConnectionManager) {
    /**
     * Generate the URI of a virtual document from input
     *
     * @param  virtualDocument - the virtual document
     * @param  language - language of the document
     */
    function solveUris(virtualDocument, language) {
        var _a;
        const serverManager = Private.getLanguageServerManager();
        const wsBase = serverManager.settings.wsUrl;
        const rootUri = coreutils_lib_index_js_.PageConfig.getOption('rootUri');
        const virtualDocumentsUri = coreutils_lib_index_js_.PageConfig.getOption('virtualDocumentsUri');
        // for now take the best match only
        const serverOptions = {
            language
        };
        const matchingServers = serverManager.getMatchingServers(serverOptions);
        const languageServerId = matchingServers.length === 0 ? null : matchingServers[0];
        if (languageServerId === null) {
            return;
        }
        const specs = serverManager.getMatchingSpecs(serverOptions);
        const spec = specs.get(languageServerId);
        if (!spec) {
            console.warn(`Specification not available for server ${languageServerId}`);
        }
        const requiresOnDiskFiles = (_a = spec === null || spec === void 0 ? void 0 : spec.requires_documents_on_disk) !== null && _a !== void 0 ? _a : true;
        const supportsInMemoryFiles = !requiresOnDiskFiles;
        const baseUri = virtualDocument.hasLspSupportedFile || supportsInMemoryFiles
            ? rootUri
            : virtualDocumentsUri;
        // workaround url-parse bug(s) (see https://github.com/jupyter-lsp/jupyterlab-lsp/issues/595)
        let documentUri = coreutils_lib_index_js_.URLExt.join(baseUri, virtualDocument.uri);
        if (!documentUri.startsWith('file:///') &&
            documentUri.startsWith('file://')) {
            documentUri = documentUri.replace('file://', 'file:///');
            if (documentUri.startsWith('file:///users/') &&
                baseUri.startsWith('file:///Users/')) {
                documentUri = documentUri.replace('file:///users/', 'file:///Users/');
            }
        }
        return {
            base: baseUri,
            document: documentUri,
            server: coreutils_lib_index_js_.URLExt.join('ws://jupyter-lsp', language),
            socket: coreutils_lib_index_js_.URLExt.join(wsBase, 'lsp', 'ws', languageServerId)
        };
    }
    DocumentConnectionManager.solveUris = solveUris;
})(DocumentConnectionManager || (DocumentConnectionManager = {}));
/**
 * Namespace primarily for language-keyed cache of LSPConnections
 */
var Private;
(function (Private) {
    const _connections = new Map();
    let _languageServerManager;
    function getLanguageServerManager() {
        return _languageServerManager;
    }
    Private.getLanguageServerManager = getLanguageServerManager;
    function setLanguageServerManager(languageServerManager) {
        _languageServerManager = languageServerManager;
    }
    Private.setLanguageServerManager = setLanguageServerManager;
    function disconnect(languageServerId) {
        const connection = _connections.get(languageServerId);
        if (connection) {
            connection.close();
            _connections.delete(languageServerId);
        }
    }
    Private.disconnect = disconnect;
    /**
     * Return (or create and initialize) the WebSocket associated with the language
     */
    async function connection(language, languageServerId, uris, onCreate, capabilities) {
        let connection = _connections.get(languageServerId);
        if (!connection) {
            const { settings } = Private.getLanguageServerManager();
            const socket = new settings.WebSocket(uris.socket);
            const connection = new LSPConnection({
                languageId: language,
                serverUri: uris.server,
                rootUri: uris.base,
                serverIdentifier: languageServerId,
                capabilities: capabilities
            });
            _connections.set(languageServerId, connection);
            connection.connect(socket);
            onCreate(connection);
        }
        connection = _connections.get(languageServerId);
        return connection;
    }
    Private.connection = connection;
    function updateServerConfiguration(languageServerId, settings) {
        const connection = _connections.get(languageServerId);
        if (connection) {
            connection.sendConfigurationChange(settings);
        }
    }
    Private.updateServerConfiguration = updateServerConfiguration;
})(Private || (Private = {}));
//# sourceMappingURL=connection_manager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/extractors/manager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * Manager for the code extractors
 */
class CodeExtractorsManager {
    constructor() {
        this._extractorMap = new Map();
        this._extractorMapAnyLanguage = new Map();
    }
    /**
     * Get the extractors for the input cell type and the main language of
     * the document
     *
     * @param  cellType - type of cell
     * @param  hostLanguage - main language of the document
     */
    getExtractors(cellType, hostLanguage) {
        var _a, _b;
        if (hostLanguage) {
            const currentMap = this._extractorMap.get(cellType);
            if (!currentMap) {
                return [];
            }
            return (_a = currentMap.get(hostLanguage)) !== null && _a !== void 0 ? _a : [];
        }
        else {
            return (_b = this._extractorMapAnyLanguage.get(cellType)) !== null && _b !== void 0 ? _b : [];
        }
    }
    /**
     * Register an extractor to extract foreign code from host documents of specified language.
     */
    register(extractor, hostLanguage) {
        const cellType = extractor.cellType;
        if (hostLanguage) {
            cellType.forEach(type => {
                if (!this._extractorMap.has(type)) {
                    this._extractorMap.set(type, new Map());
                }
                const currentMap = this._extractorMap.get(type);
                const extractorList = currentMap.get(hostLanguage);
                if (!extractorList) {
                    currentMap.set(hostLanguage, [extractor]);
                }
                else {
                    extractorList.push(extractor);
                }
            });
        }
        else {
            cellType.forEach(type => {
                if (!this._extractorMapAnyLanguage.has(type)) {
                    this._extractorMapAnyLanguage.set(type, []);
                }
                this._extractorMapAnyLanguage.get(type).push(extractor);
            });
        }
    }
}
//# sourceMappingURL=manager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/positioning.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * Compare two `IPosition` variable.
 *
 */
function isEqual(self, other) {
    return other && self.line === other.line && self.ch === other.ch;
}
/**
 * Given a list of line and an offset from the start, compute the corresponding
 * position in form of line and column number
 *
 * @param offset - number of spaces counted from the start of first line
 * @param  lines - list of lines to compute the position
 * @return  - the position of cursor
 */
function positionAtOffset(offset, lines) {
    let line = 0;
    let column = 0;
    for (let textLine of lines) {
        // each line has a new line symbol which is accounted for in offset!
        if (textLine.length + 1 <= offset) {
            offset -= textLine.length + 1;
            line += 1;
        }
        else {
            column = offset;
            break;
        }
    }
    return { line, column };
}
/**
 * Given a list of line and position in form of line and column number,
 * compute the offset from the start of first line.
 * @param position - position of cursor
 * @param  lines - list of lines to compute the position
 * @param linesIncludeBreaks - should count the line break as space?
 * return - offset number
 */
function offsetAtPosition(position, lines, linesIncludeBreaks = false) {
    let breakIncrement = linesIncludeBreaks ? 0 : 1;
    let offset = 0;
    for (let i = 0; i < lines.length; i++) {
        let textLine = lines[i];
        if (position.line > i) {
            offset += textLine.length + breakIncrement;
        }
        else {
            offset += position.column;
            break;
        }
    }
    return offset;
}
var ProtocolCoordinates;
(function (ProtocolCoordinates) {
    /**
     * Check if the position is in the input range
     *
     * @param position - position in form of line and character number.
     * @param  range - range in from of start and end position.
     */
    function isWithinRange(position, range) {
        const { line, character } = position;
        return (line >= range.start.line &&
            line <= range.end.line &&
            // need to be non-overlapping see https://github.com/jupyter-lsp/jupyterlab-lsp/issues/628
            (line != range.start.line || character > range.start.character) &&
            (line != range.end.line || character <= range.end.character));
    }
    ProtocolCoordinates.isWithinRange = isWithinRange;
})(ProtocolCoordinates || (ProtocolCoordinates = {}));
//# sourceMappingURL=positioning.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/extractors/text_extractor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The code extractor for the raw and markdown text.
 */
class TextForeignCodeExtractor {
    constructor(options) {
        this.language = options.language;
        this.standalone = options.isStandalone;
        this.fileExtension = options.file_extension;
        this.cellType = options.cellType;
    }
    /**
     * Test if there is any foreign code in provided code snippet.
     */
    hasForeignCode(code, cellType) {
        return this.cellType.includes(cellType);
    }
    /**
     * Split the code into the host and foreign code (if any foreign code was detected)
     */
    extractForeignCode(code) {
        let lines = code.split('\n');
        let extracts = new Array();
        let foreignCodeFragment = code;
        let start = positionAtOffset(0, lines);
        let end = positionAtOffset(foreignCodeFragment.length, lines);
        extracts.push({
            hostCode: '',
            foreignCode: foreignCodeFragment,
            range: { start, end },
            virtualShift: null
        });
        return extracts;
    }
}
//# sourceMappingURL=text_extractor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/extractors/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/feature.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * Class to manager the registered features of the language servers.
 */
class FeatureManager {
    constructor() {
        /**
         * List of registered features
         */
        this.features = [];
        this._featureRegistered = new index_es6_js_.Signal(this);
    }
    /**
     * Signal emitted when a new feature is registered.
     */
    get featureRegistered() {
        return this._featureRegistered;
    }
    /**
     * Register a new feature, skip if it is already registered.
     */
    register(feature) {
        if (this.features.some(ft => ft.id === feature.id)) {
            console.warn(`Feature with id ${feature.id} is already registered, skipping.`);
        }
        else {
            this.features.push(feature);
            this._featureRegistered.emit(feature);
        }
    }
    /**
     * Get the capabilities of all clients.
     */
    clientCapabilities() {
        let capabilities = {};
        for (const feature of this.features) {
            if (!feature.capabilities) {
                continue;
            }
            capabilities = lodash_mergewith_default()(capabilities, feature.capabilities);
        }
        return capabilities;
    }
    /**
     * Get the extension factories of all clients.
     */
    extensionFactories() {
        const factories = [];
        for (const feature of this.features) {
            if (!feature.extensionFactory) {
                continue;
            }
            factories.push(feature.extensionFactory);
        }
        return factories;
    }
}
//# sourceMappingURL=feature.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/manager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





class LanguageServerManager {
    constructor(options) {
        /**
         * map of language server sessions.
         */
        this._sessions = new Map();
        /**
         * Map of language server specs.
         */
        this._specs = new Map();
        /**
         * Set of emitted warning message, message in this set will not be warned again.
         */
        this._warningsEmitted = new Set();
        /**
         * A promise resolved when this server manager is ready.
         */
        this._ready = new dist_index_js_.PromiseDelegate();
        /**
         * Signal emitted when a  language server session is changed
         */
        this._sessionsChanged = new index_es6_js_.Signal(this);
        this._isDisposed = false;
        /**
         * Check if the manager is enabled or disabled
         */
        this._enabled = true;
        this._settings = options.settings || services_lib_index_js_.ServerConnection.makeSettings();
        this._baseUrlOverride = options.baseUrl;
        this._retries = options.retries || 2;
        this._retriesInterval = options.retriesInterval || 10000;
        this._statusCode = -1;
        this._configuration = {};
        this.fetchSessions().catch(e => console.log(e));
    }
    /**
     * Check if the manager is enabled or disabled
     */
    get isEnabled() {
        return this._enabled;
    }
    /**
     * Check if the manager is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Get server connection settings.
     */
    get settings() {
        return this._settings;
    }
    /**
     * Get the language server specs.
     */
    get specs() {
        return this._specs;
    }
    /**
     * Get the status end point.
     */
    get statusUrl() {
        return coreutils_lib_index_js_.URLExt.join(this._baseUrl, ILanguageServerManager.URL_NS, 'status');
    }
    /**
     * Signal emitted when a  language server session is changed
     */
    get sessionsChanged() {
        return this._sessionsChanged;
    }
    /**
     * Get the map of language server sessions.
     */
    get sessions() {
        return this._sessions;
    }
    /**
     * A promise resolved when this server manager is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Get the status code of server's responses.
     */
    get statusCode() {
        return this._statusCode;
    }
    /**
     * Enable the language server services
     */
    async enable() {
        this._enabled = true;
        await this.fetchSessions();
    }
    /**
     * Disable the language server services
     */
    disable() {
        this._enabled = false;
        this._sessions = new Map();
        this._sessionsChanged.emit(void 0);
    }
    /**
     * Dispose the manager.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Update the language server configuration.
     */
    setConfiguration(configuration) {
        this._configuration = configuration;
    }
    /**
     * Get matching language server for input language option.
     */
    getMatchingServers(options) {
        if (!options.language) {
            console.error('Cannot match server by language: language not available; ensure that kernel and specs provide language and MIME type');
            return [];
        }
        const matchingSessionsKeys = [];
        for (const [key, session] of this._sessions.entries()) {
            if (this.isMatchingSpec(options, session.spec)) {
                matchingSessionsKeys.push(key);
            }
        }
        return matchingSessionsKeys.sort(this.compareRanks.bind(this));
    }
    /**
     * Get matching language server spec for input language option.
     */
    getMatchingSpecs(options) {
        const result = new Map();
        for (const [key, specification] of this._specs.entries()) {
            if (this.isMatchingSpec(options, specification)) {
                result.set(key, specification);
            }
        }
        return result;
    }
    /**
     * Fetch the server session list from the status endpoint. The server
     * manager is ready once this method finishes.
     */
    async fetchSessions() {
        if (!this._enabled) {
            return;
        }
        let response = await services_lib_index_js_.ServerConnection.makeRequest(this.statusUrl, { method: 'GET' }, this._settings);
        this._statusCode = response.status;
        if (!response.ok) {
            if (this._retries > 0) {
                this._retries -= 1;
                setTimeout(this.fetchSessions.bind(this), this._retriesInterval);
            }
            else {
                this._ready.resolve(undefined);
                console.log('Missing jupyter_lsp server extension, skipping.');
            }
            return;
        }
        let sessions;
        try {
            const data = await response.json();
            sessions = data.sessions;
            try {
                this.version = data.version;
                this._specs = new Map(Object.entries(data.specs));
            }
            catch (err) {
                console.warn(err);
            }
        }
        catch (err) {
            console.warn(err);
            this._ready.resolve(undefined);
            return;
        }
        for (let key of Object.keys(sessions)) {
            let id = key;
            if (this._sessions.has(id)) {
                Object.assign(this._sessions.get(id) || {}, sessions[key]);
            }
            else {
                this._sessions.set(id, sessions[key]);
            }
        }
        const oldKeys = this._sessions.keys();
        for (const oldKey in oldKeys) {
            if (!sessions[oldKey]) {
                let oldId = oldKey;
                this._sessions.delete(oldId);
            }
        }
        this._sessionsChanged.emit(void 0);
        this._ready.resolve(undefined);
    }
    /**
     * Check if input language option maths the language server spec.
     */
    isMatchingSpec(options, spec) {
        // most things speak language
        // if language is not known, it is guessed based on MIME type earlier
        // so some language should be available by now (which can be not so obvious, e.g. "plain" for txt documents)
        const lowerCaseLanguage = options.language.toLocaleLowerCase();
        return spec.languages.some((language) => language.toLocaleLowerCase() == lowerCaseLanguage);
    }
    /**
     * Helper function to warn a message only once.
     */
    warnOnce(arg) {
        if (!this._warningsEmitted.has(arg)) {
            this._warningsEmitted.add(arg);
            console.warn(arg);
        }
    }
    /**
     * Compare the rank of two servers with the same language.
     */
    compareRanks(a, b) {
        var _a, _b, _c, _d;
        const DEFAULT_RANK = 50;
        const aRank = (_b = (_a = this._configuration[a]) === null || _a === void 0 ? void 0 : _a.rank) !== null && _b !== void 0 ? _b : DEFAULT_RANK;
        const bRank = (_d = (_c = this._configuration[b]) === null || _c === void 0 ? void 0 : _c.rank) !== null && _d !== void 0 ? _d : DEFAULT_RANK;
        if (aRank == bRank) {
            this.warnOnce(`Two matching servers: ${a} and ${b} have the same rank; choose which one to use by changing the rank in Advanced Settings Editor`);
            return a.localeCompare(b);
        }
        // higher rank = higher in the list (descending order)
        return bRank - aRank;
    }
    /**
     * Get the base URL for language server requests.
     */
    get _baseUrl() {
        return this._baseUrlOverride || this._settings.baseUrl;
    }
}
//# sourceMappingURL=manager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/virtual/document.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Check if given position is within range.
 * Both start and end are inclusive.
 * @param position
 * @param range
 */
function isWithinRange(position, range) {
    if (range.start.line === range.end.line) {
        return (position.line === range.start.line &&
            position.column >= range.start.column &&
            position.column <= range.end.column);
    }
    return ((position.line === range.start.line &&
        position.column >= range.start.column &&
        position.line < range.end.line) ||
        (position.line > range.start.line &&
            position.column <= range.end.column &&
            position.line === range.end.line) ||
        (position.line > range.start.line && position.line < range.end.line));
}
/**
 * A virtual implementation of IDocumentInfo
 */
class VirtualDocumentInfo {
    /**
     * Creates an instance of VirtualDocumentInfo.
     * @param document - the virtual document need to
     * be wrapped.
     */
    constructor(document) {
        /**
         * Current version of the virtual document.
         */
        this.version = 0;
        this._document = document;
    }
    /**
     * Get the text content of the virtual document.
     */
    get text() {
        return this._document.value;
    }
    /**
     * Get the uri of the virtual document, if the document is not available,
     * it returns an empty string, users need to check for the length of returned
     * value before using it.
     */
    get uri() {
        const uris = DocumentConnectionManager.solveUris(this._document, this.languageId);
        if (!uris) {
            return '';
        }
        return uris.document;
    }
    /**
     * Get the language identifier of the document.
     */
    get languageId() {
        return this._document.language;
    }
}
/**
 *
 * A notebook can hold one or more virtual documents; there is always one,
 * "root" document, corresponding to the language of the kernel. All other
 * virtual documents are extracted out of the notebook, based on magics,
 * or other syntax constructs, depending on the kernel language.
 *
 * Virtual documents represent the underlying code in a single language,
 * which has been parsed excluding interactive kernel commands (magics)
 * which could be misunderstood by the specific LSP server.
 *
 * VirtualDocument has no awareness of the notebook or editor it lives in,
 * however it is able to transform its content back to the notebook space,
 * as it keeps editor coordinates for each virtual line.
 *
 * The notebook/editor aware transformations are preferred to be placed in
 * VirtualEditor descendants rather than here.
 *
 * No dependency on editor implementation (such as CodeMirrorEditor)
 * is allowed for VirtualEditor.
 */
class VirtualDocument {
    constructor(options) {
        /**
         * Number of blank lines appended to the virtual document between
         * each cell.
         */
        this.blankLinesBetweenCells = 2;
        this._isDisposed = false;
        this._foreignDocumentClosed = new index_es6_js_.Signal(this);
        this._foreignDocumentOpened = new index_es6_js_.Signal(this);
        this._changed = new index_es6_js_.Signal(this);
        this.options = options;
        this.path = this.options.path;
        this.fileExtension = options.fileExtension;
        this.hasLspSupportedFile = options.hasLspSupportedFile;
        this.parent = options.parent;
        this.language = options.language;
        this.virtualLines = new Map();
        this.sourceLines = new Map();
        this.foreignDocuments = new Map();
        this._editorToSourceLine = new Map();
        this._foreignCodeExtractors = options.foreignCodeExtractors;
        this.standalone = options.standalone || false;
        this.instanceId = VirtualDocument.instancesCount;
        VirtualDocument.instancesCount += 1;
        this.unusedStandaloneDocuments = new DefaultMap(() => new Array());
        this._remainingLifetime = 6;
        this.documentInfo = new VirtualDocumentInfo(this);
        this.updateManager = new UpdateManager(this);
        this.updateManager.updateBegan.connect(this._updateBeganSlot, this);
        this.updateManager.blockAdded.connect(this._blockAddedSlot, this);
        this.updateManager.updateFinished.connect(this._updateFinishedSlot, this);
        this.clear();
    }
    /**
     * Convert from code editor position into code mirror position.
     */
    static ceToCm(position) {
        return { line: position.line, ch: position.column };
    }
    /**
     * Test whether the document is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Signal emitted when the foreign document is closed
     */
    get foreignDocumentClosed() {
        return this._foreignDocumentClosed;
    }
    /**
     * Signal emitted when the foreign document is opened
     */
    get foreignDocumentOpened() {
        return this._foreignDocumentOpened;
    }
    /**
     * Signal emitted when the foreign document is changed
     */
    get changed() {
        return this._changed;
    }
    /**
     * Id of the virtual document.
     */
    get virtualId() {
        // for easier debugging, the language information is included in the ID:
        return this.standalone
            ? this.instanceId + '(' + this.language + ')'
            : this.language;
    }
    /**
     * Return the ancestry to this document.
     */
    get ancestry() {
        if (!this.parent) {
            return [this];
        }
        return this.parent.ancestry.concat([this]);
    }
    /**
     * Return the id path to the virtual document.
     */
    get idPath() {
        if (!this.parent) {
            return this.virtualId;
        }
        return this.parent.idPath + '-' + this.virtualId;
    }
    /**
     * Get the uri of the virtual document.
     */
    get uri() {
        const encodedPath = encodeURI(this.path);
        if (!this.parent) {
            return encodedPath;
        }
        return encodedPath + '.' + this.idPath + '.' + this.fileExtension;
    }
    /**
     * Get the text value of the document
     */
    get value() {
        let linesPadding = '\n'.repeat(this.blankLinesBetweenCells);
        return this.lineBlocks.join(linesPadding);
    }
    /**
     * Get the last line in the virtual document
     */
    get lastLine() {
        const linesInLastBlock = this.lineBlocks[this.lineBlocks.length - 1].split('\n');
        return linesInLastBlock[linesInLastBlock.length - 1];
    }
    /**
     * Get the root document of current virtual document.
     */
    get root() {
        return this.parent ? this.parent.root : this;
    }
    /**
     * Dispose the virtual document.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.parent = null;
        this.closeAllForeignDocuments();
        this.updateManager.dispose();
        // clear all the maps
        this.foreignDocuments.clear();
        this.sourceLines.clear();
        this.unusedStandaloneDocuments.clear();
        this.virtualLines.clear();
        // just to be sure - if anything is accessed after disposal (it should not) we
        // will get altered by errors in the console AND this will limit memory leaks
        this.documentInfo = null;
        this.lineBlocks = null;
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Clear the virtual document and all related stuffs
     */
    clear() {
        this.unusedStandaloneDocuments.clear();
        for (let document of this.foreignDocuments.values()) {
            document.clear();
            if (document.standalone) {
                let set = this.unusedStandaloneDocuments.get(document.language);
                set.push(document);
            }
        }
        this.virtualLines.clear();
        this.sourceLines.clear();
        this.lastVirtualLine = 0;
        this.lastSourceLine = 0;
        this.lineBlocks = [];
    }
    /**
     * Get the virtual document from the cursor position of the source
     * document
     * @param position - position in source document
     */
    documentAtSourcePosition(position) {
        let sourceLine = this.sourceLines.get(position.line);
        if (!sourceLine) {
            return this;
        }
        let sourcePositionCe = {
            line: sourceLine.editorLine,
            column: position.ch
        };
        for (let [range, { virtualDocument: document }] of sourceLine.foreignDocumentsMap) {
            if (isWithinRange(sourcePositionCe, range)) {
                let sourcePositionCm = {
                    line: sourcePositionCe.line - range.start.line,
                    ch: sourcePositionCe.column - range.start.column
                };
                return document.documentAtSourcePosition(sourcePositionCm);
            }
        }
        return this;
    }
    /**
     * Detect if the input source position is belong to the current
     * virtual document.
     *
     * @param sourcePosition - position in the source document
     */
    isWithinForeign(sourcePosition) {
        let sourceLine = this.sourceLines.get(sourcePosition.line);
        let sourcePositionCe = {
            line: sourceLine.editorLine,
            column: sourcePosition.ch
        };
        for (let [range] of sourceLine.foreignDocumentsMap) {
            if (isWithinRange(sourcePositionCe, range)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Compute the position in root document from the position of
     * a child editor.
     *
     * @param editor - the active editor.
     * @param position - position in the active editor.
     */
    transformFromEditorToRoot(editor, position) {
        if (!this._editorToSourceLine.has(editor)) {
            console.log('Editor not found in _editorToSourceLine map');
            return null;
        }
        let shift = this._editorToSourceLine.get(editor);
        return {
            ...position,
            line: position.line + shift
        };
    }
    /**
     * Compute the position in the virtual document from the position
     * if the source document.
     *
     * @param sourcePosition - position in source document
     */
    virtualPositionAtDocument(sourcePosition) {
        let sourceLine = this.sourceLines.get(sourcePosition.line);
        if (sourceLine == null) {
            throw new Error('Source line not mapped to virtual position');
        }
        let virtualLine = sourceLine.virtualLine;
        // position inside the cell (block)
        let sourcePositionCe = {
            line: sourceLine.editorLine,
            column: sourcePosition.ch
        };
        for (let [range, content] of sourceLine.foreignDocumentsMap) {
            const { virtualLine, virtualDocument: document } = content;
            if (isWithinRange(sourcePositionCe, range)) {
                // position inside the foreign document block
                let sourcePositionCm = {
                    line: sourcePositionCe.line - range.start.line,
                    ch: sourcePositionCe.column - range.start.column
                };
                if (document.isWithinForeign(sourcePositionCm)) {
                    return this.virtualPositionAtDocument(sourcePositionCm);
                }
                else {
                    // where in this block in the entire foreign document?
                    sourcePositionCm.line += virtualLine;
                    return sourcePositionCm;
                }
            }
        }
        return {
            ch: sourcePosition.ch,
            line: virtualLine
        };
    }
    /**
     * Append a code block to the end of the virtual document.
     *
     * @param  block - block to be appended
     * @param  editorShift - position shift in source
     * document
     * @param  [virtualShift] - position shift in
     * virtual document.
     */
    appendCodeBlock(block, editorShift = { line: 0, column: 0 }, virtualShift) {
        let cellCode = block.value;
        let ceEditor = block.ceEditor;
        if (this.isDisposed) {
            console.warn('Cannot append code block: document disposed');
            return;
        }
        let sourceCellLines = cellCode.split('\n');
        let { lines, foreignDocumentsMap } = this.prepareCodeBlock(block, editorShift);
        for (let i = 0; i < lines.length; i++) {
            this.virtualLines.set(this.lastVirtualLine + i, {
                skipInspect: [],
                editor: ceEditor,
                // TODO this is incorrect, won't work if something was extracted
                sourceLine: this.lastSourceLine + i
            });
        }
        for (let i = 0; i < sourceCellLines.length; i++) {
            this.sourceLines.set(this.lastSourceLine + i, {
                editorLine: i,
                editorShift: {
                    line: editorShift.line - ((virtualShift === null || virtualShift === void 0 ? void 0 : virtualShift.line) || 0),
                    column: i === 0 ? editorShift.column - ((virtualShift === null || virtualShift === void 0 ? void 0 : virtualShift.column) || 0) : 0
                },
                // TODO: move those to a new abstraction layer (DocumentBlock class)
                editor: ceEditor,
                foreignDocumentsMap,
                // TODO this is incorrect, won't work if something was extracted
                virtualLine: this.lastVirtualLine + i
            });
        }
        this.lastVirtualLine += lines.length;
        // one empty line is necessary to separate code blocks, next 'n' lines are to silence linters;
        // the final cell does not get the additional lines (thanks to the use of join, see below)
        this.lineBlocks.push(lines.join('\n') + '\n');
        // adding the virtual lines for the blank lines
        for (let i = 0; i < this.blankLinesBetweenCells; i++) {
            this.virtualLines.set(this.lastVirtualLine + i, {
                skipInspect: [this.idPath],
                editor: ceEditor,
                sourceLine: null
            });
        }
        this.lastVirtualLine += this.blankLinesBetweenCells;
        this.lastSourceLine += sourceCellLines.length;
    }
    /**
     * Extract a code block into list of string in supported language and
     * a map of foreign document if any.
     * @param  block - block to be appended
     * @param  editorShift - position shift in source document
     */
    prepareCodeBlock(block, editorShift = { line: 0, column: 0 }) {
        let { cellCodeKept, foreignDocumentsMap } = this.extractForeignCode(block, editorShift);
        let lines = cellCodeKept.split('\n');
        return { lines, foreignDocumentsMap };
    }
    /**
     * Extract the foreign code from input block by using the registered
     * extractors.
     * @param  block - block to be appended
     * @param  editorShift - position shift in source document
     */
    extractForeignCode(block, editorShift) {
        let foreignDocumentsMap = new Map();
        let cellCode = block.value;
        const extractorsForAnyLang = this._foreignCodeExtractors.getExtractors(block.type, null);
        const extractorsForCurrentLang = this._foreignCodeExtractors.getExtractors(block.type, this.language);
        for (let extractor of [
            ...extractorsForAnyLang,
            ...extractorsForCurrentLang
        ]) {
            if (!extractor.hasForeignCode(cellCode, block.type)) {
                continue;
            }
            let results = extractor.extractForeignCode(cellCode);
            let keptCellCode = '';
            for (let result of results) {
                if (result.foreignCode !== null) {
                    // result.range should only be null if result.foregin_code is null
                    if (result.range === null) {
                        console.log('Failure in foreign code extraction: `range` is null but `foreign_code` is not!');
                        continue;
                    }
                    let foreignDocument = this._chooseForeignDocument(extractor);
                    foreignDocumentsMap.set(result.range, {
                        virtualLine: foreignDocument.lastVirtualLine,
                        virtualDocument: foreignDocument,
                        editor: block.ceEditor
                    });
                    let foreignShift = {
                        line: editorShift.line + result.range.start.line,
                        column: editorShift.column + result.range.start.column
                    };
                    foreignDocument.appendCodeBlock({
                        value: result.foreignCode,
                        ceEditor: block.ceEditor,
                        type: 'code'
                    }, foreignShift, result.virtualShift);
                }
                if (result.hostCode != null) {
                    keptCellCode += result.hostCode;
                }
            }
            // not breaking - many extractors are allowed to process the code, one after each other
            // (think JS and CSS in HTML, or %R inside of %%timeit).
            cellCode = keptCellCode;
        }
        return { cellCodeKept: cellCode, foreignDocumentsMap };
    }
    /**
     * Close a foreign document and disconnect all associated signals
     */
    closeForeign(document) {
        this._foreignDocumentClosed.emit({
            foreignDocument: document,
            parentHost: this
        });
        // remove it from foreign documents list
        this.foreignDocuments.delete(document.virtualId);
        // and delete the documents within it
        document.closeAllForeignDocuments();
        document.foreignDocumentClosed.disconnect(this.forwardClosedSignal, this);
        document.foreignDocumentOpened.disconnect(this.forwardOpenedSignal, this);
        document.dispose();
    }
    /**
     * Close all foreign documents.
     */
    closeAllForeignDocuments() {
        for (let document of this.foreignDocuments.values()) {
            this.closeForeign(document);
        }
    }
    /**
     * Close all expired documents.
     */
    closeExpiredDocuments() {
        const usedDocuments = new Set();
        for (const line of this.sourceLines.values()) {
            for (const block of line.foreignDocumentsMap.values()) {
                usedDocuments.add(block.virtualDocument);
            }
        }
        const documentIDs = new Map();
        for (const [id, document] of this.foreignDocuments.entries()) {
            const ids = documentIDs.get(document);
            if (typeof ids !== 'undefined') {
                documentIDs.set(document, [...ids, id]);
            }
            documentIDs.set(document, [id]);
        }
        const allDocuments = new Set(documentIDs.keys());
        const unusedVirtualDocuments = new Set([...allDocuments].filter(x => !usedDocuments.has(x)));
        for (let document of unusedVirtualDocuments.values()) {
            document.remainingLifetime -= 1;
            if (document.remainingLifetime <= 0) {
                document.dispose();
                const ids = documentIDs.get(document);
                for (const id of ids) {
                    this.foreignDocuments.delete(id);
                }
            }
        }
    }
    /**
     * Transform the position of the source to the editor
     * position.
     *
     * @param  pos - position in the source document
     * @return position in the editor.
     */
    transformSourceToEditor(pos) {
        let sourceLine = this.sourceLines.get(pos.line);
        let editorLine = sourceLine.editorLine;
        let editorShift = sourceLine.editorShift;
        return {
            // only shift column in the line beginning the virtual document (first list of the editor in cell magics, but might be any line of editor in line magics!)
            ch: pos.ch + (editorLine === 0 ? editorShift.column : 0),
            line: editorLine + editorShift.line
            // TODO or:
            //  line: pos.line + editor_shift.line - this.first_line_of_the_block(editor)
        };
    }
    /**
     * Transform the position in the virtual document to the
     * editor position.
     * Can be null because some lines are added as padding/anchors
     * to the virtual document and those do not exist in the source document
     * and thus they are absent in the editor.
     */
    transformVirtualToEditor(virtualPosition) {
        let sourcePosition = this.transformVirtualToSource(virtualPosition);
        if (sourcePosition == null) {
            return null;
        }
        return this.transformSourceToEditor(sourcePosition);
    }
    /**
     * Transform the position in the virtual document to the source.
     * Can be null because some lines are added as padding/anchors
     * to the virtual document and those do not exist in the source document.
     */
    transformVirtualToSource(position) {
        const line = this.virtualLines.get(position.line).sourceLine;
        if (line == null) {
            return null;
        }
        return {
            ch: position.ch,
            line: line
        };
    }
    /**
     * Compute the position in root document from the position of
     * a virtual document.
     */
    transformVirtualToRoot(position) {
        var _a;
        const editor = (_a = this.virtualLines.get(position.line)) === null || _a === void 0 ? void 0 : _a.editor;
        const editorPosition = this.transformVirtualToEditor(position);
        if (!editor || !editorPosition) {
            return null;
        }
        return this.root.transformFromEditorToRoot(editor, editorPosition);
    }
    /**
     * Get the corresponding editor of the virtual line.
     */
    getEditorAtVirtualLine(pos) {
        let line = pos.line;
        // tolerate overshot by one (the hanging blank line at the end)
        if (!this.virtualLines.has(line)) {
            line -= 1;
        }
        return this.virtualLines.get(line).editor;
    }
    /**
     * Get the corresponding editor of the source line
     */
    getEditorAtSourceLine(pos) {
        return this.sourceLines.get(pos.line).editor;
    }
    /**
     * Recursively emits changed signal from the document or any descendant foreign document.
     */
    maybeEmitChanged() {
        if (this.value !== this.previousValue) {
            this._changed.emit(this);
        }
        this.previousValue = this.value;
        for (let document of this.foreignDocuments.values()) {
            document.maybeEmitChanged();
        }
    }
    /**
     * When this counter goes down to 0, the document will be destroyed and the associated connection will be closed;
     * This is meant to reduce the number of open connections when a foreign code snippet was removed from the document.
     *
     * Note: top level virtual documents are currently immortal (unless killed by other means); it might be worth
     * implementing culling of unused documents, but if and only if JupyterLab will also implement culling of
     * idle kernels - otherwise the user experience could be a bit inconsistent, and we would need to invent our own rules.
     */
    get remainingLifetime() {
        if (!this.parent) {
            return Infinity;
        }
        return this._remainingLifetime;
    }
    set remainingLifetime(value) {
        if (this.parent) {
            this._remainingLifetime = value;
        }
    }
    /**
     * Get the foreign document that can be opened with the input extractor.
     */
    _chooseForeignDocument(extractor) {
        let foreignDocument;
        // if not standalone, try to append to existing document
        let foreignExists = this.foreignDocuments.has(extractor.language);
        if (!extractor.standalone && foreignExists) {
            foreignDocument = this.foreignDocuments.get(extractor.language);
        }
        else {
            // if (previous document does not exists) or (extractor produces standalone documents
            // and no old standalone document could be reused): create a new document
            let unusedStandalone = this.unusedStandaloneDocuments.get(extractor.language);
            if (extractor.standalone && unusedStandalone.length > 0) {
                foreignDocument = unusedStandalone.pop();
            }
            else {
                foreignDocument = this.openForeign(extractor.language, extractor.standalone, extractor.fileExtension);
            }
        }
        return foreignDocument;
    }
    /**
     * Create a foreign document from input language and file extension.
     *
     * @param  language - the required language
     * @param  standalone - the document type is supported natively by LSP?
     * @param  fileExtension - File extension.
     */
    openForeign(language, standalone, fileExtension) {
        let document = new this.constructor({
            ...this.options,
            parent: this,
            standalone: standalone,
            fileExtension: fileExtension,
            language: language
        });
        const context = {
            foreignDocument: document,
            parentHost: this
        };
        this._foreignDocumentOpened.emit(context);
        // pass through any future signals
        document.foreignDocumentClosed.connect(this.forwardClosedSignal, this);
        document.foreignDocumentOpened.connect(this.forwardOpenedSignal, this);
        this.foreignDocuments.set(document.virtualId, document);
        return document;
    }
    /**
     * Forward the closed signal from the foreign document to the host document's
     * signal
     */
    forwardClosedSignal(host, context) {
        this._foreignDocumentClosed.emit(context);
    }
    /**
     * Forward the opened signal from the foreign document to the host document's
     * signal
     */
    forwardOpenedSignal(host, context) {
        this._foreignDocumentOpened.emit(context);
    }
    /**
     * Slot of the `updateBegan` signal.
     */
    _updateBeganSlot() {
        this._editorToSourceLineNew = new Map();
    }
    /**
     * Slot of the `blockAdded` signal.
     */
    _blockAddedSlot(updateManager, blockData) {
        this._editorToSourceLineNew.set(blockData.block.ceEditor, blockData.virtualDocument.lastSourceLine);
    }
    /**
     * Slot of the `updateFinished` signal.
     */
    _updateFinishedSlot() {
        this._editorToSourceLine = this._editorToSourceLineNew;
    }
}
VirtualDocument.instancesCount = 0;
/**
 * Create foreign documents if available from input virtual documents.
 * @param virtualDocument - the virtual document to be collected
 * @return - Set of generated foreign documents
 */
function collectDocuments(virtualDocument) {
    let collected = new Set();
    collected.add(virtualDocument);
    for (let foreign of virtualDocument.foreignDocuments.values()) {
        let foreignLanguages = collectDocuments(foreign);
        foreignLanguages.forEach(collected.add, collected);
    }
    return collected;
}
class UpdateManager {
    constructor(virtualDocument) {
        this.virtualDocument = virtualDocument;
        this._isDisposed = false;
        /**
         * Promise resolved when the updating process finishes.
         */
        this._updateDone = new Promise(resolve => {
            resolve();
        });
        /**
         * Virtual documents update guard.
         */
        this._isUpdateInProgress = false;
        /**
         * Update lock to prevent multiple updates are applied at the same time.
         */
        this._updateLock = false;
        this._blockAdded = new index_es6_js_.Signal(this);
        this._documentUpdated = new index_es6_js_.Signal(this);
        this._updateBegan = new index_es6_js_.Signal(this);
        this._updateFinished = new index_es6_js_.Signal(this);
        this.documentUpdated.connect(this._onUpdated, this);
    }
    /**
     * Promise resolved when the updating process finishes.
     */
    get updateDone() {
        return this._updateDone;
    }
    /**
     * Test whether the document is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Signal emitted when a code block is added to the document.
     */
    get blockAdded() {
        return this._blockAdded;
    }
    /**
     * Signal emitted by the editor that triggered the update,
     * providing the root document of the updated documents.
     */
    get documentUpdated() {
        return this._documentUpdated;
    }
    /**
     * Signal emitted when the update is started
     */
    get updateBegan() {
        return this._updateBegan;
    }
    /**
     * Signal emitted when the update is finished
     */
    get updateFinished() {
        return this._updateFinished;
    }
    /**
     * Dispose the class
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.documentUpdated.disconnect(this._onUpdated);
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Execute provided callback within an update-locked context, which guarantees that:
     *  - the previous updates must have finished before the callback call, and
     *  - no update will happen when executing the callback
     * @param fn - the callback to execute in update lock
     */
    async withUpdateLock(fn) {
        await untilReady(() => this._canUpdate(), 12, 10).then(() => {
            try {
                this._updateLock = true;
                fn();
            }
            finally {
                this._updateLock = false;
            }
        });
    }
    /**
     * Update all the virtual documents, emit documents updated with root document if succeeded,
     * and resolve a void promise. The promise does not contain the text value of the root document,
     * as to avoid an easy trap of ignoring the changes in the virtual documents.
     */
    async updateDocuments(blocks) {
        let update = new Promise((resolve, reject) => {
            // defer the update by up to 50 ms (10 retrials * 5 ms break),
            // awaiting for the previous update to complete.
            untilReady(() => this._canUpdate(), 10, 5)
                .then(() => {
                if (this.isDisposed || !this.virtualDocument) {
                    resolve();
                }
                try {
                    this._isUpdateInProgress = true;
                    this._updateBegan.emit(blocks);
                    this.virtualDocument.clear();
                    for (let codeBlock of blocks) {
                        this._blockAdded.emit({
                            block: codeBlock,
                            virtualDocument: this.virtualDocument
                        });
                        this.virtualDocument.appendCodeBlock(codeBlock);
                    }
                    this._updateFinished.emit(blocks);
                    if (this.virtualDocument) {
                        this._documentUpdated.emit(this.virtualDocument);
                        this.virtualDocument.maybeEmitChanged();
                    }
                    resolve();
                }
                catch (e) {
                    console.warn('Documents update failed:', e);
                    reject(e);
                }
                finally {
                    this._isUpdateInProgress = false;
                }
            })
                .catch(console.error);
        });
        this._updateDone = update;
        return update;
    }
    /**
     * Once all the foreign documents were refreshed, the unused documents (and their connections)
     * should be terminated if their lifetime has expired.
     */
    _onUpdated(manager, rootDocument) {
        try {
            rootDocument.closeExpiredDocuments();
        }
        catch (e) {
            console.warn('Failed to close expired documents');
        }
    }
    /**
     * Check if the document can be updated.
     */
    _canUpdate() {
        return !this.isDisposed && !this._isUpdateInProgress && !this._updateLock;
    }
}
//# sourceMappingURL=document.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/lsp/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module lsp
 */










//# sourceMappingURL=index.js.map

/***/ }),

/***/ 27844:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_codeeditor_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7526);
/* harmony import */ var _jupyterlab_codemirror_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32871);
/* harmony import */ var _jupyterlab_docregistry_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30507);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 60545:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CommandIDs: () => (/* binding */ lib_CommandIDs),
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/mainmenu@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/mainmenu/lib/index.js)
var mainmenu_lib_index_js_ = __webpack_require__(38911);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docmanager@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/docmanager/lib/index.js)
var docmanager_lib_index_js_ = __webpack_require__(64009);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/filebrowser@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/filebrowser/lib/index.js)
var filebrowser_lib_index_js_ = __webpack_require__(29543);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu-extension/lib/recents.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */








const PLUGIN_ID = '@jupyterlab/mainmenu-extension:recents';
/**
 * A namespace for command IDs.
 */
var CommandIDs;
(function (CommandIDs) {
    /**
     * Open a recent document or directory
     */
    CommandIDs.openRecent = 'recentmenu:open-recent';
    /**
     * Reopen recently closed tab
     */
    CommandIDs.reopenLast = 'recentmenu:reopen-last';
    /**
     * Clear recent documents and directories (implemented in docmanager)
     */
    CommandIDs.clearRecents = 'docmanager:clear-recents';
})(CommandIDs || (CommandIDs = {}));
/**
 * Recents submenu
 *
 * It will trigger validation onBeforeAttach.
 */
class RecentsMenu extends dist_index_es6_js_.Menu {
    constructor(options) {
        super(options);
        this._manager = options.manager;
        this._showDirectories = options.showDirectories;
        this.updateItems();
        this._manager.changed.connect(this.updateItems, this);
    }
    async _validateRecentlyOpened() {
        return void Promise.all(this._manager.recentlyOpened.map(recent => this._manager.validate(recent)));
    }
    onBeforeAttach(msg) {
        const timeout = new dist_index_js_.PromiseDelegate();
        setTimeout(() => {
            timeout.reject('Recents validation timed out.');
        }, 550);
        Promise.race([timeout.promise, this._validateRecentlyOpened()])
            .then(() => {
            this.update();
        })
            .catch(() => {
            // no-op
        });
        super.onBeforeAttach(msg);
    }
    updateItems() {
        // We cannot edit the item list on the fly because it will close
        // the menu - so we use `isEnabled` in the command and trigger a
        // UI update to emulate that; while `isVisible` would work too,
        // that could cause the user to mis-clicks when items move around
        // because another item was hidden.
        this.clearItems();
        this.addItem({
            command: CommandIDs.reopenLast
        });
        this.addItem({ type: 'separator' });
        let addSeparator = true;
        let anyDirectory = false;
        this._manager.recentlyOpened
            .sort((a, b) => {
            if (a.contentType === b.contentType) {
                return 0;
            }
            else {
                return a.contentType !== 'directory' ? 1 : -1;
            }
        })
            .forEach((recent) => {
            const isDirectory = recent.contentType === 'directory';
            if (isDirectory) {
                if (!this._showDirectories) {
                    return;
                }
                anyDirectory = true;
            }
            else if (addSeparator && anyDirectory) {
                addSeparator = false;
                this.addItem({ type: 'separator' });
            }
            this.addItem({
                command: CommandIDs.openRecent,
                args: { recent }
            });
        });
        this.addItem({ type: 'separator' });
        this.addItem({
            command: CommandIDs.clearRecents
        });
    }
}
/**
 * Add recent files and directories to sub-menu.
 */
const recentsMenuPlugin = {
    id: PLUGIN_ID,
    description: 'Adds sub-menu for opening recent documents to the File section of the main menu.',
    autoStart: true,
    requires: [docmanager_lib_index_js_.IRecentsManager, mainmenu_lib_index_js_.IMainMenu],
    optional: [filebrowser_lib_index_js_.IFileBrowserCommands, translation_lib_index_js_.ITranslator],
    activate: (app, recentsManager, mainMenu, fileBrowserCommands, translator) => {
        const { commands } = app;
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        // Do not show directories if the file browser is not present
        const showDirectories = fileBrowserCommands !== null;
        const validate = async (recent) => {
            // If path is not found, validating will remove it
            const isValid = await recentsManager.validate(recent);
            if (!isValid) {
                await (0,lib_index_js_.showErrorMessage)(trans.__('Could Not Open Recent'), trans.__('%1 is no longer valid and will be removed from the list', recent.path));
            }
            return isValid;
        };
        // Commands
        commands.addCommand(CommandIDs.openRecent, {
            execute: async (args) => {
                const recent = args.recent;
                const path = recent.path === '' ? '/' : recent.path;
                const isValid = await validate(recent);
                if (!isValid) {
                    return;
                }
                if (fileBrowserCommands && recent.contentType === 'directory') {
                    // Note: prefer file browser (if available) to allow opening directories
                    await commands.execute(fileBrowserCommands.openPath, { path });
                }
                else {
                    await commands.execute('docmanager:open', {
                        path,
                        factory: recent.factory
                    });
                }
            },
            label: args => {
                const recent = args.recent;
                if (recent) {
                    return coreutils_lib_index_js_.PathExt.joinWithLeadingSlash(recent.root, recent.path);
                }
                else {
                    return trans.__('Open a Recent Document (given by `recent` argument)');
                }
            },
            isEnabled: args => recentsManager.recentlyOpened.includes(args.recent),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        recent: {
                            type: 'object',
                            description: trans.__('Recent document to open')
                        }
                    }
                }
            }
        });
        app.commands.addCommand(CommandIDs.reopenLast, {
            execute: async () => {
                const recent = recentsManager.recentlyClosed[0];
                if (!recent) {
                    return;
                }
                const isValid = await validate(recent);
                if (!isValid) {
                    return;
                }
                await commands.execute('docmanager:open', {
                    path: recent.path,
                    factory: recent.factory
                });
                recentsManager.removeRecent(recent, 'closed');
            },
            label: () => {
                const recent = recentsManager.recentlyClosed[0];
                return recent
                    ? trans.__('Reopen %1', recent.path)
                    : trans.__('Reopen Closed Document');
            },
            isEnabled: () => {
                return recentsManager.recentlyClosed.length !== 0;
            },
            caption: trans.__('Reopen recently closed file or notebook.'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        // Menu
        const submenu = new RecentsMenu({
            commands,
            manager: recentsManager,
            showDirectories
        });
        submenu.title.label = trans.__('Open Recent');
        mainMenu.fileMenu.addItem({
            type: 'submenu',
            submenu,
            rank: 1
        });
    }
};
//# sourceMappingURL=recents.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module mainmenu-extension
 */












const lib_PLUGIN_ID = '@jupyterlab/mainmenu-extension:plugin';
/**
 * A namespace for command IDs of semantic extension points.
 */
var lib_CommandIDs;
(function (CommandIDs) {
    CommandIDs.openEdit = 'editmenu:open';
    CommandIDs.undo = 'editmenu:undo';
    CommandIDs.redo = 'editmenu:redo';
    CommandIDs.clearCurrent = 'editmenu:clear-current';
    CommandIDs.clearAll = 'editmenu:clear-all';
    CommandIDs.find = 'editmenu:find';
    CommandIDs.goToLine = 'editmenu:go-to-line';
    CommandIDs.openFile = 'filemenu:open';
    CommandIDs.closeAndCleanup = 'filemenu:close-and-cleanup';
    CommandIDs.createConsole = 'filemenu:create-console';
    CommandIDs.shutdown = 'filemenu:shutdown';
    CommandIDs.logout = 'filemenu:logout';
    CommandIDs.openKernel = 'kernelmenu:open';
    CommandIDs.interruptKernel = 'kernelmenu:interrupt';
    CommandIDs.reconnectToKernel = 'kernelmenu:reconnect-to-kernel';
    CommandIDs.restartKernel = 'kernelmenu:restart';
    CommandIDs.restartKernelAndClear = 'kernelmenu:restart-and-clear';
    CommandIDs.changeKernel = 'kernelmenu:change';
    CommandIDs.shutdownKernel = 'kernelmenu:shutdown';
    CommandIDs.shutdownAllKernels = 'kernelmenu:shutdownAll';
    CommandIDs.openView = 'viewmenu:open';
    CommandIDs.wordWrap = 'viewmenu:word-wrap';
    CommandIDs.lineNumbering = 'viewmenu:line-numbering';
    CommandIDs.minimap = 'viewmenu:show-minimap';
    CommandIDs.matchBrackets = 'viewmenu:match-brackets';
    CommandIDs.openRun = 'runmenu:open';
    CommandIDs.run = 'runmenu:run';
    CommandIDs.runAll = 'runmenu:run-all';
    CommandIDs.restartAndRunAll = 'runmenu:restart-and-run-all';
    CommandIDs.runAbove = 'runmenu:run-above';
    CommandIDs.runBelow = 'runmenu:run-below';
    CommandIDs.openTabs = 'tabsmenu:open';
    CommandIDs.activateById = 'tabsmenu:activate-by-id';
    CommandIDs.activatePreviouslyUsedTab = 'tabsmenu:activate-previously-used-tab';
    CommandIDs.openSettings = 'settingsmenu:open';
    CommandIDs.openHelp = 'helpmenu:open';
    CommandIDs.getKernel = 'helpmenu:get-kernel';
    CommandIDs.openFirst = 'mainmenu:open-first';
})(lib_CommandIDs || (lib_CommandIDs = {}));
/**
 * A service providing an interface to the main menu.
 */
const lib_plugin = {
    id: lib_PLUGIN_ID,
    description: 'Adds and provides the application main menu.',
    requires: [index_js_.IRouter, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ICommandPalette, index_js_.ILabShell, settingregistry_lib_index_js_.ISettingRegistry],
    provides: mainmenu_lib_index_js_.IMainMenu,
    activate: async (app, router, translator, palette, labShell, registry) => {
        const { commands } = app;
        const trans = translator.load('jupyterlab');
        const menu = new mainmenu_lib_index_js_.MainMenu(commands);
        menu.id = 'jp-MainMenu';
        menu.addClass('jp-scrollbar-tiny');
        // Built menu from settings
        if (registry) {
            await Private.loadSettingsMenu(registry, (aMenu) => {
                menu.addMenu(aMenu, false, { rank: aMenu.rank });
            }, options => mainmenu_lib_index_js_.MainMenu.generateMenu(commands, options, trans), translator);
            // Trigger single update
            menu.update();
        }
        // Only add quit button if the back-end supports it by checking page config.
        const quitButton = coreutils_lib_index_js_.PageConfig.getOption('quitButton').toLowerCase();
        menu.fileMenu.quitEntry = quitButton === 'true';
        // Create the application menus.
        createEditMenu(app, menu.editMenu, trans);
        createFileMenu(app, menu.fileMenu, router, trans);
        createKernelMenu(app, menu.kernelMenu, trans);
        createRunMenu(app, menu.runMenu, trans);
        createViewMenu(app, menu.viewMenu, trans);
        createHelpMenu(app, menu.helpMenu, trans);
        // The tabs menu relies on lab shell functionality.
        if (labShell) {
            createTabsMenu(app, menu.tabsMenu, labShell, trans);
        }
        // Create commands to open the main application menus.
        const activateMenu = (item) => {
            menu.activeMenu = item;
            menu.openActiveMenu();
        };
        commands.addCommand(lib_CommandIDs.openEdit, {
            label: trans.__('Open Edit Menu'),
            execute: () => activateMenu(menu.editMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openFile, {
            label: trans.__('Open File Menu'),
            execute: () => activateMenu(menu.fileMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openKernel, {
            label: trans.__('Open Kernel Menu'),
            execute: () => activateMenu(menu.kernelMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openRun, {
            label: trans.__('Open Run Menu'),
            execute: () => activateMenu(menu.runMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openView, {
            label: trans.__('Open View Menu'),
            execute: () => activateMenu(menu.viewMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openSettings, {
            label: trans.__('Open Settings Menu'),
            execute: () => activateMenu(menu.settingsMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openTabs, {
            label: trans.__('Open Tabs Menu'),
            execute: () => activateMenu(menu.tabsMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openHelp, {
            label: trans.__('Open Help Menu'),
            execute: () => activateMenu(menu.helpMenu),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        commands.addCommand(lib_CommandIDs.openFirst, {
            label: trans.__('Open First Menu'),
            execute: () => {
                menu.activeIndex = 0;
                menu.openActiveMenu();
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        if (palette) {
            // Add some of the commands defined here to the command palette.
            palette.addItem({
                command: lib_CommandIDs.shutdown,
                category: trans.__('Main Area')
            });
            palette.addItem({
                command: lib_CommandIDs.logout,
                category: trans.__('Main Area')
            });
            palette.addItem({
                command: lib_CommandIDs.shutdownAllKernels,
                category: trans.__('Kernel Operations')
            });
            palette.addItem({
                command: lib_CommandIDs.activatePreviouslyUsedTab,
                category: trans.__('Main Area')
            });
        }
        app.shell.add(menu, 'menu', { rank: 100 });
        return menu;
    }
};
/**
 * Create the basic `Edit` menu.
 */
function createEditMenu(app, menu, trans) {
    const { commands, shell } = app;
    // Add the undo/redo commands the the Edit menu.
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.undo,
        commands,
        shell,
        semanticCommands: menu.undoers.undo,
        default: {
            label: trans.__('Undo')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.redo,
        commands,
        shell,
        semanticCommands: menu.undoers.redo,
        default: {
            label: trans.__('Redo')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    // Add the clear commands to the Edit menu.
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.clearCurrent,
        commands,
        shell,
        semanticCommands: menu.clearers.clearCurrent,
        default: {
            label: trans.__('Clear')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.clearAll,
        commands,
        shell,
        semanticCommands: menu.clearers.clearAll,
        default: {
            label: trans.__('Clear All')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.goToLine,
        commands,
        shell,
        semanticCommands: menu.goToLiners,
        default: {
            label: trans.__('Go to Line…')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
}
/**
 * Create the basic `File` menu.
 */
function createFileMenu(app, menu, router, trans) {
    const { commands, shell } = app;
    // Add a delegator command for closing and cleaning up an activity.
    // This one is a bit different, in that we consider it enabled
    // even if it cannot find a delegate for the activity.
    // In that case, we instead call the application `close` command.
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.closeAndCleanup,
        commands,
        shell,
        semanticCommands: menu.closeAndCleaners,
        default: {
            execute: 'application:close',
            label: trans.__('Close and Shut Down'),
            isEnabled: true
        },
        overrides: {
            isEnabled: () => !!app.shell.currentWidget && !!app.shell.currentWidget.title.closable,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    // Add a delegator command for creating a console for an activity.
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.createConsole,
        commands,
        shell,
        semanticCommands: menu.consoleCreators,
        default: {
            label: trans.__('New Console for Activity')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    commands.addCommand(lib_CommandIDs.shutdown, {
        label: trans.__('Shut Down'),
        caption: trans.__('Shut down %1', app.name),
        isVisible: () => menu.quitEntry,
        isEnabled: () => menu.quitEntry,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            return (0,lib_index_js_.showDialog)({
                title: trans.__('Shutdown confirmation'),
                body: trans.__('Please confirm you want to shut down %1.', app.name),
                buttons: [
                    lib_index_js_.Dialog.cancelButton(),
                    lib_index_js_.Dialog.warnButton({ label: trans.__('Shut Down') })
                ]
            }).then(async (result) => {
                if (result.button.accept) {
                    const setting = app.serviceManager.serverSettings;
                    const apiURL = coreutils_lib_index_js_.URLExt.join(setting.baseUrl, 'api/shutdown');
                    // Shutdown all kernel and terminal sessions before shutting down the server
                    // If this fails, we continue execution so we can post an api/shutdown request
                    try {
                        await Promise.all([
                            app.serviceManager.sessions.shutdownAll(),
                            app.serviceManager.terminals.shutdownAll()
                        ]);
                    }
                    catch (e) {
                        // Do nothing
                        console.log(`Failed to shutdown sessions and terminals: ${e}`);
                    }
                    return services_lib_index_js_.ServerConnection.makeRequest(apiURL, { method: 'POST' }, setting)
                        .then(result => {
                        if (result.ok) {
                            // Close this window if the shutdown request has been successful
                            const body = document.createElement('div');
                            const p1 = document.createElement('p');
                            p1.textContent = trans.__('You have shut down the Jupyter server. You can now close this tab.');
                            const p2 = document.createElement('p');
                            p2.textContent = trans.__('To use %1 again, you will need to relaunch it.', app.name);
                            body.appendChild(p1);
                            body.appendChild(p2);
                            void (0,lib_index_js_.showDialog)({
                                title: trans.__('Server stopped'),
                                body: new dist_index_es6_js_.Widget({ node: body }),
                                buttons: []
                            });
                            window.close();
                        }
                        else {
                            throw new services_lib_index_js_.ServerConnection.ResponseError(result);
                        }
                    })
                        .catch(data => {
                        throw new services_lib_index_js_.ServerConnection.NetworkError(data);
                    });
                }
            });
        }
    });
    commands.addCommand(lib_CommandIDs.logout, {
        label: trans.__('Log Out'),
        caption: trans.__('Log out of %1', app.name),
        isVisible: () => menu.quitEntry,
        isEnabled: () => menu.quitEntry,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            router.navigate('/logout', { hard: true });
        }
    });
}
/**
 * Create the basic `Kernel` menu.
 */
function createKernelMenu(app, menu, trans) {
    const { commands, shell } = app;
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.interruptKernel,
        commands,
        shell,
        semanticCommands: menu.kernelUsers.interruptKernel,
        default: {
            label: trans.__('Interrupt Kernel'),
            caption: trans.__('Interrupt the kernel')
        },
        overrides: {
            icon: args => (args.toolbar ? ui_components_lib_index_js_.stopIcon : undefined),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.reconnectToKernel,
        commands,
        shell,
        semanticCommands: menu.kernelUsers.reconnectToKernel,
        default: {
            label: trans.__('Reconnect to Kernel')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.restartKernel,
        commands,
        shell,
        semanticCommands: menu.kernelUsers.restartKernel,
        default: {
            label: trans.__('Restart Kernel…'),
            caption: trans.__('Restart the kernel')
        },
        overrides: {
            icon: args => (args.toolbar ? ui_components_lib_index_js_.refreshIcon : undefined),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.restartKernelAndClear,
        commands,
        shell,
        semanticCommands: [
            menu.kernelUsers.restartKernel,
            menu.kernelUsers.clearWidget
        ],
        default: {
            label: trans.__('Restart Kernel and Clear…')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.changeKernel,
        commands,
        shell,
        semanticCommands: menu.kernelUsers.changeKernel,
        default: {
            label: trans.__('Change Kernel…')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.shutdownKernel,
        commands,
        shell,
        semanticCommands: menu.kernelUsers.shutdownKernel,
        default: {
            label: trans.__('Shut Down Kernel'),
            caption: trans.__('Shut down kernel')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    commands.addCommand(lib_CommandIDs.shutdownAllKernels, {
        label: trans.__('Shut Down All Kernels…'),
        isEnabled: () => {
            return !app.serviceManager.sessions.running().next().done;
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => {
            return (0,lib_index_js_.showDialog)({
                title: trans.__('Shut Down All?'),
                body: trans._n('Are you sure you want to permanently shut down the running kernel?', 'Are you sure you want to permanently shut down the %1 running kernels?', app.serviceManager.kernels.runningCount),
                buttons: [
                    lib_index_js_.Dialog.cancelButton(),
                    lib_index_js_.Dialog.warnButton({ label: trans.__('Shut Down All') })
                ]
            }).then(result => {
                if (result.button.accept) {
                    return app.serviceManager.sessions.shutdownAll();
                }
            });
        }
    });
}
/**
 * Create the basic `View` menu.
 */
function createViewMenu(app, menu, trans) {
    const { commands, shell } = app;
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.lineNumbering,
        commands,
        shell,
        semanticCommands: menu.editorViewers.toggleLineNumbers,
        default: {
            label: trans.__('Show Line Numbers')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.minimap,
        commands,
        shell,
        semanticCommands: menu.editorViewers.toggleMinimap,
        default: {
            label: trans.__('Show Minimap')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.matchBrackets,
        commands,
        shell,
        semanticCommands: menu.editorViewers.toggleMatchBrackets,
        default: {
            label: trans.__('Match Brackets')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.wordWrap,
        commands,
        shell,
        semanticCommands: menu.editorViewers.toggleWordWrap,
        default: {
            label: trans.__('Wrap Words')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
}
/**
 * Create the basic `Run` menu.
 */
function createRunMenu(app, menu, trans) {
    const { commands, shell } = app;
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.run,
        commands,
        shell,
        semanticCommands: menu.codeRunners.run,
        default: {
            label: trans.__('Run Selected'),
            caption: trans.__('Run Selected')
        },
        overrides: {
            icon: args => (args.toolbar ? ui_components_lib_index_js_.runIcon : undefined),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.runAll,
        commands,
        shell,
        semanticCommands: menu.codeRunners.runAll,
        default: {
            label: trans.__('Run All'),
            caption: trans.__('Run All')
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.restartAndRunAll,
        commands,
        shell,
        semanticCommands: [menu.codeRunners.restart, menu.codeRunners.runAll],
        default: {
            label: trans.__('Restart Kernel and Run All'),
            caption: trans.__('Restart Kernel and Run All')
        },
        overrides: {
            icon: args => (args.toolbar ? ui_components_lib_index_js_.fastForwardIcon : undefined),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
}
/**
 * Create the basic `Tabs` menu.
 */
function createTabsMenu(app, menu, labShell, trans) {
    const commands = app.commands;
    // A list of the active tabs in the main area.
    const tabGroup = [];
    // A disposable for getting rid of the out-of-date tabs list.
    let disposable;
    // Command to activate a widget by id.
    commands.addCommand(lib_CommandIDs.activateById, {
        label: args => {
            if (args.id === undefined) {
                return trans.__('Activate a widget by its `id`.');
            }
            const id = args['id'] || '';
            const widget = (0,index_es6_js_.find)(app.shell.widgets('main'), w => w.id === id);
            return (widget && widget.title.label) || '';
        },
        isToggled: args => {
            const id = args['id'] || '';
            return !!app.shell.currentWidget && app.shell.currentWidget.id === id;
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    id: {
                        type: 'string',
                        description: trans.__('The widget id to activate')
                    }
                },
                required: ['id']
            }
        },
        execute: args => app.shell.activateById(args['id'] || '')
    });
    let previousId = '';
    // Command to toggle between the current
    // tab and the last modified tab.
    commands.addCommand(lib_CommandIDs.activatePreviouslyUsedTab, {
        label: trans.__('Activate Previously Used Tab'),
        isEnabled: () => !!previousId,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        },
        execute: () => commands.execute(lib_CommandIDs.activateById, { id: previousId })
    });
    if (labShell) {
        void app.restored.then(() => {
            // Iterate over the current widgets in the
            // main area, and add them to the tab group
            // of the menu.
            const populateTabs = () => {
                // remove the previous tab list
                if (disposable && !disposable.isDisposed) {
                    disposable.dispose();
                }
                tabGroup.length = 0;
                let isPreviouslyUsedTabAttached = false;
                for (const widget of app.shell.widgets('main')) {
                    if (widget.id === previousId) {
                        isPreviouslyUsedTabAttached = true;
                    }
                    tabGroup.push({
                        command: lib_CommandIDs.activateById,
                        args: { id: widget.id }
                    });
                }
                disposable = menu.addGroup(tabGroup, 1);
                previousId = isPreviouslyUsedTabAttached ? previousId : '';
            };
            populateTabs();
            labShell.layoutModified.connect(() => {
                populateTabs();
            });
            // Update the ID of the previous active tab if a new tab is selected.
            labShell.currentChanged.connect((_, args) => {
                const widget = args.oldValue;
                if (!widget) {
                    return;
                }
                previousId = widget.id;
            });
        });
    }
}
/**
 * Create the basic `Help` menu.
 */
function createHelpMenu(app, menu, trans) {
    const { commands, shell } = app;
    (0,index_js_.addSemanticCommand)({
        id: lib_CommandIDs.getKernel,
        commands,
        shell,
        semanticCommands: menu.getKernel,
        default: {
            label: trans.__('Get Kernel'),
            isVisible: false
        },
        overrides: {
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        },
        trans
    });
}
/* harmony default export */ const lib = ([lib_plugin, recentsMenuPlugin]);
/**
 * A namespace for Private data.
 */
var Private;
(function (Private) {
    async function displayInformation(trans) {
        const result = await (0,lib_index_js_.showDialog)({
            title: trans.__('Information'),
            body: trans.__('Menu customization has changed. You will need to reload JupyterLab to see the changes.'),
            buttons: [
                lib_index_js_.Dialog.cancelButton(),
                lib_index_js_.Dialog.okButton({ label: trans.__('Reload') })
            ]
        });
        if (result.button.accept) {
            location.reload();
        }
    }
    async function loadSettingsMenu(registry, addMenu, menuFactory, translator) {
        var _a;
        const trans = translator.load('jupyterlab');
        let canonical = null;
        let loaded = {};
        /**
         * Populate the plugin's schema defaults.
         */
        function populate(schema) {
            var _a, _b;
            loaded = {};
            const pluginDefaults = Object.keys(registry.plugins)
                .map(plugin => {
                var _a, _b;
                const menus = (_b = (_a = registry.plugins[plugin].schema['jupyter.lab.menus']) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : [];
                loaded[plugin] = menus;
                return menus;
            })
                .concat([(_b = (_a = schema['jupyter.lab.menus']) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : []])
                .reduceRight((acc, val) => settingregistry_lib_index_js_.SettingRegistry.reconcileMenus(acc, val, true), schema.properties.menus.default);
            // Apply default value as last step to take into account overrides.json
            // The standard default being [] as the plugin must use `jupyter.lab.menus.main`
            // to define their default value.
            schema.properties.menus.default = settingregistry_lib_index_js_.SettingRegistry.reconcileMenus(pluginDefaults, schema.properties.menus.default, true)
                // flatten one level
                .sort((a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : Infinity) - ((_b = b.rank) !== null && _b !== void 0 ? _b : Infinity); });
        }
        // Transform the plugin object to return different schema than the default.
        registry.transform(lib_PLUGIN_ID, {
            compose: plugin => {
                var _a, _b, _c, _d;
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                const defaults = (_c = (_b = (_a = canonical.properties) === null || _a === void 0 ? void 0 : _a.menus) === null || _b === void 0 ? void 0 : _b.default) !== null && _c !== void 0 ? _c : [];
                const user = {
                    ...plugin.data.user,
                    menus: (_d = plugin.data.user.menus) !== null && _d !== void 0 ? _d : []
                };
                const composite = {
                    ...plugin.data.composite,
                    menus: settingregistry_lib_index_js_.SettingRegistry.reconcileMenus(defaults, user.menus)
                };
                plugin.data = { composite, user };
                return plugin;
            },
            fetch: plugin => {
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                return {
                    data: plugin.data,
                    id: plugin.id,
                    raw: plugin.raw,
                    schema: canonical,
                    version: plugin.version
                };
            }
        });
        // Repopulate the canonical variable after the setting registry has
        // preloaded all initial plugins.
        const settings = await registry.load(lib_PLUGIN_ID);
        const currentMenus = (_a = dist_index_js_.JSONExt.deepCopy(settings.composite.menus)) !== null && _a !== void 0 ? _a : [];
        const menus = new Array();
        // Create menu for non-disabled element
        lib_index_js_.MenuFactory.createMenus(currentMenus
            .filter(menu => !menu.disabled)
            .map(menu => {
            var _a;
            return {
                ...menu,
                items: settingregistry_lib_index_js_.SettingRegistry.filterDisabledItems((_a = menu.items) !== null && _a !== void 0 ? _a : [])
            };
        }), menuFactory).forEach(menu => {
            menus.push(menu);
            addMenu(menu);
        });
        settings.changed.connect(() => {
            var _a;
            // As extension may change menu through API, prompt the user to reload if the
            // menu has been updated.
            const newMenus = (_a = settings.composite.menus) !== null && _a !== void 0 ? _a : [];
            if (!dist_index_js_.JSONExt.deepEqual(currentMenus, newMenus)) {
                void displayInformation(trans);
            }
        });
        registry.pluginChanged.connect(async (sender, plugin) => {
            var _a, _b, _c;
            if (plugin !== lib_PLUGIN_ID) {
                // If the plugin changed its menu.
                const oldMenus = (_a = loaded[plugin]) !== null && _a !== void 0 ? _a : [];
                const newMenus = (_c = (_b = registry.plugins[plugin].schema['jupyter.lab.menus']) === null || _b === void 0 ? void 0 : _b.main) !== null && _c !== void 0 ? _c : [];
                if (!dist_index_js_.JSONExt.deepEqual(oldMenus, newMenus)) {
                    if (loaded[plugin]) {
                        // The plugin has changed, request the user to reload the UI - this should not happen
                        await displayInformation(trans);
                    }
                    else {
                        // The plugin was not yet loaded when the menu was built => update the menu
                        loaded[plugin] = dist_index_js_.JSONExt.deepCopy(newMenus);
                        // Merge potential disabled state
                        const toAdd = settingregistry_lib_index_js_.SettingRegistry.reconcileMenus(newMenus, currentMenus, false, false)
                            .filter(menu => !menu.disabled)
                            .map(menu => {
                            var _a;
                            return {
                                ...menu,
                                items: settingregistry_lib_index_js_.SettingRegistry.filterDisabledItems((_a = menu.items) !== null && _a !== void 0 ? _a : [])
                            };
                        });
                        lib_index_js_.MenuFactory.updateMenus(menus, toAdd, menuFactory).forEach(menu => {
                            addMenu(menu);
                        });
                    }
                }
            }
        });
    }
    Private.loadSettingsMenu = loadSettingsMenu;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 3727:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_docmanager_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81393);
/* harmony import */ var _jupyterlab_filebrowser_style_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(40360);
/* harmony import */ var _jupyterlab_mainmenu_style_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(70022);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 12007:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  EditMenu: () => (/* reexport */ EditMenu),
  FileMenu: () => (/* reexport */ FileMenu),
  HelpMenu: () => (/* reexport */ HelpMenu),
  IMainMenu: () => (/* reexport */ IMainMenu),
  KernelMenu: () => (/* reexport */ KernelMenu),
  MainMenu: () => (/* reexport */ MainMenu),
  RunMenu: () => (/* reexport */ RunMenu),
  SettingsMenu: () => (/* reexport */ SettingsMenu),
  TabsMenu: () => (/* reexport */ TabsMenu),
  ViewMenu: () => (/* reexport */ ViewMenu)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/edit.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * An extensible Edit menu for the application.
 */
class EditMenu extends index_js_.RankedMenu {
    /**
     * Construct the edit menu.
     */
    constructor(options) {
        super(options);
        this.undoers = {
            redo: new lib_index_js_.SemanticCommand(),
            undo: new lib_index_js_.SemanticCommand()
        };
        this.clearers = {
            clearAll: new lib_index_js_.SemanticCommand(),
            clearCurrent: new lib_index_js_.SemanticCommand()
        };
        this.goToLiners = new lib_index_js_.SemanticCommand();
    }
}
//# sourceMappingURL=edit.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/file.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * An extensible FileMenu for the application.
 */
class FileMenu extends index_js_.RankedMenu {
    constructor(options) {
        super(options);
        this.quitEntry = false;
        this.closeAndCleaners = new lib_index_js_.SemanticCommand();
        this.consoleCreators = new lib_index_js_.SemanticCommand();
    }
    /**
     * The New submenu.
     */
    get newMenu() {
        var _a, _b;
        if (!this._newMenu) {
            this._newMenu =
                (_b = (_a = (0,index_es6_js_.find)(this.items, menu => { var _a; return ((_a = menu.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-file-new'; })) === null || _a === void 0 ? void 0 : _a.submenu) !== null && _b !== void 0 ? _b : new index_js_.RankedMenu({
                    commands: this.commands
                });
        }
        return this._newMenu;
    }
    /**
     * Dispose of the resources held by the file menu.
     */
    dispose() {
        var _a;
        (_a = this._newMenu) === null || _a === void 0 ? void 0 : _a.dispose();
        super.dispose();
    }
}
//# sourceMappingURL=file.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/help.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * An extensible Help menu for the application.
 */
class HelpMenu extends index_js_.RankedMenu {
    /**
     * Construct the help menu.
     */
    constructor(options) {
        super(options);
        this.getKernel = new lib_index_js_.SemanticCommand();
    }
}
//# sourceMappingURL=help.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/kernel.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * An extensible Kernel menu for the application.
 */
class KernelMenu extends index_js_.RankedMenu {
    /**
     * Construct the kernel menu.
     */
    constructor(options) {
        super(options);
        this.kernelUsers = {
            changeKernel: new lib_index_js_.SemanticCommand(),
            clearWidget: new lib_index_js_.SemanticCommand(),
            interruptKernel: new lib_index_js_.SemanticCommand(),
            reconnectToKernel: new lib_index_js_.SemanticCommand(),
            restartKernel: new lib_index_js_.SemanticCommand(),
            shutdownKernel: new lib_index_js_.SemanticCommand()
        };
    }
}
//# sourceMappingURL=kernel.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/run.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * An extensible Run menu for the application.
 */
class RunMenu extends index_js_.RankedMenu {
    /**
     * Construct the run menu.
     */
    constructor(options) {
        super(options);
        this.codeRunners = {
            restart: new lib_index_js_.SemanticCommand(),
            run: new lib_index_js_.SemanticCommand(),
            runAll: new lib_index_js_.SemanticCommand()
        };
    }
}
//# sourceMappingURL=run.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/settings.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * An extensible Settings menu for the application.
 */
class SettingsMenu extends index_js_.RankedMenu {
    /**
     * Construct the settings menu.
     */
    constructor(options) {
        super(options);
    }
}
//# sourceMappingURL=settings.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/tabs.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * An extensible Tabs menu for the application.
 */
class TabsMenu extends index_js_.RankedMenu {
    /**
     * Construct the tabs menu.
     */
    constructor(options) {
        super(options);
    }
}
//# sourceMappingURL=tabs.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/view.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * An extensible View menu for the application.
 */
class ViewMenu extends index_js_.RankedMenu {
    /**
     * Construct the view menu.
     */
    constructor(options) {
        super(options);
        this.editorViewers = {
            toggleLineNumbers: new lib_index_js_.SemanticCommand(),
            toggleMinimap: new lib_index_js_.SemanticCommand(),
            toggleMatchBrackets: new lib_index_js_.SemanticCommand(),
            toggleWordWrap: new lib_index_js_.SemanticCommand()
        };
    }
}
//# sourceMappingURL=view.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/mainmenu.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.











/**
 * The main menu class.  It is intended to be used as a singleton.
 */
class MainMenu extends dist_index_es6_js_.MenuBar {
    /**
     * Construct the main menu bar.
     */
    constructor(commands) {
        let options = { forceItemsPosition: { forceX: false, forceY: true } };
        super(options);
        this._items = [];
        this._commands = commands;
    }
    /**
     * The application "Edit" menu.
     */
    get editMenu() {
        if (!this._editMenu) {
            this._editMenu = new EditMenu({
                commands: this._commands,
                rank: 2,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._editMenu;
    }
    /**
     * The application "File" menu.
     */
    get fileMenu() {
        if (!this._fileMenu) {
            this._fileMenu = new FileMenu({
                commands: this._commands,
                rank: 1,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._fileMenu;
    }
    /**
     * The application "Help" menu.
     */
    get helpMenu() {
        if (!this._helpMenu) {
            this._helpMenu = new HelpMenu({
                commands: this._commands,
                rank: 1000,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._helpMenu;
    }
    /**
     * The application "Kernel" menu.
     */
    get kernelMenu() {
        if (!this._kernelMenu) {
            this._kernelMenu = new KernelMenu({
                commands: this._commands,
                rank: 5,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._kernelMenu;
    }
    /**
     * The application "Run" menu.
     */
    get runMenu() {
        if (!this._runMenu) {
            this._runMenu = new RunMenu({
                commands: this._commands,
                rank: 4,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._runMenu;
    }
    /**
     * The application "Settings" menu.
     */
    get settingsMenu() {
        if (!this._settingsMenu) {
            this._settingsMenu = new SettingsMenu({
                commands: this._commands,
                rank: 999,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._settingsMenu;
    }
    /**
     * The application "View" menu.
     */
    get viewMenu() {
        if (!this._viewMenu) {
            this._viewMenu = new ViewMenu({
                commands: this._commands,
                rank: 3,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._viewMenu;
    }
    /**
     * The application "Tabs" menu.
     */
    get tabsMenu() {
        if (!this._tabsMenu) {
            this._tabsMenu = new TabsMenu({
                commands: this._commands,
                rank: 500,
                renderer: index_js_.MenuSvg.defaultRenderer
            });
        }
        return this._tabsMenu;
    }
    /**
     * Add a new menu to the main menu bar.
     */
    addMenu(menu, update = true, options = {}) {
        if (index_es6_js_.ArrayExt.firstIndexOf(this.menus, menu) > -1) {
            return;
        }
        // override default renderer with svg-supporting renderer
        index_js_.MenuSvg.overrideDefaultRenderer(menu);
        const rank = 'rank' in options
            ? options.rank
            : 'rank' in menu
                ? menu.rank
                : index_js_.IRankedMenu.DEFAULT_RANK;
        const rankItem = { menu, rank };
        const index = index_es6_js_.ArrayExt.upperBound(this._items, rankItem, Private.itemCmp);
        // Upon disposal, remove the menu and its rank reference.
        menu.disposed.connect(this._onMenuDisposed, this);
        index_es6_js_.ArrayExt.insert(this._items, index, rankItem);
        /**
         * Create a new menu.
         */
        this.insertMenu(index, menu);
        // Link the menu to the API - backward compatibility when switching to menu description in settings
        switch (menu.id) {
            case 'jp-mainmenu-file':
                if (!this._fileMenu && menu instanceof FileMenu) {
                    this._fileMenu = menu;
                }
                break;
            case 'jp-mainmenu-edit':
                if (!this._editMenu && menu instanceof EditMenu) {
                    this._editMenu = menu;
                }
                break;
            case 'jp-mainmenu-view':
                if (!this._viewMenu && menu instanceof ViewMenu) {
                    this._viewMenu = menu;
                }
                break;
            case 'jp-mainmenu-run':
                if (!this._runMenu && menu instanceof RunMenu) {
                    this._runMenu = menu;
                }
                break;
            case 'jp-mainmenu-kernel':
                if (!this._kernelMenu && menu instanceof KernelMenu) {
                    this._kernelMenu = menu;
                }
                break;
            case 'jp-mainmenu-tabs':
                if (!this._tabsMenu && menu instanceof TabsMenu) {
                    this._tabsMenu = menu;
                }
                break;
            case 'jp-mainmenu-settings':
                if (!this._settingsMenu && menu instanceof SettingsMenu) {
                    this._settingsMenu = menu;
                }
                break;
            case 'jp-mainmenu-help':
                if (!this._helpMenu && menu instanceof HelpMenu) {
                    this._helpMenu = menu;
                }
                break;
        }
    }
    /**
     * Dispose of the resources held by the menu bar.
     */
    dispose() {
        var _a, _b, _c, _d, _e, _f, _g, _h;
        (_a = this._editMenu) === null || _a === void 0 ? void 0 : _a.dispose();
        (_b = this._fileMenu) === null || _b === void 0 ? void 0 : _b.dispose();
        (_c = this._helpMenu) === null || _c === void 0 ? void 0 : _c.dispose();
        (_d = this._kernelMenu) === null || _d === void 0 ? void 0 : _d.dispose();
        (_e = this._runMenu) === null || _e === void 0 ? void 0 : _e.dispose();
        (_f = this._settingsMenu) === null || _f === void 0 ? void 0 : _f.dispose();
        (_g = this._viewMenu) === null || _g === void 0 ? void 0 : _g.dispose();
        (_h = this._tabsMenu) === null || _h === void 0 ? void 0 : _h.dispose();
        super.dispose();
    }
    /**
     * Generate the menu.
     *
     * @param commands The command registry
     * @param options The main menu options.
     * @param trans - The application language translator.
     */
    static generateMenu(commands, options, trans) {
        let menu;
        const { id, label, rank } = options;
        switch (id) {
            case 'jp-mainmenu-file':
                menu = new FileMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            case 'jp-mainmenu-edit':
                menu = new EditMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            case 'jp-mainmenu-view':
                menu = new ViewMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            case 'jp-mainmenu-run':
                menu = new RunMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            case 'jp-mainmenu-kernel':
                menu = new KernelMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            case 'jp-mainmenu-tabs':
                menu = new TabsMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            case 'jp-mainmenu-settings':
                menu = new SettingsMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            case 'jp-mainmenu-help':
                menu = new HelpMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
                break;
            default:
                menu = new index_js_.RankedMenu({
                    commands,
                    rank,
                    renderer: index_js_.MenuSvg.defaultRenderer
                });
        }
        if (label) {
            menu.title.label = trans._p('menu', label);
        }
        return menu;
    }
    /**
     * Handle the disposal of a menu.
     */
    _onMenuDisposed(menu) {
        this.removeMenu(menu);
        const index = index_es6_js_.ArrayExt.findFirstIndex(this._items, item => item.menu === menu);
        if (index !== -1) {
            index_es6_js_.ArrayExt.removeAt(this._items, index);
        }
    }
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * A comparator function for menu rank items.
     */
    function itemCmp(first, second) {
        return first.rank - second.rank;
    }
    Private.itemCmp = itemCmp;
})(Private || (Private = {}));
//# sourceMappingURL=mainmenu.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The main menu token.
 */
const IMainMenu = new dist_index_js_.Token('@jupyterlab/mainmenu:IMainMenu', `A service for the main menu bar for the application.
  Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mainmenu/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module mainmenu
 */










//# sourceMappingURL=index.js.map

/***/ }),

/***/ 70022:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57261);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 79685:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_markdownviewer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(83679);
/* harmony import */ var _jupyterlab_markdownviewer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_markdownviewer__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(61832);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74853);
/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_toc__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module markdownviewer-extension
 */








/**
 * The command IDs used by the markdownviewer plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.markdownPreview = 'markdownviewer:open';
    CommandIDs.markdownEditor = 'markdownviewer:edit';
})(CommandIDs || (CommandIDs = {}));
/**
 * The name of the factory that creates markdown viewer widgets.
 */
const FACTORY = 'Markdown Preview';
/**
 * The markdown viewer plugin.
 */
const plugin = {
    activate,
    id: '@jupyterlab/markdownviewer-extension:plugin',
    description: 'Adds markdown file viewer and provides its tracker.',
    provides: _jupyterlab_markdownviewer__WEBPACK_IMPORTED_MODULE_3__.IMarkdownViewerTracker,
    requires: [_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__.IRenderMimeRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_7__.ITranslator],
    optional: [
        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_5__.ISettingRegistry,
        _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_6__.ITableOfContentsRegistry,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ISanitizer
    ],
    autoStart: true
};
/**
 * Activate the markdown viewer plugin.
 */
function activate(app, rendermime, translator, restorer, settingRegistry, tocRegistry, sanitizer) {
    const trans = translator.load('jupyterlab');
    const { commands, docRegistry } = app;
    // Add the markdown renderer factory.
    rendermime.addFactory(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__.markdownRendererFactory);
    const namespace = 'markdownviewer-widget';
    const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
        namespace
    });
    let config = {
        ..._jupyterlab_markdownviewer__WEBPACK_IMPORTED_MODULE_3__.MarkdownViewer.defaultConfig
    };
    /**
     * Update the settings of a widget.
     */
    function updateWidget(widget) {
        Object.keys(config).forEach((k) => {
            var _a;
            widget.setOption(k, (_a = config[k]) !== null && _a !== void 0 ? _a : null);
        });
    }
    if (settingRegistry) {
        const updateSettings = (settings) => {
            config = settings.composite;
            tracker.forEach(widget => {
                updateWidget(widget.content);
            });
        };
        // Fetch the initial state of the settings.
        settingRegistry
            .load(plugin.id)
            .then((settings) => {
            settings.changed.connect(() => {
                updateSettings(settings);
            });
            updateSettings(settings);
        })
            .catch((reason) => {
            console.error(reason.message);
        });
    }
    // Register the MarkdownViewer factory.
    const factory = new _jupyterlab_markdownviewer__WEBPACK_IMPORTED_MODULE_3__.MarkdownViewerFactory({
        rendermime,
        name: FACTORY,
        label: trans.__('Markdown Preview'),
        primaryFileType: docRegistry.getFileType('markdown'),
        fileTypes: ['markdown'],
        defaultRendered: ['markdown']
    });
    factory.widgetCreated.connect((sender, widget) => {
        // Notify the widget tracker if restore data needs to update.
        widget.context.pathChanged.connect(() => {
            void tracker.save(widget);
        });
        // Handle the settings of new widgets.
        updateWidget(widget.content);
        void tracker.add(widget);
    });
    docRegistry.addWidgetFactory(factory);
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: 'docmanager:open',
            args: widget => ({ path: widget.context.path, factory: FACTORY }),
            name: widget => widget.context.path
        });
    }
    commands.addCommand(CommandIDs.markdownPreview, {
        label: trans.__('Markdown Preview'),
        execute: args => {
            const path = args['path'];
            if (typeof path !== 'string') {
                return;
            }
            return commands.execute('docmanager:open', {
                path,
                factory: FACTORY,
                options: args['options']
            });
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: trans.__('The path to the markdown file to preview')
                    },
                    options: {
                        type: 'object',
                        description: trans.__('Options for opening the preview')
                    }
                },
                required: ['path']
            }
        }
    });
    commands.addCommand(CommandIDs.markdownEditor, {
        execute: () => {
            const widget = tracker.currentWidget;
            if (!widget) {
                return;
            }
            const path = widget.context.path;
            return commands.execute('docmanager:open', {
                path,
                factory: 'Editor',
                options: {
                    mode: 'split-right'
                }
            });
        },
        isVisible: () => {
            const widget = tracker.currentWidget;
            return ((widget && _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PathExt.extname(widget.context.path) === '.md') || false);
        },
        label: trans.__('Show Markdown Editor'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    if (tocRegistry) {
        tocRegistry.add(new _jupyterlab_markdownviewer__WEBPACK_IMPORTED_MODULE_3__.MarkdownViewerTableOfContentsFactory(tracker, rendermime.markdownParser, sanitizer !== null && sanitizer !== void 0 ? sanitizer : rendermime.sanitizer));
    }
    return tracker;
}
/**
 * Export the plugin as default.
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 97635:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/toc/style/index.js + 1 modules
var toc_style = __webpack_require__(91302);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var widgets_style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/markdownviewer/style/base.css
var base = __webpack_require__(48298);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markdownviewer/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markdownviewer/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markdownviewer-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 99680:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  IMarkdownViewerTracker: () => (/* reexport */ IMarkdownViewerTracker),
  MarkdownDocument: () => (/* reexport */ MarkdownDocument),
  MarkdownViewer: () => (/* reexport */ MarkdownViewer),
  MarkdownViewerFactory: () => (/* reexport */ MarkdownViewerFactory),
  MarkdownViewerTableOfContentsFactory: () => (/* reexport */ MarkdownViewerTableOfContentsFactory),
  MarkdownViewerTableOfContentsModel: () => (/* reexport */ MarkdownViewerTableOfContentsModel)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/toc@^6.5.6 (strict) (fallback: ../node_modules/@jupyterlab/toc/lib/index.js)
var index_js_ = __webpack_require__(74853);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markdownviewer/lib/toc.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Table of content model for Markdown viewer files.
 */
class MarkdownViewerTableOfContentsModel extends index_js_.TableOfContentsModel {
    /**
     * Constructor
     *
     * @param widget The widget to search in
     * @param parser Markdown parser
     * @param configuration Default model configuration
     */
    constructor(widget, parser, configuration) {
        super(widget, configuration);
        this.parser = parser;
    }
    /**
     * Type of document supported by the model.
     *
     * #### Notes
     * A `data-document-type` attribute with this value will be set
     * on the tree view `.jp-TableOfContents-content[data-document-type="..."]`
     */
    get documentType() {
        return 'markdown-viewer';
    }
    /**
     * Whether the model gets updated even if the table of contents panel
     * is hidden or not.
     */
    get isAlwaysActive() {
        return true;
    }
    /**
     * List of configuration options supported by the model.
     */
    get supportedOptions() {
        return ['maximalDepth', 'numberingH1', 'numberHeaders'];
    }
    /**
     * Produce the headings for a document.
     *
     * @returns The list of new headings or `null` if nothing needs to be updated.
     */
    async getHeadings() {
        const content = this.widget.context.model.toString();
        const headings = await index_js_.TableOfContentsUtils.Markdown.parseHeadings(content, this.parser);
        const filteredHeadings = index_js_.TableOfContentsUtils.filterHeadings(headings, {
            ...this.configuration,
            // Force base number to be equal to 1
            baseNumbering: 1
        });
        return Promise.resolve(filteredHeadings);
    }
}
/**
 * Table of content model factory for Markdown viewer files.
 */
class MarkdownViewerTableOfContentsFactory extends index_js_.TableOfContentsFactory {
    /**
     * Constructor
     *
     * @param tracker Widget tracker
     * @param parser Markdown parser
     */
    constructor(tracker, parser, sanitizer) {
        super(tracker);
        this.parser = parser;
        this.sanitizer = sanitizer;
    }
    /**
     * Create a new table of contents model for the widget
     *
     * @param widget - widget
     * @param configuration - Table of contents configuration
     * @returns The table of contents model
     */
    _createNew(widget, configuration) {
        const model = new MarkdownViewerTableOfContentsModel(widget, this.parser, configuration);
        let headingToElement = new WeakMap();
        const onActiveHeadingChanged = (model, heading) => {
            if (heading) {
                const el = headingToElement.get(heading);
                if (el) {
                    const widgetBox = widget.content.node.getBoundingClientRect();
                    const elementBox = el.getBoundingClientRect();
                    if (elementBox.top > widgetBox.bottom ||
                        elementBox.bottom < widgetBox.top) {
                        el.scrollIntoView({ block: 'center' });
                    }
                }
                else {
                    console.warn('Heading element not found for heading', heading, 'in widget', widget);
                }
            }
        };
        const onHeadingsChanged = () => {
            if (!this.parser) {
                return;
            }
            // Clear all numbering items
            index_js_.TableOfContentsUtils.clearNumbering(widget.content.node);
            // Create a new mapping
            headingToElement = new WeakMap();
            model.headings.forEach(async (heading) => {
                var _a, _b;
                const elementId = await index_js_.TableOfContentsUtils.Markdown.getHeadingId(this.parser, heading.raw, heading.level, this.sanitizer);
                if (!elementId) {
                    return;
                }
                const attribute = ((_a = this.sanitizer.allowNamedProperties) !== null && _a !== void 0 ? _a : false)
                    ? 'id'
                    : 'data-jupyter-id';
                const selector = `h${heading.level}[${attribute}="${CSS.escape(elementId)}"]`;
                headingToElement.set(heading, index_js_.TableOfContentsUtils.addPrefix(widget.content.node, selector, (_b = heading.prefix) !== null && _b !== void 0 ? _b : ''));
            });
        };
        void widget.content.ready.then(() => {
            onHeadingsChanged();
            widget.content.rendered.connect(onHeadingsChanged);
            model.activeHeadingChanged.connect(onActiveHeadingChanged);
            model.headingsChanged.connect(onHeadingsChanged);
            widget.disposed.connect(() => {
                widget.content.rendered.disconnect(onHeadingsChanged);
                model.activeHeadingChanged.disconnect(onActiveHeadingChanged);
                model.headingsChanged.disconnect(onHeadingsChanged);
            });
        });
        return model;
    }
}
//# sourceMappingURL=toc.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markdownviewer/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The markdownviewer tracker token.
 */
const IMarkdownViewerTracker = new dist_index_js_.Token('@jupyterlab/markdownviewer:IMarkdownViewerTracker', `A widget tracker for markdown
  document viewers. Use this if you want to iterate over and interact with rendered markdown documents.`);
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markdownviewer/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The class name added to a markdown viewer.
 */
const MARKDOWNVIEWER_CLASS = 'jp-MarkdownViewer';
/**
 * The markdown MIME type.
 */
const MIMETYPE = 'text/markdown';
/**
 * A widget for markdown documents.
 */
class MarkdownViewer extends dist_index_es6_js_.Widget {
    /**
     * Construct a new markdown viewer widget.
     */
    constructor(options) {
        super();
        this._config = { ...MarkdownViewer.defaultConfig };
        this._fragment = '';
        this._ready = new dist_index_js_.PromiseDelegate();
        this._isRendering = false;
        this._renderRequested = false;
        this._rendered = new index_es6_js_.Signal(this);
        this.context = options.context;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this.renderer = options.renderer;
        this.node.tabIndex = 0;
        this.addClass(MARKDOWNVIEWER_CLASS);
        const layout = (this.layout = new dist_index_es6_js_.StackedLayout());
        layout.addWidget(this.renderer);
        void this.context.ready.then(async () => {
            await this._render();
            // Throttle the rendering rate of the widget.
            this._monitor = new coreutils_lib_index_js_.ActivityMonitor({
                signal: this.context.model.contentChanged,
                timeout: this._config.renderTimeout
            });
            this._monitor.activityStopped.connect(this.update, this);
            this._ready.resolve(undefined);
        });
    }
    /**
     * A promise that resolves when the markdown viewer is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Signal emitted when the content has been rendered.
     */
    get rendered() {
        return this._rendered;
    }
    /**
     * Set URI fragment identifier.
     */
    setFragment(fragment) {
        this._fragment = fragment;
        this.update();
    }
    /**
     * Set a config option for the markdown viewer.
     */
    setOption(option, value) {
        if (this._config[option] === value) {
            return;
        }
        this._config[option] = value;
        const { style } = this.renderer.node;
        switch (option) {
            case 'fontFamily':
                style.setProperty('font-family', value);
                break;
            case 'fontSize':
                style.setProperty('font-size', value ? value + 'px' : null);
                break;
            case 'hideFrontMatter':
                this.update();
                break;
            case 'lineHeight':
                style.setProperty('line-height', value ? value.toString() : null);
                break;
            case 'lineWidth': {
                const padding = value ? `calc(50% - ${value / 2}ch)` : null;
                style.setProperty('padding-left', padding);
                style.setProperty('padding-right', padding);
                break;
            }
            case 'renderTimeout':
                if (this._monitor) {
                    this._monitor.timeout = value;
                }
                break;
            default:
                break;
        }
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        if (this._monitor) {
            this._monitor.dispose();
        }
        this._monitor = null;
        super.dispose();
    }
    /**
     * Handle an `update-request` message to the widget.
     */
    onUpdateRequest(msg) {
        if (this.context.isReady && !this.isDisposed) {
            void this._render();
            this._fragment = '';
        }
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        this.node.focus();
    }
    /**
     * Render the mime content.
     */
    async _render() {
        if (this.isDisposed) {
            return;
        }
        // Since rendering is async, we note render requests that happen while we
        // actually are rendering for a future rendering.
        if (this._isRendering) {
            this._renderRequested = true;
            return;
        }
        // Set up for this rendering pass.
        this._renderRequested = false;
        const { context } = this;
        const { model } = context;
        const source = model.toString();
        const data = {};
        // If `hideFrontMatter`is true remove front matter.
        data[MIMETYPE] = this._config.hideFrontMatter
            ? Private.removeFrontMatter(source)
            : source;
        const mimeModel = new rendermime_lib_index_js_.MimeModel({
            data,
            metadata: { fragment: this._fragment }
        });
        try {
            // Do the rendering asynchronously.
            this._isRendering = true;
            await this.renderer.renderModel(mimeModel);
            this._isRendering = false;
            // If there is an outstanding request to render, go ahead and render
            if (this._renderRequested) {
                return this._render();
            }
            else {
                this._rendered.emit();
            }
        }
        catch (reason) {
            // Dispose the document if rendering fails.
            requestAnimationFrame(() => {
                this.dispose();
            });
            void (0,lib_index_js_.showErrorMessage)(this._trans.__('Renderer Failure: %1', context.path), reason);
        }
    }
}
/**
 * The namespace for MarkdownViewer class statics.
 */
(function (MarkdownViewer) {
    /**
     * The default configuration options for an editor.
     */
    MarkdownViewer.defaultConfig = {
        fontFamily: null,
        fontSize: null,
        lineHeight: null,
        lineWidth: null,
        hideFrontMatter: true,
        renderTimeout: 1000
    };
})(MarkdownViewer || (MarkdownViewer = {}));
/**
 * A document widget for markdown content.
 */
class MarkdownDocument extends docregistry_lib_index_js_.DocumentWidget {
    setFragment(fragment) {
        this.content.setFragment(fragment);
    }
}
/**
 * A widget factory for markdown viewers.
 */
class MarkdownViewerFactory extends docregistry_lib_index_js_.ABCWidgetFactory {
    /**
     * Construct a new markdown viewer widget factory.
     */
    constructor(options) {
        super(Private.createRegistryOptions(options));
        this._fileType = options.primaryFileType;
        this._rendermime = options.rendermime;
    }
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        var _a, _b, _c, _d, _e;
        const rendermime = this._rendermime.clone({
            resolver: context.urlResolver
        });
        const renderer = rendermime.createRenderer(MIMETYPE);
        const content = new MarkdownViewer({ context, renderer });
        content.title.icon = (_a = this._fileType) === null || _a === void 0 ? void 0 : _a.icon;
        content.title.iconClass = (_c = (_b = this._fileType) === null || _b === void 0 ? void 0 : _b.iconClass) !== null && _c !== void 0 ? _c : '';
        content.title.iconLabel = (_e = (_d = this._fileType) === null || _d === void 0 ? void 0 : _d.iconLabel) !== null && _e !== void 0 ? _e : '';
        content.title.caption = this.label;
        const widget = new MarkdownDocument({ content, context });
        return widget;
    }
}
/**
 * A namespace for markdown viewer widget private data.
 */
var Private;
(function (Private) {
    /**
     * Create the document registry options.
     */
    function createRegistryOptions(options) {
        return {
            ...options,
            readOnly: true
        };
    }
    Private.createRegistryOptions = createRegistryOptions;
    /**
     * Remove YAML front matter from source.
     */
    function removeFrontMatter(source) {
        const re = /^---\n[^]*?\n(---|...)\n/;
        const match = source.match(re);
        if (!match) {
            return source;
        }
        const { length } = match[0];
        return source.slice(length);
    }
    Private.removeFrontMatter = removeFrontMatter;
})(Private || (Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markdownviewer/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module markdownviewer
 */



//# sourceMappingURL=index.js.map

/***/ }),

/***/ 79268:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createMarkdownParser: () => (/* binding */ createMarkdownParser),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84088);
/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(61832);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82124);
/* harmony import */ var _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_4__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module markedparser-extension
 */





// highlight cache key separator
const FENCE = '```~~~';
const HEADING_TAG_REGEX = /^<h[1-6]\b[^>]*>/i;
/**
 * Create a markdown parser
 *
 * @param languages Editor languages
 * @returns Markdown parser
 */
function createMarkdownParser(languages, options) {
    return {
        render: (content) => {
            return Private.render(content, languages, options);
        },
        getHeadingTokens: (content) => {
            return Private.getHeadingTokens(content, options);
        }
    };
}
/**
 * The markdown parser plugin.
 */
const plugin = {
    id: '@jupyterlab/markedparser-extension:plugin',
    description: 'Provides the Markdown parser.',
    autoStart: true,
    provides: _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__.IMarkdownParser,
    requires: [_jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_2__.IEditorLanguageRegistry],
    optional: [_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_4__.IMermaidMarkdown],
    activate: (app, languages, mermaidMarkdown) => {
        return createMarkdownParser(languages, {
            blocks: mermaidMarkdown ? [mermaidMarkdown] : []
        });
    }
};
/**
 * Export the plugin as default.
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
/**
 * A namespace for private marked functions
 */
var Private;
(function (Private) {
    let _initializing = null;
    let _marked = null;
    let _blocks = [];
    let _languages = null;
    let _markedOptions = {};
    let _highlights = new _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.LruCache();
    async function render(content, languages, options) {
        _languages = languages;
        if (!_marked) {
            _marked = await initializeMarked(options);
        }
        return _marked(content, _markedOptions);
    }
    Private.render = render;
    /**
     * Load marked lazily and exactly once.
     */
    async function initializeMarked(options) {
        if (_marked) {
            return _marked;
        }
        if (_initializing) {
            return await _initializing.promise;
        }
        // order blocks by `rank`
        _blocks = (options === null || options === void 0 ? void 0 : options.blocks) || [];
        _blocks = _blocks.sort((a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : Infinity) - ((_b = b.rank) !== null && _b !== void 0 ? _b : Infinity); });
        _initializing = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        // load marked lazily, and exactly once
        const [{ marked, Renderer }, plugins] = await Promise.all([
            __webpack_require__.e(/* import() */ 8902).then(__webpack_require__.t.bind(__webpack_require__, 78902, 23)),
            loadMarkedPlugins()
        ]);
        // use load marked plugins
        for (const plugin of plugins) {
            marked.use(plugin);
        }
        // finish marked configuration
        _markedOptions = {
            // use the explicit async paradigm for `walkTokens`
            async: true,
            // enable all built-in GitHub-flavored Markdown opinions
            gfm: true,
            // asynchronously prepare for any special tokens, like highlighting and mermaid
            walkTokens,
            // use custom renderer
            renderer: makeRenderer(Renderer)
        };
        // complete initialization
        _marked = marked;
        _initializing.resolve(_marked);
        return _marked;
    }
    Private.initializeMarked = initializeMarked;
    /**
     * Load and use marked plugins.
     *
     * As of writing, both of these features would work without plugins, but emit
     * deprecation warnings.
     */
    async function loadMarkedPlugins() {
        // use loaded marked plugins
        return Promise.all([
            (async () => (await __webpack_require__.e(/* import() */ 976).then(__webpack_require__.t.bind(__webpack_require__, 976, 23))).gfmHeadingId())(),
            (async () => (await __webpack_require__.e(/* import() */ 2354).then(__webpack_require__.t.bind(__webpack_require__, 82354, 23))).mangle())()
        ]);
    }
    /**
     * Build a custom marked renderer.
     */
    function makeRenderer(Renderer_) {
        const renderer = new Renderer_();
        const originalCode = renderer.code;
        renderer.code = ({ text, lang, escaped }) => {
            // handle block renderers
            for (const block of _blocks) {
                if (lang && block.languages.includes(lang)) {
                    const rendered = block.render(text);
                    if (rendered != null) {
                        return rendered;
                    }
                }
            }
            // handle known highlighting
            const key = `${lang}${FENCE}${text}${FENCE}`;
            const highlight = _highlights.get(key);
            if (highlight != null) {
                return highlight;
            }
            // fall back to calling with the renderer as `this`
            return originalCode.call(renderer, { text, lang, escaped });
        };
        return renderer;
    }
    /**
     * Apply and cache syntax highlighting for code blocks.
     */
    async function highlight(token) {
        const { lang, text } = token;
        if (!lang || !_languages) {
            // no language(s), no highlight
            return;
        }
        const key = `${lang}${FENCE}${text}${FENCE}`;
        if (_highlights.get(key)) {
            // already cached, don't make another DOM element
            return;
        }
        const el = document.createElement('div');
        try {
            await _languages.highlight(text, _languages.findBest(lang), el);
            const html = `<pre><code class="language-${lang}">${el.innerHTML}</code></pre>`;
            _highlights.set(key, html);
        }
        catch (err) {
            console.error(`Failed to highlight ${lang} code`, err);
        }
        finally {
            el.remove();
        }
    }
    /**
     * After parsing, lazily load and render or highlight code blocks
     */
    async function walkTokens(token) {
        switch (token.type) {
            case 'code':
                if (token.lang) {
                    for (const block of _blocks) {
                        if (block.languages.includes(token.lang)) {
                            await block.walk(token.text);
                            return;
                        }
                    }
                }
                await highlight(token);
        }
    }
    /**
     * Extract heading metadata from markdown source.
     */
    async function getHeadingTokens(content, options) {
        if (!_marked) {
            _marked = await initializeMarked(options);
        }
        const headings = new Array();
        const tokens = _marked.lexer(content);
        // Extract heading tokens and compute line numbers
        // Include three token types that may contain headings:
        // - heading: Standard markdown headings (# Title)
        // - html: Standalone HTML heading blocks (<h1>Title</h1>)
        // - paragraph: Only paragraphs with nested HTML tokens (inline html tags) that might contain embedded headings (<span><h1>Title</h1></span>)
        let currentLine = 0;
        for (const token of tokens) {
            if (token.type === 'heading' ||
                (token.type === 'html' && containsHeadingTag(token.raw)) ||
                (token.type === 'paragraph' && containsInlineHeading(token))) {
                headings.push({
                    raw: token.raw,
                    line: currentLine
                });
            }
            currentLine += token.raw.split('\n').length - 1;
        }
        return headings;
    }
    Private.getHeadingTokens = getHeadingTokens;
    function containsHeadingTag(raw) {
        return HEADING_TAG_REGEX.test(raw);
    }
    function containsInlineHeading(token) {
        if (!token.tokens)
            return false;
        return token.tokens.some((t) => t.type === 'html' && containsHeadingTag(t.raw));
    }
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 16856:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/mermaid/style/index.js + 1 modules
var mermaid_style = __webpack_require__(66285);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/markedparser-extension/style/base.css
var base = __webpack_require__(50644);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markedparser-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/markedparser-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








/***/ }),

/***/ 11408:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MathJaxTypesetter: () => (/* binding */ MathJaxTypesetter),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61832);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module mathjax-extension
 */



var CommandIDs;
(function (CommandIDs) {
    /**
     * Copy raw LaTeX to clipboard.
     */
    CommandIDs.copy = 'mathjax:clipboard';
    /**
     * Scale MathJax elements.
     */
    CommandIDs.scale = 'mathjax:scale';
})(CommandIDs || (CommandIDs = {}));
/**
 * The MathJax Typesetter.
 */
class MathJaxTypesetter {
    constructor() {
        this._initialized = false;
    }
    async _ensureInitialized() {
        if (!this._initialized) {
            this._mathDocument = await Private.ensureMathDocument();
            this._initialized = true;
        }
    }
    /**
     * Get an instance of the MathDocument object.
     */
    async mathDocument() {
        await this._ensureInitialized();
        return this._mathDocument;
    }
    /**
     * Typeset the math in a node.
     */
    async typeset(node) {
        try {
            await this._ensureInitialized();
        }
        catch (e) {
            console.error(e);
            return;
        }
        this._mathDocument.options.elements = [node];
        this._mathDocument.clear().render();
        delete this._mathDocument.options.elements;
        Private.hardenAnchorLinks(node);
    }
}
/**
 * The MathJax extension.
 */
const mathJaxPlugin = {
    id: '@jupyterlab/mathjax-extension:plugin',
    description: 'Provides the LaTeX mathematical expression interpreter.',
    provides: _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__.ILatexTypesetter,
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.ITranslator],
    activate: (app, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator).load('jupyterlab');
        const typesetter = new MathJaxTypesetter();
        app.commands.addCommand(CommandIDs.copy, {
            execute: async () => {
                const md = await typesetter.mathDocument();
                const oJax = md.outputJax;
                await navigator.clipboard.writeText(oJax.math.math);
            },
            label: trans.__('MathJax Copy Latex'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        app.commands.addCommand(CommandIDs.scale, {
            execute: async (args) => {
                const md = await typesetter.mathDocument();
                const scale = args['scale'] || 1.0;
                md.outputJax.options.scale = scale;
                md.rerender();
                // Harden only the re-rendered anchors
                for (const math of md.math) {
                    const root = math.typesetRoot;
                    if (root) {
                        Private.hardenAnchorLinks(root);
                    }
                }
            },
            label: args => trans.__('Mathjax Scale ') +
                (args['scale'] ? `x${args['scale']}` : trans.__('Reset')),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        scale: {
                            type: 'number',
                            description: trans.__('The scale factor for MathJax rendering')
                        }
                    }
                }
            }
        });
        return typesetter;
    },
    autoStart: true
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mathJaxPlugin);
/**
 * A namespace for module-private functionality.
 */
var Private;
(function (Private) {
    let _loading = null;
    async function ensureMathDocument() {
        if (!_loading) {
            _loading = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
            void Promise.all(/* import() */[__webpack_require__.e(7969), __webpack_require__.e(5115), __webpack_require__.e(792)]).then(__webpack_require__.t.bind(__webpack_require__, 20792, 23));
            const [{ mathjax }, { CHTML }, { TeX }, { TeXFont }, { AllPackages }, { SafeHandler }, { HTMLHandler }, { browserAdaptor }, { AssistiveMmlHandler }] = await Promise.all([
                __webpack_require__.e(/* import() */ 4971).then(__webpack_require__.bind(__webpack_require__, 44971)),
                Promise.all(/* import() */[__webpack_require__.e(7969), __webpack_require__.e(28), __webpack_require__.e(2065), __webpack_require__.e(7369)]).then(__webpack_require__.t.bind(__webpack_require__, 57369, 23)),
                Promise.all(/* import() */[__webpack_require__.e(7969), __webpack_require__.e(5115), __webpack_require__.e(7154), __webpack_require__.e(7582)]).then(__webpack_require__.t.bind(__webpack_require__, 27582, 23)),
                Promise.all(/* import() */[__webpack_require__.e(2065), __webpack_require__.e(4498)]).then(__webpack_require__.t.bind(__webpack_require__, 42065, 23)),
                Promise.all(/* import() */[__webpack_require__.e(7969), __webpack_require__.e(5115), __webpack_require__.e(7154), __webpack_require__.e(8845)]).then(__webpack_require__.bind(__webpack_require__, 78845)),
                __webpack_require__.e(/* import() */ 8285).then(__webpack_require__.t.bind(__webpack_require__, 78285, 23)),
                Promise.all(/* import() */[__webpack_require__.e(7969), __webpack_require__.e(28), __webpack_require__.e(2666), __webpack_require__.e(7471)]).then(__webpack_require__.t.bind(__webpack_require__, 97471, 23)),
                __webpack_require__.e(/* import() */ 270).then(__webpack_require__.bind(__webpack_require__, 90270)),
                Promise.all(/* import() */[__webpack_require__.e(7969), __webpack_require__.e(28), __webpack_require__.e(2666), __webpack_require__.e(4105)]).then(__webpack_require__.t.bind(__webpack_require__, 74105, 23))
            ]);
            mathjax.handlers.register(AssistiveMmlHandler(SafeHandler(new HTMLHandler(browserAdaptor()))));
            class EmptyFont extends TeXFont {
            }
            EmptyFont.defaultFonts = {};
            const chtml = new CHTML({
                // Override dynamically generated fonts in favor of our font css
                font: new EmptyFont()
            });
            const tex = new TeX({
                packages: AllPackages.concat('require'),
                inlineMath: [
                    ['$', '$'],
                    ['\\(', '\\)']
                ],
                displayMath: [
                    ['$$', '$$'],
                    ['\\[', '\\]']
                ],
                processEscapes: true,
                processEnvironments: true
            });
            const mathDocument = mathjax.document(window.document, {
                InputJax: tex,
                OutputJax: chtml
            });
            _loading.resolve(mathDocument);
        }
        return _loading.promise;
    }
    Private.ensureMathDocument = ensureMathDocument;
    /**
     * Utility function to harden anchor links in a given element
     */
    function hardenAnchorLinks(element) {
        const anchors = element.querySelectorAll('.MathJax a');
        anchors.forEach(anchor => {
            // Add rel="noopener" if not already present
            const existingRel = anchor.rel || '';
            const relValues = existingRel.split(/\s+/).filter(v => v.length > 0);
            if (!relValues.includes('noopener')) {
                relValues.push('noopener');
            }
            anchor.rel = relValues.join(' ');
            // Add target="_blank" if not already present
            if (anchor.target !== '_blank') {
                anchor.target = '_blank';
            }
        });
    }
    Private.hardenAnchorLinks = hardenAnchorLinks;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 46165:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/mathjax-extension/style/base.css
var base = __webpack_require__(57730);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mathjax-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mathjax-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 79161:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CommandIDs: () => (/* binding */ CommandIDs),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82124);
/* harmony import */ var _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A namespace for mermaid text-based diagram commands.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.copySource = 'mermaid:copy-source';
})(CommandIDs || (CommandIDs = {}));
/**
 * A plugin for the core rendering/cachine of mermaid text-based diagrams
 */
const core = {
    id: '@jupyterlab/mermaid-extension:core',
    description: 'Provides the Mermaid manager.',
    autoStart: true,
    optional: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.IThemeManager],
    provides: _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.IMermaidManager,
    activate: (app, themes) => {
        const manager = new _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.MermaidManager({ themes });
        _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.RenderedMermaid.manager = manager;
        return manager;
    }
};
/**
 * A plugin for rendering mermaid text-based diagrams in markdown fenced code blocks
 */
const markdown = {
    id: '@jupyterlab/mermaid-extension:markdown',
    description: 'Provides the Mermaid markdown renderer.',
    autoStart: true,
    requires: [_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.IMermaidManager],
    provides: _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.IMermaidMarkdown,
    activate: (app, mermaid) => {
        return new _jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.MermaidMarkdown({ mermaid });
    }
};
/**
 * Contextual commands for mermaid text-based diagrams.
 */
const contextCommands = {
    id: '@jupyterlab/mermaid-extension:context-commands',
    description: 'Provides context menu commands for mermaid diagrams.',
    autoStart: true,
    requires: [_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.IMermaidManager],
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.ITranslator],
    activate: (app, mermaid, translator) => {
        const isMermaid = (node) => node.classList.contains(_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.MERMAID_CLASS);
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator).load('jupyterlab');
        app.commands.addCommand(CommandIDs.copySource, {
            label: trans.__('Mermaid Copy Diagram Source'),
            execute: async (args) => {
                const node = app.contextMenuHitTest(isMermaid);
                if (!node) {
                    return;
                }
                const code = node.querySelector(`.${_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.MERMAID_CODE_CLASS}`);
                if (!code || !code.textContent) {
                    return;
                }
                await navigator.clipboard.writeText(code.textContent);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        const options = { selector: `.${_jupyterlab_mermaid__WEBPACK_IMPORTED_MODULE_1__.MERMAID_CLASS}`, rank: 13 };
        app.contextMenu.addItem({ command: CommandIDs.copySource, ...options });
        app.contextMenu.addItem({ type: 'separator', ...options });
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([core, markdown, contextCommands]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 8604:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/mermaid/style/index.js + 1 modules
var mermaid_style = __webpack_require__(66285);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/mermaid-extension/style/base.css
var base = __webpack_require__(5238);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 92615:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  DETAILS_CLASS: () => (/* reexport */ DETAILS_CLASS),
  IMermaidManager: () => (/* reexport */ IMermaidManager),
  IMermaidMarkdown: () => (/* reexport */ IMermaidMarkdown),
  MERMAID_CLASS: () => (/* reexport */ MERMAID_CLASS),
  MERMAID_CODE_CLASS: () => (/* reexport */ MERMAID_CODE_CLASS),
  MERMAID_DARK_THEME: () => (/* reexport */ MERMAID_DARK_THEME),
  MERMAID_DEFAULT_THEME: () => (/* reexport */ MERMAID_DEFAULT_THEME),
  MERMAID_FILE_EXTENSIONS: () => (/* reexport */ MERMAID_FILE_EXTENSIONS),
  MERMAID_MIME_TYPE: () => (/* reexport */ MERMAID_MIME_TYPE),
  MermaidManager: () => (/* reexport */ MermaidManager),
  MermaidMarkdown: () => (/* reexport */ MermaidMarkdown),
  RE_DEFAULT_RENDERER: () => (/* reexport */ RE_DEFAULT_RENDERER),
  RenderedMermaid: () => (/* reexport */ RenderedMermaid),
  SUMMARY_CLASS: () => (/* reexport */ SUMMARY_CLASS),
  WARNING_CLASS: () => (/* reexport */ WARNING_CLASS),
  rendererFactory: () => (/* reexport */ rendererFactory)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

// documented upstream constants
const MERMAID_MIME_TYPE = 'text/vnd.mermaid';
const MERMAID_FILE_EXTENSIONS = ['.mmd', '.mermaid'];
// layout sniffing
const RE_DEFAULT_RENDERER = /\bdefaultRenderer["']?\s*:\s*(["']?)(\b[^"'\s]+\b)(\1)/gm;
// mermaid themes
const MERMAID_DEFAULT_THEME = 'default';
const MERMAID_DARK_THEME = 'dark';
// DOM
const MERMAID_CLASS = 'jp-RenderedMermaid';
const MERMAID_CODE_CLASS = 'mermaid';
const WARNING_CLASS = 'jp-mod-warning';
const DETAILS_CLASS = 'jp-RenderedMermaid-Details';
const SUMMARY_CLASS = 'jp-RenderedMermaid-Summary';
/**
 * The exported token for a mermaid manager
 */
const IMermaidManager = new index_js_.Token('@jupyterlab/mermaid:IMermaidManager', `a manager for rendering mermaid text-based diagrams`);
/**
 * The exported token for a mermaid manager
 */
const IMermaidMarkdown = new index_js_.Token('@jupyterlab/mermaid:IMermaidMarkdown', `a manager for rendering mermaid text-based diagrams in markdown fenced code blocks`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid/lib/manager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A mermaid diagram manager with cache.
 */
class MermaidManager {
    constructor(options = {}) {
        this._diagrams = new lib_index_js_.LruCache({ maxSize: options.maxCacheSize || null });
        // handle reacting to themes
        if (options.themes) {
            Private.initThemes(options.themes || null);
            options.themes.themeChanged.connect(this.initialize, this);
        }
    }
    /**
     * Post-process to ensure mermaid diagrams contain only valid SVG and XHTML.
     */
    static cleanMermaidSvg(svg) {
        svg = svg.replace(Private.RE_VOID_ELEMENT, Private.replaceVoidElement);
        return `${Private.SVG_XML_HEADER}${svg}`;
    }
    /**
     * Handle (re)-initializing mermaid based on external values.
     */
    initialize() {
        this._diagrams.clear();
        Private.initMermaid();
    }
    /**
     * Get the underlying, potentially un-initialized mermaid module.
     */
    async getMermaid() {
        return await Private.ensureMermaid();
    }
    /**
     * Get the version of the currently-loaded mermaid module
     */
    getMermaidVersion() {
        return Private.version();
    }
    /**
     * Get a pre-cached mermaid figure.
     *
     * This primarily exists for the needs of `marked`, which supports async node
     * visitors, but not async rendering.
     */
    getCachedFigure(text) {
        return this._diagrams.get(text);
    }
    /**
     * Attempt a raw rendering of mermaid to an SVG string, extracting some metadata.
     */
    async renderSvg(text) {
        const _mermaid = await this.getMermaid();
        await Private.ensureRenderers(text);
        const id = `jp-mermaid-${Private.nextMermaidId()}`;
        // create temporary element into which to render
        const el = document.createElement('div');
        document.body.appendChild(el);
        try {
            let { svg } = await _mermaid.render(id, text, el);
            svg = MermaidManager.cleanMermaidSvg(svg);
            const parser = new DOMParser();
            const doc = parser.parseFromString(svg, 'image/svg+xml');
            const info = { text, svg };
            const svgEl = doc.querySelector('svg');
            const { maxWidth } = (svgEl === null || svgEl === void 0 ? void 0 : svgEl.style) || {};
            info.width = maxWidth ? parseFloat(maxWidth) : null;
            const firstTitle = doc.querySelector('title');
            const firstDesc = doc.querySelector('desc');
            if (firstTitle) {
                info.accessibleTitle = firstTitle.textContent;
            }
            if (firstDesc) {
                info.accessibleDescription = firstDesc.textContent;
            }
            return info;
        }
        finally {
            el.remove();
        }
    }
    /**
     * Provide and cache a fully-rendered element, checking the cache first.
     */
    async renderFigure(text) {
        // bail if already cached
        let output = this._diagrams.get(text);
        if (output != null) {
            return output;
        }
        let className = MERMAID_CLASS;
        let result = null;
        // the element that will be returned
        output = document.createElement('div');
        output.className = className;
        try {
            const response = await this.renderSvg(text);
            result = this.makeMermaidFigure(response);
        }
        catch (err) {
            output.classList.add(WARNING_CLASS);
            result = await this.makeMermaidError(text);
        }
        let version = this.getMermaidVersion();
        if (version) {
            result.dataset.jpMermaidVersion = version;
        }
        output.appendChild(result);
        // update the cache for use when rendering synchronously
        this._diagrams.set(text, output);
        return output;
    }
    /**
     * Provide a code block with the mermaid source.
     */
    makeMermaidCode(text) {
        // append the source
        const pre = document.createElement('pre');
        const code = document.createElement('code');
        code.innerText = text;
        pre.appendChild(code);
        code.className = MERMAID_CODE_CLASS;
        code.textContent = text;
        return pre;
    }
    /**
     * Get the parser message element from a failed parse.
     *
     * This doesn't do much of anything if the text is successfully parsed.
     */
    async makeMermaidError(text) {
        const _mermaid = await this.getMermaid();
        let errorMessage = '';
        try {
            await _mermaid.parse(text);
        }
        catch (err) {
            errorMessage = `${err}`;
        }
        const result = document.createElement('details');
        result.className = DETAILS_CLASS;
        const summary = document.createElement('summary');
        summary.className = SUMMARY_CLASS;
        summary.appendChild(this.makeMermaidCode(text));
        result.appendChild(summary);
        const warning = document.createElement('pre');
        warning.innerText = errorMessage;
        result.appendChild(warning);
        return result;
    }
    /**
     * Extract extra attributes to add to a generated figure.
     */
    makeMermaidFigure(info) {
        const figure = document.createElement('figure');
        const img = document.createElement('img');
        figure.appendChild(img);
        img.setAttribute('src', `data:image/svg+xml,${encodeURIComponent(info.svg)}`);
        // add dimension information
        if (info.width) {
            img.width = info.width;
        }
        // add accessible alt title
        if (info.accessibleTitle) {
            img.setAttribute('alt', info.accessibleTitle);
        }
        figure.appendChild(this.makeMermaidCode(info.text));
        // add accessible caption, with fallback to raw mermaid source
        if (info.accessibleDescription) {
            const caption = document.createElement('figcaption');
            caption.className = 'sr-only';
            caption.textContent = info.accessibleDescription;
            figure.appendChild(caption);
        }
        return figure;
    }
}
/**
 * A namespace for global, private mermaid data.
 */
var Private;
(function (Private) {
    let _themes = null;
    let _mermaid = null;
    let _mermaidElk = null;
    let _loading = null;
    let _loadingElk = null;
    let _nextMermaidId = 0;
    let _version = null;
    /**
     * Cache a reference to the theme manager.
     */
    function initThemes(themes) {
        _themes = themes;
    }
    Private.initThemes = initThemes;
    /**
     * Get the version of mermaid used for rendering.
     */
    function version() {
        return _version;
    }
    Private.version = version;
    /**
     * (Re-)initialize mermaid with lab-specific theme information
     */
    function initMermaid(mermaid = null) {
        mermaid = _mermaid;
        if (!mermaid) {
            return false;
        }
        let theme = MERMAID_DEFAULT_THEME;
        if (_themes) {
            const jpTheme = _themes.theme;
            theme =
                jpTheme && _themes.isLight(jpTheme)
                    ? MERMAID_DEFAULT_THEME
                    : MERMAID_DARK_THEME;
        }
        const fontFamily = window
            .getComputedStyle(document.body)
            .getPropertyValue('--jp-ui-font-family');
        mermaid.initialize({
            theme,
            fontFamily,
            securityLevel: 'strict',
            maxTextSize: 100000,
            maxEdges: 100000,
            startOnLoad: false
        });
        return true;
    }
    Private.initMermaid = initMermaid;
    /**
     * Determine whether mermaid has been loaded yet.
     */
    function getMermaid() {
        return _mermaid;
    }
    Private.getMermaid = getMermaid;
    /**
     * Provide a globally-unique, but unstable, ID for disambiguation.
     */
    function nextMermaidId() {
        return _nextMermaidId++;
    }
    Private.nextMermaidId = nextMermaidId;
    /**
     * Ensure mermaid has been lazily loaded once, initialized, and cached.
     */
    async function ensureMermaid() {
        if (_mermaid != null) {
            return _mermaid;
        }
        if (_loading) {
            return _loading.promise;
        }
        _loading = new index_js_.PromiseDelegate();
        _version = (await __webpack_require__.e(/* import() */ 1169).then(__webpack_require__.t.bind(__webpack_require__, 21169, 19))).version;
        const tmpMermaid = (_mermaid = (await Promise.all(/* import() */[__webpack_require__.e(6577), __webpack_require__.e(5321), __webpack_require__.e(4406), __webpack_require__.e(1894)]).then(__webpack_require__.bind(__webpack_require__, 94406))).default);
        initMermaid(tmpMermaid);
        _mermaid = tmpMermaid;
        _loading.resolve(_mermaid);
        return _mermaid;
    }
    Private.ensureMermaid = ensureMermaid;
    /** Detect and load any renderers configured via `%init` or YAML front matter.
     *
     * The current upstream behavior appears to be last-in wins, but check all.
     */
    async function ensureRenderers(text) {
        let promises = [];
        for (const match of [...text.matchAll(RE_DEFAULT_RENDERER)]) {
            // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
            switch ((match && match[2]) || null) {
                case 'elk':
                    promises.push(Private.ensureMermaidElk());
                    break;
            }
        }
        if (promises.length) {
            await Promise.all(promises);
        }
    }
    Private.ensureRenderers = ensureRenderers;
    /**
     * Ensure mermaid-elk has been lazily loaded once, initialized, and cached.
     */
    async function ensureMermaidElk() {
        if (_mermaidElk != null) {
            return _mermaidElk;
        }
        if (_loadingElk) {
            return _loadingElk.promise;
        }
        _loadingElk = new index_js_.PromiseDelegate();
        const _mermaid = await ensureMermaid();
        const tmpElk = (await __webpack_require__.e(/* import() */ 5095).then(__webpack_require__.bind(__webpack_require__, 5095))).default;
        _mermaid.registerLayoutLoaders(tmpElk);
        _mermaidElk = tmpElk;
        _loadingElk.resolve(_mermaidElk);
        return _mermaidElk;
    }
    Private.ensureMermaidElk = ensureMermaidElk;
    /**
     * A regular expression for all void elements, which may include attributes and
     * a slash.
     *
     * @see https://developer.mozilla.org/en-US/docs/Glossary/Void_element
     *
     * Of these, only `<br>` is generated by Mermaid in place of `\n`,
     * but _any_ "malformed" tag will break the SVG rendering entirely.
     */
    Private.RE_VOID_ELEMENT = /<\s*(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)\s*([^>]*?)\s*>/gi;
    /**
     * Ensure a void element is closed with a slash, preserving any attributes.
     */
    function replaceVoidElement(match, tag, rest) {
        rest = rest.trim();
        if (!rest.endsWith('/')) {
            rest = `${rest} /`;
        }
        return `<${tag} ${rest}>`;
    }
    Private.replaceVoidElement = replaceVoidElement;
    /**
     * Named HTML entities with their decimal equivalent codes.
     *
     * @see https://www.w3.org/TR/WD-html40-970708/sgml/entities.html
     * */
    Private.HTML_ENTITIES = `<!ENTITY Aacute "&#193;">
<!ENTITY aacute "&#225;">
<!ENTITY Acirc "&#194;">
<!ENTITY acirc "&#226;">
<!ENTITY acute "&#180;">
<!ENTITY AElig "&#198;">
<!ENTITY aelig "&#230;">
<!ENTITY Agrave "&#192;">
<!ENTITY agrave "&#224;">
<!ENTITY alefsym "&#8501;">
<!ENTITY Alpha "&#913;">
<!ENTITY alpha "&#945;">
<!ENTITY amp "&#38;">
<!ENTITY and "&#8869;">
<!ENTITY ang "&#8736;">
<!ENTITY Aring "&#197;">
<!ENTITY aring "&#229;">
<!ENTITY asymp "&#8776;">
<!ENTITY Atilde "&#195;">
<!ENTITY atilde "&#227;">
<!ENTITY Auml "&#196;">
<!ENTITY auml "&#228;">
<!ENTITY bdquo "&#8222;">
<!ENTITY Beta "&#914;">
<!ENTITY beta "&#946;">
<!ENTITY brvbar "&#166;">
<!ENTITY bull "&#8226;">
<!ENTITY cap "&#8745;">
<!ENTITY Ccedil "&#199;">
<!ENTITY ccedil "&#231;">
<!ENTITY cedil "&#184;">
<!ENTITY cent "&#162;">
<!ENTITY Chi "&#935;">
<!ENTITY chi "&#967;">
<!ENTITY circ "&#710;">
<!ENTITY clubs "&#9827;">
<!ENTITY cong "&#8773;">
<!ENTITY copy "&#169;">
<!ENTITY crarr "&#8629;">
<!ENTITY cup "&#8746;">
<!ENTITY curren "&#164;">
<!ENTITY dagger "&#8224;">
<!ENTITY Dagger "&#8225;">
<!ENTITY darr "&#8595;">
<!ENTITY dArr "&#8659;">
<!ENTITY deg "&#176;">
<!ENTITY Delta "&#916;">
<!ENTITY delta "&#948;">
<!ENTITY diams "&#9830;">
<!ENTITY divide "&#247;">
<!ENTITY Eacute "&#201;">
<!ENTITY eacute "&#233;">
<!ENTITY Ecirc "&#202;">
<!ENTITY ecirc "&#234;">
<!ENTITY Egrave "&#200;">
<!ENTITY egrave "&#232;">
<!ENTITY empty "&#8709;">
<!ENTITY emsp "&#8195;">
<!ENTITY ensp "&#8194;">
<!ENTITY epsilon "&#949;">
<!ENTITY Epsilon "&#917;">
<!ENTITY equiv "&#8801;">
<!ENTITY Eta "&#919;">
<!ENTITY eta "&#951;">
<!ENTITY ETH "&#208;">
<!ENTITY eth "&#240;">
<!ENTITY Euml "&#203;">
<!ENTITY euml "&#235;">
<!ENTITY exist "&#8707;">
<!ENTITY fnof "&#402;">
<!ENTITY forall "&#8704;">
<!ENTITY frac12 "&#189;">
<!ENTITY frac14 "&#188;">
<!ENTITY frac34 "&#190;">
<!ENTITY frasl "&#8260;">
<!ENTITY Gamma "&#915;">
<!ENTITY gamma "&#947;">
<!ENTITY ge "&#8805;">
<!ENTITY gt "&#62;">
<!ENTITY harr "&#8596;">
<!ENTITY hArr "&#8660;">
<!ENTITY hearts "&#9829;">
<!ENTITY hellip "&#8230;">
<!ENTITY Iacute "&#205;">
<!ENTITY iacute "&#237;">
<!ENTITY Icirc "&#206;">
<!ENTITY icirc "&#238;">
<!ENTITY iexcl "&#161;">
<!ENTITY Igrave "&#204;">
<!ENTITY igrave "&#236;">
<!ENTITY image "&#8465;">
<!ENTITY infin "&#8734;">
<!ENTITY int "&#8747;">
<!ENTITY Iota "&#921;">
<!ENTITY iota "&#953;">
<!ENTITY iquest "&#191;">
<!ENTITY isin "&#8712;">
<!ENTITY Iuml "&#207;">
<!ENTITY iuml "&#239;">
<!ENTITY Kappa "&#922;">
<!ENTITY kappa "&#954;">
<!ENTITY Lambda "&#923;">
<!ENTITY lambda "&#955;">
<!ENTITY lang "&#9001;">
<!ENTITY laquo "&#171;">
<!ENTITY larr "&#8592;">
<!ENTITY lArr "&#8656;">
<!ENTITY lceil "&#8968;">
<!ENTITY ldquo "&#8220;">
<!ENTITY le "&#8804;">
<!ENTITY lfloor "&#8970;">
<!ENTITY lowast "&#8727;">
<!ENTITY loz "&#9674;">
<!ENTITY lrm "&#8206;">
<!ENTITY lsaquo "&#8249;">
<!ENTITY lsquo "&#8216;">
<!ENTITY lt "&#60;">
<!ENTITY macr "&#175;">
<!ENTITY mdash "&#8212;">
<!ENTITY micro "&#181;">
<!ENTITY middot "&#183;">
<!ENTITY minus "&#8722;">
<!ENTITY Mu "&#924;">
<!ENTITY mu "&#956;">
<!ENTITY nabla "&#8711;">
<!ENTITY nbsp "&#160;">
<!ENTITY ndash "&#8211;">
<!ENTITY ne "&#8800;">
<!ENTITY ni "&#8715;">
<!ENTITY not "&#172;">
<!ENTITY notin "&#8713;">
<!ENTITY nsub "&#8836;">
<!ENTITY Ntilde "&#209;">
<!ENTITY ntilde "&#241;">
<!ENTITY Nu "&#925;">
<!ENTITY nu "&#957;">
<!ENTITY Oacute "&#211;">
<!ENTITY oacute "&#243;">
<!ENTITY Ocirc "&#212;">
<!ENTITY ocirc "&#244;">
<!ENTITY OElig "&#338;">
<!ENTITY oelig "&#339;">
<!ENTITY Ograve "&#210;">
<!ENTITY ograve "&#242;">
<!ENTITY oline "&#8254;">
<!ENTITY Omega "&#937;">
<!ENTITY omega "&#969;">
<!ENTITY Omicron "&#927;">
<!ENTITY omicron "&#959;">
<!ENTITY oplus "&#8853;">
<!ENTITY or "&#8870;">
<!ENTITY ordf "&#170;">
<!ENTITY ordm "&#186;">
<!ENTITY Oslash "&#216;">
<!ENTITY oslash "&#248;">
<!ENTITY Otilde "&#213;">
<!ENTITY otilde "&#245;">
<!ENTITY otimes "&#8855;">
<!ENTITY Ouml "&#214;">
<!ENTITY ouml "&#246;">
<!ENTITY para "&#182;">
<!ENTITY part "&#8706;">
<!ENTITY permil "&#8240;">
<!ENTITY perp "&#8869;">
<!ENTITY Phi "&#934;">
<!ENTITY phi "&#966;">
<!ENTITY Pi "&#928;">
<!ENTITY pi "&#960;">
<!ENTITY piv "&#982;">
<!ENTITY plusmn "&#177;">
<!ENTITY pound "&#163;">
<!ENTITY prime "&#8242;">
<!ENTITY Prime "&#8243;">
<!ENTITY prod "&#8719;">
<!ENTITY prop "&#8733;">
<!ENTITY Psi "&#936;">
<!ENTITY psi "&#968;">
<!ENTITY quot "&#34;">
<!ENTITY radic "&#8730;">
<!ENTITY rang "&#9002;">
<!ENTITY raquo "&#187;">
<!ENTITY rarr "&#8594;">
<!ENTITY rArr "&#8658;">
<!ENTITY rceil "&#8969;">
<!ENTITY rdquo "&#8221;">
<!ENTITY real "&#8476;">
<!ENTITY reg "&#174;">
<!ENTITY rfloor "&#8971;">
<!ENTITY Rho "&#929;">
<!ENTITY rho "&#961;">
<!ENTITY rlm "&#8207;">
<!ENTITY rsaquo "&#8250;">
<!ENTITY rsquo "&#8217;">
<!ENTITY sbquo "&#8218;">
<!ENTITY Scaron "&#352;">
<!ENTITY scaron "&#353;">
<!ENTITY sdot "&#8901;">
<!ENTITY sect "&#167;">
<!ENTITY shy "&#173;">
<!ENTITY Sigma "&#931;">
<!ENTITY sigma "&#963;">
<!ENTITY sigmaf "&#962;">
<!ENTITY sim "&#8764;">
<!ENTITY spades "&#9824;">
<!ENTITY sub "&#8834;">
<!ENTITY sube "&#8838;">
<!ENTITY sum "&#8721;">
<!ENTITY sup "&#8835;">
<!ENTITY sup1 "&#185;">
<!ENTITY sup2 "&#178;">
<!ENTITY sup3 "&#179;">
<!ENTITY supe "&#8839;">
<!ENTITY szlig "&#223;">
<!ENTITY Tau "&#932;">
<!ENTITY tau "&#964;">
<!ENTITY there4 "&#8756;">
<!ENTITY Theta "&#920;">
<!ENTITY theta "&#952;">
<!ENTITY thetasym "&#977;">
<!ENTITY thinsp "&#8201;">
<!ENTITY THORN "&#222;">
<!ENTITY thorn "&#254;">
<!ENTITY tilde "&#732;">
<!ENTITY times "&#215;">
<!ENTITY trade "&#8482;">
<!ENTITY Uacute "&#218;">
<!ENTITY uacute "&#250;">
<!ENTITY uarr "&#8593;">
<!ENTITY uArr "&#8657;">
<!ENTITY Ucirc "&#219;">
<!ENTITY ucirc "&#251;">
<!ENTITY Ugrave "&#217;">
<!ENTITY ugrave "&#249;">
<!ENTITY uml "&#168;">
<!ENTITY upsih "&#978;">
<!ENTITY Upsilon "&#933;">
<!ENTITY upsilon "&#965;">
<!ENTITY Uuml "&#220;">
<!ENTITY uuml "&#252;">
<!ENTITY weierp "&#8472;">
<!ENTITY Xi "&#926;">
<!ENTITY xi "&#958;">
<!ENTITY Yacute "&#221;">
<!ENTITY yacute "&#253;">
<!ENTITY yen "&#165;">
<!ENTITY Yuml "&#376;">
<!ENTITY yuml "&#255;">
<!ENTITY Zeta "&#918;">
<!ENTITY zeta "&#950;">
<!ENTITY zwj "&#8205;">
<!ENTITY zwnj "&#8204;">`.replace(/\n/g, ' ');
    /**
     * A reasonably strict xml declaration.
     */
    const XML_DECL = '<?xml version="1.0" standalone="no"?>';
    /**
     * The beginning of the XML doctype declaration.
     */
    const DOCTYPE_START = `<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [`;
    /**
     * The end of the XML docype declaration.
     */
    const DOCTYPE_END = ']>';
    /**
     * A full header for an SVG XML document.
     */
    Private.SVG_XML_HEADER = `${XML_DECL}
    ${DOCTYPE_START}${Private.HTML_ENTITIES}${DOCTYPE_END}`;
})(Private || (Private = {}));
//# sourceMappingURL=manager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid/lib/markdown.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * An implementation of mermaid fenced code blocks in markdown.
 */
class MermaidMarkdown {
    constructor(options) {
        this.languages = ['mermaid'];
        this.rank = 100;
        this._mermaid = options.mermaid;
    }
    /**
     * Pre-parse and cache the rendered text.
     */
    async walk(text) {
        await this._mermaid.renderFigure(text);
    }
    /**
     * Render the diagram.
     */
    render(text) {
        // handle pre-cached mermaid figures
        let cachedFigure = this._mermaid.getCachedFigure(text);
        if (cachedFigure) {
            return cachedFigure.outerHTML;
        }
        return null;
    }
}
//# sourceMappingURL=markdown.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid/lib/mime.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module mermaid-extension
 */



const SVG_MIME = 'image/svg+xml';
/**
 * A widget for rendering mermaid text-based diagrams, for usage with rendermime.
 */
class RenderedMermaid extends index_es6_js_.Widget {
    /**
     * Create a new widget for rendering Vega/Vega-Lite.
     */
    constructor(options) {
        super();
        this._lastRendered = null;
        this._mimeType = options.mimeType;
        this.addClass(MERMAID_CLASS);
    }
    static set manager(manager) {
        if (RenderedMermaid._manager) {
            console.warn('Mermaid manager may only be set once, and is already set.');
            return;
        }
        RenderedMermaid._manager = manager;
        RenderedMermaid._managerReady.resolve(manager);
    }
    /**
     * Render mermaid text-based diagrams into this widget's node.
     */
    async renderModel(model) {
        const manager = await RenderedMermaid._managerReady.promise;
        const text = model.data[this._mimeType];
        if (text == null || text === this._lastRendered) {
            return;
        }
        this._lastRendered = text;
        // get a div containing a figure or parser message
        const figure = await manager.renderFigure(text);
        if (figure.classList.contains(WARNING_CLASS)) {
            this.node.classList.add(WARNING_CLASS);
        }
        else {
            this.node.classList.remove(WARNING_CLASS);
        }
        if (!figure.firstChild) {
            return;
        }
        if (this.node.innerHTML !== figure.innerHTML) {
            this.node.innerHTML = figure.innerHTML;
        }
        // capture the version of mermaid used
        const version = manager.getMermaidVersion();
        const mermaidMetadata = {
            ...(model.metadata[MERMAID_MIME_TYPE] || {}),
            version
        };
        const metadata = {
            ...model.metadata,
            [MERMAID_MIME_TYPE]: mermaidMetadata
        };
        // if available, set the fully-rendered SVG
        const img = figure.querySelector('img');
        if (img) {
            const svg = decodeURIComponent(img.src.split(',')[1]);
            const oldSvg = model.data[SVG_MIME];
            if (svg !== oldSvg) {
                model.setData({
                    data: { ...model.data, [SVG_MIME]: svg },
                    metadata
                });
            }
        }
        else {
            const dataWithoutSvg = { ...model.data };
            delete dataWithoutSvg[SVG_MIME];
            model.setData({ data: dataWithoutSvg, metadata });
        }
    }
}
RenderedMermaid._manager = null;
RenderedMermaid._managerReady = new index_js_.PromiseDelegate();
/**
 * A mime renderer factory for mermaid text-based diagrams.
 */
const rendererFactory = {
    safe: true,
    mimeTypes: [MERMAID_MIME_TYPE],
    createRenderer: options => new RenderedMermaid(options)
};
//# sourceMappingURL=mime.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module mermaid
 */




//# sourceMappingURL=index.js.map

/***/ }),

/***/ 66285:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/mermaid/style/base.css
var base = __webpack_require__(26751);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/mermaid/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 89335:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58448);
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_metadataform__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63368);
/* harmony import */ var _jupyterlab_metadataform__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_metadataform__WEBPACK_IMPORTED_MODULE_5__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module metadataform-extension
 */






const PLUGIN_ID = '@jupyterlab/metadataform-extension:metadataforms';
var Private;
(function (Private) {
    async function loadSettingsMetadataForm(app, registry, notebookTools, translator, formComponentRegistry) {
        var _a;
        let canonical;
        let loaded = {};
        /**
         * Populate the plugin's schema defaults.
         */
        function populate(schema) {
            loaded = {};
            schema.properties.metadataforms.default = Object.keys(registry.plugins)
                .map(plugin => {
                var _a;
                const metadataForms = (_a = registry.plugins[plugin].schema['jupyter.lab.metadataforms']) !== null && _a !== void 0 ? _a : [];
                metadataForms.forEach(metadataForm => {
                    metadataForm._origin = plugin;
                });
                loaded[plugin] = metadataForms;
                return metadataForms;
            })
                .concat([schema['jupyter.lab.metadataforms']])
                .reduce((acc, val) => {
                // If a MetadataForm with the same ID already exists,
                // the metadataKeys will be concatenated to this MetadataForm's metadataKeys .
                // Otherwise, the whole MetadataForm will be pushed as a new form.
                val.forEach(value => {
                    const metadataForm = acc.find(addedValue => {
                        return addedValue.id === value.id;
                    });
                    if (metadataForm) {
                        // TODO do insertion of metadataSchema properties in a generic way.
                        // Currently this only support 'properties', 'allOf' and 'required'.
                        //  - add or replace entries if it is an object.
                        //  - concat if it is an array.
                        //  - replace if it is a primitive ?
                        // Includes new metadataKey in the existing metadataSchema.
                        // Overwrites if the metadataKey already exists.
                        for (let [metadataKey, properties] of Object.entries(value.metadataSchema.properties)) {
                            metadataForm.metadataSchema.properties[metadataKey] =
                                properties;
                        }
                        // Includes required fields.
                        if (value.metadataSchema.required) {
                            if (!metadataForm.metadataSchema.required) {
                                metadataForm.metadataSchema.required =
                                    value.metadataSchema.required;
                            }
                            else {
                                metadataForm.metadataSchema.required.concat(value.metadataSchema.required);
                            }
                        }
                        // Includes allOf array in the existing metadataSchema.
                        if (value.metadataSchema.allOf) {
                            if (!metadataForm.metadataSchema.allOf) {
                                metadataForm.metadataSchema.allOf =
                                    value.metadataSchema.allOf;
                            }
                            else {
                                metadataForm.metadataSchema.allOf.concat(value.metadataSchema.allOf);
                            }
                        }
                        // Includes uiSchema in the existing uiSchema.
                        // Overwrites if the uiSchema already exists for that metadataKey.
                        if (value.uiSchema) {
                            if (!metadataForm.uiSchema)
                                metadataForm.uiSchema = {};
                            for (let [metadataKey, ui] of Object.entries(value.uiSchema)) {
                                metadataForm.uiSchema[metadataKey] = ui;
                            }
                        }
                        // Includes metadataOptions in the existing uiSchema.
                        // Overwrites if options already exists for that metadataKey.
                        if (value.metadataOptions) {
                            if (!metadataForm.metadataOptions)
                                metadataForm.metadataOptions = {};
                            for (let [metadataKey, options] of Object.entries(value.metadataOptions)) {
                                metadataForm.metadataOptions[metadataKey] = options;
                            }
                        }
                    }
                    else {
                        acc.push(value);
                    }
                });
                return acc;
            }, []); // flatten one level;
        }
        // Transform the plugin object to return different schema than the default.
        registry.transform(PLUGIN_ID, {
            compose: plugin => {
                var _a, _b, _c, _d;
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                const defaults = (_c = (_b = (_a = canonical.properties) === null || _a === void 0 ? void 0 : _a.metadataforms) === null || _b === void 0 ? void 0 : _b.default) !== null && _c !== void 0 ? _c : [];
                const user = {
                    metadataforms: (_d = plugin.data.user.metadataforms) !== null && _d !== void 0 ? _d : []
                };
                const composite = {
                    metadataforms: defaults.concat(user.metadataforms)
                };
                plugin.data = { composite, user };
                return plugin;
            },
            fetch: plugin => {
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                return {
                    data: plugin.data,
                    id: plugin.id,
                    raw: plugin.raw,
                    schema: canonical,
                    version: plugin.version
                };
            }
        });
        // Repopulate the canonical variable after the setting registry has
        // preloaded all initial plugins.
        canonical = null;
        const settings = await registry.load(PLUGIN_ID);
        const metadataForms = new _jupyterlab_metadataform__WEBPACK_IMPORTED_MODULE_5__.MetadataFormProvider();
        // Creates all the forms from extensions settings.
        for (let schema of settings.composite
            .metadataforms) {
            let metaInformation = {};
            let metadataSchema = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.deepCopy(schema.metadataSchema);
            let uiSchema = {};
            if (schema.uiSchema) {
                uiSchema = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.deepCopy(schema.uiSchema);
            }
            for (let [metadataKey, properties] of Object.entries(metadataSchema.properties)) {
                if (properties.default) {
                    if (!metaInformation[metadataKey])
                        metaInformation[metadataKey] = {};
                    metaInformation[metadataKey].default = properties.default;
                }
            }
            if (schema.metadataOptions) {
                for (let [metadataKey, options] of Object.entries(schema.metadataOptions)) {
                    // Optionally links key to cell type.
                    if (options.cellTypes) {
                        if (!metaInformation[metadataKey])
                            metaInformation[metadataKey] = {};
                        metaInformation[metadataKey].cellTypes = options.cellTypes;
                    }
                    // Optionally links key to metadata level.
                    if (options.metadataLevel) {
                        if (!metaInformation[metadataKey])
                            metaInformation[metadataKey] = {};
                        metaInformation[metadataKey].level = options.metadataLevel;
                    }
                    // Optionally set the writeDefault flag.
                    if (options.writeDefault !== undefined) {
                        if (!metaInformation[metadataKey])
                            metaInformation[metadataKey] = {};
                        metaInformation[metadataKey].writeDefault = options.writeDefault;
                    }
                    // Optionally links key to a custom widget.
                    if (options.customRenderer) {
                        const component = formComponentRegistry.getRenderer(options.customRenderer);
                        // If renderer is defined (custom widget has been registered), set it as used widget.
                        if (component !== undefined) {
                            if (!uiSchema[metadataKey])
                                uiSchema[metadataKey] = {};
                            if (component.fieldRenderer) {
                                uiSchema[metadataKey]['ui:field'] = component.fieldRenderer;
                            }
                            else {
                                uiSchema[metadataKey]['ui:widget'] = component.widgetRenderer;
                            }
                        }
                    }
                }
            }
            // Adds a section to notebookTools.
            notebookTools.addSection({
                sectionName: schema.id,
                rank: schema.rank,
                label: (_a = schema.label) !== null && _a !== void 0 ? _a : schema.id
            });
            // Creates the tool.
            const tool = new _jupyterlab_metadataform__WEBPACK_IMPORTED_MODULE_5__.MetadataFormWidget({
                metadataSchema: metadataSchema,
                metaInformation: metaInformation,
                uiSchema: uiSchema,
                pluginId: schema._origin,
                translator: translator,
                showModified: schema.showModified
            });
            // Adds the form to the section.
            notebookTools.addItem({ section: schema.id, tool: tool });
            metadataForms.add(schema.id, tool);
        }
        return metadataForms;
    }
    Private.loadSettingsMetadataForm = loadSettingsMetadataForm;
})(Private || (Private = {}));
/**
 * The metadata form plugin.
 */
const metadataForm = {
    id: PLUGIN_ID,
    description: 'Provides the metadata form registry.',
    autoStart: true,
    requires: [
        _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__.INotebookTools,
        _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.ITranslator,
        _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.IFormRendererRegistry,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__.ISettingRegistry
    ],
    provides: _jupyterlab_metadataform__WEBPACK_IMPORTED_MODULE_5__.IMetadataFormProvider,
    activate: async (app, notebookTools, translator, componentsRegistry, settings) => {
        return await Private.loadSettingsMetadataForm(app, settings, notebookTools, translator, componentsRegistry);
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (metadataForm);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 26053:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_notebook_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(47456);
/* harmony import */ var _jupyterlab_metadataform_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37083);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 22924:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  FormWidget: () => (/* reexport */ FormWidget),
  IMetadataFormProvider: () => (/* reexport */ IMetadataFormProvider),
  MetadataFormProvider: () => (/* reexport */ MetadataFormProvider),
  MetadataFormWidget: () => (/* reexport */ MetadataFormWidget)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @rjsf/validator-ajv8@^5.13.4 (strict) (fallback: ../node_modules/@rjsf/validator-ajv8/lib/index.js)
var validator_ajv8_lib_index_js_ = __webpack_require__(27478);
var validator_ajv8_lib_index_js_default = /*#__PURE__*/__webpack_require__.n(validator_ajv8_lib_index_js_);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/metadataform/lib/form.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module metadataform
 */




/**
 * A ReactWidget with the form itself.
 */
class FormWidget extends index_js_.ReactWidget {
    /**
     * Constructs a new FormWidget.
     */
    constructor(props) {
        super();
        this.addClass('jp-FormWidget');
        this._props = props;
    }
    /**
     * Render the form.
     * @returns - The rendered form
     */
    render() {
        const formContext = {
            defaultFormData: this._props.settings.default(),
            updateMetadata: this._props.metadataFormWidget.updateMetadata
        };
        return (react_index_js_default().createElement(lib_index_js_.FormComponent, { validator: (validator_ajv8_lib_index_js_default()), schema: this._props.properties, formData: this._props.formData, formContext: formContext, uiSchema: this._props.uiSchema, liveValidate: true, idPrefix: `jp-MetadataForm-${this._props.pluginId}`, onChange: (e) => {
                this._props.metadataFormWidget.updateMetadata(e.formData || {});
            }, compact: true, showModifiedFromDefault: this._props.showModified, translator: this._props.translator }));
    }
}
//# sourceMappingURL=form.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/notebook@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/notebook/lib/index.js)
var notebook_lib_index_js_ = __webpack_require__(58448);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/metadataform/lib/metadataform.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module metadataform
 */






/**
 * A class that create a metadata form widget
 */
class MetadataFormWidget extends notebook_lib_index_js_.NotebookTools.Tool {
    /**
     * Construct an empty widget.
     */
    constructor(options) {
        super();
        /**
         * Update the metadata of the current cell or notebook.
         *
         * @param formData - the cell metadata set in the form.
         * @param reload - whether to update the form after updating the metadata.
         *
         * ## Notes
         * Metadata are updated from root only. If some metadata is nested,
         * the whole root object must be updated.
         * This function build an object with all the root object to update
         * in metadata before performing update.
         * It uses an arrow function to allow using 'this' properly when called from a custom field.
         */
        this.updateMetadata = (formData, reload) => {
            var _a, _b, _c, _d, _e, _f, _g, _h;
            if (this.notebookTools == undefined)
                return;
            const notebook = this.notebookTools.activeNotebookPanel;
            const cell = this.notebookTools.activeCell;
            if (cell == null)
                return;
            this._updatingMetadata = true;
            // An object representing the cell metadata to modify.
            const cellMetadataObject = {};
            // An object representing the notebook metadata to modify.
            const notebookMetadataObject = {};
            for (let [metadataKey, value] of Object.entries(formData)) {
                // Continue if the metadataKey does not exist in schema.
                if (!this.metadataKeys.includes(metadataKey))
                    continue;
                // Continue if the metadataKey is a notebook level one and there is no NotebookModel.
                if (((_a = this._metaInformation[metadataKey]) === null || _a === void 0 ? void 0 : _a.level) === 'notebook' &&
                    this._notebookModelNull)
                    continue;
                // Continue if the metadataKey is not applicable to the cell type.
                if (((_b = this._metaInformation[metadataKey]) === null || _b === void 0 ? void 0 : _b.cellTypes) &&
                    !((_d = (_c = this._metaInformation[metadataKey]) === null || _c === void 0 ? void 0 : _c.cellTypes) === null || _d === void 0 ? void 0 : _d.includes(cell.model.type))) {
                    continue;
                }
                let currentMetadata;
                let metadataObject;
                // Linking the working variable to the corresponding metadata and representation.
                if (((_e = this._metaInformation[metadataKey]) === null || _e === void 0 ? void 0 : _e.level) === 'notebook') {
                    // Working on notebook metadata.
                    currentMetadata = notebook.model.metadata;
                    metadataObject = notebookMetadataObject;
                }
                else {
                    // Working on cell metadata.
                    currentMetadata = cell.model.metadata;
                    metadataObject = cellMetadataObject;
                }
                // Remove first and last '/' if necessary and split the path.
                let nestedKey = metadataKey
                    .replace(/^\/+/, '')
                    .replace(/\/+$/, '')
                    .split('/');
                let baseMetadataKey = nestedKey[0];
                if (baseMetadataKey == undefined)
                    continue;
                let writeFinalData = value !== undefined &&
                    (((_g = (_f = this._metaInformation[metadataKey]) === null || _f === void 0 ? void 0 : _f.writeDefault) !== null && _g !== void 0 ? _g : true) ||
                        value !== ((_h = this._metaInformation[metadataKey]) === null || _h === void 0 ? void 0 : _h.default));
                // If metadata key is at root of metadata no need to go further.
                if (nestedKey.length == 1) {
                    if (writeFinalData)
                        metadataObject[baseMetadataKey] = value;
                    else
                        metadataObject[baseMetadataKey] = undefined;
                    continue;
                }
                let intermediateMetadataKeys = nestedKey.slice(1, -1);
                let finalMetadataKey = nestedKey[nestedKey.length - 1];
                // Deep copy of the metadata if not already done.
                if (!(baseMetadataKey in metadataObject)) {
                    metadataObject[baseMetadataKey] = currentMetadata[baseMetadataKey];
                }
                if (metadataObject[baseMetadataKey] === undefined)
                    metadataObject[baseMetadataKey] = {};
                // Let's have an object which points to the nested key.
                let workingObject = metadataObject[baseMetadataKey];
                let finalObjectReached = true;
                for (let nested of intermediateMetadataKeys) {
                    // If one of the nested object does not exist, this object is created
                    // only if there is a final data to write.
                    if (!(nested in workingObject)) {
                        if (!writeFinalData) {
                            finalObjectReached = false;
                            break;
                        }
                        else
                            workingObject[nested] = {};
                    }
                    workingObject = workingObject[nested];
                }
                // Write the value to the nested key or remove all empty object before the nested key,
                // only if the final object has been reached.
                if (finalObjectReached) {
                    if (!writeFinalData)
                        delete workingObject[finalMetadataKey];
                    else
                        workingObject[finalMetadataKey] = value;
                }
                // If the final nested data has been deleted, let see if there is not remaining
                // empty objects to remove.
                if (!writeFinalData) {
                    metadataObject[baseMetadataKey] = Private.deleteEmptyNested(metadataObject[baseMetadataKey], nestedKey.slice(1));
                    if (!Object.keys(metadataObject[baseMetadataKey])
                        .length)
                        metadataObject[baseMetadataKey] = undefined;
                }
            }
            // Set the cell metadata or delete it if value is undefined or empty object.
            for (let [key, value] of Object.entries(cellMetadataObject)) {
                if (value === undefined)
                    cell.model.deleteMetadata(key);
                else
                    cell.model.setMetadata(key, value);
            }
            // Set the notebook metadata or delete it if value is undefined or empty object.
            if (!this._notebookModelNull) {
                for (let [key, value] of Object.entries(notebookMetadataObject)) {
                    if (value === undefined)
                        notebook.model.deleteMetadata(key);
                    else
                        notebook.model.setMetadata(key, value);
                }
            }
            this._updatingMetadata = false;
            if (reload) {
                this._update();
            }
        };
        this._notebookModelNull = false;
        this._metadataSchema = options.metadataSchema;
        this._metaInformation = options.metaInformation;
        this._uiSchema = options.uiSchema || {};
        this._pluginId = options.pluginId;
        this._showModified = options.showModified || false;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._updatingMetadata = false;
        const layout = (this.layout = new index_es6_js_.SingletonLayout());
        const node = document.createElement('div');
        const content = document.createElement('div');
        content.textContent = this._trans.__('No metadata.');
        content.className = 'jp-MetadataForm-placeholderContent';
        node.appendChild(content);
        this._placeholder = new index_es6_js_.Widget({ node });
        this._placeholder.addClass('jp-MetadataForm-placeholder');
        layout.widget = this._placeholder;
    }
    /**
     * Get the form object itself.
     */
    get form() {
        return this._form;
    }
    /**
     * Get the list of existing metadataKey (array of string).
     *
     * ## NOTE:
     * The list contains also the conditional fields, which are not necessary
     * displayed and filled.
     */
    get metadataKeys() {
        var _a;
        const metadataKeys = [];
        // MetadataKey from schema.
        for (let metadataKey of Object.keys(this._metadataSchema.properties)) {
            metadataKeys.push(metadataKey);
        }
        // Possible additional metadataKeys from conditional schema.
        (_a = this._metadataSchema.allOf) === null || _a === void 0 ? void 0 : _a.forEach(conditional => {
            if (conditional.then !== undefined) {
                if (conditional.then.properties !== undefined) {
                    let properties = conditional.then
                        .properties;
                    for (let metadataKey of Object.keys(properties)) {
                        if (!metadataKeys.includes(metadataKey))
                            metadataKeys.push(metadataKey);
                    }
                }
            }
            if (conditional.else !== undefined) {
                if (conditional.else.properties !== undefined) {
                    let properties = conditional.else
                        .properties;
                    for (let metadataKey of Object.keys(properties)) {
                        if (!metadataKeys.includes(metadataKey))
                            metadataKeys.push(metadataKey);
                    }
                }
            }
        });
        return metadataKeys;
    }
    /**
     * Get the properties of a MetadataKey.
     *
     * @param metadataKey - metadataKey (string).
     */
    getProperties(metadataKey) {
        return (dist_index_js_.JSONExt.deepCopy(this._metadataSchema.properties[metadataKey]) || null);
    }
    /**
     * Set properties to a metadataKey.
     *
     * @param metadataKey - metadataKey (string).
     * @param properties - the properties to add or modify.
     */
    setProperties(metadataKey, properties) {
        Object.entries(properties).forEach(([key, value]) => {
            this._metadataSchema.properties[metadataKey][key] = value;
        });
    }
    /**
     * Set the content of the widget.
     */
    setContent(content) {
        const layout = this.layout;
        if (layout.widget) {
            layout.widget.removeClass('jp-MetadataForm-content');
            layout.removeWidget(layout.widget);
        }
        if (!content) {
            content = this._placeholder;
        }
        content.addClass('jp-MetadataForm-content');
        layout.widget = content;
    }
    /**
     * Build widget.
     */
    buildWidget(props) {
        this._form = new FormWidget(props);
        this._form.addClass('jp-MetadataForm');
        this.setContent(this._form);
    }
    /**
     * Update the form when the widget is displayed.
     */
    onAfterShow(msg) {
        this._update();
    }
    /**
     * Handle a change to the active cell.
     */
    onActiveCellChanged(msg) {
        if (this.isVisible)
            this._update();
    }
    /**
     * Handle a change to the active cell metadata.
     */
    onActiveCellMetadataChanged(_) {
        if (!this._updatingMetadata && this.isVisible)
            this._update();
    }
    /**
     * Handle when the active notebook panel changes.
     */
    onActiveNotebookPanelChanged(_) {
        const notebook = this.notebookTools.activeNotebookPanel;
        this._notebookModelNull = notebook === null || notebook.model === null;
        if (!this._updatingMetadata && this.isVisible)
            this._update();
    }
    /**
     * Handle a change to the active notebook metadata.
     */
    onActiveNotebookPanelMetadataChanged(msg) {
        if (!this._updatingMetadata && this.isVisible)
            this._update();
    }
    /**
     * Update the form with current cell metadata, and remove inconsistent fields.
     */
    _update() {
        var _a, _b, _c, _d, _e;
        const notebook = this.notebookTools.activeNotebookPanel;
        const cell = this.notebookTools.activeCell;
        if (cell == undefined)
            return;
        const formProperties = dist_index_js_.JSONExt.deepCopy(this._metadataSchema);
        const formData = {};
        for (let metadataKey of Object.keys(this._metadataSchema.properties || dist_index_js_.JSONExt.emptyObject)) {
            // Do not display the field if it's Notebook metadata and the notebook model is null.
            if (((_a = this._metaInformation[metadataKey]) === null || _a === void 0 ? void 0 : _a.level) === 'notebook' &&
                this._notebookModelNull) {
                delete formProperties.properties[metadataKey];
                continue;
            }
            // Do not display the field if the active cell's type is not involved.
            if (((_b = this._metaInformation[metadataKey]) === null || _b === void 0 ? void 0 : _b.cellTypes) &&
                !((_d = (_c = this._metaInformation[metadataKey]) === null || _c === void 0 ? void 0 : _c.cellTypes) === null || _d === void 0 ? void 0 : _d.includes(cell.model.type))) {
                delete formProperties.properties[metadataKey];
                continue;
            }
            let workingObject;
            // Remove the first and last '/' if exist, nad split the path.
            let nestedKeys = metadataKey
                .replace(/^\/+/, '')
                .replace(/\/+$/, '')
                .split('/');
            // Associates the correct metadata object to the working object.
            if (((_e = this._metaInformation[metadataKey]) === null || _e === void 0 ? void 0 : _e.level) === 'notebook') {
                workingObject = notebook.model.metadata;
            }
            else {
                workingObject = cell.model.metadata;
            }
            let hasValue = true;
            // Navigate to the value.
            for (let nested of nestedKeys) {
                if (nested in workingObject)
                    workingObject = workingObject[nested];
                else {
                    hasValue = false;
                    break;
                }
            }
            // Fill the formData with the current metadata value.
            if (hasValue)
                formData[metadataKey] = workingObject;
        }
        this.buildWidget({
            properties: formProperties,
            settings: new settingregistry_lib_index_js_.BaseSettings({
                schema: this._metadataSchema
            }),
            uiSchema: this._uiSchema,
            translator: this.translator || null,
            formData: formData,
            metadataFormWidget: this,
            showModified: this._showModified,
            pluginId: this._pluginId
        });
    }
}
var Private;
(function (Private) {
    /**
     * Recursive function to clean the empty nested metadata before updating real metadata.
     * this function is called when a nested metadata is undefined (or default), so maybe some
     * object are now empty.
     * @param metadataObject PartialJSONObject representing the metadata to update.
     * @param metadataKeysList Array<string> of the undefined nested metadata.
     * @returns PartialJSONObject without empty object.
     */
    function deleteEmptyNested(metadataObject, metadataKeysList) {
        let metadataKey = metadataKeysList.shift();
        if (metadataKey !== undefined && metadataKey in metadataObject) {
            if (Object.keys(metadataObject[metadataKey]).length)
                metadataObject[metadataKey] = deleteEmptyNested(metadataObject[metadataKey], metadataKeysList);
            if (!Object.keys(metadataObject[metadataKey]).length)
                delete metadataObject[metadataKey];
        }
        return metadataObject;
    }
    Private.deleteEmptyNested = deleteEmptyNested;
})(Private || (Private = {}));
//# sourceMappingURL=metadataform.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/metadataform/lib/metadataformProvider.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
class MetadataFormProvider {
    constructor() {
        this._items = {};
    }
    add(id, widget) {
        if (!this._items[id]) {
            this._items[id] = widget;
        }
        else {
            console.warn(`A MetadataformWidget is already registered with id ${id}`);
        }
    }
    get(id) {
        if (this._items[id]) {
            return this._items[id];
        }
        else {
            console.warn(`There is no MetadataformWidget registered with id ${id}`);
        }
    }
}
//# sourceMappingURL=metadataformProvider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/metadataform/lib/token.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module metadataform
 */

/**
 * The metadata form provider token.
 */
const IMetadataFormProvider = new dist_index_js_.Token('@jupyterlab/metadataform:IMetadataFormProvider', `A service to register new metadata editor widgets.`);
//# sourceMappingURL=token.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/metadataform/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module metadataform
 */




//# sourceMappingURL=index.js.map

/***/ }),

/***/ 37083:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/notebook/style/index.js + 1 modules
var notebook_style = __webpack_require__(47456);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/metadataform/style/base.css
var base = __webpack_require__(33894);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/metadataform/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/metadataform/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








/***/ }),

/***/ 23325:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MAJOR_VERSION: () => (/* binding */ MAJOR_VERSION),
/* harmony export */   MINOR_VERSION: () => (/* binding */ MINOR_VERSION),
/* harmony export */   isCode: () => (/* binding */ isCode),
/* harmony export */   isDisplayData: () => (/* binding */ isDisplayData),
/* harmony export */   isDisplayUpdate: () => (/* binding */ isDisplayUpdate),
/* harmony export */   isError: () => (/* binding */ isError),
/* harmony export */   isExecuteResult: () => (/* binding */ isExecuteResult),
/* harmony export */   isMarkdown: () => (/* binding */ isMarkdown),
/* harmony export */   isRaw: () => (/* binding */ isRaw),
/* harmony export */   isStream: () => (/* binding */ isStream),
/* harmony export */   validateMimeValue: () => (/* binding */ validateMimeValue)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module nbformat
 */
// Notebook format interfaces
// https://nbformat.readthedocs.io/en/latest/format_description.html
// https://github.com/jupyter/nbformat/blob/master/nbformat/v4/nbformat.v4.schema.json

/**
 * The earliest major version of the notebook format we support.
 */
const MAJOR_VERSION = 4;
/**
 * The earliest minor version of the notebook format we support.
 */
const MINOR_VERSION = 4;
/**
 * Validate a mime type/value pair.
 *
 * @param type - The mimetype name.
 *
 * @param value - The value associated with the type.
 *
 * @returns Whether the type/value pair are valid.
 */
function validateMimeValue(type, value) {
    // Check if "application/json" or "application/foo+json"
    const jsonTest = /^application\/.+\+json$/;
    const isJSONType = type === 'application/json' || jsonTest.test(type);
    const isString = (x) => {
        return Object.prototype.toString.call(x) === '[object String]';
    };
    // If it is an array, make sure if is not a JSON type and it is an
    // array of strings.
    if (Array.isArray(value)) {
        if (isJSONType) {
            return false;
        }
        let valid = true;
        value.forEach(v => {
            if (!isString(v)) {
                valid = false;
            }
        });
        return valid;
    }
    // If it is a string, make sure we are not a JSON type.
    if (isString(value)) {
        return !isJSONType;
    }
    // It is not a string, make sure it is a JSON type.
    if (!isJSONType) {
        return false;
    }
    // It is a JSON type, make sure it is a valid JSON object.
    return _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.JSONExt.isObject(value);
}
/**
 * Test whether a cell is a raw cell.
 */
function isRaw(cell) {
    return cell.cell_type === 'raw';
}
/**
 * Test whether a cell is a markdown cell.
 */
function isMarkdown(cell) {
    return cell.cell_type === 'markdown';
}
/**
 * Test whether a cell is a code cell.
 */
function isCode(cell) {
    return cell.cell_type === 'code';
}
/**
 * Test whether an output is an execute result.
 */
function isExecuteResult(output) {
    return output.output_type === 'execute_result';
}
/**
 * Test whether an output is from display data.
 */
function isDisplayData(output) {
    return output.output_type === 'display_data';
}
/**
 * Test whether an output is from updated display data.
 */
function isDisplayUpdate(output) {
    return output.output_type === 'update_display_data';
}
/**
 * Test whether an output is from a stream.
 */
function isStream(output) {
    return output.output_type === 'stream';
}
/**
 * Test whether an output is an error.
 */
function isError(output) {
    return output.output_type === 'error';
}
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 51962:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  commandEditItem: () => (/* binding */ commandEditItem),
  "default": () => (/* binding */ lib),
  executionIndicator: () => (/* binding */ executionIndicator),
  exportPlugin: () => (/* binding */ exportPlugin),
  notebookTrustItem: () => (/* binding */ notebookTrustItem)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/cells@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/cells/lib/index.js)
var cells_lib_index_js_ = __webpack_require__(9214);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codemirror@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codemirror/lib/index.js)
var codemirror_lib_index_js_ = __webpack_require__(84088);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/completer@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/completer/lib/index.js)
var completer_lib_index_js_ = __webpack_require__(27709);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docmanager@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/docmanager/lib/index.js)
var docmanager_lib_index_js_ = __webpack_require__(64009);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docmanager-extension@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docmanager-extension/lib/index.js)
var docmanager_extension_lib_index_js_ = __webpack_require__(36102);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/documentsearch@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/documentsearch/lib/index.js)
var documentsearch_lib_index_js_ = __webpack_require__(3894);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/filebrowser@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/filebrowser/lib/index.js)
var filebrowser_lib_index_js_ = __webpack_require__(29543);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/launcher@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/launcher/lib/index.js)
var launcher_lib_index_js_ = __webpack_require__(62961);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/lsp@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/lsp/lib/index.js)
var lsp_lib_index_js_ = __webpack_require__(84259);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/mainmenu@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/mainmenu/lib/index.js)
var mainmenu_lib_index_js_ = __webpack_require__(38911);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/metadataform@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/metadataform/lib/index.js)
var metadataform_lib_index_js_ = __webpack_require__(63368);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/notebook@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/notebook/lib/index.js)
var notebook_lib_index_js_ = __webpack_require__(58448);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/property-inspector@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/property-inspector/lib/index.js)
var property_inspector_lib_index_js_ = __webpack_require__(36236);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/toc@^6.5.6 (strict) (fallback: ../node_modules/@jupyterlab/toc/lib/index.js)
var toc_lib_index_js_ = __webpack_require__(74853);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/cell-toolbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/cell-toolbar/lib/index.js)
var cell_toolbar_lib_index_js_ = __webpack_require__(81793);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook-extension/lib/cellexecutor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Notebook cell executor plugin.
 */
const cellExecutor = {
    id: '@jupyterlab/notebook-extension:cell-executor',
    description: 'Provides the notebook cell executor.',
    autoStart: true,
    provides: notebook_lib_index_js_.INotebookCellExecutor,
    activate: () => {
        return Object.freeze({ runCell: notebook_lib_index_js_.runCell });
    }
};
//# sourceMappingURL=cellexecutor.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/logconsole@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/logconsole/lib/index.js)
var logconsole_lib_index_js_ = __webpack_require__(72006);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook-extension/lib/nboutput.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * The Log Console extension.
 */
const logNotebookOutput = {
    activate: activateNBOutput,
    id: '@jupyterlab/notebook-extension:log-output',
    description: 'Adds cell outputs log to the application logger.',
    requires: [notebook_lib_index_js_.INotebookTracker],
    optional: [logconsole_lib_index_js_.ILoggerRegistry],
    autoStart: true
};
function activateNBOutput(app, nbtracker, loggerRegistry) {
    if (!loggerRegistry) {
        // Automatically disable if logconsole is missing
        return;
    }
    function registerNB(nb) {
        function logOutput(msg, levelNormal, levelError) {
            if (services_lib_index_js_.KernelMessage.isDisplayDataMsg(msg) ||
                services_lib_index_js_.KernelMessage.isStreamMsg(msg) ||
                services_lib_index_js_.KernelMessage.isErrorMsg(msg) ||
                services_lib_index_js_.KernelMessage.isExecuteResultMsg(msg)) {
                const logger = loggerRegistry.getLogger(nb.context.path);
                logger.rendermime = nb.content.rendermime;
                const data = {
                    ...msg.content,
                    output_type: msg.header.msg_type
                };
                let level = levelNormal;
                if (services_lib_index_js_.KernelMessage.isErrorMsg(msg) ||
                    (services_lib_index_js_.KernelMessage.isStreamMsg(msg) && msg.content.name === 'stderr')) {
                    level = levelError;
                }
                logger.log({ type: 'output', data, level });
            }
        }
        // There is overlap here since unhandled messages are also emitted in the
        // iopubMessage signal. However, unhandled messages warrant a higher log
        // severity, so we'll accept that they are logged twice.
        nb.context.sessionContext.iopubMessage.connect((_, msg) => logOutput(msg, 'info', 'info'));
        nb.context.sessionContext.unhandledMessage.connect((_, msg) => logOutput(msg, 'warning', 'error'));
    }
    nbtracker.forEach(nb => registerNB(nb));
    nbtracker.widgetAdded.connect((_, nb) => registerNB(nb));
}
//# sourceMappingURL=nboutput.js.map
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook-extension/lib/tool-widgets/activeCellToolWidget.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */





/**
 * The class name added to the ActiveCellTool.
 */
const ACTIVE_CELL_TOOL_CLASS = 'jp-ActiveCellTool';
/**
 * The class name added to the ActiveCellTool content.
 */
const ACTIVE_CELL_TOOL_CONTENT_CLASS = 'jp-ActiveCellTool-Content';
/**
 * The class name added to the ActiveCellTool cell content.
 */
const ACTIVE_CELL_TOOL_CELL_CONTENT_CLASS = 'jp-ActiveCellTool-CellContent';
/**
 * The active cell field, displaying the first line and execution count of the active cell.
 *
 * ## Note
 * This field does not work as other metadata form fields, as it does not update metadata.
 */
class ActiveCellTool extends notebook_lib_index_js_.NotebookTools.Tool {
    constructor(options) {
        super();
        const { languages } = options;
        this._tracker = options.tracker;
        this.addClass(ACTIVE_CELL_TOOL_CLASS);
        this.layout = new widgets_dist_index_es6_js_.PanelLayout();
        this._inputPrompt = new cells_lib_index_js_.InputPrompt();
        this.layout.addWidget(this._inputPrompt);
        // First code line container
        const node = document.createElement('div');
        node.classList.add(ACTIVE_CELL_TOOL_CONTENT_CLASS);
        const container = node.appendChild(document.createElement('div'));
        const editor = container.appendChild(document.createElement('pre'));
        container.className = ACTIVE_CELL_TOOL_CELL_CONTENT_CLASS;
        this._editorEl = editor;
        this.layout.addWidget(new widgets_dist_index_es6_js_.Widget({ node }));
        const update = async () => {
            var _a, _b;
            this._editorEl.innerHTML = '';
            if (((_a = this._cellModel) === null || _a === void 0 ? void 0 : _a.type) === 'code') {
                this._inputPrompt.executionCount = `${(_b = this._cellModel.executionCount) !== null && _b !== void 0 ? _b : ''}`;
                this._inputPrompt.show();
            }
            else {
                this._inputPrompt.executionCount = null;
                this._inputPrompt.hide();
            }
            if (this._cellModel) {
                await languages.highlight(this._cellModel.sharedModel.getSource().split('\n')[0], languages.findByMIME(this._cellModel.mimeType), this._editorEl);
            }
        };
        this._refreshDebouncer = new polling_dist_index_es6_js_.Debouncer(update, 150);
    }
    render(props) {
        var _a, _b;
        const activeCell = this._tracker.activeCell;
        if (activeCell)
            this._cellModel = (activeCell === null || activeCell === void 0 ? void 0 : activeCell.model) || null;
        ((_a = this._cellModel) === null || _a === void 0 ? void 0 : _a.sharedModel).changed.connect(this.refresh, this);
        (_b = this._cellModel) === null || _b === void 0 ? void 0 : _b.mimeTypeChanged.connect(this.refresh, this);
        this.refresh()
            .then(() => undefined)
            .catch(() => undefined);
        return react_index_js_default().createElement("div", { ref: ref => ref === null || ref === void 0 ? void 0 : ref.appendChild(this.node) });
    }
    async refresh() {
        await this._refreshDebouncer.invoke();
    }
}
//# sourceMappingURL=activeCellToolWidget.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var observables_lib_index_js_ = __webpack_require__(52138);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook-extension/lib/tool-widgets/metadataEditorFields.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



const CELL_METADATA_EDITOR_CLASS = 'jp-CellMetadataEditor';
const NOTEBOOK_METADATA_EDITOR_CLASS = 'jp-NotebookMetadataEditor';
/**
 * The cell metadata field.
 *
 * ## Note
 * This field does not work as other metadata form fields, as it does not use RJSF to update metadata.
 * It extends the MetadataEditorTool which updates itself the metadata.
 * It only renders the node of MetadataEditorTool in a React element instead of displaying a RJSF field.
 */
class CellMetadataField extends notebook_lib_index_js_.NotebookTools.MetadataEditorTool {
    constructor(options) {
        super(options);
        this._tracker = options.tracker;
        this.editor.editorHostNode.addEventListener('blur', this.editor, true);
        this.editor.editorHostNode.addEventListener('click', this.editor, true);
        this.editor.headerNode.addEventListener('click', this.editor);
    }
    _onSourceChanged() {
        var _a, _b, _c;
        const activeCell = (_a = this._tracker.activeCell) === null || _a === void 0 ? void 0 : _a.model.sharedModel;
        if (activeCell && this.editor.source) {
            const metadataKeys = Object.keys((_b = activeCell.metadata) !== null && _b !== void 0 ? _b : {});
            const source = (_c = this.editor.source.toJSON()) !== null && _c !== void 0 ? _c : {};
            activeCell.transact(() => {
                // Iterate over all existing metadata keys and delete each one.
                // This ensures that any keys not present in the new metadata are removed.
                metadataKeys.forEach(key => activeCell.deleteMetadata(key));
                activeCell.setMetadata(source);
            });
        }
    }
    render(props) {
        var _a;
        const cell = this._tracker.activeCell;
        this.editor.source = cell
            ? new observables_lib_index_js_.ObservableJSON({ values: cell.model.metadata })
            : null;
        (_a = this.editor.source) === null || _a === void 0 ? void 0 : _a.changed.connect(this._onSourceChanged, this);
        return (react_index_js_default().createElement("div", { className: CELL_METADATA_EDITOR_CLASS },
            react_index_js_default().createElement("div", { ref: ref => ref === null || ref === void 0 ? void 0 : ref.appendChild(this.node) })));
    }
}
/**
 * The notebook metadata field.
 *
 * ## Note
 * This field does not work as other metadata form fields, as it does not use RJSF to update metadata.
 * It extends the MetadataEditorTool which updates itself the metadata.
 * It only renders the node of MetadataEditorTool in a React element instead of displaying a RJSF field.
 */
class NotebookMetadataField extends notebook_lib_index_js_.NotebookTools.MetadataEditorTool {
    constructor(options) {
        super(options);
        this._tracker = options.tracker;
        this.editor.editorHostNode.addEventListener('blur', this.editor, true);
        this.editor.editorHostNode.addEventListener('click', this.editor, true);
        this.editor.headerNode.addEventListener('click', this.editor);
    }
    _onSourceChanged() {
        var _a, _b;
        if (this.editor.source) {
            (_b = (_a = this._tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.sharedModel.setMetadata(this.editor.source.toJSON());
        }
    }
    render(props) {
        var _a, _b;
        const notebook = this._tracker.currentWidget;
        this.editor.source = notebook
            ? new observables_lib_index_js_.ObservableJSON({ values: (_a = notebook.model) === null || _a === void 0 ? void 0 : _a.metadata })
            : null;
        (_b = this.editor.source) === null || _b === void 0 ? void 0 : _b.changed.connect(this._onSourceChanged, this);
        return (react_index_js_default().createElement("div", { className: NOTEBOOK_METADATA_EDITOR_CLASS },
            react_index_js_default().createElement("div", { ref: ref => ref === null || ref === void 0 ? void 0 : ref.appendChild(this.node) })));
    }
}
//# sourceMappingURL=metadataEditorFields.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module notebook-extension
 */


































/**
 * The command IDs used by the notebook plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.createNew = 'notebook:create-new';
    CommandIDs.interrupt = 'notebook:interrupt-kernel';
    CommandIDs.restart = 'notebook:restart-kernel';
    CommandIDs.restartClear = 'notebook:restart-clear-output';
    CommandIDs.restartAndRunToSelected = 'notebook:restart-and-run-to-selected';
    CommandIDs.restartRunAll = 'notebook:restart-run-all';
    CommandIDs.reconnectToKernel = 'notebook:reconnect-to-kernel';
    CommandIDs.changeKernel = 'notebook:change-kernel';
    CommandIDs.getKernel = 'notebook:get-kernel';
    CommandIDs.createConsole = 'notebook:create-console';
    CommandIDs.createSubshellConsole = 'notebook:create-subshell-console';
    CommandIDs.createOutputView = 'notebook:create-output-view';
    CommandIDs.clearAllOutputs = 'notebook:clear-all-cell-outputs';
    CommandIDs.shutdown = 'notebook:shutdown-kernel';
    CommandIDs.closeAndShutdown = 'notebook:close-and-shutdown';
    CommandIDs.trust = 'notebook:trust';
    CommandIDs.exportToFormat = 'notebook:export-to-format';
    CommandIDs.run = 'notebook:run-cell';
    CommandIDs.runAndAdvance = 'notebook:run-cell-and-select-next';
    CommandIDs.runAndInsert = 'notebook:run-cell-and-insert-below';
    CommandIDs.runInConsole = 'notebook:run-in-console';
    CommandIDs.runAll = 'notebook:run-all-cells';
    CommandIDs.runAllAbove = 'notebook:run-all-above';
    CommandIDs.runAllBelow = 'notebook:run-all-below';
    CommandIDs.renderAllMarkdown = 'notebook:render-all-markdown';
    CommandIDs.toCode = 'notebook:change-cell-to-code';
    CommandIDs.toMarkdown = 'notebook:change-cell-to-markdown';
    CommandIDs.toRaw = 'notebook:change-cell-to-raw';
    CommandIDs.cut = 'notebook:cut-cell';
    CommandIDs.copy = 'notebook:copy-cell';
    CommandIDs.pasteAbove = 'notebook:paste-cell-above';
    CommandIDs.pasteBelow = 'notebook:paste-cell-below';
    CommandIDs.duplicateBelow = 'notebook:duplicate-below';
    CommandIDs.pasteAndReplace = 'notebook:paste-and-replace-cell';
    CommandIDs.moveUp = 'notebook:move-cell-up';
    CommandIDs.moveDown = 'notebook:move-cell-down';
    CommandIDs.clearOutputs = 'notebook:clear-cell-output';
    CommandIDs.deleteCell = 'notebook:delete-cell';
    CommandIDs.insertAbove = 'notebook:insert-cell-above';
    CommandIDs.insertBelow = 'notebook:insert-cell-below';
    CommandIDs.selectAbove = 'notebook:move-cursor-up';
    CommandIDs.selectBelow = 'notebook:move-cursor-down';
    CommandIDs.selectHeadingAboveOrCollapse = 'notebook:move-cursor-heading-above-or-collapse';
    CommandIDs.selectHeadingBelowOrExpand = 'notebook:move-cursor-heading-below-or-expand';
    CommandIDs.insertHeadingAbove = 'notebook:insert-heading-above';
    CommandIDs.insertHeadingBelow = 'notebook:insert-heading-below';
    CommandIDs.extendAbove = 'notebook:extend-marked-cells-above';
    CommandIDs.extendTop = 'notebook:extend-marked-cells-top';
    CommandIDs.extendBelow = 'notebook:extend-marked-cells-below';
    CommandIDs.extendBottom = 'notebook:extend-marked-cells-bottom';
    CommandIDs.selectAll = 'notebook:select-all';
    CommandIDs.deselectAll = 'notebook:deselect-all';
    CommandIDs.editMode = 'notebook:enter-edit-mode';
    CommandIDs.merge = 'notebook:merge-cells';
    CommandIDs.mergeAbove = 'notebook:merge-cell-above';
    CommandIDs.mergeBelow = 'notebook:merge-cell-below';
    CommandIDs.split = 'notebook:split-cell-at-cursor';
    CommandIDs.commandMode = 'notebook:enter-command-mode';
    CommandIDs.toggleAllLines = 'notebook:toggle-all-cell-line-numbers';
    CommandIDs.undoCellAction = 'notebook:undo-cell-action';
    CommandIDs.redoCellAction = 'notebook:redo-cell-action';
    CommandIDs.redo = 'notebook:redo';
    CommandIDs.undo = 'notebook:undo';
    CommandIDs.markdown1 = 'notebook:change-cell-to-heading-1';
    CommandIDs.markdown2 = 'notebook:change-cell-to-heading-2';
    CommandIDs.markdown3 = 'notebook:change-cell-to-heading-3';
    CommandIDs.markdown4 = 'notebook:change-cell-to-heading-4';
    CommandIDs.markdown5 = 'notebook:change-cell-to-heading-5';
    CommandIDs.markdown6 = 'notebook:change-cell-to-heading-6';
    CommandIDs.hideCode = 'notebook:hide-cell-code';
    CommandIDs.showCode = 'notebook:show-cell-code';
    CommandIDs.hideAllCode = 'notebook:hide-all-cell-code';
    CommandIDs.showAllCode = 'notebook:show-all-cell-code';
    CommandIDs.hideOutput = 'notebook:hide-cell-outputs';
    CommandIDs.showOutput = 'notebook:show-cell-outputs';
    CommandIDs.toggleOutput = 'notebook:toggle-cell-outputs';
    CommandIDs.hideAllOutputs = 'notebook:hide-all-cell-outputs';
    CommandIDs.showAllOutputs = 'notebook:show-all-cell-outputs';
    CommandIDs.toggleRenderSideBySideCurrentNotebook = 'notebook:toggle-render-side-by-side-current';
    CommandIDs.setSideBySideRatio = 'notebook:set-side-by-side-ratio';
    CommandIDs.enableOutputScrolling = 'notebook:enable-output-scrolling';
    CommandIDs.disableOutputScrolling = 'notebook:disable-output-scrolling';
    CommandIDs.selectLastRunCell = 'notebook:select-last-run-cell';
    CommandIDs.replaceSelection = 'notebook:replace-selection';
    CommandIDs.autoClosingBrackets = 'notebook:toggle-autoclosing-brackets';
    CommandIDs.toggleCollapseCmd = 'notebook:toggle-heading-collapse';
    CommandIDs.collapseAllCmd = 'notebook:collapse-all-headings';
    CommandIDs.expandAllCmd = 'notebook:expand-all-headings';
    CommandIDs.copyToClipboard = 'notebook:copy-to-clipboard';
    CommandIDs.invokeCompleter = 'completer:invoke-notebook';
    CommandIDs.selectCompleter = 'completer:select-notebook';
    CommandIDs.tocRunCells = 'toc:run-cells';
    CommandIDs.accessPreviousHistory = 'notebook:access-previous-history-entry';
    CommandIDs.accessNextHistory = 'notebook:access-next-history-entry';
    CommandIDs.virtualScrollbar = 'notebook:toggle-virtual-scrollbar';
})(CommandIDs || (CommandIDs = {}));
/**
 * The name of the factory that creates notebooks.
 */
const FACTORY = 'Notebook';
/**
 * The excluded Export To ...
 * (returned from nbconvert's export list)
 */
const FORMAT_EXCLUDE = ['notebook', 'python', 'custom'];
/**
 * Setting Id storing the customized toolbar definition.
 */
const PANEL_SETTINGS = '@jupyterlab/notebook-extension:panel';
/**
 * The id to use on the style tag for the side by side margins.
 */
const SIDE_BY_SIDE_STYLE_ID = 'jp-NotebookExtension-sideBySideMargins';
/**
 * The notebook widget tracker provider.
 */
const trackerPlugin = {
    id: '@jupyterlab/notebook-extension:tracker',
    description: 'Provides the notebook widget tracker.',
    provides: notebook_lib_index_js_.INotebookTracker,
    requires: [
        notebook_lib_index_js_.INotebookWidgetFactory,
        codemirror_lib_index_js_.IEditorExtensionRegistry,
        notebook_lib_index_js_.INotebookCellExecutor
    ],
    optional: [
        lib_index_js_.ICommandPalette,
        filebrowser_lib_index_js_.IDefaultFileBrowser,
        launcher_lib_index_js_.ILauncher,
        index_js_.ILayoutRestorer,
        mainmenu_lib_index_js_.IMainMenu,
        index_js_.IRouter,
        settingregistry_lib_index_js_.ISettingRegistry,
        lib_index_js_.ISessionContextDialogs,
        translation_lib_index_js_.ITranslator,
        ui_components_lib_index_js_.IFormRendererRegistry,
        filebrowser_lib_index_js_.IFileBrowserFactory
    ],
    activate: activateNotebookHandler,
    autoStart: true
};
/**
 * The notebook cell factory provider.
 */
const factory = {
    id: '@jupyterlab/notebook-extension:factory',
    description: 'Provides the notebook cell factory.',
    provides: notebook_lib_index_js_.NotebookPanel.IContentFactory,
    requires: [codeeditor_lib_index_js_.IEditorServices],
    autoStart: true,
    activate: (app, editorServices) => {
        const editorFactory = editorServices.factoryService.newInlineEditor;
        return new notebook_lib_index_js_.NotebookPanel.ContentFactory({ editorFactory });
    }
};
/**
 * The notebook tools extension.
 */
const tools = {
    activate: activateNotebookTools,
    provides: notebook_lib_index_js_.INotebookTools,
    id: '@jupyterlab/notebook-extension:tools',
    description: 'Provides the notebook tools.',
    autoStart: true,
    requires: [
        notebook_lib_index_js_.INotebookTracker,
        codeeditor_lib_index_js_.IEditorServices,
        codemirror_lib_index_js_.IEditorLanguageRegistry,
        statedb_lib_index_js_.IStateDB,
        translation_lib_index_js_.ITranslator
    ],
    optional: [property_inspector_lib_index_js_.IPropertyInspectorProvider]
};
/**
 * A plugin providing a CommandEdit status item.
 */
const commandEditItem = {
    id: '@jupyterlab/notebook-extension:mode-status',
    description: 'Adds a notebook mode status widget.',
    autoStart: true,
    requires: [notebook_lib_index_js_.INotebookTracker, translation_lib_index_js_.ITranslator],
    optional: [statusbar_lib_index_js_.IStatusBar],
    activate: (app, tracker, translator, statusBar) => {
        if (!statusBar) {
            // Automatically disable if statusbar missing
            return;
        }
        const { shell } = app;
        const item = new notebook_lib_index_js_.CommandEditStatus(translator);
        // Keep the status item up-to-date with the current notebook.
        tracker.currentChanged.connect(() => {
            const current = tracker.currentWidget;
            item.model.notebook = current && current.content;
        });
        statusBar.registerStatusItem('@jupyterlab/notebook-extension:mode-status', {
            priority: 1,
            item,
            align: 'right',
            rank: 4,
            isActive: () => !!shell.currentWidget &&
                !!tracker.currentWidget &&
                shell.currentWidget === tracker.currentWidget
        });
    }
};
/**
 * A plugin that provides a execution indicator item to the status bar.
 */
const executionIndicator = {
    id: '@jupyterlab/notebook-extension:execution-indicator',
    description: 'Adds a notebook execution status widget.',
    autoStart: true,
    requires: [notebook_lib_index_js_.INotebookTracker, index_js_.ILabShell, translation_lib_index_js_.ITranslator],
    optional: [statusbar_lib_index_js_.IStatusBar, settingregistry_lib_index_js_.ISettingRegistry],
    activate: (app, notebookTracker, labShell, translator, statusBar, settingRegistry) => {
        let statusbarItem;
        let labShellCurrentChanged;
        let statusBarDisposable;
        const updateSettings = (settings) => {
            var _a, _b;
            let { showOnToolBar, showProgress, showJumpToCell } = settings;
            if (!showOnToolBar) {
                // Status bar mode, only one `ExecutionIndicator` is needed.
                if (!statusBar) {
                    // Automatically disable if statusbar missing
                    return;
                }
                if (!(statusbarItem === null || statusbarItem === void 0 ? void 0 : statusbarItem.model)) {
                    statusbarItem = new notebook_lib_index_js_.ExecutionIndicator(translator);
                    labShellCurrentChanged = (_, change) => {
                        const { newValue } = change;
                        if (newValue && notebookTracker.has(newValue)) {
                            const panel = newValue;
                            statusbarItem.model.attachNotebook({
                                content: panel.content,
                                context: panel.sessionContext
                            });
                        }
                    };
                    statusBarDisposable = statusBar.registerStatusItem('@jupyterlab/notebook-extension:execution-indicator', {
                        item: statusbarItem,
                        align: 'left',
                        rank: 3,
                        isActive: () => {
                            const current = labShell.currentWidget;
                            return !!current && notebookTracker.has(current);
                        }
                    });
                    statusbarItem.model.attachNotebook({
                        content: (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content,
                        context: (_b = notebookTracker.currentWidget) === null || _b === void 0 ? void 0 : _b.sessionContext
                    });
                    labShell.currentChanged.connect(labShellCurrentChanged);
                    statusbarItem.disposed.connect(() => {
                        labShell.currentChanged.disconnect(labShellCurrentChanged);
                    });
                }
                statusbarItem.model.displayOption = {
                    showOnToolBar,
                    showProgress,
                    showJumpToCell
                };
            }
            else {
                //Remove old indicator widget on status bar
                if (statusBarDisposable) {
                    labShell.currentChanged.disconnect(labShellCurrentChanged);
                    statusBarDisposable.dispose();
                }
            }
        };
        if (settingRegistry) {
            // Indicator is default in tool bar, user needs to specify its
            // position in settings in order to have indicator on status bar.
            const loadSettings = settingRegistry.load(trackerPlugin.id);
            Promise.all([loadSettings, app.restored])
                .then(([settings]) => {
                updateSettings(notebook_lib_index_js_.ExecutionIndicator.getSettingValue(settings));
                settings.changed.connect(sender => updateSettings(notebook_lib_index_js_.ExecutionIndicator.getSettingValue(sender)));
            })
                .catch((reason) => {
                console.error(reason.message);
            });
        }
    }
};
/**
 * A plugin providing export commands in the main menu and command palette
 */
const exportPlugin = {
    id: '@jupyterlab/notebook-extension:export',
    description: 'Adds the export notebook commands.',
    autoStart: true,
    requires: [translation_lib_index_js_.ITranslator, notebook_lib_index_js_.INotebookTracker],
    optional: [mainmenu_lib_index_js_.IMainMenu, lib_index_js_.ICommandPalette],
    activate: (app, translator, tracker, mainMenu, palette) => {
        var _a;
        const trans = translator.load('jupyterlab');
        const { commands, shell } = app;
        const services = app.serviceManager;
        const isEnabled = () => {
            return Private.isEnabled(shell, tracker);
        };
        commands.addCommand(CommandIDs.exportToFormat, {
            label: args => {
                if (args.label === undefined) {
                    return trans.__('Save and Export Notebook to the given `format`.');
                }
                const formatLabel = args['label'];
                return args['isPalette']
                    ? trans.__('Save and Export Notebook: %1', formatLabel)
                    : formatLabel;
            },
            execute: async (args) => {
                var _a, _b;
                const current = getCurrent(tracker, shell, args);
                if (!current) {
                    return;
                }
                const { context } = current;
                const exportOptions = {
                    format: args['format'],
                    path: current.context.path,
                    exporterOptions: {
                        download: true
                    }
                };
                if (context.model.dirty && !context.model.readOnly) {
                    await context.save();
                }
                return (_b = (_a = services.nbconvert).exportAs) === null || _b === void 0 ? void 0 : _b.call(_a, exportOptions);
            },
            isEnabled,
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        format: {
                            type: 'string',
                            description: trans.__('The export format (e.g., pdf, html, latex)')
                        },
                        label: {
                            type: 'string',
                            description: trans.__('The label to display for this format')
                        },
                        isPalette: {
                            type: 'boolean',
                            description: trans.__('Whether the command is called from the command palette')
                        }
                    },
                    required: ['format']
                }
            }
        });
        // Add a notebook group to the File menu.
        let exportTo;
        if (mainMenu) {
            exportTo = (_a = mainMenu.fileMenu.items.find(item => {
                var _a;
                return item.type === 'submenu' &&
                    ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-file-notebookexport';
            })) === null || _a === void 0 ? void 0 : _a.submenu;
        }
        let formatsInitialized = false;
        /** Request formats only when a notebook might use them. */
        const maybeInitializeFormats = async () => {
            if (formatsInitialized) {
                return;
            }
            tracker.widgetAdded.disconnect(maybeInitializeFormats);
            formatsInitialized = true;
            const response = await services.nbconvert.getExportFormats(false);
            if (!response) {
                return;
            }
            const formatLabels = Private.getFormatLabels(translator);
            // Convert export list to palette and menu items.
            const formatList = Object.keys(response);
            formatList.forEach(function (key) {
                const capCaseKey = trans.__(key[0].toUpperCase() + key.substr(1));
                const labelStr = formatLabels[key] ? formatLabels[key] : capCaseKey;
                let args = {
                    format: key,
                    label: labelStr,
                    isPalette: false
                };
                if (FORMAT_EXCLUDE.indexOf(key) === -1) {
                    if (exportTo) {
                        exportTo.addItem({
                            command: CommandIDs.exportToFormat,
                            args: args
                        });
                    }
                    if (palette) {
                        args = {
                            format: key,
                            label: labelStr,
                            isPalette: true
                        };
                        const category = trans.__('Notebook Operations');
                        palette.addItem({
                            command: CommandIDs.exportToFormat,
                            category,
                            args
                        });
                    }
                }
            });
        };
        tracker.widgetAdded.connect(maybeInitializeFormats);
    }
};
/**
 * A plugin that adds a notebook trust status item to the status bar.
 */
const notebookTrustItem = {
    id: '@jupyterlab/notebook-extension:trust-status',
    description: 'Adds the notebook trusted status widget.',
    autoStart: true,
    requires: [notebook_lib_index_js_.INotebookTracker, translation_lib_index_js_.ITranslator],
    optional: [statusbar_lib_index_js_.IStatusBar],
    activate: (app, tracker, translator, statusBar) => {
        if (!statusBar) {
            // Automatically disable if statusbar missing
            return;
        }
        const { shell } = app;
        const item = new notebook_lib_index_js_.NotebookTrustStatus(translator);
        // Keep the status item up-to-date with the current notebook.
        tracker.currentChanged.connect(() => {
            const current = tracker.currentWidget;
            item.model.notebook = current && current.content;
        });
        statusBar.registerStatusItem('@jupyterlab/notebook-extension:trust-status', {
            item,
            align: 'right',
            rank: 3,
            isActive: () => !!shell.currentWidget &&
                !!tracker.currentWidget &&
                shell.currentWidget === tracker.currentWidget
        });
    }
};
/**
 * The notebook widget factory provider.
 */
const widgetFactoryPlugin = {
    id: '@jupyterlab/notebook-extension:widget-factory',
    description: 'Provides the notebook widget factory.',
    provides: notebook_lib_index_js_.INotebookWidgetFactory,
    requires: [
        notebook_lib_index_js_.NotebookPanel.IContentFactory,
        codeeditor_lib_index_js_.IEditorServices,
        rendermime_lib_index_js_.IRenderMimeRegistry,
        lib_index_js_.IToolbarWidgetRegistry
    ],
    optional: [settingregistry_lib_index_js_.ISettingRegistry, lib_index_js_.ISessionContextDialogs, translation_lib_index_js_.ITranslator],
    activate: activateWidgetFactory,
    autoStart: true
};
/**
 * The cloned output provider.
 */
const clonedOutputsPlugin = {
    id: '@jupyterlab/notebook-extension:cloned-outputs',
    description: 'Adds the clone output feature.',
    requires: [docmanager_lib_index_js_.IDocumentManager, notebook_lib_index_js_.INotebookTracker, translation_lib_index_js_.ITranslator],
    optional: [index_js_.ILayoutRestorer],
    activate: activateClonedOutputs,
    autoStart: true
};
/**
 * A plugin for code consoles functionalities.
 */
const codeConsolePlugin = {
    id: '@jupyterlab/notebook-extension:code-console',
    description: 'Adds the notebook code consoles features.',
    requires: [notebook_lib_index_js_.INotebookTracker, translation_lib_index_js_.ITranslator],
    activate: activateCodeConsole,
    autoStart: true
};
/**
 * A plugin to copy CodeCell outputs.
 */
const copyOutputPlugin = {
    id: '@jupyterlab/notebook-extension:copy-output',
    description: 'Adds the copy cell outputs feature.',
    activate: activateCopyOutput,
    requires: [translation_lib_index_js_.ITranslator, notebook_lib_index_js_.INotebookTracker],
    autoStart: true
};
/**
 * Kernel status indicator.
 */
const kernelStatus = {
    id: '@jupyterlab/notebook-extension:kernel-status',
    description: 'Adds the notebook kernel status.',
    activate: (app, tracker, kernelStatus) => {
        const provider = (widget) => {
            let session = null;
            if (widget && tracker.has(widget)) {
                return widget.sessionContext;
            }
            return session;
        };
        kernelStatus.addSessionProvider(provider);
    },
    requires: [notebook_lib_index_js_.INotebookTracker, lib_index_js_.IKernelStatusModel],
    autoStart: true
};
/**
 * Cursor position.
 */
const lineColStatus = {
    id: '@jupyterlab/notebook-extension:cursor-position',
    description: 'Adds the notebook cursor position status.',
    activate: (app, tracker, positionModel) => {
        let previousWidget = null;
        const provider = async (widget) => {
            let editor = null;
            if (widget !== previousWidget) {
                previousWidget === null || previousWidget === void 0 ? void 0 : previousWidget.content.activeCellChanged.disconnect(positionModel.update);
                previousWidget = null;
                if (widget && tracker.has(widget)) {
                    widget.content.activeCellChanged.connect(positionModel.update);
                    const activeCell = widget.content.activeCell;
                    editor = null;
                    if (activeCell) {
                        await activeCell.ready;
                        editor = activeCell.editor;
                    }
                    previousWidget = widget;
                }
            }
            else if (widget) {
                const activeCell = widget.content.activeCell;
                editor = null;
                if (activeCell) {
                    await activeCell.ready;
                    editor = activeCell.editor;
                }
            }
            return editor;
        };
        positionModel.addEditorProvider(provider);
    },
    requires: [notebook_lib_index_js_.INotebookTracker, codeeditor_lib_index_js_.IPositionModel],
    autoStart: true
};
const completerPlugin = {
    id: '@jupyterlab/notebook-extension:completer',
    description: 'Adds the code completion capability to notebooks.',
    requires: [notebook_lib_index_js_.INotebookTracker],
    optional: [completer_lib_index_js_.ICompletionProviderManager, translation_lib_index_js_.ITranslator, lib_index_js_.ISanitizer],
    activate: activateNotebookCompleterService,
    autoStart: true
};
/**
 * A plugin to search notebook documents
 */
const searchProvider = {
    id: '@jupyterlab/notebook-extension:search',
    description: 'Adds search capability to notebooks.',
    requires: [documentsearch_lib_index_js_.ISearchProviderRegistry],
    autoStart: true,
    activate: (app, registry) => {
        registry.add('jp-notebookSearchProvider', notebook_lib_index_js_.NotebookSearchProvider);
    }
};
const tocPlugin = {
    id: '@jupyterlab/notebook-extension:toc',
    description: 'Adds table of content capability to the notebooks',
    requires: [notebook_lib_index_js_.INotebookTracker, toc_lib_index_js_.ITableOfContentsRegistry, lib_index_js_.ISanitizer],
    optional: [rendermime_lib_index_js_.IMarkdownParser, settingregistry_lib_index_js_.ISettingRegistry],
    autoStart: true,
    activate: (app, tracker, tocRegistry, sanitizer, mdParser, settingRegistry) => {
        const nbTocFactory = new notebook_lib_index_js_.NotebookToCFactory(tracker, mdParser, sanitizer);
        tocRegistry.add(nbTocFactory);
        if (settingRegistry) {
            Promise.all([app.restored, settingRegistry.load(trackerPlugin.id)])
                .then(([_, setting]) => {
                const onSettingsUpdate = () => {
                    var _a;
                    nbTocFactory.scrollToTop =
                        (_a = setting.composite['scrollHeadingToTop']) !== null && _a !== void 0 ? _a : true;
                };
                onSettingsUpdate();
                setting.changed.connect(onSettingsUpdate);
            })
                .catch(error => {
                console.error('Failed to load notebook table of content settings.', error);
            });
        }
    }
};
const languageServerPlugin = {
    id: '@jupyterlab/notebook-extension:language-server',
    description: 'Adds language server capability to the notebooks.',
    requires: [
        notebook_lib_index_js_.INotebookTracker,
        lsp_lib_index_js_.ILSPDocumentConnectionManager,
        lsp_lib_index_js_.ILSPFeatureManager,
        lsp_lib_index_js_.ILSPCodeExtractorsManager,
        lsp_lib_index_js_.IWidgetLSPAdapterTracker
    ],
    activate: activateNotebookLanguageServer,
    autoStart: true
};
/**
 * Metadata editor for the raw cell mimetype.
 */
const updateRawMimetype = {
    id: '@jupyterlab/notebook-extension:update-raw-mimetype',
    description: 'Adds metadata form editor for raw cell mimetype.',
    autoStart: true,
    requires: [notebook_lib_index_js_.INotebookTracker, metadataform_lib_index_js_.IMetadataFormProvider, translation_lib_index_js_.ITranslator],
    activate: (app, tracker, metadataForms, translator) => {
        const trans = translator.load('jupyterlab');
        let formatsInitialized = false;
        async function maybeInitializeFormats() {
            if (formatsInitialized) {
                return;
            }
            if (!metadataForms.get('commonToolsSection')) {
                return;
            }
            const properties = metadataForms
                .get('commonToolsSection')
                .getProperties('/raw_mimetype');
            if (!properties) {
                return;
            }
            tracker.widgetAdded.disconnect(maybeInitializeFormats);
            formatsInitialized = true;
            const services = app.serviceManager;
            const response = await services.nbconvert.getExportFormats(false);
            if (!response) {
                return;
            }
            // convert exportList to palette and menu items
            const formatList = Object.keys(response);
            const formatLabels = Private.getFormatLabels(translator);
            formatList.forEach(function (key) {
                var _a;
                const mimetypeExists = ((_a = properties.oneOf) === null || _a === void 0 ? void 0 : _a.filter(value => value.const === key).length) > 0;
                if (!mimetypeExists) {
                    const altOption = trans.__(key[0].toUpperCase() + key.substr(1));
                    const option = formatLabels[key] ? formatLabels[key] : altOption;
                    const mimeTypeValue = response[key].output_mimetype;
                    properties.oneOf.push({
                        const: mimeTypeValue,
                        title: option
                    });
                }
            });
            metadataForms
                .get('commonToolsSection')
                .setProperties('/raw_mimetype', properties);
        }
        tracker.widgetAdded.connect(maybeInitializeFormats);
    }
};
/**
 * Registering metadata editor fields.
 */
const customMetadataEditorFields = {
    id: '@jupyterlab/notebook-extension:metadata-editor',
    description: 'Adds metadata form for full metadata editor.',
    autoStart: true,
    requires: [notebook_lib_index_js_.INotebookTracker, codeeditor_lib_index_js_.IEditorServices, ui_components_lib_index_js_.IFormRendererRegistry],
    optional: [translation_lib_index_js_.ITranslator],
    activate: (app, tracker, editorServices, formRegistry, translator) => {
        const editorFactory = options => editorServices.factoryService.newInlineEditor(options);
        // Register the custom fields.
        const cellComponent = {
            fieldRenderer: (props) => {
                return new CellMetadataField({
                    editorFactory,
                    tracker,
                    label: 'Cell metadata',
                    translator: translator
                }).render(props);
            }
        };
        formRegistry.addRenderer('@jupyterlab/notebook-extension:metadata-editor.cell-metadata', cellComponent);
        const notebookComponent = {
            fieldRenderer: (props) => {
                return new NotebookMetadataField({
                    editorFactory,
                    tracker,
                    label: 'Notebook metadata',
                    translator: translator
                }).render(props);
            }
        };
        formRegistry.addRenderer('@jupyterlab/notebook-extension:metadata-editor.notebook-metadata', notebookComponent);
    }
};
/**
 * Registering active cell field.
 */
const activeCellTool = {
    id: '@jupyterlab/notebook-extension:active-cell-tool',
    description: 'Adds active cell field in the metadata editor tab.',
    autoStart: true,
    requires: [notebook_lib_index_js_.INotebookTracker, ui_components_lib_index_js_.IFormRendererRegistry, codemirror_lib_index_js_.IEditorLanguageRegistry],
    activate: (
    // Register the custom field.
    app, tracker, formRegistry, languages) => {
        const component = {
            fieldRenderer: (props) => {
                return new ActiveCellTool({
                    tracker,
                    languages
                }).render(props);
            }
        };
        formRegistry.addRenderer('@jupyterlab/notebook-extension:active-cell-tool.renderer', component);
    }
};
/**
 * A plugin to add "Notebook (no kernel)" to the "Open With" context menu.
 *
 * Follows a similar logic as the filebrowser plugin populating the "Open With" menu
 * based on widget factories.
 *
 * TODO: investigate generalizing opening without a kernel to other file types that may be
 * backed by a kernel.
 */
const openWithNoKernelPlugin = {
    id: '@jupyterlab/notebook-extension:open-with-no-kernel',
    description: 'Adds the "Notebook (no kernel)" option to the Open With menu.',
    requires: [filebrowser_lib_index_js_.IFileBrowserFactory],
    optional: [translation_lib_index_js_.ITranslator],
    autoStart: true,
    activate: (app, factory, translator) => {
        const { tracker } = factory;
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        const items = [];
        function updateOpenWithMenu(contextMenu) {
            var _a, _b;
            // Clear previous items
            items.forEach(item => item.dispose());
            items.length = 0;
            const openWith = (_b = (_a = contextMenu.menu.items.find(item => {
                var _a;
                return item.type === 'submenu' &&
                    ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-contextmenu-open-with';
            })) === null || _a === void 0 ? void 0 : _a.submenu) !== null && _b !== void 0 ? _b : null;
            if (!openWith) {
                return; // Bail early if the open with menu is not displayed
            }
            const selectedItems = tracker.currentWidget
                ? Array.from(tracker.currentWidget.selectedItems())
                : [];
            const hasNotebooks = selectedItems.some(item => item.type === 'notebook');
            if (hasNotebooks) {
                items.push(openWith.addItem({
                    command: 'filebrowser:open',
                    args: {
                        label: trans.__('Notebook (no kernel)'),
                        factory: FACTORY,
                        kernelPreference: {
                            shouldStart: false
                        }
                    }
                }));
            }
        }
        app.contextMenu.opened.connect(updateOpenWithMenu);
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    cellExecutor,
    factory,
    trackerPlugin,
    executionIndicator,
    exportPlugin,
    tools,
    commandEditItem,
    notebookTrustItem,
    widgetFactoryPlugin,
    logNotebookOutput,
    clonedOutputsPlugin,
    codeConsolePlugin,
    copyOutputPlugin,
    kernelStatus,
    lineColStatus,
    completerPlugin,
    searchProvider,
    tocPlugin,
    languageServerPlugin,
    updateRawMimetype,
    customMetadataEditorFields,
    activeCellTool,
    openWithNoKernelPlugin
];
/* harmony default export */ const lib = (plugins);
/**
 * Activate the notebook tools extension.
 */
function activateNotebookTools(app, tracker, editorServices, languages, state, translator, inspectorProvider) {
    const trans = translator.load('jupyterlab');
    const id = 'notebook-tools';
    const notebookTools = new notebook_lib_index_js_.NotebookTools({ tracker, translator });
    // Create message hook for triggers to save to the database.
    const hook = (sender, message) => {
        switch (message.type) {
            case 'activate-request':
                void state.save(id, { open: true });
                break;
            case 'after-hide':
            case 'close-request':
                void state.remove(id);
                break;
            default:
                break;
        }
        return true;
    };
    notebookTools.title.icon = ui_components_lib_index_js_.buildIcon;
    notebookTools.title.caption = trans.__('Notebook Tools');
    notebookTools.id = id;
    messaging_dist_index_es6_js_.MessageLoop.installMessageHook(notebookTools, hook);
    if (inspectorProvider) {
        tracker.widgetAdded.connect((sender, panel) => {
            const inspector = inspectorProvider.register(panel);
            inspector.render(notebookTools);
        });
    }
    return notebookTools;
}
/**
 * Activate the notebook widget factory.
 */
function activateWidgetFactory(app, contentFactory, editorServices, rendermime, toolbarRegistry, settingRegistry, sessionContextDialogs_, translator_) {
    const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
    const sessionContextDialogs = sessionContextDialogs_ !== null && sessionContextDialogs_ !== void 0 ? sessionContextDialogs_ : new lib_index_js_.SessionContextDialogs({ translator });
    const preferKernelOption = coreutils_lib_index_js_.PageConfig.getOption('notebookStartsKernel');
    // If the option is not set, assume `true`
    const preferKernelValue = preferKernelOption === '' || preferKernelOption.toLowerCase() === 'true';
    const { commands } = app;
    let toolbarFactory;
    // Register notebook toolbar widgets
    toolbarRegistry.addFactory(FACTORY, 'save', panel => docmanager_extension_lib_index_js_.ToolbarItems.createSaveButton(commands, panel.context.fileChanged));
    toolbarRegistry.addFactory(FACTORY, 'cellType', panel => notebook_lib_index_js_.ToolbarItems.createCellTypeItem(panel, translator));
    toolbarRegistry.addFactory(FACTORY, 'kernelName', panel => lib_index_js_.Toolbar.createKernelNameItem(panel.sessionContext, sessionContextDialogs, translator));
    toolbarRegistry.addFactory(FACTORY, 'executionProgress', panel => {
        const loadingSettings = settingRegistry === null || settingRegistry === void 0 ? void 0 : settingRegistry.load(trackerPlugin.id);
        const indicator = notebook_lib_index_js_.ExecutionIndicator.createExecutionIndicatorItem(panel, translator, loadingSettings);
        void (loadingSettings === null || loadingSettings === void 0 ? void 0 : loadingSettings.then(settings => {
            panel.disposed.connect(() => {
                settings.dispose();
            });
        }));
        return indicator;
    });
    if (settingRegistry) {
        // Create the factory
        toolbarFactory = (0,lib_index_js_.createToolbarFactory)(toolbarRegistry, settingRegistry, FACTORY, PANEL_SETTINGS, translator);
    }
    const trans = translator.load('jupyterlab');
    const factory = new notebook_lib_index_js_.NotebookWidgetFactory({
        name: FACTORY,
        label: trans.__('Notebook'),
        fileTypes: ['notebook'],
        modelName: 'notebook',
        defaultFor: ['notebook'],
        preferKernel: preferKernelValue,
        canStartKernel: true,
        rendermime,
        contentFactory,
        editorConfig: notebook_lib_index_js_.StaticNotebook.defaultEditorConfig,
        notebookConfig: notebook_lib_index_js_.StaticNotebook.defaultNotebookConfig,
        mimeTypeService: editorServices.mimeTypeService,
        toolbarFactory,
        translator
    });
    app.docRegistry.addWidgetFactory(factory);
    return factory;
}
/**
 * Activate the plugin to create and track cloned outputs.
 */
function activateClonedOutputs(app, docManager, notebookTracker, translator, restorer) {
    const trans = translator.load('jupyterlab');
    const clonedOutputs = new lib_index_js_.WidgetTracker({
        namespace: 'cloned-outputs'
    });
    if (restorer) {
        void restorer.restore(clonedOutputs, {
            command: CommandIDs.createOutputView,
            args: widget => ({
                path: widget.content.path,
                index: widget.content.index
            }),
            name: widget => `${widget.content.path}:${widget.content.index}`,
            when: notebookTracker.restored // After the notebook widgets (but not contents).
        });
    }
    const { commands, shell } = app;
    const isEnabledAndSingleSelected = () => {
        return Private.isEnabledAndSingleSelected(shell, notebookTracker);
    };
    commands.addCommand(CommandIDs.createOutputView, {
        label: trans.__('Create New View for Cell Output'),
        execute: async (args) => {
            var _a;
            let cell;
            let current;
            // If we are given a notebook path and cell index, then
            // use that, otherwise use the current active cell.
            const path = args.path;
            let index = args.index;
            if (path && index !== undefined && index !== null) {
                current = docManager.findWidget(path, FACTORY);
                if (!current) {
                    return;
                }
            }
            else {
                current = notebookTracker.currentWidget;
                if (!current) {
                    return;
                }
                cell = current.content.activeCell;
                index = current.content.activeCellIndex;
            }
            // Create a MainAreaWidget
            const content = new Private.ClonedOutputArea({
                notebook: current,
                cell,
                index,
                translator
            });
            const widget = new lib_index_js_.MainAreaWidget({ content });
            current.context.addSibling(widget, {
                ref: current.id,
                mode: 'split-bottom',
                type: 'Cloned Output'
            });
            const updateCloned = () => {
                void clonedOutputs.save(widget);
            };
            current.context.pathChanged.connect(updateCloned);
            (_a = current.context.model) === null || _a === void 0 ? void 0 : _a.cells.changed.connect(updateCloned);
            // Add the cloned output to the output widget tracker.
            void clonedOutputs.add(widget);
            // Remove the output view if the parent notebook is closed.
            current.content.disposed.connect(() => {
                var _a;
                current.context.pathChanged.disconnect(updateCloned);
                (_a = current.context.model) === null || _a === void 0 ? void 0 : _a.cells.changed.disconnect(updateCloned);
                widget.dispose();
            });
        },
        isEnabled: isEnabledAndSingleSelected,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: trans.__('The path to the notebook containing the cell')
                    },
                    index: {
                        type: 'number',
                        description: trans.__('The index of the cell to create an output view for')
                    }
                }
            }
        }
    });
}
/**
 * Activate the plugin to add code console functionalities
 */
function activateCodeConsole(app, tracker, translator) {
    const trans = translator.load('jupyterlab');
    const { commands, shell } = app;
    const isEnabled = () => Private.isEnabled(shell, tracker);
    commands.addCommand(CommandIDs.createConsole, {
        label: trans.__('New Console for Notebook'),
        execute: args => {
            const current = tracker.currentWidget;
            if (!current) {
                return;
            }
            return Private.createConsole(commands, current, args['activate']);
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the console after creation')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.createSubshellConsole, {
        label: trans.__('New Subshell Console for Notebook'),
        execute: args => {
            const current = tracker.currentWidget;
            if (!current) {
                return;
            }
            return Private.createConsole(commands, current, args['activate'], true);
        },
        isEnabled,
        isVisible: () => {
            var _a, _b, _c;
            const kernel = (_b = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.context.sessionContext.session) === null || _b === void 0 ? void 0 : _b.kernel;
            return (_c = kernel === null || kernel === void 0 ? void 0 : kernel.supportsSubshells) !== null && _c !== void 0 ? _c : false;
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the console after creation')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.runInConsole, {
        label: trans.__('Run Selected Text or Current Line in Console'),
        execute: async (args) => {
            var _a, _b;
            // Default to not activating the notebook (thereby putting the notebook
            // into command mode)
            const current = tracker.currentWidget;
            if (!current) {
                return;
            }
            const { context, content } = current;
            const cell = content.activeCell;
            const metadata = cell === null || cell === void 0 ? void 0 : cell.model.metadata;
            const path = context.path;
            // ignore action in non-code cell
            if (!cell || cell.model.type !== 'code') {
                return;
            }
            let code;
            const editor = cell.editor;
            if (!editor) {
                return;
            }
            const selection = editor.getSelection();
            const { start, end } = selection;
            const selected = start.column !== end.column || start.line !== end.line;
            if (selected) {
                // Get the selected code from the editor.
                const start = editor.getOffsetAt(selection.start);
                const end = editor.getOffsetAt(selection.end);
                code = editor.model.sharedModel.getSource().substring(start, end);
            }
            else {
                // no selection, find the complete statement around the current line
                const cursor = editor.getCursorPosition();
                const srcLines = editor.model.sharedModel.getSource().split('\n');
                let curLine = selection.start.line;
                while (curLine < editor.lineCount &&
                    !srcLines[curLine].replace(/\s/g, '').length) {
                    curLine += 1;
                }
                // if curLine > 0, we first do a search from beginning
                let fromFirst = curLine > 0;
                let firstLine = 0;
                let lastLine = firstLine + 1;
                // eslint-disable-next-line
                while (true) {
                    code = srcLines.slice(firstLine, lastLine).join('\n');
                    const reply = await ((_b = (_a = current.context.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.requestIsComplete({
                        // ipython needs an empty line at the end to correctly identify completeness of indented code
                        code: code + '\n\n'
                    }));
                    if ((reply === null || reply === void 0 ? void 0 : reply.content.status) === 'complete') {
                        if (curLine < lastLine) {
                            // we find a block of complete statement containing the current line, great!
                            while (lastLine < editor.lineCount &&
                                !srcLines[lastLine].replace(/\s/g, '').length) {
                                lastLine += 1;
                            }
                            editor.setCursorPosition({
                                line: lastLine,
                                column: cursor.column
                            });
                            break;
                        }
                        else {
                            // discard the complete statement before the current line and continue
                            firstLine = lastLine;
                            lastLine = firstLine + 1;
                        }
                    }
                    else if (lastLine < editor.lineCount) {
                        // if incomplete and there are more lines, add the line and check again
                        lastLine += 1;
                    }
                    else if (fromFirst) {
                        // we search from the first line and failed, we search again from current line
                        firstLine = curLine;
                        lastLine = curLine + 1;
                        fromFirst = false;
                    }
                    else {
                        // if we have searched both from first line and from current line and we
                        // cannot find anything, we submit the current line.
                        code = srcLines[curLine];
                        while (curLine + 1 < editor.lineCount &&
                            !srcLines[curLine + 1].replace(/\s/g, '').length) {
                            curLine += 1;
                        }
                        editor.setCursorPosition({
                            line: curLine + 1,
                            column: cursor.column
                        });
                        break;
                    }
                }
            }
            if (!code) {
                return;
            }
            await commands.execute('console:open', {
                activate: false,
                insertMode: 'split-bottom',
                path
            });
            await commands.execute('console:inject', {
                activate: false,
                code,
                path,
                metadata
            });
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
}
/**
 * Activate the output copying extension
 */
function activateCopyOutput(app, translator, tracker) {
    const trans = translator.load('jupyterlab');
    /**
     * Copy the contents of an HTMLElement to the system clipboard
     */
    function copyElement(e) {
        const sel = window.getSelection();
        if (sel == null) {
            return;
        }
        // Save the current selection.
        const savedRanges = [];
        for (let i = 0; i < sel.rangeCount; ++i) {
            savedRanges[i] = sel.getRangeAt(i).cloneRange();
        }
        const range = document.createRange();
        range.selectNodeContents(e);
        sel.removeAllRanges();
        sel.addRange(range);
        document.execCommand('copy');
        // Restore the saved selection.
        sel.removeAllRanges();
        savedRanges.forEach(r => sel.addRange(r));
    }
    app.commands.addCommand(CommandIDs.copyToClipboard, {
        label: trans.__('Copy Output to Clipboard'),
        execute: args => {
            var _a;
            const cell = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.activeCell;
            if (cell == null) {
                return;
            }
            const output = cell.outputArea.outputTracker.currentWidget;
            if (output == null) {
                return;
            }
            const outputAreaAreas = output.node.getElementsByClassName('jp-OutputArea-output');
            if (outputAreaAreas.length > 0) {
                const area = outputAreaAreas[0];
                copyElement(area);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    app.contextMenu.addItem({
        command: CommandIDs.copyToClipboard,
        selector: '.jp-Notebook .jp-OutputArea-child',
        rank: 0
    });
}
/**
 * Activate the notebook handler extension.
 */
function activateNotebookHandler(app, factory, extensions, executor, palette, defaultBrowser, launcher, restorer, mainMenu, router, settingRegistry, sessionDialogs_, translator_, formRegistry, filebrowserFactory) {
    (0,notebook_lib_index_js_.setCellExecutor)(executor);
    const translator = translator_ !== null && translator_ !== void 0 ? translator_ : translation_lib_index_js_.nullTranslator;
    const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new lib_index_js_.SessionContextDialogs({ translator });
    const trans = translator.load('jupyterlab');
    const services = app.serviceManager;
    const { commands, shell } = app;
    const tracker = new notebook_lib_index_js_.NotebookTracker({ namespace: 'notebook' });
    // Use the router to deal with hash navigation
    function onRouted(router, location) {
        if (location.hash && tracker.currentWidget) {
            tracker.currentWidget.setFragment(location.hash);
        }
    }
    router === null || router === void 0 ? void 0 : router.routed.connect(onRouted);
    const isEnabled = () => {
        return Private.isEnabled(shell, tracker);
    };
    const setSideBySideOutputRatio = (sideBySideOutputRatio) => document.documentElement.style.setProperty('--jp-side-by-side-output-size', `${sideBySideOutputRatio}fr`);
    // Fetch settings if possible.
    const fetchSettings = settingRegistry
        ? settingRegistry.load(trackerPlugin.id)
        : Promise.reject(new Error(`No setting registry for ${trackerPlugin.id}`));
    fetchSettings
        .then(settings => {
        updateConfig(settings);
        settings.changed.connect(() => {
            updateConfig(settings);
            commands.notifyCommandChanged(CommandIDs.virtualScrollbar);
        });
        const updateSessionSettings = (session, changes) => {
            const { newValue, oldValue } = changes;
            const autoStartDefault = newValue.autoStartDefault;
            if (typeof autoStartDefault === 'boolean' &&
                autoStartDefault !== oldValue.autoStartDefault) {
                // Ensure we break the cycle
                if (autoStartDefault !==
                    settings.get('autoStartDefaultKernel').composite)
                    // Once the settings is changed `updateConfig` will take care
                    // of the propagation to existing session context.
                    settings
                        .set('autoStartDefaultKernel', autoStartDefault)
                        .catch(reason => {
                        console.error(`Failed to set ${settings.id}.autoStartDefaultKernel`);
                    });
            }
        };
        const sessionContexts = new WeakSet();
        const listenToKernelPreference = (panel) => {
            const session = panel.context.sessionContext;
            if (!session.isDisposed && !sessionContexts.has(session)) {
                sessionContexts.add(session);
                session.kernelPreferenceChanged.connect(updateSessionSettings);
                session.disposed.connect(() => {
                    session.kernelPreferenceChanged.disconnect(updateSessionSettings);
                });
            }
        };
        tracker.forEach(listenToKernelPreference);
        tracker.widgetAdded.connect((tracker, panel) => {
            listenToKernelPreference(panel);
        });
        commands.addCommand(CommandIDs.autoClosingBrackets, {
            execute: args => {
                var _a;
                const codeConfig = settings.get('codeCellConfig')
                    .composite;
                const markdownConfig = settings.get('markdownCellConfig')
                    .composite;
                const rawConfig = settings.get('rawCellConfig')
                    .composite;
                const anyToggled = codeConfig.autoClosingBrackets ||
                    markdownConfig.autoClosingBrackets ||
                    rawConfig.autoClosingBrackets;
                const toggled = !!((_a = args['force']) !== null && _a !== void 0 ? _a : !anyToggled);
                [
                    codeConfig.autoClosingBrackets,
                    markdownConfig.autoClosingBrackets,
                    rawConfig.autoClosingBrackets
                ] = [toggled, toggled, toggled];
                void settings.set('codeCellConfig', codeConfig);
                void settings.set('markdownCellConfig', markdownConfig);
                void settings.set('rawCellConfig', rawConfig);
            },
            label: trans.__('Auto Close Brackets for All Notebook Cell Types'),
            isToggled: () => ['codeCellConfig', 'markdownCellConfig', 'rawCellConfig'].some(x => {
                var _a;
                return ((_a = settings.get(x).composite.autoClosingBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration['autoClosingBrackets']) === true;
            }),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        force: {
                            type: 'boolean',
                            description: trans.__('Force toggling the auto closing brackets setting')
                        }
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.setSideBySideRatio, {
            label: trans.__('Set side-by-side ratio'),
            execute: args => {
                lib_index_js_.InputDialog.getNumber({
                    title: trans.__('Width of the output in side-by-side mode'),
                    value: settings.get('sideBySideOutputRatio').composite
                })
                    .then(result => {
                    setSideBySideOutputRatio(result.value);
                    if (result.value) {
                        void settings.set('sideBySideOutputRatio', result.value);
                    }
                })
                    .catch(console.error);
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        addCommands(app, tracker, translator, sessionDialogs, settings, isEnabled);
    })
        .catch((reason) => {
        console.warn(reason.message);
        updateTracker({
            editorConfig: factory.editorConfig,
            notebookConfig: factory.notebookConfig,
            kernelShutdown: factory.shutdownOnClose,
            autoStartDefault: factory.autoStartDefault
        });
        addCommands(app, tracker, translator, sessionDialogs, null, isEnabled);
    });
    if (formRegistry) {
        const CMRenderer = formRegistry.getRenderer('@jupyterlab/codemirror-extension:plugin.defaultConfig');
        if (CMRenderer) {
            formRegistry.addRenderer('@jupyterlab/notebook-extension:tracker.codeCellConfig', CMRenderer);
            formRegistry.addRenderer('@jupyterlab/notebook-extension:tracker.markdownCellConfig', CMRenderer);
            formRegistry.addRenderer('@jupyterlab/notebook-extension:tracker.rawCellConfig', CMRenderer);
        }
    }
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: 'docmanager:open',
            args: panel => ({ path: panel.context.path, factory: FACTORY }),
            name: panel => panel.context.path,
            when: services.ready
        });
    }
    const registry = app.docRegistry;
    const modelFactory = new notebook_lib_index_js_.NotebookModelFactory({
        disableDocumentWideUndoRedo: factory.notebookConfig.disableDocumentWideUndoRedo,
        collaborative: true
    });
    registry.addModelFactory(modelFactory);
    if (palette) {
        populatePalette(palette, translator);
    }
    let id = 0; // The ID counter for notebook panels.
    const ft = app.docRegistry.getFileType('notebook');
    factory.widgetCreated.connect((sender, widget) => {
        var _a, _b, _c;
        // If the notebook panel does not have an ID, assign it one.
        widget.id = widget.id || `notebook-${++id}`;
        // Set up the title icon
        widget.title.icon = ft === null || ft === void 0 ? void 0 : ft.icon;
        widget.title.iconClass = (_a = ft === null || ft === void 0 ? void 0 : ft.iconClass) !== null && _a !== void 0 ? _a : '';
        widget.title.iconLabel = (_b = ft === null || ft === void 0 ? void 0 : ft.iconLabel) !== null && _b !== void 0 ? _b : '';
        widget.content.scrollbar = (_c = factory.notebookConfig.showMinimap) !== null && _c !== void 0 ? _c : false;
        // Notify the widget tracker if restore data needs to update.
        widget.context.pathChanged.connect(() => {
            void tracker.save(widget);
        });
        // Add the notebook panel to the tracker.
        void tracker.add(widget);
    });
    /**
     * Update the settings of the current tracker.
     */
    function updateTracker(options) {
        tracker.forEach(widget => {
            var _a;
            widget.setConfig(options);
            widget.content.scrollbar = (_a = options.notebookConfig.showMinimap) !== null && _a !== void 0 ? _a : false;
        });
    }
    /**
     * Update the setting values.
     */
    function updateConfig(settings) {
        const code = {
            ...notebook_lib_index_js_.StaticNotebook.defaultEditorConfig.code,
            ...settings.get('codeCellConfig').composite
        };
        const markdown = {
            ...notebook_lib_index_js_.StaticNotebook.defaultEditorConfig.markdown,
            ...settings.get('markdownCellConfig').composite
        };
        const raw = {
            ...notebook_lib_index_js_.StaticNotebook.defaultEditorConfig.raw,
            ...settings.get('rawCellConfig').composite
        };
        factory.editorConfig = { code, markdown, raw };
        factory.notebookConfig = {
            enableKernelInitNotification: settings.get('enableKernelInitNotification')
                .composite,
            autoRenderMarkdownCells: settings.get('autoRenderMarkdownCells')
                .composite,
            showHiddenCellsButton: settings.get('showHiddenCellsButton')
                .composite,
            scrollPastEnd: settings.get('scrollPastEnd').composite,
            defaultCell: settings.get('defaultCell').composite,
            recordTiming: settings.get('recordTiming').composite,
            overscanCount: settings.get('overscanCount').composite,
            showInputPlaceholder: settings.get('showInputPlaceholder')
                .composite,
            inputHistoryScope: settings.get('inputHistoryScope').composite,
            maxNumberOutputs: settings.get('maxNumberOutputs').composite,
            showEditorForReadOnlyMarkdown: settings.get('showEditorForReadOnlyMarkdown').composite,
            disableDocumentWideUndoRedo: !settings.get('documentWideUndoRedo')
                .composite,
            renderingLayout: settings.get('renderingLayout').composite,
            sideBySideLeftMarginOverride: settings.get('sideBySideLeftMarginOverride')
                .composite,
            sideBySideRightMarginOverride: settings.get('sideBySideRightMarginOverride').composite,
            sideBySideOutputRatio: settings.get('sideBySideOutputRatio')
                .composite,
            windowingMode: settings.get('windowingMode').composite,
            accessKernelHistory: settings.get('accessKernelHistory')
                .composite,
            showMinimap: settings.get('showMinimap').composite
        };
        setSideBySideOutputRatio(factory.notebookConfig.sideBySideOutputRatio);
        const sideBySideMarginStyle = `.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {
      margin-left: ${factory.notebookConfig.sideBySideLeftMarginOverride} !important;
      margin-right: ${factory.notebookConfig.sideBySideRightMarginOverride} !important;`;
        const sideBySideMarginTag = document.getElementById(SIDE_BY_SIDE_STYLE_ID);
        if (sideBySideMarginTag) {
            sideBySideMarginTag.innerText = sideBySideMarginStyle;
        }
        else {
            document.head.insertAdjacentHTML('beforeend', `<style id="${SIDE_BY_SIDE_STYLE_ID}">${sideBySideMarginStyle}}</style>`);
        }
        factory.autoStartDefault = settings.get('autoStartDefaultKernel')
            .composite;
        factory.shutdownOnClose = settings.get('kernelShutdown')
            .composite;
        modelFactory.disableDocumentWideUndoRedo = !settings.get('documentWideUndoRedo').composite;
        updateTracker({
            editorConfig: factory.editorConfig,
            notebookConfig: factory.notebookConfig,
            kernelShutdown: factory.shutdownOnClose,
            autoStartDefault: factory.autoStartDefault
        });
    }
    // Add main menu notebook menu.
    if (mainMenu) {
        populateMenus(mainMenu, isEnabled);
    }
    // Utility function to create a new notebook.
    const createNew = async (cwd, kernelId, kernelName) => {
        const model = await commands.execute('docmanager:new-untitled', {
            path: cwd,
            type: 'notebook'
        });
        if (model !== undefined) {
            const widget = (await commands.execute('docmanager:open', {
                path: model.path,
                factory: FACTORY,
                kernel: { id: kernelId, name: kernelName }
            }));
            widget.isUntitled = true;
            return widget;
        }
    };
    // Add a command for creating a new notebook.
    commands.addCommand(CommandIDs.createNew, {
        label: args => {
            var _a, _b, _c;
            const kernelName = args['kernelName'] || '';
            if (args['isLauncher'] && args['kernelName'] && services.kernelspecs) {
                return ((_c = (_b = (_a = services.kernelspecs.specs) === null || _a === void 0 ? void 0 : _a.kernelspecs[kernelName]) === null || _b === void 0 ? void 0 : _b.display_name) !== null && _c !== void 0 ? _c : '');
            }
            if (args['isPalette'] || args['isContextMenu']) {
                return trans.__('New Notebook');
            }
            return trans.__('Notebook');
        },
        caption: trans.__('Create a new notebook'),
        icon: args => (args['isPalette'] ? undefined : ui_components_lib_index_js_.notebookIcon),
        execute: args => {
            var _a, _b;
            const currentBrowser = (_a = filebrowserFactory === null || filebrowserFactory === void 0 ? void 0 : filebrowserFactory.tracker.currentWidget) !== null && _a !== void 0 ? _a : defaultBrowser;
            const cwd = args['cwd'] || ((_b = currentBrowser === null || currentBrowser === void 0 ? void 0 : currentBrowser.model.path) !== null && _b !== void 0 ? _b : '');
            const kernelId = args['kernelId'] || '';
            const kernelName = args['kernelName'] || '';
            return createNew(cwd, kernelId, kernelName);
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    cwd: {
                        type: 'string',
                        description: trans.__('Current working directory for the new notebook')
                    },
                    kernelId: {
                        type: 'string',
                        description: trans.__('Kernel ID to use for the new notebook')
                    },
                    kernelName: {
                        type: 'string',
                        description: trans.__('Kernel name to use for the new notebook')
                    },
                    isLauncher: {
                        type: 'boolean',
                        description: trans.__('Whether the command is executed from launcher')
                    },
                    isPalette: {
                        type: 'boolean',
                        description: trans.__('Whether the command is executed from palette')
                    },
                    isContextMenu: {
                        type: 'boolean',
                        description: trans.__('Whether the command is executed from context menu')
                    }
                }
            }
        }
    });
    // Add a launcher item if the launcher is available.
    if (launcher) {
        void services.ready.then(() => {
            let disposables = null;
            const onSpecsChanged = () => {
                if (disposables) {
                    disposables.dispose();
                    disposables = null;
                }
                const specs = services.kernelspecs.specs;
                if (!specs) {
                    return;
                }
                disposables = new dist_index_es6_js_.DisposableSet();
                for (const name in specs.kernelspecs) {
                    const rank = name === specs.default ? 0 : Infinity;
                    const spec = specs.kernelspecs[name];
                    const kernelIconUrl = spec.resources['logo-svg'] || spec.resources['logo-64x64'];
                    disposables.add(launcher.add({
                        command: CommandIDs.createNew,
                        args: { isLauncher: true, kernelName: name },
                        category: trans.__('Notebook'),
                        rank,
                        kernelIconUrl,
                        metadata: {
                            kernel: dist_index_js_.JSONExt.deepCopy(spec.metadata || {})
                        }
                    }));
                }
            };
            onSpecsChanged();
            services.kernelspecs.specsChanged.connect(onSpecsChanged);
        });
    }
    return tracker;
}
/**
 * Activate the completer service for notebook.
 */
function activateNotebookCompleterService(app, notebooks, manager, translator, appSanitizer) {
    if (!manager) {
        return;
    }
    const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
    const sanitizer = appSanitizer !== null && appSanitizer !== void 0 ? appSanitizer : new lib_index_js_.Sanitizer();
    app.commands.addCommand(CommandIDs.invokeCompleter, {
        label: trans.__('Display the completion helper.'),
        execute: args => {
            var _a;
            const panel = notebooks.currentWidget;
            if (panel && ((_a = panel.content.activeCell) === null || _a === void 0 ? void 0 : _a.model.type) === 'code') {
                manager.invoke(panel.id);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        }
    });
    app.commands.addCommand(CommandIDs.selectCompleter, {
        label: trans.__('Select the completion suggestion.'),
        execute: () => {
            const id = notebooks.currentWidget && notebooks.currentWidget.id;
            if (id) {
                return manager.select(id);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the widget')
                    }
                }
            }
        }
    });
    app.commands.addKeyBinding({
        command: CommandIDs.selectCompleter,
        keys: ['Enter'],
        selector: '.jp-Notebook .jp-mod-completer-active'
    });
    const updateCompleter = async (_, notebook) => {
        var _a, _b;
        const completerContext = {
            editor: (_b = (_a = notebook.content.activeCell) === null || _a === void 0 ? void 0 : _a.editor) !== null && _b !== void 0 ? _b : null,
            session: notebook.sessionContext.session,
            widget: notebook,
            sanitizer: sanitizer
        };
        await manager.updateCompleter(completerContext);
        notebook.content.activeCellChanged.connect((_, cell) => {
            // Ensure the editor will exist on the cell before adding the completer
            cell === null || cell === void 0 ? void 0 : cell.ready.then(() => {
                const newCompleterContext = {
                    editor: cell.editor,
                    session: notebook.sessionContext.session,
                    widget: notebook,
                    sanitizer: sanitizer
                };
                return manager.updateCompleter(newCompleterContext);
            }).catch(console.error);
        });
        notebook.sessionContext.sessionChanged.connect(() => {
            var _a;
            // Ensure the editor will exist on the cell before adding the completer
            (_a = notebook.content.activeCell) === null || _a === void 0 ? void 0 : _a.ready.then(() => {
                var _a, _b;
                const newCompleterContext = {
                    editor: (_b = (_a = notebook.content.activeCell) === null || _a === void 0 ? void 0 : _a.editor) !== null && _b !== void 0 ? _b : null,
                    session: notebook.sessionContext.session,
                    widget: notebook
                };
                return manager.updateCompleter(newCompleterContext);
            }).catch(console.error);
        });
    };
    notebooks.widgetAdded.connect(updateCompleter);
    manager.activeProvidersChanged.connect(() => {
        notebooks.forEach(panel => {
            updateCompleter(undefined, panel).catch(e => console.error(e));
        });
    });
}
/**
 * Activate the language server for notebook.
 */
function activateNotebookLanguageServer(app, notebooks, connectionManager, featureManager, codeExtractorManager, adapterTracker) {
    notebooks.widgetAdded.connect(async (_, notebook) => {
        const adapter = new notebook_lib_index_js_.NotebookAdapter(notebook, {
            connectionManager,
            featureManager,
            foreignCodeExtractorsManager: codeExtractorManager
        });
        adapterTracker.add(adapter);
    });
}
// Get the current widget and activate unless the args specify otherwise.
function getCurrent(tracker, shell, args) {
    var _a, _b;
    let widget = null;
    // Check for panelId in args (used by cell toolbars)
    if (args[cell_toolbar_lib_index_js_.CellBarExtension.WIDGET_ID_ARG]) {
        widget =
            (_a = tracker.find(panel => panel.id === args[cell_toolbar_lib_index_js_.CellBarExtension.WIDGET_ID_ARG])) !== null && _a !== void 0 ? _a : null;
    }
    else if (args[lib_index_js_.SemanticCommand.WIDGET]) {
        widget =
            (_b = tracker.find(panel => panel.id === args[lib_index_js_.SemanticCommand.WIDGET])) !== null && _b !== void 0 ? _b : null;
    }
    else {
        widget = tracker.currentWidget;
    }
    const activate = args['activate'] !== false;
    if (activate && widget) {
        shell.activateById(widget.id);
    }
    return widget;
}
/**
 * Add the notebook commands to the application's command registry.
 */
function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabled) {
    var _a;
    const trans = translator.load('jupyterlab');
    const { commands, shell } = app;
    const isEnabledAndSingleSelected = () => {
        return Private.isEnabledAndSingleSelected(shell, tracker);
    };
    const refreshCellCollapsed = (notebook) => {
        var _a, _b;
        for (const cell of notebook.widgets) {
            if (cell instanceof cells_lib_index_js_.MarkdownCell && cell.headingCollapsed) {
                cell
                    .getHeadings()
                    .then(() => {
                    notebook_lib_index_js_.NotebookActions.setHeadingCollapse(cell, true, notebook);
                })
                    .catch(error => {
                    console.warn('Failed to resolve headings: ', error);
                });
            }
            if (cell.model.id === ((_b = (_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.id)) {
                notebook_lib_index_js_.NotebookActions.expandParent(cell, notebook);
            }
        }
    };
    const isEnabledAndHeadingSelected = () => {
        return Private.isEnabledAndHeadingSelected(shell, tracker);
    };
    // Set up signal handler to keep the collapse state consistent
    tracker.currentChanged.connect((sender, panel) => {
        var _a, _b;
        if (!((_b = (_a = panel === null || panel === void 0 ? void 0 : panel.content) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.cells)) {
            return;
        }
        panel.content.model.cells.changed.connect((list, args) => {
            // Might be overkill to refresh this every time, but
            // it helps to keep the collapse state consistent.
            refreshCellCollapsed(panel.content);
        });
        panel.content.activeCellChanged.connect((notebook, cell) => {
            notebook_lib_index_js_.NotebookActions.expandParent(cell, notebook);
        });
    });
    tracker.selectionChanged.connect(() => {
        commands.notifyCommandChanged(CommandIDs.duplicateBelow);
        commands.notifyCommandChanged(CommandIDs.deleteCell);
        commands.notifyCommandChanged(CommandIDs.copy);
        commands.notifyCommandChanged(CommandIDs.cut);
        commands.notifyCommandChanged(CommandIDs.pasteBelow);
        commands.notifyCommandChanged(CommandIDs.pasteAbove);
        commands.notifyCommandChanged(CommandIDs.pasteAndReplace);
        commands.notifyCommandChanged(CommandIDs.moveUp);
        commands.notifyCommandChanged(CommandIDs.moveDown);
        commands.notifyCommandChanged(CommandIDs.run);
        commands.notifyCommandChanged(CommandIDs.runAll);
        commands.notifyCommandChanged(CommandIDs.runAndAdvance);
        commands.notifyCommandChanged(CommandIDs.runAndInsert);
    });
    tracker.activeCellChanged.connect(() => {
        commands.notifyCommandChanged(CommandIDs.moveUp);
        commands.notifyCommandChanged(CommandIDs.moveDown);
    });
    commands.addCommand(CommandIDs.runAndAdvance, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Run Selected Cell', 'Run Selected Cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Run this cell and advance', 'Run these %1 cells and advance', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { context, content } = current;
                return notebook_lib_index_js_.NotebookActions.runAndAdvance(content, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.runIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.run, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Run Selected Cell and Do not Advance', 'Run Selected Cells and Do not Advance', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { context, content } = current;
                return notebook_lib_index_js_.NotebookActions.run(content, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.runAndInsert, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Run Selected Cell and Insert Below', 'Run Selected Cells and Insert Below', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { context, content } = current;
                return notebook_lib_index_js_.NotebookActions.runAndInsert(content, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.runAll, {
        label: trans.__('Run All Cells'),
        caption: trans.__('Run all cells'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { context, content } = current;
                return notebook_lib_index_js_.NotebookActions.runAll(content, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.runAllAbove, {
        label: trans.__('Run All Above Selected Cell'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { context, content } = current;
                return notebook_lib_index_js_.NotebookActions.runAllAbove(content, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled: () => {
            // Can't run above if there are multiple cells selected,
            // or if we are at the top of the notebook.
            return (isEnabledAndSingleSelected() &&
                tracker.currentWidget.content.activeCellIndex !== 0);
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.runAllBelow, {
        label: trans.__('Run Selected Cell and All Below'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { context, content } = current;
                return notebook_lib_index_js_.NotebookActions.runAllBelow(content, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled: () => {
            // Can't run below if there are multiple cells selected,
            // or if we are at the bottom of the notebook.
            return (isEnabledAndSingleSelected() &&
                (tracker.currentWidget.content.widgets.length === 1 ||
                    tracker.currentWidget.content.activeCellIndex !==
                        tracker.currentWidget.content.widgets.length - 1));
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.renderAllMarkdown, {
        label: trans.__('Render All Markdown Cells'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { content } = current;
                return notebook_lib_index_js_.NotebookActions.renderAllMarkdown(content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.restart, {
        label: trans.__('Restart Kernel…'),
        caption: trans.__('Restart the kernel'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return sessionDialogs.restart(current.sessionContext);
            }
        },
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.refreshIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.shutdown, {
        label: trans.__('Shut Down Kernel'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (!current) {
                return;
            }
            return current.context.sessionContext.shutdown();
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.closeAndShutdown, {
        label: trans.__('Close and Shut Down Notebook…'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (!current) {
                return;
            }
            const fileName = current.title.label;
            return (0,lib_index_js_.showDialog)({
                title: trans.__('Shut down the notebook?'),
                body: trans.__('Are you sure you want to close "%1"?', fileName),
                buttons: [lib_index_js_.Dialog.cancelButton(), lib_index_js_.Dialog.warnButton()]
            }).then(result => {
                if (result.button.accept) {
                    return commands
                        .execute(CommandIDs.shutdown, { activate: false })
                        .then(() => {
                        current.dispose();
                    });
                }
            });
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.trust, {
        label: () => trans.__('Trust Notebook'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const { context, content } = current;
                return notebook_lib_index_js_.NotebookActions.trust(content).then(() => context.save());
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.restartClear, {
        label: trans.__('Restart Kernel and Clear Outputs of All Cells…'),
        caption: trans.__('Restart the kernel and clear all outputs of all cells'),
        execute: async () => {
            const restarted = await commands.execute(CommandIDs.restart, {
                activate: false
            });
            if (restarted) {
                await commands.execute(CommandIDs.clearAllOutputs);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.restartAndRunToSelected, {
        label: trans.__('Restart Kernel and Run up to Selected Cell…'),
        execute: async (args) => {
            const current = getCurrent(tracker, shell, { activate: false, ...args });
            if (!current) {
                return;
            }
            const { context, content } = current;
            const cells = content.widgets.slice(0, content.activeCellIndex + 1);
            const restarted = await sessionDialogs.restart(current.sessionContext);
            if (restarted) {
                return notebook_lib_index_js_.NotebookActions.runCells(content, cells, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled: isEnabledAndSingleSelected,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.restartRunAll, {
        label: trans.__('Restart Kernel and Run All Cells…'),
        caption: trans.__('Restart the kernel and run all cells'),
        execute: async (args) => {
            const current = getCurrent(tracker, shell, { activate: false, ...args });
            if (!current) {
                return;
            }
            const { context, content } = current;
            const cells = content.widgets;
            const restarted = await sessionDialogs.restart(current.sessionContext);
            if (restarted) {
                return notebook_lib_index_js_.NotebookActions.runCells(content, cells, context.sessionContext, sessionDialogs, translator);
            }
        },
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.fastForwardIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.clearAllOutputs, {
        label: trans.__('Clear Outputs of All Cells'),
        caption: trans.__('Clear all outputs of all cells'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.clearAllOutputs(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.clearOutputs, {
        label: trans.__('Clear Cell Output'),
        caption: trans.__('Clear outputs for the selected cells'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.clearOutputs(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.interrupt, {
        label: trans.__('Interrupt Kernel'),
        caption: trans.__('Interrupt the kernel'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, args);
            if (!current) {
                return;
            }
            const kernel = (_a = current.context.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
            if (kernel) {
                return kernel.interrupt();
            }
        },
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.stopIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.toCode, {
        label: trans.__('Change to Code Cell Type'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.changeCellType(current.content, 'code', translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toMarkdown, {
        label: trans.__('Change to Markdown Cell Type'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.changeCellType(current.content, 'markdown', translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toRaw, {
        label: trans.__('Change to Raw Cell Type'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.changeCellType(current.content, 'raw', translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.cut, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Cut Cell', 'Cut Cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Cut this cell', 'Cut these %1 cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: async (args) => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    return await notebook_lib_index_js_.NotebookActions.cutToSystemClipboard(current.content);
                }
                return notebook_lib_index_js_.NotebookActions.cut(current.content);
            }
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.cutIcon : undefined),
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.copy, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Copy Cell', 'Copy Cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Copy this cell', 'Copy these %1 cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: async (args) => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    return await notebook_lib_index_js_.NotebookActions.copyToSystemClipboard(current.content);
                }
                return notebook_lib_index_js_.NotebookActions.copy(current.content);
            }
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.copyIcon : undefined),
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.pasteBelow, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Paste Cell Below', 'Paste Cells Below', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Paste this cell from the clipboard', 'Paste these %1 cells from the clipboard', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: async (args) => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    return await notebook_lib_index_js_.NotebookActions.pasteFromSystemClipboard(current.content, 'below');
                }
                return notebook_lib_index_js_.NotebookActions.paste(current.content, 'below');
            }
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.pasteIcon : undefined),
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.pasteAbove, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Paste Cell Above', 'Paste Cells Above', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Paste this cell from the clipboard', 'Paste these %1 cells from the clipboard', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: async (args) => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    return await notebook_lib_index_js_.NotebookActions.pasteFromSystemClipboard(current.content, 'above');
                }
                return notebook_lib_index_js_.NotebookActions.paste(current.content, 'above');
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.duplicateBelow, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Duplicate Cell Below', 'Duplicate Cells Below', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Create a duplicate of this cell below', 'Create duplicates of %1 cells below', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                notebook_lib_index_js_.NotebookActions.duplicate(current.content, 'belowSelected');
            }
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.duplicateIcon : undefined),
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.pasteAndReplace, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Paste Cell and Replace', 'Paste Cells and Replace', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: async (args) => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    return await notebook_lib_index_js_.NotebookActions.pasteFromSystemClipboard(current.content, 'replace');
                }
                return notebook_lib_index_js_.NotebookActions.paste(current.content, 'replace');
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.deleteCell, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Delete Cell', 'Delete Cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Delete this cell', 'Delete these %1 cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.deleteCells(current.content);
            }
        },
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.split, {
        label: trans.__('Split Cell'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.splitCell(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.merge, {
        label: trans.__('Merge Selected Cells'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const addExtraLine = (_a = settings === null || settings === void 0 ? void 0 : settings.get('addExtraLineOnCellMerge').composite) !== null && _a !== void 0 ? _a : true;
                return notebook_lib_index_js_.NotebookActions.mergeCells(current.content, false, addExtraLine);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.mergeAbove, {
        label: trans.__('Merge Cell Above'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const addExtraLine = (_a = settings === null || settings === void 0 ? void 0 : settings.get('addExtraLineOnCellMerge').composite) !== null && _a !== void 0 ? _a : true;
                return notebook_lib_index_js_.NotebookActions.mergeCells(current.content, true, addExtraLine);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.mergeBelow, {
        label: trans.__('Merge Cell Below'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const addExtraLine = (_a = settings === null || settings === void 0 ? void 0 : settings.get('addExtraLineOnCellMerge').composite) !== null && _a !== void 0 ? _a : true;
                return notebook_lib_index_js_.NotebookActions.mergeCells(current.content, false, addExtraLine);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.insertAbove, {
        label: trans.__('Insert Cell Above'),
        caption: trans.__('Insert a cell above'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.insertAbove(current.content);
            }
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.addAboveIcon : undefined),
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.insertBelow, {
        label: trans.__('Insert Cell Below'),
        caption: trans.__('Insert a cell below'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.insertBelow(current.content);
            }
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.addBelowIcon : undefined),
        isEnabled: args => (args.toolbar ? true : isEnabled()),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.selectAbove, {
        label: trans.__('Select Cell Above'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.selectAbove(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.selectBelow, {
        label: trans.__('Select Cell Below'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.selectBelow(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.insertHeadingAbove, {
        label: trans.__('Insert Heading Above Current Heading'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.insertSameLevelHeadingAbove(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.insertHeadingBelow, {
        label: trans.__('Insert Heading Below Current Heading'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.insertSameLevelHeadingBelow(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.selectHeadingAboveOrCollapse, {
        label: trans.__('Select Heading Above or Collapse Heading'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.selectHeadingAboveOrCollapseHeading(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.selectHeadingBelowOrExpand, {
        label: trans.__('Select Heading Below or Expand Heading'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.selectHeadingBelowOrExpandHeading(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.extendAbove, {
        label: trans.__('Extend Selection Above'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.extendSelectionAbove(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.extendTop, {
        label: trans.__('Extend Selection to Top'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.extendSelectionAbove(current.content, true);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.extendBelow, {
        label: trans.__('Extend Selection Below'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.extendSelectionBelow(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.extendBottom, {
        label: trans.__('Extend Selection to Bottom'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.extendSelectionBelow(current.content, true);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.selectAll, {
        label: trans.__('Select All Cells'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.selectAll(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.deselectAll, {
        label: trans.__('Deselect All Cells'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.deselectAll(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.moveUp, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Move Cell Up', 'Move Cells Up', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Move this cell up', 'Move these %1 cells up', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                notebook_lib_index_js_.NotebookActions.moveUp(current.content);
                Private.raiseSilentNotification(trans.__('Notebook cell shifted up successfully'), current.node);
            }
        },
        isEnabled: args => {
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            if (!current) {
                return false;
            }
            return current.content.activeCellIndex >= 1;
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.moveUpIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.moveDown, {
        label: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Move Cell Down', 'Move Cells Down', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        caption: args => {
            var _a;
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            return trans._n('Move this cell down', 'Move these %1 cells down', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
        },
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                notebook_lib_index_js_.NotebookActions.moveDown(current.content);
                Private.raiseSilentNotification(trans.__('Notebook cell shifted down successfully'), current.node);
            }
        },
        isEnabled: args => {
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            if (!current || !current.content.model) {
                return false;
            }
            const length = current.content.model.cells.length;
            return current.content.activeCellIndex < length - 1;
        },
        icon: args => (args.toolbar ? ui_components_lib_index_js_.moveDownIcon : undefined),
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: 'Whether the command is being executed from the toolbar'
                    },
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.toggleAllLines, {
        label: trans.__('Show Line Numbers'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.toggleAllLineNumbers(current.content);
            }
        },
        isEnabled,
        isToggled: args => {
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            if (current) {
                const config = current.content.editorConfig;
                return !!(config.code.lineNumbers &&
                    config.markdown.lineNumbers &&
                    config.raw.lineNumbers);
            }
            else {
                return false;
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.commandMode, {
        label: trans.__('Enter Command Mode'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                current.content.mode = 'command';
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.editMode, {
        label: trans.__('Enter Edit Mode'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                current.content.mode = 'edit';
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.undoCellAction, {
        label: trans.__('Undo Cell Operation'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.undo(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.redoCellAction, {
        label: trans.__('Redo Cell Operation'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.redo(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.redo, {
        label: trans.__('Redo'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const cell = current.content.activeCell;
                if (cell) {
                    cell.inputHidden = false;
                    return (_a = cell.editor) === null || _a === void 0 ? void 0 : _a.redo();
                }
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.undo, {
        label: trans.__('Undo'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, args);
            if (current) {
                const cell = current.content.activeCell;
                if (cell) {
                    cell.inputHidden = false;
                    return (_a = cell.editor) === null || _a === void 0 ? void 0 : _a.undo();
                }
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.changeKernel, {
        label: trans.__('Change Kernel…'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return sessionDialogs.selectKernel(current.context.sessionContext);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.getKernel, {
        label: trans.__('Get Kernel'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, { activate: false, ...args });
            if (current) {
                return (_a = current.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.reconnectToKernel, {
        label: trans.__('Reconnect to Kernel'),
        execute: args => {
            var _a;
            const current = getCurrent(tracker, shell, args);
            if (!current) {
                return;
            }
            const kernel = (_a = current.context.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
            if (kernel) {
                return kernel.reconnect();
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.markdown1, {
        label: trans.__('Change to Heading 1'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.setMarkdownHeader(current.content, 1, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.markdown2, {
        label: trans.__('Change to Heading 2'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.setMarkdownHeader(current.content, 2, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.markdown3, {
        label: trans.__('Change to Heading 3'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.setMarkdownHeader(current.content, 3, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.markdown4, {
        label: trans.__('Change to Heading 4'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.setMarkdownHeader(current.content, 4, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.markdown5, {
        label: trans.__('Change to Heading 5'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.setMarkdownHeader(current.content, 5, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.markdown6, {
        label: trans.__('Change to Heading 6'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.setMarkdownHeader(current.content, 6, translator);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.hideCode, {
        label: trans.__('Collapse Selected Code'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.hideCode(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.showCode, {
        label: trans.__('Expand Selected Code'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.showCode(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.hideAllCode, {
        label: trans.__('Collapse All Code'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.hideAllCode(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.showAllCode, {
        label: trans.__('Expand All Code'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.showAllCode(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.hideOutput, {
        label: trans.__('Collapse Selected Outputs'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.hideOutput(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.showOutput, {
        label: trans.__('Expand Selected Outputs'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.showOutput(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleOutput, {
        label: trans.__('Toggle Visibility of Selected Outputs'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.toggleOutput(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.hideAllOutputs, {
        label: trans.__('Collapse All Outputs'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.hideAllOutputs(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.toggleRenderSideBySideCurrentNotebook, {
        label: trans.__('Render Side-by-Side'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                if (current.content.renderingLayout === 'side-by-side') {
                    return notebook_lib_index_js_.NotebookActions.renderDefault(current.content);
                }
                return notebook_lib_index_js_.NotebookActions.renderSideBySide(current.content);
            }
        },
        isEnabled,
        isToggled: args => {
            const current = getCurrent(tracker, shell, { ...args, activate: false });
            if (current) {
                return current.content.renderingLayout === 'side-by-side';
            }
            else {
                return false;
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.showAllOutputs, {
        label: trans.__('Expand All Outputs'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.showAllOutputs(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.enableOutputScrolling, {
        label: trans.__('Enable Scrolling for Outputs'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.enableOutputScrolling(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.disableOutputScrolling, {
        label: trans.__('Disable Scrolling for Outputs'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.disableOutputScrolling(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.selectLastRunCell, {
        label: trans.__('Select current running or last run cell'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.selectLastRunCell(current.content);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.replaceSelection, {
        label: trans.__('Replace Selection in Notebook Cell'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            const text = args['text'] || '';
            if (current) {
                return notebook_lib_index_js_.NotebookActions.replaceSelection(current.content, text);
            }
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    text: {
                        type: 'string',
                        description: trans.__('Text to replace the selection with')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.toggleCollapseCmd, {
        label: trans.__('Toggle Collapse Notebook Heading'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.toggleCurrentHeadingCollapse(current.content);
            }
        },
        isEnabled: isEnabledAndHeadingSelected,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.collapseAllCmd, {
        label: trans.__('Collapse All Headings'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.collapseAllHeadings(current.content);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.expandAllCmd, {
        label: trans.__('Expand All Headings'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return notebook_lib_index_js_.NotebookActions.expandAllHeadings(current.content);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.tocRunCells, {
        label: trans.__('Select and Run Cell(s) for this Heading'),
        execute: args => {
            const current = getCurrent(tracker, shell, { activate: false, ...args });
            if (current === null) {
                return;
            }
            const activeCell = current.content.activeCell;
            let lastIndex = current.content.activeCellIndex;
            if (activeCell instanceof cells_lib_index_js_.MarkdownCell) {
                const cells = current.content.widgets;
                const level = activeCell.headingInfo.level;
                for (let i = current.content.activeCellIndex + 1; i < cells.length; i++) {
                    const cell = cells[i];
                    if (cell instanceof cells_lib_index_js_.MarkdownCell &&
                        // cell.headingInfo.level === -1 if no heading
                        cell.headingInfo.level >= 0 &&
                        cell.headingInfo.level <= level) {
                        break;
                    }
                    lastIndex = i;
                }
            }
            current.content.extendContiguousSelectionTo(lastIndex);
            void notebook_lib_index_js_.NotebookActions.run(current.content, current.sessionContext, sessionDialogs, translator);
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    activate: {
                        type: 'boolean',
                        description: trans.__('Whether to activate the notebook after execution')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.accessPreviousHistory, {
        label: trans.__('Access Previous Kernel History Entry'),
        execute: async (args) => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return await notebook_lib_index_js_.NotebookActions.accessPreviousHistory(current.content);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.accessNextHistory, {
        label: trans.__('Access Next Kernel History Entry'),
        execute: async (args) => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                return await notebook_lib_index_js_.NotebookActions.accessNextHistory(current.content);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.virtualScrollbar, {
        label: trans.__('Show Minimap'),
        caption: trans.__('Show Minimap'),
        execute: args => {
            const current = getCurrent(tracker, shell, args);
            if (current) {
                current.content.scrollbar = !current.content.scrollbar;
            }
        },
        isEnabled: () => {
            const current = tracker.currentWidget;
            return !!current;
        },
        isToggled: () => {
            var _a;
            const current = tracker.currentWidget;
            return (_a = current === null || current === void 0 ? void 0 : current.content.scrollbar) !== null && _a !== void 0 ? _a : false;
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    // All commands with isEnabled defined directly or in a semantic commands
    // To simplify here we added all commands as most of them have isEnabled
    const skip = [CommandIDs.createNew, CommandIDs.createOutputView];
    const notify = () => {
        Object.values(CommandIDs)
            .filter(id => !skip.includes(id) && app.commands.hasCommand(id))
            .forEach(id => app.commands.notifyCommandChanged(id));
    };
    tracker.currentChanged.connect(notify);
    (_a = shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);
}
/**
 * Populate the application's command palette with notebook commands.
 */
function populatePalette(palette, translator) {
    const trans = translator.load('jupyterlab');
    let category = trans.__('Notebook Operations');
    [
        CommandIDs.interrupt,
        CommandIDs.restart,
        CommandIDs.restartClear,
        CommandIDs.restartRunAll,
        CommandIDs.runAll,
        CommandIDs.renderAllMarkdown,
        CommandIDs.runAllAbove,
        CommandIDs.runAllBelow,
        CommandIDs.restartAndRunToSelected,
        CommandIDs.selectAll,
        CommandIDs.deselectAll,
        CommandIDs.clearAllOutputs,
        CommandIDs.toggleAllLines,
        CommandIDs.editMode,
        CommandIDs.commandMode,
        CommandIDs.changeKernel,
        CommandIDs.reconnectToKernel,
        CommandIDs.createConsole,
        CommandIDs.createSubshellConsole,
        CommandIDs.closeAndShutdown,
        CommandIDs.trust,
        CommandIDs.toggleCollapseCmd,
        CommandIDs.collapseAllCmd,
        CommandIDs.expandAllCmd,
        CommandIDs.accessPreviousHistory,
        CommandIDs.accessNextHistory,
        CommandIDs.virtualScrollbar
    ].forEach(command => {
        palette.addItem({ command, category });
    });
    palette.addItem({
        command: CommandIDs.createNew,
        category,
        args: { isPalette: true }
    });
    category = trans.__('Notebook Cell Operations');
    [
        CommandIDs.run,
        CommandIDs.runAndAdvance,
        CommandIDs.runAndInsert,
        CommandIDs.runInConsole,
        CommandIDs.clearOutputs,
        CommandIDs.toCode,
        CommandIDs.toMarkdown,
        CommandIDs.toRaw,
        CommandIDs.cut,
        CommandIDs.copy,
        CommandIDs.pasteBelow,
        CommandIDs.pasteAbove,
        CommandIDs.pasteAndReplace,
        CommandIDs.deleteCell,
        CommandIDs.split,
        CommandIDs.merge,
        CommandIDs.mergeAbove,
        CommandIDs.mergeBelow,
        CommandIDs.insertAbove,
        CommandIDs.insertBelow,
        CommandIDs.selectAbove,
        CommandIDs.selectBelow,
        CommandIDs.selectHeadingAboveOrCollapse,
        CommandIDs.selectHeadingBelowOrExpand,
        CommandIDs.insertHeadingAbove,
        CommandIDs.insertHeadingBelow,
        CommandIDs.extendAbove,
        CommandIDs.extendTop,
        CommandIDs.extendBelow,
        CommandIDs.extendBottom,
        CommandIDs.moveDown,
        CommandIDs.moveUp,
        CommandIDs.undoCellAction,
        CommandIDs.redoCellAction,
        CommandIDs.markdown1,
        CommandIDs.markdown2,
        CommandIDs.markdown3,
        CommandIDs.markdown4,
        CommandIDs.markdown5,
        CommandIDs.markdown6,
        CommandIDs.hideCode,
        CommandIDs.showCode,
        CommandIDs.hideAllCode,
        CommandIDs.showAllCode,
        CommandIDs.hideOutput,
        CommandIDs.showOutput,
        CommandIDs.toggleOutput,
        CommandIDs.hideAllOutputs,
        CommandIDs.showAllOutputs,
        CommandIDs.toggleRenderSideBySideCurrentNotebook,
        CommandIDs.setSideBySideRatio,
        CommandIDs.enableOutputScrolling,
        CommandIDs.disableOutputScrolling
    ].forEach(command => {
        palette.addItem({ command, category });
    });
}
/**
 * Populates the application menus for the notebook.
 */
function populateMenus(mainMenu, isEnabled) {
    // Add undo/redo hooks to the edit menu.
    mainMenu.editMenu.undoers.redo.add({
        id: CommandIDs.redo,
        isEnabled
    });
    mainMenu.editMenu.undoers.undo.add({
        id: CommandIDs.undo,
        isEnabled
    });
    // Add a clearer to the edit menu
    mainMenu.editMenu.clearers.clearAll.add({
        id: CommandIDs.clearAllOutputs,
        isEnabled
    });
    mainMenu.editMenu.clearers.clearCurrent.add({
        id: CommandIDs.clearOutputs,
        isEnabled
    });
    // Add a console creator the the Kernel menu
    mainMenu.fileMenu.consoleCreators.add({
        id: CommandIDs.createConsole,
        isEnabled
    });
    // Add a close and shutdown command to the file menu.
    mainMenu.fileMenu.closeAndCleaners.add({
        id: CommandIDs.closeAndShutdown,
        isEnabled
    });
    // Add a kernel user to the Kernel menu
    mainMenu.kernelMenu.kernelUsers.changeKernel.add({
        id: CommandIDs.changeKernel,
        isEnabled
    });
    mainMenu.kernelMenu.kernelUsers.clearWidget.add({
        id: CommandIDs.clearAllOutputs,
        isEnabled
    });
    mainMenu.kernelMenu.kernelUsers.interruptKernel.add({
        id: CommandIDs.interrupt,
        isEnabled
    });
    mainMenu.kernelMenu.kernelUsers.reconnectToKernel.add({
        id: CommandIDs.reconnectToKernel,
        isEnabled
    });
    mainMenu.kernelMenu.kernelUsers.restartKernel.add({
        id: CommandIDs.restart,
        isEnabled
    });
    mainMenu.kernelMenu.kernelUsers.shutdownKernel.add({
        id: CommandIDs.shutdown,
        isEnabled
    });
    // Add an IEditorViewer to the application view menu
    mainMenu.viewMenu.editorViewers.toggleLineNumbers.add({
        id: CommandIDs.toggleAllLines,
        isEnabled
    });
    mainMenu.viewMenu.editorViewers.toggleMinimap.add({
        id: CommandIDs.virtualScrollbar,
        isEnabled: () => true
    });
    // Add an ICodeRunner to the application run menu
    mainMenu.runMenu.codeRunners.restart.add({
        id: CommandIDs.restart,
        isEnabled
    });
    mainMenu.runMenu.codeRunners.run.add({
        id: CommandIDs.runAndAdvance,
        isEnabled
    });
    mainMenu.runMenu.codeRunners.runAll.add({ id: CommandIDs.runAll, isEnabled });
    // Add kernel information to the application help menu.
    mainMenu.helpMenu.getKernel.add({
        id: CommandIDs.getKernel,
        isEnabled
    });
}
/**
 * A namespace for module private functionality.
 */
var Private;
(function (Private) {
    /**
     * Create a console connected with a notebook kernel
     *
     * @param commands Commands registry
     * @param widget Notebook panel
     * @param activate Should the console be activated
     * @param subshell Should the console contain a subshell or the main shell
     */
    function createConsole(commands, widget, activate, subshell) {
        const options = {
            path: widget.context.path,
            preferredLanguage: widget.context.model.defaultKernelLanguage,
            activate: activate,
            subshell: subshell,
            ref: widget.id,
            insertMode: 'split-bottom',
            type: 'Linked Console'
        };
        return commands.execute('console:create', options);
    }
    Private.createConsole = createConsole;
    /**
     * Whether there is an active notebook.
     */
    function isEnabled(shell, tracker) {
        return (tracker.currentWidget !== null &&
            tracker.currentWidget === shell.currentWidget);
    }
    Private.isEnabled = isEnabled;
    /**
     * Whether there is an notebook active, with a single selected cell.
     */
    function isEnabledAndSingleSelected(shell, tracker) {
        if (!Private.isEnabled(shell, tracker)) {
            return false;
        }
        const { content } = tracker.currentWidget;
        const index = content.activeCellIndex;
        // If there are selections that are not the active cell,
        // this command is confusing, so disable it.
        for (let i = 0; i < content.widgets.length; ++i) {
            if (content.isSelected(content.widgets[i]) && i !== index) {
                return false;
            }
        }
        return true;
    }
    Private.isEnabledAndSingleSelected = isEnabledAndSingleSelected;
    /**
     * Whether there is an notebook active, with a single selected cell.
     */
    function isEnabledAndHeadingSelected(shell, tracker) {
        if (!Private.isEnabled(shell, tracker)) {
            return false;
        }
        const { content } = tracker.currentWidget;
        const index = content.activeCellIndex;
        if (!(content.activeCell instanceof cells_lib_index_js_.MarkdownCell)) {
            return false;
        }
        // If there are selections that are not the active cell,
        // this command is confusing, so disable it.
        for (let i = 0; i < content.widgets.length; ++i) {
            if (content.isSelected(content.widgets[i]) && i !== index) {
                return false;
            }
        }
        return true;
    }
    Private.isEnabledAndHeadingSelected = isEnabledAndHeadingSelected;
    /**
     * The default Export To ... formats and their human readable labels.
     */
    function getFormatLabels(translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        return {
            html: trans.__('HTML'),
            latex: trans.__('LaTeX'),
            markdown: trans.__('Markdown'),
            pdf: trans.__('PDF'),
            rst: trans.__('ReStructured Text'),
            script: trans.__('Executable Script'),
            slides: trans.__('Reveal.js Slides')
        };
    }
    Private.getFormatLabels = getFormatLabels;
    /**
     * Raises a silent notification that is read by screen readers
     *
     * FIXME: Once a notificatiom API is introduced (https://github.com/jupyterlab/jupyterlab/issues/689),
     * this can be refactored to use the same.
     *
     * More discussion at https://github.com/jupyterlab/jupyterlab/pull/9031#issuecomment-773541469
     *
     *
     * @param message Message to be relayed to screen readers
     * @param notebookNode DOM node to which the notification container is attached
     */
    function raiseSilentNotification(message, notebookNode) {
        const hiddenAlertContainerId = `sr-message-container-${notebookNode.id}`;
        const hiddenAlertContainer = document.getElementById(hiddenAlertContainerId) ||
            document.createElement('div');
        // If the container is not available, append the newly created container
        // to the current notebook panel and set related properties
        if (hiddenAlertContainer.getAttribute('id') !== hiddenAlertContainerId) {
            hiddenAlertContainer.classList.add('sr-only');
            hiddenAlertContainer.setAttribute('id', hiddenAlertContainerId);
            hiddenAlertContainer.setAttribute('role', 'alert');
            hiddenAlertContainer.hidden = true;
            notebookNode.appendChild(hiddenAlertContainer);
        }
        // Insert/Update alert container with the notification message
        hiddenAlertContainer.innerText = message;
    }
    Private.raiseSilentNotification = raiseSilentNotification;
    /**
     * A widget hosting a cloned output area.
     */
    class ClonedOutputArea extends widgets_dist_index_es6_js_.Panel {
        constructor(options) {
            super();
            this._cell = null;
            const trans = (options.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
            this._notebook = options.notebook;
            this._index = options.index !== undefined ? options.index : -1;
            this._cell = options.cell || null;
            this.id = `LinkedOutputView-${dist_index_js_.UUID.uuid4()}`;
            this.title.label = 'Output View';
            this.title.icon = ui_components_lib_index_js_.notebookIcon;
            this.title.caption = this._notebook.title.label
                ? trans.__('For Notebook: %1', this._notebook.title.label)
                : trans.__('For Notebook:');
            this.addClass('jp-LinkedOutputView');
            // Wait for the notebook to be loaded before
            // cloning the output area.
            void this._notebook.context.ready.then(() => {
                if (!this._cell) {
                    this._cell = this._notebook.content.widgets[this._index];
                }
                if (!this._cell || this._cell.model.type !== 'code') {
                    this.dispose();
                    return;
                }
                const clone = this._cell.cloneOutputArea();
                this.addWidget(clone);
            });
        }
        /**
         * The index of the cell in the notebook.
         */
        get index() {
            return this._cell
                ? index_es6_js_.ArrayExt.findFirstIndex(this._notebook.content.widgets, c => c === this._cell)
                : this._index;
        }
        /**
         * The path of the notebook for the cloned output area.
         */
        get path() {
            return this._notebook.context.path;
        }
    }
    Private.ClonedOutputArea = ClonedOutputArea;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 84221:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_statusbar_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(546);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_codeeditor_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7526);
/* harmony import */ var _jupyterlab_rendermime_style_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45304);
/* harmony import */ var _jupyterlab_docregistry_style_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30507);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_documentsearch_style_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(13737);
/* harmony import */ var _jupyterlab_codemirror_style_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(32871);
/* harmony import */ var _jupyterlab_docmanager_style_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(81393);
/* harmony import */ var _jupyterlab_filebrowser_style_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(40360);
/* harmony import */ var _jupyterlab_toc_style_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91302);
/* harmony import */ var _jupyterlab_cells_style_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(33230);
/* harmony import */ var _jupyterlab_lsp_style_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(27844);
/* harmony import */ var _jupyterlab_notebook_style_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(47456);
/* harmony import */ var _jupyterlab_completer_style_index_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(76576);
/* harmony import */ var _jupyterlab_docmanager_extension_style_index_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(91532);
/* harmony import */ var _jupyterlab_launcher_style_index_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(22640);
/* harmony import */ var _jupyterlab_logconsole_style_index_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(71960);
/* harmony import */ var _jupyterlab_mainmenu_style_index_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(70022);
/* harmony import */ var _jupyterlab_metadataform_style_index_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(37083);
/* harmony import */ var _jupyterlab_property_inspector_style_index_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(62374);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */

























/***/ }),

/***/ 90374:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CellList: () => (/* reexport */ CellList),
  CellTypeSwitcher: () => (/* reexport */ CellTypeSwitcher),
  CommandEditStatus: () => (/* reexport */ CommandEditStatus),
  ExecutionIndicator: () => (/* reexport */ ExecutionIndicator),
  ExecutionIndicatorComponent: () => (/* reexport */ ExecutionIndicatorComponent),
  INotebookCellExecutor: () => (/* reexport */ INotebookCellExecutor),
  INotebookTools: () => (/* reexport */ INotebookTools),
  INotebookTracker: () => (/* reexport */ INotebookTracker),
  INotebookWidgetFactory: () => (/* reexport */ INotebookWidgetFactory),
  KernelError: () => (/* reexport */ KernelError),
  Notebook: () => (/* reexport */ Notebook),
  NotebookActions: () => (/* reexport */ NotebookActions),
  NotebookAdapter: () => (/* reexport */ NotebookAdapter),
  NotebookHistory: () => (/* reexport */ NotebookHistory),
  NotebookModel: () => (/* reexport */ NotebookModel),
  NotebookModelFactory: () => (/* reexport */ NotebookModelFactory),
  NotebookPanel: () => (/* reexport */ NotebookPanel),
  NotebookSearchProvider: () => (/* reexport */ NotebookSearchProvider),
  NotebookToCFactory: () => (/* reexport */ NotebookToCFactory),
  NotebookToCModel: () => (/* reexport */ NotebookToCModel),
  NotebookTools: () => (/* reexport */ NotebookTools),
  NotebookTracker: () => (/* reexport */ NotebookTracker),
  NotebookTrustStatus: () => (/* reexport */ NotebookTrustStatus),
  NotebookViewModel: () => (/* reexport */ NotebookViewModel),
  NotebookWidgetFactory: () => (/* reexport */ NotebookWidgetFactory),
  NotebookWindowedLayout: () => (/* reexport */ NotebookWindowedLayout),
  RunningStatus: () => (/* reexport */ RunningStatus),
  StaticNotebook: () => (/* reexport */ StaticNotebook),
  ToolbarItems: () => (/* reexport */ ToolbarItems),
  getIdForHeading: () => (/* reexport */ getIdForHeading),
  runCell: () => (/* reexport */ cellexecutor_runCell),
  setCellExecutor: () => (/* reexport */ setCellExecutor)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/cells@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/cells/lib/index.js)
var lib_index_js_ = __webpack_require__(9214);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/cellexecutor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * Run a single notebook cell.
 *
 * @param options Cell execution options
 * @returns Execution status
 */
async function cellexecutor_runCell({ cell, notebook, notebookConfig, onCellExecuted, onCellExecutionScheduled, sessionContext, sessionDialogs, translator }) {
    var _a;
    translator = translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    switch (cell.model.type) {
        case 'markdown':
            cell.rendered = true;
            cell.inputHidden = false;
            onCellExecuted({ cell, success: true });
            break;
        case 'code':
            if (sessionContext) {
                if (sessionContext.isTerminating) {
                    await (0,index_js_.showDialog)({
                        title: trans.__('Kernel Terminating'),
                        body: trans.__('The kernel for %1 appears to be terminating. You can not run any cell for now.', (_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.path),
                        buttons: [index_js_.Dialog.okButton()]
                    });
                    break;
                }
                if (sessionContext.pendingInput) {
                    await (0,index_js_.showDialog)({
                        title: trans.__('Cell not executed due to pending input'),
                        body: trans.__('The cell has not been executed to avoid kernel deadlock as there is another pending input! Type your input in the input box, press Enter and try again.'),
                        buttons: [index_js_.Dialog.okButton()]
                    });
                    return false;
                }
                if (sessionContext.hasNoKernel) {
                    const shouldSelect = await sessionContext.startKernel();
                    if (shouldSelect && sessionDialogs) {
                        await sessionDialogs.selectKernel(sessionContext);
                    }
                }
                if (sessionContext.hasNoKernel) {
                    cell.model.sharedModel.transact(() => {
                        cell.model.clearExecution();
                    });
                    return true;
                }
                const deletedCells = notebook.deletedCells;
                onCellExecutionScheduled({ cell });
                let ran = false;
                try {
                    const reply = await lib_index_js_.CodeCell.execute(cell, sessionContext, {
                        deletedCells,
                        recordTiming: notebookConfig.recordTiming
                    });
                    deletedCells.splice(0, deletedCells.length);
                    ran = (() => {
                        if (cell.isDisposed) {
                            return false;
                        }
                        if (!reply) {
                            return true;
                        }
                        if (reply.content.status === 'ok') {
                            const content = reply.content;
                            if (content.payload && content.payload.length) {
                                handlePayload(content, notebook, cell);
                            }
                            return true;
                        }
                        else {
                            throw new KernelError(reply.content);
                        }
                    })();
                }
                catch (reason) {
                    if (cell.isDisposed || reason.message.startsWith('Canceled')) {
                        ran = false;
                    }
                    else {
                        onCellExecuted({
                            cell,
                            success: false,
                            error: reason
                        });
                        throw reason;
                    }
                }
                if (ran) {
                    onCellExecuted({ cell, success: true });
                }
                return ran;
            }
            cell.model.sharedModel.transact(() => {
                cell.model.clearExecution();
            }, false);
            break;
        default:
            break;
    }
    return Promise.resolve(true);
}
/**
 * Handle payloads from an execute reply.
 *
 * #### Notes
 * Payloads are deprecated and there are no official interfaces for them in
 * the kernel type definitions.
 * See [Payloads (DEPRECATED)](https://jupyter-client.readthedocs.io/en/latest/messaging.html#payloads-deprecated).
 */
function handlePayload(content, notebook, cell) {
    var _a;
    const setNextInput = (_a = content.payload) === null || _a === void 0 ? void 0 : _a.filter(i => {
        return i.source === 'set_next_input';
    })[0];
    if (!setNextInput) {
        return;
    }
    const text = setNextInput.text;
    const replace = setNextInput.replace;
    if (replace) {
        cell.model.sharedModel.setSource(text);
        return;
    }
    // Create a new code cell and add as the next cell.
    const notebookModel = notebook.sharedModel;
    const cells = notebook.cells;
    const index = (0,index_es6_js_.findIndex)(cells, model => model === cell.model);
    // While this cell has no outputs and could be trusted following the letter
    // of Jupyter trust model, its content comes from kernel and hence is not
    // necessarily controlled by the user; if we set it as trusted, a user
    // executing cells in succession could end up with unwanted trusted output.
    if (index === -1) {
        notebookModel.insertCell(notebookModel.cells.length, {
            cell_type: 'code',
            source: text,
            metadata: {
                trusted: false
            }
        });
    }
    else {
        notebookModel.insertCell(index + 1, {
            cell_type: 'code',
            source: text,
            metadata: {
                trusted: false
            }
        });
    }
}
//# sourceMappingURL=cellexecutor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/actions.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.










/**
 * The mimetype used for Jupyter cell data.
 */
const JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';
class KernelError extends Error {
    /**
     * Construct the kernel error.
     */
    constructor(content) {
        const errorContent = content;
        const errorName = errorContent.ename;
        const errorValue = errorContent.evalue;
        super(`KernelReplyNotOK: ${errorName} ${errorValue}`);
        this.errorName = errorName;
        this.errorValue = errorValue;
        this.traceback = errorContent.traceback;
        Object.setPrototypeOf(this, KernelError.prototype);
    }
}
/**
 * A collection of actions that run against notebooks.
 *
 * #### Notes
 * All of the actions are a no-op if there is no model on the notebook.
 * The actions set the widget `mode` to `'command'` unless otherwise specified.
 * The actions will preserve the selection on the notebook widget unless
 * otherwise specified.
 */
class NotebookActions {
    /**
     * A signal that emits whenever a cell completes execution.
     */
    static get executed() {
        return Private.executed;
    }
    /**
     * A signal that emits whenever a cell execution is scheduled.
     */
    static get executionScheduled() {
        return Private.executionScheduled;
    }
    /**
     * A signal that emits when one notebook's cells are all executed.
     */
    static get selectionExecuted() {
        return Private.selectionExecuted;
    }
    /**
     * A signal that emits when a cell's output is cleared.
     */
    static get outputCleared() {
        return Private.outputCleared;
    }
    /**
     * A private constructor for the `NotebookActions` class.
     *
     * #### Notes
     * This class can never be instantiated. Its static member `executed` will be
     * merged with the `NotebookActions` namespace. The reason it exists as a
     * standalone class is because at run time, the `Private.executed` variable
     * does not yet exist, so it needs to be referenced via a getter.
     */
    constructor() {
        // Intentionally empty.
    }
}
/**
 * A namespace for `NotebookActions` static methods.
 */
(function (NotebookActions) {
    /**
     * Split the active cell into two or more cells.
     *
     * @param notebook The target notebook widget.
     *
     * #### Notes
     * It will preserve the existing mode.
     * The last cell will be activated if no selection is found.
     * If text was selected, the cell containing the selection will
     * be activated.
     * The existing selection will be cleared.
     * The activated cell will have focus and the cursor will
     * remain in the initial position.
     * The leading whitespace in the second cell will be removed.
     * If there is no content, two empty cells will be created.
     * Both cells will have the same type as the original cell.
     * This action can be undone.
     * The original cell is preserved to maintain kernel connections.
     */
    function splitCell(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        // We force the notebook back in edit mode as splitting a cell
        // requires using the cursor position within a cell (aka it was recently in edit mode)
        // However the focus may be stolen if the action is triggered
        // from the menu entry; switching the notebook in command mode.
        notebook.mode = 'edit';
        notebook.deselectAll();
        const nbModel = notebook.model;
        const index = notebook.activeCellIndex;
        const child = notebook.widgets[index];
        const editor = child.editor;
        if (!editor) {
            // TODO
            return;
        }
        const selections = editor.getSelections();
        const orig = child.model.sharedModel.getSource();
        const offsets = [0];
        let start = -1;
        let end = -1;
        for (let i = 0; i < selections.length; i++) {
            // append start and end to handle selections
            // cursors will have same start and end
            start = editor.getOffsetAt(selections[i].start);
            end = editor.getOffsetAt(selections[i].end);
            if (start < end) {
                offsets.push(start);
                offsets.push(end);
            }
            else if (end < start) {
                offsets.push(end);
                offsets.push(start);
            }
            else {
                offsets.push(start);
            }
        }
        offsets.push(orig.length);
        const { cell_type, metadata } = child.model.sharedModel.toJSON();
        const baseMetadata = JSON.parse(JSON.stringify(metadata !== null && metadata !== void 0 ? metadata : {}));
        // If execution metadata is present but missing execute_reply (i.e., it is in running state),
        // remove execution metadata entirely for new cells
        if (cell_type === 'code' &&
            baseMetadata.execution &&
            baseMetadata.execution['iopub.execute_input'] &&
            !baseMetadata.execution['shell.execute_reply']) {
            delete baseMetadata.execution;
        }
        // Create new cells for all content pieces EXCEPT the last one
        // The last piece will remain in the original cell to preserve kernel connection
        const newCells = offsets.slice(0, -2).map((offset, offsetIdx) => ({
            cell_type,
            metadata: JSON.parse(JSON.stringify(baseMetadata)),
            source: orig
                .slice(offset, offsets[offsetIdx + 1])
                .replace(/^\n+/, '')
                .replace(/\n+$/, ''),
            outputs: undefined
        }));
        // Prepare the content for the original cell (last piece)
        const lastPieceStart = offsets[offsets.length - 2];
        const lastPieceEnd = offsets[offsets.length - 1];
        const lastPieceContent = orig
            .slice(lastPieceStart, lastPieceEnd)
            .replace(/^\n+/, '')
            .replace(/\n+$/, '');
        nbModel.sharedModel.transact(() => {
            // Insert new cells above the current cell (if any)
            if (newCells.length > 0) {
                nbModel.sharedModel.insertCells(index, newCells);
            }
            // Update the original cell with the last piece of content
            child.model.sharedModel.setSource(lastPieceContent);
            // Mark cell as dirty if it is running
            if (child.model instanceof lib_index_js_.CodeCellModel) {
                const codeCellModel = child.model;
                if (codeCellModel.executionState === 'running') {
                    codeCellModel.isDirty = true;
                }
            }
        });
        // If there was a selection, activate the cell containing the selection
        let targetCellIndex;
        if (start !== end) {
            // Find which piece contains the selection
            let selectionPieceIndex = 0;
            for (let i = 0; i < offsets.length - 1; i++) {
                if (start >= offsets[i] && start < offsets[i + 1]) {
                    selectionPieceIndex = i;
                    break;
                }
            }
            targetCellIndex = index + selectionPieceIndex;
        }
        else {
            // No selection, activate the original cell (now at the end)
            targetCellIndex = index + newCells.length;
        }
        notebook.activeCellIndex = targetCellIndex;
        notebook
            .scrollToItem(notebook.activeCellIndex)
            .then(() => {
            var _a;
            (_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.editor.focus();
        })
            .catch(reason => {
            // no-op
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.splitCell = splitCell;
    /**
     * Merge the selected cells.
     *
     * @param notebook - The target notebook widget.
     *
     * @param mergeAbove - If only one cell is selected, indicates whether to merge it
     *    with the cell above (true) or below (false, default).
     *
     * @param addExtraLine - Whether to add an extra newline between merged cell contents
     *    (true, default) or use only a single newline (false).
     *
     * #### Notes
     * The widget mode will be preserved.
     * If only one cell is selected and `mergeAbove` is true, the above cell will be selected.
     * If only one cell is selected and `mergeAbove` is false, the below cell will be selected.
     * If the active cell is a code cell, its outputs will be cleared.
     * This action can be undone.
     * The final cell will have the same type as the active cell.
     * If the active cell is a markdown cell, it will be unrendered.
     */
    function mergeCells(notebook, mergeAbove = false, addExtraLine = true) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        const toMerge = [];
        const toDelete = [];
        const model = notebook.model;
        const cells = model.cells;
        const primary = notebook.activeCell;
        const active = notebook.activeCellIndex;
        const attachments = {};
        // Get the cells to merge.
        notebook.widgets.forEach((child, index) => {
            if (notebook.isSelectedOrActive(child)) {
                toMerge.push(child.model.sharedModel.getSource());
                if (index !== active) {
                    toDelete.push(index);
                }
                // Collect attachments if the cell is a markdown cell or a raw cell
                const model = child.model;
                if ((0,lib_index_js_.isRawCellModel)(model) || (0,lib_index_js_.isMarkdownCellModel)(model)) {
                    for (const key of model.attachments.keys) {
                        attachments[key] = model.attachments.get(key).toJSON();
                    }
                }
            }
        });
        // Check for only a single cell selected.
        if (toMerge.length === 1) {
            // Merge with the cell above when mergeAbove is true
            if (mergeAbove === true) {
                // Bail if it is the first cell.
                if (active === 0) {
                    return;
                }
                // Otherwise merge with the previous cell.
                const cellModel = cells.get(active - 1);
                toMerge.unshift(cellModel.sharedModel.getSource());
                toDelete.push(active - 1);
            }
            else if (mergeAbove === false) {
                // Bail if it is the last cell.
                if (active === cells.length - 1) {
                    return;
                }
                // Otherwise merge with the next cell.
                const cellModel = cells.get(active + 1);
                toMerge.push(cellModel.sharedModel.getSource());
                toDelete.push(active + 1);
            }
        }
        notebook.deselectAll();
        const primaryModel = primary.model.sharedModel;
        const { cell_type, metadata } = primaryModel.toJSON();
        if (primaryModel.cell_type === 'code') {
            // We can trust this cell because the outputs will be removed.
            metadata.trusted = true;
        }
        const newModel = {
            cell_type,
            metadata,
            source: toMerge.join(addExtraLine ? '\n\n' : '\n'),
            attachments: primaryModel.cell_type === 'markdown' ||
                primaryModel.cell_type === 'raw'
                ? attachments
                : undefined
        };
        // Make the changes while preserving history.
        model.sharedModel.transact(() => {
            model.sharedModel.deleteCell(active);
            model.sharedModel.insertCell(active, newModel);
            toDelete
                .sort((a, b) => b - a)
                .forEach(index => {
                model.sharedModel.deleteCell(index);
            });
        });
        // If the original cell is a markdown cell, make sure
        // the new cell is unrendered.
        if (primary instanceof lib_index_js_.MarkdownCell) {
            notebook.activeCell.rendered = false;
        }
        void Private.handleState(notebook, state);
    }
    NotebookActions.mergeCells = mergeCells;
    /**
     * Delete the selected cells.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The cell after the last selected cell will be activated.
     * It will add a code cell if all cells are deleted.
     * This action can be undone.
     */
    function deleteCells(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        Private.deleteCells(notebook);
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.deleteCells = deleteCells;
    /**
     * Insert a new code cell above the active cell or in index 0 if the notebook is empty.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget mode will be preserved.
     * This action can be undone.
     * The existing selection will be cleared.
     * The new cell will the active cell.
     */
    function insertAbove(notebook) {
        if (!notebook.model) {
            return;
        }
        const state = Private.getState(notebook);
        const model = notebook.model;
        const newIndex = notebook.activeCell ? notebook.activeCellIndex : 0;
        model.sharedModel.insertCell(newIndex, {
            cell_type: notebook.notebookConfig.defaultCell,
            metadata: notebook.notebookConfig.defaultCell === 'code'
                ? {
                    // This is an empty cell created by user, thus is trusted
                    trusted: true
                }
                : {}
        });
        // Make the newly inserted cell active.
        notebook.activeCellIndex = newIndex;
        notebook.deselectAll();
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.insertAbove = insertAbove;
    /**
     * Insert a new code cell below the active cell or in index 0 if the notebook is empty.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget mode will be preserved.
     * This action can be undone.
     * The existing selection will be cleared.
     * The new cell will be the active cell.
     */
    function insertBelow(notebook) {
        if (!notebook.model) {
            return;
        }
        const state = Private.getState(notebook);
        const model = notebook.model;
        const newIndex = notebook.activeCell ? notebook.activeCellIndex + 1 : 0;
        model.sharedModel.insertCell(newIndex, {
            cell_type: notebook.notebookConfig.defaultCell,
            metadata: notebook.notebookConfig.defaultCell === 'code'
                ? {
                    // This is an empty cell created by user, thus is trusted
                    trusted: true
                }
                : {}
        });
        // Make the newly inserted cell active.
        notebook.activeCellIndex = newIndex;
        notebook.deselectAll();
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.insertBelow = insertBelow;
    function move(notebook, shift) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        const firstIndex = notebook.widgets.findIndex(w => notebook.isSelectedOrActive(w));
        let lastIndex = notebook.widgets
            .slice(firstIndex + 1)
            .findIndex(w => !notebook.isSelectedOrActive(w));
        if (lastIndex >= 0) {
            lastIndex += firstIndex + 1;
        }
        else {
            lastIndex = notebook.model.cells.length;
        }
        if (shift > 0) {
            notebook.moveCell(firstIndex, lastIndex, lastIndex - firstIndex);
        }
        else {
            notebook.moveCell(firstIndex, firstIndex + shift, lastIndex - firstIndex);
        }
        void Private.handleState(notebook, state, true);
    }
    /**
     * Move the selected cell(s) down.
     *
     * @param notebook = The target notebook widget.
     */
    function moveDown(notebook) {
        move(notebook, 1);
    }
    NotebookActions.moveDown = moveDown;
    /**
     * Move the selected cell(s) up.
     *
     * @param notebook - The target notebook widget.
     */
    function moveUp(notebook) {
        move(notebook, -1);
    }
    NotebookActions.moveUp = moveUp;
    /**
     * Change the selected cell type(s).
     *
     * @param notebook - The target notebook widget.
     * @param value - The target cell type.
     * @param translator - The application translator.
     *
     * #### Notes
     * It should preserve the widget mode.
     * This action can be undone.
     * The existing selection will be cleared.
     * Any cells converted to markdown will be unrendered.
     */
    function changeCellType(notebook, value, translator) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        Private.changeCellType(notebook, value, translator);
        void Private.handleState(notebook, state);
    }
    NotebookActions.changeCellType = changeCellType;
    /**
     * Run the selected cell(s).
     *
     * @param notebook - The target notebook widget.
     * @param sessionContext - The client session object.
     * @param sessionDialogs - The session dialogs.
     * @param translator - The application translator.
     *
     * #### Notes
     * The last selected cell will be activated, but not scrolled into view.
     * The existing selection will be cleared.
     * An execution error will prevent the remaining code cells from executing.
     * All markdown cells will be rendered.
     */
    function run(notebook, sessionContext, sessionDialogs, translator) {
        if (!notebook.model || !notebook.activeCell) {
            return Promise.resolve(false);
        }
        const state = Private.getState(notebook);
        const promise = Private.runSelected(notebook, sessionContext, sessionDialogs, translator);
        void Private.handleRunState(notebook, state);
        return promise;
    }
    NotebookActions.run = run;
    /**
     * Run specified cells.
     *
     * @param notebook - The target notebook widget.
     * @param cells - The cells to run.
     * @param sessionContext - The client session object.
     * @param sessionDialogs - The session dialogs.
     * @param translator - The application translator.
     *
     * #### Notes
     * The existing selection will be preserved.
     * The mode will be changed to command.
     * An execution error will prevent the remaining code cells from executing.
     * All markdown cells will be rendered.
     */
    function runCells(notebook, cells, sessionContext, sessionDialogs, translator) {
        if (!notebook.model) {
            return Promise.resolve(false);
        }
        const state = Private.getState(notebook);
        const promise = Private.runCells(notebook, cells, sessionContext, sessionDialogs, translator);
        void Private.handleRunState(notebook, state);
        return promise;
    }
    NotebookActions.runCells = runCells;
    /**
     * Run the selected cell(s) and advance to the next cell.
     *
     * @param notebook - The target notebook widget.
     * @param sessionContext - The client session object.
     * @param sessionDialogs - The session dialogs.
     * @param translator - The application translator.
     *
     * #### Notes
     * The existing selection will be cleared.
     * The cell after the last selected cell will be activated and scrolled into view.
     * An execution error will prevent the remaining code cells from executing.
     * All markdown cells will be rendered.
     * If the last selected cell is the last cell, a new code cell
     * will be created in `'edit'` mode.  The new cell creation can be undone.
     */
    async function runAndAdvance(notebook, sessionContext, sessionDialogs, translator) {
        var _a;
        if (!notebook.model || !notebook.activeCell) {
            return Promise.resolve(false);
        }
        const state = Private.getState(notebook);
        const promise = Private.runSelected(notebook, sessionContext, sessionDialogs, translator);
        const model = notebook.model;
        if (notebook.activeCellIndex === notebook.widgets.length - 1) {
            // Do not use push here, as we want an widget insertion
            // to make sure no placeholder widget is rendered.
            model.sharedModel.insertCell(notebook.widgets.length, {
                cell_type: notebook.notebookConfig.defaultCell,
                metadata: notebook.notebookConfig.defaultCell === 'code'
                    ? {
                        // This is an empty cell created by user, thus is trusted
                        trusted: true
                    }
                    : {}
            });
            notebook.activeCellIndex++;
            if (((_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.inViewport) === false) {
                await (0,coreutils_lib_index_js_.signalToPromise)(notebook.activeCell.inViewportChanged, 200).catch(() => {
                    // no-op
                });
            }
            notebook.mode = 'edit';
        }
        else {
            notebook.activeCellIndex++;
        }
        // If a cell is outside of viewport and scrolling is needed, the `smart`
        // logic in `handleRunState` will choose appropriate alignment, except
        // for the case of a small cell less than one viewport away for which it
        // would use the `auto` heuristic, for which we set the preferred alignment
        // to `center` as in most cases there will be space below and above a cell
        // that is smaller than (or approximately equal to) the viewport size.
        void Private.handleRunState(notebook, state, 'center');
        return promise;
    }
    NotebookActions.runAndAdvance = runAndAdvance;
    /**
     * Run the selected cell(s) and insert a new code cell.
     *
     * @param notebook - The target notebook widget.
     * @param sessionContext - The client session object.
     * @param sessionDialogs - The session dialogs.
     * @param translator - The application translator.
     *
     * #### Notes
     * An execution error will prevent the remaining code cells from executing.
     * All markdown cells will be rendered.
     * The widget mode will be set to `'edit'` after running.
     * The existing selection will be cleared.
     * The cell insert can be undone.
     * The new cell will be scrolled into view.
     */
    async function runAndInsert(notebook, sessionContext, sessionDialogs, translator) {
        var _a;
        if (!notebook.model || !notebook.activeCell) {
            return Promise.resolve(false);
        }
        const state = Private.getState(notebook);
        const promise = Private.runSelected(notebook, sessionContext, sessionDialogs, translator);
        const model = notebook.model;
        model.sharedModel.insertCell(notebook.activeCellIndex + 1, {
            cell_type: notebook.notebookConfig.defaultCell,
            metadata: notebook.notebookConfig.defaultCell === 'code'
                ? {
                    // This is an empty cell created by user, thus is trusted
                    trusted: true
                }
                : {}
        });
        notebook.activeCellIndex++;
        if (((_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.inViewport) === false) {
            await (0,coreutils_lib_index_js_.signalToPromise)(notebook.activeCell.inViewportChanged, 200).catch(() => {
                // no-op
            });
        }
        notebook.mode = 'edit';
        void Private.handleRunState(notebook, state, 'center');
        return promise;
    }
    NotebookActions.runAndInsert = runAndInsert;
    /**
     * Run all of the cells in the notebook.
     *
     * @param notebook - The target notebook widget.
     * @param sessionContext - The client session object.
     * @param sessionDialogs - The session dialogs.
     * @param translator - The application translator.
     *
     * #### Notes
     * The existing selection will be cleared.
     * An execution error will prevent the remaining code cells from executing.
     * All markdown cells will be rendered.
     * The last cell in the notebook will be activated and scrolled into view.
     */
    function runAll(notebook, sessionContext, sessionDialogs, translator) {
        if (!notebook.model || !notebook.activeCell) {
            return Promise.resolve(false);
        }
        const state = Private.getState(notebook);
        const lastIndex = notebook.widgets.length;
        const promise = Private.runCells(notebook, notebook.widgets, sessionContext, sessionDialogs, translator);
        notebook.activeCellIndex = lastIndex;
        notebook.deselectAll();
        void Private.handleRunState(notebook, state);
        return promise;
    }
    NotebookActions.runAll = runAll;
    function renderAllMarkdown(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return Promise.resolve(false);
        }
        const previousIndex = notebook.activeCellIndex;
        const state = Private.getState(notebook);
        notebook.widgets.forEach((child, index) => {
            if (child.model.type === 'markdown') {
                notebook.select(child);
                // This is to make sure that the activeCell
                // does not get executed
                notebook.activeCellIndex = index;
            }
        });
        if (notebook.activeCell.model.type !== 'markdown') {
            return Promise.resolve(true);
        }
        const promise = Private.runSelected(notebook);
        notebook.activeCellIndex = previousIndex;
        void Private.handleRunState(notebook, state);
        return promise;
    }
    NotebookActions.renderAllMarkdown = renderAllMarkdown;
    /**
     * Run all of the cells before the currently active cell (exclusive).
     *
     * @param notebook - The target notebook widget.
     * @param sessionContext - The client session object.
     * @param sessionDialogs - The session dialogs.
     * @param translator - The application translator.
     *
     * #### Notes
     * The existing selection will be cleared.
     * An execution error will prevent the remaining code cells from executing.
     * All markdown cells will be rendered.
     * The currently active cell will remain selected.
     */
    function runAllAbove(notebook, sessionContext, sessionDialogs, translator) {
        const { activeCell, activeCellIndex, model } = notebook;
        if (!model || !activeCell || activeCellIndex < 1) {
            return Promise.resolve(false);
        }
        const state = Private.getState(notebook);
        const promise = Private.runCells(notebook, notebook.widgets.slice(0, notebook.activeCellIndex), sessionContext, sessionDialogs, translator);
        notebook.deselectAll();
        void Private.handleRunState(notebook, state);
        return promise;
    }
    NotebookActions.runAllAbove = runAllAbove;
    /**
     * Run all of the cells after the currently active cell (inclusive).
     *
     * @param notebook - The target notebook widget.
     * @param sessionContext - The client session object.
     * @param sessionDialogs - The session dialogs.
     * @param translator - The application translator.
     *
     * #### Notes
     * The existing selection will be cleared.
     * An execution error will prevent the remaining code cells from executing.
     * All markdown cells will be rendered.
     * The last cell in the notebook will be activated and scrolled into view.
     */
    function runAllBelow(notebook, sessionContext, sessionDialogs, translator) {
        if (!notebook.model || !notebook.activeCell) {
            return Promise.resolve(false);
        }
        const state = Private.getState(notebook);
        const lastIndex = notebook.widgets.length;
        const promise = Private.runCells(notebook, notebook.widgets.slice(notebook.activeCellIndex), sessionContext, sessionDialogs, translator);
        notebook.activeCellIndex = lastIndex;
        notebook.deselectAll();
        void Private.handleRunState(notebook, state);
        return promise;
    }
    NotebookActions.runAllBelow = runAllBelow;
    /**
     * Replaces the selection in the active cell of the notebook.
     *
     * @param notebook - The target notebook widget.
     * @param text - The text to replace the selection.
     */
    function replaceSelection(notebook, text) {
        var _a, _b, _c;
        if (!notebook.model || !((_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.editor)) {
            return;
        }
        (_c = (_b = notebook.activeCell.editor).replaceSelection) === null || _c === void 0 ? void 0 : _c.call(_b, text);
    }
    NotebookActions.replaceSelection = replaceSelection;
    /**
     * Select the above the active cell.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget mode will be preserved.
     * This is a no-op if the first cell is the active cell.
     * This will skip any collapsed cells.
     * The existing selection will be cleared.
     */
    function selectAbove(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const footer = notebook.layout.footer;
        if (footer && document.activeElement === footer.node) {
            footer.node.blur();
            notebook.mode = 'command';
            return;
        }
        if (notebook.activeCellIndex === 0) {
            return;
        }
        let possibleNextCellIndex = notebook.activeCellIndex - 1;
        // find first non hidden cell above current cell
        while (possibleNextCellIndex >= 0) {
            const possibleNextCell = notebook.widgets[possibleNextCellIndex];
            if (!possibleNextCell.inputHidden && !possibleNextCell.isHidden) {
                break;
            }
            possibleNextCellIndex -= 1;
        }
        const state = Private.getState(notebook);
        notebook.activeCellIndex = possibleNextCellIndex;
        notebook.deselectAll();
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.selectAbove = selectAbove;
    /**
     * Select the cell below the active cell.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget mode will be preserved.
     * This is a no-op if the last cell is the active cell.
     * This will skip any collapsed cells.
     * The existing selection will be cleared.
     */
    function selectBelow(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        let maxCellIndex = notebook.widgets.length - 1;
        // Find last non-hidden cell
        while (notebook.widgets[maxCellIndex].isHidden ||
            notebook.widgets[maxCellIndex].inputHidden) {
            maxCellIndex -= 1;
        }
        if (notebook.activeCellIndex === maxCellIndex) {
            const footer = notebook.layout.footer;
            footer === null || footer === void 0 ? void 0 : footer.node.focus();
            return;
        }
        let possibleNextCellIndex = notebook.activeCellIndex + 1;
        // find first non hidden cell below current cell
        while (possibleNextCellIndex < maxCellIndex) {
            let possibleNextCell = notebook.widgets[possibleNextCellIndex];
            if (!possibleNextCell.inputHidden && !possibleNextCell.isHidden) {
                break;
            }
            possibleNextCellIndex += 1;
        }
        const state = Private.getState(notebook);
        notebook.activeCellIndex = possibleNextCellIndex;
        notebook.deselectAll();
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.selectBelow = selectBelow;
    /** Insert new heading of same level above active cell.
     *
     * @param notebook - The target notebook widget
     */
    async function insertSameLevelHeadingAbove(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        let headingLevel = Private.Headings.determineHeadingLevel(notebook.activeCell, notebook);
        if (headingLevel == -1) {
            await Private.Headings.insertHeadingAboveCellIndex(0, 1, notebook);
        }
        else {
            await Private.Headings.insertHeadingAboveCellIndex(notebook.activeCellIndex, headingLevel, notebook);
        }
    }
    NotebookActions.insertSameLevelHeadingAbove = insertSameLevelHeadingAbove;
    /** Insert new heading of same level at end of current section.
     *
     * @param notebook - The target notebook widget
     */
    async function insertSameLevelHeadingBelow(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        let headingLevel = Private.Headings.determineHeadingLevel(notebook.activeCell, notebook);
        headingLevel = headingLevel > -1 ? headingLevel : 1;
        let cellIdxOfHeadingBelow = Private.Headings.findLowerEqualLevelHeadingBelow(notebook.activeCell, notebook, true);
        await Private.Headings.insertHeadingAboveCellIndex(cellIdxOfHeadingBelow == -1
            ? notebook.model.cells.length
            : cellIdxOfHeadingBelow, headingLevel, notebook);
    }
    NotebookActions.insertSameLevelHeadingBelow = insertSameLevelHeadingBelow;
    /**
     * Select the heading above the active cell or, if already at heading, collapse it.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget mode will be preserved.
     * This is a no-op if the active cell is the topmost heading in collapsed state
     * The existing selection will be cleared.
     */
    function selectHeadingAboveOrCollapseHeading(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        let hInfoActiveCell = getHeadingInfo(notebook.activeCell);
        // either collapse or find the right heading to jump to
        if (hInfoActiveCell.isHeading && !hInfoActiveCell.collapsed) {
            setHeadingCollapse(notebook.activeCell, true, notebook);
        }
        else {
            let targetHeadingCellIdx = Private.Headings.findLowerEqualLevelParentHeadingAbove(notebook.activeCell, notebook, true);
            if (targetHeadingCellIdx > -1) {
                notebook.activeCellIndex = targetHeadingCellIdx;
            }
        }
        // clear selection and handle state
        notebook.deselectAll();
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.selectHeadingAboveOrCollapseHeading = selectHeadingAboveOrCollapseHeading;
    /**
     * Select the heading below the active cell or, if already at heading, expand it.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget mode will be preserved.
     * This is a no-op if the active cell is the last heading in expanded state
     * The existing selection will be cleared.
     */
    function selectHeadingBelowOrExpandHeading(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        let hInfo = getHeadingInfo(notebook.activeCell);
        if (hInfo.isHeading && hInfo.collapsed) {
            setHeadingCollapse(notebook.activeCell, false, notebook);
        }
        else {
            let targetHeadingCellIdx = Private.Headings.findHeadingBelow(notebook.activeCell, notebook, true // return index of heading cell
            );
            if (targetHeadingCellIdx > -1) {
                notebook.activeCellIndex = targetHeadingCellIdx;
            }
        }
        notebook.deselectAll();
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.selectHeadingBelowOrExpandHeading = selectHeadingBelowOrExpandHeading;
    /**
     * Extend the selection to the cell above.
     *
     * @param notebook - The target notebook widget.
     * @param toTop - If true, denotes selection to extend to the top.
     *
     * #### Notes
     * This is a no-op if the first cell is the active cell.
     * The new cell will be activated.
     */
    function extendSelectionAbove(notebook, toTop = false) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        // Do not wrap around.
        if (notebook.activeCellIndex === 0) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.mode = 'command';
        // Check if toTop is true, if yes, selection is made to the top.
        if (toTop) {
            notebook.extendContiguousSelectionTo(0);
        }
        else {
            notebook.extendContiguousSelectionTo(notebook.activeCellIndex - 1);
        }
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.extendSelectionAbove = extendSelectionAbove;
    /**
     * Extend the selection to the cell below.
     *
     * @param notebook - The target notebook widget.
     * @param toBottom - If true, denotes selection to extend to the bottom.
     *
     * #### Notes
     * This is a no-op if the last cell is the active cell.
     * The new cell will be activated.
     */
    function extendSelectionBelow(notebook, toBottom = false) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        // Do not wrap around.
        if (notebook.activeCellIndex === notebook.widgets.length - 1) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.mode = 'command';
        // Check if toBottom is true, if yes selection is made to the bottom.
        if (toBottom) {
            notebook.extendContiguousSelectionTo(notebook.widgets.length - 1);
        }
        else {
            notebook.extendContiguousSelectionTo(notebook.activeCellIndex + 1);
        }
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.extendSelectionBelow = extendSelectionBelow;
    /**
     * Select all of the cells of the notebook.
     *
     * @param notebook - the target notebook widget.
     */
    function selectAll(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        notebook.widgets.forEach(child => {
            notebook.select(child);
        });
    }
    NotebookActions.selectAll = selectAll;
    /**
     * Deselect all of the cells of the notebook.
     *
     * @param notebook - the target notebook widget.
     */
    function deselectAll(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        notebook.deselectAll();
    }
    NotebookActions.deselectAll = deselectAll;
    /**
     * Copy the selected cell(s) data to a clipboard.
     *
     * @param notebook - The target notebook widget.
     */
    function copy(notebook) {
        Private.copyOrCut(notebook, false);
    }
    NotebookActions.copy = copy;
    /**
     * Copy the selected cell(s) data to the system clipboard.
     *
     * @param notebook - The target notebook widget.
     */
    async function copyToSystemClipboard(notebook) {
        await Private.copyOrCutToSystemClipboard(notebook, false);
    }
    NotebookActions.copyToSystemClipboard = copyToSystemClipboard;
    /**
     * Cut the selected cell data to a clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * This action can be undone.
     * A new code cell is added if all cells are cut.
     */
    function cut(notebook) {
        Private.copyOrCut(notebook, true);
    }
    NotebookActions.cut = cut;
    /**
     * Cut the selected cell data to the system clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * This action can be undone.
     * A new code cell is added if all cells are cut.
     */
    async function cutToSystemClipboard(notebook) {
        await Private.copyOrCutToSystemClipboard(notebook, true);
    }
    NotebookActions.cutToSystemClipboard = cutToSystemClipboard;
    /**
     * Paste cells from the application clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * @param mode - the mode of adding cells:
     *   'below' (default) adds cells below the active cell,
     *   'belowSelected' adds cells below all selected cells,
     *   'above' adds cells above the active cell, and
     *   'replace' removes the currently selected cells and adds cells in their place.
     *
     * #### Notes
     * The last pasted cell becomes the active cell.
     * This is a no-op if there is no cell data on the clipboard.
     * This action can be undone.
     */
    function paste(notebook, mode = 'below') {
        const clipboard = index_js_.Clipboard.getInstance();
        if (!clipboard.hasData(JUPYTER_CELL_MIME)) {
            return;
        }
        const values = clipboard.getData(JUPYTER_CELL_MIME);
        addCells(notebook, mode, values, true);
        void focusActiveCell(notebook);
    }
    NotebookActions.paste = paste;
    /**
     * Paste cells from the system clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * @param mode - the mode of adding cells:
     *   'below' (default) adds cells below the active cell,
     *   'belowSelected' adds cells below all selected cells,
     *   'above' adds cells above the active cell, and
     *   'replace' removes the currently selected cells and adds cells in their place.
     *
     * #### Notes
     * The last pasted cell becomes the active cell.
     * This is a no-op if there is no cell data on the clipboard.
     * This action can be undone.
     */
    async function pasteFromSystemClipboard(notebook, mode = 'below') {
        const clipboard = index_js_.SystemClipboard.getInstance();
        const stored = await clipboard.getData(JUPYTER_CELL_MIME);
        if (stored === null || stored === undefined) {
            return;
        }
        const values = stored;
        addCells(notebook, mode, values, true);
        void focusActiveCell(notebook);
    }
    NotebookActions.pasteFromSystemClipboard = pasteFromSystemClipboard;
    /**
     * Duplicate selected cells in the notebook without using the application clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * @param mode - the mode of adding cells:
     *   'below' (default) adds cells below the active cell,
     *   'belowSelected' adds cells below all selected cells,
     *   'above' adds cells above the active cell, and
     *   'replace' removes the currently selected cells and adds cells in their place.
     *
     * #### Notes
     * The last pasted cell becomes the active cell.
     * This is a no-op if there is no cell data on the clipboard.
     * This action can be undone.
     */
    function duplicate(notebook, mode = 'below') {
        const values = Private.selectedCells(notebook);
        if (!values || values.length === 0) {
            return;
        }
        addCells(notebook, mode, values, false); // Cells not from the clipboard
    }
    NotebookActions.duplicate = duplicate;
    /**
     * Adds cells to the notebook.
     *
     * @param notebook - The target notebook widget.
     *
     * @param mode - the mode of adding cells:
     *   'below' (default) adds cells below the active cell,
     *   'belowSelected' adds cells below all selected cells,
     *   'above' adds cells above the active cell, and
     *   'replace' removes the currently selected cells and adds cells in their place.
     *
     * @param values — The cells to add to the notebook.
     *
     * @param cellsFromClipboard — True if the cells were sourced from the clipboard.
     *
     * #### Notes
     * The last added cell becomes the active cell.
     * This is a no-op if values is an empty array.
     * This action can be undone.
     */
    function addCells(notebook, mode = 'below', values, cellsFromClipboard = false) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        const model = notebook.model;
        notebook.mode = 'command';
        let index = 0;
        const prevActiveCellIndex = notebook.activeCellIndex;
        model.sharedModel.transact(() => {
            // Set the starting index of the paste operation depending upon the mode.
            switch (mode) {
                case 'below':
                    index = notebook.activeCellIndex + 1;
                    break;
                case 'belowSelected':
                    notebook.widgets.forEach((child, childIndex) => {
                        if (notebook.isSelectedOrActive(child)) {
                            index = childIndex + 1;
                        }
                    });
                    break;
                case 'above':
                    index = notebook.activeCellIndex;
                    break;
                case 'replace': {
                    // Find the cells to delete.
                    const toDelete = [];
                    notebook.widgets.forEach((child, index) => {
                        const deletable = child.model.sharedModel.getMetadata('deletable') !== false;
                        if (notebook.isSelectedOrActive(child) && deletable) {
                            toDelete.push(index);
                        }
                    });
                    // If cells are not deletable, we may not have anything to delete.
                    if (toDelete.length > 0) {
                        // Delete the cells as one undo event.
                        toDelete.reverse().forEach(i => {
                            model.sharedModel.deleteCell(i);
                        });
                    }
                    index = toDelete[0];
                    break;
                }
                default:
                    break;
            }
            model.sharedModel.insertCells(index, values.map(cell => {
                cell.id =
                    cell.cell_type === 'code' &&
                        notebook.lastClipboardInteraction === 'cut' &&
                        typeof cell.id === 'string'
                        ? cell.id
                        : undefined;
                return cell;
            }));
        });
        notebook.activeCellIndex = prevActiveCellIndex + values.length;
        notebook.deselectAll();
        if (cellsFromClipboard) {
            notebook.recordCellClipboardInteraction('paste', values);
        }
        void Private.handleState(notebook, state, true);
    }
    /**
     * Undo a cell action.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * This is a no-op if there are no cell actions to undo.
     */
    function undo(notebook) {
        if (!notebook.model) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.mode = 'command';
        notebook.model.sharedModel.undo();
        notebook.deselectAll();
        void Private.handleState(notebook, state);
    }
    NotebookActions.undo = undo;
    /**
     * Redo a cell action.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * This is a no-op if there are no cell actions to redo.
     */
    function redo(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.mode = 'command';
        notebook.model.sharedModel.redo();
        notebook.deselectAll();
        void Private.handleState(notebook, state);
    }
    NotebookActions.redo = redo;
    /**
     * Toggle the line number of all cells.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The original state is based on the state of the active cell.
     * The `mode` of the widget will be preserved.
     */
    function toggleAllLineNumbers(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        const config = notebook.editorConfig;
        const lineNumbers = !(config.code.lineNumbers &&
            config.markdown.lineNumbers &&
            config.raw.lineNumbers);
        const newConfig = {
            code: { ...config.code, lineNumbers },
            markdown: { ...config.markdown, lineNumbers },
            raw: { ...config.raw, lineNumbers }
        };
        notebook.editorConfig = newConfig;
        void Private.handleState(notebook, state);
    }
    NotebookActions.toggleAllLineNumbers = toggleAllLineNumbers;
    /**
     * Clear the code outputs of the selected cells.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget `mode` will be preserved.
     */
    function clearOutputs(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        let index = -1;
        for (const cell of notebook.model.cells) {
            const child = notebook.widgets[++index];
            if (notebook.isSelectedOrActive(child) && cell.type === 'code') {
                cell.sharedModel.transact(() => {
                    cell.clearExecution();
                    child.outputHidden = false;
                }, false);
                Private.outputCleared.emit({ notebook, cell: child });
            }
        }
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.clearOutputs = clearOutputs;
    /**
     * Clear all the code outputs on the widget.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The widget `mode` will be preserved.
     */
    function clearAllOutputs(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        let index = -1;
        for (const cell of notebook.model.cells) {
            const child = notebook.widgets[++index];
            if (cell.type === 'code') {
                cell.sharedModel.transact(() => {
                    cell.clearExecution();
                    child.outputHidden = false;
                }, false);
                Private.outputCleared.emit({ notebook, cell: child });
            }
        }
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.clearAllOutputs = clearAllOutputs;
    /**
     * Hide the code on selected code cells.
     *
     * @param notebook - The target notebook widget.
     */
    function hideCode(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
                cell.inputHidden = true;
            }
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.hideCode = hideCode;
    /**
     * Show the code on selected code cells.
     *
     * @param notebook - The target notebook widget.
     */
    function showCode(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
                cell.inputHidden = false;
            }
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.showCode = showCode;
    /**
     * Hide the code on all code cells.
     *
     * @param notebook - The target notebook widget.
     */
    function hideAllCode(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (cell.model.type === 'code') {
                cell.inputHidden = true;
            }
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.hideAllCode = hideAllCode;
    /**
     * Show the code on all code cells.
     *
     * @param notebook The target notebook widget.
     */
    function showAllCode(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (cell.model.type === 'code') {
                cell.inputHidden = false;
            }
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.showAllCode = showAllCode;
    /**
     * Hide the output on selected code cells.
     *
     * @param notebook - The target notebook widget.
     */
    function hideOutput(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
                cell.outputHidden = true;
            }
        });
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.hideOutput = hideOutput;
    /**
     * Show the output on selected code cells.
     *
     * @param notebook - The target notebook widget.
     */
    function showOutput(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
                cell.outputHidden = false;
            }
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.showOutput = showOutput;
    /**
     * Toggle output visibility on selected code cells.
     * If at least one output is visible, all outputs are hidden.
     * If no outputs are visible, all outputs are made visible.
     *
     * @param notebook - The target notebook widget.
     */
    function toggleOutput(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        for (const cell of notebook.widgets) {
            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
                if (cell.outputHidden === false) {
                    // We found at least one visible output; hide outputs for this cell
                    return hideOutput(notebook);
                }
            }
        }
        // We found no selected cells or no selected cells with visible output;
        // show outputs for selected cells
        return showOutput(notebook);
    }
    NotebookActions.toggleOutput = toggleOutput;
    /**
     * Hide the output on all code cells.
     *
     * @param notebook - The target notebook widget.
     */
    function hideAllOutputs(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (cell.model.type === 'code') {
                cell.outputHidden = true;
            }
        });
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.hideAllOutputs = hideAllOutputs;
    /**
     * Render side-by-side.
     *
     * @param notebook - The target notebook widget.
     */
    function renderSideBySide(notebook) {
        notebook.renderingLayout = 'side-by-side';
    }
    NotebookActions.renderSideBySide = renderSideBySide;
    /**
     * Render not side-by-side.
     *
     * @param notebook - The target notebook widget.
     */
    function renderDefault(notebook) {
        notebook.renderingLayout = 'default';
    }
    NotebookActions.renderDefault = renderDefault;
    /**
     * Show the output on all code cells.
     *
     * @param notebook - The target notebook widget.
     */
    function showAllOutputs(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (cell.model.type === 'code') {
                cell.outputHidden = false;
            }
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.showAllOutputs = showAllOutputs;
    /**
     * Enable output scrolling for all selected cells.
     *
     * @param notebook - The target notebook widget.
     */
    function enableOutputScrolling(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
                cell.outputsScrolled = true;
            }
        });
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.enableOutputScrolling = enableOutputScrolling;
    /**
     * Disable output scrolling for all selected cells.
     *
     * @param notebook - The target notebook widget.
     */
    function disableOutputScrolling(notebook) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        notebook.widgets.forEach(cell => {
            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
                cell.outputsScrolled = false;
            }
        });
        void Private.handleState(notebook, state);
    }
    NotebookActions.disableOutputScrolling = disableOutputScrolling;
    /**
     * Go to the last cell that is run or current if it is running.
     *
     * Note: This requires execution timing to be toggled on or this will have
     * no effect.
     *
     * @param notebook - The target notebook widget.
     */
    function selectLastRunCell(notebook) {
        let latestTime = null;
        let latestCellIdx = null;
        notebook.widgets.forEach((cell, cellIndx) => {
            if (cell.model.type === 'code') {
                const execution = cell.model.getMetadata('execution');
                if (execution &&
                    dist_index_js_.JSONExt.isObject(execution) &&
                    execution['iopub.status.busy'] !== undefined) {
                    // The busy status is used as soon as a request is received:
                    // https://jupyter-client.readthedocs.io/en/stable/messaging.html
                    const timestamp = execution['iopub.status.busy'].toString();
                    if (timestamp) {
                        const startTime = new Date(timestamp);
                        if (!latestTime || startTime >= latestTime) {
                            latestTime = startTime;
                            latestCellIdx = cellIndx;
                        }
                    }
                }
            }
        });
        if (latestCellIdx !== null) {
            notebook.activeCellIndex = latestCellIdx;
        }
    }
    NotebookActions.selectLastRunCell = selectLastRunCell;
    /**
     * Set the markdown header level.
     *
     * @param notebook - The target notebook widget.
     * @param level - The header level.
     * @param translator - The application translator.
     *
     * #### Notes
     * All selected cells will be switched to markdown.
     * The level will be clamped between 1 and 6.
     * If there is an existing header, it will be replaced.
     * There will always be one blank space after the header.
     * The cells will be unrendered.
     */
    function setMarkdownHeader(notebook, level, translator) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = Private.getState(notebook);
        const cells = notebook.model.cells;
        level = Math.min(Math.max(level, 1), 6);
        notebook.widgets.forEach((child, index) => {
            if (notebook.isSelectedOrActive(child)) {
                Private.setMarkdownHeader(cells.get(index), level);
            }
        });
        Private.changeCellType(notebook, 'markdown', translator);
        void Private.handleState(notebook, state);
    }
    NotebookActions.setMarkdownHeader = setMarkdownHeader;
    /**
     * Collapse all cells in given notebook.
     *
     * @param notebook - The target notebook widget.
     */
    function collapseAllHeadings(notebook) {
        const state = Private.getState(notebook);
        for (const cell of notebook.widgets) {
            if (NotebookActions.getHeadingInfo(cell).isHeading) {
                NotebookActions.setHeadingCollapse(cell, true, notebook);
                NotebookActions.setCellCollapse(cell, true);
            }
        }
        notebook.activeCellIndex = 0;
        void Private.handleState(notebook, state, true);
    }
    NotebookActions.collapseAllHeadings = collapseAllHeadings;
    /**
     * Un-collapse all cells in given notebook.
     *
     * @param notebook - The target notebook widget.
     */
    function expandAllHeadings(notebook) {
        for (const cell of notebook.widgets) {
            if (NotebookActions.getHeadingInfo(cell).isHeading) {
                NotebookActions.setHeadingCollapse(cell, false, notebook);
                // similar to collapseAll.
                NotebookActions.setCellCollapse(cell, false);
            }
        }
    }
    NotebookActions.expandAllHeadings = expandAllHeadings;
    function findNearestParentHeader(cell, notebook) {
        const index = (0,index_es6_js_.findIndex)(notebook.widgets, (possibleCell, index) => {
            return cell.model.id === possibleCell.model.id;
        });
        if (index === -1) {
            return;
        }
        // Finds the nearest header above the given cell. If the cell is a header itself, it does not return itself;
        // this can be checked directly by calling functions.
        if (index >= notebook.widgets.length) {
            return;
        }
        let childHeaderInfo = getHeadingInfo(notebook.widgets[index]);
        for (let cellN = index - 1; cellN >= 0; cellN--) {
            if (cellN < notebook.widgets.length) {
                let hInfo = getHeadingInfo(notebook.widgets[cellN]);
                if (hInfo.isHeading &&
                    hInfo.headingLevel < childHeaderInfo.headingLevel) {
                    return notebook.widgets[cellN];
                }
            }
        }
        // else no parent header found.
        return;
    }
    /**
     * Finds the "parent" heading of the given cell and expands.
     * Used for the case that a cell becomes active that is within a collapsed heading.
     * @param cell - "Child" cell that has become the active cell
     * @param notebook - The target notebook widget.
     */
    function expandParent(cell, notebook) {
        let nearestParentCell = findNearestParentHeader(cell, notebook);
        if (!nearestParentCell) {
            return;
        }
        if (!getHeadingInfo(nearestParentCell).collapsed &&
            !nearestParentCell.isHidden) {
            return;
        }
        if (nearestParentCell.isHidden) {
            expandParent(nearestParentCell, notebook);
        }
        if (getHeadingInfo(nearestParentCell).collapsed) {
            setHeadingCollapse(nearestParentCell, false, notebook);
        }
    }
    NotebookActions.expandParent = expandParent;
    /**
     * Finds the next heading that isn't a child of the given markdown heading.
     * @param cell - "Child" cell that has become the active cell
     * @param notebook - The target notebook widget.
     */
    function findNextParentHeading(cell, notebook) {
        let index = (0,index_es6_js_.findIndex)(notebook.widgets, (possibleCell, index) => {
            return cell.model.id === possibleCell.model.id;
        });
        if (index === -1) {
            return -1;
        }
        let childHeaderInfo = getHeadingInfo(cell);
        for (index = index + 1; index < notebook.widgets.length; index++) {
            let hInfo = getHeadingInfo(notebook.widgets[index]);
            if (hInfo.isHeading &&
                hInfo.headingLevel <= childHeaderInfo.headingLevel) {
                return index;
            }
        }
        // else no parent header found. return the index of the last cell
        return notebook.widgets.length;
    }
    NotebookActions.findNextParentHeading = findNextParentHeading;
    /**
     * Set the given cell and ** all "child" cells **
     * to the given collapse / expand if cell is
     * a markdown header.
     *
     * @param cell - The cell
     * @param collapsing - Whether to collapse or expand the cell
     * @param notebook - The target notebook widget.
     */
    function setHeadingCollapse(cell, collapsing, notebook) {
        const which = (0,index_es6_js_.findIndex)(notebook.widgets, (possibleCell, index) => {
            return cell.model.id === possibleCell.model.id;
        });
        if (which === -1) {
            return -1;
        }
        if (!notebook.widgets.length) {
            return which + 1;
        }
        let selectedHeadingInfo = NotebookActions.getHeadingInfo(cell);
        if (cell.isHidden ||
            !(cell instanceof lib_index_js_.MarkdownCell) ||
            !selectedHeadingInfo.isHeading) {
            // otherwise collapsing and uncollapsing already hidden stuff can
            // cause some funny looking bugs.
            return which + 1;
        }
        let localCollapsed = false;
        let localCollapsedLevel = 0;
        // iterate through all cells after the active cell.
        let cellNum;
        for (cellNum = which + 1; cellNum < notebook.widgets.length; cellNum++) {
            let subCell = notebook.widgets[cellNum];
            let subCellHeadingInfo = NotebookActions.getHeadingInfo(subCell);
            const isHeadingResolved = subCell
                .headingsResolved;
            // Defer until subCell's asynchronous heading parsing is complete
            if (subCellHeadingInfo.headingLevel === -1 && !isHeadingResolved) {
                requestAnimationFrame(() => {
                    setHeadingCollapse(cell, collapsing, notebook);
                });
                break;
            }
            if (subCellHeadingInfo.isHeading &&
                subCellHeadingInfo.headingLevel <= selectedHeadingInfo.headingLevel) {
                // then reached an equivalent or higher heading level than the
                // original the end of the collapse.
                cellNum -= 1;
                break;
            }
            if (localCollapsed &&
                subCellHeadingInfo.isHeading &&
                subCellHeadingInfo.headingLevel <= localCollapsedLevel) {
                // then reached the end of the local collapsed, so unset NotebookActions.
                localCollapsed = false;
            }
            if (collapsing || localCollapsed) {
                // then no extra handling is needed for further locally collapsed
                // headings.
                subCell.setHidden(true);
                continue;
            }
            if (subCellHeadingInfo.collapsed && subCellHeadingInfo.isHeading) {
                localCollapsed = true;
                localCollapsedLevel = subCellHeadingInfo.headingLevel;
                // but don't collapse the locally collapsed heading, so continue to
                // expand the heading. This will get noticed in the next round.
            }
            subCell.setHidden(false);
        }
        if (cellNum === notebook.widgets.length) {
            cell.numberChildNodes = cellNum - which - 1;
        }
        else {
            cell.numberChildNodes = cellNum - which;
        }
        NotebookActions.setCellCollapse(cell, collapsing);
        return cellNum + 1;
    }
    NotebookActions.setHeadingCollapse = setHeadingCollapse;
    /**
     * Toggles the collapse state of the active cell of the given notebook
     * and ** all of its "child" cells ** if the cell is a heading.
     *
     * @param notebook - The target notebook widget.
     */
    function toggleCurrentHeadingCollapse(notebook) {
        if (!notebook.activeCell || notebook.activeCellIndex === undefined) {
            return;
        }
        let headingInfo = NotebookActions.getHeadingInfo(notebook.activeCell);
        if (headingInfo.isHeading) {
            // Then toggle!
            NotebookActions.setHeadingCollapse(notebook.activeCell, !headingInfo.collapsed, notebook);
        }
        notebook.scrollToItem(notebook.activeCellIndex).catch(reason => {
            // no-op
        });
    }
    NotebookActions.toggleCurrentHeadingCollapse = toggleCurrentHeadingCollapse;
    /**
     * If cell is a markdown heading, sets the headingCollapsed field,
     * and otherwise hides the cell.
     *
     * @param cell - The cell to collapse / expand
     * @param collapsing - Whether to collapse or expand the given cell
     */
    function setCellCollapse(cell, collapsing) {
        if (cell instanceof lib_index_js_.MarkdownCell) {
            cell.headingCollapsed = collapsing;
        }
        else {
            cell.setHidden(collapsing);
        }
    }
    NotebookActions.setCellCollapse = setCellCollapse;
    /**
     * If given cell is a markdown heading, returns the heading level.
     * If given cell is not markdown, returns 7 (there are only 6 levels of markdown headings)
     *
     * @param cell - The target cell widget.
     */
    function getHeadingInfo(cell) {
        if (!(cell instanceof lib_index_js_.MarkdownCell)) {
            return { isHeading: false, headingLevel: 7 };
        }
        let level = cell.headingInfo.level;
        let collapsed = cell.headingCollapsed;
        return { isHeading: level > 0, headingLevel: level, collapsed: collapsed };
    }
    NotebookActions.getHeadingInfo = getHeadingInfo;
    /**
     * Trust the notebook after prompting the user.
     *
     * @param notebook - The target notebook widget.
     * @param translator - The application translator.
     *
     * @returns a promise that resolves when the transaction is finished.
     *
     * #### Notes
     * No dialog will be presented if the notebook is already trusted.
     */
    function trust(notebook, translator) {
        translator = translator || translation_lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        if (!notebook.model) {
            return Promise.resolve();
        }
        // Do nothing if already trusted.
        const trusted = (0,index_es6_js_.every)(notebook.model.cells, cell => cell.trusted);
        // FIXME
        const trustMessage = (react_index_js_.createElement("p", null,
            trans.__('A trusted Jupyter notebook may execute hidden malicious code when you open it.'),
            react_index_js_.createElement("br", null),
            trans.__('Selecting "Trust" will re-render this notebook in a trusted state.'),
            react_index_js_.createElement("br", null),
            trans.__('For more information, see'),
            ' ',
            react_index_js_.createElement("a", { href: "https://jupyter-server.readthedocs.io/en/stable/operators/security.html", target: "_blank", rel: "noopener noreferrer" }, trans.__('the Jupyter security documentation')),
            "."));
        if (trusted) {
            return (0,index_js_.showDialog)({
                body: trans.__('Notebook is already trusted'),
                buttons: [index_js_.Dialog.okButton()]
            }).then(() => undefined);
        }
        return (0,index_js_.showDialog)({
            body: trustMessage,
            title: trans.__('Trust this notebook?'),
            buttons: [
                index_js_.Dialog.cancelButton(),
                index_js_.Dialog.warnButton({
                    label: trans.__('Trust'),
                    ariaLabel: trans.__('Confirm Trusting this notebook')
                })
            ] // FIXME?
        }).then(result => {
            if (result.button.accept) {
                if (notebook.model) {
                    for (const cell of notebook.model.cells) {
                        cell.trusted = true;
                    }
                }
            }
        });
    }
    NotebookActions.trust = trust;
    /**
     * If the notebook has an active cell, focus it.
     *
     * @param notebook The target notebook widget
     * @param options Optional options to change the behavior of this function
     * @param options.waitUntilReady If true, do not call focus until activeCell.ready is resolved
     * @param options.preventScroll If true, do not scroll the active cell into view
     *
     * @returns a promise that resolves when focus has been called on the active
     * cell's node.
     *
     * #### Notes
     * By default, waits until after the active cell has been attached unless
     * called with { waitUntilReady: false }
     */
    async function focusActiveCell(notebook, options = { waitUntilReady: true, preventScroll: false }) {
        const { activeCell } = notebook;
        const { waitUntilReady, preventScroll } = options;
        if (!activeCell) {
            return;
        }
        if (waitUntilReady) {
            await activeCell.ready;
        }
        if (notebook.isDisposed || activeCell.isDisposed) {
            return;
        }
        activeCell.node.focus({
            preventScroll
        });
    }
    NotebookActions.focusActiveCell = focusActiveCell;
    /*
     * Access last notebook history.
     *
     * @param notebook - The target notebook widget.
     */
    async function accessPreviousHistory(notebook) {
        if (!notebook.notebookConfig.accessKernelHistory) {
            return;
        }
        const activeCell = notebook.activeCell;
        if (activeCell) {
            if (notebook.kernelHistory) {
                const previousHistory = await notebook.kernelHistory.back(activeCell);
                notebook.kernelHistory.updateEditor(activeCell, previousHistory);
            }
        }
    }
    NotebookActions.accessPreviousHistory = accessPreviousHistory;
    /**
     * Access next notebook history.
     *
     * @param notebook - The target notebook widget.
     */
    async function accessNextHistory(notebook) {
        if (!notebook.notebookConfig.accessKernelHistory) {
            return;
        }
        const activeCell = notebook.activeCell;
        if (activeCell) {
            if (notebook.kernelHistory) {
                const nextHistory = await notebook.kernelHistory.forward(activeCell);
                notebook.kernelHistory.updateEditor(activeCell, nextHistory);
            }
        }
    }
    NotebookActions.accessNextHistory = accessNextHistory;
})(NotebookActions || (NotebookActions = {}));
/**
 * Set the notebook cell executor and the related signals.
 */
function setCellExecutor(executor) {
    if (Private.executor) {
        throw new Error('Cell executor can only be set once.');
    }
    Private.executor = executor;
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * A signal that emits whenever a cell completes execution.
     */
    Private.executed = new dist_index_es6_js_.Signal({});
    /**
     * A signal that emits whenever a cell execution is scheduled.
     */
    Private.executionScheduled = new dist_index_es6_js_.Signal({});
    /**
     * A signal that emits when one notebook's cells are all executed.
     */
    Private.selectionExecuted = new dist_index_es6_js_.Signal({});
    /**
     * A signal that emits when one notebook's cells are all executed.
     */
    Private.outputCleared = new dist_index_es6_js_.Signal({});
    /**
     * Get the state of a widget before running an action.
     */
    function getState(notebook) {
        var _a, _b;
        return {
            wasFocused: notebook.node.contains(document.activeElement),
            activeCellId: (_b = (_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.model.id) !== null && _b !== void 0 ? _b : null
        };
    }
    Private.getState = getState;
    /**
     * Handle the state of a widget after running an action.
     */
    async function handleState(notebook, state, scrollIfNeeded = false) {
        const { activeCell, activeCellIndex } = notebook;
        if (scrollIfNeeded && activeCell) {
            await notebook.scrollToItem(activeCellIndex, 'auto', 0).catch(reason => {
                // no-op
            });
        }
        if (state.wasFocused || notebook.mode === 'edit') {
            notebook.activate();
        }
    }
    Private.handleState = handleState;
    /**
     * Handle the state of a widget after running a run action.
     */
    async function handleRunState(notebook, state, alignPreference) {
        const { activeCell, activeCellIndex } = notebook;
        if (activeCell) {
            await notebook
                .scrollToItem(activeCellIndex, 'smart', 0, alignPreference)
                .catch(reason => {
                // no-op
            });
        }
        if (state.wasFocused || notebook.mode === 'edit') {
            notebook.activate();
        }
    }
    Private.handleRunState = handleRunState;
    /**
     * Run the selected cells.
     *
     * @param notebook Notebook
     * @param cells Cells to run
     * @param sessionContext Notebook session context
     * @param sessionDialogs Session dialogs
     * @param translator Application translator
     */
    function runCells(notebook, cells, sessionContext, sessionDialogs, translator) {
        const lastCell = cells[cells.length - 1];
        notebook.mode = 'command';
        let initializingDialogShown = false;
        return Promise.all(cells.map(cell => {
            if (cell.model.type === 'code' &&
                notebook.notebookConfig.enableKernelInitNotification &&
                sessionContext &&
                sessionContext.kernelDisplayStatus === 'initializing' &&
                !initializingDialogShown) {
                initializingDialogShown = true;
                translator = translator || translation_lib_index_js_.nullTranslator;
                const trans = translator.load('jupyterlab');
                index_js_.Notification.emit(trans.__(`Kernel '${sessionContext.kernelDisplayName}' for '${sessionContext.path}' is still initializing. You can run code cells when the kernel has initialized.`), 'warning', {
                    autoClose: false
                });
                return Promise.resolve(false);
            }
            if (cell.model.type === 'code' &&
                notebook.notebookConfig.enableKernelInitNotification &&
                initializingDialogShown) {
                return Promise.resolve(false);
            }
            return runCell(notebook, cell, sessionContext, sessionDialogs, translator);
        }))
            .then(results => {
            if (notebook.isDisposed) {
                return false;
            }
            Private.selectionExecuted.emit({
                notebook,
                lastCell
            });
            // Post an update request.
            notebook.update();
            return results.every(result => result);
        })
            .catch(reason => {
            if (reason.message.startsWith('KernelReplyNotOK')) {
                cells.map(cell => {
                    // Remove '*' prompt from cells that didn't execute
                    if (cell.model.type === 'code' &&
                        cell.model.executionCount == null) {
                        cell.model.executionState = 'idle';
                    }
                });
            }
            else {
                throw reason;
            }
            Private.selectionExecuted.emit({
                notebook,
                lastCell
            });
            notebook.update();
            return false;
        });
    }
    Private.runCells = runCells;
    /**
     * Run the selected cells.
     *
     * @param notebook Notebook
     * @param sessionContext Notebook session context
     * @param sessionDialogs Session dialogs
     * @param translator Application translator
     */
    function runSelected(notebook, sessionContext, sessionDialogs, translator) {
        notebook.mode = 'command';
        let lastIndex = notebook.activeCellIndex;
        const selected = notebook.widgets.filter((child, index) => {
            const active = notebook.isSelectedOrActive(child);
            if (active) {
                lastIndex = index;
            }
            return active;
        });
        notebook.activeCellIndex = lastIndex;
        notebook.deselectAll();
        return runCells(notebook, selected, sessionContext, sessionDialogs, translator);
    }
    Private.runSelected = runSelected;
    /**
     * Run a cell.
     */
    async function runCell(notebook, cell, sessionContext, sessionDialogs, translator) {
        if (!Private.executor) {
            console.warn('Requesting cell execution without any cell executor defined. Falling back to default execution.');
        }
        const options = {
            cell,
            notebook: notebook.model,
            notebookConfig: notebook.notebookConfig,
            onCellExecuted: args => {
                Private.executed.emit({ notebook, ...args });
            },
            onCellExecutionScheduled: args => {
                Private.executionScheduled.emit({ notebook, ...args });
            },
            sessionContext,
            sessionDialogs,
            translator
        };
        return Private.executor ? Private.executor.runCell(options) : cellexecutor_runCell(options);
    }
    /**
     * Get the selected cell(s) without affecting the clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * @returns A list of 0 or more selected cells
     */
    function selectedCells(notebook) {
        return notebook.widgets
            .filter(cell => notebook.isSelectedOrActive(cell))
            .map(cell => cell.model.toJSON())
            .map(cellJSON => {
            if (cellJSON.metadata.deletable !== undefined) {
                delete cellJSON.metadata.deletable;
            }
            return cellJSON;
        });
    }
    Private.selectedCells = selectedCells;
    /**
     * Copy or cut the selected cell data to the application clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * @param cut - True if the cells should be cut, false if they should be copied.
     */
    function copyOrCut(notebook, cut) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = getState(notebook);
        const clipboard = index_js_.Clipboard.getInstance();
        notebook.mode = 'command';
        clipboard.clear();
        const data = Private.selectedCells(notebook);
        clipboard.setData(JUPYTER_CELL_MIME, data);
        if (cut) {
            deleteCells(notebook);
        }
        else {
            notebook.deselectAll();
        }
        if (cut) {
            notebook.recordCellClipboardInteraction('cut', data);
        }
        else {
            notebook.recordCellClipboardInteraction('copy', data);
        }
        void handleState(notebook, state);
    }
    Private.copyOrCut = copyOrCut;
    /**
     * Copy or cut the selected cell data to the system clipboard.
     *
     * @param notebook - The target notebook widget.
     *
     * @param cut - True if the cells should be cut, false if they should be copied.
     */
    async function copyOrCutToSystemClipboard(notebook, cut) {
        if (!notebook.model || !notebook.activeCell) {
            return;
        }
        const state = getState(notebook);
        const clipboard = index_js_.SystemClipboard.getInstance();
        notebook.mode = 'command';
        clipboard.clear();
        const data = Private.selectedCells(notebook);
        await clipboard.setData(JUPYTER_CELL_MIME, data);
        if (cut) {
            deleteCells(notebook);
        }
        else {
            notebook.deselectAll();
        }
        if (cut) {
            notebook.recordCellClipboardInteraction('cut', data);
        }
        else {
            notebook.recordCellClipboardInteraction('copy', data);
        }
        void handleState(notebook, state);
    }
    Private.copyOrCutToSystemClipboard = copyOrCutToSystemClipboard;
    /**
     * Change the selected cell type(s).
     *
     * @param notebook - The target notebook widget.
     *
     * @param value - The target cell type.
     *
     * #### Notes
     * It should preserve the widget mode.
     * This action can be undone.
     * The existing selection will be cleared.
     * Any cells converted to markdown will be unrendered.
     */
    function changeCellType(notebook, value, translator) {
        const notebookSharedModel = notebook.model.sharedModel;
        notebook.widgets.forEach((child, index) => {
            if (!notebook.isSelectedOrActive(child)) {
                return;
            }
            if (child.model.type === 'code' &&
                child.outputArea.pendingInput) {
                translator = translator || translation_lib_index_js_.nullTranslator;
                const trans = translator.load('jupyterlab');
                // Do not permit changing cell type when input is pending
                void (0,index_js_.showDialog)({
                    title: trans.__('Cell type not changed due to pending input'),
                    body: trans.__('The cell type has not been changed to avoid kernel deadlock as this cell has pending input! Submit your pending input and try again.'),
                    buttons: [index_js_.Dialog.okButton()]
                });
                return;
            }
            if (child.model.getMetadata('editable') == false) {
                translator = translator || translation_lib_index_js_.nullTranslator;
                const trans = translator.load('jupyterlab');
                // Do not permit changing cell type when the cell is readonly
                void (0,index_js_.showDialog)({
                    title: trans.__('Cell is read-only'),
                    body: trans.__('The cell is read-only, its type cannot be changed!'),
                    buttons: [index_js_.Dialog.okButton()]
                });
                return;
            }
            if (child.model.type !== value) {
                const raw = child.model.toJSON();
                notebookSharedModel.transact(() => {
                    notebookSharedModel.deleteCell(index);
                    if (value === 'code') {
                        // After change of type outputs are deleted so cell can be trusted.
                        raw.metadata.trusted = true;
                    }
                    else {
                        // Otherwise clear the metadata as trusted is only "valid" on code
                        // cells (since other cell types cannot have outputs).
                        raw.metadata.trusted = undefined;
                    }
                    const newCell = notebookSharedModel.insertCell(index, {
                        id: raw.id,
                        cell_type: value,
                        source: raw.source,
                        metadata: raw.metadata
                    });
                    if (raw.attachments && ['markdown', 'raw'].includes(value)) {
                        newCell.attachments =
                            raw.attachments;
                    }
                });
            }
            if (value === 'markdown') {
                // Fetch the new widget and unrender it.
                child = notebook.widgets[index];
                child.rendered = false;
            }
        });
        notebook.deselectAll();
    }
    Private.changeCellType = changeCellType;
    /**
     * Delete the selected cells.
     *
     * @param notebook - The target notebook widget.
     *
     * #### Notes
     * The cell after the last selected cell will be activated.
     * If the last cell is deleted, then the previous one will be activated.
     * It will add a code cell if all cells are deleted.
     * This action can be undone.
     */
    function deleteCells(notebook) {
        const model = notebook.model;
        const sharedModel = model.sharedModel;
        const toDelete = [];
        notebook.mode = 'command';
        // Find the cells to delete.
        notebook.widgets.forEach((child, index) => {
            var _a;
            const deletable = child.model.getMetadata('deletable') !== false;
            if (notebook.isSelectedOrActive(child) && deletable) {
                toDelete.push(index);
                (_a = notebook.model) === null || _a === void 0 ? void 0 : _a.deletedCells.push(child.model.id);
            }
        });
        // If cells are not deletable, we may not have anything to delete.
        if (toDelete.length > 0) {
            // Delete the cells as one undo event.
            sharedModel.transact(() => {
                // Delete cells in reverse order to maintain the correct indices.
                toDelete.reverse().forEach(index => {
                    sharedModel.deleteCell(index);
                });
                // Add a new cell if the notebook is empty. This is done
                // within the compound operation to make the deletion of
                // a notebook's last cell undoable.
                if (sharedModel.cells.length == toDelete.length) {
                    sharedModel.insertCell(0, {
                        cell_type: notebook.notebookConfig.defaultCell,
                        metadata: notebook.notebookConfig.defaultCell === 'code'
                            ? {
                                // This is an empty cell created in empty notebook, thus is trusted
                                trusted: true
                            }
                            : {}
                    });
                }
            });
            // Select the *first* interior cell not deleted or the cell
            // *after* the last selected cell.
            // Note: The activeCellIndex is clamped to the available cells,
            // so if the last cell is deleted the previous cell will be activated.
            // The *first* index is the index of the last cell in the initial
            // toDelete list due to the `reverse` operation above.
            notebook.activeCellIndex = toDelete[0] - toDelete.length + 1;
        }
        // Deselect any remaining, undeletable cells. Do this even if we don't
        // delete anything so that users are aware *something* happened.
        notebook.deselectAll();
    }
    Private.deleteCells = deleteCells;
    /**
     * Set the markdown header level of a cell.
     */
    function setMarkdownHeader(cell, level) {
        // Remove existing header or leading white space.
        let source = cell.sharedModel.getSource();
        const regex = /^(#+\s*)|^(\s*)/;
        const newHeader = Array(level + 1).join('#') + ' ';
        const matches = regex.exec(source);
        if (matches) {
            source = source.slice(matches[0].length);
        }
        cell.sharedModel.setSource(newHeader + source);
    }
    Private.setMarkdownHeader = setMarkdownHeader;
    /** Functionality related to collapsible headings */
    let Headings;
    (function (Headings) {
        /** Find the heading that is parent to cell.
         *
         * @param childCell - The cell that is child to the sought heading
         * @param notebook - The target notebook widget
         * @param includeChildCell [default=false] - if set to true and childCell is a heading itself, the childCell will be returned
         * @param returnIndex [default=false] - if set to true, the cell index is returned rather than the cell object.
         *
         * @returns the (index | Cell object) of the parent heading or (-1 | null) if there is no parent heading.
         */
        function findParentHeading(childCell, notebook, includeChildCell = false, returnIndex = false) {
            let cellIdx = notebook.widgets.indexOf(childCell) - (includeChildCell ? 1 : 0);
            while (cellIdx >= 0) {
                let headingInfo = NotebookActions.getHeadingInfo(notebook.widgets[cellIdx]);
                if (headingInfo.isHeading) {
                    return returnIndex ? cellIdx : notebook.widgets[cellIdx];
                }
                cellIdx--;
            }
            return returnIndex ? -1 : null;
        }
        Headings.findParentHeading = findParentHeading;
        /** Find heading above with leq level than baseCell heading level.
         *
         * @param baseCell - cell relative to which so search
         * @param notebook - target notebook widget
         * @param returnIndex [default=false] - if set to true, the cell index is returned rather than the cell object.
         *
         * @returns the (index | Cell object) of the found heading or (-1 | null) if no heading found.
         */
        function findLowerEqualLevelParentHeadingAbove(baseCell, notebook, returnIndex = false) {
            let baseHeadingLevel = Private.Headings.determineHeadingLevel(baseCell, notebook);
            if (baseHeadingLevel == -1) {
                baseHeadingLevel = 1; // if no heading level can be determined, assume we're on level 1
            }
            // find the heading above with heading level <= baseHeadingLevel and return its index
            let cellIdx = notebook.widgets.indexOf(baseCell) - 1;
            while (cellIdx >= 0) {
                let cell = notebook.widgets[cellIdx];
                let headingInfo = NotebookActions.getHeadingInfo(cell);
                if (headingInfo.isHeading &&
                    headingInfo.headingLevel <= baseHeadingLevel) {
                    return returnIndex ? cellIdx : cell;
                }
                cellIdx--;
            }
            return returnIndex ? -1 : null; // no heading found
        }
        Headings.findLowerEqualLevelParentHeadingAbove = findLowerEqualLevelParentHeadingAbove;
        /** Find next heading with equal or lower level.
         *
         * @param baseCell - cell relative to which so search
         * @param notebook - target notebook widget
         * @param returnIndex [default=false] - if set to true, the cell index is returned rather than the cell object.
         *
         * @returns the (index | Cell object) of the found heading or (-1 | null) if no heading found.
         */
        function findLowerEqualLevelHeadingBelow(baseCell, notebook, returnIndex = false) {
            let baseHeadingLevel = Private.Headings.determineHeadingLevel(baseCell, notebook);
            if (baseHeadingLevel == -1) {
                baseHeadingLevel = 1; // if no heading level can be determined, assume we're on level 1
            }
            let cellIdx = notebook.widgets.indexOf(baseCell) + 1;
            while (cellIdx < notebook.widgets.length) {
                let cell = notebook.widgets[cellIdx];
                let headingInfo = NotebookActions.getHeadingInfo(cell);
                if (headingInfo.isHeading &&
                    headingInfo.headingLevel <= baseHeadingLevel) {
                    return returnIndex ? cellIdx : cell;
                }
                cellIdx++;
            }
            return returnIndex ? -1 : null;
        }
        Headings.findLowerEqualLevelHeadingBelow = findLowerEqualLevelHeadingBelow;
        /** Find next heading.
         *
         * @param baseCell - cell relative to which so search
         * @param notebook - target notebook widget
         * @param returnIndex [default=false] - if set to true, the cell index is returned rather than the cell object.
         *
         * @returns the (index | Cell object) of the found heading or (-1 | null) if no heading found.
         */
        function findHeadingBelow(baseCell, notebook, returnIndex = false) {
            let cellIdx = notebook.widgets.indexOf(baseCell) + 1;
            while (cellIdx < notebook.widgets.length) {
                let cell = notebook.widgets[cellIdx];
                let headingInfo = NotebookActions.getHeadingInfo(cell);
                if (headingInfo.isHeading) {
                    return returnIndex ? cellIdx : cell;
                }
                cellIdx++;
            }
            return returnIndex ? -1 : null;
        }
        Headings.findHeadingBelow = findHeadingBelow;
        /** Determine the heading level of a cell.
         *
         * @param baseCell - The cell of which the heading level shall be determined
         * @param notebook - The target notebook widget
         *
         * @returns the heading level or -1 if there is no parent heading
         *
         * #### Notes
         * If the baseCell is a heading itself, the heading level of baseCell is returned.
         * If the baseCell is not a heading itself, the level of the parent heading is returned.
         * If there is no parent heading, -1 is returned.
         */
        function determineHeadingLevel(baseCell, notebook) {
            let headingInfoBaseCell = NotebookActions.getHeadingInfo(baseCell);
            // fill baseHeadingLevel or return null if there is no heading at or above baseCell
            if (headingInfoBaseCell.isHeading) {
                return headingInfoBaseCell.headingLevel;
            }
            else {
                let parentHeading = findParentHeading(baseCell, notebook, true);
                if (parentHeading == null) {
                    return -1;
                }
                return NotebookActions.getHeadingInfo(parentHeading).headingLevel;
            }
        }
        Headings.determineHeadingLevel = determineHeadingLevel;
        /** Insert a new heading cell at given position.
         *
         * @param cellIndex - where to insert
         * @param headingLevel - level of the new heading
         * @param notebook - target notebook
         *
         * #### Notes
         * Enters edit mode after insert.
         */
        async function insertHeadingAboveCellIndex(cellIndex, headingLevel, notebook) {
            var _a;
            headingLevel = Math.min(Math.max(headingLevel, 1), 6);
            const state = Private.getState(notebook);
            const model = notebook.model;
            const sharedModel = model.sharedModel;
            sharedModel.insertCell(cellIndex, {
                cell_type: 'markdown',
                source: '#'.repeat(headingLevel) + ' '
            });
            notebook.activeCellIndex = cellIndex;
            if (((_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.inViewport) === false) {
                await (0,coreutils_lib_index_js_.signalToPromise)(notebook.activeCell.inViewportChanged, 200).catch(() => {
                    // no-op
                });
            }
            notebook.deselectAll();
            void Private.handleState(notebook, state, true);
            notebook.mode = 'edit';
            notebook.widgets[cellIndex].setHidden(false);
        }
        Headings.insertHeadingAboveCellIndex = insertHeadingAboveCellIndex;
    })(Headings = Private.Headings || (Private.Headings = {}));
})(Private || (Private = {}));
//# sourceMappingURL=actions.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/celllist.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A cell list object that supports undo/redo.
 */
class CellList {
    /**
     * Construct the cell list.
     */
    constructor(model) {
        this.model = model;
        this._cellMap = new WeakMap();
        this._changed = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._insertCells(0, this.model.cells);
        this.model.changed.connect(this._onSharedModelChanged, this);
    }
    /**
     * A signal emitted when the cell list has changed.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Test whether the cell list has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Get the length of the cell list.
     *
     * @returns The number of cells in the cell list.
     */
    get length() {
        return this.model.cells.length;
    }
    /**
     * Create an iterator over the cells in the cell list.
     *
     * @returns A new iterator starting at the front of the cell list.
     */
    *[Symbol.iterator]() {
        for (const cell of this.model.cells) {
            yield this._cellMap.get(cell);
        }
    }
    /**
     * Dispose of the resources held by the cell list.
     */
    dispose() {
        var _a;
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        // Clean up the cell map and cell order objects.
        for (const cell of this.model.cells) {
            (_a = this._cellMap.get(cell)) === null || _a === void 0 ? void 0 : _a.dispose();
        }
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Get the cell at the specified index.
     *
     * @param index - The positive integer index of interest.
     *
     * @returns The cell at the specified index.
     */
    get(index) {
        return this._cellMap.get(this.model.cells[index]);
    }
    _insertCells(index, cells) {
        cells.forEach(sharedModel => {
            let cellModel;
            switch (sharedModel.cell_type) {
                case 'code': {
                    cellModel = new lib_index_js_.CodeCellModel({
                        sharedModel: sharedModel
                    });
                    break;
                }
                case 'markdown': {
                    cellModel = new lib_index_js_.MarkdownCellModel({
                        sharedModel: sharedModel
                    });
                    break;
                }
                default: {
                    cellModel = new lib_index_js_.RawCellModel({
                        sharedModel: sharedModel
                    });
                }
            }
            this._cellMap.set(sharedModel, cellModel);
            sharedModel.disposed.connect(() => {
                cellModel.dispose();
                this._cellMap.delete(sharedModel);
            });
        });
        return this.length;
    }
    _onSharedModelChanged(self, change) {
        var _a;
        let currpos = 0;
        // We differ emitting the list changes to ensure cell model for all current shared cell have been created.
        const events = new Array();
        (_a = change.cellsChange) === null || _a === void 0 ? void 0 : _a.forEach(delta => {
            if (delta.insert != null) {
                this._insertCells(currpos, delta.insert);
                events.push({
                    type: 'add',
                    newIndex: currpos,
                    newValues: delta.insert.map(c => this._cellMap.get(c)),
                    oldIndex: -2,
                    oldValues: []
                });
                currpos += delta.insert.length;
            }
            else if (delta.delete != null) {
                events.push({
                    type: 'remove',
                    newIndex: -1,
                    newValues: [],
                    oldIndex: currpos,
                    // Cells have been disposed, so we don't know which one are gone.
                    oldValues: new Array(delta.delete).fill(undefined)
                });
            }
            else if (delta.retain != null) {
                currpos += delta.retain;
            }
        });
        events.forEach(msg => this._changed.emit(msg));
    }
}
//# sourceMappingURL=celllist.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/default-toolbar.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * The class name added to toolbar cell type dropdown wrapper.
 */
const TOOLBAR_CELLTYPE_CLASS = 'jp-Notebook-toolbarCellType';
/**
 * The class name added to toolbar cell type dropdown.
 */
const TOOLBAR_CELLTYPE_DROPDOWN_CLASS = 'jp-Notebook-toolbarCellTypeDropdown';
/**
 * A namespace for the default toolbar items.
 */
var ToolbarItems;
(function (ToolbarItems) {
    /**
     * Create save button toolbar item.
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createSaveButton(panel, translator) {
        const trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        function onClick() {
            if (panel.context.model.readOnly) {
                return (0,index_js_.showDialog)({
                    title: trans.__('Cannot Save'),
                    body: trans.__('Document is read-only'),
                    buttons: [index_js_.Dialog.okButton()]
                });
            }
            void panel.context.save().then(() => {
                if (!panel.isDisposed) {
                    return panel.context.createCheckpoint();
                }
            });
        }
        return (0,ui_components_lib_index_js_.addToolbarButtonClass)(ui_components_lib_index_js_.ReactWidget.create(react_index_js_.createElement(ui_components_lib_index_js_.UseSignal, { signal: panel.context.fileChanged }, () => (react_index_js_.createElement(ui_components_lib_index_js_.ToolbarButtonComponent, { icon: ui_components_lib_index_js_.saveIcon, onClick: onClick, tooltip: trans.__('Save the notebook contents and create checkpoint'), enabled: !!(panel &&
                panel.context &&
                panel.context.contentsModel &&
                panel.context.contentsModel.writable) })))));
    }
    ToolbarItems.createSaveButton = createSaveButton;
    /**
     * Create an insert toolbar item.
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createInsertButton(panel, translator) {
        const trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.addIcon,
            onClick: () => {
                NotebookActions.insertBelow(panel.content);
            },
            tooltip: trans.__('Insert a cell below')
        });
    }
    ToolbarItems.createInsertButton = createInsertButton;
    /**
     * Create a cut toolbar item.
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createCutButton(panel, translator, settings) {
        const trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.cutIcon,
            onClick: async () => {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    await NotebookActions.cutToSystemClipboard(panel.content);
                }
                else {
                    NotebookActions.cut(panel.content);
                }
            },
            tooltip: trans.__('Cut the selected cells')
        });
    }
    ToolbarItems.createCutButton = createCutButton;
    /**
     * Create a copy toolbar item.
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createCopyButton(panel, translator, settings) {
        const trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.copyIcon,
            onClick: async () => {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    await NotebookActions.copyToSystemClipboard(panel.content);
                }
                else {
                    NotebookActions.copy(panel.content);
                }
            },
            tooltip: trans.__('Copy the selected cells')
        });
    }
    ToolbarItems.createCopyButton = createCopyButton;
    /**
     * Create a paste toolbar item.
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createPasteButton(panel, translator, settings) {
        const trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.pasteIcon,
            onClick: async () => {
                if (settings === null || settings === void 0 ? void 0 : settings.get('useSystemClipboardForCells').composite) {
                    await NotebookActions.pasteFromSystemClipboard(panel.content);
                }
                else {
                    NotebookActions.paste(panel.content);
                }
            },
            tooltip: trans.__('Paste cells from the clipboard')
        });
    }
    ToolbarItems.createPasteButton = createPasteButton;
    /**
     * Create a run toolbar item.
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createRunButton(panel, sessionDialogs, translator) {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.runIcon,
            onClick: () => {
                void NotebookActions.runAndAdvance(panel.content, panel.sessionContext, sessionDialogs, translator);
            },
            tooltip: trans.__('Run the selected cells and advance')
        });
    }
    ToolbarItems.createRunButton = createRunButton;
    /**
     * Create a restart run all toolbar item
     *
     * @deprecated since v3.2
     * This is dead code now.
     */
    function createRestartRunAllButton(panel, dialogs, translator) {
        const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        return new ui_components_lib_index_js_.ToolbarButton({
            icon: ui_components_lib_index_js_.fastForwardIcon,
            onClick: () => {
                const dialogs_ = dialogs !== null && dialogs !== void 0 ? dialogs : new index_js_.SessionContextDialogs({ translator });
                void dialogs_.restart(panel.sessionContext).then(restarted => {
                    if (restarted) {
                        void NotebookActions.runAll(panel.content, panel.sessionContext, dialogs_, translator);
                    }
                    return restarted;
                });
            },
            tooltip: trans.__('Restart the kernel, then re-run the whole notebook')
        });
    }
    ToolbarItems.createRestartRunAllButton = createRestartRunAllButton;
    /**
     * Create a cell type switcher item.
     *
     * #### Notes
     * It will display the type of the current active cell.
     * If more than one cell is selected but are of different types,
     * it will display `'-'`.
     * When the user changes the cell type, it will change the
     * cell types of the selected cells.
     * It can handle a change to the context.
     */
    function createCellTypeItem(panel, translator) {
        return new CellTypeSwitcher(panel.content, translator);
    }
    ToolbarItems.createCellTypeItem = createCellTypeItem;
    /**
     * Get the default toolbar items for panel
     *
     * @deprecated since v4
     */
    function getDefaultItems(panel, sessionDialogs, translator, settings) {
        return [
            { name: 'save', widget: createSaveButton(panel, translator) },
            { name: 'insert', widget: createInsertButton(panel, translator) },
            { name: 'cut', widget: createCutButton(panel, translator, settings) },
            { name: 'copy', widget: createCopyButton(panel, translator, settings) },
            { name: 'paste', widget: createPasteButton(panel, translator, settings) },
            {
                name: 'run',
                widget: createRunButton(panel, sessionDialogs, translator)
            },
            {
                name: 'interrupt',
                widget: index_js_.Toolbar.createInterruptButton(panel.sessionContext, translator)
            },
            {
                name: 'restart',
                widget: index_js_.Toolbar.createRestartButton(panel.sessionContext, sessionDialogs, translator)
            },
            {
                name: 'restart-and-run',
                widget: createRestartRunAllButton(panel, sessionDialogs, translator)
            },
            { name: 'cellType', widget: createCellTypeItem(panel, translator) },
            { name: 'spacer', widget: ui_components_lib_index_js_.Toolbar.createSpacerItem() },
            {
                name: 'kernelName',
                widget: index_js_.Toolbar.createKernelNameItem(panel.sessionContext, sessionDialogs, translator)
            }
        ];
    }
    ToolbarItems.getDefaultItems = getDefaultItems;
})(ToolbarItems || (ToolbarItems = {}));
/**
 * A toolbar widget that switches cell types.
 */
class CellTypeSwitcher extends ui_components_lib_index_js_.ReactWidget {
    /**
     * Construct a new cell type switcher.
     */
    constructor(widget, translator) {
        super();
        /**
         * Handle `change` events for the HTMLSelect component.
         */
        this.handleChange = (event) => {
            if (event.target.value !== '-') {
                NotebookActions.changeCellType(this._notebook, event.target.value);
                this._notebook.activate();
            }
        };
        /**
         * Handle `keydown` events for the HTMLSelect component.
         */
        this.handleKeyDown = (event) => {
            if (event.keyCode === 13) {
                this._notebook.activate();
            }
        };
        this._trans = (translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this.addClass(TOOLBAR_CELLTYPE_CLASS);
        this._notebook = widget;
        if (widget.model) {
            this.update();
        }
        widget.activeCellChanged.connect(this.update, this);
        // Follow a change in the selection.
        widget.selectionChanged.connect(this.update, this);
    }
    render() {
        let value = '-';
        if (this._notebook.activeCell) {
            value = this._notebook.activeCell.model.type;
        }
        for (const widget of this._notebook.widgets) {
            if (this._notebook.isSelectedOrActive(widget)) {
                if (widget.model.type !== value) {
                    value = '-';
                    break;
                }
            }
        }
        return (react_index_js_.createElement(ui_components_lib_index_js_.HTMLSelect, { className: TOOLBAR_CELLTYPE_DROPDOWN_CLASS, onChange: this.handleChange, onKeyDown: this.handleKeyDown, value: value, "aria-label": this._trans.__('Cell type'), title: this._trans.__('Select the cell type') },
            react_index_js_.createElement("option", { value: "-" }, "-"),
            react_index_js_.createElement("option", { value: "code" }, this._trans.__('Code')),
            react_index_js_.createElement("option", { value: "markdown" }, this._trans.__('Markdown')),
            react_index_js_.createElement("option", { value: "raw" }, this._trans.__('Raw'))));
    }
}
//# sourceMappingURL=default-toolbar.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statusbar@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statusbar/lib/index.js)
var statusbar_lib_index_js_ = __webpack_require__(99055);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/executionindicator.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * A react functional component for rendering execution indicator.
 */
function ExecutionIndicatorComponent(props) {
    var _a;
    const translator = props.translator || translation_lib_index_js_.nullTranslator;
    const kernelStatuses = (0,index_js_.translateKernelStatuses)(translator);
    const trans = translator.load('jupyterlab');
    const showJumpToCell = (_a = props.displayOption.showJumpToCell) !== null && _a !== void 0 ? _a : false;
    const state = props.state;
    const showOnToolBar = props.displayOption.showOnToolBar;
    const showProgress = props.displayOption.showProgress;
    const tooltipClass = showOnToolBar ? 'down' : 'up';
    const emptyDiv = react_index_js_default().createElement("div", null);
    const [hasExecutedCell, setHasExecutedCell] = react_index_js_default().useState(false);
    react_index_js_default().useEffect(() => {
        if (hasExecutedCell) {
            return;
        }
        const onExecutionScheduled = () => {
            setHasExecutedCell(true);
        };
        NotebookActions.executionScheduled.connect(onExecutionScheduled);
        return () => {
            NotebookActions.executionScheduled.disconnect(onExecutionScheduled);
        };
    }, [showJumpToCell, hasExecutedCell]);
    if (!state) {
        return emptyDiv;
    }
    const kernelStatus = state.kernelStatus;
    const circleIconProps = {
        alignSelf: 'normal',
        height: '24px'
    };
    const time = state.totalTime;
    const scheduledCellNumber = state.scheduledCellNumber || 0;
    const remainingCellNumber = state.scheduledCell.size || 0;
    const executedCellNumber = scheduledCellNumber - remainingCellNumber;
    let percentage = (100 * executedCellNumber) / scheduledCellNumber;
    let displayClass = showProgress ? '' : 'hidden';
    if (!showProgress && percentage < 100) {
        percentage = 0;
    }
    const progressBar = (percentage) => (react_index_js_default().createElement(statusbar_lib_index_js_.ProgressCircle, { progress: percentage, width: 16, height: 24, label: trans.__('Kernel status') }));
    const titleFactory = (translatedStatus) => trans.__('Kernel status: %1', translatedStatus);
    const onJumpToCell = () => {
        const nb = props.notebook;
        NotebookActions.selectLastRunCell(nb);
        if (nb.activeCell) {
            void nb.scrollToCell(nb.activeCell);
        }
    };
    const reactElement = (status, circle, popup) => (react_index_js_default().createElement("div", { className: 'jp-Notebook-ExecutionIndicator', title: showProgress ? '' : titleFactory(kernelStatuses[status]), "data-status": status },
        circle,
        react_index_js_default().createElement("div", { className: `jp-Notebook-ExecutionIndicator-tooltip ${tooltipClass} ${displayClass}` },
            react_index_js_default().createElement("span", null,
                " ",
                titleFactory(kernelStatuses[status]),
                " "),
            popup,
            showJumpToCell && hasExecutedCell && (react_index_js_default().createElement(ui_components_lib_index_js_.Button, { className: "jp-Notebook-ExecutionIndicator-jumpButton", onClick: onJumpToCell, title: trans.__('Jump to current or last executed cell') }, trans.__('Jump to cell'))))));
    if (state.kernelStatus === 'connecting' ||
        state.kernelStatus === 'disconnected' ||
        state.kernelStatus === 'unknown') {
        return reactElement(kernelStatus, react_index_js_default().createElement(ui_components_lib_index_js_.offlineBoltIcon.react, { ...circleIconProps }), []);
    }
    if (state.kernelStatus === 'starting' ||
        state.kernelStatus === 'terminating' ||
        state.kernelStatus === 'restarting' ||
        state.kernelStatus === 'initializing') {
        return reactElement(kernelStatus, react_index_js_default().createElement(ui_components_lib_index_js_.circleIcon.react, { ...circleIconProps }), []);
    }
    if (state.executionStatus === 'busy') {
        return reactElement('busy', progressBar(percentage), [
            react_index_js_default().createElement("span", { key: 0 }, trans.__(`Executed ${executedCellNumber}/${scheduledCellNumber} cells`)),
            react_index_js_default().createElement("span", { key: 1 }, trans._n('Elapsed time: %1 second', 'Elapsed time: %1 seconds', time))
        ]);
    }
    else {
        // No cell is scheduled, fall back to the status of kernel
        const progress = state.kernelStatus === 'busy' ? 0 : 100;
        const popup = state.kernelStatus === 'busy' || time === 0
            ? []
            : [
                react_index_js_default().createElement("span", { key: 0 }, trans._n('Executed %1 cell', 'Executed %1 cells', scheduledCellNumber)),
                react_index_js_default().createElement("span", { key: 1 }, trans._n('Elapsed time: %1 second', 'Elapsed time: %1 seconds', time))
            ];
        return reactElement(state.kernelStatus, progressBar(progress), popup);
    }
}
/**
 * A VDomRenderer widget for displaying the execution status.
 */
class ExecutionIndicator extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct the kernel status widget.
     */
    constructor(translator, showProgress = true) {
        super(new ExecutionIndicator.Model());
        this.translator = translator || translation_lib_index_js_.nullTranslator;
        this.addClass('jp-mod-highlighted');
    }
    /**
     * Render the execution status item.
     */
    render() {
        if (this.model === null || !this.model.renderFlag) {
            return react_index_js_default().createElement("div", null);
        }
        else {
            const nb = this.model.currentNotebook;
            if (!nb) {
                return (react_index_js_default().createElement(ExecutionIndicatorComponent, { displayOption: this.model.displayOption, state: undefined, translator: this.translator, notebook: undefined }));
            }
            return (react_index_js_default().createElement(ExecutionIndicatorComponent, { displayOption: this.model.displayOption, state: this.model.executionState(nb), translator: this.translator, notebook: nb }));
        }
    }
}
/**
 * A namespace for ExecutionIndicator statics.
 */
(function (ExecutionIndicator) {
    /**
     * A VDomModel for the execution status indicator.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        constructor() {
            super();
            /**
             * A weak map to hold execution status of multiple notebooks.
             */
            this._notebookExecutionProgress = new WeakMap();
            this._displayOption = {
                showOnToolBar: true,
                showProgress: true,
                showJumpToCell: false
            };
            this._renderFlag = true;
        }
        /**
         * Attach a notebook with session context to model in order to keep
         * track of multiple notebooks. If a session context is already
         * attached, only set current activated notebook to input.
         *
         * @param data - The  notebook and session context to be attached to model
         */
        attachNotebook(data) {
            var _a, _b, _c, _d;
            if (data && data.content && data.context) {
                const nb = data.content;
                const context = data.context;
                this._currentNotebook = nb;
                if (!this._notebookExecutionProgress.has(nb)) {
                    this._notebookExecutionProgress.set(nb, {
                        executionStatus: 'idle',
                        kernelStatus: 'idle',
                        totalTime: 0,
                        interval: 0,
                        timeout: 0,
                        scheduledCell: new Set(),
                        scheduledCellNumber: 0,
                        needReset: true
                    });
                    const state = this._notebookExecutionProgress.get(nb);
                    const contextStatusChanged = (ctx) => {
                        if (state) {
                            state.kernelStatus = ctx.kernelDisplayStatus;
                        }
                        this.stateChanged.emit(void 0);
                    };
                    context.statusChanged.connect(contextStatusChanged, this);
                    const contextConnectionStatusChanged = (ctx) => {
                        if (state) {
                            state.kernelStatus = ctx.kernelDisplayStatus;
                        }
                        this.stateChanged.emit(void 0);
                    };
                    context.connectionStatusChanged.connect(contextConnectionStatusChanged, this);
                    context.disposed.connect(ctx => {
                        ctx.connectionStatusChanged.disconnect(contextConnectionStatusChanged, this);
                        ctx.statusChanged.disconnect(contextStatusChanged, this);
                    });
                    const handleKernelMsg = (sender, msg) => {
                        const message = msg.msg;
                        const msgId = message.header.msg_id;
                        if (message.header.msg_type === 'execute_request') {
                            // A cell code is scheduled for executing
                            this._cellScheduledCallback(nb, msgId);
                        }
                        else if (services_lib_index_js_.KernelMessage.isStatusMsg(message) &&
                            message.content.execution_state === 'idle') {
                            // Idle status message case.
                            const parentId = message.parent_header
                                .msg_id;
                            this._cellExecutedCallback(nb, parentId);
                        }
                        else if (services_lib_index_js_.KernelMessage.isStatusMsg(message) &&
                            message.content.execution_state === 'restarting') {
                            this._restartHandler(nb);
                        }
                        else if (message.header.msg_type === 'execute_input') {
                            // A cell code starts executing.
                            this._startTimer(nb);
                        }
                    };
                    (_b = (_a = context.session) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.anyMessage.connect(handleKernelMsg);
                    (_d = (_c = context.session) === null || _c === void 0 ? void 0 : _c.kernel) === null || _d === void 0 ? void 0 : _d.disposed.connect(kernel => kernel.anyMessage.disconnect(handleKernelMsg));
                    const kernelChangedSlot = (_, kernelData) => {
                        if (state) {
                            this._resetTime(state);
                            this.stateChanged.emit(void 0);
                            if (kernelData.newValue) {
                                kernelData.newValue.anyMessage.connect(handleKernelMsg);
                            }
                        }
                    };
                    context.kernelChanged.connect(kernelChangedSlot);
                    context.disposed.connect(ctx => ctx.kernelChanged.disconnect(kernelChangedSlot));
                }
            }
        }
        /**
         * The current activated notebook in model.
         */
        get currentNotebook() {
            return this._currentNotebook;
        }
        /**
         * The display options for progress bar and elapsed time.
         */
        get displayOption() {
            return this._displayOption;
        }
        /**
         * Set the display options for progress bar and elapsed time.
         *
         * @param options - Options to be used
         */
        set displayOption(options) {
            this._displayOption = options;
        }
        /**
         * Get the execution state associated with a notebook.
         *
         * @param nb - The notebook used to identify execution
         * state.
         *
         * @returns - The associated execution state.
         */
        executionState(nb) {
            return this._notebookExecutionProgress.get(nb);
        }
        /**
         * Schedule switch to idle status and clearing of the timer.
         *
         * ### Note
         *
         * To keep track of cells executed under 1 second,
         * the execution state is marked as `needReset` 1 second after executing
         * these cells. This `Timeout` will be cleared if there is any cell
         * scheduled after that.
         */
        _scheduleSwitchToIdle(state) {
            window.setTimeout(() => {
                state.executionStatus = 'idle';
                clearInterval(state.interval);
                this.stateChanged.emit(void 0);
            }, 150);
            state.timeout = window.setTimeout(() => {
                state.needReset = true;
            }, 1000);
        }
        /**
         * The function is called on kernel's idle status message.
         * It is used to keep track of number of executed
         * cells or Comm custom messages and the status of kernel.
         *
         * @param nb - The notebook which contains the executed code cell.
         * @param msg_id - The id of message.
         */
        _cellExecutedCallback(nb, msg_id) {
            const state = this._notebookExecutionProgress.get(nb);
            if (state && state.scheduledCell.has(msg_id)) {
                state.scheduledCell.delete(msg_id);
                if (state.scheduledCell.size === 0) {
                    this._scheduleSwitchToIdle(state);
                }
            }
        }
        /**
         * The function is called on kernel's restarting status message.
         * It is used to clear the state tracking the number of executed
         * cells.
         *
         * @param nb - The notebook which contains the executed code cell.
         */
        _restartHandler(nb) {
            const state = this._notebookExecutionProgress.get(nb);
            if (state) {
                state.scheduledCell.clear();
                this._scheduleSwitchToIdle(state);
            }
        }
        /**
         * This function is called on kernel's `execute_input` message to start
         * the elapsed time counter.
         *
         * @param  nb - The notebook which contains the scheduled execution request.
         */
        _startTimer(nb) {
            const state = this._notebookExecutionProgress.get(nb);
            if (!state) {
                return;
            }
            if (state.scheduledCell.size > 0) {
                if (state.executionStatus !== 'busy') {
                    state.executionStatus = 'busy';
                    clearTimeout(state.timeout);
                    this.stateChanged.emit(void 0);
                    state.interval = window.setInterval(() => {
                        this._tick(state);
                    }, 1000);
                }
            }
            else {
                this._resetTime(state);
            }
        }
        /**
         * The function is called on kernel's `execute_request` message or Comm message, it is
         * used to keep track number of scheduled cell or Comm execution message
         * and the status of kernel.
         *
         * @param  nb - The notebook which contains the scheduled code.
         * cell
         * @param  msg_id - The id of message.
         */
        _cellScheduledCallback(nb, msg_id) {
            const state = this._notebookExecutionProgress.get(nb);
            if (state && !state.scheduledCell.has(msg_id)) {
                if (state.needReset) {
                    this._resetTime(state);
                }
                state.scheduledCell.add(msg_id);
                state.scheduledCellNumber += 1;
            }
        }
        /**
         * Increment the executed time of input execution state
         * and emit `stateChanged` signal to re-render the indicator.
         *
         * @param  data - the state to be updated.
         */
        _tick(data) {
            data.totalTime += 1;
            this.stateChanged.emit(void 0);
        }
        /**
         * Reset the input execution state.
         *
         * @param  data - the state to be rested.
         */
        _resetTime(data) {
            data.totalTime = 0;
            data.scheduledCellNumber = 0;
            data.executionStatus = 'idle';
            data.scheduledCell = new Set();
            clearTimeout(data.timeout);
            clearInterval(data.interval);
            data.needReset = false;
        }
        get renderFlag() {
            return this._renderFlag;
        }
        updateRenderOption(options) {
            if (this.displayOption.showOnToolBar) {
                if (!options.showOnToolBar) {
                    this._renderFlag = false;
                }
                else {
                    this._renderFlag = true;
                }
            }
            this.displayOption.showProgress = options.showProgress;
            this.displayOption.showJumpToCell = options.showJumpToCell;
            this.stateChanged.emit(void 0);
        }
    }
    ExecutionIndicator.Model = Model;
    function createExecutionIndicatorItem(panel, translator, loadSettings) {
        const toolbarItem = new ExecutionIndicator(translator);
        toolbarItem.model.displayOption = {
            showOnToolBar: true,
            showProgress: true,
            showJumpToCell: false
        };
        toolbarItem.model.attachNotebook({
            content: panel.content,
            context: panel.sessionContext
        });
        if (loadSettings) {
            loadSettings
                .then(settings => {
                const updateSettings = (newSettings) => {
                    const displayOptions = getSettingValue(newSettings);
                    // Auto-enable recordTiming if jump button is enabled
                    if (displayOptions.showJumpToCell) {
                        const recordTiming = newSettings.get('recordTiming')
                            .composite;
                        if (!recordTiming) {
                            newSettings.set('recordTiming', true).catch((reason) => {
                                console.error('Failed to auto-enable recordTiming:', reason.message);
                            });
                        }
                    }
                    toolbarItem.model.updateRenderOption(displayOptions);
                };
                settings.changed.connect(updateSettings);
                updateSettings(settings);
                toolbarItem.disposed.connect(() => {
                    settings.changed.disconnect(updateSettings);
                });
            })
                .catch((reason) => {
                console.error(reason.message);
            });
        }
        return toolbarItem;
    }
    ExecutionIndicator.createExecutionIndicatorItem = createExecutionIndicatorItem;
    function getSettingValue(settings) {
        let showOnToolBar = true;
        let showProgress = true;
        let showJumpToCell = false;
        const configValues = settings.get('kernelStatus').composite;
        if (configValues) {
            showOnToolBar = !configValues.showOnStatusBar;
            showProgress = configValues.showProgress;
            showJumpToCell = configValues.showJumpToRecentExecutionButton;
        }
        return { showOnToolBar, showProgress, showJumpToCell };
    }
    ExecutionIndicator.getSettingValue = getSettingValue;
})(ExecutionIndicator || (ExecutionIndicator = {}));
//# sourceMappingURL=executionindicator.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/history.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A console history manager object.
 */
class NotebookHistory {
    /**
     * Construct a new console history object.
     */
    constructor(options) {
        /**
         * The number of history items to increase a batch size by per subsequent request.
         */
        this._requestBatchSize = 10;
        this._cursor = 0;
        this._hasSession = false;
        this._history = [];
        this._placeholder = '';
        this._kernelSession = '';
        this._setByHistory = false;
        this._isDisposed = false;
        this._editor = null;
        this._filtered = [];
        this._kernel = null;
        this._sessionContext = options.sessionContext;
        this._trans = (options.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        void this._handleKernel().then(() => {
            this._sessionContext.kernelChanged.connect(this._handleKernel, this);
        });
        this._toRequest = this._requestBatchSize;
    }
    /**
     * The current editor used by the history manager.
     */
    get editor() {
        return this._editor;
    }
    set editor(value) {
        if (this._editor === value) {
            return;
        }
        const prev = this._editor;
        if (prev) {
            prev.model.sharedModel.changed.disconnect(this.onTextChange, this);
        }
        this._editor = value;
        if (value) {
            value.model.sharedModel.changed.connect(this.onTextChange, this);
        }
    }
    /**
     * The placeholder text that a history session began with.
     */
    get placeholder() {
        return this._placeholder;
    }
    /**
     * Kernel session number for filtering
     */
    get kernelSession() {
        return this._kernelSession;
    }
    /**
     * Get whether the notebook history manager is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the notebook history manager.
     */
    dispose() {
        this._isDisposed = true;
        this._history.length = 0;
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Set placeholder and editor. Start session if one is not already started.
     *
     * @param activeCell - The currently selected Cell in the notebook.
     */
    async checkSession(activeCell) {
        var _a;
        if (!this._hasSession) {
            await this._retrieveHistory();
            this._hasSession = true;
            this.editor = activeCell.editor;
            this._placeholder = ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.model.sharedModel.getSource()) || '';
            // Filter the history with the placeholder string.
            this.setFilter(this._placeholder);
            this._cursor = this._filtered.length - 1;
        }
    }
    /**
     * Get the previous item in the notebook history.
     *
     * @param activeCell - The currently selected Cell in the notebook.
     *
     * @returns A Promise resolving to the historical cell content text.
     */
    async back(activeCell) {
        await this.checkSession(activeCell);
        --this._cursor;
        if (this._cursor < 0) {
            await this.fetchBatch();
        }
        this._cursor = Math.max(0, this._cursor);
        const content = this._filtered[this._cursor];
        // This shouldn't ever be undefined as `setFilter` will always be run first
        return content;
    }
    /**
     * Get the next item in the notebook history.
     *
     * @param activeCell - The currently selected Cell in the notebook.
     *
     * @returns A Promise resolving to the historical cell content text.
     */
    async forward(activeCell) {
        await this.checkSession(activeCell);
        ++this._cursor;
        this._cursor = Math.min(this._filtered.length - 1, this._cursor);
        const content = this._filtered[this._cursor];
        // This shouldn't ever be undefined as `setFilter` will always be run first
        return content;
    }
    /**
     * Update the editor of the cell with provided text content.
     *
     * @param activeCell - The currently selected Cell in the notebook.
     * @param content - the result from back or forward
     */
    updateEditor(activeCell, content) {
        var _a, _b;
        if (activeCell) {
            const model = (_a = activeCell.editor) === null || _a === void 0 ? void 0 : _a.model;
            const source = model === null || model === void 0 ? void 0 : model.sharedModel.getSource();
            if (this.isDisposed || !content) {
                return;
            }
            if (source === content) {
                return;
            }
            this._setByHistory = true;
            model === null || model === void 0 ? void 0 : model.sharedModel.setSource(content);
            let columnPos = 0;
            columnPos = content.indexOf('\n');
            if (columnPos < 0) {
                columnPos = content.length;
            }
            (_b = activeCell.editor) === null || _b === void 0 ? void 0 : _b.setCursorPosition({ line: 0, column: columnPos });
        }
    }
    /**
     * Reset the history navigation state, i.e., start a new history session.
     */
    reset() {
        this._hasSession = false;
        this._placeholder = '';
        this._toRequest = this._requestBatchSize;
    }
    /**
     * Fetches a subsequent batch of history. Updates the filtered history and cursor to correct place in history,
     * accounting for potentially new history items above it.
     */
    async fetchBatch() {
        this._toRequest += this._requestBatchSize;
        let oldFilteredReversed = this._filtered.slice().reverse();
        let oldHistory = this._history.slice();
        await this._retrieveHistory().then(() => {
            this.setFilter(this._placeholder);
            let cursorOffset = 0;
            let filteredReversed = this._filtered.slice().reverse();
            for (let i = 0; i < oldFilteredReversed.length; i++) {
                let item = oldFilteredReversed[i];
                for (let ij = i + cursorOffset; ij < filteredReversed.length; ij++) {
                    if (item === filteredReversed[ij]) {
                        break;
                    }
                    else {
                        cursorOffset += 1;
                    }
                }
            }
            this._cursor =
                this._filtered.length - (oldFilteredReversed.length + 1) - cursorOffset;
        });
        if (this._cursor < 0) {
            if (this._history.length > oldHistory.length) {
                await this.fetchBatch();
            }
        }
    }
    /**
     * Populate the history collection on history reply from a kernel.
     *
     * @param value The kernel message history reply.
     *
     * #### Notes
     * History entries have the shape:
     * [session: number, line: number, input: string]
     * Contiguous duplicates are stripped out of the API response.
     */
    onHistory(value, cell) {
        this._history.length = 0;
        let last = ['', '', ''];
        let current = ['', '', ''];
        let kernelSession = '';
        if (value.content.status === 'ok') {
            for (let i = 0; i < value.content.history.length; i++) {
                current = value.content.history[i];
                if (current !== last) {
                    kernelSession = value.content.history[i][0];
                    this._history.push((last = current));
                }
            }
            // set the kernel session for filtering
            if (!this.kernelSession) {
                if (current[2] == (cell === null || cell === void 0 ? void 0 : cell.model.sharedModel.getSource())) {
                    this._kernelSession = kernelSession;
                }
            }
        }
    }
    /**
     * Handle a text change signal from the editor.
     */
    onTextChange() {
        if (this._setByHistory) {
            this._setByHistory = false;
            return;
        }
        this.reset();
    }
    /**
     * Handle the current kernel changing.
     */
    async _handleKernel() {
        var _a;
        this._kernel = (_a = this._sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!this._kernel) {
            this._history.length = 0;
            return;
        }
        await this._retrieveHistory().catch();
        return;
    }
    /**
     * retrieve the history from the kernel
     *
     * @param cell - The string to use when filtering the data.
     */
    async _retrieveHistory(cell) {
        var _a;
        return await ((_a = this._kernel) === null || _a === void 0 ? void 0 : _a.requestHistory(request(this._toRequest)).then(v => {
            this.onHistory(v, cell);
        }).catch(() => {
            console.warn(this._trans.__('History was unable to be retrieved'));
        }));
    }
    /**
     * Set the filter data.
     *
     * @param filterStr - The string to use when filtering the data.
     */
    setFilter(filterStr = '') {
        // Apply the new filter and remove contiguous duplicates.
        this._filtered.length = 0;
        let last = '';
        let current = '';
        for (let i = 0; i < this._history.length; i++) {
            current = this._history[i][2];
            if (current !== last && filterStr !== current) {
                this._filtered.push((last = current));
            }
        }
        this._filtered.push(filterStr);
    }
}
function request(n) {
    return {
        output: false,
        raw: true,
        hist_access_type: 'tail',
        n: n
    };
}
//# sourceMappingURL=history.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/nbformat@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/nbformat/lib/index.js)
var nbformat_lib_index_js_ = __webpack_require__(74702);
// EXTERNAL MODULE: consume shared module (default) @jupyter/ydoc@~3.1.0 (singleton) (fallback: ../node_modules/@jupyter/ydoc/lib/index.js)
var ydoc_lib_index_js_ = __webpack_require__(88162);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * An implementation of a notebook Model.
 */
class NotebookModel {
    /**
     * Construct a new notebook model.
     */
    constructor(options = {}) {
        var _a, _b;
        /**
         * Whether the model should disposed the shared model on disposal or not.
         */
        this.standaloneModel = false;
        this._dirty = false;
        this._readOnly = false;
        this._contentChanged = new dist_index_es6_js_.Signal(this);
        this._stateChanged = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._metadataChanged = new dist_index_es6_js_.Signal(this);
        this.standaloneModel = typeof options.sharedModel === 'undefined';
        if (options.sharedModel) {
            this.sharedModel = options.sharedModel;
        }
        else {
            this.sharedModel = ydoc_lib_index_js_.YNotebook.create({
                disableDocumentWideUndoRedo: (_a = options.disableDocumentWideUndoRedo) !== null && _a !== void 0 ? _a : true,
                data: {
                    nbformat: nbformat_lib_index_js_.MAJOR_VERSION,
                    nbformat_minor: nbformat_lib_index_js_.MINOR_VERSION,
                    metadata: {
                        kernelspec: { name: '', display_name: '' },
                        language_info: { name: (_b = options.languagePreference) !== null && _b !== void 0 ? _b : '' }
                    }
                }
            });
        }
        this._cells = new CellList(this.sharedModel);
        this._trans = (options.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this._deletedCells = [];
        this._collaborationEnabled = !!(options === null || options === void 0 ? void 0 : options.collaborationEnabled);
        this._cells.changed.connect(this._onCellsChanged, this);
        this.sharedModel.changed.connect(this._onStateChanged, this);
        this.sharedModel.metadataChanged.connect(this._onMetadataChanged, this);
    }
    /**
     * A signal emitted when the document content changes.
     */
    get contentChanged() {
        return this._contentChanged;
    }
    /**
     * Signal emitted when notebook metadata changes.
     */
    get metadataChanged() {
        return this._metadataChanged;
    }
    /**
     * A signal emitted when the document state changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * Get the observable list of notebook cells.
     */
    get cells() {
        return this._cells;
    }
    /**
     * The dirty state of the document.
     */
    get dirty() {
        return this._dirty;
    }
    set dirty(newValue) {
        const oldValue = this._dirty;
        if (newValue === oldValue) {
            return;
        }
        this._dirty = newValue;
        this.triggerStateChange({
            name: 'dirty',
            oldValue,
            newValue
        });
    }
    /**
     * The read only state of the document.
     */
    get readOnly() {
        return this._readOnly;
    }
    set readOnly(newValue) {
        if (newValue === this._readOnly) {
            return;
        }
        const oldValue = this._readOnly;
        this._readOnly = newValue;
        this.triggerStateChange({ name: 'readOnly', oldValue, newValue });
    }
    /**
     * The metadata associated with the notebook.
     *
     * ### Notes
     * This is a copy of the metadata. Changing a part of it
     * won't affect the model.
     * As this returns a copy of all metadata, it is advised to
     * use `getMetadata` to speed up the process of getting a single key.
     */
    get metadata() {
        return this.sharedModel.metadata;
    }
    /**
     * The major version number of the nbformat.
     */
    get nbformat() {
        return this.sharedModel.nbformat;
    }
    /**
     * The minor version number of the nbformat.
     */
    get nbformatMinor() {
        return this.sharedModel.nbformat_minor;
    }
    /**
     * The default kernel name of the document.
     */
    get defaultKernelName() {
        var _a;
        const spec = this.getMetadata('kernelspec');
        return (_a = spec === null || spec === void 0 ? void 0 : spec.name) !== null && _a !== void 0 ? _a : '';
    }
    /**
     * A list of deleted cells for the notebook..
     */
    get deletedCells() {
        return this._deletedCells;
    }
    /**
     * The default kernel language of the document.
     */
    get defaultKernelLanguage() {
        var _a;
        const info = this.getMetadata('language_info');
        return (_a = info === null || info === void 0 ? void 0 : info.name) !== null && _a !== void 0 ? _a : '';
    }
    /**
     * Whether the model is collaborative or not.
     */
    get collaborative() {
        return this._collaborationEnabled;
    }
    /**
     * Dispose of the resources held by the model.
     */
    dispose() {
        // Do nothing if already disposed.
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        const cells = this.cells;
        this._cells = null;
        cells.dispose();
        if (this.standaloneModel) {
            this.sharedModel.dispose();
        }
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Delete a metadata
     *
     * @param key Metadata key
     */
    deleteMetadata(key) {
        return this.sharedModel.deleteMetadata(key);
    }
    /**
     * Get a metadata
     *
     * ### Notes
     * This returns a copy of the key value.
     *
     * @param key Metadata key
     */
    getMetadata(key) {
        return this.sharedModel.getMetadata(key);
    }
    /**
     * Set a metadata
     *
     * @param key Metadata key
     * @param value Metadata value
     */
    setMetadata(key, value) {
        if (typeof value === 'undefined') {
            this.sharedModel.deleteMetadata(key);
        }
        else {
            this.sharedModel.setMetadata(key, value);
        }
    }
    /**
     * Serialize the model to a string.
     */
    toString() {
        return JSON.stringify(this.toJSON());
    }
    /**
     * Deserialize the model from a string.
     *
     * #### Notes
     * Should emit a [contentChanged] signal.
     */
    fromString(value) {
        this.fromJSON(JSON.parse(value));
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        this._ensureMetadata();
        return this.sharedModel.toJSON();
    }
    /**
     * Deserialize the model from JSON.
     *
     * #### Notes
     * Should emit a [contentChanged] signal.
     */
    fromJSON(value) {
        var _a, _b;
        const copy = dist_index_js_.JSONExt.deepCopy(value);
        const origNbformat = value.metadata.orig_nbformat;
        // Alert the user if the format changes.
        copy.nbformat = Math.max(value.nbformat, nbformat_lib_index_js_.MAJOR_VERSION);
        if (copy.nbformat !== value.nbformat ||
            copy.nbformat_minor < nbformat_lib_index_js_.MINOR_VERSION) {
            copy.nbformat_minor = nbformat_lib_index_js_.MINOR_VERSION;
        }
        if (origNbformat !== undefined && copy.nbformat !== origNbformat) {
            const newer = copy.nbformat > origNbformat;
            let msg;
            if (newer) {
                msg = this._trans.__(`This notebook has been converted from an older notebook format (v%1)
to the current notebook format (v%2).
The next time you save this notebook, the current notebook format (v%2) will be used.
'Older versions of Jupyter may not be able to read the new format.' To preserve the original format version,
close the notebook without saving it.`, origNbformat, copy.nbformat);
            }
            else {
                msg = this._trans.__(`This notebook has been converted from an newer notebook format (v%1)
to the current notebook format (v%2).
The next time you save this notebook, the current notebook format (v%2) will be used.
Some features of the original notebook may not be available.' To preserve the original format version,
close the notebook without saving it.`, origNbformat, copy.nbformat);
            }
            void (0,index_js_.showDialog)({
                title: this._trans.__('Notebook converted'),
                body: msg,
                buttons: [index_js_.Dialog.okButton({ label: this._trans.__('Ok') })]
            });
        }
        // Ensure there is at least one cell
        if (((_b = (_a = copy.cells) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0) {
            copy['cells'] = [
                { cell_type: 'code', source: '', metadata: { trusted: true } }
            ];
        }
        this.sharedModel.fromJSON(copy);
        this._ensureMetadata();
        this.dirty = true;
    }
    /**
     * Handle a change in the cells list.
     */
    _onCellsChanged(list, change) {
        switch (change.type) {
            case 'add':
                change.newValues.forEach(cell => {
                    cell.contentChanged.connect(this.triggerContentChange, this);
                });
                break;
            case 'remove':
                break;
            case 'clear':
                break;
            case 'set':
                change.newValues.forEach(cell => {
                    cell.contentChanged.connect(this.triggerContentChange, this);
                });
                break;
            default:
                break;
        }
        this.triggerContentChange();
    }
    _onMetadataChanged(sender, changes) {
        this._metadataChanged.emit(changes);
        this.triggerContentChange();
    }
    _onStateChanged(sender, changes) {
        if (changes.stateChange) {
            changes.stateChange.forEach(value => {
                if (value.name === 'dirty') {
                    // Setting `dirty` will trigger the state change.
                    // We always set `dirty` because the shared model state
                    // and the local attribute are synchronized one way shared model -> _dirty
                    this.dirty = value.newValue;
                }
                else if (value.oldValue !== value.newValue) {
                    this.triggerStateChange({
                        newValue: undefined,
                        oldValue: undefined,
                        ...value
                    });
                }
            });
        }
    }
    /**
     * Make sure we have the required metadata fields.
     */
    _ensureMetadata(languageName = '') {
        if (!this.getMetadata('language_info')) {
            this.sharedModel.setMetadata('language_info', { name: languageName });
        }
        if (!this.getMetadata('kernelspec')) {
            this.sharedModel.setMetadata('kernelspec', {
                name: '',
                display_name: ''
            });
        }
    }
    /**
     * Trigger a state change signal.
     */
    triggerStateChange(args) {
        this._stateChanged.emit(args);
    }
    /**
     * Trigger a content changed signal.
     */
    triggerContentChange() {
        this._contentChanged.emit(void 0);
        this.dirty = true;
    }
    /**
     * Whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
}
//# sourceMappingURL=model.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/modelfactory.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A model factory for notebooks.
 */
class NotebookModelFactory {
    /**
     * Construct a new notebook model factory.
     */
    constructor(options = {}) {
        var _a, _b;
        this._disposed = false;
        this._disableDocumentWideUndoRedo =
            (_a = options.disableDocumentWideUndoRedo) !== null && _a !== void 0 ? _a : true;
        this._collaborative = (_b = options.collaborative) !== null && _b !== void 0 ? _b : true;
    }
    /**
     * Define the disableDocumentWideUndoRedo property.
     *
     * @experimental
     * @alpha
     */
    get disableDocumentWideUndoRedo() {
        return this._disableDocumentWideUndoRedo;
    }
    set disableDocumentWideUndoRedo(disableDocumentWideUndoRedo) {
        this._disableDocumentWideUndoRedo = disableDocumentWideUndoRedo;
    }
    /**
     * The name of the model.
     */
    get name() {
        return 'notebook';
    }
    /**
     * The content type of the file.
     */
    get contentType() {
        return 'notebook';
    }
    /**
     * The format of the file.
     */
    get fileFormat() {
        return 'json';
    }
    /**
     * Whether the model is collaborative or not.
     */
    get collaborative() {
        return this._collaborative;
    }
    /**
     * Get whether the model factory has been disposed.
     */
    get isDisposed() {
        return this._disposed;
    }
    /**
     * Dispose of the model factory.
     */
    dispose() {
        this._disposed = true;
    }
    /**
     * Create a new model for a given path.
     *
     * @param options Model options.
     *
     * @returns A new document model.
     */
    createNew(options = {}) {
        return new NotebookModel({
            languagePreference: options.languagePreference,
            sharedModel: options.sharedModel,
            collaborationEnabled: options.collaborationEnabled && this.collaborative,
            disableDocumentWideUndoRedo: this._disableDocumentWideUndoRedo
        });
    }
    /**
     * Get the preferred kernel language given a path.
     */
    preferredLanguage(path) {
        return '';
    }
}
//# sourceMappingURL=modelfactory.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/modestatus.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




/**
 * A pure function for rendering a Command/Edit mode component.
 *
 * @param props the props for rendering the component.
 *
 * @returns a tsx component for command/edit mode.
 */
function CommandEditComponent(props) {
    const trans = (props.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
    return (react_index_js_.createElement(statusbar_lib_index_js_.TextItem, { source: trans.__('Mode: %1', props.modeNames[props.notebookMode]) }));
}
/**
 * StatusBar item to display which notebook mode user is in.
 */
class CommandEditStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct a new CommandEdit status item.
     */
    constructor(translator) {
        super(new CommandEditStatus.Model());
        this.translator = translator || translation_lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        this._modeNames = {
            command: this._trans.__('Command'),
            edit: this._trans.__('Edit')
        };
    }
    /**
     * Render the CommandEdit status item.
     */
    render() {
        if (!this.model) {
            return null;
        }
        this.node.title = this._trans.__('Notebook is in %1 mode', this._modeNames[this.model.notebookMode]);
        return (react_index_js_.createElement(CommandEditComponent, { notebookMode: this.model.notebookMode, translator: this.translator, modeNames: this._modeNames }));
    }
}
/**
 * A namespace for CommandEdit statics.
 */
(function (CommandEditStatus) {
    /**
     * A VDomModel for the CommandEdit renderer.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        constructor() {
            super(...arguments);
            /**
             * On a change to the notebook, update the mode.
             */
            this._onChanged = (_notebook) => {
                const oldMode = this._notebookMode;
                if (this._notebook) {
                    this._notebookMode = _notebook.mode;
                }
                else {
                    this._notebookMode = 'command';
                }
                this._triggerChange(oldMode, this._notebookMode);
            };
            this._notebookMode = 'command';
            this._notebook = null;
        }
        /**
         * The current mode of the current notebook.
         */
        get notebookMode() {
            return this._notebookMode;
        }
        /**
         * Set the current notebook for the model.
         */
        set notebook(notebook) {
            const oldNotebook = this._notebook;
            if (oldNotebook !== null) {
                oldNotebook.stateChanged.disconnect(this._onChanged, this);
                oldNotebook.activeCellChanged.disconnect(this._onChanged, this);
                oldNotebook.modelContentChanged.disconnect(this._onChanged, this);
            }
            const oldMode = this._notebookMode;
            this._notebook = notebook;
            if (this._notebook === null) {
                this._notebookMode = 'command';
            }
            else {
                this._notebookMode = this._notebook.mode;
                this._notebook.stateChanged.connect(this._onChanged, this);
                this._notebook.activeCellChanged.connect(this._onChanged, this);
                this._notebook.modelContentChanged.connect(this._onChanged, this);
            }
            this._triggerChange(oldMode, this._notebookMode);
        }
        /**
         * Trigger a state change for the renderer.
         */
        _triggerChange(oldState, newState) {
            if (oldState !== newState) {
                this.stateChanged.emit(void 0);
            }
        }
    }
    CommandEditStatus.Model = Model;
})(CommandEditStatus || (CommandEditStatus = {}));
//# sourceMappingURL=modestatus.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/lsp@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/lsp/lib/index.js)
var lsp_lib_index_js_ = __webpack_require__(84259);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/notebooklspadapter.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




class NotebookAdapter extends lsp_lib_index_js_.WidgetLSPAdapter {
    constructor(editorWidget, options) {
        super(editorWidget, options);
        this.editorWidget = editorWidget;
        this.options = options;
        this._type = 'code';
        this._readyDelegate = new dist_index_js_.PromiseDelegate();
        this._editorToCell = new Map();
        this.editor = editorWidget.content;
        this._cellToEditor = new WeakMap();
        this.isReady = this.isReady.bind(this);
        Promise.all([
            this.widget.context.sessionContext.ready,
            this.connectionManager.ready
        ])
            .then(async () => {
            await this.initOnceReady();
            this._readyDelegate.resolve();
        })
            .catch(console.error);
    }
    /**
     * Get current path of the document.
     */
    get documentPath() {
        return this.widget.context.path;
    }
    /**
     * Get the mime type of the document.
     */
    get mimeType() {
        var _a;
        let mimeType;
        let languageMetadata = this.language_info();
        if (!languageMetadata || !languageMetadata.mimetype) {
            // fallback to the code cell mime type if no kernel in use
            mimeType = this.widget.content.codeMimetype;
        }
        else {
            mimeType = languageMetadata.mimetype;
        }
        return Array.isArray(mimeType)
            ? (_a = mimeType[0]) !== null && _a !== void 0 ? _a : codeeditor_lib_index_js_.IEditorMimeTypeService.defaultMimeType
            : mimeType;
    }
    /**
     * Get the file extension of the document.
     */
    get languageFileExtension() {
        let languageMetadata = this.language_info();
        if (!languageMetadata || !languageMetadata.file_extension) {
            return;
        }
        return languageMetadata.file_extension.replace('.', '');
    }
    /**
     * Get the inner HTMLElement of the document widget.
     */
    get wrapperElement() {
        return this.widget.node;
    }
    /**
     *  Get the list of CM editor with its type in the document,
     */
    get editors() {
        if (this.isDisposed) {
            return [];
        }
        let notebook = this.widget.content;
        this._editorToCell.clear();
        if (notebook.isDisposed) {
            return [];
        }
        return notebook.widgets.map(cell => {
            return {
                ceEditor: this._getCellEditor(cell),
                type: cell.model.type,
                value: cell.model.sharedModel.getSource()
            };
        });
    }
    /**
     * Get the activated CM editor.
     */
    get activeEditor() {
        return this.editor.activeCell
            ? this._getCellEditor(this.editor.activeCell)
            : undefined;
    }
    /**
     * Promise that resolves once the adapter is initialized
     */
    get ready() {
        return this._readyDelegate.promise;
    }
    /**
     * Get the index of editor from the cursor position in the virtual
     * document.
     * @deprecated This is error-prone and will be removed in JupyterLab 5.0, use `getEditorIndex()` with `virtualDocument.getEditorAtVirtualLine(position)` instead.
     *
     * @param position - the position of cursor in the virtual document.
     */
    getEditorIndexAt(position) {
        let cell = this._getCellAt(position);
        let notebook = this.widget.content;
        return notebook.widgets.findIndex(otherCell => {
            return cell === otherCell;
        });
    }
    /**
     * Get the index of input editor
     *
     * @param ceEditor - instance of the code editor
     */
    getEditorIndex(ceEditor) {
        let cell = this._editorToCell.get(ceEditor);
        return this.editor.widgets.findIndex(otherCell => {
            return cell === otherCell;
        });
    }
    /**
     * Get the wrapper of input editor.
     *
     * @param ceEditor - instance of the code editor
     */
    getEditorWrapper(ceEditor) {
        let cell = this._editorToCell.get(ceEditor);
        return cell.node;
    }
    /**
     * Callback on kernel changed event, it will disconnect the
     * document with the language server and then reconnect.
     *
     * @param _session - Session context of changed kernel
     * @param change - Changed data
     */
    async onKernelChanged(_session, change) {
        if (!change.newValue) {
            return;
        }
        try {
            // note: we need to wait until ready before updating language info
            const oldLanguageInfo = this._languageInfo;
            await (0,lsp_lib_index_js_.untilReady)(this.isReady, -1);
            await this._updateLanguageInfo();
            const newLanguageInfo = this._languageInfo;
            if ((oldLanguageInfo === null || oldLanguageInfo === void 0 ? void 0 : oldLanguageInfo.name) != newLanguageInfo.name ||
                (oldLanguageInfo === null || oldLanguageInfo === void 0 ? void 0 : oldLanguageInfo.mimetype) != (newLanguageInfo === null || newLanguageInfo === void 0 ? void 0 : newLanguageInfo.mimetype) ||
                (oldLanguageInfo === null || oldLanguageInfo === void 0 ? void 0 : oldLanguageInfo.file_extension) != (newLanguageInfo === null || newLanguageInfo === void 0 ? void 0 : newLanguageInfo.file_extension)) {
                console.log(`Changed to ${this._languageInfo.name} kernel, reconnecting`);
                this.reloadConnection();
            }
            else {
                console.log('Keeping old LSP connection as the new kernel uses the same language');
            }
        }
        catch (err) {
            console.warn(err);
            // try to reconnect anyway
            this.reloadConnection();
        }
    }
    /**
     * Dispose the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.widget.context.sessionContext.kernelChanged.disconnect(this.onKernelChanged, this);
        this.widget.content.activeCellChanged.disconnect(this._activeCellChanged, this);
        super.dispose();
        // editors are needed for the parent dispose() to unbind signals, so they are the last to go
        this._editorToCell.clear();
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Method to check if the notebook context is ready.
     */
    isReady() {
        var _a;
        return (!this.widget.isDisposed &&
            this.widget.context.isReady &&
            this.widget.content.isVisible &&
            this.widget.content.widgets.length > 0 &&
            ((_a = this.widget.context.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel) != null);
    }
    /**
     * Update the virtual document on cell changing event.
     *
     * @param cells - Observable list of changed cells
     * @param change - Changed data
     */
    async handleCellChange(cells, change) {
        let cellsAdded = [];
        let cellsRemoved = [];
        const type = this._type;
        if (change.type === 'set') {
            // handling of conversions is important, because the editors get re-used and their handlers inherited,
            // so we need to clear our handlers from editors of e.g. markdown cells which previously were code cells.
            let convertedToMarkdownOrRaw = [];
            let convertedToCode = [];
            if (change.newValues.length === change.oldValues.length) {
                // during conversion the cells should not get deleted nor added
                for (let i = 0; i < change.newValues.length; i++) {
                    if (change.oldValues[i].type === type &&
                        change.newValues[i].type !== type) {
                        convertedToMarkdownOrRaw.push(change.newValues[i]);
                    }
                    else if (change.oldValues[i].type !== type &&
                        change.newValues[i].type === type) {
                        convertedToCode.push(change.newValues[i]);
                    }
                }
                cellsAdded = convertedToCode;
                cellsRemoved = convertedToMarkdownOrRaw;
            }
        }
        else if (change.type == 'add') {
            cellsAdded = change.newValues.filter(cellModel => cellModel.type === type);
        }
        // note: editorRemoved is not emitted for removal of cells by change of type 'remove' (but only during cell type conversion)
        // because there is no easy way to get the widget associated with the removed cell(s) - because it is no
        // longer in the notebook widget list! It would need to be tracked on our side, but it is not necessary
        // as (except for a tiny memory leak) it should not impact the functionality in any way
        if (cellsRemoved.length ||
            cellsAdded.length ||
            change.type === 'set' ||
            change.type === 'move' ||
            change.type === 'remove' ||
            change.type === 'clear') {
            // in contrast to the file editor document which can be only changed by the modification of the editor content,
            // the notebook document can also get modified by a change in the number or arrangement of editors themselves;
            // for this reason each change has to trigger documents update (so that LSP mirror is in sync).
            await this.updateDocuments();
        }
        for (let cellModel of cellsAdded) {
            let cellWidget = this.widget.content.widgets.find(cell => cell.model.id === cellModel.id);
            if (!cellWidget) {
                console.warn(`Widget for added cell with ID: ${cellModel.id} not found!`);
                continue;
            }
            // Add editor to the mapping if needed
            this._getCellEditor(cellWidget);
        }
    }
    /**
     * Generate the virtual document associated with the document.
     */
    createVirtualDocument() {
        return new lsp_lib_index_js_.VirtualDocument({
            language: this.language,
            foreignCodeExtractors: this.options.foreignCodeExtractorsManager,
            path: this.documentPath,
            fileExtension: this.languageFileExtension,
            // notebooks are continuous, each cell is dependent on the previous one
            standalone: false,
            // notebooks are not supported by LSP servers
            hasLspSupportedFile: false
        });
    }
    /**
     * Get the metadata of notebook.
     */
    language_info() {
        return this._languageInfo;
    }
    /**
     * Initialization function called once the editor and the LSP connection
     * manager is ready. This function will create the virtual document and
     * connect various signals.
     */
    async initOnceReady() {
        await (0,lsp_lib_index_js_.untilReady)(this.isReady.bind(this), -1);
        await this._updateLanguageInfo();
        this.initVirtual();
        // connect the document, but do not open it as the adapter will handle this
        // after registering all features
        this.connectDocument(this.virtualDocument, false).catch(console.warn);
        this.widget.context.sessionContext.kernelChanged.connect(this.onKernelChanged, this);
        this.widget.content.activeCellChanged.connect(this._activeCellChanged, this);
        this._connectModelSignals(this.widget);
        this.editor.modelChanged.connect(notebook => {
            // note: this should not usually happen;
            // there is no default action that would trigger this,
            // its just a failsafe in case if another extension decides
            // to swap the notebook model
            console.warn('Model changed, connecting cell change handler; this is not something we were expecting');
            this._connectModelSignals(notebook);
        });
    }
    /**
     * Connect the cell changed event to its handler
     *
     * @param  notebook - The notebook that emitted event.
     */
    _connectModelSignals(notebook) {
        if (notebook.model === null) {
            console.warn(`Model is missing for notebook ${notebook}, cannot connect cell changed signal!`);
        }
        else {
            notebook.model.cells.changed.connect(this.handleCellChange, this);
        }
    }
    /**
     * Update the stored language info with the one from the notebook.
     */
    async _updateLanguageInfo() {
        var _a, _b, _c, _d;
        const language_info = (_d = (await ((_c = (_b = (_a = this.widget.context.sessionContext) === null || _a === void 0 ? void 0 : _a.session) === null || _b === void 0 ? void 0 : _b.kernel) === null || _c === void 0 ? void 0 : _c.info))) === null || _d === void 0 ? void 0 : _d.language_info;
        if (language_info) {
            this._languageInfo = language_info;
        }
        else {
            throw new Error('Language info update failed (no session, kernel, or info available)');
        }
    }
    /**
     * Handle the cell changed event
     * @param  notebook - The notebook that emitted event
     * @param cell - Changed cell.
     */
    _activeCellChanged(notebook, cell) {
        if (!cell || cell.model.type !== this._type) {
            return;
        }
        this._activeEditorChanged.emit({
            editor: this._getCellEditor(cell)
        });
    }
    /**
     * Get the cell at the cursor position of the virtual document.
     * @param  pos - Position in the virtual document.
     */
    _getCellAt(pos) {
        let editor = this.virtualDocument.getEditorAtVirtualLine(pos);
        return this._editorToCell.get(editor);
    }
    /**
     * Get the cell editor and add new ones to the mappings.
     *
     * @param cell Cell widget
     * @returns Cell editor accessor
     */
    _getCellEditor(cell) {
        if (!this._cellToEditor.has(cell)) {
            const editor = Object.freeze({
                getEditor: () => cell.editor,
                ready: async () => {
                    await cell.ready;
                    return cell.editor;
                },
                reveal: async () => {
                    await this.editor.scrollToCell(cell);
                    return cell.editor;
                }
            });
            this._cellToEditor.set(cell, editor);
            this._editorToCell.set(editor, cell);
            cell.disposed.connect(() => {
                this._cellToEditor.delete(cell);
                this._editorToCell.delete(editor);
                this._editorRemoved.emit({
                    editor
                });
            });
            this._editorAdded.emit({
                editor
            });
        }
        return this._cellToEditor.get(cell);
    }
}
//# sourceMappingURL=notebooklspadapter.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var observables_lib_index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/notebooktools.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







class RankedPanel extends widgets_dist_index_es6_js_.Widget {
    constructor() {
        super();
        this._items = [];
        this.layout = new widgets_dist_index_es6_js_.PanelLayout();
        this.addClass('jp-RankedPanel');
    }
    addWidget(widget, rank) {
        const rankItem = { widget, rank };
        const index = index_es6_js_.ArrayExt.upperBound(this._items, rankItem, notebooktools_Private.itemCmp);
        index_es6_js_.ArrayExt.insert(this._items, index, rankItem);
        const layout = this.layout;
        layout.insertWidget(index, widget);
    }
    /**
     * Handle the removal of a child
     *
     */
    onChildRemoved(msg) {
        const index = index_es6_js_.ArrayExt.findFirstIndex(this._items, item => item.widget === msg.child);
        if (index !== -1) {
            index_es6_js_.ArrayExt.removeAt(this._items, index);
        }
    }
}
/**
 * A widget that provides metadata tools.
 */
class NotebookTools extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new NotebookTools object.
     */
    constructor(options) {
        super();
        this.addClass('jp-NotebookTools');
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this._tools = [];
        this.layout = new widgets_dist_index_es6_js_.PanelLayout();
        this._tracker = options.tracker;
        this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged, this);
        this._tracker.activeCellChanged.connect(this._onActiveCellChanged, this);
        this._tracker.selectionChanged.connect(this._onSelectionChanged, this);
        this._onActiveNotebookPanelChanged();
        this._onActiveCellChanged();
        this._onSelectionChanged();
    }
    /**
     * The active cell widget.
     */
    get activeCell() {
        return this._tracker.activeCell;
    }
    /**
     * The currently selected cells.
     */
    get selectedCells() {
        const panel = this._tracker.currentWidget;
        if (!panel) {
            return [];
        }
        const notebook = panel.content;
        return notebook.widgets.filter(cell => notebook.isSelectedOrActive(cell));
    }
    /**
     * The current notebook.
     */
    get activeNotebookPanel() {
        return this._tracker.currentWidget;
    }
    /**
     * Add a cell tool item.
     */
    addItem(options) {
        var _a;
        const tool = options.tool;
        const rank = (_a = options.rank) !== null && _a !== void 0 ? _a : 100;
        let section;
        const extendedTool = this._tools.find(extendedTool => extendedTool.section === options.section);
        if (extendedTool)
            section = extendedTool.panel;
        else {
            throw new Error(`The section ${options.section} does not exist`);
        }
        tool.addClass('jp-NotebookTools-tool');
        section.addWidget(tool, rank);
        // TODO: perhaps the necessary notebookTools functionality should be
        // consolidated into a single object, rather than a broad reference to this.
        tool.notebookTools = this;
        // Trigger the tool to update its active notebook and cell.
        messaging_dist_index_es6_js_.MessageLoop.sendMessage(tool, NotebookTools.ActiveNotebookPanelMessage);
        messaging_dist_index_es6_js_.MessageLoop.sendMessage(tool, NotebookTools.ActiveCellMessage);
    }
    /*
     * Add a section to the notebook tool with its widget
     */
    addSection(options) {
        var _a;
        const sectionName = options.sectionName;
        const label = options.label || options.sectionName;
        const widget = options.tool;
        let rank = (_a = options.rank) !== null && _a !== void 0 ? _a : null;
        const newSection = new RankedPanel();
        newSection.title.label = label;
        if (widget)
            newSection.addWidget(widget, 0);
        this._tools.push({
            section: sectionName,
            panel: newSection,
            rank: rank
        });
        if (rank != null)
            this.layout.insertWidget(rank, new ui_components_lib_index_js_.Collapser({ widget: newSection }));
        else {
            // If no rank is provided, try to add the new section before the AdvancedTools.
            let advancedToolsRank = null;
            const layout = this.layout;
            for (let i = 0; i < layout.widgets.length; i++) {
                let w = layout.widgets[i];
                if (w instanceof ui_components_lib_index_js_.Collapser) {
                    if (w.widget.id === 'advancedToolsSection') {
                        advancedToolsRank = i;
                        break;
                    }
                }
            }
            if (advancedToolsRank !== null)
                this.layout.insertWidget(advancedToolsRank, new ui_components_lib_index_js_.Collapser({ widget: newSection }));
            else
                this.layout.addWidget(new ui_components_lib_index_js_.Collapser({ widget: newSection }));
        }
    }
    /**
     * Handle a change to the notebook panel.
     */
    _onActiveNotebookPanelChanged() {
        if (this._prevActiveNotebookModel &&
            !this._prevActiveNotebookModel.isDisposed) {
            this._prevActiveNotebookModel.metadataChanged.disconnect(this._onActiveNotebookPanelMetadataChanged, this);
        }
        const activeNBModel = this.activeNotebookPanel && this.activeNotebookPanel.content
            ? this.activeNotebookPanel.content.model
            : null;
        this._prevActiveNotebookModel = activeNBModel;
        if (activeNBModel) {
            activeNBModel.metadataChanged.connect(this._onActiveNotebookPanelMetadataChanged, this);
        }
        for (const widget of this._toolChildren()) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, NotebookTools.ActiveNotebookPanelMessage);
        }
    }
    /**
     * Handle a change to the active cell.
     */
    _onActiveCellChanged() {
        if (this._prevActiveCell && !this._prevActiveCell.isDisposed) {
            this._prevActiveCell.metadataChanged.disconnect(this._onActiveCellMetadataChanged, this);
        }
        const activeCell = this.activeCell ? this.activeCell.model : null;
        this._prevActiveCell = activeCell;
        if (activeCell) {
            activeCell.metadataChanged.connect(this._onActiveCellMetadataChanged, this);
        }
        for (const widget of this._toolChildren()) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, NotebookTools.ActiveCellMessage);
        }
    }
    /**
     * Handle a change in the selection.
     */
    _onSelectionChanged() {
        for (const widget of this._toolChildren()) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, NotebookTools.SelectionMessage);
        }
    }
    /**
     * Handle a change in the active cell metadata.
     */
    _onActiveNotebookPanelMetadataChanged(sender, args) {
        const message = new observables_lib_index_js_.ObservableJSON.ChangeMessage('activenotebookpanel-metadata-changed', { oldValue: undefined, newValue: undefined, ...args });
        for (const widget of this._toolChildren()) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, message);
        }
    }
    /**
     * Handle a change in the notebook model metadata.
     */
    _onActiveCellMetadataChanged(sender, args) {
        const message = new observables_lib_index_js_.ObservableJSON.ChangeMessage('activecell-metadata-changed', { newValue: undefined, oldValue: undefined, ...args });
        for (const widget of this._toolChildren()) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, message);
        }
    }
    *_toolChildren() {
        for (let tool of this._tools) {
            yield* tool.panel.children();
        }
    }
}
/**
 * The namespace for NotebookTools class statics.
 */
(function (NotebookTools) {
    /**
     * A singleton conflatable `'activenotebookpanel-changed'` message.
     */
    NotebookTools.ActiveNotebookPanelMessage = new messaging_dist_index_es6_js_.ConflatableMessage('activenotebookpanel-changed');
    /**
     * A singleton conflatable `'activecell-changed'` message.
     */
    NotebookTools.ActiveCellMessage = new messaging_dist_index_es6_js_.ConflatableMessage('activecell-changed');
    /**
     * A singleton conflatable `'selection-changed'` message.
     */
    NotebookTools.SelectionMessage = new messaging_dist_index_es6_js_.ConflatableMessage('selection-changed');
    /**
     * The base notebook tool, meant to be subclassed.
     */
    class Tool extends widgets_dist_index_es6_js_.Widget {
        dispose() {
            super.dispose();
            if (this.notebookTools) {
                this.notebookTools = null;
            }
        }
        /**
         * Process a message sent to the widget.
         *
         * @param msg - The message sent to the widget.
         */
        processMessage(msg) {
            super.processMessage(msg);
            switch (msg.type) {
                case 'activenotebookpanel-changed':
                    this.onActiveNotebookPanelChanged(msg);
                    break;
                case 'activecell-changed':
                    this.onActiveCellChanged(msg);
                    break;
                case 'selection-changed':
                    this.onSelectionChanged(msg);
                    break;
                case 'activecell-metadata-changed':
                    this.onActiveCellMetadataChanged(msg);
                    break;
                case 'activenotebookpanel-metadata-changed':
                    this.onActiveNotebookPanelMetadataChanged(msg);
                    break;
                default:
                    break;
            }
        }
        /**
         * Handle a change to the notebook panel.
         *
         * #### Notes
         * The default implementation is a no-op.
         */
        onActiveNotebookPanelChanged(msg) {
            /* no-op */
        }
        /**
         * Handle a change to the active cell.
         *
         * #### Notes
         * The default implementation is a no-op.
         */
        onActiveCellChanged(msg) {
            /* no-op */
        }
        /**
         * Handle a change to the selection.
         *
         * #### Notes
         * The default implementation is a no-op.
         */
        onSelectionChanged(msg) {
            /* no-op */
        }
        /**
         * Handle a change to the metadata of the active cell.
         *
         * #### Notes
         * The default implementation is a no-op.
         */
        onActiveCellMetadataChanged(msg) {
            /* no-op */
        }
        /**
         * Handle a change to the metadata of the active cell.
         *
         * #### Notes
         * The default implementation is a no-op.
         */
        onActiveNotebookPanelMetadataChanged(msg) {
            /* no-op */
        }
    }
    NotebookTools.Tool = Tool;
    /**
     * A raw metadata editor.
     */
    class MetadataEditorTool extends Tool {
        /**
         * Construct a new raw metadata tool.
         */
        constructor(options) {
            super();
            const { editorFactory } = options;
            this.addClass('jp-MetadataEditorTool');
            const layout = (this.layout = new widgets_dist_index_es6_js_.PanelLayout());
            this._editorFactory = editorFactory;
            this._editorLabel = options.label || 'Edit Metadata';
            this.createEditor();
            const titleNode = new widgets_dist_index_es6_js_.Widget({ node: document.createElement('label') });
            titleNode.node.textContent = options.label || 'Edit Metadata';
            layout.addWidget(titleNode);
            layout.addWidget(this.editor);
        }
        /**
         * The editor used by the tool.
         */
        get editor() {
            return this._editor;
        }
        /**
         * Handle a change to the notebook.
         */
        onActiveNotebookPanelChanged(msg) {
            this.editor.dispose();
            if (this.notebookTools.activeNotebookPanel) {
                this.createEditor();
            }
        }
        createEditor() {
            this._editor = new codeeditor_lib_index_js_.JSONEditor({
                editorFactory: this._editorFactory
            });
            this.editor.title.label = this._editorLabel;
            this.layout.addWidget(this.editor);
        }
    }
    NotebookTools.MetadataEditorTool = MetadataEditorTool;
})(NotebookTools || (NotebookTools = {}));
/**
 * A namespace for private data.
 */
var notebooktools_Private;
(function (Private) {
    /**
     * A comparator function for widget rank items.
     */
    function itemCmp(first, second) {
        return first.rank - second.rank;
    }
    Private.itemCmp = itemCmp;
})(notebooktools_Private || (notebooktools_Private = {}));
//# sourceMappingURL=notebooktools.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/toc@^6.5.6 (strict) (fallback: ../node_modules/@jupyterlab/toc/lib/index.js)
var toc_lib_index_js_ = __webpack_require__(74853);
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var domutils_dist_index_es6_js_ = __webpack_require__(19451);
// EXTERNAL MODULE: consume shared module (default) @lumino/dragdrop@~2.1.8 (singleton) (fallback: ../node_modules/@lumino/dragdrop/dist/index.es6.js)
var dragdrop_dist_index_es6_js_ = __webpack_require__(58980);
// EXTERNAL MODULE: consume shared module (default) @lumino/properties@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/properties/dist/index.es6.js)
var properties_dist_index_es6_js_ = __webpack_require__(10249);
// EXTERNAL MODULE: consume shared module (default) @lumino/virtualdom@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/virtualdom/dist/index.es6.js)
var virtualdom_dist_index_es6_js_ = __webpack_require__(17197);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/constants.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
/**
 * The class name added to a drop target.
 */
const DROP_TARGET_CLASS = 'jp-mod-dropTarget';
/**
 * The class name added to a drop source.
 */
const DROP_SOURCE_CLASS = 'jp-mod-dropSource';
//# sourceMappingURL=constants.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/windowing.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */






/**
 * Check whether the element is in a scrolling notebook.
 * Traverses open shadow DOM roots if needed.
 */
function isInScrollingNotebook(element) {
    if (!element) {
        return false;
    }
    const notebook = element.closest('.jp-WindowedPanel-viewport');
    if (notebook && notebook.dataset.isScrolling == 'true') {
        return true;
    }
    const root = element.getRootNode();
    return !!(root &&
        root instanceof ShadowRoot &&
        isInScrollingNotebook(root.host));
}
/**
 * Check whether the element is part of a CodeMirror editor.
 */
function isCodeMirrorElement(element) {
    if (!element) {
        return false;
    }
    return !!element.closest('.cm-editor');
}
/**
 * Subclass IntersectionObserver to allow suspending callbacks when notebook is scrolling.
 */
window.IntersectionObserver = class extends window.IntersectionObserver {
    constructor(callback, options) {
        super(entries => {
            this._delayCallbackInScrollingNotebook(entries);
        }, options);
        this.callback = callback;
        this._delayCallbackInScrollingNotebook = (entries) => {
            const entriesInScrollingNotebook = [];
            const nonOutputEntries = [];
            for (const entry of entries) {
                // Do not delay callbacks to CodeMirror editor logic
                if (isInScrollingNotebook(entry.target) &&
                    !isCodeMirrorElement(entry.target)) {
                    entriesInScrollingNotebook.push(entry);
                }
                else {
                    nonOutputEntries.push(entry);
                }
            }
            if (nonOutputEntries.length) {
                this.callback(nonOutputEntries, this);
            }
            if (entriesInScrollingNotebook.length) {
                void this._throttler.invoke(entriesInScrollingNotebook);
            }
        };
        this._throttler = new polling_dist_index_es6_js_.Throttler(entries => {
            // keep delaying until no longer in scrolling notebook
            this._delayCallbackInScrollingNotebook(entries);
        }, { limit: 1000, edge: 'trailing' });
    }
};
/**
 * Subclass ResizeObserver to allow suspending callbacks when notebook is scrolling.
 */
window.ResizeObserver = class extends window.ResizeObserver {
    constructor(callback) {
        super(entries => {
            this._delayCallbackInScrollingNotebook(entries);
        });
        this.callback = callback;
        this._delayCallbackInScrollingNotebook = (entries) => {
            const entriesInScrollingNotebook = [];
            const nonOutputEntries = [];
            for (const entry of entries) {
                if (isInScrollingNotebook(entry.target)) {
                    entriesInScrollingNotebook.push(entry);
                }
                else {
                    nonOutputEntries.push(entry);
                }
            }
            if (nonOutputEntries.length) {
                this.callback(nonOutputEntries, this);
            }
            if (entriesInScrollingNotebook.length) {
                void this._throttler.invoke(entriesInScrollingNotebook);
            }
        };
        this._throttler = new polling_dist_index_es6_js_.Throttler(entries => {
            // keep delaying until no longer in scrolling notebook
            this._delayCallbackInScrollingNotebook(entries);
        }, { limit: 1000, edge: 'trailing' });
    }
};
/**
 * Notebook view model for the windowed list.
 */
class NotebookViewModel extends ui_components_lib_index_js_.WindowedListModel {
    /**
     * Construct a notebook windowed list model.
     */
    constructor(cells, options) {
        super(options);
        this.cells = cells;
        /**
         * Cell size estimator
         *
         * @param index Cell index
         * @returns Cell height in pixels
         */
        this.estimateWidgetSize = (index) => {
            const cell = this.cells[index];
            if (!cell) {
                // This should not happen, but if it does,
                // do not throw if cell was deleted in the meantime
                console.warn(`estimateWidgetSize requested for cell ${index} in notebook with only ${this.cells.length} cells`);
                return 0;
            }
            const model = cell.model;
            const height = this.cellsEstimatedHeight.get(model.id);
            if (typeof height === 'number') {
                return height;
            }
            const nLines = model.sharedModel.getSource().split('\n').length;
            let outputsLines = 0;
            if (model instanceof lib_index_js_.CodeCellModel && !model.isDisposed) {
                for (let outputIdx = 0; outputIdx < model.outputs.length; outputIdx++) {
                    const output = model.outputs.get(outputIdx);
                    const data = output.data['text/plain'];
                    if (typeof data === 'string') {
                        outputsLines += data.split('\n').length;
                    }
                    else if (Array.isArray(data)) {
                        outputsLines += data.join('').split('\n').length;
                    }
                }
            }
            return (NotebookViewModel.DEFAULT_EDITOR_LINE_HEIGHT * (nLines + outputsLines) +
                NotebookViewModel.DEFAULT_CELL_MARGIN);
        };
        /**
         * Render the cell at index.
         *
         * @param index Cell index
         * @returns Cell widget
         */
        this.widgetRenderer = (index) => {
            return this.cells[index];
        };
        /**
         * Threshold used to decide if the cell should be scrolled to in the `smart` mode.
         * Defaults to scrolling when less than a full line of the cell is visible.
         */
        this.scrollDownThreshold = NotebookViewModel.DEFAULT_CELL_MARGIN / 2 +
            NotebookViewModel.DEFAULT_EDITOR_LINE_HEIGHT;
        /**
         * Threshold used to decide if the cell should be scrolled to in the `smart` mode.
         * Defaults to scrolling when the cell margin or more is invisible.
         */
        this.scrollUpThreshold = NotebookViewModel.DEFAULT_CELL_MARGIN / 2;
        /**
         * Mapping between the cell ids and the cell estimated heights
         *
         * This height is not refreshed with the changes to the document.
         * It is only used to measure cells outside the viewport on CPU
         * idle cycle to improve UX scrolling.
         */
        this.cellsEstimatedHeight = new Map();
        this._emitEstimatedHeightChanged = new polling_dist_index_es6_js_.Debouncer(() => {
            this._stateChanged.emit({
                name: 'estimatedWidgetSize',
                newValue: null,
                oldValue: null
            });
        });
        // Set default cell size
        this._estimatedWidgetSize = NotebookViewModel.DEFAULT_CELL_SIZE;
    }
    /**
     * Set an estimated height for a cell
     *
     * @param cellId Cell ID
     * @param size Cell height
     */
    setEstimatedWidgetSize(cellId, size) {
        if (size === null) {
            if (this.cellsEstimatedHeight.has(cellId)) {
                this.cellsEstimatedHeight.delete(cellId);
            }
        }
        else {
            this.cellsEstimatedHeight.set(cellId, size);
            this._emitEstimatedHeightChanged.invoke().catch(error => {
                console.error('Fail to trigger an update following a estimated height update.', error);
            });
        }
    }
}
/**
 * Default cell height
 */
NotebookViewModel.DEFAULT_CELL_SIZE = 39;
/**
 * Default editor line height
 */
NotebookViewModel.DEFAULT_EDITOR_LINE_HEIGHT = 17;
/**
 * Default cell margin (top + bottom)
 */
NotebookViewModel.DEFAULT_CELL_MARGIN = 22;
/**
 * Windowed list layout for the notebook.
 */
class NotebookWindowedLayout extends ui_components_lib_index_js_.WindowedLayout {
    constructor() {
        super(...arguments);
        this._header = null;
        this._footer = null;
        this._willBeRemoved = null;
        this._topHiddenCodeCells = -1;
    }
    /**
     * Notebook's header
     */
    get header() {
        return this._header;
    }
    set header(header) {
        var _a;
        if (this._header && this._header.isAttached) {
            widgets_dist_index_es6_js_.Widget.detach(this._header);
        }
        this._header = header;
        if (this._header && ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isAttached)) {
            widgets_dist_index_es6_js_.Widget.attach(this._header, this.parent.node);
        }
    }
    /**
     * Notebook widget's footer
     */
    get footer() {
        return this._footer;
    }
    set footer(footer) {
        var _a;
        if (this._footer && this._footer.isAttached) {
            widgets_dist_index_es6_js_.Widget.detach(this._footer);
        }
        this._footer = footer;
        if (this._footer && ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isAttached)) {
            widgets_dist_index_es6_js_.Widget.attach(this._footer, this.parent.outerNode);
        }
    }
    /**
     * Notebook's active cell
     */
    get activeCell() {
        return this._activeCell;
    }
    set activeCell(widget) {
        this._activeCell = widget;
    }
    /**
     * Dispose the layout
     * */
    dispose() {
        var _a, _b;
        if (this.isDisposed) {
            return;
        }
        (_a = this._header) === null || _a === void 0 ? void 0 : _a.dispose();
        (_b = this._footer) === null || _b === void 0 ? void 0 : _b.dispose();
        super.dispose();
    }
    /**
     * * A message handler invoked on a `'child-removed'` message.
     * *
     * @param widget - The widget to remove from the layout.
     *
     * #### Notes
     * A widget is automatically removed from the layout when its `parent`
     * is set to `null`. This method should only be invoked directly when
     * removing a widget from a layout which has yet to be installed on a
     * parent widget.
     *
     * This method does *not* modify the widget's `parent`.
     */
    removeWidget(widget) {
        const index = this.widgets.indexOf(widget);
        // We need to deal with code cell widget not in viewport (aka not in this.widgets) but still
        // partly attached
        if (index >= 0) {
            this.removeWidgetAt(index);
        } // If the layout is parented, detach the widget from the DOM.
        else if (widget === this._willBeRemoved && this.parent) {
            this.detachWidget(index, widget);
        }
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation adds the widgets's node to the parent's
     * node at the proper location, and sends the appropriate attach
     * messages to the widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is added to the parent's node.
     */
    attachWidget(index, widget) {
        // Status may change in onBeforeAttach
        const wasPlaceholder = widget.isPlaceholder();
        // Initialized sub-widgets or attached them for CodeCell
        // Because this reattaches all sub-widget to the DOM which leads
        // to a loss of focus, we do not call it for soft-hidden cells.
        const isSoftHidden = this._isSoftHidden(widget);
        if (this.parent.isAttached && !isSoftHidden) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, widgets_dist_index_es6_js_.Widget.Msg.BeforeAttach);
        }
        if (isSoftHidden) {
            // Restore visibility for active, or previously active cell
            this._toggleSoftVisibility(widget, true);
        }
        if (!wasPlaceholder &&
            widget instanceof lib_index_js_.CodeCell &&
            widget.node.parentElement) {
            // We don't remove code cells to preserve outputs internal state
            widget.node.style.display = '';
            // Reset cache
            this._topHiddenCodeCells = -1;
            if (this.parent.isAttached && !widget.isAttached) {
                widget.setFlag(widgets_dist_index_es6_js_.Widget.Flag.IsAttached);
            }
        }
        else if (!isSoftHidden) {
            // Look up the next sibling reference node.
            const siblingIndex = this._findNearestChildBinarySearch(this.parent.viewportNode.childElementCount - 1, 0, parseInt(widget.dataset.windowedListIndex, 10) + 1);
            let ref = this.parent.viewportNode.children[siblingIndex];
            // Insert the widget's node before the sibling.
            this.parent.viewportNode.insertBefore(widget.node, ref);
            // Send an `'after-attach'` message if the parent is attached.
            // Event listeners will be added here
            // Some widgets are updating/resetting when attached, so
            // we should not recall this each time a cell move into the
            // viewport.
            if (this.parent.isAttached) {
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, widgets_dist_index_es6_js_.Widget.Msg.AfterAttach);
            }
        }
        widget.inViewport = true;
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation removes the widget's node from the
     * parent's node, and sends the appropriate detach messages to the
     * widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is removed from the parent's node.
     */
    detachWidget(index, widget) {
        widget.inViewport = false;
        // Note: `index` is relative to the displayed cells, not all cells,
        // hence we compare with the widget itself.
        if (widget === this.activeCell && widget !== this._willBeRemoved) {
            // Do not change display of the active cell to allow user to continue providing input
            // into the code mirror editor when out of view. We still hide the cell so to prevent
            // minor visual glitches when scrolling.
            this._toggleSoftVisibility(widget, false);
            // Return before sending "AfterDetach" message to CodeCell
            // to prevent removing contents of the active cell.
            return;
        }
        // Do not apply `display: none` on cells which contain:
        // - `<defs>` as multiple browsers (Chrome and Firefox)
        //   are bugged and do not respect the spec here, see
        //   https://github.com/jupyterlab/jupyterlab/issues/16952
        //   https://issues.chromium.org/issues/40324398
        //   https://bugzilla.mozilla.org/show_bug.cgi?id=376027
        // - elements containing `.myst` class as jupyterlab-myst
        //   re-renders cause height jitter and scrolling issues;
        //   in future this could be addressed by the proposal
        //   to allow renderers to specify hiding mode, see
        //   https://github.com/jupyterlab/jupyterlab/issues/17331
        const requiresSoftHiding = widget.node.querySelector('defs,.myst');
        if (requiresSoftHiding) {
            this._toggleSoftVisibility(widget, false);
            return;
        }
        // TODO we could improve this further by discarding also the code cell without outputs
        if (
        // We detach the code cell currently dragged otherwise it won't be attached at the correct position
        widget instanceof lib_index_js_.CodeCell &&
            !widget.node.classList.contains(DROP_SOURCE_CLASS) &&
            widget !== this._willBeRemoved) {
            // We don't remove code cells to preserve outputs internal state
            // Transform does not work because the widget height is kept (at least in FF)
            widget.node.style.display = 'none';
            // Reset cache
            this._topHiddenCodeCells = -1;
        }
        else {
            // Send a `'before-detach'` message if the parent is attached.
            // This should not be called every time a cell leaves the viewport
            // as it will remove listeners that won't be added back as afterAttach
            // is shunted to avoid unwanted update/reset.
            if (this.parent.isAttached) {
                // Event listeners will be removed here
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, widgets_dist_index_es6_js_.Widget.Msg.BeforeDetach);
            }
            // Remove the widget's node from the parent.
            this.parent.viewportNode.removeChild(widget.node);
            // Ensure to clean up drop target class if the widget move out of the viewport
            widget.node.classList.remove(DROP_TARGET_CLASS);
        }
        if (this.parent.isAttached) {
            // Detach sub widget of CodeCell except the OutputAreaWrapper
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, widgets_dist_index_es6_js_.Widget.Msg.AfterDetach);
        }
    }
    /**
     * Move a widget in the parent's DOM node.
     *
     * @param fromIndex - The previous index of the widget in the layout.
     *
     * @param toIndex - The current index of the widget in the layout.
     *
     * @param widget - The widget to move in the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation moves the widget's node to the proper
     * location in the parent's node and sends the appropriate attach and
     * detach messages to the widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is moved in the parent's node.
     */
    moveWidget(fromIndex, toIndex, widget) {
        // Optimize move without de-/attaching as motion appends with parent attached
        // Case fromIndex === toIndex, already checked in PanelLayout.insertWidget
        if (this._topHiddenCodeCells < 0) {
            this._topHiddenCodeCells = 0;
            for (let idx = 0; idx < this.parent.viewportNode.children.length; idx++) {
                const n = this.parent.viewportNode.children[idx];
                if (n.style.display == 'none') {
                    this._topHiddenCodeCells++;
                }
                else {
                    break;
                }
            }
        }
        const ref = this.parent.viewportNode.children[toIndex + this._topHiddenCodeCells];
        if (fromIndex < toIndex) {
            ref.insertAdjacentElement('afterend', widget.node);
        }
        else {
            ref.insertAdjacentElement('beforebegin', widget.node);
        }
    }
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        if (this._header && !this._header.isAttached) {
            widgets_dist_index_es6_js_.Widget.attach(this._header, this.parent.node, this.parent.node.firstElementChild);
        }
        if (this._footer && !this._footer.isAttached) {
            widgets_dist_index_es6_js_.Widget.attach(this._footer, this.parent.outerNode);
        }
    }
    onBeforeDetach(msg) {
        var _a, _b;
        if ((_a = this._header) === null || _a === void 0 ? void 0 : _a.isAttached) {
            widgets_dist_index_es6_js_.Widget.detach(this._header);
        }
        if ((_b = this._footer) === null || _b === void 0 ? void 0 : _b.isAttached) {
            widgets_dist_index_es6_js_.Widget.detach(this._footer);
        }
        super.onBeforeDetach(msg);
    }
    /**
     * A message handler invoked on a `'child-removed'` message.
     *
     * @param msg Message
     */
    onChildRemoved(msg) {
        this._willBeRemoved = msg.child;
        super.onChildRemoved(msg);
        this._willBeRemoved = null;
    }
    /**
     * Toggle "soft" visibility of the widget.
     *
     * #### Notes
     * To ensure that user events reach the CodeMirror editor, this method
     * does not toggle `display` nor `visibility` which have side effects,
     * but instead hides it in the compositor and ensures that the bounding
     * box is has an area equal to zero.
     * To ensure we do not trigger style recalculation, we set the styles
     * directly on the node instead of using a class.
     */
    _toggleSoftVisibility(widget, show) {
        if (show) {
            widget.node.style.opacity = '';
            widget.node.style.height = '';
            widget.node.style.padding = '';
        }
        else {
            widget.node.style.opacity = '0';
            // Both padding and height need to be set to zero
            // to ensure bounding box collapses to invisible.
            widget.node.style.height = '0';
            widget.node.style.padding = '0';
        }
    }
    _isSoftHidden(widget) {
        return widget.node.style.opacity === '0';
    }
    _findNearestChildBinarySearch(high, low, index) {
        while (low <= high) {
            const middle = low + Math.floor((high - low) / 2);
            const currentIndex = parseInt(this.parent.viewportNode.children[middle].dataset
                .windowedListIndex, 10);
            if (currentIndex === index) {
                return middle;
            }
            else if (currentIndex < index) {
                low = middle + 1;
            }
            else if (currentIndex > index) {
                high = middle - 1;
            }
        }
        if (low > 0) {
            return low;
        }
        else {
            return 0;
        }
    }
}
//# sourceMappingURL=windowing.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/notebookfooter.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


const NOTEBOOK_FOOTER_CLASS = 'jp-Notebook-footer';
/**
 * A footer widget added after the last cell of the notebook.
 */
class NotebookFooter extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a footer widget.
     */
    constructor(notebook) {
        super({ node: document.createElement('button') });
        this.notebook = notebook;
        const trans = notebook.translator.load('jupyterlab');
        this.addClass(NOTEBOOK_FOOTER_CLASS);
        this.node.setAttribute('tabindex', '-1');
        this.node.innerText = trans.__('Click to add a cell.');
    }
    /**
     * Handle incoming events.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'click':
                this.onClick();
                break;
            case 'keydown':
                if (event.key === 'ArrowUp') {
                    this.onArrowUp();
                    break;
                }
        }
    }
    /**
     * On single click (mouse event), insert a cell below (at the end of the notebook as default behavior).
     */
    onClick() {
        if (this.notebook.widgets.length > 0) {
            this.notebook.activeCellIndex = this.notebook.widgets.length - 1;
        }
        NotebookActions.insertBelow(this.notebook);
        // Focus on the created cell.
        void NotebookActions.focusActiveCell(this.notebook);
    }
    /**
     * On arrow up key pressed (keydown keyboard event).
     * @deprecated To be removed in v5, this is a no-op
     */
    onArrowUp() {
        // The specific behavior has been removed in https://github.com/jupyterlab/jupyterlab/pull/14796
    }
    /*
     * Handle `after-detach` messages for the widget.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        this.node.addEventListener('click', this);
        this.node.addEventListener('keydown', this);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        this.node.removeEventListener('click', this);
        this.node.removeEventListener('keydown', this);
        super.onBeforeDetach(msg);
    }
}
//# sourceMappingURL=notebookfooter.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


















/**
 * The data attribute added to a widget that has an active kernel.
 */
const KERNEL_USER = 'jpKernelUser';
/**
 * The data attribute added to a widget that can run code.
 */
const CODE_RUNNER = 'jpCodeRunner';
/**
 * The data attribute added to a widget that can undo.
 */
const UNDOER = 'jpUndoer';
/**
 * The class name added to notebook widgets.
 */
const NB_CLASS = 'jp-Notebook';
/**
 * The class name added to notebook widget cells.
 */
const NB_CELL_CLASS = 'jp-Notebook-cell';
/**
 * The class name added to a notebook in edit mode.
 */
const EDIT_CLASS = 'jp-mod-editMode';
/**
 * The class name added to a notebook in command mode.
 */
const COMMAND_CLASS = 'jp-mod-commandMode';
/**
 * The class name added to the active cell.
 */
const ACTIVE_CLASS = 'jp-mod-active';
/**
 * The class name added to selected cells.
 */
const SELECTED_CLASS = 'jp-mod-selected';
/**
 * The class name added to the cell when dirty.
 */
const DIRTY_CLASS = 'jp-mod-dirty';
/**
 * The class name added to an active cell when there are other selected cells.
 */
const OTHER_SELECTED_CLASS = 'jp-mod-multiSelected';
/**
 * The class name added to unconfined images.
 */
const UNCONFINED_CLASS = 'jp-mod-unconfined';
/**
 * The class name added to the notebook when an element within it is focused
 * and takes keyboard input, such as focused <input> or <div contenteditable>.
 *
 * This class is also effective when the focused element is in shadow DOM.
 */
const READ_WRITE_CLASS = 'jp-mod-readWrite';
/**
 * The class name added to drag images.
 */
const DRAG_IMAGE_CLASS = 'jp-dragImage';
/**
 * The class name added to singular drag images
 */
const SINGLE_DRAG_IMAGE_CLASS = 'jp-dragImage-singlePrompt';
/**
 * The class name added to the drag image cell content.
 */
const CELL_DRAG_CONTENT_CLASS = 'jp-dragImage-content';
/**
 * The class name added to the drag image cell content.
 */
const CELL_DRAG_PROMPT_CLASS = 'jp-dragImage-prompt';
/**
 * The class name added to the drag image cell content.
 */
const CELL_DRAG_MULTIPLE_BACK = 'jp-dragImage-multipleBack';
/**
 * The mimetype used for Jupyter cell data.
 */
const widget_JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';
/**
 * The threshold in pixels to start a drag event.
 */
const DRAG_THRESHOLD = 5;
/**
 * Maximal remaining time for idle callback
 *
 * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API#getting_the_most_out_of_idle_callbacks
 */
const MAXIMUM_TIME_REMAINING = 50;
/**
 * The class attached to the heading collapser button
 */
const HEADING_COLLAPSER_CLASS = 'jp-collapseHeadingButton';
/**
 * The class that controls the visibility of "heading collapser" and "show hidden cells" buttons.
 */
const HEADING_COLLAPSER_VISBILITY_CONTROL_CLASS = 'jp-mod-showHiddenCellsButton';
const SIDE_BY_SIDE_CLASS = 'jp-mod-sideBySide';
if (window.requestIdleCallback === undefined) {
    // On Safari, requestIdleCallback is not available, so we use replacement functions for `idleCallbacks`
    // See: https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API#falling_back_to_settimeout
    // eslint-disable-next-line @typescript-eslint/ban-types
    window.requestIdleCallback = function (handler) {
        let startTime = Date.now();
        return setTimeout(function () {
            handler({
                didTimeout: false,
                timeRemaining: function () {
                    return Math.max(0, 50.0 - (Date.now() - startTime));
                }
            });
        }, 1);
    };
    window.cancelIdleCallback = function (id) {
        clearTimeout(id);
    };
}
/**
 * A widget which renders static non-interactive notebooks.
 *
 * #### Notes
 * The widget model must be set separately and can be changed
 * at any time.  Consumers of the widget must account for a
 * `null` model, and may want to listen to the `modelChanged`
 * signal.
 */
class StaticNotebook extends ui_components_lib_index_js_.WindowedList {
    /**
     * Construct a notebook widget.
     */
    constructor(options) {
        var _a, _b, _c, _d, _e, _f;
        const cells = new Array();
        const windowingActive = ((_b = (_a = options.notebookConfig) === null || _a === void 0 ? void 0 : _a.windowingMode) !== null && _b !== void 0 ? _b : StaticNotebook.defaultNotebookConfig.windowingMode) === 'full';
        super({
            model: new NotebookViewModel(cells, {
                overscanCount: (_d = (_c = options.notebookConfig) === null || _c === void 0 ? void 0 : _c.overscanCount) !== null && _d !== void 0 ? _d : StaticNotebook.defaultNotebookConfig.overscanCount,
                windowingActive
            }),
            layout: new NotebookWindowedLayout(),
            renderer: (_e = options.renderer) !== null && _e !== void 0 ? _e : ui_components_lib_index_js_.WindowedList.defaultRenderer,
            scrollbar: false
        });
        this._cellCollapsed = new dist_index_es6_js_.Signal(this);
        this._cellInViewportChanged = new dist_index_es6_js_.Signal(this);
        this._renderingLayoutChanged = new dist_index_es6_js_.Signal(this);
        this._contentVisibilityObserver = null;
        this.addClass(NB_CLASS);
        this.cellsArray = cells;
        this._idleCallBack = null;
        this._editorConfig = StaticNotebook.defaultEditorConfig;
        this._notebookConfig = StaticNotebook.defaultNotebookConfig;
        this._mimetype = codeeditor_lib_index_js_.IEditorMimeTypeService.defaultMimeType;
        this._notebookModel = null;
        this._modelChanged = new dist_index_es6_js_.Signal(this);
        this._modelContentChanged = new dist_index_es6_js_.Signal(this);
        this.node.dataset[KERNEL_USER] = 'true';
        this.node.dataset[UNDOER] = 'true';
        this.node.dataset[CODE_RUNNER] = 'true';
        this.rendermime = options.rendermime;
        this.translator = options.translator || translation_lib_index_js_.nullTranslator;
        this.contentFactory = options.contentFactory;
        this.editorConfig =
            options.editorConfig || StaticNotebook.defaultEditorConfig;
        this.notebookConfig =
            options.notebookConfig || StaticNotebook.defaultNotebookConfig;
        this._updateNotebookConfig();
        this._mimetypeService = options.mimeTypeService;
        this.renderingLayout = (_f = options.notebookConfig) === null || _f === void 0 ? void 0 : _f.renderingLayout;
        this.kernelHistory = options.kernelHistory;
    }
    get cellCollapsed() {
        return this._cellCollapsed;
    }
    get cellInViewportChanged() {
        return this._cellInViewportChanged;
    }
    /**
     * A signal emitted when the model of the notebook changes.
     */
    get modelChanged() {
        return this._modelChanged;
    }
    /**
     * A signal emitted when the model content changes.
     *
     * #### Notes
     * This is a convenience signal that follows the current model.
     */
    get modelContentChanged() {
        return this._modelContentChanged;
    }
    /**
     * A signal emitted when the rendering layout of the notebook changes.
     */
    get renderingLayoutChanged() {
        return this._renderingLayoutChanged;
    }
    /**
     * The model for the widget.
     */
    get model() {
        return this._notebookModel;
    }
    set model(newValue) {
        var _a;
        newValue = newValue || null;
        if (this._notebookModel === newValue) {
            return;
        }
        const oldValue = this._notebookModel;
        this._notebookModel = newValue;
        // Trigger private, protected, and public changes.
        this._onModelChanged(oldValue, newValue);
        this.onModelChanged(oldValue, newValue);
        this._modelChanged.emit(void 0);
        // Trigger state change
        this.viewModel.itemsList = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.cells) !== null && _a !== void 0 ? _a : null;
    }
    /**
     * Get the mimetype for code cells.
     */
    get codeMimetype() {
        return this._mimetype;
    }
    /**
     * A read-only sequence of the widgets in the notebook.
     */
    get widgets() {
        return this.cellsArray;
    }
    /**
     * A configuration object for cell editor settings.
     */
    get editorConfig() {
        return this._editorConfig;
    }
    set editorConfig(value) {
        this._editorConfig = value;
        this._updateEditorConfig();
    }
    /**
     * A configuration object for notebook settings.
     */
    get notebookConfig() {
        return this._notebookConfig;
    }
    set notebookConfig(value) {
        this._notebookConfig = value;
        this._updateNotebookConfig();
    }
    get renderingLayout() {
        return this._renderingLayout;
    }
    set renderingLayout(value) {
        var _a;
        this._renderingLayout = value;
        if (this._renderingLayout === 'side-by-side') {
            this.node.classList.add(SIDE_BY_SIDE_CLASS);
        }
        else {
            this.node.classList.remove(SIDE_BY_SIDE_CLASS);
        }
        this._renderingLayoutChanged.emit((_a = this._renderingLayout) !== null && _a !== void 0 ? _a : 'default');
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        var _a;
        // Do nothing if already disposed.
        if (this.isDisposed) {
            return;
        }
        this._notebookModel = null;
        (_a = this.layout.header) === null || _a === void 0 ? void 0 : _a.dispose();
        //  Disconnect the content-visibility observer
        if (this._contentVisibilityObserver) {
            this._contentVisibilityObserver.disconnect();
            this._contentVisibilityObserver = null;
        }
        super.dispose();
    }
    onBeforeDetach(msg) {
        //  Disconnect the content-visibility observer
        if (this._contentVisibilityObserver) {
            this._contentVisibilityObserver.disconnect();
            this._contentVisibilityObserver = null;
        }
        super.onBeforeDetach(msg);
    }
    /**
     * Move cells preserving widget view state.
     *
     * #### Notes
     * This is required because at the model level a move is a deletion
     * followed by an insertion. Hence the view state is not preserved.
     *
     * @param from The index of the cell to move
     * @param to The new index of the cell
     * @param n Number of cells to move
     */
    moveCell(from, to, n = 1) {
        if (!this.model) {
            return;
        }
        const boundedTo = Math.min(this.model.cells.length - 1, Math.max(0, to));
        if (boundedTo === from) {
            return;
        }
        const viewModel = new Array(n);
        let dirtyState = new Array(n);
        for (let i = 0; i < n; i++) {
            viewModel[i] = {};
            const oldCell = this.widgets[from + i];
            if (oldCell.model.type === 'markdown') {
                for (const k of ['rendered', 'headingCollapsed']) {
                    // @ts-expect-error Cell has no index signature
                    viewModel[i][k] = oldCell[k];
                }
            }
            else if (oldCell.model.type === 'code') {
                const oldCodeCell = oldCell.model;
                dirtyState[i] = oldCodeCell.isDirty;
            }
        }
        this.model.sharedModel.moveCells(from, boundedTo, n);
        for (let i = 0; i < n; i++) {
            const newCell = this.widgets[to + i];
            const view = viewModel[i];
            for (const state in view) {
                // @ts-expect-error Cell has no index signature
                newCell[state] = view[state];
            }
            if (from > to) {
                if (this.widgets[to + i].model.type === 'code') {
                    this.widgets[to + i].model.isDirty = dirtyState[i];
                }
            }
            else {
                if (this.widgets[to + i - n + 1].model.type === 'code') {
                    this.widgets[to + i - n + 1].model.isDirty =
                        dirtyState[i];
                }
            }
        }
    }
    /**
     * Force rendering the cell outputs of a given cell if it is still a placeholder.
     *
     * #### Notes
     * The goal of this method is to allow search on cell outputs (that is based
     * on DOM tree introspection).
     *
     * @param index The cell index
     */
    renderCellOutputs(index) {
        const cell = this.viewModel.widgetRenderer(index);
        if (cell instanceof lib_index_js_.CodeCell && cell.isPlaceholder()) {
            cell.dataset.windowedListIndex = `${index}`;
            this.layout.insertWidget(index, cell);
            if (this.notebookConfig.windowingMode === 'full') {
                // We need to delay slightly the removal to let codemirror properly initialize
                requestAnimationFrame(() => {
                    this.layout.removeWidget(cell);
                });
            }
        }
    }
    /**
     * Adds a message to the notebook as a header.
     */
    addHeader() {
        const trans = this.translator.load('jupyterlab');
        const info = new widgets_dist_index_es6_js_.Widget();
        info.node.textContent = trans.__('The notebook is empty. Click the + button on the toolbar to add a new cell.');
        this.layout.header = info;
    }
    /**
     * Removes the header.
     */
    removeHeader() {
        var _a;
        (_a = this.layout.header) === null || _a === void 0 ? void 0 : _a.dispose();
        this.layout.header = null;
    }
    /**
     * Handle a new model.
     *
     * #### Notes
     * This method is called after the model change has been handled
     * internally and before the `modelChanged` signal is emitted.
     * The default implementation is a no-op.
     */
    onModelChanged(oldValue, newValue) {
        // No-op.
    }
    /**
     * Handle changes to the notebook model content.
     *
     * #### Notes
     * The default implementation emits the `modelContentChanged` signal.
     */
    onModelContentChanged(model, args) {
        this._modelContentChanged.emit(void 0);
    }
    /**
     * Handle changes to the notebook model metadata.
     *
     * #### Notes
     * The default implementation updates the mimetypes of the code cells
     * when the `language_info` metadata changes.
     */
    onMetadataChanged(sender, args) {
        switch (args.key) {
            case 'language_info':
                this._updateMimetype();
                break;
            default:
                break;
        }
    }
    /**
     * Handle a cell being inserted.
     *
     * The default implementation is a no-op
     */
    onCellInserted(index, cell) {
        // This is a no-op.
    }
    /**
     * Handle a cell being removed.
     *
     * The default implementation is a no-op
     */
    onCellRemoved(index, cell) {
        // This is a no-op.
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     *
     * In defer-like mode, the default logic for inserting cells
     * is skipped, enabling the notebook to render cells in small
     * batches, without blocking the UI.
     */
    onUpdateRequest(msg) {
        if (['defer', 'contentVisibility'].includes(this.notebookConfig.windowingMode)) {
            void this._runOnIdleTime();
        }
        else {
            super.onUpdateRequest(msg);
        }
    }
    /**
     * Handle a new model on the widget.
     */
    _onModelChanged(oldValue, newValue) {
        var _a;
        if (oldValue) {
            oldValue.contentChanged.disconnect(this.onModelContentChanged, this);
            oldValue.metadataChanged.disconnect(this.onMetadataChanged, this);
            oldValue.cells.changed.disconnect(this._onCellsChanged, this);
            while (this.cellsArray.length) {
                this._removeCell(0);
            }
        }
        if (!newValue) {
            this._mimetype = codeeditor_lib_index_js_.IEditorMimeTypeService.defaultMimeType;
            return;
        }
        this._updateMimetype();
        const cells = newValue.cells;
        const collab = (_a = newValue.collaborative) !== null && _a !== void 0 ? _a : false;
        if (!collab && !cells.length) {
            newValue.sharedModel.insertCell(0, {
                cell_type: this.notebookConfig.defaultCell,
                metadata: this.notebookConfig.defaultCell === 'code'
                    ? {
                        // This is an empty cell created in empty notebook, thus is trusted
                        trusted: true
                    }
                    : {}
            });
        }
        let index = -1;
        for (const cell of cells) {
            this._insertCell(++index, cell);
        }
        newValue.cells.changed.connect(this._onCellsChanged, this);
        newValue.metadataChanged.connect(this.onMetadataChanged, this);
        newValue.contentChanged.connect(this.onModelContentChanged, this);
    }
    /**
     * Handle a change cells event.
     */
    _onCellsChanged(sender, args) {
        this.removeHeader();
        switch (args.type) {
            case 'add': {
                let index = 0;
                index = args.newIndex;
                for (const value of args.newValues) {
                    this._insertCell(index++, value);
                }
                this._updateDataWindowedListIndex(args.newIndex, args.newValues.length);
                break;
            }
            case 'remove':
                for (let length = args.oldValues.length; length > 0; length--) {
                    this._removeCell(args.oldIndex);
                }
                this._updateDataWindowedListIndex(args.oldIndex, -1 * args.oldValues.length);
                // Add default cell if there are no cells remaining.
                if (!sender.length) {
                    const model = this.model;
                    // Add the cell in a new context to avoid triggering another
                    // cell changed event during the handling of this signal.
                    requestAnimationFrame(() => {
                        if (model && !model.isDisposed && !model.sharedModel.cells.length) {
                            model.sharedModel.insertCell(0, {
                                cell_type: this.notebookConfig.defaultCell,
                                metadata: this.notebookConfig.defaultCell === 'code'
                                    ? {
                                        // This is an empty cell created in empty notebook, thus is trusted
                                        trusted: true
                                    }
                                    : {}
                            });
                        }
                    });
                }
                break;
            default:
                return;
        }
        if (!this.model.sharedModel.cells.length) {
            this.addHeader();
        }
        this.update();
    }
    /**
     * Create a cell widget and insert into the notebook.
     */
    _insertCell(index, cell) {
        let widget;
        switch (cell.type) {
            case 'code':
                widget = this._createCodeCell(cell);
                widget.model.mimeType = this._mimetype;
                break;
            case 'markdown':
                widget = this._createMarkdownCell(cell);
                if (cell.sharedModel.getSource() === '') {
                    widget.rendered = false;
                }
                break;
            default:
                widget = this._createRawCell(cell);
        }
        widget.inViewportChanged.connect(this._onCellInViewportChanged, this);
        widget.addClass(NB_CELL_CLASS);
        index_es6_js_.ArrayExt.insert(this.cellsArray, index, widget);
        this.onCellInserted(index, widget);
        this._scheduleCellRenderOnIdle();
    }
    /**
     * Create a code cell widget from a code cell model.
     */
    _createCodeCell(model) {
        const rendermime = this.rendermime;
        const contentFactory = this.contentFactory;
        const editorConfig = this.editorConfig.code;
        const options = {
            contentFactory,
            editorConfig,
            inputHistoryScope: this.notebookConfig.inputHistoryScope,
            showInputPlaceholder: this.notebookConfig.showInputPlaceholder,
            maxNumberOutputs: this.notebookConfig.maxNumberOutputs,
            model,
            placeholder: this._notebookConfig.windowingMode !== 'none',
            rendermime,
            translator: this.translator
        };
        const cell = this.contentFactory.createCodeCell(options);
        cell.syncCollapse = true;
        cell.syncEditable = true;
        cell.syncScrolled = true;
        cell.outputArea.inputRequested.connect((_, stdin) => {
            this._onInputRequested(cell).catch(reason => {
                console.error('Failed to scroll to cell requesting input.', reason);
            });
            stdin.disposed.connect(() => {
                // The input field is removed from the DOM after the user presses Enter.
                // This causes focus to be lost if we don't explicitly re-focus
                // somewhere else.
                cell.node.focus();
            });
        });
        return cell;
    }
    /**
     * Create a markdown cell widget from a markdown cell model.
     */
    _createMarkdownCell(model) {
        const rendermime = this.rendermime;
        const contentFactory = this.contentFactory;
        const editorConfig = this.editorConfig.markdown;
        const options = {
            contentFactory,
            editorConfig,
            model,
            placeholder: this._notebookConfig.windowingMode !== 'none',
            rendermime,
            showEditorForReadOnlyMarkdown: this._notebookConfig.showEditorForReadOnlyMarkdown
        };
        const cell = this.contentFactory.createMarkdownCell(options);
        cell.syncCollapse = true;
        cell.syncEditable = true;
        // Connect collapsed signal for each markdown cell widget
        cell.headingCollapsedChanged.connect(this._onCellCollapsed, this);
        return cell;
    }
    /**
     * Create a raw cell widget from a raw cell model.
     */
    _createRawCell(model) {
        const contentFactory = this.contentFactory;
        const editorConfig = this.editorConfig.raw;
        const options = {
            editorConfig,
            model,
            contentFactory,
            placeholder: this._notebookConfig.windowingMode !== 'none'
        };
        const cell = this.contentFactory.createRawCell(options);
        cell.syncCollapse = true;
        cell.syncEditable = true;
        return cell;
    }
    /**
     * Remove a cell widget.
     */
    _removeCell(index) {
        const widget = this.cellsArray[index];
        widget.parent = null;
        index_es6_js_.ArrayExt.removeAt(this.cellsArray, index);
        this.onCellRemoved(index, widget);
        widget.dispose();
    }
    /**
     * Update the mimetype of the notebook.
     */
    _updateMimetype() {
        var _a;
        const info = (_a = this._notebookModel) === null || _a === void 0 ? void 0 : _a.getMetadata('language_info');
        if (!info) {
            return;
        }
        this._mimetype = this._mimetypeService.getMimeTypeByLanguage(info);
        for (const widget of this.widgets) {
            if (widget.model.type === 'code') {
                widget.model.mimeType = this._mimetype;
            }
        }
    }
    /**
     * Callback when a cell collapsed status changes.
     *
     * @param cell Cell changed
     * @param collapsed New collapsed status
     */
    _onCellCollapsed(cell, collapsed) {
        cell
            .getHeadings()
            .then(() => {
            NotebookActions.setHeadingCollapse(cell, collapsed, this);
            this._cellCollapsed.emit(cell);
        })
            .catch(error => {
            console.warn('Failed to resolve headings: ', error);
        });
    }
    /**
     * Callback when a cell viewport status changes.
     *
     * @param cell Cell changed
     */
    _onCellInViewportChanged(cell) {
        this._cellInViewportChanged.emit(cell);
    }
    /**
     * Ensure to load in the DOM a cell requesting an user input
     *
     * @param cell Cell requesting an input
     */
    async _onInputRequested(cell) {
        if (!cell.inViewport) {
            const cellIndex = this.widgets.findIndex(c => c === cell);
            if (cellIndex >= 0) {
                await this.scrollToItem(cellIndex);
                const inputEl = cell.node.querySelector('.jp-Stdin');
                if (inputEl) {
                    domutils_dist_index_es6_js_.ElementExt.scrollIntoViewIfNeeded(this.node, inputEl);
                    inputEl.focus();
                }
            }
        }
    }
    _scheduleCellRenderOnIdle() {
        if (this.notebookConfig.windowingMode !== 'none' && !this.isDisposed) {
            if (!this._idleCallBack) {
                this._idleCallBack = requestIdleCallback((deadline) => {
                    this._idleCallBack = null;
                    // In case of timeout, render for some time even if it means freezing the UI
                    // This avoids the cells to never be loaded.
                    void this._runOnIdleTime(deadline.didTimeout
                        ? MAXIMUM_TIME_REMAINING
                        : deadline.timeRemaining());
                }, {
                    timeout: 3000
                });
            }
        }
    }
    _updateDataWindowedListIndex(start, delta) {
        for (const cell of this.cellsArray) {
            const globalIndex = parseInt(cell.dataset.windowedListIndex, 10);
            if (globalIndex >= start) {
                cell.node.dataset.windowedListIndex = `${globalIndex + delta}`;
            }
        }
    }
    /**
     * Update editor settings for notebook cells.
     */
    _updateEditorConfig() {
        for (let i = 0; i < this.widgets.length; i++) {
            const cell = this.widgets[i];
            let config = {};
            switch (cell.model.type) {
                case 'code':
                    config = this._editorConfig.code;
                    break;
                case 'markdown':
                    config = this._editorConfig.markdown;
                    break;
                default:
                    config = this._editorConfig.raw;
                    break;
            }
            cell.updateEditorConfig({ ...config });
        }
    }
    async _runOnIdleTime(remainingTime = MAXIMUM_TIME_REMAINING) {
        const startTime = Date.now();
        let cellIdx = 0;
        while (Date.now() - startTime < remainingTime &&
            cellIdx < this.cellsArray.length) {
            const cell = this.cellsArray[cellIdx];
            if (cell.isPlaceholder()) {
                if (['defer', 'full', 'contentVisibility'].includes(this.notebookConfig.windowingMode)) {
                    await this._updateForDeferMode(cell, cellIdx);
                    if (this.notebookConfig.windowingMode === 'full') {
                        // We need to delay slightly the removal to let codemirror properly initialize
                        requestAnimationFrame(() => {
                            this.viewModel.setEstimatedWidgetSize(cell.model.id, cell.node.getBoundingClientRect().height);
                            this.layout.removeWidget(cell);
                        });
                    }
                    else if (this.notebookConfig.windowingMode === 'contentVisibility') {
                        // Update height estimate in the view model
                        const height = cell.node.getBoundingClientRect().height;
                        this.viewModel.setEstimatedWidgetSize(cell.model.id, height);
                        cell.node.style.containIntrinsicSize = `auto ${height}px`;
                    }
                }
            }
            cellIdx++;
        }
        // If the notebook is not fully rendered
        if (cellIdx < this.cellsArray.length) {
            // If we are deferring the cell rendering and the rendered cells do
            // not fill the viewport yet
            if (this.notebookConfig.windowingMode === 'defer' &&
                this.viewportNode.clientHeight < this.node.clientHeight) {
                // Spend more time rendering cells to fill the viewport
                await this._runOnIdleTime();
            }
            else {
                this._scheduleCellRenderOnIdle();
            }
        }
        else {
            if (this._idleCallBack) {
                window.cancelIdleCallback(this._idleCallBack);
                this._idleCallBack = null;
            }
        }
    }
    async _updateForDeferMode(cell, cellIdx) {
        cell.dataset.windowedListIndex = `${cellIdx}`;
        this.layout.insertWidget(cellIdx, cell);
        await cell.ready;
    }
    /**
     * Apply updated notebook settings.
     */
    _updateNotebookConfig() {
        // Apply scrollPastEnd setting.
        this.toggleClass('jp-mod-scrollPastEnd', this._notebookConfig.scrollPastEnd);
        // Control visibility of heading collapser UI
        this.toggleClass(HEADING_COLLAPSER_VISBILITY_CONTROL_CLASS, this._notebookConfig.showHiddenCellsButton);
        // Control editor visibility for read-only Markdown cells
        const showEditorForReadOnlyMarkdown = this._notebookConfig.showEditorForReadOnlyMarkdown;
        if (showEditorForReadOnlyMarkdown !== undefined) {
            for (const cell of this.cellsArray) {
                if (cell.model.type === 'markdown') {
                    cell.showEditorForReadOnly =
                        showEditorForReadOnlyMarkdown;
                }
            }
        }
        this.viewModel.windowingActive =
            this._notebookConfig.windowingMode === 'full';
        // Apply content visibility when notebook settings update (without reload)
        const isContentVisibility = this._notebookConfig.windowingMode === 'contentVisibility';
        this.viewportNode.classList.toggle('jp-content-visibility-mode', isContentVisibility);
        if (isContentVisibility) {
            requestAnimationFrame(() => {
                this.cellsArray.forEach((cell, i) => {
                    const estHeight = this._viewModel.estimateWidgetSize(i);
                    cell.node.style.containIntrinsicSize = `auto ${estHeight}px`;
                });
            });
            this._setupContentVisibilityObserver();
        }
        else {
            // Remove intrinsic size styling when disabling content visibility
            this.cellsArray.forEach(cell => {
                cell.node.style.removeProperty('contain-intrinsic-size');
                cell.node.style.removeProperty('content-visibility');
                cell.node.style.removeProperty('contain');
            });
            // Disconnect observer if it exists
            if (this._contentVisibilityObserver) {
                this._contentVisibilityObserver.disconnect();
                this._contentVisibilityObserver = null;
            }
        }
    }
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        // Apply content visibility when notebook widget is attached to the DOM
        if (this._notebookConfig.windowingMode === 'contentVisibility') {
            this.viewportNode.classList.toggle('jp-content-visibility-mode', true);
            // Update intrinsic sizes for all cells initially
            requestAnimationFrame(() => {
                this.cellsArray.forEach((cell, i) => {
                    const estHeight = this._viewModel.estimateWidgetSize(i);
                    cell.node.style.containIntrinsicSize = `auto ${estHeight}px`;
                    cell.node.style.contentVisibility = 'auto';
                    cell.node.style.contain = 'layout style paint';
                });
            });
            // Use the real browser viewport for visibility detection
            this._setupContentVisibilityObserver();
        }
    }
    _setupContentVisibilityObserver() {
        var _a;
        if (!this._contentVisibilityObserver) {
            // Create observer only once
            this._contentVisibilityObserver = new IntersectionObserver(entries => {
                for (const entry of entries) {
                    const cell = entry.target;
                    if (entry.isIntersecting) {
                        cell.style.contentVisibility = 'visible';
                        cell.style.contain = 'style';
                    }
                    else {
                        cell.style.contentVisibility = 'auto';
                        cell.style.contain = 'layout style paint';
                    }
                }
            }, { root: null, threshold: 0.1 });
        }
        // Observe all existing cells
        this.cellsArray.forEach(cell => this._contentVisibilityObserver.observe(cell.node));
        // Watch for newly added cells and set intrinsic size for them too
        (_a = this.model) === null || _a === void 0 ? void 0 : _a.cells.changed.connect(() => {
            requestAnimationFrame(() => {
                this.cellsArray.forEach((cell, i) => {
                    const estHeight = this._viewModel.estimateWidgetSize(i);
                    cell.node.style.containIntrinsicSize = `auto ${estHeight}px`;
                    this._contentVisibilityObserver.observe(cell.node);
                });
            });
        });
    }
}
/**
 * The namespace for the `StaticNotebook` class statics.
 */
(function (StaticNotebook) {
    /**
     * Default configuration options for cell editors.
     */
    StaticNotebook.defaultEditorConfig = {
        code: {
            lineNumbers: false,
            lineWrap: false,
            matchBrackets: true,
            tabFocusable: false
        },
        markdown: {
            lineNumbers: false,
            lineWrap: true,
            matchBrackets: false,
            tabFocusable: false
        },
        raw: {
            lineNumbers: false,
            lineWrap: true,
            matchBrackets: false,
            tabFocusable: false
        }
    };
    /**
     * Default configuration options for notebooks.
     */
    StaticNotebook.defaultNotebookConfig = {
        enableKernelInitNotification: false,
        showHiddenCellsButton: true,
        scrollPastEnd: true,
        defaultCell: 'code',
        recordTiming: false,
        inputHistoryScope: 'global',
        maxNumberOutputs: 50,
        showEditorForReadOnlyMarkdown: true,
        disableDocumentWideUndoRedo: true,
        autoRenderMarkdownCells: false,
        renderingLayout: 'default',
        sideBySideLeftMarginOverride: '10px',
        sideBySideRightMarginOverride: '10px',
        sideBySideOutputRatio: 1,
        overscanCount: 1,
        windowingMode: 'contentVisibility',
        accessKernelHistory: false,
        showInputPlaceholder: true,
        showMinimap: false
    };
    /**
     * The default implementation of an `IContentFactory`.
     */
    class ContentFactory extends lib_index_js_.Cell.ContentFactory {
        /**
         * Create a new code cell widget.
         *
         * #### Notes
         * If no cell content factory is passed in with the options, the one on the
         * notebook content factory is used.
         */
        createCodeCell(options) {
            return new lib_index_js_.CodeCell(options).initializeState();
        }
        /**
         * Create a new markdown cell widget.
         *
         * #### Notes
         * If no cell content factory is passed in with the options, the one on the
         * notebook content factory is used.
         */
        createMarkdownCell(options) {
            return new lib_index_js_.MarkdownCell(options).initializeState();
        }
        /**
         * Create a new raw cell widget.
         *
         * #### Notes
         * If no cell content factory is passed in with the options, the one on the
         * notebook content factory is used.
         */
        createRawCell(options) {
            return new lib_index_js_.RawCell(options).initializeState();
        }
    }
    StaticNotebook.ContentFactory = ContentFactory;
})(StaticNotebook || (StaticNotebook = {}));
/**
 * A virtual scrollbar item representing a notebook cell.
 */
class ScrollbarItem {
    /**
     * Construct a scrollbar item.
     */
    constructor(options) {
        /**
         * Render the scrollbar item as an HTML element.
         */
        this.render = (props) => {
            if (!this._element) {
                this._element = this._createElement();
                this._notebook.activeCellChanged.connect(this._updateActive);
                this._notebook.selectionChanged.connect(this._updateSelection);
                if (this._model.type === 'code') {
                    const model = this._model;
                    model.outputs.changed.connect(this._updatePrompt);
                    model.stateChanged.connect(this._updateState);
                }
            }
            // Add cell type (code/markdown/raw)
            if (this._model.type != this._element.dataset.type) {
                this._element.dataset.type = this._model.type;
            }
            const source = this._model.sharedModel.source;
            const trimmedSource = source.length > 10000 ? source.substring(0, 10000) : source;
            if (trimmedSource !== this._source.textContent) {
                this._source.textContent = trimmedSource;
            }
            this._updateActive();
            this._updateSelection();
            this._updatePrompt();
            this._updateDirty();
            return this._element;
        };
        /**
         * Dispose of the resources held by the item.
         */
        this.dispose = () => {
            this._isDisposed = true;
            this._notebook.activeCellChanged.disconnect(this._updateActive);
            this._notebook.selectionChanged.disconnect(this._updateSelection);
            if (this._model.type === 'code') {
                const model = this._model;
                if (model.outputs) {
                    model.outputs.changed.disconnect(this._updatePrompt);
                    model.stateChanged.disconnect(this._updateState);
                }
            }
        };
        this._updateState = (_, change) => {
            // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
            switch (change.name) {
                case 'executionCount':
                case 'executionState':
                    this._updatePrompt();
                    break;
                case 'isDirty': {
                    this._updateDirty();
                    break;
                }
            }
        };
        this._updatePrompt = () => {
            if (this._model.type !== 'code') {
                return;
            }
            const model = this._model;
            let hasError = false;
            for (let i = 0; i < model.outputs.length; i++) {
                const output = model.outputs.get(i);
                if (output.type === 'error') {
                    hasError = true;
                    break;
                }
            }
            let content;
            let state = '';
            if (hasError) {
                content = '[!]';
                state = 'error';
            }
            else if (model.executionState == 'running') {
                content = '[*]';
            }
            else if (model.executionCount) {
                content = `[${model.executionCount}]`;
            }
            else {
                content = '[ ]';
            }
            if (this._executionIndicator.textContent !== content) {
                this._executionIndicator.textContent = content;
            }
            if (this._element.dataset.output !== state) {
                this._element.dataset.output = state;
            }
        };
        this._updateActive = () => {
            var _a;
            if (!this._element) {
                this._element = this._createElement();
            }
            const li = this._element;
            const wasActive = li.classList.contains(ACTIVE_CLASS);
            if (((_a = this._notebook.activeCell) === null || _a === void 0 ? void 0 : _a.model) === this._model) {
                if (!wasActive) {
                    li.classList.add(ACTIVE_CLASS);
                }
            }
            else if (wasActive) {
                li.classList.remove(ACTIVE_CLASS);
                // Needed due to order in which selection and active changed signals fire
                li.classList.remove(SELECTED_CLASS);
            }
        };
        this._updateSelection = () => {
            if (!this._element) {
                this._element = this._createElement();
            }
            const li = this._element;
            const wasSelected = li.classList.contains(SELECTED_CLASS);
            if (this._notebook.selectedCells.some(cell => this._model === cell.model)) {
                if (!wasSelected) {
                    li.classList.add(SELECTED_CLASS);
                }
            }
            else if (wasSelected) {
                li.classList.remove(SELECTED_CLASS);
            }
        };
        this._isDisposed = false;
        this._element = null;
        // Note: there should be no DOM operations in the constructor
        this._model = options.model;
        this._notebook = options.notebook;
    }
    /**
     * Unique item key used for caching.
     */
    get key() {
        return this._model.id;
    }
    /**
     * Test whether the item has been disposed.
     */
    get isDisposed() {
        // Ensure the state is up-to-date in case if the model was disposed
        // (the model can be disposed when cells are moved/recreated).
        if (!this._isDisposed && this._model.isDisposed) {
            this.dispose();
        }
        return this._isDisposed;
    }
    _updateDirty() {
        if (this._model.type !== 'code' || !this._element) {
            return;
        }
        const model = this._model;
        const wasDirty = this._element.classList.contains(DIRTY_CLASS);
        if (wasDirty !== model.isDirty) {
            if (model.isDirty) {
                this._element.classList.add(DIRTY_CLASS);
            }
            else {
                this._element.classList.remove(DIRTY_CLASS);
            }
        }
    }
    _createElement() {
        const li = document.createElement('li');
        const executionIndicator = (this._executionIndicator =
            document.createElement('div'));
        executionIndicator.className = 'jp-scrollbarItem-executionIndicator';
        const source = (this._source = document.createElement('div'));
        source.className = 'jp-scrollbarItem-source';
        li.append(executionIndicator);
        li.append(source);
        return li;
    }
}
/**
 * A notebook widget that supports interactivity.
 */
class Notebook extends StaticNotebook {
    /**
     * Construct a notebook widget.
     */
    constructor(options) {
        super({
            renderer: {
                createOuter() {
                    return document.createElement('div');
                },
                createViewport() {
                    const el = document.createElement('div');
                    el.setAttribute('role', 'feed');
                    el.setAttribute('aria-label', 'Cells');
                    return el;
                },
                createScrollbar() {
                    return document.createElement('ol');
                },
                createScrollbarViewportIndicator() {
                    return document.createElement('div');
                },
                createScrollbarItem(notebook, _index, model) {
                    return new ScrollbarItem({
                        notebook,
                        model
                    });
                }
            },
            ...options
        });
        this._activeCellIndex = -1;
        this._activeCell = null;
        this._mode = 'command';
        this._drag = null;
        this._dragData = null;
        this._selectData = null;
        this._mouseMode = null;
        this._activeCellChanged = new dist_index_es6_js_.Signal(this);
        this._stateChanged = new dist_index_es6_js_.Signal(this);
        this._selectionChanged = new dist_index_es6_js_.Signal(this);
        this._cellsPasted = new dist_index_es6_js_.Signal(this);
        this._localCopy = [];
        this._checkCacheOnNextResize = false;
        this._lastClipboardInteraction = null;
        this._selectedCells = [];
        // Allow the node to scroll while dragging items.
        this.outerNode.setAttribute('data-lm-dragscroll', 'true');
        this.activeCellChanged.connect(this._updateSelectedCells, this);
        this.jumped.connect((_, index) => (this.activeCellIndex = index));
        this.selectionChanged.connect(this._updateSelectedCells, this);
        this.addFooter();
    }
    /**
     * List of selected and active cells
     */
    get selectedCells() {
        return this._selectedCells;
    }
    /**
     * Adds a footer to the notebook.
     */
    addFooter() {
        const info = new NotebookFooter(this);
        this.layout.footer = info;
    }
    /**
     * Handle a change cells event.
     */
    _onCellsChanged(sender, args) {
        var _a, _b;
        const activeCellId = (_a = this.activeCell) === null || _a === void 0 ? void 0 : _a.model.id;
        super._onCellsChanged(sender, args);
        if (activeCellId) {
            const newActiveCellIndex = (_b = this.model) === null || _b === void 0 ? void 0 : _b.sharedModel.cells.findIndex(cell => cell.getId() === activeCellId);
            if (newActiveCellIndex != null) {
                this.activeCellIndex = newActiveCellIndex;
            }
        }
    }
    /**
     * A signal emitted when the active cell changes.
     *
     * #### Notes
     * This can be due to the active index changing or the
     * cell at the active index changing.
     */
    get activeCellChanged() {
        return this._activeCellChanged;
    }
    /**
     * A signal emitted when the state of the notebook changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * A signal emitted when the selection state of the notebook changes.
     */
    get selectionChanged() {
        return this._selectionChanged;
    }
    /**
     * A signal emitted when cells are pasted to the notebook.
     */
    get cellsPasted() {
        return this._cellsPasted;
    }
    /**
     * The interactivity mode of the notebook.
     */
    get mode() {
        return this._mode;
    }
    set mode(newValue) {
        this.setMode(newValue);
    }
    /**
     * Set the notebook mode.
     *
     * @param newValue Notebook mode
     * @param options Control mode side-effect
     * @param options.focus Whether to ensure focus (default) or not when setting the mode.
     */
    setMode(newValue, options = {}) {
        var _a;
        const setFocus = (_a = options.focus) !== null && _a !== void 0 ? _a : true;
        const activeCell = this.activeCell;
        if (!activeCell) {
            newValue = 'command';
        }
        if (newValue === this._mode) {
            if (setFocus) {
                this._ensureFocus();
            }
            return;
        }
        // Post an update request.
        this.update();
        const oldValue = this._mode;
        this._mode = newValue;
        if (newValue === 'edit') {
            // Edit mode deselects all cells.
            for (const widget of this.widgets) {
                this.deselect(widget);
            }
            // Edit mode unrenders an active markdown widget.
            if (activeCell instanceof lib_index_js_.MarkdownCell) {
                activeCell.rendered = false;
            }
            activeCell.inputHidden = false;
        }
        else {
            if (setFocus) {
                void NotebookActions.focusActiveCell(this, {
                    // Do not await the active cell because that creates a bug. If the user
                    // is editing a code cell and presses Accel Shift C to open the command
                    // palette, then the command palette opens before
                    // activeCell.node.focus() is called, which closes the command palette.
                    // To the end user, it looks as if all the keyboard shortcut did was
                    // move focus from the cell editor to the cell as a whole.
                    waitUntilReady: false,
                    preventScroll: true
                });
            }
        }
        this._stateChanged.emit({ name: 'mode', oldValue, newValue });
        if (setFocus) {
            this._ensureFocus();
        }
    }
    /**
     * The active cell index of the notebook.
     *
     * #### Notes
     * The index will be clamped to the bounds of the notebook cells.
     */
    get activeCellIndex() {
        if (!this.model) {
            return -1;
        }
        return this.widgets.length ? this._activeCellIndex : -1;
    }
    set activeCellIndex(newValue) {
        var _a, _b;
        const oldValue = this._activeCellIndex;
        if (!this.model || !this.widgets.length) {
            newValue = -1;
        }
        else {
            newValue = Math.max(newValue, 0);
            newValue = Math.min(newValue, this.widgets.length - 1);
        }
        this._activeCellIndex = newValue;
        const oldCell = (_a = this.widgets[oldValue]) !== null && _a !== void 0 ? _a : null;
        const cell = (_b = this.widgets[newValue]) !== null && _b !== void 0 ? _b : null;
        this.layout.activeCell = cell;
        const cellChanged = cell !== this._activeCell;
        if (cellChanged) {
            // Post an update request.
            this.update();
            this._activeCell = cell;
        }
        if (cellChanged || newValue != oldValue) {
            this._activeCellChanged.emit(cell);
        }
        if (this.mode === 'edit') {
            if (cell instanceof lib_index_js_.MarkdownCell) {
                cell.rendered = false;
            }
            if (this.notebookConfig.autoRenderMarkdownCells &&
                cellChanged &&
                oldCell instanceof lib_index_js_.MarkdownCell) {
                oldCell.rendered = true;
            }
        }
        this._ensureFocus();
        if (newValue === oldValue) {
            return;
        }
        this._trimSelections();
        this._stateChanged.emit({ name: 'activeCellIndex', oldValue, newValue });
    }
    /**
     * Get the active cell widget.
     *
     * #### Notes
     * This is a cell or `null` if there is no active cell.
     */
    get activeCell() {
        return this._activeCell;
    }
    get lastClipboardInteraction() {
        return this._lastClipboardInteraction;
    }
    set lastClipboardInteraction(newValue) {
        this._lastClipboardInteraction = newValue;
    }
    /**
     * This function should be called when a clipboard interaction involve notebook cells.
     *
     * @param interaction - the clipboard interaction (copy, cut or paste).
     * @param cells - the cells copied, cut or pasted.
     */
    recordCellClipboardInteraction(interaction, cells) {
        const lastInteraction = this._lastClipboardInteraction;
        if (interaction === 'copy' || interaction === 'cut') {
            this._localCopy = cells;
        }
        else if (interaction === 'paste') {
            const pasted = cells;
            // Check if the current clipboard match the previously copied/cut cells.
            const isLocal = index_es6_js_.ArrayExt.shallowEqual(pasted, this._localCopy, dist_index_js_.JSONExt.deepEqual);
            // Emit a signal with the last interaction and the number of pasted cells.
            this._cellsPasted.emit({
                previousInteraction: isLocal ? lastInteraction : null,
                cellCount: pasted.length
            });
        }
        // Update the last clipboard interaction.
        this.lastClipboardInteraction = interaction;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._activeCell = null;
        super.dispose();
    }
    /**
     * Move cells preserving widget view state.
     *
     * #### Notes
     * This is required because at the model level a move is a deletion
     * followed by an insertion. Hence the view state is not preserved.
     *
     * @param from The index of the cell to move
     * @param to The new index of the cell
     * @param n Number of cells to move
     */
    moveCell(from, to, n = 1) {
        // Save active cell id to be restored
        const newActiveCellIndex = from <= this.activeCellIndex && this.activeCellIndex < from + n
            ? this.activeCellIndex + to - from - (from > to ? 0 : n - 1)
            : -1;
        const isSelected = this.widgets
            .slice(from, from + n)
            .map(w => this.isSelected(w));
        super.moveCell(from, to, n);
        if (newActiveCellIndex >= 0) {
            this.activeCellIndex = newActiveCellIndex;
        }
        if (from > to) {
            isSelected.forEach((selected, idx) => {
                if (selected) {
                    this.select(this.widgets[to + idx]);
                }
            });
        }
        else {
            isSelected.forEach((selected, idx) => {
                if (selected) {
                    this.select(this.widgets[to - n + 1 + idx]);
                }
            });
        }
    }
    /**
     * Select a cell widget.
     *
     * #### Notes
     * It is a no-op if the value does not change.
     * It will emit the `selectionChanged` signal.
     */
    select(widget) {
        if (widget_Private.selectedProperty.get(widget)) {
            return;
        }
        widget_Private.selectedProperty.set(widget, true);
        this._selectionChanged.emit(void 0);
        this.update();
    }
    /**
     * Deselect a cell widget.
     *
     * #### Notes
     * It is a no-op if the value does not change.
     * It will emit the `selectionChanged` signal.
     */
    deselect(widget) {
        if (!widget_Private.selectedProperty.get(widget)) {
            return;
        }
        widget_Private.selectedProperty.set(widget, false);
        this._selectionChanged.emit(void 0);
        this.update();
    }
    /**
     * Whether a cell is selected.
     */
    isSelected(widget) {
        return widget_Private.selectedProperty.get(widget);
    }
    /**
     * Whether a cell is selected or is the active cell.
     */
    isSelectedOrActive(widget) {
        if (widget === this._activeCell) {
            return true;
        }
        return widget_Private.selectedProperty.get(widget);
    }
    /**
     * Deselect all of the cells.
     */
    deselectAll() {
        let changed = false;
        for (const widget of this.widgets) {
            if (widget_Private.selectedProperty.get(widget)) {
                changed = true;
            }
            widget_Private.selectedProperty.set(widget, false);
        }
        if (changed) {
            this._selectionChanged.emit(void 0);
        }
        // Make sure we have a valid active cell.
        this.activeCellIndex = this.activeCellIndex; // eslint-disable-line
        this.update();
    }
    /**
     * Move the head of an existing contiguous selection to extend the selection.
     *
     * @param index - The new head of the existing selection.
     *
     * #### Notes
     * If there is no existing selection, the active cell is considered an
     * existing one-cell selection.
     *
     * If the new selection is a single cell, that cell becomes the active cell
     * and all cells are deselected.
     *
     * There is no change if there are no cells (i.e., activeCellIndex is -1).
     */
    extendContiguousSelectionTo(index) {
        let { head, anchor } = this.getContiguousSelection();
        let i;
        // Handle the case of no current selection.
        if (anchor === null || head === null) {
            if (index === this.activeCellIndex) {
                // Already collapsed selection, nothing more to do.
                return;
            }
            // We will start a new selection below.
            head = this.activeCellIndex;
            anchor = this.activeCellIndex;
        }
        // Move the active cell. We do this before the collapsing shortcut below.
        this.activeCellIndex = index;
        // Make sure the index is valid, according to the rules for setting and clipping the
        // active cell index. This may change the index.
        index = this.activeCellIndex;
        // Collapse the selection if it is only the active cell.
        if (index === anchor) {
            this.deselectAll();
            return;
        }
        let selectionChanged = false;
        if (head < index) {
            if (head < anchor) {
                widget_Private.selectedProperty.set(this.widgets[head], false);
                selectionChanged = true;
            }
            // Toggle everything strictly between head and index except anchor.
            for (i = head + 1; i < index; i++) {
                if (i !== anchor) {
                    widget_Private.selectedProperty.set(this.widgets[i], !widget_Private.selectedProperty.get(this.widgets[i]));
                    selectionChanged = true;
                }
            }
        }
        else if (index < head) {
            if (anchor < head) {
                widget_Private.selectedProperty.set(this.widgets[head], false);
                selectionChanged = true;
            }
            // Toggle everything strictly between index and head except anchor.
            for (i = index + 1; i < head; i++) {
                if (i !== anchor) {
                    widget_Private.selectedProperty.set(this.widgets[i], !widget_Private.selectedProperty.get(this.widgets[i]));
                    selectionChanged = true;
                }
            }
        }
        // Anchor and index should *always* be selected.
        if (!widget_Private.selectedProperty.get(this.widgets[anchor])) {
            selectionChanged = true;
        }
        widget_Private.selectedProperty.set(this.widgets[anchor], true);
        if (!widget_Private.selectedProperty.get(this.widgets[index])) {
            selectionChanged = true;
        }
        widget_Private.selectedProperty.set(this.widgets[index], true);
        if (selectionChanged) {
            this._selectionChanged.emit(void 0);
        }
    }
    /**
     * Get the head and anchor of a contiguous cell selection.
     *
     * The head of a contiguous selection is always the active cell.
     *
     * If there are no cells selected, `{head: null, anchor: null}` is returned.
     *
     * Throws an error if the currently selected cells do not form a contiguous
     * selection.
     */
    getContiguousSelection() {
        const cells = this.widgets;
        const first = index_es6_js_.ArrayExt.findFirstIndex(cells, c => this.isSelected(c));
        // Return early if no cells are selected.
        if (first === -1) {
            return { head: null, anchor: null };
        }
        const last = index_es6_js_.ArrayExt.findLastIndex(cells, c => this.isSelected(c), -1, first);
        // Check that the selection is contiguous.
        for (let i = first; i <= last; i++) {
            if (!this.isSelected(cells[i])) {
                throw new Error('Selection not contiguous');
            }
        }
        // Check that the active cell is one of the endpoints of the selection.
        const activeIndex = this.activeCellIndex;
        if (first !== activeIndex && last !== activeIndex) {
            throw new Error('Active cell not at endpoint of selection');
        }
        // Determine the head and anchor of the selection.
        if (first === activeIndex) {
            return { head: first, anchor: last };
        }
        else {
            return { head: last, anchor: first };
        }
    }
    /**
     * Scroll so that the given cell is in view. Selects and activates cell.
     *
     * @param cell - A cell in the notebook widget.
     * @param align - Type of alignment.
     *
     */
    async scrollToCell(cell, align = 'auto') {
        try {
            await this.scrollToItem(this.widgets.findIndex(c => c === cell), align);
        }
        catch (r) {
            //no-op
        }
        // change selection and active cell:
        this.deselectAll();
        this.select(cell);
        cell.activate();
    }
    _parseFragment(fragment) {
        const cleanedFragment = fragment.slice(1);
        if (!cleanedFragment) {
            // Bail early
            return;
        }
        const parts = cleanedFragment.split('=');
        if (parts.length === 1) {
            // Default to legacy if no prefix is given.
            return {
                kind: 'legacy',
                value: cleanedFragment
            };
        }
        return {
            kind: parts[0],
            value: parts.slice(1).join('=')
        };
    }
    /**
     * Set URI fragment identifier.
     */
    async setFragment(fragment) {
        const parsedFragment = this._parseFragment(fragment);
        if (!parsedFragment) {
            // Bail early
            return;
        }
        let result;
        switch (parsedFragment.kind) {
            case 'heading':
                result = await this._findHeading(parsedFragment.value);
                break;
            case 'cell-id':
                result = this._findCellById(parsedFragment.value);
                break;
            case 'legacy':
                result = await this._findLegacy(parsedFragment.value);
                break;
            default:
                console.warn(`Unknown target type for URI fragment ${fragment}, interpreting as a heading`);
                result = await this._findLegacy(parsedFragment.kind + '=' + parsedFragment.value);
                break;
        }
        if (result == null) {
            return;
        }
        let { cell, element } = result;
        if (!cell.inViewport) {
            await this.scrollToCell(cell, 'center');
        }
        if (element == null) {
            element = cell.node;
        }
        // Scroll notebook to set the target on top.
        element.scrollIntoView();
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the notebook panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        if (!this.model) {
            return;
        }
        switch (event.type) {
            case 'contextmenu':
                if (event.eventPhase === Event.CAPTURING_PHASE) {
                    this._evtContextMenuCapture(event);
                }
                break;
            case 'mousedown':
                if (event.eventPhase === Event.CAPTURING_PHASE) {
                    this._evtMouseDownCapture(event);
                }
                else {
                    // Skip processing the event when it resulted from a toolbar button click
                    if (!event.defaultPrevented) {
                        this._evtMouseDown(event);
                    }
                }
                break;
            case 'mouseup':
                if (event.currentTarget === document) {
                    this._evtDocumentMouseup(event);
                }
                break;
            case 'mousemove':
                if (event.currentTarget === document) {
                    this._evtDocumentMousemove(event);
                }
                break;
            case 'keydown':
                // This works because CodeMirror does not stop the event propagation
                this._ensureFocus(true);
                break;
            case 'dblclick':
                this._evtDblClick(event);
                break;
            case 'focusin':
                this._evtFocusIn(event);
                break;
            case 'focusout':
                this._evtFocusOut(event);
                break;
            case 'lm-dragenter':
                this._evtDragEnter(event);
                break;
            case 'lm-dragleave':
                this._evtDragLeave(event);
                break;
            case 'lm-dragover':
                this._evtDragOver(event);
                break;
            case 'lm-drop':
                this._evtDrop(event);
                break;
            default:
                super.handleEvent(event);
                break;
        }
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        const node = this.node;
        node.addEventListener('contextmenu', this, true);
        node.addEventListener('mousedown', this, true);
        node.addEventListener('mousedown', this);
        node.addEventListener('keydown', this);
        node.addEventListener('dblclick', this);
        node.addEventListener('focusin', this);
        node.addEventListener('focusout', this);
        // Capture drag events for the notebook widget
        // in order to preempt the drag/drop handlers in the
        // code editor widgets, which can take text data.
        node.addEventListener('lm-dragenter', this, true);
        node.addEventListener('lm-dragleave', this, true);
        node.addEventListener('lm-dragover', this, true);
        node.addEventListener('lm-drop', this, true);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        const node = this.node;
        node.removeEventListener('contextmenu', this, true);
        node.removeEventListener('mousedown', this, true);
        node.removeEventListener('mousedown', this);
        node.removeEventListener('keydown', this);
        node.removeEventListener('dblclick', this);
        node.removeEventListener('focusin', this);
        node.removeEventListener('focusout', this);
        node.removeEventListener('lm-dragenter', this, true);
        node.removeEventListener('lm-dragleave', this, true);
        node.removeEventListener('lm-dragover', this, true);
        node.removeEventListener('lm-drop', this, true);
        document.removeEventListener('mousemove', this, true);
        document.removeEventListener('mouseup', this, true);
        super.onBeforeDetach(msg);
    }
    /**
     * A message handler invoked on an `'after-show'` message.
     */
    onAfterShow(msg) {
        super.onAfterShow(msg);
        this._checkCacheOnNextResize = true;
    }
    /**
     * A message handler invoked on a `'resize'` message.
     */
    onResize(msg) {
        var _a;
        // TODO
        if (!this._checkCacheOnNextResize) {
            return super.onResize(msg);
        }
        super.onResize(msg);
        this._checkCacheOnNextResize = false;
        const cache = this._cellLayoutStateCache;
        const width = parseInt(this.node.style.width, 10);
        if (cache) {
            if (width === cache.width) {
                // Cache identical, do nothing
                return;
            }
        }
        // Update cache
        this._cellLayoutStateCache = { width };
        // Fallback:
        for (const w of this.widgets) {
            if (w instanceof lib_index_js_.Cell && w.inViewport) {
                (_a = w.editorWidget) === null || _a === void 0 ? void 0 : _a.update();
            }
        }
    }
    /**
     * A message handler invoked on an `'before-hide'` message.
     */
    onBeforeHide(msg) {
        super.onBeforeHide(msg);
        // Update cache
        const width = parseInt(this.node.style.width, 10);
        this._cellLayoutStateCache = { width };
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        super.onActivateRequest(msg);
        this._ensureFocus(true);
    }
    /**
     * Handle `update-request` messages sent to the widget.
     */
    onUpdateRequest(msg) {
        super.onUpdateRequest(msg);
        const activeCell = this.activeCell;
        // Set the appropriate classes on the cells.
        if (this.mode === 'edit') {
            this.addClass(EDIT_CLASS);
            this.removeClass(COMMAND_CLASS);
        }
        else {
            this.addClass(COMMAND_CLASS);
            this.removeClass(EDIT_CLASS);
        }
        let count = 0;
        for (const widget of this.widgets) {
            // Set tabIndex to -1 to allow calling .focus() on cell without allowing
            // focus via tab key. This allows focus (document.activeElement) to move
            // up and down the document, cell by cell, when the user presses J/K or
            // ArrowDown/ArrowUp, but (unlike tabIndex = 0) does not add the notebook
            // cells (which could be numerous) to the set of nodes that the user would
            // have to visit when pressing the tab key to move about the UI.
            // NOTE: we need to be very careful to avoid modifying DOM to avoid triggering layout on scroll
            if (widget === activeCell) {
                activeCell.addClass(ACTIVE_CLASS);
                activeCell.addClass(SELECTED_CLASS);
                // Set tab index to 0 on the active cell so that if the user tabs away from
                // the notebook then tabs back, they will return to the cell where they
                // left off.
                activeCell.node.tabIndex = 0;
            }
            else {
                widget.node.tabIndex = -1;
                widget.removeClass(ACTIVE_CLASS);
                widget.removeClass(OTHER_SELECTED_CLASS);
            }
            if (this.isSelectedOrActive(widget)) {
                widget.addClass(SELECTED_CLASS);
                count++;
            }
            else {
                widget.removeClass(SELECTED_CLASS);
            }
        }
        if (activeCell && count > 1) {
            activeCell.addClass(OTHER_SELECTED_CLASS);
        }
    }
    /**
     * Handle a cell being inserted.
     */
    onCellInserted(index, cell) {
        void cell.ready.then(() => {
            if (!cell.isDisposed) {
                cell.editor.edgeRequested.connect(this._onEdgeRequest, this);
            }
        });
        cell.scrollRequested.connect((_emitter, scrollRequest) => {
            if (cell !== this.activeCell) {
                // Do nothing for cells other than the active cell
                // to avoid scroll requests from editor extensions
                // stealing user focus (this may be revisited).
                return;
            }
            if (!scrollRequest.defaultPrevented) {
                // Nothing to do if scroll request was already handled.
                return;
            }
            // Node which allows to scroll the notebook
            const scroller = this.outerNode;
            if (cell.inViewport) {
                // If cell got scrolled to the viewport in the meantime,
                // proceed with scrolling within the cell.
                return scrollRequest.scrollWithinCell({ scroller });
            }
            // If cell is not in the viewport and needs scrolling,
            // first scroll to the cell and then scroll within the cell.
            this.scrollToItem(this.activeCellIndex)
                .then(() => {
                void cell.ready.then(() => {
                    scrollRequest.scrollWithinCell({ scroller });
                });
            })
                .catch(reason => {
                // no-op
            });
        });
        // If the insertion happened above, increment the active cell
        // index, otherwise it stays the same.
        this.activeCellIndex =
            index <= this.activeCellIndex
                ? this.activeCellIndex + 1
                : this.activeCellIndex;
    }
    /**
     * Handle a cell being removed.
     */
    onCellRemoved(index, cell) {
        // If the removal happened above, decrement the active
        // cell index, otherwise it stays the same.
        this.activeCellIndex =
            index <= this.activeCellIndex
                ? this.activeCellIndex - 1
                : this.activeCellIndex;
        if (this.isSelected(cell)) {
            this._selectionChanged.emit(void 0);
        }
    }
    /**
     * Handle a new model.
     */
    onModelChanged(oldValue, newValue) {
        super.onModelChanged(oldValue, newValue);
        // Try to set the active cell index to 0.
        // It will be set to `-1` if there is no new model or the model is empty.
        this.activeCellIndex = 0;
    }
    /**
     * Handle edge request signals from cells.
     */
    _onEdgeRequest(editor, location) {
        // Ensure edit mode but do not focus yet; we ensure the edit mode
        // with focus trigger at the end, as a side-effect of `this.mode = 'edit'`,
        // which could be simplified in the future.
        this.setMode('edit', { focus: false });
        const prev = this.activeCellIndex;
        if (location === 'top') {
            this.activeCellIndex--;
            // Move the cursor to the first position on the last line.
            if (this.activeCellIndex < prev) {
                const editor = this.activeCell.editor;
                if (editor) {
                    const lastLine = editor.lineCount - 1;
                    editor.setCursorPosition({ line: lastLine, column: 0 });
                }
            }
        }
        else if (location === 'bottom') {
            this.activeCellIndex++;
            // Move the cursor to the first character.
            if (this.activeCellIndex > prev) {
                const editor = this.activeCell.editor;
                if (editor) {
                    editor.setCursorPosition({ line: 0, column: 0 });
                }
            }
        }
        // This is potentially no longer needed with the `setMode` call at the top.
        this.mode = 'edit';
    }
    /**
     * Ensure that the notebook has proper focus.
     */
    _ensureFocus(force = false) {
        var _a, _b;
        // No-op is the footer has the focus.
        const footer = this.layout.footer;
        if (footer && document.activeElement === footer.node) {
            return;
        }
        const activeCell = this.activeCell;
        if (this.mode === 'edit' && activeCell) {
            // Test for !== true to cover hasFocus is false and editor is not yet rendered.
            if (((_a = activeCell.editor) === null || _a === void 0 ? void 0 : _a.hasFocus()) !== true) {
                if (activeCell.inViewport) {
                    (_b = activeCell.editor) === null || _b === void 0 ? void 0 : _b.focus();
                }
                else {
                    this.scrollToItem(this.activeCellIndex)
                        .then(() => {
                        void activeCell.ready.then(() => {
                            var _a;
                            (_a = activeCell.editor) === null || _a === void 0 ? void 0 : _a.focus();
                        });
                    })
                        .catch(reason => {
                        // no-op
                    });
                }
            }
        }
        if (force &&
            activeCell &&
            !activeCell.node.contains(document.activeElement)) {
            void NotebookActions.focusActiveCell(this, {
                preventScroll: true
            });
        }
    }
    /**
     * Find the cell index containing the target html element.
     *
     * #### Notes
     * Returns -1 if the cell is not found.
     */
    _findCell(node) {
        // Trace up the DOM hierarchy to find the root cell node.
        // Then find the corresponding child and select it.
        let n = node;
        while (n && n !== this.node) {
            if (n.classList.contains(NB_CELL_CLASS)) {
                const i = index_es6_js_.ArrayExt.findFirstIndex(this.widgets, widget => widget.node === n);
                if (i !== -1) {
                    return i;
                }
                break;
            }
            n = n.parentElement;
        }
        return -1;
    }
    /**
     * Find the target of html mouse event and cell index containing this target.
     *
     * #### Notes
     * Returned index is -1 if the cell is not found.
     */
    _findEventTargetAndCell(event) {
        let target = event.target;
        let index = this._findCell(target);
        if (index === -1) {
            // `event.target` sometimes gives an orphaned node in Firefox 57, which
            // can have `null` anywhere in its parent line. If we fail to find a cell
            // using `event.target`, try again using a target reconstructed from the
            // position of the click event.
            target = document.elementFromPoint(event.clientX, event.clientY);
            index = this._findCell(target);
        }
        return [target, index];
    }
    /**
     * Find heading with given ID in any of the cells.
     */
    async _findHeading(queryId) {
        var _a;
        // Loop on cells, get headings and search for first matching id.
        for (let cellIdx = 0; cellIdx < this.widgets.length; cellIdx++) {
            const cell = this.widgets[cellIdx];
            if (cell.model.type === 'raw' ||
                (cell.model.type === 'markdown' && !cell.rendered)) {
                // Bail early
                continue;
            }
            for (const heading of cell.headings) {
                let id = '';
                switch (heading.type) {
                    case lib_index_js_.Cell.HeadingType.HTML:
                        id = heading.id;
                        break;
                    case lib_index_js_.Cell.HeadingType.Markdown:
                        {
                            const mdHeading = heading;
                            id = await toc_lib_index_js_.TableOfContentsUtils.Markdown.getHeadingId(this.rendermime.markdownParser, mdHeading.raw, mdHeading.level, this.rendermime.sanitizer);
                        }
                        break;
                }
                if (id === queryId) {
                    const attribute = ((_a = this.rendermime.sanitizer.allowNamedProperties) !== null && _a !== void 0 ? _a : false)
                        ? 'id'
                        : 'data-jupyter-id';
                    const element = this.node.querySelector(`h${heading.level}[${attribute}="${CSS.escape(id)}"]`);
                    return {
                        cell,
                        element
                    };
                }
            }
        }
        return null;
    }
    /**
     * Find cell by its unique ID.
     */
    _findCellById(queryId) {
        for (let cellIdx = 0; cellIdx < this.widgets.length; cellIdx++) {
            const cell = this.widgets[cellIdx];
            if (cell.model.id === queryId) {
                return {
                    cell
                };
            }
        }
        return null;
    }
    /**
     * Find anchor target by any ID in any of the cell.
     */
    async _findLegacy(queryId) {
        var _a;
        // Loop on cells, search for first matching id.
        for (let cellIdx = 0; cellIdx < this.widgets.length; cellIdx++) {
            const cell = this.widgets[cellIdx];
            if (cell.model.type === 'raw' ||
                (cell.model.type === 'markdown' && !cell.rendered)) {
                // Bail early
                continue;
            }
            const attribute = ((_a = this.rendermime.sanitizer.allowNamedProperties) !== null && _a !== void 0 ? _a : false)
                ? 'id'
                : 'data-jupyter-id';
            const element = cell.node.querySelector(`[${attribute}="${CSS.escape(queryId)}"]`);
            if (element !== null) {
                return {
                    cell,
                    element: element
                };
            }
        }
        return null;
    }
    /**
     * Handle `contextmenu` event.
     */
    _evtContextMenuCapture(event) {
        var _a;
        // Allow the event to propagate un-modified if the user
        // is holding the shift-key (and probably requesting
        // the native context menu).
        if (event.shiftKey) {
            return;
        }
        const [target, index] = this._findEventTargetAndCell(event);
        const widget = this.widgets[index];
        if (widget && ((_a = widget.editorWidget) === null || _a === void 0 ? void 0 : _a.node.contains(target))) {
            // Prevent CodeMirror from focusing the editor.
            // TODO: find an editor-agnostic solution.
            event.preventDefault();
        }
    }
    /**
     * Handle `mousedown` event in the capture phase for the widget.
     */
    _evtMouseDownCapture(event) {
        var _a;
        const { button, shiftKey } = event;
        const [target, index] = this._findEventTargetAndCell(event);
        const widget = this.widgets[index];
        // On OS X, the context menu may be triggered with ctrl-left-click. In
        // Firefox, ctrl-left-click gives an event with button 2, but in Chrome,
        // ctrl-left-click gives an event with button 0 with the ctrl modifier.
        if (button === 2 &&
            !shiftKey &&
            widget &&
            ((_a = widget.editorWidget) === null || _a === void 0 ? void 0 : _a.node.contains(target))) {
            this.mode = 'command';
            // Prevent CodeMirror from focusing the editor.
            // TODO: find an editor-agnostic solution.
            event.preventDefault();
        }
    }
    /**
     * Handle `mousedown` events for the widget.
     */
    _evtMouseDown(event) {
        var _a, _b, _c;
        const { button, shiftKey } = event;
        // We only handle main or secondary button actions.
        if (!(button === 0 || button === 2)) {
            return;
        }
        // Shift right-click gives the browser default behavior.
        if (shiftKey && button === 2) {
            return;
        }
        const [target, index] = this._findEventTargetAndCell(event);
        const widget = this.widgets[index];
        let targetArea;
        if (widget) {
            if ((_a = widget.editorWidget) === null || _a === void 0 ? void 0 : _a.node.contains(target)) {
                targetArea = 'input';
            }
            else if ((_b = widget.promptNode) === null || _b === void 0 ? void 0 : _b.contains(target)) {
                targetArea = 'prompt';
            }
            else {
                targetArea = 'cell';
            }
        }
        else {
            targetArea = 'notebook';
        }
        // Make sure we go to command mode if the click isn't in the cell editor If
        // we do click in the cell editor, the editor handles the focus event to
        // switch to edit mode.
        if (targetArea !== 'input') {
            this.mode = 'command';
        }
        if (targetArea === 'notebook') {
            this.deselectAll();
        }
        else if (targetArea === 'prompt' || targetArea === 'cell') {
            // We don't want to prevent the default selection behavior
            // if there is currently text selected in an output.
            const hasSelection = ((_c = window.getSelection()) !== null && _c !== void 0 ? _c : '').toString() !== '';
            if (button === 0 &&
                shiftKey &&
                !hasSelection &&
                !['INPUT', 'OPTION'].includes(target.tagName)) {
                // Prevent browser selecting text in prompt or output
                event.preventDefault();
                // Shift-click - extend selection
                try {
                    this.extendContiguousSelectionTo(index);
                }
                catch (e) {
                    console.error(e);
                    this.deselectAll();
                    return;
                }
                // Enter selecting mode
                this._mouseMode = 'select';
                // We don't want to block the shift-click mouse up handler
                // when the current cell is (and remains) the active cell.
                this._selectData = {
                    startedOnActiveCell: index == this.activeCellIndex,
                    startingCellIndex: this.activeCellIndex
                };
                document.addEventListener('mouseup', this, true);
                document.addEventListener('mousemove', this, true);
            }
            else if (button === 0 && !shiftKey) {
                // Prepare to start a drag if we are on the drag region.
                if (targetArea === 'prompt') {
                    // Prepare for a drag start
                    this._dragData = {
                        pressX: event.clientX,
                        pressY: event.clientY,
                        index: index
                    };
                    // Enter possible drag mode
                    this._mouseMode = 'couldDrag';
                    document.addEventListener('mouseup', this, true);
                    document.addEventListener('mousemove', this, true);
                    event.preventDefault();
                }
                if (!this.isSelectedOrActive(widget)) {
                    this.deselectAll();
                    this.activeCellIndex = index;
                }
            }
            else if (button === 2) {
                if (!this.isSelectedOrActive(widget)) {
                    this.deselectAll();
                    this.activeCellIndex = index;
                }
                event.preventDefault();
            }
        }
        else if (targetArea === 'input') {
            if (button === 2 && !this.isSelectedOrActive(widget)) {
                this.deselectAll();
                this.activeCellIndex = index;
            }
        }
        // If we didn't set focus above, make sure we get focus now.
        this._ensureFocus(true);
    }
    /**
     * Handle the `'mouseup'` event on the document.
     */
    _evtDocumentMouseup(event) {
        const [, index] = this._findEventTargetAndCell(event);
        let shouldPreventDefault = true;
        if (this._mouseMode === 'select' && this._selectData) {
            // User did not move the mouse over to a difference cell, so there was no selection
            const { startedOnActiveCell, startingCellIndex } = this._selectData;
            if (startedOnActiveCell && index === startingCellIndex) {
                shouldPreventDefault = false;
            }
            this._selectData = null;
        }
        if (shouldPreventDefault) {
            event.preventDefault();
            event.stopPropagation();
        }
        // Remove the event listeners we put on the document
        document.removeEventListener('mousemove', this, true);
        document.removeEventListener('mouseup', this, true);
        if (this._mouseMode === 'couldDrag') {
            // We didn't end up dragging if we are here, so treat it as a click event.
            this.deselectAll();
            this.activeCellIndex = index;
            // Focus notebook if active cell changes but does not have focus.
            if (!this.activeCell.node.contains(document.activeElement)) {
                void NotebookActions.focusActiveCell(this);
            }
        }
        this._mouseMode = null;
    }
    /**
     * Handle the `'mousemove'` event for the widget.
     */
    _evtDocumentMousemove(event) {
        event.preventDefault();
        event.stopPropagation();
        // If in select mode, update the selection
        switch (this._mouseMode) {
            case 'select': {
                const target = event.target;
                const index = this._findCell(target);
                if (index !== -1) {
                    this.extendContiguousSelectionTo(index);
                }
                break;
            }
            case 'couldDrag': {
                // Check for a drag initialization.
                const data = this._dragData;
                const dx = Math.abs(event.clientX - data.pressX);
                const dy = Math.abs(event.clientY - data.pressY);
                if (dx >= DRAG_THRESHOLD || dy >= DRAG_THRESHOLD) {
                    this._mouseMode = null;
                    this._startDrag(data.index, event.clientX, event.clientY);
                }
                break;
            }
            default:
                break;
        }
    }
    /**
     * Handle the `'lm-dragenter'` event for the widget.
     */
    _evtDragEnter(event) {
        if (!event.mimeData.hasData(widget_JUPYTER_CELL_MIME)) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        const target = event.target;
        const index = this._findCell(target);
        if (index === -1) {
            return;
        }
        const widget = this.cellsArray[index];
        widget.node.classList.add(DROP_TARGET_CLASS);
    }
    /**
     * Handle the `'lm-dragleave'` event for the widget.
     */
    _evtDragLeave(event) {
        if (!event.mimeData.hasData(widget_JUPYTER_CELL_MIME)) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        const elements = this.node.getElementsByClassName(DROP_TARGET_CLASS);
        if (elements.length) {
            elements[0].classList.remove(DROP_TARGET_CLASS);
        }
    }
    /**
     * Handle the `'lm-dragover'` event for the widget.
     */
    _evtDragOver(event) {
        if (!event.mimeData.hasData(widget_JUPYTER_CELL_MIME)) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        event.dropAction = event.proposedAction;
        const elements = this.node.getElementsByClassName(DROP_TARGET_CLASS);
        if (elements.length) {
            elements[0].classList.remove(DROP_TARGET_CLASS);
        }
        const target = event.target;
        const index = this._findCell(target);
        if (index === -1) {
            return;
        }
        const widget = this.cellsArray[index];
        widget.node.classList.add(DROP_TARGET_CLASS);
    }
    /**
     * Handle the `'lm-drop'` event for the widget.
     */
    _evtDrop(event) {
        if (!event.mimeData.hasData(widget_JUPYTER_CELL_MIME)) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        if (event.proposedAction === 'none') {
            event.dropAction = 'none';
            return;
        }
        let target = event.target;
        while (target && target.parentElement) {
            if (target.classList.contains(DROP_TARGET_CLASS)) {
                target.classList.remove(DROP_TARGET_CLASS);
                break;
            }
            target = target.parentElement;
        }
        // Model presence should be checked before calling event handlers
        const model = this.model;
        const source = event.source;
        if (source === this) {
            // Handle the case where we are moving cells within
            // the same notebook.
            event.dropAction = 'move';
            const toMove = event.mimeData.getData('internal:cells');
            // For collapsed markdown headings with hidden "child" cells, move all
            // child cells as well as the markdown heading.
            const cell = toMove[toMove.length - 1];
            if (cell instanceof lib_index_js_.MarkdownCell && cell.headingCollapsed) {
                const nextParent = NotebookActions.findNextParentHeading(cell, source);
                if (nextParent > 0) {
                    const index = (0,index_es6_js_.findIndex)(source.widgets, (possibleCell) => {
                        return cell.model.id === possibleCell.model.id;
                    });
                    toMove.push(...source.widgets.slice(index + 1, nextParent));
                }
            }
            // Compute the to/from indices for the move.
            let fromIndex = index_es6_js_.ArrayExt.firstIndexOf(this.widgets, toMove[0]);
            let toIndex = this._findCell(target);
            // This check is needed for consistency with the view.
            if (toIndex !== -1 && toIndex > fromIndex) {
                toIndex -= 1;
            }
            else if (toIndex === -1) {
                // If the drop is within the notebook but not on any cell,
                // most often this means it is past the cell areas, so
                // set it to move the cells to the end of the notebook.
                toIndex = this.widgets.length - 1;
            }
            // Don't move if we are within the block of selected cells.
            if (toIndex >= fromIndex && toIndex < fromIndex + toMove.length) {
                return;
            }
            // Move the cells one by one
            this.moveCell(fromIndex, toIndex, toMove.length);
        }
        else {
            // Handle the case where we are copying cells between
            // notebooks.
            event.dropAction = 'copy';
            // Find the target cell and insert the copied cells.
            let index = this._findCell(target);
            if (index === -1) {
                index = this.widgets.length;
            }
            const start = index;
            const values = event.mimeData.getData(widget_JUPYTER_CELL_MIME);
            // Insert the copies of the original cells.
            // We preserve trust status of pasted cells by not modifying metadata.
            model.sharedModel.insertCells(index, values);
            // Select the inserted cells.
            this.deselectAll();
            this.activeCellIndex = start;
            this.extendContiguousSelectionTo(index - 1);
        }
        void NotebookActions.focusActiveCell(this);
    }
    /**
     * Start a drag event.
     */
    _startDrag(index, clientX, clientY) {
        var _a;
        const cells = this.model.cells;
        const selected = [];
        const toMove = [];
        let i = -1;
        for (const widget of this.widgets) {
            const cell = cells.get(++i);
            if (this.isSelectedOrActive(widget)) {
                widget.addClass(DROP_SOURCE_CLASS);
                selected.push(cell.toJSON());
                toMove.push(widget);
            }
        }
        const activeCell = this.activeCell;
        let dragImage = null;
        let countString;
        if ((activeCell === null || activeCell === void 0 ? void 0 : activeCell.model.type) === 'code') {
            const executionCount = activeCell.model
                .executionCount;
            countString = ' ';
            if (executionCount) {
                countString = executionCount.toString();
            }
        }
        else {
            countString = '';
        }
        // Create the drag image.
        dragImage = widget_Private.createDragImage(selected.length, countString, (_a = activeCell === null || activeCell === void 0 ? void 0 : activeCell.model.sharedModel.getSource().split('\n')[0].slice(0, 26)) !== null && _a !== void 0 ? _a : '');
        // Set up the drag event.
        this._drag = new dragdrop_dist_index_es6_js_.Drag({
            mimeData: new dist_index_js_.MimeData(),
            dragImage,
            supportedActions: 'copy-move',
            proposedAction: 'copy',
            source: this
        });
        this._drag.mimeData.setData(widget_JUPYTER_CELL_MIME, selected);
        // Add mimeData for the fully reified cell widgets, for the
        // case where the target is in the same notebook and we
        // can just move the cells.
        this._drag.mimeData.setData('internal:cells', toMove);
        // Add mimeData for the text content of the selected cells,
        // allowing for drag/drop into plain text fields.
        const textContent = toMove
            .map(cell => cell.model.sharedModel.getSource())
            .join('\n');
        this._drag.mimeData.setData('text/plain', textContent);
        // Remove mousemove and mouseup listeners and start the drag.
        document.removeEventListener('mousemove', this, true);
        document.removeEventListener('mouseup', this, true);
        this._mouseMode = null;
        void this._drag.start(clientX, clientY).then(action => {
            if (this.isDisposed) {
                return;
            }
            this._drag = null;
            for (const widget of toMove) {
                widget.removeClass(DROP_SOURCE_CLASS);
            }
        });
    }
    /**
     * Update the notebook node with class indicating read-write state.
     */
    _updateReadWrite() {
        const inReadWrite = index_js_.DOMUtils.hasActiveEditableElement(this.node);
        if (this.node.classList.contains(READ_WRITE_CLASS) === inReadWrite) {
            return;
        }
        this.node.classList.toggle(READ_WRITE_CLASS, inReadWrite);
    }
    /**
     * Handle `focus` events for the widget.
     */
    _evtFocusIn(event) {
        var _a, _b;
        // Update read-write class state.
        this._updateReadWrite();
        const target = event.target;
        const index = this._findCell(target);
        if (index !== -1) {
            const widget = this.widgets[index];
            // If the editor itself does not have focus, ensure command mode.
            if (widget.editorWidget && !widget.editorWidget.node.contains(target)) {
                this.setMode('command', { focus: false });
            }
            // Cell index needs to be updated before changing mode,
            // otherwise the previous cell may get un-rendered.
            this.activeCellIndex = index;
            // If the editor has focus, ensure edit mode.
            const node = (_a = widget.editorWidget) === null || _a === void 0 ? void 0 : _a.node;
            if (node === null || node === void 0 ? void 0 : node.contains(target)) {
                this.setMode('edit', { focus: false });
            }
        }
        else {
            // No cell has focus, ensure command mode.
            this.setMode('command', { focus: false });
            // Prevents the parent element to get the focus.
            event.preventDefault();
            // Check if the focus was previously in the active cell to avoid focus looping
            // between the cell and the cell toolbar.
            const source = event.relatedTarget;
            // Focuses on the active cell if the focus did not come from it.
            // Otherwise focus on the footer element (add cell button).
            if (this._activeCell && !this._activeCell.node.contains(source)) {
                this._activeCell.ready
                    .then(() => {
                    var _a;
                    (_a = this._activeCell) === null || _a === void 0 ? void 0 : _a.node.focus({
                        preventScroll: true
                    });
                })
                    .catch(() => {
                    var _a;
                    (_a = this.layout.footer) === null || _a === void 0 ? void 0 : _a.node.focus({
                        preventScroll: true
                    });
                });
            }
            else {
                (_b = this.layout.footer) === null || _b === void 0 ? void 0 : _b.node.focus({
                    preventScroll: true
                });
            }
        }
    }
    /**
     * Handle `focusout` events for the notebook.
     */
    _evtFocusOut(event) {
        var _a;
        const relatedTarget = event.relatedTarget;
        // Bail if the window is losing focus, to preserve edit mode. This test
        // assumes that we explicitly focus things rather than calling blur()
        if (!relatedTarget) {
            // Update read-write class state.
            this._updateReadWrite();
            return;
        }
        // Bail if the item gaining focus is another cell,
        // and we should not be entering command mode.
        const index = this._findCell(relatedTarget);
        if (index !== -1) {
            const widget = this.widgets[index];
            if ((_a = widget.editorWidget) === null || _a === void 0 ? void 0 : _a.node.contains(relatedTarget)) {
                // Do not update read-write state as there is no real loss of focus,
                // instead we are just switching to a different cell
                return;
            }
        }
        // Otherwise enter command mode if not already.
        if (this.mode !== 'command') {
            this.setMode('command', { focus: false });
        }
        // Update read-write class state.
        this._updateReadWrite();
    }
    /**
     * Handle `dblclick` events for the widget.
     */
    _evtDblClick(event) {
        const model = this.model;
        if (!model) {
            return;
        }
        this.deselectAll();
        const [target, index] = this._findEventTargetAndCell(event);
        if (event.target.classList.contains(HEADING_COLLAPSER_CLASS)) {
            return;
        }
        if (index === -1) {
            return;
        }
        this.activeCellIndex = index;
        if (model.cells.get(index).type === 'markdown') {
            const widget = this.widgets[index];
            widget.rendered = false;
        }
        else if (target.localName === 'img') {
            target.classList.toggle(UNCONFINED_CLASS);
        }
    }
    /**
     * Remove selections from inactive cells to avoid
     * spurious cursors.
     */
    _trimSelections() {
        for (let i = 0; i < this.widgets.length; i++) {
            if (i !== this._activeCellIndex) {
                const cell = this.widgets[i];
                if (!cell.model.isDisposed && cell.editor) {
                    cell.model.selections.delete(cell.editor.uuid);
                }
            }
        }
    }
    _updateSelectedCells() {
        this._selectedCells = this.widgets.filter(cell => this.isSelectedOrActive(cell));
        if (this.kernelHistory) {
            this.kernelHistory.reset();
        }
    }
}
/**
 * The namespace for the `Notebook` class statics.
 */
(function (Notebook) {
    /**
     * The default implementation of a notebook content factory..
     *
     * #### Notes
     * Override methods on this class to customize the default notebook factory
     * methods that create notebook content.
     */
    class ContentFactory extends StaticNotebook.ContentFactory {
    }
    Notebook.ContentFactory = ContentFactory;
})(Notebook || (Notebook = {}));
/**
 * A namespace for private data.
 */
var widget_Private;
(function (Private) {
    /**
     * An attached property for the selected state of a cell.
     */
    Private.selectedProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'selected',
        create: () => false
    });
    /**
     * A custom panel layout for the notebook.
     */
    class NotebookPanelLayout extends widgets_dist_index_es6_js_.PanelLayout {
        /**
         * A message handler invoked on an `'update-request'` message.
         *
         * #### Notes
         * This is a reimplementation of the base class method,
         * and is a no-op.
         */
        onUpdateRequest(msg) {
            // This is a no-op.
        }
    }
    Private.NotebookPanelLayout = NotebookPanelLayout;
    /**
     * Create a cell drag image.
     */
    function createDragImage(count, promptNumber, cellContent) {
        if (count > 1) {
            if (promptNumber !== '') {
                return virtualdom_dist_index_es6_js_.VirtualDOM.realize(virtualdom_dist_index_es6_js_.h.div(virtualdom_dist_index_es6_js_.h.div({ className: DRAG_IMAGE_CLASS }, virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }, '[' + promptNumber + ']:'), virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent)), virtualdom_dist_index_es6_js_.h.div({ className: CELL_DRAG_MULTIPLE_BACK }, '')));
            }
            else {
                return virtualdom_dist_index_es6_js_.VirtualDOM.realize(virtualdom_dist_index_es6_js_.h.div(virtualdom_dist_index_es6_js_.h.div({ className: DRAG_IMAGE_CLASS }, virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }), virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent)), virtualdom_dist_index_es6_js_.h.div({ className: CELL_DRAG_MULTIPLE_BACK }, '')));
            }
        }
        else {
            if (promptNumber !== '') {
                return virtualdom_dist_index_es6_js_.VirtualDOM.realize(virtualdom_dist_index_es6_js_.h.div(virtualdom_dist_index_es6_js_.h.div({ className: `${DRAG_IMAGE_CLASS} ${SINGLE_DRAG_IMAGE_CLASS}` }, virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }, '[' + promptNumber + ']:'), virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent))));
            }
            else {
                return virtualdom_dist_index_es6_js_.VirtualDOM.realize(virtualdom_dist_index_es6_js_.h.div(virtualdom_dist_index_es6_js_.h.div({ className: `${DRAG_IMAGE_CLASS} ${SINGLE_DRAG_IMAGE_CLASS}` }, virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_PROMPT_CLASS }), virtualdom_dist_index_es6_js_.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent))));
            }
        }
    }
    Private.createDragImage = createDragImage;
})(widget_Private || (widget_Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/panel.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * The class name added to notebook panels.
 */
const NOTEBOOK_PANEL_CLASS = 'jp-NotebookPanel';
const NOTEBOOK_PANEL_TOOLBAR_CLASS = 'jp-NotebookPanel-toolbar';
const NOTEBOOK_PANEL_NOTEBOOK_CLASS = 'jp-NotebookPanel-notebook';
/**
 * A widget that hosts a notebook toolbar and content area.
 *
 * #### Notes
 * The widget keeps the document metadata in sync with the current
 * kernel on the context.
 */
class NotebookPanel extends docregistry_lib_index_js_.DocumentWidget {
    /**
     * Construct a new notebook panel.
     */
    constructor(options) {
        super(options);
        /**
         * Whether we are currently in a series of autorestarts we have already
         * notified the user about.
         */
        this._autorestarting = false;
        // Set up CSS classes
        this.addClass(NOTEBOOK_PANEL_CLASS);
        this.toolbar.addClass(NOTEBOOK_PANEL_TOOLBAR_CLASS);
        this.content.addClass(NOTEBOOK_PANEL_NOTEBOOK_CLASS);
        // Set up things related to the context
        this.content.model = this.context.model;
        this.context.sessionContext.kernelChanged.connect(this._onKernelChanged, this);
        this.context.sessionContext.statusChanged.connect(this._onSessionStatusChanged, this);
        // this.content.fullyRendered.connect(this._onFullyRendered, this);
        this.context.saveState.connect(this._onSave, this);
        void this.revealed.then(() => {
            if (this.isDisposed) {
                // this widget has already been disposed, bail
                return;
            }
            // Set the document edit mode on initial open if it looks like a new document.
            if (this.content.widgets.length === 1) {
                const cellModel = this.content.widgets[0].model;
                if (cellModel.type === 'code' &&
                    cellModel.sharedModel.getSource() === '') {
                    this.content.mode = 'edit';
                }
            }
        });
    }
    /**
     * Handle a change to the document registry save state.
     *
     * @param sender The document registry context
     * @param state The document registry save state
     */
    _onSave(sender, state) {
        if (state === 'started' && this.model) {
            // Find markdown cells
            for (const cell of this.model.cells) {
                if ((0,lib_index_js_.isMarkdownCellModel)(cell)) {
                    for (const key of cell.attachments.keys) {
                        if (!cell.sharedModel.getSource().includes(key)) {
                            cell.attachments.remove(key);
                        }
                    }
                }
            }
        }
    }
    /**
     * The session context used by the panel.
     */
    get sessionContext() {
        return this.context.sessionContext;
    }
    /**
     * The model for the widget.
     */
    get model() {
        return this.content.model;
    }
    /**
     * Update the options for the current notebook panel.
     *
     * @param config new options to set
     */
    setConfig(config) {
        this.content.editorConfig = config.editorConfig;
        this.content.notebookConfig = config.notebookConfig;
        // Update kernel shutdown behavior
        const kernelPreference = this.context.sessionContext.kernelPreference;
        this.context.sessionContext.kernelPreference = {
            ...kernelPreference,
            shutdownOnDispose: config.kernelShutdown,
            autoStartDefault: config.autoStartDefault
        };
    }
    /**
     * Set URI fragment identifier.
     */
    setFragment(fragment) {
        void this.context.ready.then(() => {
            void this.content.setFragment(fragment);
        });
    }
    /**
     * Dispose of the resources used by the widget.
     */
    dispose() {
        this.content.dispose();
        super.dispose();
    }
    /**
     * Prints the notebook by converting to HTML with nbconvert.
     */
    [index_js_.Printing.symbol]() {
        return async () => {
            // Save before generating HTML
            if (this.context.model.dirty && !this.context.model.readOnly) {
                await this.context.save();
            }
            await index_js_.Printing.printURL(coreutils_lib_index_js_.PageConfig.getNBConvertURL({
                format: 'html',
                download: false,
                path: this.context.path
            }));
        };
    }
    /**
     * A message handler invoked on a 'before-hide' message.
     */
    onBeforeHide(msg) {
        super.onBeforeHide(msg);
        // Inform the windowed list that the notebook is gonna be hidden
        this.content.isParentHidden = true;
    }
    /**
     * A message handler invoked on a 'before-show' message.
     */
    onBeforeShow(msg) {
        // Inform the windowed list that the notebook is gonna be shown
        // Use onBeforeShow instead of onAfterShow to take into account
        // resizing (like sidebars got expanded before switching to the notebook tab)
        this.content.isParentHidden = false;
        super.onBeforeShow(msg);
    }
    /**
     * Handle a change in the kernel by updating the document metadata.
     */
    _onKernelChanged(sender, args) {
        if (!this.model || !args.newValue) {
            return;
        }
        const { newValue } = args;
        void newValue.info.then(info => {
            var _a;
            if (this.model &&
                ((_a = this.context.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel) === newValue) {
                this._updateLanguage(info.language_info);
            }
        });
        void this._updateSpec(newValue);
    }
    _onSessionStatusChanged(sender, status) {
        var _a;
        // If the status is autorestarting, and we aren't already in a series of
        // autorestarts, show the dialog.
        if (status === 'autorestarting' && !this._autorestarting) {
            // The kernel died and the server is restarting it. We notify the user so
            // they know why their kernel state is gone.
            void (0,index_js_.showDialog)({
                title: this._trans.__('Kernel Restarting'),
                body: this._trans.__('The kernel for %1 appears to have died. It will restart automatically.', (_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path),
                buttons: [index_js_.Dialog.okButton({ label: this._trans.__('Ok') })]
            });
            this._autorestarting = true;
        }
        else if (status === 'restarting') {
            // Another autorestart attempt will first change the status to
            // restarting, then to autorestarting again, so we don't reset the
            // autorestarting status if the status is 'restarting'.
            /* no-op */
        }
        else {
            this._autorestarting = false;
        }
    }
    /**
     * Update the kernel language.
     */
    _updateLanguage(language) {
        this.model.setMetadata('language_info', language);
    }
    /**
     * Update the kernel spec.
     */
    async _updateSpec(kernel) {
        const spec = await kernel.spec;
        if (this.isDisposed) {
            return;
        }
        this.model.setMetadata('kernelspec', {
            name: kernel.name,
            display_name: spec === null || spec === void 0 ? void 0 : spec.display_name,
            language: spec === null || spec === void 0 ? void 0 : spec.language
        });
    }
}
/**
 * A namespace for `NotebookPanel` statics.
 */
(function (NotebookPanel) {
    /**
     * The default implementation of an `IContentFactory`.
     */
    class ContentFactory extends Notebook.ContentFactory {
        /**
         * Create a new content area for the panel.
         */
        createNotebook(options) {
            return new Notebook(options);
        }
    }
    NotebookPanel.ContentFactory = ContentFactory;
    /**
     * The notebook renderer token.
     */
    NotebookPanel.IContentFactory = new dist_index_js_.Token('@jupyterlab/notebook:IContentFactory', `A factory object that creates new notebooks.
    Use this if you want to create and host notebooks in your own UI elements.`);
})(NotebookPanel || (NotebookPanel = {}));
//# sourceMappingURL=panel.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/documentsearch@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/documentsearch/lib/index.js)
var documentsearch_lib_index_js_ = __webpack_require__(3894);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/searchprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * Notebook document search provider
 */
class NotebookSearchProvider extends documentsearch_lib_index_js_.SearchProvider {
    /**
     * Constructor
     *
     * @param widget The widget to search in
     * @param translator Application translator
     */
    constructor(widget, translator = translation_lib_index_js_.nullTranslator) {
        super(widget);
        this.translator = translator;
        this._textSelection = null;
        this._currentProviderIndex = null;
        this._delayedActiveCellChangeHandler = null;
        this._onSelection = false;
        this._selectedCells = 1;
        this._selectedLines = 0;
        this._query = null;
        this._searchProviders = [];
        this._editorSelectionsObservable = null;
        this._selectionSearchMode = 'cells';
        this._selectionLock = false;
        this._searchActive = false;
        this._handleHighlightsAfterActiveCellChange =
            this._handleHighlightsAfterActiveCellChange.bind(this);
        this.widget.model.cells.changed.connect(this._onCellsChanged, this);
        this.widget.content.activeCellChanged.connect(this._onActiveCellChanged, this);
        this.widget.content.selectionChanged.connect(this._onCellSelectionChanged, this);
        this.widget.content.stateChanged.connect(this._onNotebookStateChanged, this);
        this._observeActiveCell();
        this._filtersChanged.connect(this._setEnginesSelectionSearchMode, this);
    }
    _onNotebookStateChanged(_, args) {
        if (args.name === 'mode') {
            // Delay the update to ensure that `document.activeElement` settled.
            window.setTimeout(() => {
                var _a;
                if (args.newValue === 'command' &&
                    ((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.closest('.jp-DocumentSearch-overlay'))) {
                    // Do not request updating mode when user switched focus to search overlay.
                    return;
                }
                this._updateSelectionMode();
                this._filtersChanged.emit();
            }, 0);
        }
    }
    /**
     * Report whether or not this provider has the ability to search on the given object
     *
     * @param domain Widget to test
     * @returns Search ability
     */
    static isApplicable(domain) {
        // check to see if the CMSearchProvider can search on the
        // first cell, false indicates another editor is present
        return domain instanceof NotebookPanel;
    }
    /**
     * Instantiate a search provider for the notebook panel.
     *
     * #### Notes
     * The widget provided is always checked using `isApplicable` before calling
     * this factory.
     *
     * @param widget The widget to search on
     * @param translator [optional] The translator object
     *
     * @returns The search provider on the notebook panel
     */
    static createNew(widget, translator) {
        return new NotebookSearchProvider(widget, translator);
    }
    /**
     * The current index of the selected match.
     */
    get currentMatchIndex() {
        let agg = 0;
        let found = false;
        for (let idx = 0; idx < this._searchProviders.length; idx++) {
            const provider = this._searchProviders[idx];
            if (this._currentProviderIndex == idx) {
                const localMatch = provider.currentMatchIndex;
                if (localMatch === null) {
                    return null;
                }
                agg += localMatch;
                found = true;
                break;
            }
            else {
                agg += provider.matchesCount;
            }
        }
        return found ? agg : null;
    }
    /**
     * The number of matches.
     */
    get matchesCount() {
        return this._searchProviders.reduce((sum, provider) => (sum += provider.matchesCount), 0);
    }
    /**
     * Set to true if the widget under search is read-only, false
     * if it is editable. Will be used to determine whether to show
     * the replace option.
     */
    get isReadOnly() {
        var _a, _b, _c;
        return (_c = (_b = (_a = this.widget) === null || _a === void 0 ? void 0 : _a.content.model) === null || _b === void 0 ? void 0 : _b.readOnly) !== null && _c !== void 0 ? _c : false;
    }
    /**
     * Support for options adjusting replacement behavior.
     */
    get replaceOptionsSupport() {
        return {
            preserveCase: true
        };
    }
    getSelectionState() {
        const cellMode = this._selectionSearchMode === 'cells';
        const selectedCount = cellMode ? this._selectedCells : this._selectedLines;
        return selectedCount > 1
            ? 'multiple'
            : selectedCount === 1 && !cellMode
                ? 'single'
                : 'none';
    }
    /**
     * Dispose of the resources held by the search provider.
     *
     * #### Notes
     * If the object's `dispose` method is called more than once, all
     * calls made after the first will be a no-op.
     *
     * #### Undefined Behavior
     * It is undefined behavior to use any functionality of the object
     * after it has been disposed unless otherwise explicitly noted.
     */
    dispose() {
        var _a;
        if (this.isDisposed) {
            return;
        }
        this.widget.content.activeCellChanged.disconnect(this._onActiveCellChanged, this);
        (_a = this.widget.model) === null || _a === void 0 ? void 0 : _a.cells.changed.disconnect(this._onCellsChanged, this);
        this.widget.content.stateChanged.disconnect(this._onNotebookStateChanged, this);
        this.widget.content.selectionChanged.disconnect(this._onCellSelectionChanged, this);
        this._stopObservingLastCell();
        super.dispose();
        const index = this.widget.content.activeCellIndex;
        this.endQuery()
            .then(() => {
            if (!this.widget.isDisposed) {
                this.widget.content.activeCellIndex = index;
            }
        })
            .catch(reason => {
            console.error(`Fail to end search query in notebook:\n${reason}`);
        });
    }
    /**
     * Get the filters for the given provider.
     *
     * @returns The filters.
     */
    getFilters() {
        const trans = this.translator.load('jupyterlab');
        return {
            output: {
                title: trans.__('Search Cell Outputs'),
                description: trans.__('Search in the cell outputs.'),
                disabledDescription: trans.__('Search in the cell outputs (not available when replace options are shown).'),
                default: false,
                supportReplace: false
            },
            selection: {
                title: this._selectionSearchMode === 'cells'
                    ? trans._n('Search in %1 Selected Cell', 'Search in %1 Selected Cells', this._selectedCells)
                    : trans._n('Search in %1 Selected Line', 'Search in %1 Selected Lines', this._selectedLines),
                description: trans.__('Search only in the selected cells or text (depending on edit/command mode).'),
                default: false,
                supportReplace: true
            }
        };
    }
    /**
     * Update the search in selection mode; it should only be called when user
     * navigates the notebook (enters editing/command mode, changes selection)
     * but not when the searchbox gets focused (switching the notebook to command
     * mode) nor when search highlights a match (switching notebook to edit mode).
     */
    _updateSelectionMode() {
        if (this._selectionLock) {
            return;
        }
        this._selectionSearchMode =
            this._selectedCells === 1 &&
                this.widget.content.mode === 'edit' &&
                this._selectedLines !== 0
                ? 'text'
                : 'cells';
    }
    /**
     * Get an initial query value if applicable so that it can be entered
     * into the search box as an initial query
     *
     * @returns Initial value used to populate the search box.
     */
    getInitialQuery() {
        var _a;
        // Get whatever is selected in the browser window.
        return ((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) || '';
    }
    /**
     * Clear currently highlighted match.
     */
    async clearHighlight() {
        this._selectionLock = true;
        if (this._currentProviderIndex !== null &&
            this._currentProviderIndex < this._searchProviders.length) {
            await this._searchProviders[this._currentProviderIndex].clearHighlight();
            this._currentProviderIndex = null;
        }
        this._selectionLock = false;
    }
    /**
     * Highlight the next match.
     *
     * @param loop Whether to loop within the matches list.
     *
     * @returns The next match if available.
     */
    async highlightNext(loop = true, options) {
        const match = await this._stepNext(false, loop, options);
        return match !== null && match !== void 0 ? match : undefined;
    }
    /**
     * Highlight the previous match.
     *
     * @param loop Whether to loop within the matches list.
     *
     * @returns The previous match if available.
     */
    async highlightPrevious(loop = true, options) {
        const match = await this._stepNext(true, loop, options);
        return match !== null && match !== void 0 ? match : undefined;
    }
    /**
     * Search for a regular expression with optional filters.
     *
     * @param query A regular expression to test for
     * @param filters Filter parameters to pass to provider
     *
     */
    async startQuery(query, filters) {
        if (!this.widget) {
            return;
        }
        await this.endQuery();
        this._searchActive = true;
        let cells = this.widget.content.widgets;
        this._query = query;
        this._filters = {
            output: false,
            selection: false,
            ...(filters !== null && filters !== void 0 ? filters : {})
        };
        this._onSelection = this._filters.selection;
        const currentProviderIndex = this.widget.content.activeCellIndex;
        // For each cell, create a search provider
        this._searchProviders = await Promise.all(cells.map(async (cell, index) => {
            const cellSearchProvider = (0,lib_index_js_.createCellSearchProvider)(cell);
            await cellSearchProvider.setIsActive(!this._filters.selection ||
                this.widget.content.isSelectedOrActive(cell));
            if (this._onSelection &&
                this._selectionSearchMode === 'text' &&
                index === currentProviderIndex) {
                if (this._textSelection) {
                    await cellSearchProvider.setSearchSelection(this._textSelection);
                }
            }
            await cellSearchProvider.startQuery(query, this._filters);
            return cellSearchProvider;
        }));
        this._currentProviderIndex = currentProviderIndex;
        // We do not want to show the first "current" closest to cursor as depending
        // on which way the user dragged the selection it would be:
        // - the first or last match when searching in selection
        // - the next match when starting search using ctrl + f
        // `scroll` and `select` are disabled because `startQuery` is also used as
        // "restartQuery" after each text change and if those were enabled, we would
        // steal the cursor.
        await this.highlightNext(true, {
            from: 'selection-start',
            scroll: false,
            select: false
        });
        return Promise.resolve();
    }
    /**
     * Stop the search and clear all internal state.
     */
    async endQuery() {
        await Promise.all(this._searchProviders.map(provider => {
            return provider.endQuery().then(() => {
                provider.dispose();
            });
        }));
        this._searchActive = false;
        this._searchProviders.length = 0;
        this._currentProviderIndex = null;
    }
    /**
     * Replace the currently selected match with the provided text
     *
     * @param newText The replacement text.
     * @param loop Whether to loop within the matches list.
     *
     * @returns A promise that resolves with a boolean indicating whether a replace occurred.
     */
    async replaceCurrentMatch(newText, loop = true, options) {
        let replaceOccurred = false;
        const unrenderMarkdownCell = async (highlightNext = false) => {
            var _a;
            // Unrendered markdown cell
            const activeCell = (_a = this.widget) === null || _a === void 0 ? void 0 : _a.content.activeCell;
            if ((activeCell === null || activeCell === void 0 ? void 0 : activeCell.model.type) === 'markdown' &&
                activeCell.rendered) {
                activeCell.rendered = false;
                if (highlightNext) {
                    await this.highlightNext(loop);
                }
            }
        };
        if (this._currentProviderIndex !== null) {
            await unrenderMarkdownCell();
            const searchEngine = this._searchProviders[this._currentProviderIndex];
            replaceOccurred = await searchEngine.replaceCurrentMatch(newText, false, options);
            if (searchEngine.currentMatchIndex === null) {
                // switch to next cell
                await this.highlightNext(loop, { from: 'previous-match' });
            }
        }
        // TODO: markdown unrendering/highlighting sequence is likely incorrect
        // Force highlighting the first hit in the unrendered cell
        await unrenderMarkdownCell(true);
        return replaceOccurred;
    }
    /**
     * Replace all matches in the notebook with the provided text
     *
     * @param newText The replacement text.
     *
     * @returns A promise that resolves with a boolean indicating whether a replace occurred.
     */
    async replaceAllMatches(newText, options) {
        const replacementOccurred = await Promise.all(this._searchProviders.map(provider => {
            return provider.replaceAllMatches(newText, options);
        }));
        return replacementOccurred.includes(true);
    }
    async validateFilter(name, value) {
        if (name !== 'output') {
            // Bail early
            return value;
        }
        // If value is true and some cells have never been rendered, ask confirmation.
        if (value &&
            this.widget.content.widgets.some(w => w instanceof lib_index_js_.CodeCell && w.isPlaceholder())) {
            const trans = this.translator.load('jupyterlab');
            const reply = await (0,index_js_.showDialog)({
                title: trans.__('Confirmation'),
                body: trans.__('Searching outputs requires you to run all cells and render their outputs. Are you sure you want to search in the cell outputs?'),
                buttons: [
                    index_js_.Dialog.cancelButton({ label: trans.__('Cancel') }),
                    index_js_.Dialog.okButton({ label: trans.__('Ok') })
                ]
            });
            if (reply.button.accept) {
                this.widget.content.widgets.forEach((w, i) => {
                    if (w instanceof lib_index_js_.CodeCell && w.isPlaceholder()) {
                        this.widget.content.renderCellOutputs(i);
                    }
                });
            }
            else {
                return false;
            }
        }
        return value;
    }
    _addCellProvider(index) {
        var _a, _b;
        const cell = this.widget.content.widgets[index];
        const cellSearchProvider = (0,lib_index_js_.createCellSearchProvider)(cell);
        index_es6_js_.ArrayExt.insert(this._searchProviders, index, cellSearchProvider);
        void cellSearchProvider
            .setIsActive(!((_b = (_a = this._filters) === null || _a === void 0 ? void 0 : _a.selection) !== null && _b !== void 0 ? _b : false) ||
            this.widget.content.isSelectedOrActive(cell))
            .then(() => {
            if (this._searchActive) {
                void cellSearchProvider.startQuery(this._query, this._filters);
            }
        });
    }
    _removeCellProvider(index) {
        const provider = index_es6_js_.ArrayExt.removeAt(this._searchProviders, index);
        provider === null || provider === void 0 ? void 0 : provider.dispose();
    }
    async _onCellsChanged(cells, changes) {
        switch (changes.type) {
            case 'add':
                changes.newValues.forEach((model, index) => {
                    this._addCellProvider(changes.newIndex + index);
                });
                break;
            case 'move':
                index_es6_js_.ArrayExt.move(this._searchProviders, changes.oldIndex, changes.newIndex);
                break;
            case 'remove':
                for (let index = 0; index < changes.oldValues.length; index++) {
                    this._removeCellProvider(changes.oldIndex);
                }
                break;
            case 'set':
                changes.newValues.forEach((model, index) => {
                    this._addCellProvider(changes.newIndex + index);
                    this._removeCellProvider(changes.newIndex + index + 1);
                });
                break;
            case 'clear':
                for (let index = this._searchProviders.length - 1; index >= 0; index--) {
                    this._removeCellProvider(index);
                }
                break;
        }
        this._stateChanged.emit();
    }
    async _stepNext(reverse = false, loop = false, options) {
        var _a;
        const activateNewMatch = async (match) => {
            var _a;
            const shouldScroll = (_a = options === null || options === void 0 ? void 0 : options.scroll) !== null && _a !== void 0 ? _a : true;
            if (!shouldScroll) {
                // do not activate the match if scrolling was disabled
                return;
            }
            this._selectionLock = true;
            if (this.widget.content.activeCellIndex !== this._currentProviderIndex) {
                this.widget.content.activeCellIndex = this._currentProviderIndex;
            }
            if (this.widget.content.activeCellIndex === -1) {
                console.warn('No active cell (no cells or no model), aborting search');
                this._selectionLock = false;
                return;
            }
            const activeCell = this.widget.content.activeCell;
            if (!activeCell.inViewport) {
                try {
                    await this.widget.content.scrollToItem(this._currentProviderIndex);
                }
                catch (error) {
                    // no-op
                }
            }
            // Unhide cell
            if (activeCell.inputHidden) {
                activeCell.inputHidden = false;
            }
            if (!activeCell.inViewport) {
                this._selectionLock = false;
                // It will not be possible the cell is not in the view
                return;
            }
            await activeCell.ready;
            const editor = activeCell.editor;
            editor.revealPosition(editor.getPositionAt(match.position));
            this._selectionLock = false;
        };
        if (this._currentProviderIndex === null) {
            this._currentProviderIndex = this.widget.content.activeCellIndex;
        }
        // When going to previous match in cell mode and there is no current we
        // want to skip the active cell and go to the previous cell; in edit mode
        // the appropriate behaviour is induced by searching from nearest cursor.
        if (reverse && this.widget.content.mode === 'command') {
            const searchEngine = this._searchProviders[this._currentProviderIndex];
            const currentMatch = searchEngine.getCurrentMatch();
            if (!currentMatch) {
                this._currentProviderIndex -= 1;
            }
            if (loop) {
                this._currentProviderIndex =
                    (this._currentProviderIndex + this._searchProviders.length) %
                        this._searchProviders.length;
            }
        }
        // If we're looking for the next match after the previous match,
        // and we've reached the end of the current cell, start at the next one, if possible
        const from = (_a = options === null || options === void 0 ? void 0 : options.from) !== null && _a !== void 0 ? _a : '';
        const atEndOfCurrentCell = from === 'previous-match' &&
            this._searchProviders[this._currentProviderIndex].currentMatchIndex ===
                null;
        const startIndex = this._currentProviderIndex;
        // If we need to move to the next cell or loop, reset the position of the current search provider.
        if (atEndOfCurrentCell) {
            void this._searchProviders[this._currentProviderIndex].clearHighlight();
        }
        // If we're at the end of the last cell in the provider list and we need to loop, do so
        if (loop &&
            atEndOfCurrentCell &&
            this._currentProviderIndex + 1 >= this._searchProviders.length) {
            this._currentProviderIndex = 0;
        }
        else {
            this._currentProviderIndex += atEndOfCurrentCell ? 1 : 0;
        }
        do {
            const searchEngine = this._searchProviders[this._currentProviderIndex];
            const match = reverse
                ? await searchEngine.highlightPrevious(false, options)
                : await searchEngine.highlightNext(false, options);
            if (match) {
                await activateNewMatch(match);
                return match;
            }
            else {
                this._currentProviderIndex =
                    this._currentProviderIndex + (reverse ? -1 : 1);
                if (loop) {
                    this._currentProviderIndex =
                        (this._currentProviderIndex + this._searchProviders.length) %
                            this._searchProviders.length;
                }
            }
        } while (loop
            ? // We looped on all cells, no hit found
                this._currentProviderIndex !== startIndex
            : 0 <= this._currentProviderIndex &&
                this._currentProviderIndex < this._searchProviders.length);
        if (loop) {
            // try the first provider again
            const searchEngine = this._searchProviders[startIndex];
            const match = reverse
                ? await searchEngine.highlightPrevious(false, options)
                : await searchEngine.highlightNext(false, options);
            if (match) {
                await activateNewMatch(match);
                return match;
            }
        }
        this._currentProviderIndex = null;
        return null;
    }
    async _onActiveCellChanged() {
        if (this._delayedActiveCellChangeHandler !== null) {
            // Prevent handler from running twice if active cell is changed twice
            // within the same task of the event loop.
            clearTimeout(this._delayedActiveCellChangeHandler);
            this._delayedActiveCellChangeHandler = null;
        }
        if (this.widget.content.activeCellIndex !== this._currentProviderIndex) {
            // At this time we cannot handle the change of active cell, because
            // `activeCellChanged` is also emitted in the middle of cell selection
            // change, and if selection is getting extended, we do not want to clear
            // highlights just to re-apply them shortly after, which has side effects
            // impacting the functionality and performance.
            this._delayedActiveCellChangeHandler = window.setTimeout(() => {
                this.delayedActiveCellChangeHandlerReady =
                    this._handleHighlightsAfterActiveCellChange();
            }, 0);
        }
        this._observeActiveCell();
    }
    async _handleHighlightsAfterActiveCellChange() {
        if (this._onSelection) {
            const previousProviderCell = this._currentProviderIndex !== null &&
                this._currentProviderIndex < this.widget.content.widgets.length
                ? this.widget.content.widgets[this._currentProviderIndex]
                : null;
            const previousProviderInCurrentSelection = previousProviderCell &&
                this.widget.content.isSelectedOrActive(previousProviderCell);
            if (!previousProviderInCurrentSelection) {
                await this._updateCellSelection();
                // Clear highlight from previous provider
                await this.clearHighlight();
                // If we are searching in all cells, we should not change the active
                // provider when switching active cell to preserve current match;
                // if we are searching within selected cells we should update
                this._currentProviderIndex = this.widget.content.activeCellIndex;
            }
        }
        await this._ensureCurrentMatch();
    }
    /**
     * If there are results but no match is designated as current,
     * mark a result as current and highlight it.
     */
    async _ensureCurrentMatch() {
        if (this._currentProviderIndex !== null) {
            const searchEngine = this._searchProviders[this._currentProviderIndex];
            if (!searchEngine) {
                // This can happen when `startQuery()` has not finished yet.
                return;
            }
            const currentMatch = searchEngine.getCurrentMatch();
            if (!currentMatch && this.matchesCount) {
                // Select a match as current by highlighting next (with looping) from
                // the selection start, to prevent "current" match from jumping around.
                await this.highlightNext(true, {
                    from: 'start',
                    scroll: false,
                    select: false
                });
            }
        }
    }
    _observeActiveCell() {
        var _a;
        const editor = (_a = this.widget.content.activeCell) === null || _a === void 0 ? void 0 : _a.editor;
        if (!editor) {
            return;
        }
        this._stopObservingLastCell();
        editor.model.selections.changed.connect(this._setSelectedLines, this);
        this._editorSelectionsObservable = editor.model.selections;
    }
    _stopObservingLastCell() {
        if (this._editorSelectionsObservable) {
            this._editorSelectionsObservable.changed.disconnect(this._setSelectedLines, this);
        }
    }
    _setSelectedLines() {
        var _a;
        const editor = (_a = this.widget.content.activeCell) === null || _a === void 0 ? void 0 : _a.editor;
        if (!editor) {
            return;
        }
        const selection = editor.getSelection();
        const { start, end } = selection;
        const newLines = end.line === start.line && end.column === start.column
            ? 0
            : end.line - start.line + 1;
        this._textSelection = selection;
        if (newLines !== this._selectedLines) {
            this._selectedLines = newLines;
            this._updateSelectionMode();
        }
        this._filtersChanged.emit();
    }
    /**
     * Set whether the engines should search within selection only or full text.
     */
    async _setEnginesSelectionSearchMode() {
        let textMode;
        if (!this._onSelection) {
            // When search in selection is off we always search full text
            textMode = false;
        }
        else {
            // When search in selection is off we either search in full cells
            // (toggling off isActive flag on search engines of non-selected cells)
            // or in selected text of the active cell.
            textMode = this._selectionSearchMode === 'text';
        }
        if (this._selectionLock) {
            return;
        }
        // Clear old selection restrictions or if relevant, set current restrictions for active provider.
        await Promise.all(this._searchProviders.map((provider, index) => {
            const isCurrent = this.widget.content.activeCellIndex === index;
            provider.setProtectSelection(isCurrent && this._onSelection);
            return provider.setSearchSelection(isCurrent && textMode ? this._textSelection : null);
        }));
    }
    async _onCellSelectionChanged() {
        if (this._delayedActiveCellChangeHandler !== null) {
            // Avoid race condition due to `activeCellChanged` and `selectionChanged`
            // signals firing in short sequence when selection gets extended, with
            // handling of the former having potential to undo selection set by the latter.
            clearTimeout(this._delayedActiveCellChangeHandler);
            this._delayedActiveCellChangeHandler = null;
        }
        await this._updateCellSelection();
        if (this._currentProviderIndex === null) {
            // For consistency we set the first cell in selection as current provider.
            const firstSelectedCellIndex = this.widget.content.widgets.findIndex(cell => this.widget.content.isSelectedOrActive(cell));
            this._currentProviderIndex = firstSelectedCellIndex;
        }
        await this._ensureCurrentMatch();
    }
    async _updateCellSelection() {
        const cells = this.widget.content.widgets;
        let selectedCells = 0;
        await Promise.all(cells.map(async (cell, index) => {
            const provider = this._searchProviders[index];
            const isSelected = this.widget.content.isSelectedOrActive(cell);
            if (isSelected) {
                selectedCells += 1;
            }
            if (provider && this._onSelection) {
                await provider.setIsActive(isSelected);
            }
        }));
        if (selectedCells !== this._selectedCells) {
            this._selectedCells = selectedCells;
            this._updateSelectionMode();
        }
        this._filtersChanged.emit();
    }
}
//# sourceMappingURL=searchprovider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/toc.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Cell running status
 */
var RunningStatus;
(function (RunningStatus) {
    /**
     * Cell is idle
     */
    RunningStatus[RunningStatus["Idle"] = -1] = "Idle";
    /**
     * Cell execution is unsuccessful
     */
    RunningStatus[RunningStatus["Error"] = -0.5] = "Error";
    /**
     * Cell execution is scheduled
     */
    RunningStatus[RunningStatus["Scheduled"] = 0] = "Scheduled";
    /**
     * Cell is running
     */
    RunningStatus[RunningStatus["Running"] = 1] = "Running";
})(RunningStatus || (RunningStatus = {}));
/**
 * Table of content model for Notebook files.
 */
class NotebookToCModel extends toc_lib_index_js_.TableOfContentsModel {
    /**
     * Constructor
     *
     * @param widget The widget to search in
     * @param parser Markdown parser
     * @param sanitizer Sanitizer
     * @param configuration Default model configuration
     */
    constructor(widget, parser, sanitizer, configuration) {
        super(widget, configuration);
        this.parser = parser;
        this.sanitizer = sanitizer;
        /**
         * Mapping between configuration options and notebook metadata.
         *
         * If it starts with `!`, the boolean value of the configuration option is
         * opposite to the one stored in metadata.
         * If it contains `/`, the metadata data is nested.
         */
        this.configMetadataMap = {
            numberHeaders: ['toc-autonumbering', 'toc/number_sections'],
            numberingH1: ['!toc/skip_h1_title'],
            baseNumbering: ['toc/base_numbering']
        };
        this._runningCells = new Array();
        this._errorCells = new Array();
        this._cellToHeadingIndex = new WeakMap();
        void widget.context.ready.then(() => {
            // Load configuration from metadata
            this.setConfiguration({});
        });
        this.widget.context.model.metadataChanged.connect(this.onMetadataChanged, this);
        this.widget.content.activeCellChanged.connect(this.onActiveCellChanged, this);
        NotebookActions.executionScheduled.connect(this.onExecutionScheduled, this);
        NotebookActions.executed.connect(this.onExecuted, this);
        NotebookActions.outputCleared.connect(this.onOutputCleared, this);
        this.headingsChanged.connect(this.onHeadingsChanged, this);
    }
    /**
     * Type of document supported by the model.
     *
     * #### Notes
     * A `data-document-type` attribute with this value will be set
     * on the tree view `.jp-TableOfContents-content[data-document-type="..."]`
     */
    get documentType() {
        return 'notebook';
    }
    /**
     * Whether the model gets updated even if the table of contents panel
     * is hidden or not.
     */
    get isAlwaysActive() {
        return true;
    }
    /**
     * List of configuration options supported by the model.
     */
    get supportedOptions() {
        return [
            'baseNumbering',
            'maximalDepth',
            'numberingH1',
            'numberHeaders',
            'includeOutput',
            'syncCollapseState'
        ];
    }
    /**
     * Get the headings of a given cell.
     *
     * @param cell Cell
     * @returns The associated headings
     */
    getCellHeadings(cell) {
        const headings = new Array();
        let headingIndex = this._cellToHeadingIndex.get(cell);
        if (headingIndex !== undefined) {
            const candidate = this.headings[headingIndex];
            headings.push(candidate);
            while (this.headings[headingIndex - 1] &&
                this.headings[headingIndex - 1].cellRef === candidate.cellRef) {
                headingIndex--;
                headings.unshift(this.headings[headingIndex]);
            }
        }
        return headings;
    }
    /**
     * Dispose the object
     */
    dispose() {
        var _a, _b, _c;
        if (this.isDisposed) {
            return;
        }
        this.headingsChanged.disconnect(this.onHeadingsChanged, this);
        (_b = (_a = this.widget.context) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.metadataChanged.disconnect(this.onMetadataChanged, this);
        (_c = this.widget.content) === null || _c === void 0 ? void 0 : _c.activeCellChanged.disconnect(this.onActiveCellChanged, this);
        NotebookActions.executionScheduled.disconnect(this.onExecutionScheduled, this);
        NotebookActions.executed.disconnect(this.onExecuted, this);
        NotebookActions.outputCleared.disconnect(this.onOutputCleared, this);
        this._runningCells.length = 0;
        this._errorCells.length = 0;
        super.dispose();
    }
    /**
     * Model configuration setter.
     *
     * @param c New configuration
     */
    setConfiguration(c) {
        // Ensure configuration update
        const metadataConfig = this.loadConfigurationFromMetadata();
        super.setConfiguration({ ...this.configuration, ...metadataConfig, ...c });
    }
    /**
     * Callback on heading collapse.
     *
     * @param options.heading The heading to change state (all headings if not provided)
     * @param options.collapsed The new collapsed status (toggle existing status if not provided)
     */
    toggleCollapse(options) {
        super.toggleCollapse(options);
        this.updateRunningStatus(this.headings);
    }
    /**
     * Produce the headings for a document.
     *
     * @returns The list of new headings or `null` if nothing needs to be updated.
     */
    async getHeadings() {
        const cells = this.widget.content.widgets;
        const headings = [];
        const documentLevels = new Array();
        // Generate headings by iterating through all notebook cells...
        for (let i = 0; i < cells.length; i++) {
            const cell = cells[i];
            const model = cell.model;
            switch (model.type) {
                case 'code': {
                    // Collapsing cells is incompatible with output headings
                    if (!this.configuration.syncCollapseState &&
                        this.configuration.includeOutput) {
                        headings.push(...toc_lib_index_js_.TableOfContentsUtils.filterHeadings(await cell.getHeadings(), this.configuration, documentLevels).map(heading => {
                            return {
                                ...heading,
                                cellRef: cell,
                                collapsed: false,
                                isRunning: RunningStatus.Idle
                            };
                        }));
                    }
                    break;
                }
                case 'markdown': {
                    const cellHeadings = toc_lib_index_js_.TableOfContentsUtils.filterHeadings(await cell.getHeadings(), this.configuration, documentLevels).map((heading, index) => {
                        return {
                            ...heading,
                            cellRef: cell,
                            collapsed: false,
                            isRunning: RunningStatus.Idle
                        };
                    });
                    // If there are multiple headings, only collapse the highest heading (i.e. minimal level)
                    // consistent with the cell.headingInfo
                    if (this.configuration.syncCollapseState &&
                        cell.headingCollapsed) {
                        const minLevel = Math.min(...cellHeadings.map(h => h.level));
                        const minHeading = cellHeadings.find(h => h.level === minLevel);
                        minHeading.collapsed = cell.headingCollapsed;
                    }
                    headings.push(...cellHeadings);
                    break;
                }
            }
            if (headings.length > 0) {
                this._cellToHeadingIndex.set(cell, headings.length - 1);
            }
            else {
                // If no headings were found, remove the cell from the map
                this._cellToHeadingIndex.delete(cell);
            }
        }
        this.updateRunningStatus(headings);
        return Promise.resolve(headings);
    }
    /**
     * Test if two headings are equal or not.
     *
     * @param heading1 First heading
     * @param heading2 Second heading
     * @returns Whether the headings are equal.
     */
    isHeadingEqual(heading1, heading2) {
        return (super.isHeadingEqual(heading1, heading2) &&
            heading1.cellRef === heading2.cellRef);
    }
    /**
     * Read table of content configuration from notebook metadata.
     *
     * @returns ToC configuration from metadata
     */
    loadConfigurationFromMetadata() {
        const nbModel = this.widget.content.model;
        const newConfig = {};
        if (nbModel) {
            for (const option in this.configMetadataMap) {
                const keys = this.configMetadataMap[option];
                for (const k of keys) {
                    let key = k;
                    const negate = key[0] === '!';
                    if (negate) {
                        key = key.slice(1);
                    }
                    const keyPath = key.split('/');
                    let value = nbModel.getMetadata(keyPath[0]);
                    for (let p = 1; p < keyPath.length; p++) {
                        value = (value !== null && value !== void 0 ? value : {})[keyPath[p]];
                    }
                    if (value !== undefined) {
                        if (typeof value === 'boolean' && negate) {
                            value = !value;
                        }
                        newConfig[option] = value;
                    }
                }
            }
        }
        return newConfig;
    }
    onActiveCellChanged(notebook, cell) {
        // Highlight the first title as active (if multiple titles are in the same cell)
        const activeHeading = this.getCellHeadings(cell)[0];
        this.setActiveHeading(activeHeading !== null && activeHeading !== void 0 ? activeHeading : null, false);
    }
    onHeadingsChanged() {
        if (this.widget.content.activeCell) {
            this.onActiveCellChanged(this.widget.content, this.widget.content.activeCell);
        }
    }
    onExecuted(_, args) {
        this._runningCells.forEach((cell, index) => {
            var _a;
            if (cell === args.cell) {
                this._runningCells.splice(index, 1);
                const headingIndex = this._cellToHeadingIndex.get(cell);
                if (headingIndex !== undefined) {
                    const heading = this.headings[headingIndex];
                    // when the execution is not successful but errorName is undefined,
                    // the execution is interrupted by previous cells
                    if (args.success || ((_a = args.error) === null || _a === void 0 ? void 0 : _a.errorName) === undefined) {
                        heading.isRunning = RunningStatus.Idle;
                        return;
                    }
                    heading.isRunning = RunningStatus.Error;
                    if (!this._errorCells.includes(cell)) {
                        this._errorCells.push(cell);
                    }
                }
            }
        });
        this.updateRunningStatus(this.headings);
        this.stateChanged.emit();
    }
    onExecutionScheduled(_, args) {
        if (!this._runningCells.includes(args.cell)) {
            this._runningCells.push(args.cell);
        }
        this._errorCells.forEach((cell, index) => {
            if (cell === args.cell) {
                this._errorCells.splice(index, 1);
            }
        });
        this.updateRunningStatus(this.headings);
        this.stateChanged.emit();
    }
    onOutputCleared(_, args) {
        this._errorCells.forEach((cell, index) => {
            if (cell === args.cell) {
                this._errorCells.splice(index, 1);
                const headingIndex = this._cellToHeadingIndex.get(cell);
                if (headingIndex !== undefined) {
                    const heading = this.headings[headingIndex];
                    heading.isRunning = RunningStatus.Idle;
                }
            }
        });
        this.updateRunningStatus(this.headings);
        this.stateChanged.emit();
    }
    onMetadataChanged() {
        this.setConfiguration({});
    }
    updateRunningStatus(headings) {
        // Update isRunning
        this._runningCells.forEach((cell, index) => {
            const headingIndex = this._cellToHeadingIndex.get(cell);
            if (headingIndex !== undefined) {
                const heading = this.headings[headingIndex];
                // Running is prioritized over Scheduled, so if a heading is
                // running don't change status
                if (heading.isRunning !== RunningStatus.Running) {
                    heading.isRunning =
                        index > 0 ? RunningStatus.Scheduled : RunningStatus.Running;
                }
            }
        });
        this._errorCells.forEach((cell, index) => {
            const headingIndex = this._cellToHeadingIndex.get(cell);
            if (headingIndex !== undefined) {
                const heading = this.headings[headingIndex];
                // Running and Scheduled are prioritized over Error, so only if
                // a heading is idle will it be set to Error
                if (heading.isRunning === RunningStatus.Idle) {
                    heading.isRunning = RunningStatus.Error;
                }
            }
        });
        let globalIndex = 0;
        while (globalIndex < headings.length) {
            const heading = headings[globalIndex];
            globalIndex++;
            if (heading.collapsed) {
                const maxIsRunning = Math.max(heading.isRunning, getMaxIsRunning(headings, heading.level));
                heading.dataset = {
                    ...heading.dataset,
                    'data-running': maxIsRunning.toString()
                };
            }
            else {
                heading.dataset = {
                    ...heading.dataset,
                    'data-running': heading.isRunning.toString()
                };
            }
        }
        function getMaxIsRunning(headings, collapsedLevel) {
            let maxIsRunning = RunningStatus.Idle;
            while (globalIndex < headings.length) {
                const heading = headings[globalIndex];
                heading.dataset = {
                    ...heading.dataset,
                    'data-running': heading.isRunning.toString()
                };
                if (heading.level > collapsedLevel) {
                    globalIndex++;
                    maxIsRunning = Math.max(heading.isRunning, maxIsRunning);
                    if (heading.collapsed) {
                        maxIsRunning = Math.max(maxIsRunning, getMaxIsRunning(headings, heading.level));
                        heading.dataset = {
                            ...heading.dataset,
                            'data-running': maxIsRunning.toString()
                        };
                    }
                }
                else {
                    break;
                }
            }
            return maxIsRunning;
        }
    }
}
/**
 * Table of content model factory for Notebook files.
 */
class NotebookToCFactory extends toc_lib_index_js_.TableOfContentsFactory {
    /**
     * Constructor
     *
     * @param tracker Widget tracker
     * @param parser Markdown parser
     * @param sanitizer Sanitizer
     */
    constructor(tracker, parser, sanitizer) {
        super(tracker);
        this.parser = parser;
        this.sanitizer = sanitizer;
        this._scrollToTop = true;
    }
    /**
     * Whether to scroll the active heading to the top
     * of the document or not.
     */
    get scrollToTop() {
        return this._scrollToTop;
    }
    set scrollToTop(v) {
        this._scrollToTop = v;
    }
    /**
     * Create a new table of contents model for the widget
     *
     * @param widget - widget
     * @param configuration - Table of contents configuration
     * @returns The table of contents model
     */
    _createNew(widget, configuration) {
        const model = new NotebookToCModel(widget, this.parser, this.sanitizer, configuration);
        // Connect model signals to notebook panel
        let headingToElement = new WeakMap();
        const onActiveHeadingChanged = (model, heading) => {
            if (heading) {
                const onCellInViewport = async (cell) => {
                    if (!cell.inViewport) {
                        // Bail early
                        return;
                    }
                    const el = headingToElement.get(heading);
                    if (el) {
                        if (this.scrollToTop) {
                            el.scrollIntoView({ block: 'start' });
                        }
                        else {
                            const widgetBox = widget.content.node.getBoundingClientRect();
                            const elementBox = el.getBoundingClientRect();
                            if (elementBox.top > widgetBox.bottom ||
                                elementBox.bottom < widgetBox.top) {
                                el.scrollIntoView({ block: 'center' });
                            }
                        }
                    }
                    else {
                        console.debug('scrolling to heading: using fallback strategy');
                        await widget.content.scrollToItem(widget.content.activeCellIndex, this.scrollToTop ? 'start' : undefined, 0);
                    }
                };
                const cell = heading.cellRef;
                const cells = widget.content.widgets;
                const idx = cells.indexOf(cell);
                // Switch to command mode to avoid entering Markdown cell in edit mode
                // if the document was in edit mode
                if (cell.model.type == 'markdown' && widget.content.mode != 'command') {
                    widget.content.mode = 'command';
                }
                widget.content.activeCellIndex = idx;
                if (cell.inViewport) {
                    onCellInViewport(cell).catch(reason => {
                        console.error(`Fail to scroll to cell to display the required heading (${reason}).`);
                    });
                }
                else {
                    widget.content
                        .scrollToItem(idx, this.scrollToTop ? 'start' : undefined)
                        .then(() => {
                        return onCellInViewport(cell);
                    })
                        .catch(reason => {
                        console.error(`Fail to scroll to cell to display the required heading (${reason}).`);
                    });
                }
            }
        };
        const findHeadingElement = (cell) => {
            model.getCellHeadings(cell).forEach(async (heading) => {
                var _a, _b, _c;
                const elementId = await getIdForHeading(heading, this.parser, this.sanitizer);
                const attribute = ((_a = this.sanitizer.allowNamedProperties) !== null && _a !== void 0 ? _a : false)
                    ? 'id'
                    : 'data-jupyter-id';
                const selector = elementId
                    ? `h${heading.level}[${attribute}="${CSS.escape(elementId)}"]`
                    : `h${heading.level}`;
                if (heading.outputIndex !== undefined) {
                    // Code cell
                    headingToElement.set(heading, toc_lib_index_js_.TableOfContentsUtils.addPrefix(heading.cellRef.outputArea.widgets[heading.outputIndex].node, selector, (_b = heading.prefix) !== null && _b !== void 0 ? _b : ''));
                }
                else {
                    headingToElement.set(heading, toc_lib_index_js_.TableOfContentsUtils.addPrefix(heading.cellRef.node, selector, (_c = heading.prefix) !== null && _c !== void 0 ? _c : ''));
                }
            });
        };
        const onHeadingsChanged = (model) => {
            if (!this.parser) {
                return;
            }
            // Clear all numbering items
            toc_lib_index_js_.TableOfContentsUtils.clearNumbering(widget.content.node);
            // Create a new mapping
            headingToElement = new WeakMap();
            widget.content.widgets.forEach(cell => {
                findHeadingElement(cell);
            });
        };
        const onHeadingCollapsed = (_, heading) => {
            var _a, _b, _c, _d;
            if (model.configuration.syncCollapseState) {
                if (heading !== null) {
                    const cell = heading.cellRef;
                    if (cell.headingCollapsed !== ((_a = heading.collapsed) !== null && _a !== void 0 ? _a : false)) {
                        cell.headingCollapsed = (_b = heading.collapsed) !== null && _b !== void 0 ? _b : false;
                    }
                }
                else {
                    const collapseState = (_d = (_c = model.headings[0]) === null || _c === void 0 ? void 0 : _c.collapsed) !== null && _d !== void 0 ? _d : false;
                    widget.content.widgets.forEach(cell => {
                        if (cell instanceof lib_index_js_.MarkdownCell) {
                            if (cell.headingInfo.level >= 0) {
                                cell.headingCollapsed = collapseState;
                            }
                        }
                    });
                }
            }
        };
        const onCellCollapsed = (_, cell) => {
            if (model.configuration.syncCollapseState) {
                const h = model.getCellHeadings(cell)[0];
                if (h) {
                    model.toggleCollapse({
                        heading: h,
                        collapsed: cell.headingCollapsed
                    });
                }
            }
        };
        const onCellInViewportChanged = (_, cell) => {
            if (cell.inViewport) {
                findHeadingElement(cell);
            }
            else {
                // Needed to remove prefix in cell outputs
                toc_lib_index_js_.TableOfContentsUtils.clearNumbering(cell.node);
            }
        };
        void widget.context.ready.then(() => {
            onHeadingsChanged(model);
            model.activeHeadingChanged.connect(onActiveHeadingChanged);
            model.headingsChanged.connect(onHeadingsChanged);
            model.collapseChanged.connect(onHeadingCollapsed);
            widget.content.cellCollapsed.connect(onCellCollapsed);
            widget.content.cellInViewportChanged.connect(onCellInViewportChanged);
            widget.disposed.connect(() => {
                model.activeHeadingChanged.disconnect(onActiveHeadingChanged);
                model.headingsChanged.disconnect(onHeadingsChanged);
                model.collapseChanged.disconnect(onHeadingCollapsed);
                widget.content.cellCollapsed.disconnect(onCellCollapsed);
                widget.content.cellInViewportChanged.disconnect(onCellInViewportChanged);
            });
        });
        return model;
    }
}
/**
 * Get the element id for an heading
 * @param heading Heading
 * @param parser The markdownparser
 * @returns The element id
 */
async function getIdForHeading(heading, parser, sanitizer) {
    let elementId = null;
    if (heading.type === lib_index_js_.Cell.HeadingType.Markdown) {
        elementId = await toc_lib_index_js_.TableOfContentsUtils.Markdown.getHeadingId(parser, 
        // Type from TableOfContentsUtils.Markdown.IMarkdownHeading
        heading.raw, heading.level, sanitizer);
    }
    else if (heading.type === lib_index_js_.Cell.HeadingType.HTML) {
        // Type from TableOfContentsUtils.IHTMLHeading
        elementId = heading.id;
    }
    return elementId;
}
//# sourceMappingURL=toc.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The notebook widget factory token.
 */
const INotebookWidgetFactory = new dist_index_js_.Token('@jupyterlab/notebook:INotebookWidgetFactory', 'A service to create the notebook viewer.');
/**
 * The notebook tools token.
 */
const INotebookTools = new dist_index_js_.Token('@jupyterlab/notebook:INotebookTools', `A service for the "Notebook Tools" panel in the
  right sidebar. Use this to add your own functionality to the panel.`);
/**
 * The notebook tracker token.
 */
const INotebookTracker = new dist_index_js_.Token('@jupyterlab/notebook:INotebookTracker', `A widget tracker for notebooks.
  Use this if you want to be able to iterate over and interact with notebooks
  created by the application.`);
/**
 * The notebook cell executor token.
 */
const INotebookCellExecutor = new dist_index_js_.Token('@jupyterlab/notebook:INotebookCellExecutor', `The notebook cell executor`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/tracker.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


class NotebookTracker extends index_js_.WidgetTracker {
    constructor() {
        super(...arguments);
        this._activeCell = null;
        this._activeCellChanged = new dist_index_es6_js_.Signal(this);
        this._selectionChanged = new dist_index_es6_js_.Signal(this);
    }
    /**
     * The currently focused cell.
     *
     * #### Notes
     * This is a read-only property. If there is no cell with the focus, then this
     * value is `null`.
     */
    get activeCell() {
        const widget = this.currentWidget;
        if (!widget) {
            return null;
        }
        return widget.content.activeCell || null;
    }
    /**
     * A signal emitted when the current active cell changes.
     *
     * #### Notes
     * If there is no cell with the focus, then `null` will be emitted.
     */
    get activeCellChanged() {
        return this._activeCellChanged;
    }
    /**
     * A signal emitted when the selection state changes.
     */
    get selectionChanged() {
        return this._selectionChanged;
    }
    /**
     * Add a new notebook panel to the tracker.
     *
     * @param panel - The notebook panel being added.
     */
    add(panel) {
        const promise = super.add(panel);
        panel.content.activeCellChanged.connect(this._onActiveCellChanged, this);
        panel.content.selectionChanged.connect(this._onSelectionChanged, this);
        return promise;
    }
    /**
     * Dispose of the resources held by the tracker.
     */
    dispose() {
        this._activeCell = null;
        super.dispose();
    }
    /**
     * Handle the current change event.
     */
    onCurrentChanged(widget) {
        // Store an internal reference to active cell to prevent false positives.
        const activeCell = this.activeCell;
        if (activeCell && activeCell === this._activeCell) {
            return;
        }
        this._activeCell = activeCell;
        if (!widget) {
            return;
        }
        // Since the notebook has changed, immediately signal an active cell change
        this._activeCellChanged.emit(widget.content.activeCell || null);
    }
    _onActiveCellChanged(sender, cell) {
        // Check if the active cell change happened for the current notebook.
        if (this.currentWidget && this.currentWidget.content === sender) {
            this._activeCell = cell || null;
            this._activeCellChanged.emit(this._activeCell);
        }
    }
    _onSelectionChanged(sender) {
        // Check if the selection change happened for the current notebook.
        if (this.currentWidget && this.currentWidget.content === sender) {
            this._selectionChanged.emit(void 0);
        }
    }
}
//# sourceMappingURL=tracker.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/truststatus.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



const TRUST_CLASS = 'jp-StatusItem-trust';
/**
 * Determine the notebook trust status message.
 */
function cellTrust(props, translator) {
    translator = translator || translation_lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    if (props.trustedCells === props.totalCells) {
        return trans.__('Notebook trusted: %1 of %2 code cells trusted.', props.trustedCells, props.totalCells);
    }
    else if (props.activeCellTrusted) {
        return trans.__('Active cell trusted: %1 of %2 code cells trusted.', props.trustedCells, props.totalCells);
    }
    else {
        return trans.__('Notebook not trusted: %1 of %2 code cells trusted.', props.trustedCells, props.totalCells);
    }
}
/**
 * A pure function for a notebook trust status component.
 *
 * @param props the props for the component.
 *
 * @returns a tsx component for notebook trust.
 */
function NotebookTrustComponent(props) {
    if (props.allCellsTrusted) {
        return react_index_js_default().createElement(ui_components_lib_index_js_.trustedIcon.react, { top: '2px', stylesheet: 'statusBar' });
    }
    else {
        return react_index_js_default().createElement(ui_components_lib_index_js_.notTrustedIcon.react, { top: '2px', stylesheet: 'statusBar' });
    }
}
/**
 * The NotebookTrust status item.
 */
class NotebookTrustStatus extends ui_components_lib_index_js_.VDomRenderer {
    /**
     * Construct a new status item.
     */
    constructor(translator) {
        super(new NotebookTrustStatus.Model());
        this.translator = translator || translation_lib_index_js_.nullTranslator;
        this.node.classList.add(TRUST_CLASS);
    }
    /**
     * Render the NotebookTrust status item.
     */
    render() {
        if (!this.model) {
            return null;
        }
        const newTitle = cellTrust(this.model, this.translator);
        if (newTitle !== this.node.title) {
            this.node.title = newTitle;
        }
        return (react_index_js_default().createElement(NotebookTrustComponent, { allCellsTrusted: this.model.trustedCells === this.model.totalCells, activeCellTrusted: this.model.activeCellTrusted, totalCells: this.model.totalCells, trustedCells: this.model.trustedCells }));
    }
}
/**
 * A namespace for NotebookTrust statics.
 */
(function (NotebookTrustStatus) {
    /**
     * A VDomModel for the NotebookTrust status item.
     */
    class Model extends ui_components_lib_index_js_.VDomModel {
        constructor() {
            super(...arguments);
            this._trustedCells = 0;
            this._totalCells = 0;
            this._activeCellTrusted = false;
            this._notebook = null;
        }
        /**
         * The number of trusted code cells in the current notebook.
         */
        get trustedCells() {
            return this._trustedCells;
        }
        /**
         * The total number of code cells in the current notebook.
         */
        get totalCells() {
            return this._totalCells;
        }
        /**
         * Whether the active cell is trusted.
         */
        get activeCellTrusted() {
            return this._activeCellTrusted;
        }
        /**
         * The current notebook for the model.
         */
        get notebook() {
            return this._notebook;
        }
        set notebook(model) {
            const oldNotebook = this._notebook;
            if (oldNotebook !== null) {
                oldNotebook.activeCellChanged.disconnect(this._onActiveCellChanged, this);
                oldNotebook.modelContentChanged.disconnect(this._onModelChanged, this);
            }
            const oldState = this._getAllState();
            this._notebook = model;
            if (this._notebook === null) {
                this._trustedCells = 0;
                this._totalCells = 0;
                this._activeCellTrusted = false;
            }
            else {
                // Add listeners
                this._notebook.activeCellChanged.connect(this._onActiveCellChanged, this);
                this._notebook.modelContentChanged.connect(this._onModelChanged, this);
                // Derive values
                if (this._notebook.activeCell) {
                    this._activeCellTrusted = this._notebook.activeCell.model.trusted;
                }
                else {
                    this._activeCellTrusted = false;
                }
                const { total, trusted } = this._deriveCellTrustState(this._notebook.model);
                this._totalCells = total;
                this._trustedCells = trusted;
            }
            this._triggerChange(oldState, this._getAllState());
        }
        /**
         * When the notebook model changes, update the trust state.
         */
        _onModelChanged(notebook) {
            const oldState = this._getAllState();
            const { total, trusted } = this._deriveCellTrustState(notebook.model);
            this._totalCells = total;
            this._trustedCells = trusted;
            this._triggerChange(oldState, this._getAllState());
        }
        /**
         * When the active cell changes, update the trust state.
         */
        _onActiveCellChanged(model, cell) {
            const oldState = this._getAllState();
            if (cell) {
                this._activeCellTrusted = cell.model.trusted;
            }
            else {
                this._activeCellTrusted = false;
            }
            this._triggerChange(oldState, this._getAllState());
        }
        /**
         * Given a notebook model, figure out how many of the code cells are trusted.
         */
        _deriveCellTrustState(model) {
            if (model === null) {
                return { total: 0, trusted: 0 };
            }
            let total = 0;
            let trusted = 0;
            for (const cell of model.cells) {
                if (cell.type !== 'code') {
                    continue;
                }
                total++;
                if (cell.trusted) {
                    trusted++;
                }
            }
            return { total, trusted };
        }
        /**
         * Get the current state of the model.
         */
        _getAllState() {
            return [this._trustedCells, this._totalCells, this.activeCellTrusted];
        }
        /**
         * Trigger a change in the renderer.
         */
        _triggerChange(oldState, newState) {
            if (oldState[0] !== newState[0] ||
                oldState[1] !== newState[1] ||
                oldState[2] !== newState[2]) {
                this.stateChanged.emit(void 0);
            }
        }
    }
    NotebookTrustStatus.Model = Model;
})(NotebookTrustStatus || (NotebookTrustStatus = {}));
//# sourceMappingURL=truststatus.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/widgetfactory.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A widget factory for notebook panels.
 */
class NotebookWidgetFactory extends docregistry_lib_index_js_.ABCWidgetFactory {
    /**
     * Construct a new notebook widget factory.
     *
     * @param options - The options used to construct the factory.
     */
    constructor(options) {
        super(options);
        this.rendermime = options.rendermime;
        this.contentFactory = options.contentFactory;
        this.mimeTypeService = options.mimeTypeService;
        this._editorConfig =
            options.editorConfig || StaticNotebook.defaultEditorConfig;
        this._notebookConfig =
            options.notebookConfig || StaticNotebook.defaultNotebookConfig;
    }
    /**
     * A configuration object for cell editor settings.
     */
    get editorConfig() {
        return this._editorConfig;
    }
    set editorConfig(value) {
        this._editorConfig = value;
    }
    /**
     * A configuration object for notebook settings.
     */
    get notebookConfig() {
        return this._notebookConfig;
    }
    set notebookConfig(value) {
        this._notebookConfig = value;
    }
    /**
     * Create a new widget.
     *
     * #### Notes
     * The factory will start the appropriate kernel.
     */
    createNewWidget(context, source) {
        const translator = context.translator;
        const kernelHistory = new NotebookHistory({
            sessionContext: context.sessionContext,
            translator: translator
        });
        const nbOptions = {
            rendermime: source
                ? source.content.rendermime
                : this.rendermime.clone({ resolver: context.urlResolver }),
            contentFactory: this.contentFactory,
            mimeTypeService: this.mimeTypeService,
            editorConfig: source ? source.content.editorConfig : this._editorConfig,
            notebookConfig: source
                ? source.content.notebookConfig
                : this._notebookConfig,
            translator,
            kernelHistory
        };
        const content = this.contentFactory.createNotebook(nbOptions);
        return new NotebookPanel({ context, content });
    }
}
//# sourceMappingURL=widgetfactory.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module notebook
 */




















//# sourceMappingURL=index.js.map

/***/ }),

/***/ 47456:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js + 1 modules
var statusbar_style = __webpack_require__(546);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@lumino/dragdrop/style/index.js + 1 modules
var dragdrop_style = __webpack_require__(49868);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/documentsearch/style/index.js + 1 modules
var documentsearch_style = __webpack_require__(13737);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codemirror/style/index.js + 1 modules
var codemirror_style = __webpack_require__(32871);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/toc/style/index.js + 1 modules
var toc_style = __webpack_require__(91302);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/cells/style/index.js + 2 modules
var cells_style = __webpack_require__(33230);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/lsp/style/index.js
var lsp_style = __webpack_require__(27844);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/notebook/style/base.css
var base = __webpack_require__(39678);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/notebook/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */

















/***/ }),

/***/ 10170:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ModelDB: () => (/* reexport */ ModelDB),
  ObservableJSON: () => (/* reexport */ ObservableJSON),
  ObservableList: () => (/* reexport */ ObservableList),
  ObservableMap: () => (/* reexport */ ObservableMap),
  ObservableString: () => (/* reexport */ ObservableString),
  ObservableUndoableList: () => (/* reexport */ ObservableUndoableList),
  ObservableValue: () => (/* reexport */ ObservableValue)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/observables/lib/observablemap.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A concrete implementation of IObservableMap<T>.
 */
class ObservableMap {
    /**
     * Construct a new observable map.
     */
    constructor(options = {}) {
        this._map = new Map();
        this._changed = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._itemCmp = options.itemCmp || Private.itemCmp;
        if (options.values) {
            for (const key in options.values) {
                this._map.set(key, options.values[key]);
            }
        }
    }
    /**
     * The type of the Observable.
     */
    get type() {
        return 'Map';
    }
    /**
     * A signal emitted when the map has changed.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Whether this map has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * The number of key-value pairs in the map.
     */
    get size() {
        return this._map.size;
    }
    /**
     * Set a key-value pair in the map
     *
     * @param key - The key to set.
     *
     * @param value - The value for the key.
     *
     * @returns the old value for the key, or undefined
     *   if that did not exist.
     *
     * @throws if the new value is undefined.
     *
     * #### Notes
     * This is a no-op if the value does not change.
     */
    set(key, value) {
        const oldVal = this._map.get(key);
        if (value === undefined) {
            throw Error('Cannot set an undefined value, use remove');
        }
        // Bail if the value does not change.
        const itemCmp = this._itemCmp;
        if (oldVal !== undefined && itemCmp(oldVal, value)) {
            return oldVal;
        }
        this._map.set(key, value);
        this._changed.emit({
            type: oldVal ? 'change' : 'add',
            key: key,
            oldValue: oldVal,
            newValue: value
        });
        return oldVal;
    }
    /**
     * Get a value for a given key.
     *
     * @param key - the key.
     *
     * @returns the value for that key.
     */
    get(key) {
        return this._map.get(key);
    }
    /**
     * Check whether the map has a key.
     *
     * @param key - the key to check.
     *
     * @returns `true` if the map has the key, `false` otherwise.
     */
    has(key) {
        return this._map.has(key);
    }
    /**
     * Get a list of the keys in the map.
     *
     * @returns - a list of keys.
     */
    keys() {
        const keyList = [];
        this._map.forEach((v, k) => {
            keyList.push(k);
        });
        return keyList;
    }
    /**
     * Get a list of the values in the map.
     *
     * @returns - a list of values.
     */
    values() {
        const valList = [];
        this._map.forEach((v, k) => {
            valList.push(v);
        });
        return valList;
    }
    /**
     * Remove a key from the map
     *
     * @param key - the key to remove.
     *
     * @returns the value of the given key,
     *   or undefined if that does not exist.
     *
     * #### Notes
     * This is a no-op if the value does not change.
     */
    delete(key) {
        const oldVal = this._map.get(key);
        const removed = this._map.delete(key);
        if (removed) {
            this._changed.emit({
                type: 'remove',
                key: key,
                oldValue: oldVal,
                newValue: undefined
            });
        }
        return oldVal;
    }
    /**
     * Set the ObservableMap to an empty map.
     */
    clear() {
        // Delete one by one to emit the correct signals.
        const keyList = this.keys();
        for (let i = 0; i < keyList.length; i++) {
            this.delete(keyList[i]);
        }
    }
    /**
     * Dispose of the resources held by the map.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
        this._map.clear();
    }
}
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * The default strict equality item comparator.
     */
    function itemCmp(first, second) {
        return first === second;
    }
    Private.itemCmp = itemCmp;
})(Private || (Private = {}));
//# sourceMappingURL=observablemap.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/observables/lib/observablejson.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A concrete Observable map for JSON data.
 */
class ObservableJSON extends ObservableMap {
    /**
     * Construct a new observable JSON object.
     */
    constructor(options = {}) {
        super({
            itemCmp: index_js_.JSONExt.deepEqual,
            values: options.values
        });
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        const out = Object.create(null);
        const keys = this.keys();
        for (const key of keys) {
            const value = this.get(key);
            if (value !== undefined) {
                out[key] = index_js_.JSONExt.deepCopy(value);
            }
        }
        return out;
    }
}
/**
 * The namespace for ObservableJSON static data.
 */
(function (ObservableJSON) {
    /**
     * An observable JSON change message.
     */
    class ChangeMessage extends messaging_dist_index_es6_js_.Message {
        /**
         * Create a new metadata changed message.
         */
        constructor(type, args) {
            super(type);
            this.args = args;
        }
    }
    ObservableJSON.ChangeMessage = ChangeMessage;
})(ObservableJSON || (ObservableJSON = {}));
//# sourceMappingURL=observablejson.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/observables/lib/observablestring.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A concrete implementation of [[IObservableString]]
 */
class ObservableString {
    /**
     * Construct a new observable string.
     */
    constructor(initialText = '') {
        this._text = '';
        this._isDisposed = false;
        this._changed = new dist_index_es6_js_.Signal(this);
        this._text = initialText;
    }
    /**
     * The type of the Observable.
     */
    get type() {
        return 'String';
    }
    /**
     * A signal emitted when the string has changed.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Set the value of the string.
     */
    set text(value) {
        if (value.length === this._text.length && value === this._text) {
            return;
        }
        this._text = value;
        this._changed.emit({
            type: 'set',
            start: 0,
            end: value.length,
            value: value
        });
    }
    /**
     * Get the value of the string.
     */
    get text() {
        return this._text;
    }
    /**
     * Insert a substring.
     *
     * @param index - The starting index.
     *
     * @param text - The substring to insert.
     */
    insert(index, text, options) {
        this._text = this._text.slice(0, index) + text + this._text.slice(index);
        this._changed.emit({
            type: 'insert',
            start: index,
            end: index + text.length,
            value: text,
            options
        });
    }
    /**
     * Remove a substring.
     *
     * @param start - The starting index.
     *
     * @param end - The ending index.
     */
    remove(start, end, options) {
        const oldValue = this._text.slice(start, end);
        this._text = this._text.slice(0, start) + this._text.slice(end);
        this._changed.emit({
            type: 'remove',
            start: start,
            end: end,
            value: oldValue,
            options
        });
    }
    /**
     * Set the ObservableString to an empty string.
     */
    clear() {
        this.text = '';
    }
    /**
     * Test whether the string has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the string.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
        this.clear();
    }
}
//# sourceMappingURL=observablestring.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/observables/lib/observablelist.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A concrete implementation of [[IObservableList]].
 */
class ObservableList {
    /**
     * Construct a new observable map.
     */
    constructor(options = {}) {
        this._array = [];
        this._isDisposed = false;
        this._changed = new dist_index_es6_js_.Signal(this);
        if (options.values) {
            for (const value of options.values) {
                this._array.push(value);
            }
        }
        this._itemCmp = options.itemCmp || observablelist_Private.itemCmp;
    }
    /**
     * The type of this object.
     */
    get type() {
        return 'List';
    }
    /**
     * A signal emitted when the list has changed.
     */
    get changed() {
        return this._changed;
    }
    /**
     * The length of the list.
     */
    get length() {
        return this._array.length;
    }
    /**
     * Test whether the list has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the list.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
        this.clear();
    }
    /**
     * Create an iterator over the values in the list.
     *
     * @returns A new iterator starting at the front of the list.
     *
     * #### Complexity
     * Constant.
     *
     * #### Iterator Validity
     * No changes.
     */
    [Symbol.iterator]() {
        return this._array[Symbol.iterator]();
    }
    /**
     * Get the value at the specified index.
     *
     * @param index - The positive integer index of interest.
     *
     * @returns The value at the specified index.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral or out of range.
     */
    get(index) {
        return this._array[index];
    }
    /**
     * Set the value at the specified index.
     *
     * @param index - The positive integer index of interest.
     *
     * @param value - The value to set at the specified index.
     *
     * #### Complexity
     * Constant.
     *
     * #### Iterator Validity
     * No changes.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral or out of range.
     */
    set(index, value) {
        const oldValue = this._array[index];
        if (value === undefined) {
            throw new Error('Cannot set an undefined item');
        }
        // Bail if the value does not change.
        const itemCmp = this._itemCmp;
        if (itemCmp(oldValue, value)) {
            return;
        }
        this._array[index] = value;
        this._changed.emit({
            type: 'set',
            oldIndex: index,
            newIndex: index,
            oldValues: [oldValue],
            newValues: [value]
        });
    }
    /**
     * Add a value to the end of the list.
     *
     * @param value - The value to add to the end of the list.
     *
     * @returns The new length of the list.
     *
     * #### Complexity
     * Constant.
     *
     * #### Notes
     * By convention, the oldIndex is set to -1 to indicate
     * an push operation.
     *
     * #### Iterator Validity
     * No changes.
     */
    push(value) {
        const num = this._array.push(value);
        this._changed.emit({
            type: 'add',
            oldIndex: -1,
            newIndex: this.length - 1,
            oldValues: [],
            newValues: [value]
        });
        return num;
    }
    /**
     * Insert a value into the list at a specific index.
     *
     * @param index - The index at which to insert the value.
     *
     * @param value - The value to set at the specified index.
     *
     * #### Complexity
     * Linear.
     *
     * #### Iterator Validity
     * No changes.
     *
     * #### Notes
     * The `index` will be clamped to the bounds of the list.
     *
     * By convention, the oldIndex is set to -2 to indicate
     * an insert operation.
     *
     * The value -2 as oldIndex can be used to distinguish from the push
     * method which will use a value -1.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     */
    insert(index, value) {
        if (index === this._array.length) {
            this._array.push(value);
        }
        else {
            algorithm_dist_index_es6_js_.ArrayExt.insert(this._array, index, value);
        }
        this._changed.emit({
            type: 'add',
            oldIndex: -2,
            newIndex: index,
            oldValues: [],
            newValues: [value]
        });
    }
    /**
     * Remove the first occurrence of a value from the list.
     *
     * @param value - The value of interest.
     *
     * @returns The index of the removed value, or `-1` if the value
     *   is not contained in the list.
     *
     * #### Complexity
     * Linear.
     *
     * #### Iterator Validity
     * Iterators pointing at the removed value and beyond are invalidated.
     */
    removeValue(value) {
        const itemCmp = this._itemCmp;
        const index = algorithm_dist_index_es6_js_.ArrayExt.findFirstIndex(this._array, item => {
            return itemCmp(item, value);
        });
        if (index < 0)
            return index;
        this.remove(index);
        return index;
    }
    /**
     * Remove and return the value at a specific index.
     *
     * @param index - The index of the value of interest.
     *
     * @returns The value at the specified index, or `undefined` if the
     *   index is out of range.
     *
     * #### Complexity
     * Constant.
     *
     * #### Iterator Validity
     * Iterators pointing at the removed value and beyond are invalidated.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     */
    remove(index) {
        const value = algorithm_dist_index_es6_js_.ArrayExt.removeAt(this._array, index);
        if (value === undefined) {
            return;
        }
        this._changed.emit({
            type: 'remove',
            oldIndex: index,
            newIndex: -1,
            newValues: [],
            oldValues: [value]
        });
        return value;
    }
    /**
     * Remove all values from the list.
     *
     * #### Complexity
     * Linear.
     *
     * #### Iterator Validity
     * All current iterators are invalidated.
     */
    clear() {
        const copy = this._array.slice();
        this._array.length = 0;
        this._changed.emit({
            type: 'clear',
            oldIndex: 0,
            newIndex: 0,
            newValues: [],
            oldValues: copy
        });
    }
    /**
     * Move a value from one index to another.
     *
     * @param fromIndex - The index of the element to move.
     *
     * @param toIndex - The index to move the element to.
     *
     * #### Complexity
     * Constant.
     *
     * #### Iterator Validity
     * Iterators pointing at the lesser of the `fromIndex` and the `toIndex`
     * and beyond are invalidated.
     *
     * #### Undefined Behavior
     * A `fromIndex` or a `toIndex` which is non-integral.
     */
    move(fromIndex, toIndex) {
        if (this.length <= 1 || fromIndex === toIndex) {
            return;
        }
        const values = [this._array[fromIndex]];
        algorithm_dist_index_es6_js_.ArrayExt.move(this._array, fromIndex, toIndex);
        this._changed.emit({
            type: 'move',
            oldIndex: fromIndex,
            newIndex: toIndex,
            oldValues: values,
            newValues: values
        });
    }
    /**
     * Push a set of values to the back of the list.
     *
     * @param values - An iterable set of values to add.
     *
     * @returns The new length of the list.
     *
     * #### Complexity
     * Linear.
     *
     * #### Notes
     * By convention, the oldIndex is set to -1 to indicate
     * an push operation.
     *
     * #### Iterator Validity
     * No changes.
     */
    pushAll(values) {
        const newIndex = this.length;
        for (const value of values) {
            this._array.push(value);
        }
        this._changed.emit({
            type: 'add',
            oldIndex: -1,
            newIndex,
            oldValues: [],
            newValues: Array.from(values)
        });
        return this.length;
    }
    /**
     * Insert a set of items into the list at the specified index.
     *
     * @param index - The index at which to insert the values.
     *
     * @param values - The values to insert at the specified index.
     *
     * #### Complexity.
     * Linear.
     *
     * #### Iterator Validity
     * No changes.
     *
     * #### Notes
     * The `index` will be clamped to the bounds of the list.
     * By convention, the oldIndex is set to -2 to indicate
     * an insert operation.
     *
     * #### Undefined Behavior.
     * An `index` which is non-integral.
     */
    insertAll(index, values) {
        const newIndex = index;
        for (const value of values) {
            algorithm_dist_index_es6_js_.ArrayExt.insert(this._array, index++, value);
        }
        this._changed.emit({
            type: 'add',
            oldIndex: -2,
            newIndex,
            oldValues: [],
            newValues: Array.from(values)
        });
    }
    /**
     * Remove a range of items from the list.
     *
     * @param startIndex - The start index of the range to remove (inclusive).
     *
     * @param endIndex - The end index of the range to remove (exclusive).
     *
     * @returns The new length of the list.
     *
     * #### Complexity
     * Linear.
     *
     * #### Iterator Validity
     * Iterators pointing to the first removed value and beyond are invalid.
     *
     * #### Undefined Behavior
     * A `startIndex` or `endIndex` which is non-integral.
     */
    removeRange(startIndex, endIndex) {
        const oldValues = this._array.slice(startIndex, endIndex);
        for (let i = startIndex; i < endIndex; i++) {
            algorithm_dist_index_es6_js_.ArrayExt.removeAt(this._array, startIndex);
        }
        this._changed.emit({
            type: 'remove',
            oldIndex: startIndex,
            newIndex: -1,
            oldValues,
            newValues: []
        });
        return this.length;
    }
}
/**
 * The namespace for module private data.
 */
var observablelist_Private;
(function (Private) {
    /**
     * The default strict equality item cmp.
     */
    function itemCmp(first, second) {
        return first === second;
    }
    Private.itemCmp = itemCmp;
})(observablelist_Private || (observablelist_Private = {}));
//# sourceMappingURL=observablelist.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/observables/lib/undoablelist.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A concrete implementation of an observable undoable list.
 */
class ObservableUndoableList extends ObservableList {
    /**
     * Construct a new undoable observable list.
     */
    constructor(serializer) {
        super();
        this._inCompound = false;
        this._isUndoable = true;
        this._madeCompoundChange = false;
        this._index = -1;
        this._stack = [];
        this._serializer = serializer;
        this.changed.connect(this._onListChanged, this);
    }
    /**
     * Whether the object can redo changes.
     */
    get canRedo() {
        return this._index < this._stack.length - 1;
    }
    /**
     * Whether the object can undo changes.
     */
    get canUndo() {
        return this._index >= 0;
    }
    /**
     * Begin a compound operation.
     *
     * @param isUndoAble - Whether the operation is undoable.
     *   The default is `true`.
     */
    beginCompoundOperation(isUndoAble) {
        this._inCompound = true;
        this._isUndoable = isUndoAble !== false;
        this._madeCompoundChange = false;
    }
    /**
     * End a compound operation.
     */
    endCompoundOperation() {
        this._inCompound = false;
        this._isUndoable = true;
        if (this._madeCompoundChange) {
            this._index++;
        }
    }
    /**
     * Undo an operation.
     */
    undo() {
        if (!this.canUndo) {
            return;
        }
        const changes = this._stack[this._index];
        this._isUndoable = false;
        for (const change of changes.reverse()) {
            this._undoChange(change);
        }
        this._isUndoable = true;
        this._index--;
    }
    /**
     * Redo an operation.
     */
    redo() {
        if (!this.canRedo) {
            return;
        }
        this._index++;
        const changes = this._stack[this._index];
        this._isUndoable = false;
        for (const change of changes) {
            this._redoChange(change);
        }
        this._isUndoable = true;
    }
    /**
     * Clear the change stack.
     */
    clearUndo() {
        this._index = -1;
        this._stack = [];
    }
    /**
     * Handle a change in the list.
     */
    _onListChanged(list, change) {
        if (this.isDisposed || !this._isUndoable) {
            return;
        }
        // Clear everything after this position if necessary.
        if (!this._inCompound || !this._madeCompoundChange) {
            this._stack = this._stack.slice(0, this._index + 1);
        }
        // Copy the change.
        const evt = this._copyChange(change);
        // Put the change in the stack.
        if (this._stack[this._index + 1]) {
            this._stack[this._index + 1].push(evt);
        }
        else {
            this._stack.push([evt]);
        }
        // If not in a compound operation, increase index.
        if (!this._inCompound) {
            this._index++;
        }
        else {
            this._madeCompoundChange = true;
        }
    }
    /**
     * Undo a change event.
     */
    _undoChange(change) {
        let index = 0;
        const serializer = this._serializer;
        switch (change.type) {
            case 'add':
                for (let length = change.newValues.length; length > 0; length--) {
                    this.remove(change.newIndex);
                }
                break;
            case 'set':
                index = change.oldIndex;
                for (const value of change.oldValues) {
                    this.set(index++, serializer.fromJSON(value));
                }
                break;
            case 'remove':
                index = change.oldIndex;
                for (const value of change.oldValues) {
                    this.insert(index++, serializer.fromJSON(value));
                }
                break;
            case 'move':
                this.move(change.newIndex, change.oldIndex);
                break;
            case 'clear':
                index = 0;
                for (const value of change.oldValues) {
                    this.insert(index++, serializer.fromJSON(value));
                }
                break;
            default:
                return;
        }
    }
    /**
     * Redo a change event.
     */
    _redoChange(change) {
        let index = 0;
        const serializer = this._serializer;
        switch (change.type) {
            case 'add':
                index = change.newIndex;
                for (const value of change.newValues) {
                    this.insert(index++, serializer.fromJSON(value));
                }
                break;
            case 'set':
                index = change.newIndex;
                for (const value of change.newValues) {
                    this.set(change.newIndex++, serializer.fromJSON(value));
                }
                break;
            case 'remove':
                for (let length = change.oldValues.length; length > 0; length--) {
                    this.remove(change.oldIndex);
                }
                break;
            case 'move':
                this.move(change.oldIndex, change.newIndex);
                break;
            case 'clear':
                this.clear();
                break;
            default:
                return;
        }
    }
    /**
     * Copy a change as JSON.
     */
    _copyChange(change) {
        const oldValues = [];
        for (const value of change.oldValues) {
            oldValues.push(this._serializer.toJSON(value));
        }
        const newValues = [];
        for (const value of change.newValues) {
            newValues.push(this._serializer.toJSON(value));
        }
        return {
            type: change.type,
            oldIndex: change.oldIndex,
            newIndex: change.newIndex,
            oldValues,
            newValues
        };
    }
}
/**
 * Namespace for ObservableUndoableList utilities.
 */
(function (ObservableUndoableList) {
    /**
     * A default, identity serializer.
     */
    class IdentitySerializer {
        /**
         * Identity serialize.
         */
        toJSON(value) {
            return value;
        }
        /**
         * Identity deserialize.
         */
        fromJSON(value) {
            return value;
        }
    }
    ObservableUndoableList.IdentitySerializer = IdentitySerializer;
})(ObservableUndoableList || (ObservableUndoableList = {}));
//# sourceMappingURL=undoablelist.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/observables/lib/modeldb.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * A concrete implementation of an `IObservableValue`.
 */
class ObservableValue {
    /**
     * Constructor for the value.
     *
     * @param initialValue the starting value for the `ObservableValue`.
     */
    constructor(initialValue = null) {
        this._value = null;
        this._changed = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._value = initialValue;
    }
    /**
     * The observable type.
     */
    get type() {
        return 'Value';
    }
    /**
     * Whether the value has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * The changed signal.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Get the current value, or `undefined` if it has not been set.
     */
    get() {
        return this._value;
    }
    /**
     * Set the current value.
     */
    set(value) {
        const oldValue = this._value;
        if (index_js_.JSONExt.deepEqual(oldValue, value)) {
            return;
        }
        this._value = value;
        this._changed.emit({
            oldValue: oldValue,
            newValue: value
        });
    }
    /**
     * Dispose of the resources held by the value.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        dist_index_es6_js_.Signal.clearData(this);
        this._value = null;
    }
}
/**
 * The namespace for the `ObservableValue` class statics.
 */
(function (ObservableValue) {
    /**
     * The changed args object emitted by the `IObservableValue`.
     */
    class IChangedArgs {
    }
    ObservableValue.IChangedArgs = IChangedArgs;
})(ObservableValue || (ObservableValue = {}));
/**
 * A concrete implementation of an `IModelDB`.
 */
class ModelDB {
    /**
     * Constructor for the `ModelDB`.
     */
    constructor(options = {}) {
        /**
         * Whether the model has been populated with
         * any model values.
         */
        this.isPrepopulated = false;
        /**
         * Whether the model is collaborative.
         */
        this.isCollaborative = false;
        /**
         * A promise resolved when the model is connected
         * to its backend. For the in-memory ModelDB it
         * is immediately resolved.
         */
        this.connected = Promise.resolve(void 0);
        this._toDispose = false;
        this._isDisposed = false;
        this._disposables = new index_es6_js_.DisposableSet();
        this._basePath = options.basePath || '';
        if (options.baseDB) {
            this._db = options.baseDB;
        }
        else {
            this._db = new ObservableMap();
            this._toDispose = true;
        }
    }
    /**
     * The base path for the `ModelDB`. This is prepended
     * to all the paths that are passed in to the member
     * functions of the object.
     */
    get basePath() {
        return this._basePath;
    }
    /**
     * Whether the database is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Get a value for a path.
     *
     * @param path the path for the object.
     *
     * @returns an `IObservable`.
     */
    get(path) {
        return this._db.get(this._resolvePath(path));
    }
    /**
     * Whether the `IModelDB` has an object at this path.
     *
     * @param path the path for the object.
     *
     * @returns a boolean for whether an object is at `path`.
     */
    has(path) {
        return this._db.has(this._resolvePath(path));
    }
    /**
     * Create a string and insert it in the database.
     *
     * @param path the path for the string.
     *
     * @returns the string that was created.
     */
    createString(path) {
        const str = new ObservableString();
        this._disposables.add(str);
        this.set(path, str);
        return str;
    }
    /**
     * Create an undoable list and insert it in the database.
     *
     * @param path the path for the list.
     *
     * @returns the list that was created.
     *
     * #### Notes
     * The list can only store objects that are simple
     * JSON Objects and primitives.
     */
    createList(path) {
        const vec = new ObservableUndoableList(new ObservableUndoableList.IdentitySerializer());
        this._disposables.add(vec);
        this.set(path, vec);
        return vec;
    }
    /**
     * Create a map and insert it in the database.
     *
     * @param path the path for the map.
     *
     * @returns the map that was created.
     *
     * #### Notes
     * The map can only store objects that are simple
     * JSON Objects and primitives.
     */
    createMap(path) {
        const map = new ObservableJSON();
        this._disposables.add(map);
        this.set(path, map);
        return map;
    }
    /**
     * Create an opaque value and insert it in the database.
     *
     * @param path the path for the value.
     *
     * @returns the value that was created.
     */
    createValue(path) {
        const val = new ObservableValue();
        this._disposables.add(val);
        this.set(path, val);
        return val;
    }
    /**
     * Get a value at a path, or `undefined if it has not been set
     * That value must already have been created using `createValue`.
     *
     * @param path the path for the value.
     */
    getValue(path) {
        const val = this.get(path);
        if (!val || val.type !== 'Value') {
            throw Error('Can only call getValue for an ObservableValue');
        }
        return val.get();
    }
    /**
     * Set a value at a path. That value must already have
     * been created using `createValue`.
     *
     * @param path the path for the value.
     *
     * @param value the new value.
     */
    setValue(path, value) {
        const val = this.get(path);
        if (!val || val.type !== 'Value') {
            throw Error('Can only call setValue on an ObservableValue');
        }
        val.set(value);
    }
    /**
     * Create a view onto a subtree of the model database.
     *
     * @param basePath the path for the root of the subtree.
     *
     * @returns an `IModelDB` with a view onto the original
     *   `IModelDB`, with `basePath` prepended to all paths.
     */
    view(basePath) {
        const view = new ModelDB({ basePath, baseDB: this });
        this._disposables.add(view);
        return view;
    }
    /**
     * Set a value at a path. Not intended to
     * be called by user code, instead use the
     * `create*` factory methods.
     *
     * @param path the path to set the value at.
     *
     * @param value the value to set at the path.
     */
    set(path, value) {
        this._db.set(this._resolvePath(path), value);
    }
    /**
     * Dispose of the resources held by the database.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        if (this._toDispose) {
            this._db.dispose();
        }
        this._disposables.dispose();
    }
    /**
     * Compute the fully resolved path for a path argument.
     */
    _resolvePath(path) {
        if (this._basePath) {
            path = this._basePath + '.' + path;
        }
        return path;
    }
}
//# sourceMappingURL=modeldb.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/observables/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module observables
 */






//# sourceMappingURL=index.js.map

/***/ }),

/***/ 47226:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  OutputArea: () => (/* reexport */ OutputArea),
  OutputAreaModel: () => (/* reexport */ OutputAreaModel),
  OutputPrompt: () => (/* reexport */ OutputPrompt),
  SimplifiedOutputArea: () => (/* reexport */ SimplifiedOutputArea),
  Stdin: () => (/* reexport */ Stdin)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/nbformat@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/nbformat/lib/index.js)
var index_js_ = __webpack_require__(74702);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/observables@~5.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/observables/lib/index.js)
var lib_index_js_ = __webpack_require__(52138);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/outputarea/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * The default implementation of the IOutputAreaModel.
 */
class OutputAreaModel {
    /**
     * Construct a new observable outputs instance.
     */
    constructor(options = {}) {
        /**
         * A flag that is set when we want to clear the output area
         * *after* the next addition to it.
         */
        this.clearNext = false;
        this._lastStreamName = '';
        this._trusted = false;
        this._isDisposed = false;
        this._stateChanged = new dist_index_es6_js_.Signal(this);
        this._changed = new dist_index_es6_js_.Signal(this);
        this._streamIndex = 0;
        this._trusted = !!options.trusted;
        this.contentFactory =
            options.contentFactory || OutputAreaModel.defaultContentFactory;
        this.list = new lib_index_js_.ObservableList();
        if (options.values) {
            for (const value of options.values) {
                const index = this._add(value) - 1;
                const item = this.list.get(index);
                item.changed.connect(this._onGenericChange, this);
            }
        }
        this.list.changed.connect(this._onListChanged, this);
    }
    /**
     * A signal emitted when an item changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * A signal emitted when the list of items changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Get the length of the items in the model.
     */
    get length() {
        return this.list ? this.list.length : 0;
    }
    /**
     * Get whether the model is trusted.
     */
    get trusted() {
        return this._trusted;
    }
    /**
     * Set whether the model is trusted.
     *
     * #### Notes
     * Changing the value will cause all of the models to re-set.
     */
    set trusted(value) {
        if (value === this._trusted) {
            return;
        }
        const trusted = (this._trusted = value);
        for (let i = 0; i < this.list.length; i++) {
            const oldItem = this.list.get(i);
            const value = oldItem.toJSON();
            const item = this._createItem({ value, trusted });
            this.list.set(i, item);
            oldItem.dispose();
        }
    }
    /**
     * Test whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.list.dispose();
        dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Get an item at the specified index.
     */
    get(index) {
        return this.list.get(index);
    }
    /**
     * Set the value at the specified index.
     */
    set(index, value) {
        value = dist_index_js_.JSONExt.deepCopy(value);
        // Normalize stream data.
        Private.normalize(value);
        const item = this._createItem({ value, trusted: this._trusted });
        this.list.set(index, item);
    }
    removeStreamOutput(number) {
        const prev = this.list.get(this.length - 1);
        const curText = prev.streamText;
        const length = curText.text.length;
        const options = { silent: true };
        curText.remove(length - number, length, options);
    }
    appendStreamOutput(text) {
        const prev = this.list.get(this.length - 1);
        const curText = prev.streamText;
        const length = curText.text.length;
        const options = { silent: true };
        curText.insert(length, text, options);
    }
    /**
     * Add an output, which may be combined with previous output.
     *
     * @returns The total number of outputs.
     *
     * #### Notes
     * The output bundle is copied.
     * Contiguous stream outputs of the same `name` are combined.
     */
    add(output) {
        // If we received a delayed clear message, then clear now.
        if (this.clearNext) {
            this.clear();
            this.clearNext = false;
        }
        return this._add(output);
    }
    /**
     * Remove an output at a given index.
     */
    remove(index) {
        var _a;
        (_a = this.list.remove(index)) === null || _a === void 0 ? void 0 : _a.dispose();
    }
    /**
     * Clear all of the output.
     *
     * @param wait Delay clearing the output until the next message is added.
     */
    clear(wait = false) {
        this._lastStreamName = '';
        if (wait) {
            this.clearNext = true;
            return;
        }
        for (const item of this.list) {
            item.dispose();
        }
        this.list.clear();
    }
    /**
     * Deserialize the model from JSON.
     *
     * #### Notes
     * This will clear any existing data.
     */
    fromJSON(values) {
        this.clear();
        for (const value of values) {
            this._add(value);
        }
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        return Array.from((0,index_es6_js_.map)(this.list, (output) => output.toJSON()));
    }
    /**
     * Add a copy of the item to the list.
     *
     * @returns The list length
     */
    _add(value) {
        const trusted = this._trusted;
        value = dist_index_js_.JSONExt.deepCopy(value);
        // Normalize the value.
        Private.normalize(value);
        // Consolidate outputs if they are stream outputs of the same kind.
        if (index_js_.isStream(value) &&
            value.name === this._lastStreamName &&
            this.length > 0 &&
            this.shouldCombine({
                value,
                lastModel: this.list.get(this.length - 1)
            })) {
            // We append the new text to the current text.
            // This creates a text change event.
            const prev = this.list.get(this.length - 1);
            const curText = prev.streamText;
            const newText = typeof value.text === 'string' ? value.text : value.text.join('');
            this._streamIndex = Private.addText(this._streamIndex, curText, newText);
            return this.length;
        }
        if (index_js_.isStream(value)) {
            if (typeof value.text !== 'string') {
                value.text = value.text.join('');
            }
            const { text, index } = Private.processText(0, value.text);
            this._streamIndex = index;
            value.text = text;
        }
        // Create the new item.
        const item = this._createItem({ value, trusted });
        // Add the item to our list and return the new length.
        const length = this.list.push(item);
        // Update the stream information.
        if (index_js_.isStream(value)) {
            this._lastStreamName = value.name;
        }
        else {
            this._lastStreamName = '';
        }
        return length;
    }
    /**
     * Whether a new value should be consolidated with the previous output.
     *
     * This will only be called if the minimal criteria of both being stream
     * messages of the same type.
     */
    shouldCombine(options) {
        return true;
    }
    /**
     * Create an output item and hook up its signals.
     */
    _createItem(options) {
        const factory = this.contentFactory;
        const item = factory.createOutputModel(options);
        return item;
    }
    /**
     * Handle a change to the list.
     */
    _onListChanged(sender, args) {
        switch (args.type) {
            case 'add':
                args.newValues.forEach(item => {
                    item.changed.connect(this._onGenericChange, this);
                });
                break;
            case 'remove':
                args.oldValues.forEach(item => {
                    item.changed.disconnect(this._onGenericChange, this);
                });
                break;
            case 'set':
                args.newValues.forEach(item => {
                    item.changed.connect(this._onGenericChange, this);
                });
                args.oldValues.forEach(item => {
                    item.changed.disconnect(this._onGenericChange, this);
                });
                break;
            case 'move':
                break;
            case 'clear':
                args.oldValues.forEach(item => {
                    item.changed.disconnect(this._onGenericChange, this);
                });
                break;
        }
        this._changed.emit(args);
    }
    /**
     * Handle a change to an item.
     */
    _onGenericChange(itemModel) {
        let idx;
        let item = null;
        for (idx = 0; idx < this.list.length; idx++) {
            item = this.list.get(idx);
            if (item === itemModel) {
                break;
            }
        }
        if (item != null) {
            this._stateChanged.emit(idx);
            this._changed.emit({
                type: 'set',
                newIndex: idx,
                oldIndex: idx,
                oldValues: [item],
                newValues: [item]
            });
        }
    }
}
/**
 * The namespace for OutputAreaModel class statics.
 */
(function (OutputAreaModel) {
    /**
     * The default implementation of a `IModelOutputFactory`.
     */
    class ContentFactory {
        /**
         * Create an output model.
         */
        createOutputModel(options) {
            return new rendermime_lib_index_js_.OutputModel(options);
        }
    }
    OutputAreaModel.ContentFactory = ContentFactory;
    /**
     * The default output model factory.
     */
    OutputAreaModel.defaultContentFactory = new ContentFactory();
})(OutputAreaModel || (OutputAreaModel = {}));
/**
 * A namespace for module-private functionality.
 */
var Private;
(function (Private) {
    /**
     * Normalize an output.
     */
    function normalize(value) {
        if (index_js_.isStream(value)) {
            if (Array.isArray(value.text)) {
                value.text = value.text.join('\n');
            }
        }
    }
    Private.normalize = normalize;
    /**
     * Like `indexOf` but allowing to use a regular expression.
     */
    function indexOfAny(text, re, i) {
        const index = text.slice(i).search(re);
        return index >= 0 ? index + i : index;
    }
    /*
     * Handle backspaces in `newText` and concatenates to `text`, if any.
     */
    function processText(index, newText, text) {
        if (text === undefined) {
            text = '';
        }
        if (!(newText.includes('\b') ||
            newText.includes('\r') ||
            newText.includes('\n'))) {
            text =
                text.slice(0, index) + newText + text.slice(index + newText.length);
            return { text, index: index + newText.length };
        }
        let idx0 = index;
        let idx1 = -1;
        let lastEnd = 0;
        const regex = /[\n\b\r]/;
        // TODO: once we upgrade eslint to 9.1.0 we can toggle `allExceptWhileTrue`
        // option and remove the ignore rule below.
        // eslint-disable-next-line no-constant-condition
        while (true) {
            idx1 = indexOfAny(newText, regex, lastEnd);
            // Insert characters at current position.
            const prefix = newText.slice(lastEnd, idx1 === -1 ? newText.length : idx1);
            text = text.slice(0, idx0) + prefix + text.slice(idx0 + prefix.length);
            lastEnd = idx1 + 1;
            idx0 += prefix.length;
            if (idx1 === -1) {
                break;
            }
            const newChar = newText[idx1];
            if (newChar === '\b') {
                // Backspace: delete previous character if there is one and if it's not a line feed.
                if (idx0 > 0 && text[idx0 - 1] !== '\n') {
                    text = text.slice(0, idx0 - 1) + text.slice(idx0 + 1);
                    idx0--;
                }
            }
            else if (newChar === '\r') {
                // Carriage return: go back to beginning of line.
                let done = false;
                while (!done) {
                    if (idx0 === 0) {
                        done = true;
                    }
                    else if (text[idx0 - 1] === '\n') {
                        done = true;
                    }
                    else {
                        idx0--;
                    }
                }
            }
            else if (newChar === '\n') {
                // Insert new line at end of text.
                text = text + '\n';
                idx0 = text.length;
            }
            else {
                throw Error(`This should not happen`);
            }
        }
        return { text, index: idx0 };
    }
    Private.processText = processText;
    /**
     * Reallocate the string to prevent memory leak,
     * workaround for issue in Chrome and Firefox:
     * - https://issues.chromium.org/issues/41480525
     * - https://bugzilla.mozilla.org/show_bug.cgi?id=727615
     */
    function unleakString(s) {
        return JSON.parse(JSON.stringify(s));
    }
    /*
     * Concatenate a string to an observable string, handling backspaces.
     */
    function addText(prevIndex, curText, newText) {
        const { text, index } = processText(prevIndex, newText, curText.text);
        // Compute the difference between current text and new text.
        let done = false;
        let idx = 0;
        while (!done) {
            if (idx === text.length) {
                if (idx === curText.text.length) {
                    done = true;
                }
                else {
                    curText.remove(idx, curText.text.length);
                    done = true;
                }
            }
            else if (idx === curText.text.length) {
                if (idx !== text.length) {
                    curText.insert(curText.text.length, unleakString(text.slice(idx)));
                    done = true;
                }
            }
            else if (text[idx] !== curText.text[idx]) {
                curText.remove(idx, curText.text.length);
                curText.insert(idx, unleakString(text.slice(idx)));
                done = true;
            }
            else {
                idx++;
            }
        }
        return index;
    }
    Private.addText = addText;
})(Private || (Private = {}));
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/properties@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/properties/dist/index.es6.js)
var properties_dist_index_es6_js_ = __webpack_require__(10249);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/outputarea/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * The class name added to an output area widget.
 */
const OUTPUT_AREA_CLASS = 'jp-OutputArea';
/**
 * The class name added to the direction children of OutputArea
 */
const OUTPUT_AREA_ITEM_CLASS = 'jp-OutputArea-child';
/**
 * The class name added to actual outputs
 */
const OUTPUT_AREA_OUTPUT_CLASS = 'jp-OutputArea-output';
/**
 * The class name added to prompt children of OutputArea.
 */
const OUTPUT_AREA_PROMPT_CLASS = 'jp-OutputArea-prompt';
const OUTPUT_AREA_STDIN_HIDING_CLASS = 'jp-OutputArea-stdin-hiding';
/**
 * The class name added to OutputPrompt.
 */
const OUTPUT_PROMPT_CLASS = 'jp-OutputPrompt';
/**
 * The class name added to an execution result.
 */
const EXECUTE_CLASS = 'jp-OutputArea-executeResult';
/**
 * The class name added stdin items of OutputArea
 */
const OUTPUT_AREA_STDIN_ITEM_CLASS = 'jp-OutputArea-stdin-item';
/**
 * The class name added to stdin widgets.
 */
const STDIN_CLASS = 'jp-Stdin';
/**
 * The class name added to stdin data prompt nodes.
 */
const STDIN_PROMPT_CLASS = 'jp-Stdin-prompt';
/**
 * The class name added to stdin data input nodes.
 */
const STDIN_INPUT_CLASS = 'jp-Stdin-input';
/**
 * The overlay that can be clicked to switch between output scrolling modes.
 */
const OUTPUT_PROMPT_OVERLAY = 'jp-OutputArea-promptOverlay';
/** ****************************************************************************
 * OutputArea
 ******************************************************************************/
/**
 * An output area widget.
 *
 * #### Notes
 * The widget model must be set separately and can be changed
 * at any time.  Consumers of the widget must account for a
 * `null` model, and may want to listen to the `modelChanged`
 * signal.
 */
class OutputArea extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct an output area widget.
     */
    constructor(options) {
        var _a, _b, _c, _d, _e;
        super();
        /**
         * A public signal used to indicate the number of displayed outputs has changed.
         *
         * #### Notes
         * This is useful for parents who want to apply styling based on the number
         * of outputs. Emits the current number of outputs.
         */
        this.outputLengthChanged = new dist_index_es6_js_.Signal(this);
        /**
         * Handle an iopub message.
         */
        this._onIOPub = (msg) => {
            const model = this.model;
            const msgType = msg.header.msg_type;
            let output;
            const transient = (msg.content.transient || {});
            const displayId = transient['display_id'];
            let targets;
            switch (msgType) {
                case 'execute_result':
                case 'display_data':
                case 'stream':
                case 'error':
                    output = { ...msg.content, output_type: msgType };
                    model.add(output);
                    break;
                case 'clear_output': {
                    const wait = msg.content.wait;
                    model.clear(wait);
                    break;
                }
                case 'update_display_data':
                    output = { ...msg.content, output_type: 'display_data' };
                    targets = this._displayIdMap.get(displayId);
                    if (targets) {
                        for (const index of targets) {
                            model.set(index, output);
                        }
                    }
                    break;
                case 'status': {
                    const executionState = msg.content
                        .execution_state;
                    if (executionState === 'idle') {
                        // If status is idle, the kernel is no longer blocked by the input
                        this._pendingInput = false;
                    }
                    break;
                }
                default:
                    break;
            }
            if (displayId && msgType === 'display_data') {
                targets = this._displayIdMap.get(displayId) || [];
                targets.push(model.length - 1);
                this._displayIdMap.set(displayId, targets);
            }
        };
        /**
         * Handle an execute reply message.
         */
        this._onExecuteReply = (msg) => {
            // API responses that contain a pager are special cased and their type
            // is overridden from 'execute_reply' to 'display_data' in order to
            // render output.
            const model = this.model;
            const content = msg.content;
            if (content.status !== 'ok') {
                return;
            }
            const payload = content && content.payload;
            if (!payload || !payload.length) {
                return;
            }
            const pages = payload.filter((i) => i.source === 'page');
            if (!pages.length) {
                return;
            }
            const page = JSON.parse(JSON.stringify(pages[0]));
            const output = {
                output_type: 'display_data',
                data: page.data,
                metadata: {}
            };
            model.add(output);
        };
        this._displayIdMap = new Map();
        this._minHeightTimeout = null;
        this._inputRequested = new dist_index_es6_js_.Signal(this);
        this._toggleScrolling = new dist_index_es6_js_.Signal(this);
        this._initialize = new dist_index_es6_js_.Signal(this);
        this._outputTracker = new apputils_lib_index_js_.WidgetTracker({
            namespace: dist_index_js_.UUID.uuid4()
        });
        this._inputHistoryScope = 'global';
        this._pendingInput = false;
        this._showInputPlaceholder = true;
        super.layout = new widgets_dist_index_es6_js_.PanelLayout();
        this.addClass(OUTPUT_AREA_CLASS);
        this.contentFactory =
            (_a = options.contentFactory) !== null && _a !== void 0 ? _a : OutputArea.defaultContentFactory;
        this.rendermime = options.rendermime;
        this._maxNumberOutputs = (_b = options.maxNumberOutputs) !== null && _b !== void 0 ? _b : Infinity;
        this._translator = (_c = options.translator) !== null && _c !== void 0 ? _c : translation_lib_index_js_.nullTranslator;
        this._inputHistoryScope = (_d = options.inputHistoryScope) !== null && _d !== void 0 ? _d : 'global';
        this._showInputPlaceholder = (_e = options.showInputPlaceholder) !== null && _e !== void 0 ? _e : true;
        const model = (this.model = options.model);
        for (let i = 0; i < Math.min(model.length, this._maxNumberOutputs + 1); i++) {
            const output = model.get(i);
            this._insertOutput(i, output);
            if (output.type === 'stream') {
                // This is a stream output, follow changes to the text.
                output.streamText.changed.connect((sender, event) => {
                    this._setOutput(i, output);
                });
            }
        }
        model.changed.connect(this.onModelChanged, this);
        model.stateChanged.connect(this.onStateChanged, this);
        if (options.promptOverlay) {
            this._addPromptOverlay();
        }
    }
    /**
     * Narrow the type of OutputArea's layout prop
     */
    get layout() {
        return super.layout;
    }
    /**
     * A read-only sequence of the children widgets in the output area.
     */
    get widgets() {
        return this.layout.widgets;
    }
    /**
     * The kernel future associated with the output area.
     */
    get future() {
        return this._future;
    }
    set future(value) {
        // Bail if the model is disposed.
        if (this.model.isDisposed) {
            throw Error('Model is disposed');
        }
        if (this._future === value) {
            return;
        }
        if (this._future) {
            this._future.dispose();
        }
        this._future = value;
        value.done
            .finally(() => {
            this._pendingInput = false;
        })
            .catch(() => {
            // No-op, required because `finally` re-raises any rejections,
            // even if caught on the `done` promise level before.
        });
        this.model.clear();
        // Make sure there were no input widgets.
        if (this.widgets.length) {
            this._clear();
            this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));
        }
        // Handle published messages.
        value.onIOPub = this._onIOPub;
        // Handle the execute reply.
        value.onReply = this._onExecuteReply;
        // Handle stdin.
        value.onStdin = msg => {
            if (services_lib_index_js_.KernelMessage.isInputRequestMsg(msg)) {
                this.onInputRequest(msg, value);
            }
        };
    }
    /**
     * Signal emitted when an output area is requesting an input. The signal
     * carries the input widget that this class creates in response to the input
     * request.
     */
    get inputRequested() {
        return this._inputRequested;
    }
    /**
     * A flag indicating if the output area has pending input.
     */
    get pendingInput() {
        return this._pendingInput;
    }
    /**
     * The maximum number of output items to display on top and bottom of cell output.
     *
     * ### Notes
     * It is set to Infinity if no trim is applied.
     */
    get maxNumberOutputs() {
        return this._maxNumberOutputs;
    }
    set maxNumberOutputs(limit) {
        if (limit <= 0) {
            console.warn(`OutputArea.maxNumberOutputs must be strictly positive.`);
            return;
        }
        const lastShown = this._maxNumberOutputs;
        this._maxNumberOutputs = limit;
        if (lastShown < limit) {
            this._showTrimmedOutputs(lastShown);
        }
    }
    /**
     * Dispose of the resources used by the output area.
     */
    dispose() {
        if (this._future) {
            this._future.dispose();
            this._future = null;
        }
        this._displayIdMap.clear();
        this._outputTracker.dispose();
        super.dispose();
    }
    /**
     * Follow changes on the model state.
     */
    onModelChanged(sender, args) {
        switch (args.type) {
            case 'add':
                const output = args.newValues[0];
                this._insertOutput(args.newIndex, output);
                if (output.type === 'stream') {
                    // A stream output has been added, follow changes to the text.
                    output.streamText.changed.connect((sender, event) => {
                        this._setOutput(args.newIndex, output);
                    });
                }
                break;
            case 'remove':
                if (this.widgets.length) {
                    // all items removed from model
                    if (this.model.length === 0) {
                        this._clear();
                    }
                    else {
                        // range of items removed from model
                        // remove widgets corresponding to removed model items
                        const startIndex = args.oldIndex;
                        for (let i = 0; i < args.oldValues.length && startIndex < this.widgets.length; ++i) {
                            const widget = this.widgets[startIndex];
                            widget.parent = null;
                            widget.dispose();
                        }
                        // apply item offset to target model item indices in _displayIdMap
                        this._moveDisplayIdIndices(startIndex, args.oldValues.length);
                        // prevent jitter caused by immediate height change
                        this._preventHeightChangeJitter();
                    }
                }
                break;
            case 'clear':
                this._clear();
                break;
            case 'set':
                this._setOutput(args.newIndex, args.newValues[0]);
                break;
            default:
                break;
        }
        this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));
    }
    /**
     * Emitted when user requests toggling of the output scrolling mode.
     */
    get toggleScrolling() {
        return this._toggleScrolling;
    }
    get initialize() {
        return this._initialize;
    }
    /**
     * Add overlay allowing to toggle scrolling.
     */
    _addPromptOverlay() {
        const overlay = document.createElement('div');
        overlay.className = OUTPUT_PROMPT_OVERLAY;
        overlay.addEventListener('click', () => {
            this._toggleScrolling.emit();
        });
        this.node.appendChild(overlay);
        // Update overlay height so it always matches the output panel.
        // TODO: use CSS anchor positionning level once fully supported in all browsers
        const resize = () => {
            const panel = this.node.querySelector('.jp-OutputArea-child');
            if (panel) {
                overlay.style.height = `${Math.max(panel.getBoundingClientRect().height, this.node.getBoundingClientRect().height)}px`;
            }
        };
        const observer = new ResizeObserver(resize);
        observer.observe(this.node);
        this.disposed.connect(() => {
            observer.disconnect();
        });
        requestAnimationFrame(() => {
            this._initialize.emit();
        });
    }
    /**
     * Update indices in _displayIdMap in response to element remove from model items
     *
     * @param startIndex - The index of first element removed
     *
     * @param count - The number of elements removed from model items
     *
     */
    _moveDisplayIdIndices(startIndex, count) {
        this._displayIdMap.forEach((indices) => {
            const rangeEnd = startIndex + count;
            const numIndices = indices.length;
            // reverse loop in order to prevent removing element affecting the index
            for (let i = numIndices - 1; i >= 0; --i) {
                const index = indices[i];
                // remove model item indices in removed range
                if (index >= startIndex && index < rangeEnd) {
                    indices.splice(i, 1);
                }
                else if (index >= rangeEnd) {
                    // move model item indices that were larger than range end
                    indices[i] -= count;
                }
            }
        });
    }
    /**
     * Follow changes on the output model state.
     */
    onStateChanged(sender, change) {
        const outputLength = Math.min(this.model.length, this._maxNumberOutputs);
        if (change) {
            if (change >= this._maxNumberOutputs) {
                // Bail early
                return;
            }
            this._setOutput(change, this.model.get(change));
        }
        else {
            for (let i = 0; i < outputLength; i++) {
                this._setOutput(i, this.model.get(i));
            }
        }
        this.outputLengthChanged.emit(outputLength);
    }
    /**
     * Clear the widget outputs.
     */
    _clear() {
        // Bail if there is no work to do.
        if (!this.widgets.length) {
            return;
        }
        // Remove all of our widgets.
        const length = this.widgets.length;
        for (let i = 0; i < length; i++) {
            const widget = this.widgets[0];
            widget.parent = null;
            widget.dispose();
        }
        // Clear the display id map.
        this._displayIdMap.clear();
        // prevent jitter caused by immediate height change
        this._preventHeightChangeJitter();
    }
    _preventHeightChangeJitter() {
        // When an output area is cleared and then quickly replaced with new
        // content (as happens with @interact in widgets, for example), the
        // quickly changing height can make the page jitter.
        // We introduce a small delay in the minimum height
        // to prevent this jitter.
        const rect = this.node.getBoundingClientRect();
        this.node.style.minHeight = `${rect.height}px`;
        if (this._minHeightTimeout) {
            window.clearTimeout(this._minHeightTimeout);
        }
        this._minHeightTimeout = window.setTimeout(() => {
            if (this.isDisposed) {
                return;
            }
            this.node.style.minHeight = '';
        }, 50);
    }
    /**
     * Handle an input request from a kernel.
     */
    onInputRequest(msg, future) {
        // Add an output widget to the end.
        const factory = this.contentFactory;
        const stdinPrompt = msg.content.prompt;
        const password = msg.content.password;
        const panel = new widgets_dist_index_es6_js_.Panel();
        panel.addClass(OUTPUT_AREA_ITEM_CLASS);
        panel.addClass(OUTPUT_AREA_STDIN_ITEM_CLASS);
        const prompt = factory.createOutputPrompt();
        prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);
        panel.addWidget(prompt);
        // Indicate that input is pending
        this._pendingInput = true;
        const input = factory.createStdin({
            parent_header: msg.header,
            prompt: stdinPrompt,
            password,
            future,
            translator: this._translator,
            inputHistoryScope: this._inputHistoryScope,
            showInputPlaceholder: this._showInputPlaceholder
        });
        input.addClass(OUTPUT_AREA_OUTPUT_CLASS);
        panel.addWidget(input);
        // Increase number of outputs to display the result up to the input request.
        if (this.model.length >= this.maxNumberOutputs) {
            this.maxNumberOutputs = this.model.length;
        }
        this._inputRequested.emit(input);
        // Get the input node to ensure focus after updating the model upon user reply.
        const inputNode = input.node.getElementsByTagName('input')[0];
        /**
         * Wait for the stdin to complete, add it to the model (so it persists)
         * and remove the stdin widget.
         */
        void input.value.then(value => {
            // Increase number of outputs to display the result of stdin if needed.
            if (this.model.length >= this.maxNumberOutputs) {
                this.maxNumberOutputs = this.model.length + 1;
            }
            panel.addClass(OUTPUT_AREA_STDIN_HIDING_CLASS);
            // Use stdin as the stream so it does not get combined with stdout.
            // Note: because it modifies DOM it may (will) shift focus away from the input node.
            this.model.add({
                output_type: 'stream',
                name: 'stdin',
                text: value + '\n'
            });
            // Refocus the input node after it lost focus due to update of the model.
            inputNode.focus();
            // Indicate that input is no longer pending
            this._pendingInput = false;
            // Keep the input in view for a little while; this (along refocusing)
            // ensures that we can avoid the cell editor stealing the focus, and
            // leading to user inadvertently modifying editor content when executing
            // consecutive commands in short succession.
            window.setTimeout(() => {
                // Tack currently focused element to ensure that it remains on it
                // after disposal of the panel with the old input
                // (which modifies DOM and can lead to focus jump).
                const focusedElement = document.activeElement;
                // Dispose the old panel with no longer needed input box.
                panel.dispose();
                // Refocus the element that was focused before.
                if (focusedElement && focusedElement instanceof HTMLElement) {
                    focusedElement.focus();
                }
            }, 500);
        });
        // Note: the `input.value` promise must be listened to before we attach the panel
        this.layout.addWidget(panel);
    }
    /**
     * Update an output in the layout in place.
     */
    _setOutput(index, model) {
        if (index >= this._maxNumberOutputs) {
            return;
        }
        const panel = this.layout.widgets[index];
        const renderer = (panel.widgets
            ? panel.widgets.filter(it => 'renderModel' in it).pop()
            : panel);
        // Check whether it is safe to reuse renderer:
        // - Preferred mime type has not changed
        // - Isolation has not changed
        const mimeType = this.rendermime.preferredMimeType(model.data, model.trusted ? 'any' : 'ensure');
        if (widget_Private.currentPreferredMimetype.get(renderer) === mimeType &&
            OutputArea.isIsolated(mimeType, model.metadata) ===
                renderer instanceof widget_Private.IsolatedRenderer) {
            void renderer.renderModel(model);
        }
        else {
            this.layout.widgets[index].dispose();
            this._insertOutput(index, model);
        }
    }
    /**
     * Render and insert a single output into the layout.
     *
     * @param index - The index of the output to be inserted.
     * @param model - The model of the output to be inserted.
     */
    _insertOutput(index, model) {
        if (index > this._maxNumberOutputs) {
            return;
        }
        const layout = this.layout;
        if (index === this._maxNumberOutputs) {
            const warning = new widget_Private.TrimmedOutputs(this._maxNumberOutputs, () => {
                const lastShown = this._maxNumberOutputs;
                this._maxNumberOutputs = Infinity;
                this._showTrimmedOutputs(lastShown);
            }, this._translator);
            layout.insertWidget(index, this._wrappedOutput(warning));
        }
        else {
            let output = this.createOutputItem(model);
            if (output) {
                output.toggleClass(EXECUTE_CLASS, model.executionCount !== null);
            }
            else {
                output = new widgets_dist_index_es6_js_.Widget();
            }
            if (!this._outputTracker.has(output)) {
                void this._outputTracker.add(output);
            }
            layout.insertWidget(index, output);
        }
    }
    /**
     * A widget tracker for individual output widgets in the output area.
     */
    get outputTracker() {
        return this._outputTracker;
    }
    /**
     * Dispose information message and show output models from the given
     * index to maxNumberOutputs
     *
     * @param lastShown Starting model index to insert.
     */
    _showTrimmedOutputs(lastShown) {
        // Dispose information widget
        this.widgets[lastShown].dispose();
        for (let idx = lastShown; idx < this.model.length; idx++) {
            this._insertOutput(idx, this.model.get(idx));
        }
        this.outputLengthChanged.emit(Math.min(this.model.length, this._maxNumberOutputs));
    }
    /**
     * Create an output item with a prompt and actual output
     *
     * @returns a rendered widget, or null if we cannot render
     * #### Notes
     */
    createOutputItem(model) {
        const output = this.createRenderedMimetype(model);
        if (!output) {
            return null;
        }
        return this._wrappedOutput(output, model.executionCount);
    }
    /**
     * Render a mimetype
     */
    createRenderedMimetype(model) {
        const mimeType = this.rendermime.preferredMimeType(model.data, model.trusted ? 'any' : 'ensure');
        if (!mimeType) {
            return null;
        }
        let output = this.rendermime.createRenderer(mimeType);
        const isolated = OutputArea.isIsolated(mimeType, model.metadata);
        if (isolated === true) {
            output = new widget_Private.IsolatedRenderer(output);
        }
        widget_Private.currentPreferredMimetype.set(output, mimeType);
        output.renderModel(model).catch(error => {
            // Manually append error message to output
            const pre = document.createElement('pre');
            const trans = this._translator.load('jupyterlab');
            pre.textContent = trans.__('Javascript Error: %1', error.message);
            output.node.appendChild(pre);
            // Remove mime-type-specific CSS classes
            output.node.className = 'lm-Widget jp-RenderedText';
            output.node.setAttribute('data-mime-type', 'application/vnd.jupyter.stderr');
        });
        return output;
    }
    /**
     * Wrap a output widget within a output panel
     *
     * @param output Output widget to wrap
     * @param executionCount Execution count
     * @returns The output panel
     */
    _wrappedOutput(output, executionCount = null) {
        const panel = new widget_Private.OutputPanel();
        panel.addClass(OUTPUT_AREA_ITEM_CLASS);
        const prompt = this.contentFactory.createOutputPrompt();
        prompt.executionCount = executionCount;
        prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);
        panel.addWidget(prompt);
        output.addClass(OUTPUT_AREA_OUTPUT_CLASS);
        panel.addWidget(output);
        return panel;
    }
}
class SimplifiedOutputArea extends OutputArea {
    /**
     * Handle an input request from a kernel by doing nothing.
     */
    onInputRequest(msg, future) {
        return;
    }
    /**
     * Create an output item without a prompt, just the output widgets
     */
    createOutputItem(model) {
        const output = this.createRenderedMimetype(model);
        if (!output) {
            return null;
        }
        const panel = new widget_Private.OutputPanel();
        panel.addClass(OUTPUT_AREA_ITEM_CLASS);
        output.addClass(OUTPUT_AREA_OUTPUT_CLASS);
        panel.addWidget(output);
        return panel;
    }
}
/**
 * A namespace for OutputArea statics.
 */
(function (OutputArea) {
    /**
     * Execute code on an output area.
     */
    async function execute(code, output, sessionContext, metadata) {
        var _a;
        // Override the default for `stop_on_error`.
        let stopOnError = true;
        if (metadata &&
            Array.isArray(metadata.tags) &&
            metadata.tags.indexOf('raises-exception') !== -1) {
            stopOnError = false;
        }
        const content = {
            code,
            stop_on_error: stopOnError
        };
        const kernel = (_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
        if (!kernel) {
            throw new Error('Session has no kernel.');
        }
        const future = kernel.requestExecute(content, false, metadata);
        output.future = future;
        return future.done;
    }
    OutputArea.execute = execute;
    function isIsolated(mimeType, metadata) {
        const mimeMd = metadata[mimeType];
        // mime-specific higher priority
        if (mimeMd && mimeMd['isolated'] !== undefined) {
            return !!mimeMd['isolated'];
        }
        else {
            // fallback on global
            return !!metadata['isolated'];
        }
    }
    OutputArea.isIsolated = isIsolated;
    /**
     * The default implementation of `IContentFactory`.
     */
    class ContentFactory {
        /**
         * Create the output prompt for the widget.
         */
        createOutputPrompt() {
            return new OutputPrompt();
        }
        /**
         * Create an stdin widget.
         */
        createStdin(options) {
            return new Stdin(options);
        }
    }
    OutputArea.ContentFactory = ContentFactory;
    /**
     * The default `ContentFactory` instance.
     */
    OutputArea.defaultContentFactory = new ContentFactory();
})(OutputArea || (OutputArea = {}));
/**
 * The default output prompt implementation
 */
class OutputPrompt extends widgets_dist_index_es6_js_.Widget {
    /*
     * Create an output prompt widget.
     */
    constructor() {
        super();
        this._executionCount = null;
        this.addClass(OUTPUT_PROMPT_CLASS);
    }
    /**
     * The execution count for the prompt.
     */
    get executionCount() {
        return this._executionCount;
    }
    set executionCount(value) {
        this._executionCount = value;
        if (value === null) {
            this.node.textContent = '';
        }
        else {
            this.node.textContent = `[${value}]:`;
        }
    }
}
/**
 * The default stdin widget.
 */
class Stdin extends widgets_dist_index_es6_js_.Widget {
    static _historyIx(key, ix) {
        const history = Stdin._history.get(key);
        if (!history) {
            return undefined;
        }
        const len = history.length;
        // wrap nonpositive ix to nonnegative ix
        if (ix <= 0) {
            return len + ix;
        }
    }
    static _historyAt(key, ix) {
        const history = Stdin._history.get(key);
        if (!history) {
            return undefined;
        }
        const len = history.length;
        const ixpos = Stdin._historyIx(key, ix);
        if (ixpos !== undefined && ixpos < len) {
            return history[ixpos];
        }
        // return undefined if ix is out of bounds
    }
    static _historyPush(key, line) {
        const history = Stdin._history.get(key);
        history.push(line);
        if (history.length > 1000) {
            // truncate line history if it's too long
            history.shift();
        }
    }
    static _historySearch(key, pat, ix, reverse = true) {
        const history = Stdin._history.get(key);
        const len = history.length;
        const ixpos = Stdin._historyIx(key, ix);
        const substrFound = (x) => x.search(pat) !== -1;
        if (ixpos === undefined) {
            return;
        }
        if (reverse) {
            if (ixpos === 0) {
                // reverse search fails if already at start of history
                return;
            }
            const ixFound = history.slice(0, ixpos).findLastIndex(substrFound);
            if (ixFound !== -1) {
                // wrap ix to negative
                return ixFound - len;
            }
        }
        else {
            if (ixpos >= len - 1) {
                // forward search fails if already at end of history
                return;
            }
            const ixFound = history.slice(ixpos + 1).findIndex(substrFound);
            if (ixFound !== -1) {
                // wrap ix to negative and adjust for slice
                return ixFound - len + ixpos + 1;
            }
        }
    }
    /**
     * Construct a new input widget.
     */
    constructor(options) {
        var _a;
        super({
            node: widget_Private.createInputWidgetNode(options.prompt, options.password)
        });
        this._promise = new dist_index_js_.PromiseDelegate();
        this._resolved = false;
        this.addClass(STDIN_CLASS);
        this._future = options.future;
        this._historyIndex = 0;
        this._historyKey =
            options.inputHistoryScope === 'session'
                ? options.parent_header.session
                : '';
        this._historyPat = '';
        this._parentHeader = options.parent_header;
        this._password = options.password;
        this._trans = ((_a = options.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        this._value = options.prompt + ' ';
        this._input = this.node.getElementsByTagName('input')[0];
        // make users aware of the line history feature
        if (options.showInputPlaceholder && !this._password) {
            this._input.placeholder = this._trans.__('↑↓ for history. Search history with c-↑/c-↓');
        }
        else {
            this._input.placeholder = '';
        }
        // initialize line history
        if (!Stdin._history.has(this._historyKey)) {
            Stdin._history.set(this._historyKey, []);
        }
    }
    /**
     * The value of the widget.
     */
    get value() {
        return this._promise.promise.then(() => this._value);
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the dock panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        // Stop bubbling
        event.stopPropagation();
        if (this._resolved) {
            // Do not handle any more key events if the promise was resolved.
            event.preventDefault();
            return;
        }
        const input = this._input;
        if (event.type === 'keydown') {
            if (event.key === 'Enter') {
                this.resetSearch();
                this._future.sendInputReply({
                    status: 'ok',
                    value: input.value
                }, this._parentHeader);
                if (this._password) {
                    this._value += '········';
                }
                else {
                    this._value += input.value;
                    Stdin._historyPush(this._historyKey, input.value);
                }
                this._resolved = true;
                this._promise.resolve(void 0);
            }
            else if (event.key === 'Escape') {
                // currently this gets clobbered by the documentsearch:end command at the notebook level
                this.resetSearch();
                input.blur();
            }
            else if (event.ctrlKey &&
                (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
                // if _historyPat is blank, use input as search pattern. Otherwise, reuse the current search pattern
                if (this._historyPat === '') {
                    this._historyPat = input.value;
                }
                const reverse = event.key === 'ArrowUp';
                const searchHistoryIx = Stdin._historySearch(this._historyKey, this._historyPat, this._historyIndex, reverse);
                if (searchHistoryIx !== undefined) {
                    const historyLine = Stdin._historyAt(this._historyKey, searchHistoryIx);
                    if (historyLine !== undefined) {
                        if (this._historyIndex === 0) {
                            this._valueCache = input.value;
                        }
                        this._setInputValue(historyLine);
                        this._historyIndex = searchHistoryIx;
                        // The default action for ArrowUp is moving to first character
                        // but we want to keep the cursor at the end.
                        event.preventDefault();
                    }
                }
            }
            else if (event.key === 'ArrowUp') {
                this.resetSearch();
                const historyLine = Stdin._historyAt(this._historyKey, this._historyIndex - 1);
                if (historyLine) {
                    if (this._historyIndex === 0) {
                        this._valueCache = input.value;
                    }
                    this._setInputValue(historyLine);
                    --this._historyIndex;
                    // The default action for ArrowUp is moving to first character
                    // but we want to keep the cursor at the end.
                    event.preventDefault();
                }
            }
            else if (event.key === 'ArrowDown') {
                this.resetSearch();
                if (this._historyIndex === 0) {
                    // do nothing
                }
                else if (this._historyIndex === -1) {
                    this._setInputValue(this._valueCache);
                    ++this._historyIndex;
                }
                else {
                    const historyLine = Stdin._historyAt(this._historyKey, this._historyIndex + 1);
                    if (historyLine) {
                        this._setInputValue(historyLine);
                        ++this._historyIndex;
                    }
                }
            }
        }
    }
    resetSearch() {
        this._historyPat = '';
    }
    /**
     * Handle `after-attach` messages sent to the widget.
     */
    onAfterAttach(msg) {
        this._input.addEventListener('keydown', this);
        this._input.focus();
    }
    /**
     * Handle `before-detach` messages sent to the widget.
     */
    onBeforeDetach(msg) {
        this._input.removeEventListener('keydown', this);
    }
    _setInputValue(value) {
        this._input.value = value;
        // Set cursor at the end; this is usually not necessary when input is
        // focused but having the explicit placement ensures consistency.
        this._input.setSelectionRange(value.length, value.length);
    }
}
Stdin._history = new Map();
/** ****************************************************************************
 * Private namespace
 ******************************************************************************/
/**
 * A namespace for private data.
 */
var widget_Private;
(function (Private) {
    /**
     * Create the node for an InputWidget.
     */
    function createInputWidgetNode(prompt, password) {
        const node = document.createElement('div');
        const promptNode = document.createElement('pre');
        promptNode.className = STDIN_PROMPT_CLASS;
        promptNode.textContent = prompt;
        const input = document.createElement('input');
        input.className = STDIN_INPUT_CLASS;
        if (password) {
            input.type = 'password';
        }
        node.appendChild(promptNode);
        promptNode.appendChild(input);
        return node;
    }
    Private.createInputWidgetNode = createInputWidgetNode;
    /**
     * A renderer for IFrame data.
     */
    class IsolatedRenderer extends widgets_dist_index_es6_js_.Widget {
        /**
         * Create an isolated renderer.
         */
        constructor(wrapped) {
            super({ node: document.createElement('iframe') });
            this.addClass('jp-mod-isolated');
            this._wrapped = wrapped;
            // Once the iframe is loaded, the subarea is dynamically inserted
            const iframe = this.node;
            iframe.frameBorder = '0';
            iframe.scrolling = 'auto';
            iframe.addEventListener('load', () => {
                // Workaround needed by Firefox, to properly render svg inside
                // iframes, see https://stackoverflow.com/questions/10177190/
                // svg-dynamically-added-to-iframe-does-not-render-correctly
                iframe.contentDocument.open();
                // Insert the subarea into the iframe
                // We must directly write the html. At this point, subarea doesn't
                // contain any user content.
                iframe.contentDocument.write(this._wrapped.node.innerHTML);
                iframe.contentDocument.close();
                const body = iframe.contentDocument.body;
                // Adjust the iframe height automatically
                iframe.style.height = `${body.scrollHeight}px`;
                iframe.heightChangeObserver = new ResizeObserver(() => {
                    iframe.style.height = `${body.scrollHeight}px`;
                });
                iframe.heightChangeObserver.observe(body);
            });
        }
        /**
         * Render a mime model.
         *
         * @param model - The mime model to render.
         *
         * @returns A promise which resolves when rendering is complete.
         *
         * #### Notes
         * This method may be called multiple times during the lifetime
         * of the widget to update it if and when new data is available.
         */
        renderModel(model) {
            return this._wrapped.renderModel(model);
        }
    }
    Private.IsolatedRenderer = IsolatedRenderer;
    Private.currentPreferredMimetype = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'preferredMimetype',
        create: owner => ''
    });
    /**
     * A `Panel` that's focused by a `contextmenu` event.
     */
    class OutputPanel extends widgets_dist_index_es6_js_.Panel {
        /**
         * Construct a new `OutputPanel` widget.
         */
        constructor(options) {
            super(options);
        }
        /**
         * A callback that focuses on the widget.
         */
        _onContext(_) {
            this.node.focus();
        }
        /**
         * Handle `after-attach` messages sent to the widget.
         */
        onAfterAttach(msg) {
            super.onAfterAttach(msg);
            this.node.addEventListener('contextmenu', this._onContext.bind(this));
        }
        /**
         * Handle `before-detach` messages sent to the widget.
         */
        onBeforeDetach(msg) {
            super.onAfterDetach(msg);
            this.node.removeEventListener('contextmenu', this._onContext.bind(this));
        }
    }
    Private.OutputPanel = OutputPanel;
    /**
     * Trimmed outputs information widget.
     */
    class TrimmedOutputs extends widgets_dist_index_es6_js_.Widget {
        /**
         * Widget constructor
         *
         * ### Notes
         * The widget will be disposed on click after calling the callback.
         *
         * @param maxNumberOutputs Maximal number of outputs to display
         * @param _onClick Callback on click event on the widget
         */
        constructor(maxNumberOutputs, onClick, translator) {
            const node = document.createElement('div');
            const trans = (translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator).load('jupyterlab');
            const button = document.createElement('button');
            button.type = 'button';
            button.className = 'jp-TrimmedOutputs-button';
            button.title = trans.__('The first %1 are displayed', maxNumberOutputs);
            button.textContent = trans.__('Show more outputs');
            node.appendChild(button);
            super({
                node
            });
            this._onClick = onClick;
            this.addClass('jp-TrimmedOutputs');
        }
        /**
         * Handle the DOM events for widget.
         *
         * @param event - The DOM event sent to the widget.
         *
         * #### Notes
         * This method implements the DOM `EventListener` interface and is
         * called in response to events on the widget's DOM node. It should
         * not be called directly by user code.
         */
        handleEvent(event) {
            if (event.type === 'click') {
                this._onClick(event);
            }
        }
        /**
         * Handle `after-attach` messages for the widget.
         */
        onAfterAttach(msg) {
            super.onAfterAttach(msg);
            this.node.addEventListener('click', this);
        }
        /**
         * A message handler invoked on a `'before-detach'`
         * message
         */
        onBeforeDetach(msg) {
            super.onBeforeDetach(msg);
            this.node.removeEventListener('click', this);
        }
    }
    Private.TrimmedOutputs = TrimmedOutputs;
})(widget_Private || (widget_Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/outputarea/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module outputarea
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 76941:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/outputarea/style/base.css
var base = __webpack_require__(5416);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/outputarea/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/outputarea/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 84058:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RenderedPDF: () => (/* binding */ RenderedPDF),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   rendererFactory: () => (/* binding */ rendererFactory)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61533);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_2__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module pdf-extension
 */



/**
 * The MIME type for PDF.
 */
const MIME_TYPE = 'application/pdf';
/**
 * A class for rendering a PDF document.
 */
class RenderedPDF extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.Widget {
    constructor() {
        super();
        this._base64 = '';
        this._disposable = null;
        this._ready = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        this.addClass('jp-PDFContainer');
        // We put the object in an iframe, which seems to have a better chance
        // of retaining its scroll position upon tab focusing, moving around etc.
        const iframe = document.createElement('iframe');
        // Sets iframe loading to lazy
        iframe.setAttribute('loading', 'lazy');
        this.node.appendChild(iframe);
        // The iframe content window is not available until the onload event.
        iframe.onload = () => {
            const body = iframe.contentWindow.document.createElement('body');
            body.style.margin = '0px';
            iframe.contentWindow.document.body = body;
            this._object = iframe.contentWindow.document.createElement('object');
            // work around for https://discussions.apple.com/thread/252247740
            // Detect if running on Desktop Safari
            if (!window.safari) {
                this._object.type = MIME_TYPE;
            }
            this._object.width = '100%';
            this._object.height = '100%';
            body.appendChild(this._object);
            this._ready.resolve(void 0);
        };
    }
    /**
     * Render PDF into this widget's node.
     */
    async renderModel(model) {
        await this._ready.promise;
        const data = model.data[MIME_TYPE];
        if (!data ||
            (data.length === this._base64.length && data === this._base64)) {
            // If there is no data, or if the string has not changed, we do not
            // need to re-parse the data and rerender. We do, however, check
            // for a fragment if the user wants to scroll the output.
            if (model.metadata.fragment && this._object.data) {
                const url = this._object.data;
                this._object.data = `${url.split('#')[0]}${model.metadata.fragment}`;
            }
            // For some opaque reason, Firefox seems to loose its scroll position
            // upon unhiding a PDF. But triggering a refresh of the URL makes it
            // find it again. No idea what the reason for this is.
            if (Private.IS_FIREFOX) {
                this._object.data = this._object.data; // eslint-disable-line
            }
            return Promise.resolve(void 0);
        }
        this._base64 = data;
        const blob = Private.b64toBlob(data, MIME_TYPE);
        // Release reference to any previous object url.
        if (this._disposable) {
            this._disposable.dispose();
        }
        let objectUrl = URL.createObjectURL(blob);
        if (model.metadata.fragment) {
            objectUrl += model.metadata.fragment;
        }
        this._object.data = objectUrl;
        // Set the disposable release the object URL.
        this._disposable = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_1__.DisposableDelegate(() => {
            try {
                URL.revokeObjectURL(objectUrl);
            }
            catch (error) {
                /* no-op */
            }
        });
        return;
    }
    /**
     * Handle a `before-hide` message.
     */
    onBeforeHide() {
        // Dispose of any URL fragment before hiding the widget
        // so that it is not remembered upon show. Only Firefox
        // seems to have a problem with this.
        if (Private.IS_FIREFOX) {
            this._object.data = this._object.data.split('#')[0];
        }
    }
    /**
     * Dispose of the resources held by the pdf widget.
     */
    dispose() {
        if (this._disposable) {
            this._disposable.dispose();
        }
        super.dispose();
    }
}
/**
 * A mime renderer factory for PDF data.
 */
const rendererFactory = {
    safe: false,
    mimeTypes: [MIME_TYPE],
    defaultRank: 100,
    createRenderer: options => new RenderedPDF()
};
const extensions = [
    {
        id: '@jupyterlab/pdf-extension:factory',
        description: 'Adds renderer for PDF content.',
        rendererFactory,
        dataType: 'string',
        documentWidgetFactoryOptions: {
            name: 'PDF',
            // TODO: translate label
            modelName: 'base64',
            primaryFileType: 'PDF',
            fileTypes: ['PDF'],
            defaultFor: ['PDF']
        }
    }
];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (extensions);
/**
 * A namespace for PDF widget private data.
 */
var Private;
(function (Private) {
    /**
     * A flag for determining whether the user is using Firefox.
     * There are some different PDF viewer behaviors on Firefox,
     * and we try to address them with this. User agent string parsing
     * is *not* reliable, so this should be considered a best-effort test.
     */
    Private.IS_FIREFOX = /Firefox/.test(navigator.userAgent);
    /**
     * Convert a base64 encoded string to a Blob object.
     * Modified from a snippet found here:
     * https://stackoverflow.com/questions/16245767/creating-a-blob-from-a-base64-string-in-javascript
     *
     * @param b64Data - The base64 encoded data.
     *
     * @param contentType - The mime type of the data.
     *
     * @param sliceSize - The size to chunk the data into for processing.
     *
     * @returns a Blob for the data.
     */
    function b64toBlob(b64Data, contentType = '', sliceSize = 512) {
        const byteCharacters = atob(b64Data);
        const byteArrays = [];
        for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
            const slice = byteCharacters.slice(offset, offset + sliceSize);
            const byteNumbers = new Array(slice.length);
            for (let i = 0; i < slice.length; i++) {
                byteNumbers[i] = slice.charCodeAt(i);
            }
            const byteArray = new Uint8Array(byteNumbers);
            byteArrays.push(byteArray);
        }
        return new Blob(byteArrays, { type: contentType });
    }
    Private.b64toBlob = b64toBlob;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 53927:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/pdf-extension/style/base.css
var base = __webpack_require__(83970);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pdf-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pdf-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 53187:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_pluginmanager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(72201);
/* harmony import */ var _jupyterlab_pluginmanager__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_pluginmanager__WEBPACK_IMPORTED_MODULE_4__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module pluginmanager-extension
 */





/**
 * The command IDs used by the pluginmanager plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.open = 'pluginmanager:open';
    CommandIDs.refreshPlugins = 'pluginmanager:refresh';
})(CommandIDs || (CommandIDs = {}));
const PLUGIN_ID = '@jupyterlab/pluginmanager-extension:plugin';
/**
 * A plugin for managing status of other plugins.
 */
const pluginmanager = {
    id: PLUGIN_ID,
    description: 'Enable or disable individual plugins.',
    autoStart: true,
    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab.IInfo],
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.ITranslator, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
    provides: _jupyterlab_pluginmanager__WEBPACK_IMPORTED_MODULE_4__.IPluginManager,
    activate: (app, appInfo, translator, palette, restorer) => {
        const { commands, shell } = app;
        translator = translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;
        const trans = translator.load('jupyterlab');
        // Translation strings.
        const category = trans.__('Plugin Manager');
        const widgetLabel = trans.__('Advanced Plugin Manager');
        const refreshPlugins = trans.__('Refresh Plugin List');
        const namespace = 'plugin-manager';
        const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
            namespace: namespace
        });
        /**
         * Create a MainAreaWidget for Plugin Manager.
         */
        function createWidget(args) {
            const model = new _jupyterlab_pluginmanager__WEBPACK_IMPORTED_MODULE_4__.PluginListModel({
                ...args,
                pluginData: {
                    availablePlugins: appInfo.availablePlugins
                },
                serverSettings: app.serviceManager.serverSettings,
                extraLockedPlugins: [
                    PLUGIN_ID,
                    // The app needs a service manager to function
                    '@jupyterlab/services-extension:service-manager',
                    // UI will not proceed beyond splash without `layout` plugin
                    '@jupyterlab/application-extension:layout',
                    // State restoration does not work well without resolver,
                    // can leave user locked out of the plugin manager
                    // (if command palette and menu are disabled too)
                    '@jupyterlab/apputils-extension:resolver'
                ],
                translator: translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator
            });
            const content = new _jupyterlab_pluginmanager__WEBPACK_IMPORTED_MODULE_4__.Plugins({
                model,
                translator: translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator
            });
            content.title.label = widgetLabel;
            content.title.icon = _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.extensionIcon;
            content.title.caption = trans.__('Plugin Manager');
            const main = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MainAreaWidget({ content, reveal: model.ready });
            main.toolbar.addItem('refresh-plugins', new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.CommandToolbarButton({
                id: CommandIDs.refreshPlugins,
                args: { noLabel: true },
                commands
            }));
            return main;
        }
        // Register commands.
        commands.addCommand(CommandIDs.open, {
            label: widgetLabel,
            execute: args => {
                const main = createWidget(args);
                shell.add(main, 'main', { type: 'Plugins' });
                // add to tracker so it can be restored, and update when choices change
                void tracker.add(main);
                main.content.model.trackerDataChanged.connect(() => {
                    void tracker.save(main);
                });
                return main;
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        query: {
                            type: 'string',
                            description: trans.__('The search query for plugins')
                        },
                        isDisclaimed: {
                            type: 'boolean',
                            description: trans.__('Whether the disclaimer has been accepted')
                        }
                    }
                }
            }
        });
        commands.addCommand(CommandIDs.refreshPlugins, {
            label: args => (args.noLabel ? '' : refreshPlugins),
            caption: trans.__('Refresh plugins list'),
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.refreshIcon,
            execute: async () => {
                var _a;
                return (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.model.refresh().catch((reason) => {
                    console.error(`Failed to refresh the available plugins list:\n${reason}`);
                });
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {
                        noLabel: {
                            type: 'boolean',
                            description: trans.__('Whether to hide the label')
                        }
                    }
                }
            }
        });
        if (palette) {
            palette.addItem({ command: CommandIDs.open, category });
        }
        if (restorer) {
            void restorer.restore(tracker, {
                command: CommandIDs.open,
                name: _ => 'plugins',
                args: widget => {
                    const { query, isDisclaimed } = widget.content.model;
                    const args = {
                        query,
                        isDisclaimed
                    };
                    return args;
                }
            });
        }
        return {
            open: () => {
                return app.commands.execute(CommandIDs.open);
            }
        };
    }
};
const plugins = [pluginmanager];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 67074:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_pluginmanager_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96850);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 69821:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  IPluginManager: () => (/* reexport */ IPluginManager),
  PluginListModel: () => (/* reexport */ PluginListModel),
  Plugins: () => (/* reexport */ Plugins)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pluginmanager/lib/dialogs.js

function PluginRequiredMessage(props) {
    return (react_index_js_.createElement(react_index_js_.Fragment, null,
        props.trans.__('The plugin "%1" cannot be disabled as it is required by other plugins:', props.plugin.id),
        react_index_js_.createElement("ul", null, props.dependants.map(plugin => (react_index_js_.createElement("li", { key: 'dependantsDialog-' + plugin.id }, plugin.id)))),
        props.trans.__('Please disable the dependent plugins first.')));
}
function PluginInUseMessage(props) {
    return (react_index_js_.createElement("div", { className: 'jp-pluginmanager-PluginInUseMessage' },
        props.trans.__('While the plugin "%1" is not required by other enabled plugins, some plugins provide optional features depending on it. These plugins are:', props.plugin.id),
        react_index_js_.createElement("ul", null, props.optionalDependants.map(plugin => (react_index_js_.createElement("li", { key: 'optionalDependantsDialog-' + plugin.id }, plugin.id)))),
        props.trans.__('Do you want to disable it anyway?')));
}
//# sourceMappingURL=dialogs.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pluginmanager/lib/model.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */








/**
 * The server API path for querying/modifying available plugins.
 */
const PLUGIN_API_PATH = 'lab/api/plugins';
/**
 * The model representing plugin list.
 */
class PluginListModel extends ui_components_lib_index_js_.VDomModel {
    constructor(options) {
        var _a, _b, _c;
        super();
        /**
         * Contains an error message if an error occurred when querying plugin status.
         */
        this.statusError = null;
        /**
         * Contains an error message if an error occurred when enabling/disabling plugin.
         */
        this.actionError = null;
        this._trackerDataChanged = new index_es6_js_.Signal(this);
        this._isLoading = false;
        this._pendingActions = [];
        this._ready = new dist_index_js_.PromiseDelegate();
        this._pluginData = options.pluginData;
        this._serverSettings =
            options.serverSettings || services_lib_index_js_.ServerConnection.makeSettings();
        this._query = options.query || '';
        this._isDisclaimed = (_a = options.isDisclaimed) !== null && _a !== void 0 ? _a : false;
        this._extraLockedPlugins = (_b = options.extraLockedPlugins) !== null && _b !== void 0 ? _b : [];
        this.refresh()
            .then(() => this._ready.resolve())
            .catch(e => this._ready.reject(e));
        this._trans = ((_c = options.translator) !== null && _c !== void 0 ? _c : translation_lib_index_js_.nullTranslator).load('jupyterlab');
    }
    get available() {
        return [...this._available.values()];
    }
    /**
     * Whether plugin data is still getting loaded.
     */
    get isLoading() {
        return this._isLoading;
    }
    /**
     * Whether the warning is disclaimed or not.
     */
    get isDisclaimed() {
        return this._isDisclaimed;
    }
    set isDisclaimed(v) {
        if (v !== this._isDisclaimed) {
            this._isDisclaimed = v;
            this.stateChanged.emit();
            this._trackerDataChanged.emit(void 0);
        }
    }
    /**
     * The search query.
     *
     * Setting its value triggers a new search.
     */
    get query() {
        return this._query;
    }
    set query(value) {
        if (this._query !== value) {
            this._query = value;
            this.stateChanged.emit();
            this._trackerDataChanged.emit(void 0);
        }
    }
    /**
     * A promise that resolves when the trackable data changes
     */
    get trackerDataChanged() {
        return this._trackerDataChanged;
    }
    /**
     * A promise that resolves when the plugins were fetched from the server
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Enable a plugin.
     *
     * @param entry An entry indicating which plugin to enable.
     */
    async enable(entry) {
        if (!this.isDisclaimed) {
            throw new Error('User has not confirmed the disclaimer');
        }
        await this._performAction('enable', entry);
        entry.enabled = true;
    }
    /**
     * Disable a plugin.
     *
     * @param entry An entry indicating which plugin to disable.
     * @returns Whether the plugin was disabled
     */
    async disable(entry) {
        if (!this.isDisclaimed) {
            throw new Error('User has not confirmed the disclaimer');
        }
        const { dependants, optionalDependants } = this.getDependants(entry);
        if (dependants.length > 0) {
            // We require user to disable plugins one-by-one as each of them may have
            // further dependencies (or optional dependencies) and we want the user to
            // take a pause to think about those.
            void (0,index_js_.showDialog)({
                title: this._trans.__('This plugin is required by other plugins'),
                body: PluginRequiredMessage({
                    plugin: entry,
                    dependants,
                    trans: this._trans
                }),
                buttons: [index_js_.Dialog.okButton()]
            });
            return;
        }
        if (optionalDependants.length > 0) {
            const userConfirmation = await (0,index_js_.showDialog)({
                title: this._trans.__('This plugin is used by other plugins'),
                body: PluginInUseMessage({
                    plugin: entry,
                    optionalDependants,
                    trans: this._trans
                }),
                buttons: [
                    index_js_.Dialog.okButton({ label: this._trans.__('Disable anyway') }),
                    index_js_.Dialog.cancelButton()
                ]
            });
            if (!userConfirmation.button.accept) {
                return;
            }
        }
        await this._performAction('disable', entry);
        if (this.actionError) {
            return;
        }
        entry.enabled = false;
    }
    getDependants(entry) {
        const dependants = [];
        const optionalDependants = [];
        if (entry.provides) {
            const tokenName = entry.provides.name;
            for (const plugin of this._available.values()) {
                if (!plugin.enabled) {
                    continue;
                }
                if (plugin.requires
                    .filter(token => !!token)
                    .some(token => token.name === tokenName)) {
                    dependants.push(plugin);
                }
                if (plugin.optional
                    .filter(token => !!token)
                    .some(token => token.name === tokenName)) {
                    optionalDependants.push(plugin);
                }
            }
        }
        return {
            dependants,
            optionalDependants
        };
    }
    /**
     * Whether there are currently any actions pending.
     */
    hasPendingActions() {
        return this._pendingActions.length > 0;
    }
    /**
     * Send a request to the server to perform an action on a plugin.
     *
     * @param action A valid action to perform.
     * @param entry The plugin to perform the action on.
     */
    _performAction(action, entry) {
        this.actionError = null;
        const actionRequest = this._requestAPI({}, {
            method: 'POST',
            body: JSON.stringify({
                cmd: action,
                plugin_name: entry.id
            })
        });
        actionRequest.catch(reason => {
            this.actionError = reason.toString();
        });
        this._addPendingAction(actionRequest);
        return actionRequest;
    }
    /**
     * Add a pending action.
     *
     * @param pending A promise that resolves when the action is completed.
     */
    _addPendingAction(pending) {
        // Add to pending actions collection
        this._pendingActions.push(pending);
        // Ensure action is removed when resolved
        const remove = () => {
            const i = this._pendingActions.indexOf(pending);
            this._pendingActions.splice(i, 1);
            this.stateChanged.emit(undefined);
        };
        pending.then(remove, remove);
        // Signal changed state
        this.stateChanged.emit(undefined);
    }
    /**
     * Refresh plugin lock statuses
     */
    async refresh() {
        var _a;
        this.statusError = null;
        this._isLoading = true;
        this.stateChanged.emit();
        try {
            // Get the lock status from backend; if backend is not available,
            // we assume that all plugins are locked.
            const fallback = {
                allLocked: true,
                lockRules: []
            };
            const status = (_a = (await this._requestAPI())) !== null && _a !== void 0 ? _a : fallback;
            this._available = new Map(this._pluginData.availablePlugins.map(plugin => {
                let tokenLabel = plugin.provides
                    ? plugin.provides.name.split(':')[1]
                    : undefined;
                if (plugin.provides && !tokenLabel) {
                    tokenLabel = plugin.provides.name;
                }
                return [
                    plugin.id,
                    {
                        ...plugin,
                        locked: this._isLocked(plugin.id, status),
                        tokenLabel
                    }
                ];
            }));
        }
        catch (reason) {
            this.statusError = reason.toString();
        }
        finally {
            this._isLoading = false;
            this.stateChanged.emit();
        }
    }
    _isLocked(pluginId, status) {
        if (status.allLocked) {
            // All plugins are locked.
            return true;
        }
        if (this._extraLockedPlugins.includes(pluginId)) {
            // Plugin is locked on client side.
            return true;
        }
        const extension = pluginId.split(':')[0];
        if (status.lockRules.includes(extension)) {
            // Entire extension is locked.
            return true;
        }
        if (status.lockRules.includes(pluginId)) {
            // This plugin specifically is locked.
            return true;
        }
        return false;
    }
    /**
     * Call the plugin API
     *
     * @param endPoint API REST end point for the plugin
     * @param init Initial values for the request
     * @returns The response body interpreted as JSON
     */
    async _requestAPI(queryArgs = {}, init = {}) {
        // Make request to Jupyter API
        const settings = this._serverSettings;
        const requestUrl = lib_index_js_.URLExt.join(settings.baseUrl, PLUGIN_API_PATH);
        let response;
        try {
            response = await services_lib_index_js_.ServerConnection.makeRequest(requestUrl + lib_index_js_.URLExt.objectToQueryString(queryArgs), init, settings);
        }
        catch (error) {
            throw new services_lib_index_js_.ServerConnection.NetworkError(error);
        }
        let data = await response.text();
        if (data.length > 0) {
            try {
                data = JSON.parse(data);
            }
            catch (error) {
                console.log('Not a JSON response body.', response);
            }
        }
        if (!response.ok) {
            throw new services_lib_index_js_.ServerConnection.ResponseError(response, data.message || data);
        }
        return data;
    }
}
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pluginmanager/lib/widget.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




/**
 * Panel with a table of available plugins allowing to enable/disable each.
 */
class Plugins extends dist_index_es6_js_.Panel {
    constructor(options) {
        const { model, translator } = options;
        super();
        this.model = model;
        this.addClass('jp-pluginmanager');
        this.trans = translator.load('jupyterlab');
        this.addWidget(new Disclaimer(model, this.trans));
        const header = new Header(model, this.trans);
        this.addWidget(header);
        const availableList = new AvailableList(model, this.trans);
        this.addWidget(availableList);
    }
}
class AvailableList extends index_js_.VDomRenderer {
    constructor(model, trans) {
        super(model);
        this.trans = trans;
        this.addClass('jp-pluginmanager-AvailableList');
    }
    render() {
        return (react_index_js_.createElement(react_index_js_.Fragment, null, this.model.statusError !== null ? (react_index_js_.createElement(ErrorMessage, null, this.trans.__('Error querying installed extensions%1', this.model.statusError ? `: ${this.model.statusError}` : '.'))) : this.model.isLoading ? (react_index_js_.createElement("div", { className: "jp-pluginmanager-loader" }, this.trans.__('Updating plugin list…'))) : (react_index_js_.createElement(ui_components_lib_index_js_.Table, { blankIndicator: () => {
                return react_index_js_.createElement("div", null, this.trans.__('No entries'));
            }, sortKey: 'plugin-id', rows: this.model.available
                .filter(pkg => {
                const pattern = new RegExp(this.model.query, 'i');
                return (pattern.test(pkg.id) ||
                    pattern.test(pkg.extension) ||
                    (pkg.tokenLabel && pattern.test(pkg.tokenLabel)));
            })
                .map(data => {
                return {
                    data: data,
                    key: data.id
                };
            }), columns: [
                {
                    id: 'plugin-id',
                    label: this.trans.__('Plugin'),
                    renderCell: (row) => (react_index_js_.createElement(react_index_js_.Fragment, null,
                        react_index_js_.createElement("code", null, row.id),
                        react_index_js_.createElement("br", null),
                        row.description)),
                    sort: (a, b) => a.id.localeCompare(b.id)
                },
                {
                    id: 'description',
                    label: this.trans.__('Description'),
                    renderCell: (row) => react_index_js_.createElement(react_index_js_.Fragment, null, row.description),
                    sort: (a, b) => a.description && b.description
                        ? a.description.localeCompare(b.description)
                        : undefined,
                    isHidden: true
                },
                {
                    id: 'autostart',
                    label: this.trans.__('Autostart?'),
                    renderCell: (row) => {
                        switch (row.autoStart) {
                            case 'defer':
                                return this.trans.__('Defer');
                            case true:
                                return this.trans.__('Yes');
                            case false:
                            case undefined: // The default is `false`.
                                return this.trans.__('No');
                            default:
                                const leftover = row.autoStart;
                                throw new Error(`Unknown value: ${leftover}`);
                        }
                    },
                    sort: (a, b) => a.autoStart === b.autoStart ? 0 : a.autoStart ? -1 : 1
                },
                {
                    id: 'requires',
                    label: this.trans.__('Depends on'),
                    renderCell: (row) => (react_index_js_.createElement(react_index_js_.Fragment, null, row.requires.map(v => v.name).join('\n'))),
                    sort: (a, b) => (a.requires || []).length - (b.requires || []).length,
                    isHidden: true
                },
                {
                    id: 'extension',
                    label: this.trans.__('Extension'),
                    renderCell: (row) => react_index_js_.createElement(react_index_js_.Fragment, null, row.extension),
                    sort: (a, b) => a.extension.localeCompare(b.extension)
                },
                {
                    id: 'provides',
                    label: this.trans.__('Provides'),
                    renderCell: (row) => (react_index_js_.createElement(react_index_js_.Fragment, null, row.provides ? (react_index_js_.createElement("code", { title: row.provides.name }, row.tokenLabel)) : ('-'))),
                    sort: (a, b) => (a.tokenLabel || '').localeCompare(b.tokenLabel || '')
                },
                {
                    id: 'enabled',
                    label: this.trans.__('Enabled'),
                    renderCell: (row) => (react_index_js_.createElement(react_index_js_.Fragment, null,
                        react_index_js_.createElement("input", { type: "checkbox", checked: row.enabled, disabled: row.locked || !this.model.isDisclaimed, title: row.locked || !this.model.isDisclaimed
                                ? row.locked
                                    ? this.trans.__('This plugin is locked.')
                                    : this.trans.__('To enable/disable, please acknowledge the disclaimer.')
                                : row.enabled
                                    ? this.trans.__('Disable %1 plugin', row.id)
                                    : this.trans.__('Enable %1 plugin', row.id), onChange: (event) => {
                                if (!this.model.isDisclaimed) {
                                    return;
                                }
                                if (event.target.checked) {
                                    void this.onAction('enable', row);
                                }
                                else {
                                    void this.onAction('disable', row);
                                }
                            } }),
                        row.locked ? (react_index_js_.createElement(ui_components_lib_index_js_.lockIcon.react, { tag: "span", title: this.trans.__('This plugin was locked by system administrator or is a critical dependency and cannot be enabled/disabled.') })) : (''))),
                    sort: (a, b) => +a.enabled - +b.enabled
                }
            ] }))));
    }
    /**
     * Callback handler for when the user wants to perform an action on an extension.
     *
     * @param action The action to perform.
     * @param entry The entry to perform the action on.
     */
    onAction(action, entry) {
        switch (action) {
            case 'enable':
                return this.model.enable(entry);
            case 'disable':
                return this.model.disable(entry);
            default:
                throw new Error(`Invalid action: ${action}`);
        }
    }
}
class Disclaimer extends index_js_.VDomRenderer {
    constructor(model, trans) {
        super(model);
        this.trans = trans;
        this.addClass('jp-pluginmanager-Disclaimer');
    }
    render() {
        return (react_index_js_.createElement("div", null,
            react_index_js_.createElement("div", null, this.trans.__('Customise your experience/improve performance by disabling plugins you do not need. To disable or uninstall an entire extension use the Extension Manager instead. Changes will apply after reloading JupyterLab.')),
            react_index_js_.createElement("label", null,
                react_index_js_.createElement("input", { type: "checkbox", className: "jp-mod-styled jp-pluginmanager-Disclaimer-checkbox", defaultChecked: this.model.isDisclaimed, onChange: event => {
                        this.model.isDisclaimed = event.target.checked;
                    } }),
                this.trans.__('I understand that disabling core application plugins may render features and parts of the user interface unavailable and recovery using `jupyter labextension enable <plugin-name>` command may be required'))));
    }
}
class Header extends index_js_.VDomRenderer {
    constructor(model, trans) {
        super(model);
        this.trans = trans;
        this.addClass('jp-pluginmanager-Header');
    }
    render() {
        return (react_index_js_.createElement(react_index_js_.Fragment, null,
            react_index_js_.createElement(ui_components_lib_index_js_.FilterBox, { placeholder: this.trans.__('Filter'), updateFilter: (fn, query) => {
                    this.model.query = query !== null && query !== void 0 ? query : '';
                }, initialQuery: this.model.query, useFuzzyFilter: false }),
            react_index_js_.createElement("div", { className: `jp-pluginmanager-pending ${this.model.hasPendingActions() ? 'jp-mod-hasPending' : ''}` }),
            this.model.actionError && (react_index_js_.createElement(ErrorMessage, null,
                react_index_js_.createElement("p", null, this.trans.__('Error when performing an action.')),
                react_index_js_.createElement("p", null, this.trans.__('Reason given:')),
                react_index_js_.createElement("pre", null, this.model.actionError)))));
    }
}
function ErrorMessage(props) {
    return react_index_js_.createElement("div", { className: "jp-pluginmanager-error" }, props.children);
}
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pluginmanager/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The plugin manager token.
 */
const IPluginManager = new dist_index_js_.Token('@jupyterlab/pluginmanager:IPluginManager', `A canary for plugin manager presence, with a method to open the plugin manager widget.`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pluginmanager/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module pluginmanager
 */



//# sourceMappingURL=index.js.map

/***/ }),

/***/ 96850:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/pluginmanager/style/base.css
var base = __webpack_require__(40141);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pluginmanager/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/pluginmanager/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








/***/ }),

/***/ 41198:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  IPropertyInspectorProvider: () => (/* reexport */ IPropertyInspectorProvider),
  SideBarPropertyInspectorProvider: () => (/* binding */ SideBarPropertyInspectorProvider)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/property-inspector/lib/token.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The property inspector provider token.
 */
const IPropertyInspectorProvider = new dist_index_js_.Token('@jupyterlab/property-inspector:IPropertyInspectorProvider', 'A service to register new widgets in the property inspector side panel.');
//# sourceMappingURL=token.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/property-inspector/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module property-inspector
 */






/**
 * The implementation of the PropertyInspector.
 */
class PropertyInspectorProvider extends dist_index_es6_js_.Widget {
    /**
     * Construct a new Property Inspector.
     */
    constructor() {
        super();
        this._tracker = new dist_index_es6_js_.FocusTracker();
        this._inspectors = new Map();
        this.addClass('jp-PropertyInspector');
        this._tracker = new dist_index_es6_js_.FocusTracker();
        this._tracker.currentChanged.connect(this._onCurrentChanged, this);
    }
    /**
     * Register a widget in the property inspector provider.
     *
     * @param widget The owner widget to register.
     */
    register(widget) {
        if (this._inspectors.has(widget)) {
            throw new Error('Widget is already registered');
        }
        const inspector = new Private.PropertyInspector(widget);
        widget.disposed.connect(this._onWidgetDisposed, this);
        this._inspectors.set(widget, inspector);
        inspector.onAction.connect(this._onInspectorAction, this);
        this._tracker.add(widget);
        return inspector;
    }
    /**
     * The current widget being tracked by the inspector.
     */
    get currentWidget() {
        return this._tracker.currentWidget;
    }
    /**
     * Refresh the content for the current widget.
     */
    refresh() {
        const current = this._tracker.currentWidget;
        if (!current) {
            this.setContent(null);
            return;
        }
        const inspector = this._inspectors.get(current);
        if (inspector) {
            this.setContent(inspector.content);
        }
    }
    /**
     * Handle the disposal of a widget.
     */
    _onWidgetDisposed(sender) {
        const inspector = this._inspectors.get(sender);
        if (inspector) {
            inspector.dispose();
            this._inspectors.delete(sender);
        }
    }
    /**
     * Handle inspector actions.
     */
    _onInspectorAction(sender, action) {
        const owner = sender.owner;
        const current = this._tracker.currentWidget;
        switch (action) {
            case 'content':
                if (current === owner) {
                    this.setContent(sender.content);
                }
                break;
            case 'dispose':
                if (owner) {
                    this._tracker.remove(owner);
                    this._inspectors.delete(owner);
                }
                break;
            case 'show-panel':
                if (current === owner) {
                    this.showPanel();
                }
                break;
            default:
                throw new Error('Unsupported inspector action');
        }
    }
    /**
     * Handle a change to the current widget in the tracker.
     */
    _onCurrentChanged() {
        const current = this._tracker.currentWidget;
        if (current) {
            const inspector = this._inspectors.get(current);
            const content = inspector.content;
            this.setContent(content);
        }
        else {
            this.setContent(null);
        }
    }
}
/**
 * A class that adds a property inspector provider to the
 * JupyterLab sidebar.
 */
class SideBarPropertyInspectorProvider extends PropertyInspectorProvider {
    /**
     * Construct a new Side Bar Property Inspector.
     */
    constructor({ shell, placeholder, translator }) {
        super();
        this._labshell = shell;
        this.translator = translator || index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        const layout = (this.layout = new dist_index_es6_js_.SingletonLayout());
        if (placeholder) {
            this._placeholder = placeholder;
        }
        else {
            const node = document.createElement('div');
            const content = document.createElement('div');
            const placeholderHeadline = document.createElement('h3');
            const placeholderText = document.createElement('p');
            placeholderHeadline.textContent = this._trans.__('No Properties');
            placeholderText.textContent = this._trans.__('The property inspector allows to view and edit properties of a selected notebook.');
            content.className = 'jp-PropertyInspector-placeholderContent';
            content.appendChild(placeholderHeadline);
            content.appendChild(placeholderText);
            node.appendChild(content);
            this._placeholder = new dist_index_es6_js_.Widget({ node });
            this._placeholder.addClass('jp-PropertyInspector-placeholder');
        }
        layout.widget = this._placeholder;
        this._labshell.currentChanged.connect(this._onShellCurrentChanged, this);
        this._onShellCurrentChanged();
    }
    /**
     * Set the content of the sidebar panel.
     */
    setContent(content) {
        const layout = this.layout;
        if (layout.widget) {
            layout.widget.removeClass('jp-PropertyInspector-content');
            layout.removeWidget(layout.widget);
        }
        if (!content) {
            content = this._placeholder;
        }
        content.addClass('jp-PropertyInspector-content');
        layout.widget = content;
    }
    /**
     * Show the sidebar panel.
     */
    showPanel() {
        this._labshell.activateById(this.id);
    }
    /**
     * Handle the case when the current widget is not in our tracker.
     */
    _onShellCurrentChanged() {
        const current = this.currentWidget;
        if (!current) {
            this.setContent(null);
            return;
        }
        const currentShell = this._labshell.currentWidget;
        if (currentShell === null || currentShell === void 0 ? void 0 : currentShell.node.contains(current.node)) {
            this.refresh();
        }
        else {
            this.setContent(null);
        }
    }
}
/**
 * A namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * An implementation of the property inspector used by the
     * property inspector provider.
     */
    class PropertyInspector {
        /**
         * Construct a new property inspector.
         */
        constructor(owner) {
            this._isDisposed = false;
            this._content = null;
            this._owner = null;
            this._onAction = new index_es6_js_.Signal(this);
            this._owner = owner;
        }
        /**
         * The owner widget for the property inspector.
         */
        get owner() {
            return this._owner;
        }
        /**
         * The current content for the property inspector.
         */
        get content() {
            return this._content;
        }
        /**
         * Whether the property inspector is disposed.
         */
        get isDisposed() {
            return this._isDisposed;
        }
        /**
         * A signal used for actions related to the property inspector.
         */
        get onAction() {
            return this._onAction;
        }
        /**
         * Show the property inspector panel.
         */
        showPanel() {
            if (this._isDisposed) {
                return;
            }
            this._onAction.emit('show-panel');
        }
        /**
         * Render the property inspector content.
         */
        render(widget) {
            if (this._isDisposed) {
                return;
            }
            if (widget instanceof dist_index_es6_js_.Widget) {
                this._content = widget;
            }
            else {
                this._content = lib_index_js_.ReactWidget.create(widget);
            }
            this._onAction.emit('content');
        }
        /**
         * Dispose of the property inspector.
         */
        dispose() {
            if (this._isDisposed) {
                return;
            }
            this._isDisposed = true;
            this._content = null;
            this._owner = null;
            index_es6_js_.Signal.clearData(this);
        }
    }
    Private.PropertyInspector = PropertyInspector;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 62374:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/property-inspector/style/base.css
var base = __webpack_require__(22794);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/property-inspector/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/property-inspector/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 75297:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module rendermime-interfaces
 */

//# sourceMappingURL=index.js.map

/***/ }),

/***/ 43967:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   g: () => (/* binding */ AttachmentModel)
/* harmony export */ });
/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52138);
/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_2__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/



/**
 * The default implementation of a notebook attachment model.
 */
class AttachmentModel {
    /**
     * Construct a new attachment model.
     */
    constructor(options) {
        // All attachments are untrusted
        this.trusted = false;
        this._changed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_2__.Signal(this);
        this._raw = {};
        const data = Private.getData(options.value);
        this._data = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0__.ObservableJSON({ values: data });
        this._rawData = data;
        // Make a copy of the data.
        const value = options.value;
        for (const key in value) {
            // Ignore data and metadata that were stripped.
            switch (key) {
                case 'data':
                    break;
                default:
                    this._raw[key] = Private.extract(value, key);
            }
        }
    }
    /**
     * A signal emitted when the attachment model changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Dispose of the resources used by the attachment model.
     */
    dispose() {
        this._data.dispose();
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_2__.Signal.clearData(this);
    }
    /**
     * The data associated with the model.
     */
    get data() {
        return this._rawData;
    }
    /**
     * The metadata associated with the model.
     */
    get metadata() {
        return {};
    }
    /**
     * Set the data associated with the model.
     *
     * #### Notes
     * Depending on the implementation of the mime model,
     * this call may or may not have deferred effects,
     */
    setData(options) {
        if (options.data) {
            this._updateObservable(this._data, options.data);
            this._rawData = options.data;
        }
        this._changed.emit(void 0);
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        const attachment = {};
        for (const key in this._raw) {
            attachment[key] = Private.extract(this._raw, key);
        }
        return attachment;
    }
    /**
     * Update an observable JSON object using a readonly JSON object.
     */
    _updateObservable(observable, data) {
        const oldKeys = observable.keys();
        const newKeys = Object.keys(data);
        // Handle removed keys.
        for (const key of oldKeys) {
            if (newKeys.indexOf(key) === -1) {
                observable.delete(key);
            }
        }
        // Handle changed data.
        for (const key of newKeys) {
            const oldValue = observable.get(key);
            const newValue = data[key];
            if (oldValue !== newValue) {
                observable.set(key, newValue);
            }
        }
    }
}
/**
 * The namespace for AttachmentModel statics.
 */
(function (AttachmentModel) {
    /**
     * Get the data for an attachment.
     *
     * @param bundle - A kernel attachment MIME bundle.
     *
     * @returns - The data for the payload.
     */
    function getData(bundle) {
        return Private.getData(bundle);
    }
    AttachmentModel.getData = getData;
})(AttachmentModel || (AttachmentModel = {}));
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * Get the data from a notebook attachment.
     */
    function getData(bundle) {
        return convertBundle(bundle);
    }
    Private.getData = getData;
    /**
     * Get the bundle options given attachment model options.
     */
    function getBundleOptions(options) {
        const data = getData(options.value);
        return { data };
    }
    Private.getBundleOptions = getBundleOptions;
    /**
     * Extract a value from a JSONObject.
     */
    function extract(value, key) {
        const item = value[key];
        if (item === undefined || _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.isPrimitive(item)) {
            return item;
        }
        return _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.deepCopy(item);
    }
    Private.extract = extract;
    /**
     * Convert a mime bundle to mime data.
     */
    function convertBundle(bundle) {
        const map = Object.create(null);
        for (const mimeType in bundle) {
            map[mimeType] = extract(bundle, mimeType);
        }
        return map;
    }
})(Private || (Private = {}));
//# sourceMappingURL=attachmentmodel.js.map

/***/ }),

/***/ 15862:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BJ: () => (/* binding */ textRendererFactory),
/* harmony export */   Dq: () => (/* binding */ errorRendererFactory),
/* harmony export */   F: () => (/* binding */ svgRendererFactory),
/* harmony export */   Lz: () => (/* binding */ imageRendererFactory),
/* harmony export */   Nf: () => (/* binding */ standardRendererFactories),
/* harmony export */   hJ: () => (/* binding */ latexRendererFactory),
/* harmony export */   nF: () => (/* binding */ javaScriptRendererFactory),
/* harmony export */   vy: () => (/* binding */ htmlRendererFactory),
/* harmony export */   xr: () => (/* binding */ markdownRendererFactory)
/* harmony export */ });
/* harmony import */ var _widgets__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28182);

/**
 * A mime renderer factory for raw html.
 */
const htmlRendererFactory = {
    safe: true,
    mimeTypes: ['text/html'],
    defaultRank: 50,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedHTML */ .oI(options)
};
/**
 * A mime renderer factory for images.
 */
const imageRendererFactory = {
    safe: true,
    mimeTypes: [
        'image/bmp',
        'image/png',
        'image/jpeg',
        'image/gif',
        'image/webp'
    ],
    defaultRank: 90,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedImage */ .UH(options)
};
/**
 * A mime renderer factory for LaTeX.
 */
const latexRendererFactory = {
    safe: true,
    mimeTypes: ['text/latex'],
    defaultRank: 70,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedLatex */ .FK(options)
};
/**
 * A mime renderer factory for Markdown.
 */
const markdownRendererFactory = {
    safe: true,
    mimeTypes: ['text/markdown'],
    defaultRank: 60,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedMarkdown */ .cw(options)
};
/**
 * A mime renderer factory for svg.
 */
const svgRendererFactory = {
    safe: false,
    mimeTypes: ['image/svg+xml'],
    defaultRank: 80,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedSVG */ .zt(options)
};
/**
 * A mime renderer factory for rendering stderr outputs
 */
const errorRendererFactory = {
    safe: true,
    mimeTypes: ['application/vnd.jupyter.stderr'],
    defaultRank: 110,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedError */ .Hw(options)
};
/**
 * A mime renderer factory for plain and jupyter console text data.
 */
const textRendererFactory = {
    safe: true,
    mimeTypes: ['text/plain', 'application/vnd.jupyter.stdout'],
    defaultRank: 120,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedText */ .lH(options)
};
/**
 * A placeholder factory for rendered JavaScript.
 */
const javaScriptRendererFactory = {
    safe: false,
    mimeTypes: ['text/javascript', 'application/javascript'],
    defaultRank: 110,
    createRenderer: options => new _widgets__WEBPACK_IMPORTED_MODULE_0__/* .RenderedJavaScript */ .ND(options)
};
/**
 * The standard factories provided by the rendermime package.
 */
const standardRendererFactories = [
    htmlRendererFactory,
    markdownRendererFactory,
    latexRendererFactory,
    svgRendererFactory,
    imageRendererFactory,
    javaScriptRendererFactory,
    errorRendererFactory,
    textRendererFactory
];
//# sourceMappingURL=factories.js.map

/***/ }),

/***/ 72401:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AttachmentModel: () => (/* reexport safe */ _attachmentmodel__WEBPACK_IMPORTED_MODULE_1__.g),
/* harmony export */   ILatexTypesetter: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_8__._y),
/* harmony export */   IMarkdownParser: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_8__.sc),
/* harmony export */   IRenderMimeRegistry: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_8__.ZD),
/* harmony export */   IUrlResolverFactory: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_8__.X5),
/* harmony export */   MimeModel: () => (/* reexport safe */ _mimemodel__WEBPACK_IMPORTED_MODULE_4__.a),
/* harmony export */   OutputModel: () => (/* reexport safe */ _outputmodel__WEBPACK_IMPORTED_MODULE_5__.M),
/* harmony export */   RenderMimeRegistry: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_6__.D),
/* harmony export */   RenderedCommon: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.pY),
/* harmony export */   RenderedError: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.Hw),
/* harmony export */   RenderedHTML: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.oI),
/* harmony export */   RenderedHTMLCommon: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.BP),
/* harmony export */   RenderedImage: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.UH),
/* harmony export */   RenderedJavaScript: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.ND),
/* harmony export */   RenderedLatex: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.FK),
/* harmony export */   RenderedMarkdown: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.cw),
/* harmony export */   RenderedSVG: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.zt),
/* harmony export */   RenderedText: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.lH),
/* harmony export */   errorRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.Dq),
/* harmony export */   hardenAnchorLinks: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.D2),
/* harmony export */   htmlRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.vy),
/* harmony export */   imageRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.Lz),
/* harmony export */   javaScriptRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.nF),
/* harmony export */   latexRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.hJ),
/* harmony export */   markdownRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.xr),
/* harmony export */   removeMath: () => (/* reexport safe */ _latex__WEBPACK_IMPORTED_MODULE_3__.D),
/* harmony export */   renderError: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.Op),
/* harmony export */   renderHTML: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.NN),
/* harmony export */   renderImage: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.co),
/* harmony export */   renderLatex: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.K3),
/* harmony export */   renderMarkdown: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.ap),
/* harmony export */   renderSVG: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.KB),
/* harmony export */   renderText: () => (/* reexport safe */ _renderers__WEBPACK_IMPORTED_MODULE_7__.IY),
/* harmony export */   replaceMath: () => (/* reexport safe */ _latex__WEBPACK_IMPORTED_MODULE_3__.b),
/* harmony export */   standardRendererFactories: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.Nf),
/* harmony export */   svgRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.F),
/* harmony export */   textRendererFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.BJ)
/* harmony export */ });
/* harmony import */ var _jupyterlab_rendermime_interfaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79858);
/* harmony import */ var _jupyterlab_rendermime_interfaces__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime_interfaces__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _jupyterlab_rendermime_interfaces__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _jupyterlab_rendermime_interfaces__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
/* harmony import */ var _attachmentmodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43967);
/* harmony import */ var _factories__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15862);
/* harmony import */ var _latex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69837);
/* harmony import */ var _mimemodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32021);
/* harmony import */ var _outputmodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4800);
/* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(32549);
/* harmony import */ var _renderers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3328);
/* harmony import */ var _tokens__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2186);
/* harmony import */ var _widgets__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28182);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module rendermime
 */










//# sourceMappingURL=index.js.map

/***/ }),

/***/ 69837:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D: () => (/* binding */ removeMath),
/* harmony export */   b: () => (/* binding */ replaceMath)
/* harmony export */ });
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
// Some magic for deferring mathematical expressions to MathJax
// by hiding them from the Markdown parser.
// Some of the code here is adapted with permission from Davide Cervone
// under the terms of the Apache2 license governing the MathJax project.
// Other minor modifications are also due to StackExchange and are used with
// permission.
const inline = '$'; // the inline math delimiter
// MATHSPLIT contains the pattern for math delimiters and special symbols
// needed for searching for math in the text input.
const MATHSPLIT = /(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;
/**
 *  Break up the text into its component parts and search
 *    through them for math delimiters, braces, linebreaks, etc.
 *  Math delimiters must match and braces must balance.
 *  Don't allow math to pass through a double linebreak
 *    (which will be a paragraph).
 */
function removeMath(text) {
    const math = []; // stores math strings for later
    let start = null;
    let end = null;
    let last = null;
    let braces = 0;
    let deTilde;
    // Except for extreme edge cases, this should catch precisely those pieces of the markdown
    // source that will later be turned into code spans. While MathJax will not TeXify code spans,
    // we still have to consider them at this point; the following issue has happened several times:
    //
    //     `$foo` and `$bar` are variables.  -->  <code>$foo ` and `$bar</code> are variables.
    const hasCodeSpans = text.includes('`') || text.includes('~~~');
    if (hasCodeSpans) {
        text = text
            .replace(/~/g, '~T')
            // note: the `fence` (three or more consecutive tildes or backticks)
            // can be followed by an `info string` but this cannot include backticks,
            // see specification: https://spec.commonmark.org/0.30/#info-string
            .replace(/^(?<fence>`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k<fence>`*$/gm, wholematch => wholematch.replace(/\$/g, '~D'))
            .replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm, wholematch => wholematch.replace(/\$/g, '~D'));
        deTilde = (text) => {
            return text.replace(/~([TD])/g, (wholematch, character) => character === 'T' ? '~' : inline);
        };
    }
    else {
        deTilde = (text) => {
            return text;
        };
    }
    let blocks = text.replace(/\r\n?/g, '\n').split(MATHSPLIT);
    for (let i = 1, m = blocks.length; i < m; i += 2) {
        const block = blocks[i];
        if (block.charAt(0) === '@') {
            //
            //  Things that look like our math markers will get
            //  stored and then retrieved along with the math.
            //
            blocks[i] = '@@' + math.length + '@@';
            math.push(block);
        }
        else if (start !== null) {
            //
            //  If we are in math, look for the end delimiter,
            //    but don't go past double line breaks, and
            //    and balance braces within the math.
            //
            if (block === end) {
                if (braces) {
                    last = i;
                }
                else {
                    blocks = processMath(start, i, deTilde, math, blocks);
                    start = null;
                    end = null;
                    last = null;
                }
            }
            else if (block.match(/\n.*\n/)) {
                if (last !== null) {
                    i = last;
                    blocks = processMath(start, i, deTilde, math, blocks);
                }
                start = null;
                end = null;
                last = null;
                braces = 0;
            }
            else if (block === '{') {
                braces++;
            }
            else if (block === '}' && braces) {
                braces--;
            }
        }
        else {
            //
            //  Look for math start delimiters and when
            //    found, set up the end delimiter.
            //
            if (block === inline || block === '$$') {
                start = i;
                end = block;
                braces = 0;
            }
            else if (block === '\\\\(' || block === '\\\\[') {
                start = i;
                end = block.slice(-1) === '(' ? '\\\\)' : '\\\\]';
                braces = 0;
            }
            else if (block.substr(1, 5) === 'begin') {
                start = i;
                end = '\\end' + block.substr(6);
                braces = 0;
            }
        }
    }
    if (start !== null && last !== null) {
        blocks = processMath(start, last, deTilde, math, blocks);
        start = null;
        end = null;
        last = null;
    }
    return { text: deTilde(blocks.join('')), math };
}
/**
 * Put back the math strings that were saved,
 * and clear the math array (no need to keep it around).
 */
function replaceMath(text, math) {
    /**
     * Replace a math placeholder with its corresponding group.
     * The math delimiters "\\(", "\\[", "\\)" and "\\]" are replaced
     * removing one backslash in order to be interpreted correctly by MathJax.
     */
    const process = (match, n) => {
        let group = math[n];
        if (group.substr(0, 3) === '\\\\(' &&
            group.substr(group.length - 3) === '\\\\)') {
            group = '\\(' + group.substring(3, group.length - 3) + '\\)';
        }
        else if (group.substr(0, 3) === '\\\\[' &&
            group.substr(group.length - 3) === '\\\\]') {
            group = '\\[' + group.substring(3, group.length - 3) + '\\]';
        }
        return group;
    };
    // Replace all the math group placeholders in the text
    // with the saved strings.
    return text.replace(/@@(\d+)@@/g, process);
}
/**
 * Process math blocks.
 *
 * The math is in blocks i through j, so
 *   collect it into one block and clear the others.
 *  Replace &, <, and > by named entities.
 *  For IE, put <br> at the ends of comments since IE removes \n.
 *  Clear the current math positions and store the index of the
 *   math, then push the math string onto the storage array.
 *  The preProcess function is called on all blocks if it has been passed in
 */
function processMath(i, j, preProcess, math, blocks) {
    let block = blocks
        .slice(i, j + 1)
        .join('')
        .replace(/&/g, '&amp;') // use HTML entity for &
        .replace(/</g, '&lt;') // use HTML entity for <
        .replace(/>/g, '&gt;'); // use HTML entity for >
    if (navigator && navigator.appName === 'Microsoft Internet Explorer') {
        block = block.replace(/(%[^\n]*)\n/g, '$1<br/>\n');
    }
    while (j > i) {
        blocks[j] = '';
        j--;
    }
    blocks[i] = '@@' + math.length + '@@'; // replace the current block text with a unique tag to find later
    if (preProcess) {
        block = preProcess(block);
    }
    math.push(block);
    return blocks;
}
//# sourceMappingURL=latex.js.map

/***/ }),

/***/ 32021:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   a: () => (/* binding */ MimeModel)
/* harmony export */ });
/**
 * The default mime model implementation.
 */
class MimeModel {
    /**
     * Construct a new mime model.
     */
    constructor(options = {}) {
        this.trusted = !!options.trusted;
        this._data = options.data || {};
        this._metadata = options.metadata || {};
        this._callback = options.callback || Private.noOp;
    }
    /**
     * The data associated with the model.
     */
    get data() {
        return this._data;
    }
    /**
     * The metadata associated with the model.
     */
    get metadata() {
        return this._metadata;
    }
    /**
     * Set the data associated with the model.
     *
     * #### Notes
     * Depending on the implementation of the mime model,
     * this call may or may not have deferred effects,
     */
    setData(options) {
        this._data = options.data || this._data;
        this._metadata = options.metadata || this._metadata;
        this._callback(options);
    }
}
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * A no-op callback function.
     */
    function noOp() {
        /* no-op */
    }
    Private.noOp = noOp;
})(Private || (Private = {}));
//# sourceMappingURL=mimemodel.js.map

/***/ }),

/***/ 4800:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ OutputModel)
/* harmony export */ });
/* harmony import */ var _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(74702);
/* harmony import */ var _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52138);
/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_3__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/




/**
 * The default implementation of a notebook output model.
 */
class OutputModel {
    /**
     * Construct a new output model.
     */
    constructor(options) {
        this._changed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal(this);
        this._raw = {};
        this._text = undefined;
        const { data, metadata, trusted } = Private.getBundleOptions(options);
        this._rawData = data;
        if (options.value !== undefined && _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isStream(options.value)) {
            this._text = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1__.ObservableString(typeof options.value.text === 'string'
                ? options.value.text
                : options.value.text.join(''));
        }
        this._metadata = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_1__.ObservableJSON({ values: metadata });
        this._rawMetadata = metadata;
        this.trusted = trusted;
        // Make a copy of the data.
        const value = options.value;
        for (const key in value) {
            // Ignore data and metadata that were stripped.
            switch (key) {
                case 'data':
                case 'metadata':
                    break;
                default:
                    this._raw[key] = Private.extract(value, key);
            }
        }
        this.type = value.output_type;
        if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isExecuteResult(value)) {
            this.executionCount = value.execution_count;
        }
        else {
            this.executionCount = null;
        }
    }
    /**
     * A signal emitted when the output model changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Dispose of the resources used by the output model.
     */
    dispose() {
        var _a;
        (_a = this._text) === null || _a === void 0 ? void 0 : _a.dispose();
        this._metadata.dispose();
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal.clearData(this);
    }
    /**
     * The data associated with the model.
     */
    get data() {
        return Private.getData(this.toJSON());
    }
    get streamText() {
        return this._text;
    }
    /**
     * The metadata associated with the model.
     */
    get metadata() {
        return this._rawMetadata;
    }
    /**
     * Set the data associated with the model.
     *
     * #### Notes
     * Depending on the implementation of the mime model,
     * this call may or may not have deferred effects,
     */
    setData(options) {
        if (options.data) {
            this._rawData = options.data;
        }
        if (options.metadata) {
            this._updateObservable(this._metadata, options.metadata);
            this._rawMetadata = options.metadata;
        }
        this._changed.emit();
    }
    /**
     * Serialize the model to JSON.
     */
    toJSON() {
        const output = {};
        for (const key in this._raw) {
            output[key] = Private.extract(this._raw, key);
        }
        if (this._text !== undefined) {
            output['text'] = this._text.text;
        }
        switch (this.type) {
            case 'display_data':
            case 'execute_result':
            case 'update_display_data':
                output['data'] = this._rawData;
                output['metadata'] = this.metadata;
                break;
            default:
                break;
        }
        // Remove transient data.
        delete output['transient'];
        return output;
    }
    /**
     * Update an observable JSON object using a readonly JSON object.
     */
    _updateObservable(observable, data) {
        const oldKeys = observable.keys();
        const newKeys = Object.keys(data);
        // Handle removed keys.
        for (const key of oldKeys) {
            if (newKeys.indexOf(key) === -1) {
                observable.delete(key);
            }
        }
        // Handle changed data.
        for (const key of newKeys) {
            const oldValue = observable.get(key);
            const newValue = data[key];
            if (oldValue !== newValue) {
                observable.set(key, newValue);
            }
        }
    }
}
/**
 * The namespace for OutputModel statics.
 */
(function (OutputModel) {
    /**
     * Get the data for an output.
     *
     * @param output - A kernel output message payload.
     *
     * @returns - The data for the payload.
     */
    function getData(output) {
        return Private.getData(output);
    }
    OutputModel.getData = getData;
    /**
     * Get the metadata from an output message.
     *
     * @param output - A kernel output message payload.
     *
     * @returns - The metadata for the payload.
     */
    function getMetadata(output) {
        return Private.getMetadata(output);
    }
    OutputModel.getMetadata = getMetadata;
})(OutputModel || (OutputModel = {}));
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * Get the data from a notebook output.
     */
    function getData(output) {
        let bundle = {};
        if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isExecuteResult(output) ||
            _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isDisplayData(output) ||
            _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isDisplayUpdate(output)) {
            bundle = output.data;
        }
        else if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isStream(output)) {
            if (output.name === 'stderr') {
                bundle['application/vnd.jupyter.stderr'] = output.text;
            }
            else {
                bundle['application/vnd.jupyter.stdout'] = output.text;
            }
        }
        else if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isError(output)) {
            bundle['application/vnd.jupyter.error'] = output;
            const traceback = output.traceback.join('\n');
            bundle['application/vnd.jupyter.stderr'] =
                traceback || `${output.ename}: ${output.evalue}`;
        }
        return convertBundle(bundle);
    }
    Private.getData = getData;
    /**
     * Get the metadata from an output message.
     */
    function getMetadata(output) {
        const value = Object.create(null);
        if (_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isExecuteResult(output) || _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_0__.isDisplayData(output)) {
            for (const key in output.metadata) {
                value[key] = extract(output.metadata, key);
            }
        }
        return value;
    }
    Private.getMetadata = getMetadata;
    /**
     * Get the bundle options given output model options.
     */
    function getBundleOptions(options) {
        const data = getData(options.value);
        const metadata = getMetadata(options.value);
        const trusted = !!options.trusted;
        return { data, metadata, trusted };
    }
    Private.getBundleOptions = getBundleOptions;
    /**
     * Extract a value from a JSONObject.
     */
    function extract(value, key) {
        const item = value[key];
        if (item === undefined || _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.JSONExt.isPrimitive(item)) {
            return item;
        }
        return JSON.parse(JSON.stringify(item));
    }
    Private.extract = extract;
    /**
     * Convert a mime bundle to mime data.
     */
    function convertBundle(bundle) {
        const map = Object.create(null);
        for (const mimeType in bundle) {
            map[mimeType] = extract(bundle, mimeType);
        }
        return map;
    }
})(Private || (Private = {}));
//# sourceMappingURL=outputmodel.js.map

/***/ }),

/***/ 32549:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D: () => (/* binding */ RenderMimeRegistry)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _mimemodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32021);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/




/**
 * An object which manages mime renderer factories.
 *
 * This object is used to render mime models using registered mime
 * renderers, selecting the preferred mime renderer to render the
 * model into a widget.
 *
 * #### Notes
 * This class is not intended to be subclassed.
 */
class RenderMimeRegistry {
    /**
     * Construct a new rendermime.
     *
     * @param options - The options for initializing the instance.
     */
    constructor(options = {}) {
        var _a, _b, _c, _d, _e, _f;
        this._id = 0;
        this._ranks = {};
        this._types = null;
        this._factories = {};
        // Parse the options.
        this.translator = (_a = options.translator) !== null && _a !== void 0 ? _a : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;
        this.resolver = (_b = options.resolver) !== null && _b !== void 0 ? _b : null;
        this.linkHandler = (_c = options.linkHandler) !== null && _c !== void 0 ? _c : null;
        this.latexTypesetter = (_d = options.latexTypesetter) !== null && _d !== void 0 ? _d : null;
        this.markdownParser = (_e = options.markdownParser) !== null && _e !== void 0 ? _e : null;
        this.sanitizer = (_f = options.sanitizer) !== null && _f !== void 0 ? _f : new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Sanitizer();
        // Add the initial factories.
        if (options.initialFactories) {
            for (const factory of options.initialFactories) {
                this.addFactory(factory);
            }
        }
    }
    /**
     * The ordered list of mimeTypes.
     */
    get mimeTypes() {
        return this._types || (this._types = Private.sortedTypes(this._ranks));
    }
    /**
     * Find the preferred mime type for a mime bundle.
     *
     * @param bundle - The bundle of mime data.
     *
     * @param safe - How to consider safe/unsafe factories. If 'ensure',
     *   it will only consider safe factories. If 'any', any factory will be
     *   considered. If 'prefer', unsafe factories will be considered, but
     *   only after the safe options have been exhausted.
     *
     * @returns The preferred mime type from the available factories,
     *   or `undefined` if the mime type cannot be rendered.
     */
    preferredMimeType(bundle, safe = 'ensure') {
        // Try to find a safe factory first, if preferred.
        if (safe === 'ensure' || safe === 'prefer') {
            for (const mt of this.mimeTypes) {
                if (mt in bundle && this._factories[mt].safe) {
                    return mt;
                }
            }
        }
        if (safe !== 'ensure') {
            // Otherwise, search for the best factory among all factories.
            for (const mt of this.mimeTypes) {
                if (mt in bundle) {
                    return mt;
                }
            }
        }
        // Otherwise, no matching mime type exists.
        return undefined;
    }
    /**
     * Create a renderer for a mime type.
     *
     * @param mimeType - The mime type of interest.
     *
     * @returns A new renderer for the given mime type.
     *
     * @throws An error if no factory exists for the mime type.
     */
    createRenderer(mimeType) {
        // Throw an error if no factory exists for the mime type.
        if (!(mimeType in this._factories)) {
            throw new Error(`No factory for mime type: '${mimeType}'`);
        }
        // Invoke the best factory for the given mime type.
        return this._factories[mimeType].createRenderer({
            mimeType,
            resolver: this.resolver,
            sanitizer: this.sanitizer,
            linkHandler: this.linkHandler,
            latexTypesetter: this.latexTypesetter,
            markdownParser: this.markdownParser,
            translator: this.translator
        });
    }
    /**
     * Create a new mime model.  This is a convenience method.
     *
     * @options - The options used to create the model.
     *
     * @returns A new mime model.
     */
    createModel(options = {}) {
        return new _mimemodel__WEBPACK_IMPORTED_MODULE_3__/* .MimeModel */ .a(options);
    }
    /**
     * Create a clone of this rendermime instance.
     *
     * @param options - The options for configuring the clone.
     *
     * @returns A new independent clone of the rendermime.
     */
    clone(options = {}) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
        // Create the clone.
        const clone = new RenderMimeRegistry({
            resolver: (_b = (_a = options.resolver) !== null && _a !== void 0 ? _a : this.resolver) !== null && _b !== void 0 ? _b : undefined,
            sanitizer: (_d = (_c = options.sanitizer) !== null && _c !== void 0 ? _c : this.sanitizer) !== null && _d !== void 0 ? _d : undefined,
            linkHandler: (_f = (_e = options.linkHandler) !== null && _e !== void 0 ? _e : this.linkHandler) !== null && _f !== void 0 ? _f : undefined,
            latexTypesetter: (_h = (_g = options.latexTypesetter) !== null && _g !== void 0 ? _g : this.latexTypesetter) !== null && _h !== void 0 ? _h : undefined,
            markdownParser: (_k = (_j = options.markdownParser) !== null && _j !== void 0 ? _j : this.markdownParser) !== null && _k !== void 0 ? _k : undefined,
            translator: this.translator
        });
        // Clone the internal state.
        clone._factories = { ...this._factories };
        clone._ranks = { ...this._ranks };
        clone._id = this._id;
        // Return the cloned object.
        return clone;
    }
    /**
     * Get the renderer factory registered for a mime type.
     *
     * @param mimeType - The mime type of interest.
     *
     * @returns The factory for the mime type, or `undefined`.
     */
    getFactory(mimeType) {
        return this._factories[mimeType];
    }
    /**
     * Add a renderer factory to the rendermime.
     *
     * @param factory - The renderer factory of interest.
     *
     * @param rank - The rank of the renderer. A lower rank indicates
     *   a higher priority for rendering. If not given, the rank will
     *   defer to the `defaultRank` of the factory.  If no `defaultRank`
     *   is given, it will default to 100.
     *
     * #### Notes
     * The renderer will replace an existing renderer for the given
     * mimeType.
     */
    addFactory(factory, rank) {
        if (rank === undefined) {
            rank = factory.defaultRank;
            if (rank === undefined) {
                rank = 100;
            }
        }
        for (const mt of factory.mimeTypes) {
            this._factories[mt] = factory;
            this._ranks[mt] = { rank, id: this._id++ };
        }
        this._types = null;
    }
    /**
     * Remove a mime type.
     *
     * @param mimeType - The mime type of interest.
     */
    removeMimeType(mimeType) {
        delete this._factories[mimeType];
        delete this._ranks[mimeType];
        this._types = null;
    }
    /**
     * Get the rank for a given mime type.
     *
     * @param mimeType - The mime type of interest.
     *
     * @returns The rank of the mime type or undefined.
     */
    getRank(mimeType) {
        const rank = this._ranks[mimeType];
        return rank && rank.rank;
    }
    /**
     * Set the rank of a given mime type.
     *
     * @param mimeType - The mime type of interest.
     *
     * @param rank - The new rank to assign.
     *
     * #### Notes
     * This is a no-op if the mime type is not registered.
     */
    setRank(mimeType, rank) {
        if (!this._ranks[mimeType]) {
            return;
        }
        const id = this._id++;
        this._ranks[mimeType] = { rank, id };
        this._types = null;
    }
}
/**
 * The namespace for `RenderMimeRegistry` class statics.
 */
(function (RenderMimeRegistry) {
    /**
     * A default resolver that uses a given reference path and a contents manager.
     */
    class UrlResolver {
        /**
         * Create a new url resolver.
         */
        constructor(options) {
            this._path = options.path;
            this._contents = options.contents;
        }
        /**
         * The path of the object, from which local urls can be derived.
         */
        get path() {
            return this._path;
        }
        set path(value) {
            this._path = value;
        }
        /**
         * Resolve a relative url to an absolute url path.
         */
        async resolveUrl(url) {
            if (this.isLocal(url)) {
                const cwd = encodeURI(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.dirname(this.path));
                url = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.resolve(cwd, url);
            }
            return url;
        }
        /**
         * Get the download url of a given absolute url path.
         *
         * #### Notes
         * The returned URL may include a query parameter.
         */
        async getDownloadUrl(urlPath) {
            if (this.isLocal(urlPath)) {
                // decode url->path before passing to contents api
                return this._contents.getDownloadUrl(decodeURIComponent(urlPath));
            }
            return urlPath;
        }
        /**
         * Whether the URL should be handled by the resolver
         * or not.
         *
         * @param allowRoot - Whether the paths starting at Unix-style filesystem root (`/`) are permitted.
         *
         * #### Notes
         * This is similar to the `isLocal` check in `URLExt`,
         * but it also checks whether the path points to any
         * of the `IDrive`s that may be registered with the contents
         * manager.
         */
        isLocal(url, allowRoot = false) {
            if (this.isMalformed(url)) {
                return false;
            }
            return (_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.URLExt.isLocal(url, allowRoot) ||
                !!this._contents.driveName(decodeURI(url)));
        }
        /**
         * Resolve a path from Jupyter kernel to a path:
         * - relative to `root_dir` (preferably) this is in jupyter-server scope,
         * - path understood and known by kernel (if such a path exists).
         * Returns `null` if there is no file matching provided path in neither
         * kernel nor jupyter-server contents manager.
         */
        async resolvePath(path) {
            // TODO: a clean implementation would be server-side and depends on:
            // https://github.com/jupyter-server/jupyter_server/issues/1280
            const rootDir = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PageConfig.getOption('rootUri').replace('file://', '');
            // Workaround: expand `~` path using root dir (if it matches).
            if (path.startsWith('~/') && rootDir.startsWith('/home/')) {
                // For now we assume that kernel is in root dir.
                path = rootDir.split('/').slice(0, 3).join('/') + path.substring(1);
            }
            if (path.startsWith(rootDir) || path.startsWith('./')) {
                try {
                    const relativePath = path.replace(rootDir, '');
                    // If file exists on the server we have guessed right
                    const response = await this._contents.get(relativePath, {
                        content: false
                    });
                    return {
                        path: response.path,
                        scope: 'server'
                    };
                }
                catch (error) {
                    // The file seems like should be on the server but is not.
                    console.warn(`Could not resolve location of ${path} on server`);
                    return null;
                }
            }
            // The file is not accessible from jupyter-server but maybe it is
            // available from DAP `source`; we assume the path is available
            // from kernel because currently we have no way of checking this
            // without introducing a cycle (unless we were to set the debugger
            // service instance on the resolver later).
            return {
                path: path,
                scope: 'kernel'
            };
        }
        /**
         * Whether the URL can be decoded using `decodeURI`.
         */
        isMalformed(url) {
            try {
                decodeURI(url);
                return false;
            }
            catch (error) {
                if (error instanceof URIError) {
                    return true;
                }
                throw error;
            }
        }
    }
    RenderMimeRegistry.UrlResolver = UrlResolver;
})(RenderMimeRegistry || (RenderMimeRegistry = {}));
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * Get the mime types in the map, ordered by rank.
     */
    function sortedTypes(map) {
        return Object.keys(map).sort((a, b) => {
            const p1 = map[a];
            const p2 = map[b];
            if (p1.rank !== p2.rank) {
                return p1.rank - p2.rank;
            }
            return p1.id - p2.id;
        });
    }
    Private.sortedTypes = sortedTypes;
})(Private || (Private = {}));
//# sourceMappingURL=registry.js.map

/***/ }),

/***/ 3328:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D2: () => (/* binding */ hardenAnchorLinks),
/* harmony export */   IY: () => (/* binding */ renderText),
/* harmony export */   K3: () => (/* binding */ renderLatex),
/* harmony export */   KB: () => (/* binding */ renderSVG),
/* harmony export */   NN: () => (/* binding */ renderHTML),
/* harmony export */   Op: () => (/* binding */ renderError),
/* harmony export */   ap: () => (/* binding */ renderMarkdown),
/* harmony export */   co: () => (/* binding */ renderImage)
/* harmony export */ });
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var lodash_escape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8872);
/* harmony import */ var lodash_escape__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_escape__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _latex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69837);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/




/**
 * Render HTML into a host node.
 *
 * @param options - The options for rendering.
 *
 * @returns A promise which resolves when rendering is complete.
 */
async function renderHTML(options) {
    // Unpack the options.
    let { host, source, trusted, sanitizer, resolver, linkHandler, shouldTypeset, latexTypesetter, translator } = options;
    translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator;
    const trans = translator === null || translator === void 0 ? void 0 : translator.load('jupyterlab');
    let originalSource = source;
    // Bail early if the source is empty.
    if (!source) {
        host.textContent = '';
        return;
    }
    // Sanitize the source if it is not trusted. This removes all
    // `<script>` tags as well as other potentially harmful HTML.
    if (!trusted) {
        originalSource = `${source}`;
        source = sanitizer.sanitize(source);
    }
    // Set the inner HTML of the host.
    host.innerHTML = source;
    if (host.getElementsByTagName('script').length > 0) {
        // If output it trusted, eval any script tags contained in the HTML.
        // This is not done automatically by the browser when script tags are
        // created by setting `innerHTML`.
        if (trusted) {
            Private.evalInnerHTMLScriptTags(host);
        }
        else {
            const container = document.createElement('div');
            const warning = document.createElement('pre');
            warning.textContent = trans.__('This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?');
            const runButton = document.createElement('button');
            runButton.textContent = trans.__('Run');
            runButton.onclick = event => {
                host.innerHTML = originalSource;
                Private.evalInnerHTMLScriptTags(host);
                if (host.firstChild) {
                    host.removeChild(host.firstChild);
                }
            };
            container.appendChild(warning);
            container.appendChild(runButton);
            host.insertBefore(container, host.firstChild);
        }
    }
    // Handle default behavior of nodes.
    Private.handleDefaults(host);
    if (shouldTypeset && latexTypesetter) {
        const maybePromise = latexTypesetter.typeset(host);
        if (maybePromise instanceof Promise) {
            // Harden anchors to contain secure target/rel attributes.
            maybePromise
                .then(() => hardenAnchorLinks(host, resolver))
                .catch(console.warn);
        }
        else {
            hardenAnchorLinks(host, resolver);
        }
    }
    else {
        hardenAnchorLinks(host, resolver);
    }
    // Patch the urls if a resolver is available.
    if (resolver) {
        await Private.handleUrls(host, resolver, linkHandler);
    }
}
/**
 * Render an image into a host node.
 *
 * @param options - The options for rendering.
 *
 * @returns A promise which resolves when rendering is complete.
 */
async function renderImage(options) {
    // Unpack the options.
    const { host, mimeType, source, width, height, needsBackground, unconfined } = options;
    // Clear the content in the host.
    host.textContent = '';
    // Create the image element.
    const img = document.createElement('img');
    // Set the source of the image.
    img.src = `data:${mimeType};base64,${source}`;
    // Set the size of the image if provided.
    if (typeof height === 'number') {
        img.height = height;
    }
    if (typeof width === 'number') {
        img.width = width;
    }
    if (needsBackground === 'light') {
        img.classList.add('jp-needs-light-background');
    }
    else if (needsBackground === 'dark') {
        img.classList.add('jp-needs-dark-background');
    }
    if (unconfined === true) {
        img.classList.add('jp-mod-unconfined');
    }
    // Add the image to the host.
    host.appendChild(img);
}
/**
 * Render LaTeX into a host node.
 *
 * @param options - The options for rendering.
 *
 * @returns A promise which resolves when rendering is complete.
 */
async function renderLatex(options) {
    // Unpack the options.
    const { host, source, shouldTypeset, latexTypesetter, resolver } = options;
    // Set the source on the node.
    host.textContent = source;
    // Typeset the node if needed.
    if (shouldTypeset && latexTypesetter) {
        const maybePromise = latexTypesetter.typeset(host);
        if (maybePromise instanceof Promise) {
            // Harden anchors to contain secure target/rel attributes.
            maybePromise
                .then(() => hardenAnchorLinks(host, resolver))
                .catch(console.warn);
        }
        else {
            hardenAnchorLinks(host, resolver);
        }
    }
}
/**
 * Render Markdown into a host node.
 *
 * @param options - The options for rendering.
 *
 * @returns A promise which resolves when rendering is complete.
 */
async function renderMarkdown(options) {
    var _a;
    // Unpack the options.
    const { host, source, markdownParser, ...others } = options;
    // Clear the content if there is no source.
    if (!source) {
        host.textContent = '';
        return;
    }
    let html = '';
    if (markdownParser) {
        // Separate math from normal markdown text.
        const parts = (0,_latex__WEBPACK_IMPORTED_MODULE_3__/* .removeMath */ .D)(source);
        // Convert the markdown to HTML.
        html = await markdownParser.render(parts['text']);
        // Replace math.
        html = (0,_latex__WEBPACK_IMPORTED_MODULE_3__/* .replaceMath */ .b)(html, parts['math']);
    }
    else {
        // Fallback if the application does not have any markdown parser.
        html = `<pre>${source}</pre>`;
    }
    // Render HTML.
    await renderHTML({
        host,
        source: html,
        ...others
    });
    // Apply ids to the header nodes.
    Private.headerAnchors(host, (_a = options.sanitizer.allowNamedProperties) !== null && _a !== void 0 ? _a : false);
}
/**
 * The namespace for the `renderMarkdown` function statics.
 */
(function (renderMarkdown) {
    /**
     * Create a normalized id for a header element.
     *
     * @param header Header element
     * @returns Normalized id
     */
    function createHeaderId(header) {
        var _a;
        return ((_a = header.textContent) !== null && _a !== void 0 ? _a : '').replace(/ /g, '-');
    }
    renderMarkdown.createHeaderId = createHeaderId;
})(renderMarkdown || (renderMarkdown = {}));
/**
 * Render SVG into a host node.
 *
 * @param options - The options for rendering.
 *
 * @returns A promise which resolves when rendering is complete.
 */
async function renderSVG(options) {
    // Unpack the options.
    let { host, source, trusted, unconfined } = options;
    // Clear the content if there is no source.
    if (!source) {
        host.textContent = '';
        return;
    }
    // Display a message if the source is not trusted.
    if (!trusted) {
        host.textContent =
            'Cannot display an untrusted SVG. Maybe you need to run the cell?';
        return;
    }
    // Add missing SVG namespace (if actually missing)
    const patt = '<svg[^>]+xmlns=[^>]+svg';
    if (source.search(patt) < 0) {
        source = source.replace('<svg', '<svg xmlns="http://www.w3.org/2000/svg"');
    }
    // Render in img so that user can save it easily
    const img = new Image();
    img.src = `data:image/svg+xml,${encodeURIComponent(source)}`;
    host.appendChild(img);
    if (unconfined === true) {
        host.classList.add('jp-mod-unconfined');
    }
}
var ILinker;
(function (ILinker) {
    // Matching regular expressions is slow; we can fast-reject
    // a string if it does not start with `data:`, `www.`, or
    // a valid schema. We define a valid schema as an alphanumeric
    // sequence of length at least two and followed by `://`,
    // e.g.`https://`. To fast-reject in long sequence of characters
    // we need to impose an additional restriction on the length.
    // As of 2025 the longest registered URI schemes are:
    // - machineProvisioningProgressReporter - 35
    // - microsoft.windows.camera.multipicker - 36
    // See https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
    // While technically any length is allowed, it is unlikely that any scheme
    // longer than 40 characters would be of a general benefit to most users,
    // and if one finds themselves with a use case which requires it, they are
    // welcome to open a PR which allows to customize this restriction.
    const maxAcceptedProtocolLength = 40;
    // Taken from Visual Studio Code:
    // https://github.com/microsoft/vscode/blob/9f709d170b06e991502153f281ec3c012add2e42/src/vs/workbench/contrib/debug/browser/linkDetector.ts#L17-L18
    const controlCodes = '\\u0000-\\u0020\\u007f-\\u009f';
    ILinker.webLinkRegex = new RegExp('(?<path>(?:[a-zA-Z][a-zA-Z0-9+.-]{2,' +
        maxAcceptedProtocolLength +
        '}:\\/\\/|data:|www\\.)[^\\s' +
        controlCodes +
        '"]{2,}[^\\s' +
        controlCodes +
        '"\'(){}\\[\\],:;.!?])', 'ug');
    // Taken from Visual Studio Code:
    // https://github.com/microsoft/vscode/blob/3e407526a1e2ff22cacb69c7e353e81a12f41029/extensions/notebook-renderers/src/linkify.ts#L9
    const winAbsPathRegex = /(?:[a-zA-Z]:(?:(?:\\|\/)[\w\.-]*)+)/;
    const winRelPathRegex = /(?:(?:\~|\.)(?:(?:\\|\/)[\w\.-]*)+)/;
    const winPathRegex = new RegExp(`(${winAbsPathRegex.source}|${winRelPathRegex.source})`);
    const posixPathRegex = /((?:\~|\.)?(?:\/[\w\.-]*)+)/;
    const lineColumnRegex = /(?:(?:\:|", line )(?<line>[\d]+))?(?:\:(?<column>[\d]+))?/;
    // TODO: this ought to come from kernel (browser may be on a different OS).
    const isWindows = navigator.userAgent.indexOf('Windows') >= 0;
    ILinker.pathLinkRegex = new RegExp(`(?<path>${isWindows ? winPathRegex.source : posixPathRegex.source})${lineColumnRegex.source}`, 'g');
})(ILinker || (ILinker = {}));
/**
 * Linker for web URLs.
 */
class WebLinker {
    constructor() {
        this.regex = ILinker.webLinkRegex;
    }
    createAnchor(url, label) {
        const anchor = document.createElement('a');
        anchor.href = url.startsWith('www.') ? 'https://' + url : url;
        anchor.rel = 'noopener';
        anchor.target = '_blank';
        anchor.appendChild(document.createTextNode(label));
        return anchor;
    }
    processPath(url) {
        // Special case when the URL ends with ">" or "<"
        const lastChars = url.slice(-1);
        const endsWithGtLt = ['>', '<'].indexOf(lastChars) !== -1;
        const len = endsWithGtLt ? url.length - 1 : url.length;
        url = url.slice(0, len);
        return url;
    }
    processLabel(url) {
        return this.processPath(url);
    }
}
/**
 * Linker for path URIs.
 */
class PathLinker {
    constructor() {
        this.regex = ILinker.pathLinkRegex;
    }
    createAnchor(path, label, locators) {
        const anchor = document.createElement('a');
        // Store the path in dataset.
        // Do not set `href` - at this point we do not know if the path is valid and
        // accessible for application (and we want rendering those as links).
        anchor.dataset.path = path;
        // Store line using RFC 5147 fragment locator for text/plain files.
        // It could be expanded to other formats, e.g. based on file extension.
        const line = parseInt(locators['line'], 10);
        let locator = !isNaN(line) ? `line=${line - 1}` : '';
        anchor.dataset.locator = locator;
        anchor.appendChild(document.createTextNode(label));
        return anchor;
    }
}
function autolink(content, options) {
    const linkers = [];
    if (options.checkWeb) {
        linkers.push(new WebLinker());
    }
    if (options.checkPaths) {
        linkers.push(new PathLinker());
    }
    const nodes = [];
    // There are two ways to implement competitive regexes:
    // - two heads (which would need to resolve overlaps), or
    // - (simpler) divide and recurse (implemented below)
    const linkify = (content, regexIndex) => {
        if (regexIndex >= linkers.length) {
            nodes.push(document.createTextNode(content));
            return;
        }
        const linker = linkers[regexIndex];
        let match;
        let currentIndex = 0;
        const regex = linker.regex;
        // Reset regex
        regex.lastIndex = 0;
        while (null != (match = regex.exec(content))) {
            const stringBeforeMatch = content.substring(currentIndex, match.index);
            if (stringBeforeMatch) {
                linkify(stringBeforeMatch, regexIndex + 1);
            }
            const { path, ...locators } = match.groups;
            const value = linker.processPath ? linker.processPath(path) : path;
            const label = linker.processLabel
                ? linker.processLabel(match[0])
                : match[0];
            nodes.push(linker.createAnchor(value, label, locators));
            currentIndex = match.index + label.length;
        }
        const stringAfterMatches = content.substring(currentIndex);
        if (stringAfterMatches) {
            linkify(stringAfterMatches, regexIndex + 1);
        }
    };
    linkify(content, 0);
    return nodes;
}
/**
 * Split a shallow node (node without nested nodes inside) at a given text content position.
 *
 * @param node the shallow node to be split
 * @param at the position in textContent at which the split should occur
 */
function splitShallowNode(node, at) {
    var _a, _b;
    const pre = node.cloneNode();
    pre.textContent = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.slice(0, at);
    const post = node.cloneNode();
    post.textContent = (_b = node.textContent) === null || _b === void 0 ? void 0 : _b.slice(at);
    return {
        pre,
        post
    };
}
/**
 * Iterate over some nodes, while tracking cumulative start and end position.
 */
function* nodeIter(nodes) {
    var _a;
    let start = 0;
    let end;
    for (let node of nodes) {
        end = start + (((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) || 0);
        yield {
            node,
            start,
            end,
            isText: node.nodeType === Node.TEXT_NODE
        };
        start = end;
    }
}
/**
 * Align two collections of nodes.
 *
 * If a text node in one collections spans an element in the other, yield the spanned elements.
 * Otherwise, split the nodes such that yielded pair start and stop on the same position.
 */
function* alignedNodes(a, b) {
    var _a, _b;
    let iterA = nodeIter(a);
    let iterB = nodeIter(b);
    let nA = iterA.next();
    let nB = iterB.next();
    while (!nA.done && !nB.done) {
        let A = nA.value;
        let B = nB.value;
        if (A.isText && A.start <= B.start && A.end >= B.end) {
            // A is a text element that spans all of B, simply yield B
            yield [null, B.node];
            nB = iterB.next();
        }
        else if (B.isText && B.start <= A.start && B.end >= A.end) {
            // B is a text element that spans all of A, simply yield A
            yield [A.node, null];
            nA = iterA.next();
        }
        else {
            // There is some intersection, split one, unless they match exactly
            if (A.end === B.end && A.start === B.start) {
                yield [A.node, B.node];
                nA = iterA.next();
                nB = iterB.next();
            }
            else if (A.end > B.end) {
                /*
                A |-----[======]---|
                B |--[======]------|
                            | <- Split A here
                        | <- trim B to start from here if needed
                */
                let { pre, post } = splitShallowNode(A.node, B.end - A.start);
                if (B.start < A.start) {
                    // this node should not be yielded anywhere else, so ok to modify in-place
                    B.node.textContent = (_a = B.node.textContent) === null || _a === void 0 ? void 0 : _a.slice(A.start - B.start);
                }
                yield [pre, B.node];
                // Modify iteration result in-place:
                A.node = post;
                A.start = B.end;
                nB = iterB.next();
            }
            else if (B.end > A.end) {
                let { pre, post } = splitShallowNode(B.node, A.end - B.start);
                if (A.start < B.start) {
                    // this node should not be yielded anywhere else, so ok to modify in-place
                    A.node.textContent = (_b = A.node.textContent) === null || _b === void 0 ? void 0 : _b.slice(B.start - A.start);
                }
                yield [A.node, pre];
                // Modify iteration result in-place:
                B.node = post;
                B.start = A.end;
                nA = iterA.next();
            }
            else {
                throw new Error(`Unexpected intersection: ${JSON.stringify(A)} ${JSON.stringify(B)}`);
            }
        }
    }
}
/**
 * Render text into a host node.
 *
 * @param options - The options for rendering.
 *
 * @returns A promise which resolves when rendering is complete.
 */
async function renderText(options) {
    renderTextual(options, {
        checkWeb: true,
        checkPaths: false
    });
}
/**
 * Sanitize HTML out using native browser sanitizer.
 *
 * Compared to the `ISanitizer.sanitize` this does not allow to selectively
 * allow to keep certain tags but escapes everything; on the other hand
 * it is much faster as it uses platform-optimized code.
 */
function nativeSanitize(source) {
    const el = document.createElement('span');
    el.textContent = source;
    return el.innerHTML;
}
const ansiPrefix = '\x1b';
/**
 * Render the textual representation into a host node.
 *
 * Implements the shared logic for `renderText` and `renderError`.
 */
function renderTextual(options, autoLinkOptions) {
    var _a, _b;
    // Unpack the options.
    const { host, sanitizer, source } = options;
    const hasAnsiPrefix = source.includes(ansiPrefix);
    // Create the HTML content:
    // If no ANSI codes are present use a fast path for escaping.
    const content = hasAnsiPrefix
        ? sanitizer.sanitize(Private.ansiSpan(source), {
            allowedTags: ['span']
        })
        : nativeSanitize(source);
    // Set the sanitized content for the host node.
    const pre = document.createElement('pre');
    pre.innerHTML = content;
    const preTextContent = pre.textContent;
    const cacheStoreOptions = [];
    if (autoLinkOptions.checkWeb) {
        cacheStoreOptions.push('web');
    }
    if (autoLinkOptions.checkPaths) {
        cacheStoreOptions.push('paths');
    }
    const cacheStoreKey = cacheStoreOptions.join('-');
    let cacheStore = Private.autoLinkCache.get(cacheStoreKey);
    if (!cacheStore) {
        cacheStore = new WeakMap();
        Private.autoLinkCache.set(cacheStoreKey, cacheStore);
    }
    let ret;
    if (preTextContent) {
        // Note: only text nodes and span elements should be present after sanitization in the `<pre>` element.
        let linkedNodes;
        if ((_b = (_a = sanitizer.getAutolink) === null || _a === void 0 ? void 0 : _a.call(sanitizer)) !== null && _b !== void 0 ? _b : true) {
            const cache = getApplicableLinkCache(cacheStore.get(host), preTextContent);
            if (cache) {
                const { cachedNodes: fromCache, addedText } = cache;
                const newAdditions = autolink(addedText, autoLinkOptions);
                const lastInCache = fromCache[fromCache.length - 1];
                const firstNewNode = newAdditions[0];
                if (lastInCache instanceof Text && firstNewNode instanceof Text) {
                    const joiningNode = lastInCache;
                    joiningNode.data += firstNewNode.data;
                    linkedNodes = [
                        ...fromCache.slice(0, -1),
                        joiningNode,
                        ...newAdditions.slice(1)
                    ];
                }
                else {
                    linkedNodes = [...fromCache, ...newAdditions];
                }
            }
            else {
                linkedNodes = autolink(preTextContent, autoLinkOptions);
            }
            cacheStore.set(host, {
                preTextContent,
                // Clone the nodes before storing them in the cache in case if another component
                // attempts to modify (e.g. dispose of) them - which is the case for search highlights!
                linkedNodes: linkedNodes.map(node => node.cloneNode(true))
            });
        }
        else {
            linkedNodes = [document.createTextNode(content)];
        }
        const preNodes = Array.from(pre.childNodes);
        ret = mergeNodes(preNodes, linkedNodes);
    }
    else {
        ret = document.createElement('pre');
    }
    host.appendChild(ret);
}
/**
 * Return the information from the cache that can be used given the cache entry and current text.
 * If the cache is invalid given the current text (or cannot be used) `null` is returned.
 */
function getApplicableLinkCache(cachedResult, preTextContent) {
    if (!cachedResult) {
        return null;
    }
    if (preTextContent.length < cachedResult.preTextContent.length) {
        // If the new content is shorter than the cached content
        // we cannot use the cache as we only support appending.
        return null;
    }
    let addedText = preTextContent.substring(cachedResult.preTextContent.length);
    let cachedNodes = cachedResult.linkedNodes;
    const lastCachedNode = cachedResult.linkedNodes[cachedResult.linkedNodes.length - 1];
    // Only use cached nodes if:
    // - the last cached node is a text node
    // - the new content starts with a new line
    // - the old content ends with a new line
    if (cachedResult.preTextContent.endsWith('\n') ||
        addedText.startsWith('\n')) {
        // Second or third condition is met, we can use the cached nodes
        // (this is a no-op, we just continue execution).
    }
    else if (lastCachedNode instanceof Text) {
        // The first condition is met, we can use the cached nodes,
        // but first we remove the Text node to re-analyse its text.
        // This is required when we cached `aaa www.one.com bbb www.`
        // and the incoming addition is `two.com`. We can still
        // use text node `aaa ` and anchor node `www.one.com`, but
        // we need to pass `bbb www.` + `two.com` through linkify again.
        cachedNodes = cachedNodes.slice(0, -1);
        addedText = lastCachedNode.textContent + addedText;
    }
    else {
        return null;
    }
    // Finally check if text has not changed.
    if (!preTextContent.startsWith(cachedResult.preTextContent)) {
        return null;
    }
    return {
        cachedNodes,
        addedText
    };
}
/**
 * Render error into a host node.
 *
 * @param options - The options for rendering.
 *
 * @returns A promise which resolves when rendering is complete.
 */
async function renderError(options) {
    // Unpack the options.
    const { host, linkHandler, resolver } = options;
    renderTextual(options, {
        checkWeb: true,
        checkPaths: true
    });
    // Patch the paths if a resolver is available.
    if (resolver) {
        await Private.handlePaths(host, resolver, linkHandler);
    }
}
/**
 * Merge `<span>` nodes from a `<pre>` element with `<a>` nodes from linker.
 */
function mergeNodes(preNodes, linkedNodes) {
    const ret = document.createElement('pre');
    let inAnchorElement = false;
    const combinedNodes = [];
    for (let nodes of alignedNodes(preNodes, linkedNodes)) {
        if (!nodes[0]) {
            combinedNodes.push(nodes[1]);
            inAnchorElement = nodes[1].nodeType !== Node.TEXT_NODE;
            continue;
        }
        else if (!nodes[1]) {
            combinedNodes.push(nodes[0]);
            inAnchorElement = false;
            continue;
        }
        let [preNode, linkNode] = nodes;
        const lastCombined = combinedNodes[combinedNodes.length - 1];
        // If we are already in an anchor element and the anchor element did not change,
        // we should insert the node from <pre> which is either Text node or coloured span Element
        // into the anchor content as a child
        if (inAnchorElement &&
            linkNode.href ===
                lastCombined.href) {
            lastCombined.appendChild(preNode);
        }
        else {
            // the `linkNode` is either Text or AnchorElement;
            const isAnchor = linkNode.nodeType !== Node.TEXT_NODE;
            // if we are NOT about to start an anchor element, just add the pre Node
            if (!isAnchor) {
                combinedNodes.push(preNode);
                inAnchorElement = false;
            }
            else {
                // otherwise start a new anchor; the contents of the `linkNode` and `preNode` should be the same,
                // so we just put the neatly formatted `preNode` inside the anchor node (`linkNode`)
                // and append that to combined nodes.
                linkNode.textContent = '';
                linkNode.appendChild(preNode);
                combinedNodes.push(linkNode);
                inAnchorElement = true;
            }
        }
    }
    // Do not reuse `pre` element. Clearing out previous children is too slow...
    for (const child of combinedNodes) {
        ret.appendChild(child);
    }
    return ret;
}
/**
 * Harden anchor links.
 */
function hardenAnchorLinks(node, resolver) {
    // Handle anchor elements.
    const anchors = node.getElementsByTagName('a');
    for (let i = 0; i < anchors.length; i++) {
        const el = anchors[i];
        // skip when processing a elements inside svg
        // which are of type SVGAnimatedString
        if (!(el instanceof HTMLAnchorElement)) {
            continue;
        }
        const path = el.href;
        const isLocal = resolver && resolver.isLocal
            ? resolver.isLocal(path)
            : _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.URLExt.isLocal(path);
        // set target attribute if not already present
        if (!el.target) {
            el.target = isLocal ? '_self' : '_blank';
        }
        // set rel as 'noopener' for non-local anchors
        if (!isLocal) {
            el.rel = 'noopener';
        }
    }
}
/**
 * The namespace for module implementation details.
 */
var Private;
(function (Private) {
    /**
     * Cache for auto-linking results to provide better performance when streaming outputs.
     */
    Private.autoLinkCache = new Map();
    /**
     * Eval the script tags contained in a host populated by `innerHTML`.
     *
     * When script tags are created via `innerHTML`, the browser does not
     * evaluate them when they are added to the page. This function works
     * around that by creating new equivalent script nodes manually, and
     * replacing the originals.
     */
    function evalInnerHTMLScriptTags(host) {
        // Create a snapshot of the current script nodes.
        const scripts = Array.from(host.getElementsByTagName('script'));
        // Loop over each script node.
        for (const script of scripts) {
            // Skip any scripts which no longer have a parent.
            if (!script.parentNode) {
                continue;
            }
            // Create a new script node which will be clone.
            const clone = document.createElement('script');
            // Copy the attributes into the clone.
            const attrs = script.attributes;
            for (let i = 0, n = attrs.length; i < n; ++i) {
                const { name, value } = attrs[i];
                clone.setAttribute(name, value);
            }
            // Copy the text content into the clone.
            clone.textContent = script.textContent;
            // Replace the old script in the parent.
            script.parentNode.replaceChild(clone, script);
        }
    }
    Private.evalInnerHTMLScriptTags = evalInnerHTMLScriptTags;
    /**
     * Handle the default behavior of nodes.
     */
    function handleDefaults(node) {
        // Handle image elements.
        const imgs = node.getElementsByTagName('img');
        for (let i = 0; i < imgs.length; i++) {
            if (!imgs[i].alt) {
                imgs[i].alt = 'Image';
            }
        }
    }
    Private.handleDefaults = handleDefaults;
    /**
     * Resolve the relative urls in element `src` and `href` attributes.
     *
     * @param node - The head html element.
     *
     * @param resolver - A url resolver.
     *
     * @param linkHandler - An optional link handler for nodes.
     *
     * @returns a promise fulfilled when the relative urls have been resolved.
     */
    async function handleUrls(node, resolver, linkHandler) {
        const promises = [];
        // Handle HTML Elements with src attributes.
        const nodes = node.querySelectorAll('*[src]');
        for (let i = 0; i < nodes.length; i++) {
            promises.push(handleAttr(nodes[i], 'src', resolver));
        }
        // Handle anchor elements.
        const anchors = node.getElementsByTagName('a');
        for (let i = 0; i < anchors.length; i++) {
            promises.push(handleAnchor(anchors[i], resolver, linkHandler));
        }
        // Handle link elements.
        const links = node.getElementsByTagName('link');
        for (let i = 0; i < links.length; i++) {
            promises.push(handleAttr(links[i], 'href', resolver));
        }
        return Promise.all(promises);
    }
    Private.handleUrls = handleUrls;
    /**
     * Resolve the paths in `<a>` elements that have a `data-path` attribute.
     *
     * @param node - The head html element.
     *
     * @param resolver - A url resolver.
     *
     * @param linkHandler - An optional link handler for nodes.
     *
     * @returns a promise fulfilled when the relative urls have been resolved.
     */
    async function handlePaths(node, resolver, linkHandler) {
        const anchors = Array.from(node.querySelectorAll('a[data-path]'));
        return Promise.all(anchors.map(anchor => handlePathAnchor(anchor, resolver, linkHandler)));
    }
    Private.handlePaths = handlePaths;
    /**
     * Apply ids to headers.
     */
    function headerAnchors(node, allowNamedProperties) {
        const headerNames = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
        for (const headerType of headerNames) {
            const headers = node.getElementsByTagName(headerType);
            for (let i = 0; i < headers.length; i++) {
                const header = headers[i];
                const headerId = renderMarkdown.createHeaderId(header);
                if (allowNamedProperties) {
                    header.id = headerId;
                }
                else {
                    header.setAttribute('data-jupyter-id', headerId);
                }
                const anchor = document.createElement('a');
                anchor.target = '_self';
                anchor.textContent = '¶';
                anchor.href = '#' + headerId;
                anchor.classList.add('jp-InternalAnchorLink');
                header.appendChild(anchor);
            }
        }
    }
    Private.headerAnchors = headerAnchors;
    /**
     * Handle a node with a `src` or `href` attribute.
     */
    async function handleAttr(node, name, resolver) {
        const source = node.getAttribute(name) || '';
        const isLocal = resolver.isLocal
            ? resolver.isLocal(source)
            : _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.URLExt.isLocal(source);
        if (!source || !isLocal) {
            return;
        }
        try {
            const urlPath = await resolver.resolveUrl(source, {
                attribute: name,
                tag: node.localName
            });
            let url = await resolver.getDownloadUrl(urlPath);
            if (_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.URLExt.parse(url).protocol !== 'data:') {
                // Bust caching for local src attrs.
                // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
                url += (/\?/.test(url) ? '&' : '?') + new Date().getTime();
            }
            node.setAttribute(name, url);
        }
        catch (err) {
            // If there was an error getting the url,
            // just make it an empty link and report the error.
            node.setAttribute(name, '');
            throw err;
        }
    }
    /**
     * Handle an anchor node.
     */
    async function handleAnchor(anchor, resolver, linkHandler) {
        // Get the link path without the location prepended.
        // (e.g. "./foo.md#Header 1" vs "http://localhost:8888/foo.md#Header 1")
        let href = anchor.getAttribute('href') || '';
        if (!href) {
            return;
        }
        const hash = anchor.hash;
        if (hash && hash === href) {
            anchor.target = '_self';
            anchor.addEventListener('click', (event) => {
                const id = hash.slice(1);
                const escapedId = CSS.escape(id);
                const doc = anchor.ownerDocument;
                const el = doc.querySelector(`[data-jupyter-id="${escapedId}"]`) ||
                    doc.querySelector(`#${escapedId}`);
                if (el) {
                    event.preventDefault();
                    el.scrollIntoView();
                }
            });
            return;
        }
        const isLocal = resolver.isLocal
            ? resolver.isLocal(href)
            : _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.URLExt.isLocal(href);
        // Bail if it is not a file-like url.
        if (!isLocal) {
            return;
        }
        // Remove the hash until we can handle it.
        if (hash) {
            // For external links, remove the hash until we have hash handling.
            href = href.replace(hash, '');
        }
        // Get the appropriate file path.
        return resolver
            .resolveUrl(href, { attribute: 'href', tag: 'a' })
            .then(urlPath => {
            // decode encoded url from url to api path
            const path = decodeURIComponent(urlPath);
            // Handle the click override.
            if (linkHandler) {
                linkHandler.handleLink(anchor, path, hash);
            }
            // Get the appropriate file download path.
            return resolver.getDownloadUrl(urlPath);
        })
            .then(url => {
            // Set the visible anchor.
            anchor.href = url + hash;
        })
            .catch(err => {
            // If there was an error getting the url,
            // just make it an empty link.
            anchor.href = '';
        });
    }
    /**
     * Handle an anchor node.
     */
    async function handlePathAnchor(anchor, resolver, linkHandler) {
        let path = anchor.dataset.path || '';
        let locator = anchor.dataset.locator ? '#' + anchor.dataset.locator : '';
        delete anchor.dataset.path;
        delete anchor.dataset.locator;
        const allowRoot = true;
        const isLocal = resolver.isLocal
            ? resolver.isLocal(path, allowRoot)
            : _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.URLExt.isLocal(path, allowRoot);
        // Bail if:
        // - it is not a file-like url,
        // - the resolver does not support paths
        // - there is no link handler, or if it does not support paths
        if (!path ||
            !isLocal ||
            !resolver.resolvePath ||
            !linkHandler ||
            !linkHandler.handlePath) {
            anchor.replaceWith(...anchor.childNodes);
            return;
        }
        try {
            // Find given path
            const resolution = await resolver.resolvePath(path);
            if (!resolution) {
                // Bail if the file does not exist
                console.log('Path resolution bailing: does not exist');
                return;
            }
            // Handle the click override.
            linkHandler.handlePath(anchor, resolution.path, resolution.scope, locator);
            // Set the visible anchor.
            anchor.href = resolution.path + locator;
        }
        catch (err) {
            // If there was an error getting the url,
            // just make it an empty link.
            console.warn('Path anchor error:', err);
            anchor.href = '#linking-failed-see-console';
        }
    }
    const ANSI_COLORS = [
        'ansi-black',
        'ansi-red',
        'ansi-green',
        'ansi-yellow',
        'ansi-blue',
        'ansi-magenta',
        'ansi-cyan',
        'ansi-white',
        'ansi-black-intense',
        'ansi-red-intense',
        'ansi-green-intense',
        'ansi-yellow-intense',
        'ansi-blue-intense',
        'ansi-magenta-intense',
        'ansi-cyan-intense',
        'ansi-white-intense'
    ];
    /**
     * Create HTML tags for a string with given foreground, background etc. and
     * add them to the `out` array.
     */
    function pushColoredChunk(chunk, fg, bg, bold, underline, inverse, out) {
        if (chunk) {
            const classes = [];
            const styles = [];
            if (bold && typeof fg === 'number' && 0 <= fg && fg < 8) {
                fg += 8; // Bold text uses "intense" colors
            }
            if (inverse) {
                [fg, bg] = [bg, fg];
            }
            if (typeof fg === 'number') {
                classes.push(ANSI_COLORS[fg] + '-fg');
            }
            else if (fg.length) {
                styles.push(`color: rgb(${fg})`);
            }
            else if (inverse) {
                classes.push('ansi-default-inverse-fg');
            }
            if (typeof bg === 'number') {
                classes.push(ANSI_COLORS[bg] + '-bg');
            }
            else if (bg.length) {
                styles.push(`background-color: rgb(${bg})`);
            }
            else if (inverse) {
                classes.push('ansi-default-inverse-bg');
            }
            if (bold) {
                classes.push('ansi-bold');
            }
            if (underline) {
                classes.push('ansi-underline');
            }
            if (classes.length || styles.length) {
                out.push('<span');
                if (classes.length) {
                    out.push(` class="${classes.join(' ')}"`);
                }
                if (styles.length) {
                    out.push(` style="${styles.join('; ')}"`);
                }
                out.push('>');
                out.push(chunk);
                out.push('</span>');
            }
            else {
                out.push(chunk);
            }
        }
    }
    /**
     * Convert ANSI extended colors to R/G/B triple.
     */
    function getExtendedColors(numbers) {
        let r;
        let g;
        let b;
        const n = numbers.shift();
        if (n === 2 && numbers.length >= 3) {
            // 24-bit RGB
            r = numbers.shift();
            g = numbers.shift();
            b = numbers.shift();
            if ([r, g, b].some(c => c < 0 || 255 < c)) {
                throw new RangeError('Invalid range for RGB colors');
            }
        }
        else if (n === 5 && numbers.length >= 1) {
            // 256 colors
            const idx = numbers.shift();
            if (idx < 0) {
                throw new RangeError('Color index must be >= 0');
            }
            else if (idx < 16) {
                // 16 default terminal colors
                return idx;
            }
            else if (idx < 232) {
                // 6x6x6 color cube, see https://stackoverflow.com/a/27165165/500098
                r = Math.floor((idx - 16) / 36);
                r = r > 0 ? 55 + r * 40 : 0;
                g = Math.floor(((idx - 16) % 36) / 6);
                g = g > 0 ? 55 + g * 40 : 0;
                b = (idx - 16) % 6;
                b = b > 0 ? 55 + b * 40 : 0;
            }
            else if (idx < 256) {
                // grayscale, see https://stackoverflow.com/a/27165165/500098
                r = g = b = (idx - 232) * 10 + 8;
            }
            else {
                throw new RangeError('Color index must be < 256');
            }
        }
        else {
            throw new RangeError('Invalid extended color specification');
        }
        return [r, g, b];
    }
    /**
     * Transform ANSI color escape codes into HTML <span> tags with CSS
     * classes such as "ansi-green-intense-fg".
     * The actual colors used are set in the CSS file.
     * This also removes non-color escape sequences.
     * This is supposed to have the same behavior as nbconvert.filters.ansi2html()
     */
    function ansiSpan(str) {
        const ansiRe = /\x1b\[(.*?)([@-~])/g; // eslint-disable-line no-control-regex
        let fg = [];
        let bg = [];
        let bold = false;
        let underline = false;
        let inverse = false;
        let match;
        const out = [];
        const numbers = [];
        let start = 0;
        str = lodash_escape__WEBPACK_IMPORTED_MODULE_2___default()(str);
        str += '\x1b[m'; // Ensure markup for trailing text
        // tslint:disable-next-line
        while ((match = ansiRe.exec(str))) {
            if (match[2] === 'm') {
                const items = match[1].split(';');
                for (let i = 0; i < items.length; i++) {
                    const item = items[i];
                    if (item === '') {
                        numbers.push(0);
                    }
                    else if (item.search(/^\d+$/) !== -1) {
                        numbers.push(parseInt(item, 10));
                    }
                    else {
                        // Ignored: Invalid color specification
                        numbers.length = 0;
                        break;
                    }
                }
            }
            else {
                // Ignored: Not a color code
            }
            const chunk = str.substring(start, match.index);
            pushColoredChunk(chunk, fg, bg, bold, underline, inverse, out);
            start = ansiRe.lastIndex;
            while (numbers.length) {
                const n = numbers.shift();
                switch (n) {
                    case 0:
                        fg = bg = [];
                        bold = false;
                        underline = false;
                        inverse = false;
                        break;
                    case 1:
                    case 5:
                        bold = true;
                        break;
                    case 4:
                        underline = true;
                        break;
                    case 7:
                        inverse = true;
                        break;
                    case 21:
                    case 22:
                        bold = false;
                        break;
                    case 24:
                        underline = false;
                        break;
                    case 27:
                        inverse = false;
                        break;
                    case 30:
                    case 31:
                    case 32:
                    case 33:
                    case 34:
                    case 35:
                    case 36:
                    case 37:
                        fg = n - 30;
                        break;
                    case 38:
                        try {
                            fg = getExtendedColors(numbers);
                        }
                        catch (e) {
                            numbers.length = 0;
                        }
                        break;
                    case 39:
                        fg = [];
                        break;
                    case 40:
                    case 41:
                    case 42:
                    case 43:
                    case 44:
                    case 45:
                    case 46:
                    case 47:
                        bg = n - 40;
                        break;
                    case 48:
                        try {
                            bg = getExtendedColors(numbers);
                        }
                        catch (e) {
                            numbers.length = 0;
                        }
                        break;
                    case 49:
                        bg = [];
                        break;
                    case 90:
                    case 91:
                    case 92:
                    case 93:
                    case 94:
                    case 95:
                    case 96:
                    case 97:
                        fg = n - 90 + 8;
                        break;
                    case 100:
                    case 101:
                    case 102:
                    case 103:
                    case 104:
                    case 105:
                    case 106:
                    case 107:
                        bg = n - 100 + 8;
                        break;
                    default:
                    // Unknown codes are ignored
                }
            }
        }
        return out.join('');
    }
    Private.ansiSpan = ansiSpan;
})(Private || (Private = {}));
//# sourceMappingURL=renderers.js.map

/***/ }),

/***/ 2186:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   X5: () => (/* binding */ IUrlResolverFactory),
/* harmony export */   ZD: () => (/* binding */ IRenderMimeRegistry),
/* harmony export */   _y: () => (/* binding */ ILatexTypesetter),
/* harmony export */   sc: () => (/* binding */ IMarkdownParser)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * The rendermime token.
 */
const IRenderMimeRegistry = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/rendermime:IRenderMimeRegistry', 'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.');
/**
 * The latex typesetter token.
 */
const ILatexTypesetter = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/rendermime:ILatexTypesetter', 'A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension.');
/**
 * The markdown parser token.
 */
const IMarkdownParser = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/rendermime:IMarkdownParser', 'A service for rendering markdown syntax as HTML content.');
/**
 * The URL resolver factory.
 */
const IUrlResolverFactory = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/rendermime:IUrlResolverFactory', 'A factory for resolver of asset URLs.');
//# sourceMappingURL=tokens.js.map

/***/ }),

/***/ 28182:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BP: () => (/* binding */ RenderedHTMLCommon),
/* harmony export */   FK: () => (/* binding */ RenderedLatex),
/* harmony export */   Hw: () => (/* binding */ RenderedError),
/* harmony export */   ND: () => (/* binding */ RenderedJavaScript),
/* harmony export */   UH: () => (/* binding */ RenderedImage),
/* harmony export */   cw: () => (/* binding */ RenderedMarkdown),
/* harmony export */   lH: () => (/* binding */ RenderedText),
/* harmony export */   oI: () => (/* binding */ RenderedHTML),
/* harmony export */   pY: () => (/* binding */ RenderedCommon),
/* harmony export */   zt: () => (/* binding */ RenderedSVG)
/* harmony export */ });
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _renderers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3328);



/**
 * A common base class for mime renderers.
 */
class RenderedCommon extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_1__.Widget {
    /**
     * Construct a new rendered common widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        var _a, _b;
        super();
        this.mimeType = options.mimeType;
        this.sanitizer = options.sanitizer;
        this.resolver = options.resolver;
        this.linkHandler = options.linkHandler;
        this.translator = (_a = options.translator) !== null && _a !== void 0 ? _a : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_0__.nullTranslator;
        this.latexTypesetter = options.latexTypesetter;
        this.markdownParser = (_b = options.markdownParser) !== null && _b !== void 0 ? _b : null;
        this.node.dataset['mimeType'] = this.mimeType;
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @param keepExisting - Whether to keep the existing rendering.
     *
     * @returns A promise which resolves when rendering is complete.
     *
     * #### Notes
     * By default, if the DOM node for this widget already has content, it
     * is emptied before rendering. Subclasses that do not want this behavior
     * (if, for instance, they are using DOM diffing), should override this
     * method or call `super.renderModel(model, true)`.
     */
    async renderModel(model, keepExisting) {
        // TODO compare model against old model for early bail?
        // Empty any existing content in the node from previous renders
        if (!keepExisting) {
            while (this.node.firstChild) {
                this.node.removeChild(this.node.firstChild);
            }
        }
        // Toggle the trusted class on the widget.
        this.toggleClass('jp-mod-trusted', model.trusted);
        // Render the actual content.
        await this.render(model);
        // Handle the fragment identifier if given.
        const { fragment } = model.metadata;
        if (fragment) {
            this.setFragment(fragment);
        }
    }
    /**
     * Set the URI fragment identifier.
     *
     * @param fragment - The URI fragment identifier.
     */
    setFragment(fragment) {
        /* no-op */
    }
}
/**
 * A common base class for HTML mime renderers.
 */
class RenderedHTMLCommon extends RenderedCommon {
    /**
     * Construct a new rendered HTML common widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        this.addClass('jp-RenderedHTMLCommon');
    }
    setFragment(fragment) {
        let el;
        try {
            if (fragment.startsWith('#')) {
                const id = fragment.slice(1);
                const escapedId = CSS.escape(id);
                if (this.sanitizer.allowNamedProperties) {
                    el = this.node.querySelector(`#${escapedId}`);
                }
                else {
                    el = this.node.querySelector(`[data-jupyter-id="${escapedId}"]`);
                }
            }
            else {
                el = this.node.querySelector(fragment);
            }
        }
        catch (error) {
            console.warn('Unable to set URI fragment identifier.', error);
        }
        if (el) {
            el.scrollIntoView();
        }
    }
}
/**
 * A mime renderer for displaying HTML and math.
 */
class RenderedHTML extends RenderedHTMLCommon {
    /**
     * Construct a new rendered HTML widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        // A promise which resolves when most recent rendering is complete.
        this._rendered = Promise.resolve();
        this.addClass('jp-RenderedHTML');
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    render(model) {
        return (this._rendered = _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderHTML */ .NN({
            host: this.node,
            source: String(model.data[this.mimeType]),
            trusted: model.trusted,
            resolver: this.resolver,
            sanitizer: this.sanitizer,
            linkHandler: this.linkHandler,
            shouldTypeset: this.isAttached,
            latexTypesetter: this.latexTypesetter,
            translator: this.translator
        }));
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        this._rendered
            .then(() => {
            if (this.latexTypesetter) {
                Private.typeset(this.node, this.latexTypesetter, this.resolver);
            }
        })
            .catch(console.warn);
    }
}
/**
 * A mime renderer for displaying LaTeX output.
 */
class RenderedLatex extends RenderedCommon {
    /**
     * Construct a new rendered LaTeX widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        // A promise which resolves when most recent rendering is complete.
        this._rendered = Promise.resolve();
        this.addClass('jp-RenderedLatex');
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    render(model) {
        return (this._rendered = _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderLatex */ .K3({
            host: this.node,
            source: String(model.data[this.mimeType]),
            shouldTypeset: this.isAttached,
            latexTypesetter: this.latexTypesetter,
            resolver: this.resolver
        }));
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        this._rendered
            .then(() => {
            if (this.latexTypesetter) {
                Private.typeset(this.node, this.latexTypesetter, this.resolver);
            }
        })
            .catch(console.warn);
    }
}
/**
 * A mime renderer for displaying images.
 */
class RenderedImage extends RenderedCommon {
    /**
     * Construct a new rendered image widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        this.addClass('jp-RenderedImage');
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    render(model) {
        const metadata = model.metadata[this.mimeType];
        return _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderImage */ .co({
            host: this.node,
            mimeType: this.mimeType,
            source: String(model.data[this.mimeType]),
            width: metadata && metadata.width,
            height: metadata && metadata.height,
            needsBackground: model.metadata['needs_background'],
            unconfined: metadata && metadata.unconfined
        });
    }
}
/**
 * A mime renderer for displaying Markdown with embedded latex.
 */
class RenderedMarkdown extends RenderedHTMLCommon {
    /**
     * Construct a new rendered markdown widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        // A promise which resolves when most recent rendering is complete.
        this._rendered = Promise.resolve();
        this.addClass('jp-RenderedMarkdown');
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    render(model) {
        return (this._rendered = _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderMarkdown */ .ap({
            host: this.node,
            source: String(model.data[this.mimeType]),
            trusted: model.trusted,
            resolver: this.resolver,
            sanitizer: this.sanitizer,
            linkHandler: this.linkHandler,
            shouldTypeset: this.isAttached,
            latexTypesetter: this.latexTypesetter,
            markdownParser: this.markdownParser,
            translator: this.translator
        }));
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    async renderModel(model) {
        await super.renderModel(model, true);
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        this._rendered
            .then(() => {
            if (this.latexTypesetter) {
                Private.typeset(this.node, this.latexTypesetter, this.resolver);
            }
        })
            .catch(console.warn);
    }
}
/**
 * A widget for displaying SVG content.
 */
class RenderedSVG extends RenderedCommon {
    /**
     * Construct a new rendered SVG widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        // A promise which resolves when most recent rendering is complete.
        this._rendered = Promise.resolve();
        this.addClass('jp-RenderedSVG');
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    render(model) {
        const metadata = model.metadata[this.mimeType];
        return (this._rendered = _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderSVG */ .KB({
            host: this.node,
            source: String(model.data[this.mimeType]),
            trusted: model.trusted,
            unconfined: metadata && metadata.unconfined,
            translator: this.translator
        }));
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        this._rendered
            .then(() => {
            if (this.latexTypesetter) {
                Private.typeset(this.node, this.latexTypesetter, this.resolver);
            }
        })
            .catch(console.warn);
    }
}
/**
 * A widget for displaying plain text and console text.
 */
class RenderedText extends RenderedCommon {
    /**
     * Construct a new rendered text widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        this.addClass('jp-RenderedText');
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    render(model) {
        return _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderText */ .IY({
            host: this.node,
            sanitizer: this.sanitizer,
            source: String(model.data[this.mimeType]),
            translator: this.translator
        });
    }
}
class RenderedError extends RenderedCommon {
    constructor(options) {
        super(options);
        this.addClass('jp-RenderedText');
    }
    render(model) {
        return _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderError */ .Op({
            host: this.node,
            sanitizer: this.sanitizer,
            source: String(model.data[this.mimeType]),
            linkHandler: this.linkHandler,
            resolver: this.resolver,
            translator: this.translator
        });
    }
}
/**
 * A widget for displaying JavaScript output.
 */
class RenderedJavaScript extends RenderedCommon {
    /**
     * Construct a new rendered text widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options) {
        super(options);
        this.addClass('jp-RenderedJavaScript');
    }
    /**
     * Render a mime model.
     *
     * @param model - The mime model to render.
     *
     * @returns A promise which resolves when rendering is complete.
     */
    render(model) {
        const trans = this.translator.load('jupyterlab');
        return _renderers__WEBPACK_IMPORTED_MODULE_2__/* .renderText */ .IY({
            host: this.node,
            sanitizer: this.sanitizer,
            source: trans.__('JavaScript output is disabled in JupyterLab'),
            translator: this.translator
        });
    }
}
/**
 * The namespace for module implementation details.
 */
var Private;
(function (Private) {
    /**
     * Run typesetter on the given node and harden links.
     */
    function typeset(host, latexTypesetter, resolver) {
        const result = latexTypesetter.typeset(host);
        // Harden anchors to contain secure target/rel attributes.
        if (result instanceof Promise) {
            // If promised was returned, await for rendering to complete.
            result
                .then(() => _renderers__WEBPACK_IMPORTED_MODULE_2__/* .hardenAnchorLinks */ .D2(host, resolver))
                .catch(console.warn);
        }
        else {
            _renderers__WEBPACK_IMPORTED_MODULE_2__/* .hardenAnchorLinks */ .D2(host, resolver);
        }
    }
    Private.typeset = typeset;
})(Private || (Private = {}));
//# sourceMappingURL=widgets.js.map

/***/ }),

/***/ 45304:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/rendermime/style/base.css
var base = __webpack_require__(96414);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/rendermime/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 97854:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  CommandIDs: () => (/* binding */ CommandIDs),
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/running@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/running/lib/index.js)
var running_lib_index_js_ = __webpack_require__(64008);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docmanager@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/docmanager/lib/index.js)
var docmanager_lib_index_js_ = __webpack_require__(64009);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(75205);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/running-extension/lib/kernels.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








const KERNEL_ITEM_CLASS = 'jp-mod-kernel';
const KERNELSPEC_ITEM_CLASS = 'jp-mod-kernelspec';
const WIDGET_ITEM_CLASS = 'jp-mod-kernel-widget';
const KERNEL_LABEL_ID = 'jp-RunningSessions-item-label-kernel-id';
/**
 * Add the running kernel manager (notebooks & consoles) to the running panel.
 */
async function addKernelRunningSessionManager(managers, translator, app) {
    const { commands, contextMenu, serviceManager } = app;
    const { kernels, kernelspecs, sessions } = serviceManager;
    const { runningChanged, RunningKernel } = Private;
    const throttler = new index_es6_js_.Throttler(() => runningChanged.emit(undefined), 100);
    const trans = translator.load('jupyterlab');
    const shutdownUnusedLabel = trans.__('Shut Down Unused');
    let shutdownUnusedEnabled = false;
    const shutdownUnusedThrottler = new index_es6_js_.Throttler(checkShutdownUnusedEnabled, 10000);
    // Throttle signal emissions from the kernel and session managers.
    kernels.runningChanged.connect(() => {
        void throttler.invoke();
        void shutdownUnusedThrottler.invoke();
    });
    sessions.runningChanged.connect(() => void throttler.invoke());
    // Wait until the relevant services are ready.
    await Promise.all([kernels.ready, kernelspecs.ready, sessions.ready]);
    function getUnusedKernels() {
        // Identifies unused kernels
        return Array.from(kernels.running()).filter(kernel => { var _a; return ((_a = kernel.connections) !== null && _a !== void 0 ? _a : 1) < 1; });
    }
    async function checkShutdownUnusedEnabled() {
        const wasEnabled = shutdownUnusedEnabled;
        shutdownUnusedEnabled = getUnusedKernels().length > 0;
        if (wasEnabled !== shutdownUnusedEnabled) {
            commands.notifyCommandChanged(CommandIDs.kernelShutDownUnused);
        }
    }
    commands.addCommand(CommandIDs.kernelShutDownUnused, {
        label: args => (args.toolbar ? '' : shutdownUnusedLabel),
        icon: args => (args.toolbar ? ui_components_lib_index_js_.cleaningIcon : undefined),
        execute: async () => {
            const unusedKernels = getUnusedKernels();
            if (unusedKernels.length === 0) {
                return;
            }
            const confirmed = await (0,lib_index_js_.showDialog)({
                title: shutdownUnusedLabel,
                body: (react_index_js_default().createElement((react_index_js_default()).Fragment, null,
                    trans.__('Are you sure you want to shut down the following unused kernels?'),
                    react_index_js_default().createElement("ul", null, unusedKernels.map(kernel => (react_index_js_default().createElement("li", { key: kernel.id }, trans.__('%1 (%2)', kernel.name, kernel.id.slice(0, 8)))))))),
                buttons: [
                    lib_index_js_.Dialog.cancelButton(),
                    lib_index_js_.Dialog.warnButton({ label: shutdownUnusedLabel })
                ]
            });
            if (confirmed.button.accept) {
                await Promise.allSettled(unusedKernels.map(kernel => services_lib_index_js_.KernelAPI.shutdownKernel(kernel.id)));
                await Promise.all([
                    kernels.refreshRunning(),
                    sessions.refreshRunning()
                ]);
            }
        },
        isEnabled: () => shutdownUnusedEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    toolbar: {
                        type: 'boolean',
                        description: trans.__('Whether executed from toolbar')
                    }
                }
            }
        }
    });
    // Add the kernels pane to the running sidebar.
    managers.add({
        name: trans.__('Kernels'),
        supportsMultipleViews: true,
        running: (options) => {
            var _a;
            const kernelsBySpec = new Map();
            for (const kernel of kernels.running()) {
                const list = (_a = kernelsBySpec.get(kernel.name)) !== null && _a !== void 0 ? _a : [];
                kernelsBySpec.set(kernel.name, list);
                list.push(new RunningKernel({
                    commands,
                    kernel,
                    kernels,
                    sessions,
                    trans,
                    mode: options.mode
                }));
            }
            const treeItems = Array.from(kernelsBySpec.entries()).map(([spec, kernels]) => {
                var _a;
                return new Private.KernelSpecItem({
                    name: spec,
                    kernels,
                    spec: (_a = kernelspecs.specs) === null || _a === void 0 ? void 0 : _a.kernelspecs[spec],
                    trans
                });
            });
            return options.mode === 'tree'
                ? treeItems
                : treeItems
                    .map(item => item.children.map(i => { var _a; return (_a = i.children) !== null && _a !== void 0 ? _a : []; }).flat())
                    .flat();
        },
        shutdownAll: () => kernels.shutdownAll(),
        refreshRunning: () => Promise.all([kernels.refreshRunning(), sessions.refreshRunning()]),
        runningChanged,
        shutdownLabel: trans.__('Shut Down Kernel'),
        shutdownAllLabel: trans.__('Shut Down All'),
        shutdownAllConfirmationText: () => trans._n('Are you sure you want to permanently shut down the running kernel?', 'Are you sure you want to permanently shut down the %1 running kernels?', kernels.runningCount),
        toolbarButtons: [
            new ui_components_lib_index_js_.CommandToolbarButton({
                commands,
                id: CommandIDs.kernelShutDownUnused,
                caption: shutdownUnusedLabel,
                args: { toolbar: true }
            })
        ]
    });
    // Add running kernels commands to the registry.
    const test = (node) => node.classList.contains(KERNEL_ITEM_CLASS);
    commands.addCommand(CommandIDs.kernelNewConsole, {
        icon: ui_components_lib_index_js_.consoleIcon,
        label: trans.__('New Console for Kernel'),
        execute: args => {
            var _a;
            const node = app.contextMenuHitTest(test);
            const id = (_a = args.id) !== null && _a !== void 0 ? _a : node === null || node === void 0 ? void 0 : node.dataset['context'];
            if (id) {
                return commands.execute('console:create', { kernelPreference: { id } });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    id: {
                        type: 'string',
                        description: trans.__('Kernel ID to create console for')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.kernelNewNotebook, {
        icon: ui_components_lib_index_js_.notebookIcon,
        label: trans.__('New Notebook for Kernel'),
        execute: args => {
            var _a;
            const node = app.contextMenuHitTest(test);
            const id = (_a = args.id) !== null && _a !== void 0 ? _a : node === null || node === void 0 ? void 0 : node.dataset['context'];
            if (id) {
                return commands.execute('notebook:create-new', { kernelId: id });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    id: {
                        type: 'string',
                        description: trans.__('Kernel ID to create notebook for')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.kernelOpenSession, {
        icon: args => args.type === 'console'
            ? ui_components_lib_index_js_.consoleIcon
            : args.type === 'notebook'
                ? ui_components_lib_index_js_.notebookIcon
                : undefined,
        isEnabled: ({ path, type }) => !!type || path !== undefined,
        label: ({ name, path }) => name ||
            coreutils_lib_index_js_.PathExt.basename(path || trans.__('Unknown Session')),
        execute: ({ path, type }) => {
            if (!type || path === undefined) {
                return;
            }
            const command = type === 'console' ? 'console:open' : 'docmanager:open';
            return commands.execute(command, { path });
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    path: {
                        type: 'string',
                        description: trans.__('Path to the session to open')
                    },
                    type: {
                        type: 'string',
                        description: trans.__('Type of session (console or notebook)')
                    },
                    name: {
                        type: 'string',
                        description: trans.__('Name of the session')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.kernelShutDown, {
        icon: ui_components_lib_index_js_.closeIcon,
        label: trans.__('Shut Down Kernel'),
        execute: args => {
            var _a;
            const node = app.contextMenuHitTest(test);
            const id = (_a = args.id) !== null && _a !== void 0 ? _a : node === null || node === void 0 ? void 0 : node.dataset['context'];
            if (id) {
                return kernels.shutdown(id);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    id: {
                        type: 'string',
                        description: trans.__('Kernel ID to shut down')
                    }
                }
            }
        }
    });
    const sessionsItems = [];
    // Populate connected sessions submenu when context menu is opened.
    contextMenu.opened.connect(async () => {
        var _a, _b, _c;
        const submenu = (_b = (_a = contextMenu.menu.items.find(item => {
            var _a;
            return item.type === 'submenu' &&
                ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-contextmenu-connected-sessions';
        })) === null || _a === void 0 ? void 0 : _a.submenu) !== null && _b !== void 0 ? _b : null;
        if (!submenu) {
            // Bail early if the connected session menu is not found
            return;
        }
        // Empty the connected sessions submenu.
        sessionsItems.forEach(item => item.dispose());
        sessionsItems.length = 0;
        submenu.clearItems();
        const node = app.contextMenuHitTest(test);
        const id = node === null || node === void 0 ? void 0 : node.dataset['context'];
        if (!id) {
            return;
        }
        // Populate the submenu with sessions connected to this kernel.
        const command = CommandIDs.kernelOpenSession;
        for (const session of sessions.running()) {
            if (id === ((_c = session.kernel) === null || _c === void 0 ? void 0 : _c.id)) {
                const { name, path, type } = session;
                sessionsItems.push(submenu.addItem({ command, args: { name, path, type } }));
            }
        }
    });
}
var Private;
(function (Private) {
    class KernelSpecItem {
        constructor(options) {
            this._name = options.name;
            this.className = KERNELSPEC_ITEM_CLASS;
            this._kernels = options.kernels;
            this.spec = options.spec || null;
            this.trans = options.trans;
        }
        icon() {
            const { spec } = this;
            if (!spec || !spec.resources) {
                return ui_components_lib_index_js_.jupyterIcon;
            }
            return (spec.resources['logo-svg'] ||
                spec.resources['logo-64x64'] ||
                spec.resources['logo-32x32']);
        }
        label() {
            const { _name, spec } = this;
            return (spec === null || spec === void 0 ? void 0 : spec.display_name) || _name;
        }
        get children() {
            return this._kernels;
        }
    }
    Private.KernelSpecItem = KernelSpecItem;
    class RunningKernel {
        constructor(options) {
            this.className = KERNEL_ITEM_CLASS;
            this.commands = options.commands;
            this.kernel = options.kernel;
            this.context = this.kernel.id;
            this.kernels = options.kernels;
            this.sessions = options.sessions;
            this.trans = options.trans;
            this._mode = options.mode;
        }
        get children() {
            var _a;
            const children = [];
            const open = CommandIDs.kernelOpenSession;
            const { commands } = this;
            for (const session of this.sessions.running()) {
                if (this.kernel.id === ((_a = session.kernel) === null || _a === void 0 ? void 0 : _a.id)) {
                    const { name, path, type } = session;
                    children.push({
                        className: WIDGET_ITEM_CLASS,
                        context: this.kernel.id,
                        open: () => void commands.execute(open, { name, path, type }),
                        icon: () => type === 'console'
                            ? ui_components_lib_index_js_.consoleIcon
                            : type === 'notebook'
                                ? ui_components_lib_index_js_.notebookIcon
                                : ui_components_lib_index_js_.jupyterIcon,
                        label: () => {
                            if (this._mode === 'tree') {
                                return name;
                            }
                            const kernelIdPrefix = this.kernel.id.split('-')[0];
                            return (react_index_js_default().createElement((react_index_js_default()).Fragment, null,
                                name,
                                ' ',
                                react_index_js_default().createElement("span", { className: KERNEL_LABEL_ID },
                                    "(",
                                    kernelIdPrefix,
                                    ")")));
                        },
                        labelTitle: () => path,
                        name: () => name
                    });
                }
            }
            return children;
        }
        shutdown() {
            return this.kernels.shutdown(this.kernel.id);
        }
        icon() {
            return ui_components_lib_index_js_.kernelIcon;
        }
        label() {
            const { kernel } = this;
            const kernelIdPrefix = kernel.id.split('-')[0];
            return (react_index_js_default().createElement((react_index_js_default()).Fragment, null,
                this._summary,
                ' ',
                react_index_js_default().createElement("span", { className: KERNEL_LABEL_ID },
                    "(",
                    kernelIdPrefix,
                    ")")));
        }
        labelTitle() {
            var _a;
            const { trans } = this;
            const { id } = this.kernel;
            const title = [`${this._summary}: ${id}`];
            for (const session of this.sessions.running()) {
                if (this.kernel.id === ((_a = session.kernel) === null || _a === void 0 ? void 0 : _a.id)) {
                    const { path, type } = session;
                    title.push(trans.__(`%1\nPath: %2`, type, path));
                }
            }
            return title.join('\n\n');
        }
        get _summary() {
            const children = this.children;
            if (children.length === 0) {
                return this.trans.__('No sessions connected');
            }
            else if (children.length == 1) {
                return children[0].name();
            }
            else {
                return this.trans.__('%1 and %2 more', children[0].name(), children.length - 1);
            }
        }
    }
    Private.RunningKernel = RunningKernel;
    Private.runningChanged = new dist_index_es6_js_.Signal({});
})(Private || (Private = {}));
//# sourceMappingURL=kernels.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/docregistry@~4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/docregistry/lib/index.js)
var docregistry_lib_index_js_ = __webpack_require__(34992);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/running-extension/lib/opentabs.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * A class used to consolidate the signals used to rerender the open tabs section.
 */
class OpenTabsSignaler {
    constructor(labShell) {
        this._tabsChanged = new dist_index_es6_js_.Signal(this);
        this._widgets = [];
        this._labShell = labShell;
        this._labShell.layoutModified.connect(this._emitTabsChanged, this);
    }
    /**
     * A signal that fires when the open tabs section should be rerendered.
     */
    get tabsChanged() {
        return this._tabsChanged;
    }
    /**
     * Add a widget to watch for title changing.
     *
     * @param widget A widget whose title may change.
     */
    addWidget(widget) {
        widget.title.changed.connect(this._emitTabsChanged, this);
        this._widgets.push(widget);
    }
    /**
     * Emit the main signal that indicates the open tabs should be rerendered.
     */
    _emitTabsChanged() {
        this._widgets.forEach(widget => {
            widget.title.changed.disconnect(this._emitTabsChanged, this);
        });
        this._widgets = [];
        this._tabsChanged.emit(void 0);
    }
}
/**
 * Add the open tabs section to the running panel.
 *
 * @param managers - The IRunningSessionManagers used to register this section.
 * @param translator - The translator to use.
 * @param labShell - The ILabShell.
 */
function addOpenTabsSessionManager(managers, translator, labShell) {
    const signaler = new OpenTabsSignaler(labShell);
    const trans = translator.load('jupyterlab');
    managers.add({
        name: trans.__('Open Tabs'),
        supportsMultipleViews: false,
        running: () => {
            return Array.from(labShell.widgets('main')).map((widget) => {
                signaler.addWidget(widget);
                return new OpenTab(widget);
            });
        },
        shutdownAll: () => {
            const widgets = Array.from(labShell.widgets('main'));
            for (const widget of widgets) {
                widget.close();
            }
        },
        refreshRunning: () => {
            return void 0;
        },
        runningChanged: signaler.tabsChanged,
        shutdownLabel: trans.__('Close'),
        shutdownAllLabel: trans.__('Close All'),
        shutdownAllConfirmationText: trans.__('Are you sure you want to close all open tabs?')
    });
    class OpenTab {
        constructor(widget) {
            this._widget = widget;
        }
        open() {
            labShell.activateById(this._widget.id);
        }
        shutdown() {
            this._widget.close();
        }
        icon() {
            const widgetIcon = this._widget.title.icon;
            return widgetIcon instanceof ui_components_lib_index_js_.LabIcon ? widgetIcon : ui_components_lib_index_js_.fileIcon;
        }
        label() {
            return this._widget.title.label;
        }
        labelTitle() {
            let labelTitle;
            if (this._widget instanceof docregistry_lib_index_js_.DocumentWidget) {
                labelTitle = this._widget.context.path;
            }
            else {
                labelTitle = this._widget.title.label;
            }
            return labelTitle;
        }
    }
}
//# sourceMappingURL=opentabs.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/running-extension/lib/recents.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * Add the 'recently closed' section to the running panel.
 *
 * @param managers - The IRunningSessionManagers used to register this section.
 * @param recentsManager - The recent documents manager.
 * @param commands - The command registry.
 * @param docRegistry - Document registry.
 * @param translator - The translator to use.
 */
function addRecentlyClosedSessionManager(managers, recentsManager, commands, docRegistry, translator) {
    const trans = translator.load('jupyterlab');
    managers.add({
        name: trans.__('Recently Closed'),
        supportsMultipleViews: false,
        running: () => {
            return recentsManager.recentlyClosed.map((recent) => {
                return new RecentItem(recent);
            });
        },
        shutdownAll: () => {
            for (const widget of recentsManager.recentlyClosed) {
                recentsManager.removeRecent(widget, 'closed');
            }
        },
        refreshRunning: () => {
            return void 0;
        },
        runningChanged: recentsManager.changed,
        shutdownLabel: trans.__('Forget'),
        shutdownAllLabel: trans.__('Forget All'),
        shutdownAllConfirmationText: trans.__('Are you sure you want to clear recently closed tabs?')
    });
    class RecentItem {
        constructor(recent) {
            this._recent = recent;
        }
        async open() {
            const recent = this._recent;
            const isValid = await recentsManager.validate(recent);
            if (!isValid) {
                return;
            }
            await commands.execute('docmanager:open', {
                path: recent.path,
                factory: recent.factory
            });
            recentsManager.removeRecent(recent, 'closed');
        }
        shutdown() {
            recentsManager.removeRecent(this._recent, 'closed');
        }
        icon() {
            if (!this._recent.factory) {
                return ui_components_lib_index_js_.fileIcon;
            }
            // Prefer path inference as it is more granular.
            const fileTypes = docRegistry.getFileTypesForPath(this._recent.path);
            for (const fileType of fileTypes) {
                const icon = fileType.icon;
                if (icon instanceof ui_components_lib_index_js_.LabIcon) {
                    return icon;
                }
            }
            // Fallback to factory-base inference.
            const factory = docRegistry.getWidgetFactory(this._recent.factory);
            if (factory) {
                for (const fileTypeName of factory.fileTypes) {
                    const fileType = docRegistry.getFileType(fileTypeName);
                    const icon = fileType === null || fileType === void 0 ? void 0 : fileType.icon;
                    if (icon instanceof ui_components_lib_index_js_.LabIcon) {
                        return icon;
                    }
                }
            }
            return ui_components_lib_index_js_.fileIcon;
        }
        label() {
            return coreutils_lib_index_js_.PathExt.basename(this._recent.path);
        }
        labelTitle() {
            return this._recent.path;
        }
    }
}
//# sourceMappingURL=recents.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/running-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module running-extension
 */










/**
 * The command IDs used by the running plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.kernelNewConsole = 'running:kernel-new-console';
    CommandIDs.kernelNewNotebook = 'running:kernel-new-notebook';
    CommandIDs.kernelOpenSession = 'running:kernel-open-session';
    CommandIDs.kernelShutDown = 'running:kernel-shut-down';
    CommandIDs.kernelShutDownUnused = 'running:kernel-shut-down-unused';
    CommandIDs.showPanel = 'running:show-panel';
    CommandIDs.showModal = 'running:show-modal';
})(CommandIDs || (CommandIDs = {}));
/**
 * The default running sessions extension.
 */
const lib_plugin = {
    id: '@jupyterlab/running-extension:plugin',
    description: 'Provides the running session managers.',
    provides: running_lib_index_js_.IRunningSessionManagers,
    requires: [translation_lib_index_js_.ITranslator],
    optional: [index_js_.ILabShell],
    autoStart: true,
    activate: (app, translator, labShell) => {
        const runningSessionManagers = new running_lib_index_js_.RunningSessionManagers();
        if (labShell) {
            addOpenTabsSessionManager(runningSessionManagers, translator, labShell);
        }
        void addKernelRunningSessionManager(runningSessionManagers, translator, app);
        return runningSessionManagers;
    }
};
/**
 * The plugin enabling the running sidebar.
 */
const sidebarPlugin = {
    id: '@jupyterlab/running-extension:sidebar',
    description: 'Provides the running session sidebar.',
    provides: running_lib_index_js_.IRunningSessionSidebar,
    requires: [running_lib_index_js_.IRunningSessionManagers, translation_lib_index_js_.ITranslator],
    optional: [index_js_.ILayoutRestorer, statedb_lib_index_js_.IStateDB],
    autoStart: true,
    activate: (app, manager, translator, restorer, state) => {
        const trans = translator.load('jupyterlab');
        const running = new running_lib_index_js_.RunningSessions(manager, translator, state);
        running.id = 'jp-running-sessions';
        running.title.caption = trans.__('Running Terminals and Kernels');
        running.title.icon = ui_components_lib_index_js_.runningIcon;
        running.node.setAttribute('role', 'region');
        running.node.setAttribute('aria-label', trans.__('Running Sessions section'));
        // Let the application restorer track the running panel for restoration of
        // application state (e.g. setting the running panel as the current side bar
        // widget).
        if (restorer) {
            restorer.add(running, 'running-sessions');
        }
        // Rank has been chosen somewhat arbitrarily to give priority to the running
        // sessions widget in the sidebar.
        app.shell.add(running, 'left', { rank: 200, type: 'Sessions and Tabs' });
        app.commands.addCommand(CommandIDs.showPanel, {
            label: trans.__('Sessions and Tabs'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            },
            execute: () => {
                app.shell.activateById(running.id);
            }
        });
        return running;
    }
};
/**
 * An optional adding recently closed tabs.
 */
const recentsPlugin = {
    id: '@jupyterlab/running-extension:recently-closed',
    description: 'Adds recently closed documents list.',
    requires: [running_lib_index_js_.IRunningSessionManagers, docmanager_lib_index_js_.IRecentsManager, translation_lib_index_js_.ITranslator],
    autoStart: true,
    activate: (app, manager, recents, translator) => {
        addRecentlyClosedSessionManager(manager, recents, app.commands, app.docRegistry, translator);
    }
};
/**
 * An optional plugin allowing to among running items.
 */
const searchPlugin = {
    id: '@jupyterlab/running-extension:search-tabs',
    description: 'Adds a widget to search open and closed tabs.',
    requires: [running_lib_index_js_.IRunningSessionManagers, translation_lib_index_js_.ITranslator],
    optional: [lib_index_js_.ICommandPalette, running_lib_index_js_.IRunningSessionSidebar],
    autoStart: true,
    activate: (app, manager, translator, palette, sidebar) => {
        const trans = translator.load('jupyterlab');
        app.commands.addCommand(CommandIDs.showModal, {
            execute: () => {
                const running = new running_lib_index_js_.SearchableSessions(manager, translator);
                const dialog = new lib_index_js_.Dialog({
                    title: trans.__('Tabs and Running Sessions'),
                    body: running,
                    buttons: [lib_index_js_.Dialog.okButton({})],
                    hasClose: true
                });
                dialog.addClass('jp-SearchableSessions-modal');
                return dialog.launch();
            },
            label: trans.__('Search Tabs and Running Sessions'),
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        if (palette) {
            palette.addItem({
                command: CommandIDs.showModal,
                category: trans.__('Running')
            });
        }
        if (sidebar) {
            const button = new ui_components_lib_index_js_.CommandToolbarButton({
                commands: app.commands,
                id: CommandIDs.showModal,
                icon: ui_components_lib_index_js_.launcherIcon,
                label: ''
            });
            sidebar.toolbar.addItem('open-as-modal', button);
        }
    }
};
/**
 * Export the plugins.
 */
/* harmony default export */ const lib = ([lib_plugin, sidebarPlugin, recentsPlugin, searchPlugin]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 47275:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _lumino_widgets_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20959);
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_docregistry_style_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30507);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_docmanager_style_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81393);
/* harmony import */ var _jupyterlab_running_style_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37133);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 1809:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   IRunningSessionManagers: () => (/* binding */ IRunningSessionManagers),
/* harmony export */   IRunningSessionSidebar: () => (/* binding */ IRunningSessionSidebar),
/* harmony export */   RunningSessionManagers: () => (/* binding */ RunningSessionManagers),
/* harmony export */   RunningSessions: () => (/* binding */ RunningSessions),
/* harmony export */   SearchableSessions: () => (/* binding */ SearchableSessions),
/* harmony export */   SearchableSessionsList: () => (/* binding */ SearchableSessionsList)
/* harmony export */ });
/* harmony import */ var _jupyter_react_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75816);
/* harmony import */ var _jupyter_react_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyter_react_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(61533);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19451);
/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_domutils__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(78156);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module running
 */










/**
 * The class name added to a running widget.
 */
const RUNNING_CLASS = 'jp-RunningSessions';
/**
 * The class name added to a searchable widget.
 */
const SEARCHABLE_CLASS = 'jp-SearchableSessions';
/**
 * The class name added to the running terminal sessions section.
 */
const SECTION_CLASS = 'jp-RunningSessions-section';
/**
 * The class name added to a section container.
 */
const CONTAINER_CLASS = 'jp-RunningSessions-sectionContainer';
/**
 * The class name added to the running sessions items.
 */
const ITEM_CLASS = 'jp-RunningSessions-item';
/**
 * The class name added to a running session item label.
 */
const ITEM_LABEL_CLASS = 'jp-RunningSessions-itemLabel';
/**
 * The class name added to a running session item detail.
 */
const ITEM_DETAIL_CLASS = 'jp-RunningSessions-itemDetail';
/**
 * The class name added to a running session item shutdown button.
 */
const SHUTDOWN_BUTTON_CLASS = 'jp-RunningSessions-itemShutdown';
/**
 * The class name added to a running session item shutdown button.
 */
const SHUTDOWN_ALL_BUTTON_CLASS = 'jp-RunningSessions-shutdownAll';
/**
 * The class name added to icons.
 */
const ITEM_ICON_CLASS = 'jp-RunningSessions-icon';
/**
 * Modifier added to a section when flattened list view is requested.
 */
const LIST_VIEW_CLASS = 'jp-mod-running-list-view';
/**
 * The class name added to button switching between nested and flat view.
 */
const VIEW_BUTTON_CLASS = 'jp-RunningSessions-viewButton';
/**
 * The class name added to button switching between nested and flat view.
 */
const COLLAPSE_EXPAND_BUTTON_CLASS = 'jp-RunningSessions-collapseButton';
/**
 * Identifier used in the state database.
 */
const STATE_DB_ID = 'jp-running-sessions';
/**
 * The running sessions managers token.
 */
const IRunningSessionManagers = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.Token('@jupyterlab/running:IRunningSessionManagers', 'A service to add running session managers.');
/**
 * The running sessions token.
 */
const IRunningSessionSidebar = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.Token('@jupyterlab/running:IRunningSessionsSidebar', 'A token allowing to modify the running sessions sidebar.');
class RunningSessionManagers {
    constructor() {
        this._added = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);
        this._managers = [];
    }
    /**
     * Signal emitted when a new manager is added.
     */
    get added() {
        return this._added;
    }
    /**
     * Add a running item manager.
     *
     * @param manager - The running item manager.
     *
     */
    add(manager) {
        this._managers.push(manager);
        this._added.emit(manager);
        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_5__.DisposableDelegate(() => {
            const i = this._managers.indexOf(manager);
            if (i > -1) {
                this._managers.splice(i, 1);
            }
        });
    }
    /**
     * Return an iterator of launcher items.
     */
    items() {
        return this._managers;
    }
}
function Item(props) {
    var _a, _b;
    const { runningItem } = props;
    const [collapsed, setCollapsed] = react__WEBPACK_IMPORTED_MODULE_9___default().useState(false);
    // Use a ref instead of a state because the state does not have the time
    // to update in the callbacks
    const shuttingDown = (0,react__WEBPACK_IMPORTED_MODULE_9__.useRef)(false);
    const classList = [ITEM_CLASS];
    const detail = (_a = runningItem.detail) === null || _a === void 0 ? void 0 : _a.call(runningItem);
    const icon = runningItem.icon();
    const title = runningItem.labelTitle ? runningItem.labelTitle() : '';
    const translator = props.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;
    const trans = translator.load('jupyterlab');
    // Handle shutdown requests.
    const shutdownItemIcon = props.shutdownItemIcon || _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.closeIcon;
    const shutdownLabel = (_b = (typeof props.shutdownLabel === 'function'
        ? props.shutdownLabel(runningItem)
        : props.shutdownLabel)) !== null && _b !== void 0 ? _b : trans.__('Shut Down');
    const shutdown = (0,react__WEBPACK_IMPORTED_MODULE_9__.useCallback)((event) => {
        var _a;
        shuttingDown.current = true;
        event.preventDefault();
        (_a = runningItem.shutdown) === null || _a === void 0 ? void 0 : _a.call(runningItem);
    }, [runningItem, shuttingDown]);
    // Materialise getter to avoid triggering it repeatedly
    const children = runningItem.children;
    // Manage collapsed state. Use the shutdown flag in lieu of `stopPropagation`.
    const collapsible = !!(children === null || children === void 0 ? void 0 : children.length);
    const onClick = (0,react__WEBPACK_IMPORTED_MODULE_9__.useCallback)((event) => {
        if (shuttingDown.current) {
            return;
        }
        const item = (0,_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.getTreeItemElement)(event.target);
        if (event.currentTarget !== item) {
            return;
        }
        if (collapsible) {
            setCollapsed(!collapsed);
        }
    }, [collapsible, collapsed, shuttingDown]);
    // Listen to signal to collapse from outside
    props.collapseToggled.connect((_emitter, newCollapseState) => setCollapsed(newCollapseState));
    if (runningItem.className) {
        classList.push(runningItem.className);
    }
    return (react__WEBPACK_IMPORTED_MODULE_9___default().createElement((react__WEBPACK_IMPORTED_MODULE_9___default().Fragment), null,
        react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_jupyter_react_components__WEBPACK_IMPORTED_MODULE_0__.TreeItem, { className: `${classList.join(' ')} jp-TreeItem nested`, onClick: onClick, "data-context": runningItem.context || '', expanded: !collapsed },
            icon ? (typeof icon === 'string' ? (react__WEBPACK_IMPORTED_MODULE_9___default().createElement("img", { src: icon, className: ITEM_ICON_CLASS, slot: "start" })) : (react__WEBPACK_IMPORTED_MODULE_9___default().createElement(icon.react, { slot: "start", tag: "span", className: ITEM_ICON_CLASS }))) : undefined,
            react__WEBPACK_IMPORTED_MODULE_9___default().createElement("span", { className: ITEM_LABEL_CLASS, title: title, onClick: runningItem.open && (() => runningItem.open()) }, runningItem.label()),
            detail && react__WEBPACK_IMPORTED_MODULE_9___default().createElement("span", { className: ITEM_DETAIL_CLASS }, detail),
            runningItem.shutdown && (react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_jupyter_react_components__WEBPACK_IMPORTED_MODULE_0__.Button, { appearance: "stealth", className: SHUTDOWN_BUTTON_CLASS, onClick: shutdown, title: shutdownLabel, slot: "end" },
                react__WEBPACK_IMPORTED_MODULE_9___default().createElement(shutdownItemIcon.react, { tag: null }))),
            children && (react__WEBPACK_IMPORTED_MODULE_9___default().createElement(List, { runningItems: children, shutdownItemIcon: shutdownItemIcon, translator: translator, collapseToggled: props.collapseToggled })))));
}
function List(props) {
    const filter = props.filter;
    const items = filter
        ? props.runningItems
            .map(item => {
            return {
                item,
                score: filter(item)
            };
        })
            .filter(({ score }) => score !== null)
            .sort((a, b) => {
            return a.score.score - b.score.score;
        })
            .map(({ item }) => item)
        : props.runningItems;
    return (react__WEBPACK_IMPORTED_MODULE_9___default().createElement((react__WEBPACK_IMPORTED_MODULE_9___default().Fragment), null, items.map((item, i) => (react__WEBPACK_IMPORTED_MODULE_9___default().createElement(Item, { child: props.child, key: i, runningItem: item, shutdownLabel: props.shutdownLabel, shutdownItemIcon: props.shutdownItemIcon, translator: props.translator, collapseToggled: props.collapseToggled })))));
}
class FilterWidget extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ReactWidget {
    constructor(translator) {
        super();
        this._filterFn = (_) => {
            return { score: 0 };
        };
        this._filterChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);
        this.filter = this.filter.bind(this);
        this._updateFilter = this._updateFilter.bind(this);
        this._trans = translator.load('jupyterlab');
        this.addClass('jp-SearchableSessions-filter');
    }
    get filterChanged() {
        return this._filterChanged;
    }
    render() {
        return (react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.FilterBox, { placeholder: this._trans.__('Search'), updateFilter: this._updateFilter, useFuzzyFilter: false, caseSensitive: false }));
    }
    filter(item) {
        var _a;
        const labels = [this._getTextContent(item.label())];
        for (const child of (_a = item.children) !== null && _a !== void 0 ? _a : []) {
            labels.push(this._getTextContent(child.label()));
        }
        return this._filterFn(labels.join(' '));
    }
    _getTextContent(node) {
        if (typeof node === 'string') {
            return node;
        }
        if (typeof node === 'number') {
            return '' + node;
        }
        if (typeof node === 'boolean') {
            return '' + node;
        }
        if (Array.isArray(node)) {
            return node.map(n => this._getTextContent(n)).join(' ');
        }
        if (node && (0,react__WEBPACK_IMPORTED_MODULE_9__.isValidElement)(node)) {
            return node.props.children
                .map((n) => this._getTextContent(n))
                .join(' ');
        }
        return '';
    }
    _updateFilter(filterFn) {
        this._filterFn = filterFn;
        this._filterChanged.emit();
    }
}
class ListWidget extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ReactWidget {
    constructor(_options) {
        super();
        this._options = _options;
        this._update = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);
        _options.manager.runningChanged.connect(this._emitUpdate, this);
        if (_options.filterProvider) {
            _options.filterProvider.filterChanged.connect(this._emitUpdate, this);
        }
    }
    /**
     * Whether the items are displayed as a tree view
     * or a flat list.
     */
    get mode() {
        return this._mode;
    }
    set mode(v) {
        if (this._mode !== v) {
            this._mode = v;
            this._update.emit();
        }
    }
    dispose() {
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal.clearData(this);
        super.dispose();
    }
    onBeforeShow(msg) {
        super.onBeforeShow(msg);
        this._update.emit();
    }
    render() {
        const options = this._options;
        let cached = true;
        return (react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.UseSignal, { signal: this._update }, () => {
            var _a;
            // Cache the running items for the initial load and request from
            // the service every subsequent load.
            if (cached) {
                cached = false;
            }
            else {
                options.runningItems = options.manager.running({ mode: this.mode });
            }
            const classes = ['jp-TreeView'];
            if (this.mode === 'list') {
                classes.push('jp-mod-flat');
            }
            return (react__WEBPACK_IMPORTED_MODULE_9___default().createElement("div", { className: CONTAINER_CLASS },
                react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_jupyter_react_components__WEBPACK_IMPORTED_MODULE_0__.TreeView, { className: classes.join(' ') },
                    react__WEBPACK_IMPORTED_MODULE_9___default().createElement(List, { runningItems: options.runningItems, shutdownLabel: options.manager.shutdownLabel, shutdownItemIcon: options.manager.shutdownItemIcon, filter: (_a = options.filterProvider) === null || _a === void 0 ? void 0 : _a.filter, translator: options.translator, collapseToggled: options.collapseToggled }))));
        }));
    }
    _emitUpdate() {
        if (!this.isVisible) {
            return;
        }
        this._update.emit();
    }
}
/**
 * The Section component contains the shared look and feel for an interactive
 * list of kernels and sessions.
 *
 * It is specialized for each based on its props.
 */
class Section extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.PanelWithToolbar {
    constructor(options) {
        var _a;
        super();
        this._buttons = null;
        this._listView = false;
        this._collapseToggled = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);
        this._viewChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);
        this._listView = ((_a = options.viewMode) !== null && _a !== void 0 ? _a : 'tree') === 'list';
        this._manager = options.manager;
        this._filterProvider = options.filterProvider;
        const translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;
        this._trans = translator.load('jupyterlab');
        this.addClass(SECTION_CLASS);
        this.title.label = options.manager.name;
        this._manager.runningChanged.connect(this._onListChanged, this);
        if (options.filterProvider) {
            options.filterProvider.filterChanged.connect(this._onListChanged, this);
        }
        this._updateEmptyClass();
        const runningItems = options.manager.running({
            mode: options.manager.supportsMultipleViews && !this._listView
                ? 'tree'
                : 'list'
        });
        if (options.showToolbar !== false) {
            this._initializeToolbar(runningItems);
        }
        this._listWidget = new ListWidget({
            runningItems,
            collapseToggled: this._collapseToggled,
            ...options
        });
        this._listWidget.mode =
            options.manager.supportsMultipleViews && !this._listView
                ? 'tree'
                : 'list';
        this.addWidget(this._listWidget);
    }
    /**
     * Toggle between list and tree view.
     */
    toggleListView(forceOn) {
        const newState = typeof forceOn !== 'undefined' ? forceOn : !this._listView;
        this._listView = newState;
        if (this._buttons) {
            const switchViewButton = this._buttons['switch-view'];
            switchViewButton.pressed = newState;
        }
        this._collapseToggled.emit(false);
        if (this._manager.supportsMultipleViews === undefined) {
            this.toggleClass(LIST_VIEW_CLASS, newState);
        }
        this._updateButtons();
        this._listWidget.mode =
            this._manager.supportsMultipleViews && !this._listView ? 'tree' : 'list';
        this._viewChanged.emit({ mode: newState ? 'list' : 'tree' });
    }
    /**
     * Dispose the resources held by the widget
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal.clearData(this);
        super.dispose();
    }
    get _shutdownAllLabel() {
        return this._manager.shutdownAllLabel || this._trans.__('Shut Down All');
    }
    _initializeToolbar(runningItems) {
        const enabled = runningItems.length > 0;
        const shutdownAllLabel = this._shutdownAllLabel;
        const shutdownTitle = `${shutdownAllLabel}?`;
        const onShutdown = () => {
            var _a;
            const shutdownAllConfirmationText = (_a = (typeof this._manager.shutdownAllConfirmationText === 'function'
                ? this._manager.shutdownAllConfirmationText()
                : this._manager.shutdownAllConfirmationText)) !== null && _a !== void 0 ? _a : `${shutdownAllLabel} ${this._manager.name}`;
            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
                title: shutdownTitle,
                body: shutdownAllConfirmationText,
                buttons: [
                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton(),
                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.warnButton({ label: shutdownAllLabel })
                ]
            }).then(result => {
                if (result.button.accept) {
                    this._manager.shutdownAll();
                }
            });
        };
        const shutdownAllButton = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton({
            label: shutdownAllLabel,
            className: `${SHUTDOWN_ALL_BUTTON_CLASS}${!enabled ? ' jp-mod-disabled' : ''}`,
            enabled,
            onClick: onShutdown.bind(this)
        });
        const switchViewButton = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton({
            className: VIEW_BUTTON_CLASS,
            enabled,
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.tableRowsIcon,
            pressedIcon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.treeViewIcon,
            onClick: () => this.toggleListView(),
            tooltip: this._trans.__('Switch to List View'),
            pressedTooltip: this._trans.__('Switch to Tree View')
        });
        const collapseExpandAllButton = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton({
            className: COLLAPSE_EXPAND_BUTTON_CLASS,
            enabled,
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.collapseAllIcon,
            pressedIcon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.expandAllIcon,
            onClick: () => {
                const newState = !collapseExpandAllButton.pressed;
                this._collapseToggled.emit(newState);
                collapseExpandAllButton.pressed = newState;
            },
            tooltip: this._trans.__('Collapse All'),
            pressedTooltip: this._trans.__('Expand All')
        });
        this._buttons = {
            'switch-view': switchViewButton,
            'collapse-expand': collapseExpandAllButton,
            'shutdown-all': shutdownAllButton
        };
        // Update buttons once defined and before adding to DOM
        this._updateButtons();
        this._manager.runningChanged.connect(this._updateButtons, this);
        // Add manager-specific buttons
        if (this._manager.toolbarButtons) {
            this._manager.toolbarButtons.forEach(button => this.toolbar.addItem(button instanceof _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.CommandToolbarButton ? button.commandId : button.id, button));
        }
        for (const name of ['collapse-expand', 'switch-view', 'shutdown-all']) {
            this.toolbar.addItem(name, this._buttons[name]);
        }
        this.toolbar.addClass('jp-RunningSessions-toolbar');
        this._toolbar.node.setAttribute('aria-label', this._trans.__('%1 toolbar', this.title.label));
    }
    _onListChanged() {
        this._updateButtons();
        this._updateEmptyClass();
    }
    _updateEmptyClass() {
        if (this._filterProvider) {
            const items = this._manager
                .running({
                mode: this._manager.supportsMultipleViews && !this._listView
                    ? 'tree'
                    : 'list'
            })
                .filter(this._filterProvider.filter);
            const empty = items.length === 0;
            if (empty) {
                this.node.classList.toggle('jp-mod-empty', true);
            }
            else {
                this.node.classList.toggle('jp-mod-empty', false);
            }
        }
    }
    get viewChanged() {
        return this._viewChanged;
    }
    _updateButtons() {
        if (!this._buttons) {
            return;
        }
        let runningItems = this._manager.running({
            mode: this._manager.supportsMultipleViews && !this._listView ? 'tree' : 'list'
        });
        const enabled = runningItems.length > 0;
        const hasNesting = 
        // If the flag is undefined fallback to the old behavior
        // @deprecated we should remove the fallback in the next iteration
        this._manager.supportsMultipleViews === undefined
            ? runningItems.filter(item => item.children).length !== 0
            : this._manager.supportsMultipleViews;
        const inTreeView = hasNesting && !this._buttons['switch-view'].pressed;
        this._buttons['switch-view'].node.style.display = hasNesting
            ? 'flex'
            : 'none';
        this._buttons['collapse-expand'].node.style.display = inTreeView
            ? 'flex'
            : 'none';
        this._buttons['collapse-expand'].enabled = enabled;
        this._buttons['switch-view'].enabled = enabled;
        this._buttons['shutdown-all'].enabled = enabled;
    }
}
/**
 * A class that exposes the running terminal and kernel sessions.
 */
class RunningSessions extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.SidePanel {
    /**
     * Construct a new running widget.
     */
    constructor(managers, translator, stateDB) {
        super();
        this.managers = managers;
        this._stateDB = stateDB !== null && stateDB !== void 0 ? stateDB : null;
        this.translator = translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;
        const trans = this.translator.load('jupyterlab');
        this.addClass(RUNNING_CLASS);
        this.toolbar.addItem('refresh', new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton({
            tooltip: trans.__('Refresh List'),
            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_3__.refreshIcon,
            onClick: () => managers.items().forEach(manager => manager.refreshRunning())
        }));
        managers.items().forEach(manager => this.addSection(managers, manager));
        managers.added.connect(this.addSection, this);
    }
    /**
     * Dispose the resources held by the widget
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.managers.added.disconnect(this.addSection, this);
        super.dispose();
    }
    /**
     * Add a section for a new manager.
     *
     * @param managers Managers
     * @param manager New manager
     */
    async addSection(managers, manager) {
        const section = new Section({ manager, translator: this.translator });
        this.addWidget(section);
        const state = await this._getState();
        const sectionsInListView = state.listViewSections;
        const sectionId = manager.name;
        if (sectionsInListView && sectionsInListView.includes(sectionId)) {
            section.toggleListView(true);
        }
        section.viewChanged.connect(async (_emitter, viewState) => {
            await this._updateState(sectionId, viewState.mode);
        });
    }
    /**
     * Update state database with the new state of a given section.
     */
    async _updateState(sectionId, mode) {
        var _a;
        const state = await this._getState();
        let listViewSections = (_a = state.listViewSections) !== null && _a !== void 0 ? _a : [];
        if (mode === 'list' && !listViewSections.includes(sectionId)) {
            listViewSections.push(sectionId);
        }
        else {
            listViewSections = listViewSections.filter(e => e !== sectionId);
        }
        const newState = { listViewSections };
        if (this._stateDB) {
            await this._stateDB.save(STATE_DB_ID, newState);
        }
    }
    /**
     * Get current state from the state database.
     */
    async _getState() {
        var _a;
        if (!this._stateDB) {
            return {};
        }
        return ((_a = (await this._stateDB.fetch(STATE_DB_ID))) !== null && _a !== void 0 ? _a : {});
    }
}
/**
 * Section but rendering its own title before the content
 */
class TitledSection extends Section {
    constructor(options) {
        super(options);
        const titleNode = document.createElement('h3');
        titleNode.className = 'jp-SearchableSessions-title';
        const label = titleNode.appendChild(document.createElement('span'));
        label.className = 'jp-SearchableSessions-titleLabel';
        label.textContent = this.title.label;
        this.node.insertAdjacentElement('afterbegin', titleNode);
    }
}
class EmptyIndicator extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__.Widget {
    constructor(translator) {
        super();
        const trans = translator.load('jupyterlab');
        this.addClass('jp-SearchableSessions-emptyIndicator');
        this.node.textContent = trans.__('No matches');
    }
}
/**
 * A panel intended for use within `Dialog` to allow searching tabs and running sessions.
 */
class SearchableSessions extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__.Panel {
    constructor(managers, translator) {
        super();
        this._activeIndex = 0;
        this._translator = translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;
        this.addClass(RUNNING_CLASS);
        this.addClass(SEARCHABLE_CLASS);
        this._filterWidget = new FilterWidget(this._translator);
        this.addWidget(this._filterWidget);
        this._list = new SearchableSessionsList(managers, this._filterWidget, translator);
        this.addWidget(this._list);
        this._filterWidget.filterChanged.connect(() => {
            this._activeIndex = 0;
            this._updateActive(0);
        }, this);
    }
    /**
     * Dispose the resources held by the widget
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal.clearData(this);
        super.dispose();
    }
    /**
     * Click active element when the user confirmed the choice in the dialog.
     */
    getValue() {
        const items = [
            ...this.node.querySelectorAll('.' + ITEM_LABEL_CLASS)
        ];
        const pos = Math.min(Math.max(this._activeIndex, 0), items.length - 1);
        items[pos].click();
    }
    /**
     * Handle incoming events.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'keydown':
                this._evtKeydown(event);
                break;
        }
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(_) {
        this._forceFocusInput();
        this.node.addEventListener('keydown', this);
        setTimeout(() => {
            this._updateActive(0);
        }, 0);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(_) {
        this.node.removeEventListener('keydown', this);
    }
    /**
     * Force focus on the filter input.
     *
     * Note: forces focus because this widget is intended to be used in `Dialog`,
     * which does not support focusing React widget nested within a non-React
     * widget (a limitation of `focusNodeSelector` option implementation).
     */
    _forceFocusInput() {
        var _a;
        (_a = this._filterWidget.renderPromise) === null || _a === void 0 ? void 0 : _a.then(() => {
            var _a;
            const jpSearch = this._filterWidget.node.querySelector('jp-search');
            const input = (_a = jpSearch === null || jpSearch === void 0 ? void 0 : jpSearch.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input');
            if (!input) {
                console.warn('Input element not found, cannot focus');
                return;
            }
            input.focus();
        }).catch(console.warn);
    }
    /**
     * Navigate between items using up/down keys by shifting focus.
     */
    _evtKeydown(event) {
        if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
            const direction = event.key === 'ArrowDown' ? +1 : -1;
            const wasSet = this._updateActive(direction);
            if (wasSet) {
                event.preventDefault();
            }
        }
    }
    /**
     * Set and mark active item relative to the current.
     *
     * Returns whether an active item was set.
     */
    _updateActive(direction) {
        const items = [...this.node.querySelectorAll('.' + ITEM_CLASS)].filter(e => e.checkVisibility());
        if (!items.length) {
            return false;
        }
        for (const item of items) {
            if (item.classList.contains('jp-mod-active')) {
                item.classList.toggle('jp-mod-active', false);
            }
        }
        const currentIndex = this._activeIndex;
        let newIndex = null;
        if (currentIndex === -1) {
            // First or last
            newIndex = direction === +1 ? 0 : items.length - 1;
        }
        else {
            newIndex = Math.min(Math.max(currentIndex + direction, 0), items.length - 1);
        }
        if (newIndex !== null) {
            items[newIndex].classList.add('jp-mod-active');
            _lumino_domutils__WEBPACK_IMPORTED_MODULE_6__.ElementExt.scrollIntoViewIfNeeded(this._list.node, items[newIndex]);
            this._activeIndex = newIndex;
            return true;
        }
        return false;
    }
}
/**
 * A panel list of searchable sessions.
 */
class SearchableSessionsList extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__.Panel {
    constructor(managers, filterWidget, translator) {
        super();
        this._managers = managers;
        this._translator = translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;
        this._filterWidget = filterWidget;
        this.addClass('jp-SearchableSessions-list');
        this._emptyIndicator = new EmptyIndicator(this._translator);
        this.addWidget(this._emptyIndicator);
        managers.items().forEach(manager => this.addSection(managers, manager));
        managers.added.connect(this.addSection, this);
    }
    /**
     * Dispose the resources held by the widget
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._managers.added.disconnect(this.addSection, this);
        super.dispose();
    }
    /**
     * Add a section for a new manager.
     *
     * @param managers Managers
     * @param manager New manager
     */
    addSection(managers, manager) {
        const section = new TitledSection({
            manager,
            translator: this._translator,
            showToolbar: false,
            filterProvider: this._filterWidget,
            viewMode: 'list'
        });
        // Do not use tree view in searchable list
        section.toggleListView(true);
        this.addWidget(section);
        // Move empty indicator to the end
        this.addWidget(this._emptyIndicator);
    }
}
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 37133:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/running/style/base.css
var base = __webpack_require__(21230);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/running/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/running/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 58738:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37253);
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module services-extension
 */

/**
 * Config section manager plugin.
 */
const configSectionManager = {
    id: '@jupyterlab/services-extension:config-section-manager',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConfigSectionManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings],
    description: 'Provides the config section manager.',
    activate: (_, serverSettings) => {
        const manager = new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ConfigSectionManager({ serverSettings });
        // Set the config section manager for the global ConfigSection.
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ConfigSection._setConfigSectionManager(manager);
        return manager;
    }
};
/**
 * The default connection status provider.
 */
const connectionStatusPlugin = {
    id: '@jupyterlab/services-extension:connection-status',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus,
    description: 'Provides the default connection status.',
    activate: () => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ConnectionStatus();
    }
};
/**
 * The default contents manager plugin.
 */
const contentsManagerPlugin = {
    id: '@jupyterlab/services-extension:contents-manager',
    description: 'The default contents manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IContentsManager,
    requires: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IDefaultDrive, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings],
    activate: (_, defaultDrive, serverSettings) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ContentsManager({
            defaultDrive,
            serverSettings
        });
    }
};
/**
 * The default IContentProvider plugin.
 */
const defaultContentProvider = {
    id: '@jupyterlab/services-extension:default-content-provider',
    description: 'The default content provider for the contents manager.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IDefaultContentProvider,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings],
    activate: (_, serverSettings) => {
        const apiEndpoint = 'api/contents';
        serverSettings = serverSettings !== null && serverSettings !== void 0 ? serverSettings : _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ServerConnection.makeSettings();
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.RestContentProvider({ serverSettings, apiEndpoint });
    }
};
/**
 * Content provider plugin warning
 *
 * A plugin that errors out if users are overwritting the deprecated defaultContentProvider
 */
const contentProviderWarning = {
    id: '@jupyterlab/services-extension:content-provider-warning',
    description: 'Warn if user is overwriting the deprecated contentprovider plugin.',
    autoStart: true,
    requires: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IDefaultContentProvider],
    activate: (_, contentProvider) => {
        if (!(contentProvider instanceof _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.RestContentProvider)) {
            console.error('Defining a IDefaultContentProvider plugin is deprecated since JupyterLab 4.5.1 and does not be have any effect.');
        }
    }
};
/**
 * The default drive plugin.
 */
const defaultDrivePlugin = {
    id: '@jupyterlab/services-extension:default-drive',
    description: 'The default drive for the contents manager.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IDefaultDrive,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings],
    activate: (_, serverSettings) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.Drive({ serverSettings: serverSettings !== null && serverSettings !== void 0 ? serverSettings : undefined });
    }
};
/**
 * The event manager plugin.
 */
const eventManagerPlugin = {
    id: '@jupyterlab/services-extension:event-manager',
    description: 'The event manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IEventManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus],
    activate: (_, serverSettings, connectionStatus) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.EventManager({
            serverSettings,
            standby: () => {
                return !(connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.isConnected) || 'when-hidden';
            }
        });
    }
};
/**
 * The kernel manager plugin.
 */
const kernelManagerPlugin = {
    id: '@jupyterlab/services-extension:kernel-manager',
    description: 'The kernel manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IKernelManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus],
    activate: (_, serverSettings, connectionStatus) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.KernelManager({
            serverSettings,
            standby: () => {
                return !(connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.isConnected) || 'when-hidden';
            }
        });
    }
};
/**
 * The kernel spec manager plugin.
 */
const kernelSpecManagerPlugin = {
    id: '@jupyterlab/services-extension:kernel-spec-manager',
    description: 'The kernel spec manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IKernelSpecManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus],
    activate: (_, serverSettings, connectionStatus) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.KernelSpecManager({
            serverSettings,
            standby: () => {
                return !(connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.isConnected) || 'when-hidden';
            }
        });
    }
};
/**
 * The nbconvert manager plugin.
 */
const nbConvertManagerPlugin = {
    id: '@jupyterlab/services-extension:nbconvert-manager',
    description: 'The nbconvert manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.INbConvertManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings],
    activate: (_, serverSettings) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.NbConvertManager({ serverSettings });
    }
};
/**
 * The session manager plugin.
 */
const sessionManagerPlugin = {
    id: '@jupyterlab/services-extension:session-manager',
    description: 'The session manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ISessionManager,
    requires: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IKernelManager],
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus],
    activate: (_, kernelManager, serverSettings, connectionStatus) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.SessionManager({
            kernelManager,
            serverSettings,
            standby: () => {
                return !(connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.isConnected) || 'when-hidden';
            }
        });
    }
};
/**
 * The setting manager plugin.
 */
const settingManagerPlugin = {
    id: '@jupyterlab/services-extension:setting-manager',
    description: 'The setting manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ISettingManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings],
    activate: (_, serverSettings) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.SettingManager({ serverSettings });
    }
};
/**
 * The terminal manager plugin.
 */
const terminalManagerPlugin = {
    id: '@jupyterlab/services-extension:terminal-manager',
    description: 'The terminal manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ITerminalManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus],
    activate: (_, serverSettings, connectionStatus) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.TerminalManager({
            serverSettings,
            standby: () => {
                return !(connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.isConnected) || 'when-hidden';
            }
        });
    }
};
/**
 * The user manager plugin.
 */
const userManagerPlugin = {
    id: '@jupyterlab/services-extension:user-manager',
    description: 'The user manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IUserManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus],
    activate: (_, serverSettings, connectionStatus) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.UserManager({
            serverSettings,
            standby: () => {
                return !(connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.isConnected) || 'when-hidden';
            }
        });
    }
};
/**
 * The workspace manager plugin.
 */
const workspaceManagerPlugin = {
    id: '@jupyterlab/services-extension:workspace-manager',
    description: 'The workspace manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IWorkspaceManager,
    optional: [_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings],
    activate: (_, serverSettings) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.WorkspaceManager({ serverSettings });
    }
};
/**
 * The default server settings plugin.
 */
const serverSettingsPlugin = {
    id: '@jupyterlab/services-extension:server-settings',
    description: 'The default server settings plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings,
    activate: (_) => {
        return _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ServerConnection.makeSettings();
    }
};
/**
 * Instantiate a new service manager.
 */
const serviceManagerPlugin = {
    id: '@jupyterlab/services-extension:service-manager',
    description: 'The default service manager plugin.',
    autoStart: true,
    provides: _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServiceManager,
    // Builder is not exposed as a plugin since it is now deprecated.
    optional: [
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IConnectionStatus,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IContentsManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IDefaultDrive,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IServerSettings,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IEventManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IKernelManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IKernelSpecManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.INbConvertManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ISessionManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ISettingManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ITerminalManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IUserManager,
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.IWorkspaceManager
    ],
    activate: (_, connectionStatus, contents, defaultDrive, serverSettings, events, kernels, kernelspecs, nbconvert, sessions, settings, terminals, user, workspaces) => {
        return new _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.ServiceManager({
            standby: () => {
                return !(connectionStatus === null || connectionStatus === void 0 ? void 0 : connectionStatus.isConnected) || 'when-hidden';
            },
            contents,
            defaultDrive,
            serverSettings,
            events,
            kernels,
            kernelspecs,
            nbconvert,
            sessions,
            settings,
            terminals,
            user,
            workspaces
        });
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([
    configSectionManager,
    connectionStatusPlugin,
    contentsManagerPlugin,
    defaultContentProvider,
    contentProviderWarning,
    defaultDrivePlugin,
    eventManagerPlugin,
    kernelManagerPlugin,
    kernelSpecManagerPlugin,
    nbConvertManagerPlugin,
    sessionManagerPlugin,
    settingManagerPlugin,
    serverSettingsPlugin,
    serviceManagerPlugin,
    terminalManagerPlugin,
    userManagerPlugin,
    workspaceManagerPlugin
]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 78037:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.BaseManager = void 0;
const signaling_1 = __webpack_require__(46257);
const serverconnection_1 = __webpack_require__(43851);
class BaseManager {
    constructor(options) {
        var _a;
        this._isDisposed = false;
        this._disposed = new signaling_1.Signal(this);
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * A signal emitted when the delegate is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Test whether the delegate has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Whether the manager is active.
     */
    get isActive() {
        return true;
    }
    /**
     * Dispose of the delegate and invoke the callback function.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._disposed.emit(undefined);
        signaling_1.Signal.clearData(this);
    }
}
exports.BaseManager = BaseManager;
//# sourceMappingURL=basemanager.js.map

/***/ }),

/***/ 76418:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.BuildManager = void 0;
const coreutils_1 = __webpack_require__(4666);
const serverconnection_1 = __webpack_require__(43851);
/**
 * The url for the lab build service.
 */
const BUILD_SETTINGS_URL = 'api/build';
/**
 * The build API service manager.
 */
class BuildManager {
    /**
     * Create a new setting manager.
     */
    constructor(options = {}) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * Test whether the build service is available.
     */
    get isAvailable() {
        return coreutils_1.PageConfig.getOption('buildAvailable').toLowerCase() === 'true';
    }
    /**
     * Test whether to check build status automatically.
     */
    get shouldCheck() {
        return coreutils_1.PageConfig.getOption('buildCheck').toLowerCase() === 'true';
    }
    /**
     * Get whether the application should be built.
     */
    getStatus() {
        const { _url, serverSettings } = this;
        const promise = serverconnection_1.ServerConnection.makeRequest(_url, {}, serverSettings);
        return promise
            .then(response => {
            if (response.status !== 200) {
                throw new serverconnection_1.ServerConnection.ResponseError(response);
            }
            return response.json();
        })
            .then(data => {
            if (typeof data.status !== 'string') {
                throw new Error('Invalid data');
            }
            if (typeof data.message !== 'string') {
                throw new Error('Invalid data');
            }
            return data;
        });
    }
    /**
     * Build the application.
     */
    build() {
        const { _url, serverSettings } = this;
        const init = { method: 'POST' };
        const promise = serverconnection_1.ServerConnection.makeRequest(_url, init, serverSettings);
        return promise.then(response => {
            if (response.status === 400) {
                throw new serverconnection_1.ServerConnection.ResponseError(response, 'Build aborted');
            }
            if (response.status !== 200) {
                const message = `Build failed with ${response.status}.

        If you are experiencing the build failure after installing an extension (or trying to include previously installed extension after updating JupyterLab) please check the extension repository for new installation instructions as many extensions migrated to the prebuilt extensions system which no longer requires rebuilding JupyterLab (but uses a different installation procedure, typically involving a package manager such as 'pip' or 'conda').

        If you specifically intended to install a source extension, please run 'jupyter lab build' on the server for full output.`;
                throw new serverconnection_1.ServerConnection.ResponseError(response, message);
            }
        });
    }
    /**
     * Cancel an active build.
     */
    cancel() {
        const { _url, serverSettings } = this;
        const init = { method: 'DELETE' };
        const promise = serverconnection_1.ServerConnection.makeRequest(_url, init, serverSettings);
        return promise.then(response => {
            if (response.status !== 204) {
                throw new serverconnection_1.ServerConnection.ResponseError(response);
            }
        });
    }
    /**
     * Get the build API URL.
     */
    get _url() {
        const { baseUrl, appUrl } = this.serverSettings;
        return coreutils_1.URLExt.join(baseUrl, appUrl, BUILD_SETTINGS_URL);
    }
}
exports.BuildManager = BuildManager;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 34027:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ConfigWithDefaults = exports.ConfigSection = exports.ConfigSectionManager = void 0;
const coreutils_1 = __webpack_require__(4666);
const __1 = __webpack_require__(83676);
/**
 * The url for the config service.
 */
const SERVICE_CONFIG_URL = 'api/config';
/**
 * A manager for config sections.
 */
class ConfigSectionManager {
    /**
     * Create a config section manager.
     */
    constructor(options) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();
    }
    /**
     * Create a config section.
     */
    async create(options) {
        const section = new DefaultConfigSection({
            ...options,
            serverSettings: this.serverSettings
        });
        await section.load();
        return section;
    }
}
exports.ConfigSectionManager = ConfigSectionManager;
/**
 * The namespace for ConfigSection statics.
 */
var ConfigSection;
(function (ConfigSection) {
    /**
     * Create a config section.
     *
     * @returns A Promise that is fulfilled with the config section is loaded.
     *
     * @deprecated Creating a config section via the `ConfigSection.create()` global has been deprecated and may be removed in a future version.
     * Instead, require the config section manager via the `IConfigSectionManager` token in a plugin.
     */
    async function create(options) {
        if (!_configSectionManager) {
            const section = new DefaultConfigSection(options);
            await section.load();
            return section;
        }
        const section = await _configSectionManager.create(options);
        return section;
    }
    ConfigSection.create = create;
    let _configSectionManager;
    /**
     * Internal function to set the config section manager.
     *
     * @deprecated This function is an internal helper kept for backward compatiblity.
     * It is not part of the public API and may be removed in a future version.
     */
    function _setConfigSectionManager(manager) {
        if (_configSectionManager) {
            throw new Error('ConfigSectionManager already set. If you would like to create a config section, use the `IConfigSectionManager` token in a plugin.');
        }
        _configSectionManager = manager;
    }
    ConfigSection._setConfigSectionManager = _setConfigSectionManager;
})(ConfigSection || (exports.ConfigSection = ConfigSection = {}));
/**
 * Implementation of the Configurable data section.
 */
class DefaultConfigSection {
    /**
     * Construct a new config section.
     */
    constructor(options) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();
        this._name = options.name;
    }
    /**
     * Get the data for this section.
     */
    get data() {
        return this._data;
    }
    /**
     * Load the initial data for this section.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/config).
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async load() {
        const response = await __1.ServerConnection.makeRequest(this._url, {}, this.serverSettings);
        if (response.status !== 200) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        this._data = await response.json();
    }
    /**
     * Modify the stored config values.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/config).
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     *
     * Updates the local data immediately, sends the change to the server,
     * and updates the local data with the response, and fulfils the promise
     * with that data.
     */
    async update(newdata) {
        this._data = { ...this._data, ...newdata };
        const init = {
            method: 'PATCH',
            body: JSON.stringify(newdata)
        };
        const response = await __1.ServerConnection.makeRequest(this._url, init, this.serverSettings);
        if (response.status !== 200) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        this._data = await response.json();
        return this._data;
    }
    /**
     * Get the URL for this config section.
     */
    get _url() {
        return coreutils_1.URLExt.join(this.serverSettings.baseUrl, SERVICE_CONFIG_URL, encodeURIComponent(this._name));
    }
}
/**
 * Configurable object with defaults.
 */
class ConfigWithDefaults {
    /**
     * Create a new config with defaults.
     */
    constructor(options) {
        var _a, _b;
        this._className = '';
        this._section = options.section;
        this._defaults = (_a = options.defaults) !== null && _a !== void 0 ? _a : {};
        this._className = (_b = options.className) !== null && _b !== void 0 ? _b : '';
    }
    /**
     * Get data from the config section or fall back to defaults.
     */
    get(key) {
        const data = this._classData();
        return key in data ? data[key] : this._defaults[key];
    }
    /**
     * Set a config value.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/config).
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     *
     * Sends the update to the server, and changes our local copy of the data
     * immediately.
     */
    set(key, value) {
        const d = {};
        d[key] = value;
        if (this._className) {
            const d2 = {};
            d2[this._className] = d;
            return this._section.update(d2);
        }
        else {
            return this._section.update(d);
        }
    }
    /**
     * Get data from the Section with our classname, if available.
     *
     * #### Notes
     * If we have no classname, get all of the data in the Section
     */
    _classData() {
        const data = this._section.data;
        if (this._className && this._className in data) {
            return data[this._className];
        }
        return data;
    }
}
exports.ConfigWithDefaults = ConfigWithDefaults;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 1285:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ConnectionStatus = void 0;
/**
 * Application connection status
 */
class ConnectionStatus {
    constructor() {
        /**
         * Whether the application is connected to the server or not.
         *
         * #### Notes
         *
         * Every periodic network polling should be paused while this is set
         * to `false`. Extensions should use this value to decide whether to proceed
         * with the polling.
         * The extensions may also set this value to `false` if there is no need to
         * fetch anything from the server backend basing on some conditions
         * (e.g. when an error message dialog is displayed).
         * At the same time, the extensions are responsible for setting this value
         * back to `true`.
         */
        this.isConnected = true;
    }
}
exports.ConnectionStatus = ConnectionStatus;
//# sourceMappingURL=connectionstatus.js.map

/***/ }),

/***/ 87594:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.RestContentProvider = exports.ContentProviderRegistry = exports.Drive = exports.ContentsManager = exports.Contents = void 0;
const coreutils_1 = __webpack_require__(4666);
const disposable_1 = __webpack_require__(61533);
const signaling_1 = __webpack_require__(46257);
const __1 = __webpack_require__(83676);
const validate = __importStar(__webpack_require__(36556));
/**
 * The url for the default drive service.
 */
const SERVICE_DRIVE_URL = 'api/contents';
/**
 * The url for the file access.
 */
const FILES_URL = 'files';
/**
 * A namespace for contents interfaces.
 */
var Contents;
(function (Contents) {
    /**
     * Validates an IModel, throwing an error if it does not pass.
     */
    function validateContentsModel(contents) {
        validate.validateContentsModel(contents);
    }
    Contents.validateContentsModel = validateContentsModel;
    /**
     * Validates an ICheckpointModel, throwing an error if it does not pass.
     */
    function validateCheckpointModel(checkpoint) {
        validate.validateCheckpointModel(checkpoint);
    }
    Contents.validateCheckpointModel = validateCheckpointModel;
})(Contents || (exports.Contents = Contents = {}));
/**
 * A contents manager that passes file operations to the server.
 * Multiple servers implementing the `IDrive` interface can be
 * attached to the contents manager, so that the same session can
 * perform file operations on multiple backends.
 *
 * This includes checkpointing with the normal file operations.
 */
class ContentsManager {
    /**
     * Construct a new contents manager object.
     *
     * @param options - The options used to initialize the object.
     */
    constructor(options = {}) {
        var _a, _b;
        this._isDisposed = false;
        this._additionalDrives = new Map();
        this._fileChanged = new signaling_1.Signal(this);
        const serverSettings = (this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings());
        this._defaultDrive = (_b = options.defaultDrive) !== null && _b !== void 0 ? _b : new Drive({ serverSettings });
        this._defaultDrive.fileChanged.connect(this._onFileChanged, this);
    }
    /**
     * The default drive associated with the manager.
     */
    get defaultDrive() {
        return this._defaultDrive;
    }
    /**
     * A signal emitted when a file operation takes place.
     */
    get fileChanged() {
        return this._fileChanged;
    }
    /**
     * Test whether the manager has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_1.Signal.clearData(this);
    }
    /**
     * Add an `IDrive` to the manager.
     */
    addDrive(drive) {
        this._additionalDrives.set(drive.name, drive);
        drive.fileChanged.connect(this._onFileChanged, this);
    }
    /**
     * Given a path, get a shared model factory from the relevant backend.
     * The factory defined on content provider best matching the given path
     * takes precedence over the factory defined on the drive as a whole.
     * Returns `null` if the backend does not provide one.
     */
    getSharedModelFactory(path, options) {
        var _a, _b;
        const [drive] = this._driveForPath(path);
        const provider = (_a = drive.contentProviderRegistry) === null || _a === void 0 ? void 0 : _a.getProvider(options === null || options === void 0 ? void 0 : options.contentProviderId);
        if (provider === null || provider === void 0 ? void 0 : provider.sharedModelFactory) {
            return provider.sharedModelFactory;
        }
        return (_b = drive.sharedModelFactory) !== null && _b !== void 0 ? _b : null;
    }
    /**
     * Given a path of the form `drive:local/portion/of/it.txt`
     * get the local part of it.
     *
     * @param path the path.
     *
     * @returns The local part of the path.
     */
    localPath(path) {
        const parts = path.split('/');
        const firstParts = parts[0].split(':');
        if (firstParts.length === 1 || !this._additionalDrives.has(firstParts[0])) {
            return coreutils_1.PathExt.removeSlash(path);
        }
        return coreutils_1.PathExt.join(firstParts.slice(1).join(':'), ...parts.slice(1));
    }
    /**
     * Normalize a global path. Reduces '..' and '.' parts, and removes
     * leading slashes from the local part of the path, while retaining
     * the drive name if it exists.
     *
     * @param path the path.
     *
     * @returns The normalized path.
     */
    normalize(path) {
        const parts = path.split(':');
        if (parts.length === 1) {
            return coreutils_1.PathExt.normalize(path);
        }
        return `${parts[0]}:${coreutils_1.PathExt.normalize(parts.slice(1).join(':'))}`;
    }
    /**
     * Resolve a global path, starting from the root path. Behaves like
     * posix-path.resolve, with 3 differences:
     *  - will never prepend cwd
     *  - if root has a drive name, the result is prefixed with "<drive>:"
     *  - before adding drive name, leading slashes are removed
     *
     * @param path the path.
     *
     * @returns The normalized path.
     */
    resolvePath(root, path) {
        const driveName = this.driveName(root);
        const localPath = this.localPath(root);
        const resolved = coreutils_1.PathExt.resolve('/', localPath, path);
        return driveName ? `${driveName}:${resolved}` : resolved;
    }
    /**
     * Given a path of the form `drive:local/portion/of/it.txt`
     * get the name of the drive. If the path is missing
     * a drive portion, returns an empty string.
     *
     * @param path the path.
     *
     * @returns The drive name for the path, or the empty string.
     */
    driveName(path) {
        const parts = path.split('/');
        const firstParts = parts[0].split(':');
        if (firstParts.length === 1) {
            return '';
        }
        if (this._additionalDrives.has(firstParts[0])) {
            return firstParts[0];
        }
        return '';
    }
    /**
     * Get a file or directory.
     *
     * @param path The path to the file.
     *
     * @param options The options used to fetch the file.
     *
     * @returns A promise which resolves with the file content.
     */
    get(path, options) {
        const [drive, localPath] = this._driveForPath(path);
        return drive.get(localPath, options).then(contentsModel => {
            const listing = [];
            if (contentsModel.type === 'directory' && contentsModel.content) {
                for (const item of contentsModel.content) {
                    listing.push({ ...item, path: this._toGlobalPath(drive, item.path) });
                }
                return {
                    ...contentsModel,
                    path: this._toGlobalPath(drive, localPath),
                    content: listing,
                    serverPath: contentsModel.path
                };
            }
            else {
                return {
                    ...contentsModel,
                    path: this._toGlobalPath(drive, localPath),
                    serverPath: contentsModel.path
                };
            }
        });
    }
    /**
     * Get an encoded download url given a file path.
     *
     * @param path - An absolute POSIX file path on the server.
     *
     * #### Notes
     * It is expected that the path contains no relative paths.
     *
     * The returned URL may include a query parameter.
     */
    getDownloadUrl(path) {
        const [drive, localPath] = this._driveForPath(path);
        return drive.getDownloadUrl(localPath);
    }
    /**
     * Create a new untitled file or directory in the specified directory path.
     *
     * @param options The options used to create the file.
     *
     * @returns A promise which resolves with the created file content when the
     *    file is created.
     */
    newUntitled(options = {}) {
        if (options.path) {
            const globalPath = this.normalize(options.path);
            const [drive, localPath] = this._driveForPath(globalPath);
            return drive
                .newUntitled({ ...options, path: localPath })
                .then(contentsModel => {
                return {
                    ...contentsModel,
                    path: coreutils_1.PathExt.join(globalPath, contentsModel.name),
                    serverPath: contentsModel.path
                };
            });
        }
        else {
            return this._defaultDrive.newUntitled(options);
        }
    }
    /**
     * Delete a file.
     *
     * @param path - The path to the file.
     *
     * @returns A promise which resolves when the file is deleted.
     */
    delete(path) {
        const [drive, localPath] = this._driveForPath(path);
        return drive.delete(localPath);
    }
    /**
     * Rename a file or directory.
     *
     * @param path - The original file path.
     *
     * @param newPath - The new file path.
     *
     * @returns A promise which resolves with the new file contents model when
     *   the file is renamed.
     */
    rename(path, newPath) {
        const [drive1, path1] = this._driveForPath(path);
        const [drive2, path2] = this._driveForPath(newPath);
        if (drive1 !== drive2) {
            throw Error('ContentsManager: renaming files must occur within a Drive');
        }
        return drive1.rename(path1, path2).then(contentsModel => {
            return {
                ...contentsModel,
                path: this._toGlobalPath(drive1, path2),
                serverPath: contentsModel.path
            };
        });
    }
    /**
     * Save a file.
     *
     * @param path - The desired file path.
     *
     * @param options - Optional overrides to the model.
     *
     * @returns A promise which resolves with the file content model when the
     *   file is saved.
     *
     * #### Notes
     * Ensure that `model.content` is populated for the file.
     */
    save(path, options = {}) {
        const globalPath = this.normalize(path);
        const [drive, localPath] = this._driveForPath(path);
        return drive
            .save(localPath, { ...options, path: localPath })
            .then(contentsModel => {
            return {
                ...contentsModel,
                path: globalPath,
                serverPath: contentsModel.path
            };
        });
    }
    /**
     * Copy a file into a given directory.
     *
     * @param fromFile - The original file path.
     *
     * @param toDir - The destination directory path.
     *
     * @returns A promise which resolves with the new contents model when the
     *  file is copied.
     *
     * #### Notes
     * The server will select the name of the copied file.
     */
    copy(fromFile, toDir) {
        const [drive1, path1] = this._driveForPath(fromFile);
        const [drive2, path2] = this._driveForPath(toDir);
        if (drive1 === drive2) {
            return drive1.copy(path1, path2).then(contentsModel => {
                return {
                    ...contentsModel,
                    path: this._toGlobalPath(drive1, contentsModel.path),
                    serverPath: contentsModel.path
                };
            });
        }
        else {
            throw Error('Copying files between drives is not currently implemented');
        }
    }
    /**
     * Create a checkpoint for a file.
     *
     * @param path - The path of the file.
     *
     * @returns A promise which resolves with the new checkpoint model when the
     *   checkpoint is created.
     */
    createCheckpoint(path) {
        const [drive, localPath] = this._driveForPath(path);
        return drive.createCheckpoint(localPath);
    }
    /**
     * List available checkpoints for a file.
     *
     * @param path - The path of the file.
     *
     * @returns A promise which resolves with a list of checkpoint models for
     *    the file.
     */
    listCheckpoints(path) {
        const [drive, localPath] = this._driveForPath(path);
        return drive.listCheckpoints(localPath);
    }
    /**
     * Restore a file to a known checkpoint state.
     *
     * @param path - The path of the file.
     *
     * @param checkpointID - The id of the checkpoint to restore.
     *
     * @returns A promise which resolves when the checkpoint is restored.
     */
    restoreCheckpoint(path, checkpointID) {
        const [drive, localPath] = this._driveForPath(path);
        return drive.restoreCheckpoint(localPath, checkpointID);
    }
    /**
     * Delete a checkpoint for a file.
     *
     * @param path - The path of the file.
     *
     * @param checkpointID - The id of the checkpoint to delete.
     *
     * @returns A promise which resolves when the checkpoint is deleted.
     */
    deleteCheckpoint(path, checkpointID) {
        const [drive, localPath] = this._driveForPath(path);
        return drive.deleteCheckpoint(localPath, checkpointID);
    }
    /**
     * Given a drive and a local path, construct a fully qualified
     * path. The inverse of `_driveForPath`.
     *
     * @param drive an `IDrive`.
     *
     * @param localPath the local path on the drive.
     *
     * @returns the fully qualified path.
     */
    _toGlobalPath(drive, localPath) {
        if (drive === this._defaultDrive) {
            return coreutils_1.PathExt.removeSlash(localPath);
        }
        else {
            return `${drive.name}:${coreutils_1.PathExt.removeSlash(localPath)}`;
        }
    }
    /**
     * Given a path, get the `IDrive to which it refers,
     * where the path satisfies the pattern
     * `'driveName:path/to/file'`. If there is no `driveName`
     * prepended to the path, it returns the default drive.
     *
     * @param path a path to a file.
     *
     * @returns A tuple containing an `IDrive` object for the path,
     * and a local path for that drive.
     */
    _driveForPath(path) {
        const driveName = this.driveName(path);
        const localPath = this.localPath(path);
        if (driveName) {
            return [this._additionalDrives.get(driveName), localPath];
        }
        else {
            return [this._defaultDrive, localPath];
        }
    }
    /**
     * Respond to fileChanged signals from the drives attached to
     * the manager. This prepends the drive name to the path if necessary,
     * and then forwards the signal.
     */
    _onFileChanged(sender, args) {
        var _a, _b;
        if (sender === this._defaultDrive) {
            this._fileChanged.emit(args);
        }
        else {
            let newValue = null;
            let oldValue = null;
            if ((_a = args.newValue) === null || _a === void 0 ? void 0 : _a.path) {
                newValue = {
                    ...args.newValue,
                    path: this._toGlobalPath(sender, args.newValue.path)
                };
            }
            if ((_b = args.oldValue) === null || _b === void 0 ? void 0 : _b.path) {
                oldValue = {
                    ...args.oldValue,
                    path: this._toGlobalPath(sender, args.oldValue.path)
                };
            }
            this._fileChanged.emit({
                type: args.type,
                newValue,
                oldValue
            });
        }
    }
}
exports.ContentsManager = ContentsManager;
/**
 * A default implementation for an `IDrive`, talking to the
 * server using the Jupyter REST API.
 */
class Drive {
    /**
     * Construct a new contents manager object.
     *
     * @param options - The options used to initialize the object.
     */
    constructor(options = {}) {
        var _a, _b, _c;
        this._isDisposed = false;
        this._fileChanged = new signaling_1.Signal(this);
        this.name = (_a = options.name) !== null && _a !== void 0 ? _a : 'Default';
        this._apiEndpoint = (_b = options.apiEndpoint) !== null && _b !== void 0 ? _b : SERVICE_DRIVE_URL;
        this.serverSettings =
            (_c = options.serverSettings) !== null && _c !== void 0 ? _c : __1.ServerConnection.makeSettings();
        this._restContentProvider = new RestContentProvider({
            ...options,
            apiEndpoint: this._apiEndpoint,
            serverSettings: this.serverSettings
        });
        if (options.defaultContentProvider) {
            this.contentProviderRegistry = new ContentProviderRegistry({
                defaultProvider: options.defaultContentProvider
            });
        }
        else {
            this.contentProviderRegistry = new ContentProviderRegistry();
        }
        this.contentProviderRegistry.fileChanged.connect((registry, change) => {
            this._fileChanged.emit(change);
        });
    }
    /**
     * A signal emitted when a file operation takes place.
     */
    get fileChanged() {
        return this._fileChanged;
    }
    /**
     * Test whether the manager has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_1.Signal.clearData(this);
    }
    /**
     * Get a file or directory.
     *
     * @param localPath The path to the file.
     *
     * @param options The options used to fetch the file.
     *
     * @returns A promise which resolves with the file content.
     *
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async get(localPath, options) {
        const contentProvider = this.contentProviderRegistry.getProvider(options === null || options === void 0 ? void 0 : options.contentProviderId);
        if (contentProvider) {
            return contentProvider.get(localPath, options);
        }
        return await this._restContentProvider.get(localPath, options);
    }
    /**
     * Get an encoded download url given a file path.
     *
     * @param localPath - An absolute POSIX file path on the server.
     *
     * #### Notes
     * It is expected that the path contains no relative paths.
     *
     * The returned URL may include a query parameter.
     */
    getDownloadUrl(localPath) {
        const baseUrl = this.serverSettings.baseUrl;
        let url = coreutils_1.URLExt.join(baseUrl, FILES_URL, coreutils_1.URLExt.encodeParts(localPath));
        let cookie = '';
        try {
            cookie = document.cookie;
        }
        catch (e) {
            // e.g. SecurityError in case of CSP Sandbox
        }
        const xsrfTokenMatch = cookie.match('\\b_xsrf=([^;]*)\\b');
        if (xsrfTokenMatch) {
            const fullUrl = new URL(url);
            fullUrl.searchParams.append('_xsrf', xsrfTokenMatch[1]);
            url = fullUrl.toString();
        }
        return Promise.resolve(url);
    }
    /**
     * Create a new untitled file or directory in the specified directory path.
     *
     * @param options The options used to create the file.
     *
     * @returns A promise which resolves with the created file content when the
     *    file is created.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async newUntitled(options = {}) {
        var _a;
        let body = '{}';
        if (options) {
            if (options.ext) {
                options.ext = Private.normalizeExtension(options.ext);
            }
            body = JSON.stringify(options);
        }
        const settings = this.serverSettings;
        const url = this._getUrl((_a = options.path) !== null && _a !== void 0 ? _a : '');
        const init = {
            method: 'POST',
            body
        };
        const response = await __1.ServerConnection.makeRequest(url, init, settings);
        if (response.status !== 201) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        validate.validateContentsModel(data);
        this._fileChanged.emit({
            type: 'new',
            oldValue: null,
            newValue: data
        });
        return data;
    }
    /**
     * Delete a file.
     *
     * @param localPath - The path to the file.
     *
     * @returns A promise which resolves when the file is deleted.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents).
     */
    async delete(localPath) {
        const url = this._getUrl(localPath);
        const settings = this.serverSettings;
        const init = { method: 'DELETE' };
        const response = await __1.ServerConnection.makeRequest(url, init, settings);
        // TODO: update IPEP27 to specify errors more precisely, so
        // that error types can be detected here with certainty.
        if (response.status !== 204) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        this._fileChanged.emit({
            type: 'delete',
            oldValue: { path: localPath },
            newValue: null
        });
    }
    /**
     * Rename a file or directory.
     *
     * @param oldLocalPath - The original file path.
     *
     * @param newLocalPath - The new file path.
     *
     * @returns A promise which resolves with the new file contents model when
     *   the file is renamed.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async rename(oldLocalPath, newLocalPath) {
        const settings = this.serverSettings;
        const url = this._getUrl(oldLocalPath);
        const init = {
            method: 'PATCH',
            body: JSON.stringify({ path: newLocalPath })
        };
        const response = await __1.ServerConnection.makeRequest(url, init, settings);
        if (response.status !== 200) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        validate.validateContentsModel(data);
        this._fileChanged.emit({
            type: 'rename',
            oldValue: { path: oldLocalPath },
            newValue: data
        });
        return data;
    }
    /**
     * Save a file.
     *
     * @param localPath - The desired file path.
     *
     * @param options - Optional overrides to the model.
     *
     * @returns A promise which resolves with the file content model when the
     *   file is saved.
     *
     * #### Notes
     * Ensure that `model.content` is populated for the file.
     *
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async save(localPath, options = {}) {
        const contentProvider = this.contentProviderRegistry.getProvider(options === null || options === void 0 ? void 0 : options.contentProviderId);
        let data;
        if (contentProvider) {
            data = await contentProvider.save(localPath, options);
        }
        else {
            data = await this._restContentProvider.save(localPath, options);
        }
        this._fileChanged.emit({
            type: 'save',
            oldValue: null,
            newValue: data
        });
        return data;
    }
    /**
     * Copy a file into a given directory.
     *
     * @param fromFile - The original file path.
     *
     * @param toDir - The destination directory path.
     *
     * @returns A promise which resolves with the new contents model when the
     *  file is copied.
     *
     * #### Notes
     * The server will select the name of the copied file.
     *
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async copy(fromFile, toDir) {
        const settings = this.serverSettings;
        const url = this._getUrl(toDir);
        const init = {
            method: 'POST',
            body: JSON.stringify({ copy_from: fromFile })
        };
        const response = await __1.ServerConnection.makeRequest(url, init, settings);
        if (response.status !== 201) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        validate.validateContentsModel(data);
        this._fileChanged.emit({
            type: 'new',
            oldValue: null,
            newValue: data
        });
        return data;
    }
    /**
     * Create a checkpoint for a file.
     *
     * @param localPath - The path of the file.
     *
     * @returns A promise which resolves with the new checkpoint model when the
     *   checkpoint is created.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async createCheckpoint(localPath) {
        const url = this._getUrl(localPath, 'checkpoints');
        const init = { method: 'POST' };
        const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);
        if (response.status !== 201) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        validate.validateCheckpointModel(data);
        return data;
    }
    /**
     * List available checkpoints for a file.
     *
     * @param localPath - The path of the file.
     *
     * @returns A promise which resolves with a list of checkpoint models for
     *    the file.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async listCheckpoints(localPath) {
        const url = this._getUrl(localPath, 'checkpoints');
        const response = await __1.ServerConnection.makeRequest(url, {}, this.serverSettings);
        if (response.status !== 200) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        if (!Array.isArray(data)) {
            throw new Error('Invalid Checkpoint list');
        }
        for (let i = 0; i < data.length; i++) {
            validate.validateCheckpointModel(data[i]);
        }
        return data;
    }
    /**
     * Restore a file to a known checkpoint state.
     *
     * @param localPath - The path of the file.
     *
     * @param checkpointID - The id of the checkpoint to restore.
     *
     * @returns A promise which resolves when the checkpoint is restored.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents).
     */
    async restoreCheckpoint(localPath, checkpointID) {
        const url = this._getUrl(localPath, 'checkpoints', checkpointID);
        const init = { method: 'POST' };
        const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);
        if (response.status !== 204) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
    }
    /**
     * Delete a checkpoint for a file.
     *
     * @param localPath - The path of the file.
     *
     * @param checkpointID - The id of the checkpoint to delete.
     *
     * @returns A promise which resolves when the checkpoint is deleted.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents).
     */
    async deleteCheckpoint(localPath, checkpointID) {
        const url = this._getUrl(localPath, 'checkpoints', checkpointID);
        const init = { method: 'DELETE' };
        const response = await __1.ServerConnection.makeRequest(url, init, this.serverSettings);
        if (response.status !== 204) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
    }
    /**
     * Get a REST url for a file given a path.
     */
    _getUrl(...args) {
        const parts = args.map(path => coreutils_1.URLExt.encodeParts(path));
        const baseUrl = this.serverSettings.baseUrl;
        return coreutils_1.URLExt.join(baseUrl, this._apiEndpoint, ...parts);
    }
}
exports.Drive = Drive;
/**
 * A namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * Normalize a file extension to be of the type `'.foo'`.
     *
     * Adds a leading dot if not present and converts to lower case.
     */
    function normalizeExtension(extension) {
        if (extension.length > 0 && extension.indexOf('.') !== 0) {
            extension = `.${extension}`;
        }
        return extension;
    }
    Private.normalizeExtension = normalizeExtension;
})(Private || (Private = {}));
/**
 * The default registry of content providers.
 */
class ContentProviderRegistry {
    /**
     * Construct a new content provider registry.
     *
     * @param options - The options used to initialize the registry.
     */
    constructor(options) {
        this._providers = new Map();
        this._fileChanged = new signaling_1.Signal(this);
        if (options === null || options === void 0 ? void 0 : options.defaultProvider) {
            this.register('default', options.defaultProvider);
        }
    }
    /**
     * Add a content provider to the registry.
     *
     * @param identifier - The identifier of the provider; it can be reused between drives.
     * @param provider - The content provider to register.
     */
    register(identifier, provider) {
        if (this._providers.has(identifier)) {
            throw Error(`Provider with ${identifier} identifier was already registered on this drive`);
        }
        this._providers.set(identifier, provider);
        const fileChangedProxy = (_provider, change) => {
            this._fileChanged.emit(change);
        };
        if (provider.fileChanged) {
            provider.fileChanged.connect(fileChangedProxy);
        }
        return new disposable_1.DisposableDelegate(() => {
            if (provider.fileChanged) {
                provider.fileChanged.disconnect(fileChangedProxy);
            }
            if (this._providers.has(identifier)) {
                this._providers.delete(identifier);
            }
        });
    }
    /**
     * Get a content provider matching provided identifier.
     *
     * If no identifier is provided, return the default provider.
     * Throws an error if a provider with given identifier is not found.
     *
     * @param identifier - identifier of the content provider.
     */
    getProvider(identifier) {
        if (!identifier) {
            return null;
        }
        const provider = this._providers.get(identifier);
        if (!provider) {
            throw Error(`Provider ${identifier} is not registered`);
        }
        return provider;
    }
    /**
     * A proxy of the file changed signal for all the providers.
     */
    get fileChanged() {
        return this._fileChanged;
    }
}
exports.ContentProviderRegistry = ContentProviderRegistry;
/**
 * A content provider using the Jupyter REST API.
 */
class RestContentProvider {
    constructor(options) {
        this._options = options;
    }
    /**
     * Get a file or directory.
     *
     * @param localPath The path to the file.
     *
     * @param options The options used to fetch the file.
     *
     * @returns A promise which resolves with the file content.
     *
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async get(localPath, options) {
        let url = this._getUrl(localPath);
        if (options) {
            // The notebook type cannot take a format option.
            if (options.type === 'notebook') {
                delete options['format'];
            }
            const content = options.content ? '1' : '0';
            const hash = options.hash ? '1' : '0';
            const params = { ...options, content, hash };
            url += coreutils_1.URLExt.objectToQueryString(params);
        }
        const settings = this._options.serverSettings;
        const response = await __1.ServerConnection.makeRequest(url, {}, settings);
        if (response.status !== 200) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        validate.validateContentsModel(data);
        return data;
    }
    /**
     * Save a file.
     *
     * @param localPath - The desired file path.
     *
     * @param options - Optional overrides to the model.
     *
     * @returns A promise which resolves with the file content model when the
     *   file is saved.
     *
     * #### Notes
     * Ensure that `model.content` is populated for the file.
     *
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/contents) and validates the response model.
     */
    async save(localPath, options = {}) {
        const settings = this._options.serverSettings;
        const url = this._getUrl(localPath);
        const file = new File([JSON.stringify(options)], 'data.json', {
            type: 'application/json'
        });
        const init = {
            method: 'PUT',
            body: file
        };
        const response = await __1.ServerConnection.makeRequest(url, init, settings);
        // will return 200 for an existing file and 201 for a new file
        if (response.status !== 200 && response.status !== 201) {
            const err = await __1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        validate.validateContentsModel(data);
        return data;
    }
    /**
     * Get a REST url for a file given a path.
     */
    _getUrl(...args) {
        const parts = args.map(path => coreutils_1.URLExt.encodeParts(path));
        const baseUrl = this._options.serverSettings.baseUrl;
        return coreutils_1.URLExt.join(baseUrl, this._options.apiEndpoint, ...parts);
    }
}
exports.RestContentProvider = RestContentProvider;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 36556:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateContentsModel = validateContentsModel;
exports.validateCheckpointModel = validateCheckpointModel;
const validate_1 = __webpack_require__(45669);
/**
 * Validate an `Contents.IModel` object.
 */
function validateContentsModel(model) {
    (0, validate_1.validateProperty)(model, 'name', 'string');
    (0, validate_1.validateProperty)(model, 'path', 'string');
    (0, validate_1.validateProperty)(model, 'type', 'string');
    (0, validate_1.validateProperty)(model, 'created', 'string');
    (0, validate_1.validateProperty)(model, 'last_modified', 'string');
    (0, validate_1.validateProperty)(model, 'mimetype', 'object');
    (0, validate_1.validateProperty)(model, 'content', 'object');
    (0, validate_1.validateProperty)(model, 'format', 'object');
}
/**
 * Validate an `Contents.ICheckpointModel` object.
 */
function validateCheckpointModel(model) {
    (0, validate_1.validateProperty)(model, 'id', 'string');
    (0, validate_1.validateProperty)(model, 'last_modified', 'string');
}
//# sourceMappingURL=validate.js.map

/***/ }),

/***/ 95348:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.EventManager = void 0;
const coreutils_1 = __webpack_require__(4666);
const polling_1 = __webpack_require__(75205);
const signaling_1 = __webpack_require__(46257);
const serverconnection_1 = __webpack_require__(43851);
/**
 * The url for the jupyter-server events service.
 */
const SERVICE_EVENTS_URL = 'api/events';
/**
 * The events API service manager.
 */
class EventManager {
    /**
     * Create a new event manager.
     */
    constructor(options = {}) {
        var _a, _b;
        this._socket = null;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
        // If subscription fails, the poll attempts to reconnect and backs off.
        this._poll = new polling_1.Poll({
            factory: () => this._subscribe(),
            standby: (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden'
        });
        this._stream = new signaling_1.Stream(this);
        // Subscribe to the events socket.
        void this._poll.start();
    }
    /**
     * Whether the event manager is disposed.
     */
    get isDisposed() {
        return this._poll.isDisposed;
    }
    /**
     * An event stream that emits and yields each new event.
     */
    get stream() {
        return this._stream;
    }
    /**
     * Dispose the event manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        // Clean up poll.
        this._poll.dispose();
        // Clean up socket.
        const socket = this._socket;
        if (socket) {
            this._socket = null;
            socket.onopen = () => undefined;
            socket.onerror = () => undefined;
            socket.onmessage = () => undefined;
            socket.onclose = () => undefined;
            socket.close();
        }
        // Clean up stream.
        signaling_1.Signal.clearData(this);
        this._stream.stop();
    }
    /**
     * Post an event request to be emitted by the event bus.
     */
    async emit(event) {
        const { serverSettings } = this;
        const { baseUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const url = coreutils_1.URLExt.join(baseUrl, SERVICE_EVENTS_URL);
        const init = { body: JSON.stringify(event), method: 'POST' };
        const response = await makeRequest(url, init, serverSettings);
        if (response.status !== 204) {
            throw new ResponseError(response);
        }
    }
    /**
     * Subscribe to event bus emissions.
     */
    _subscribe() {
        return new Promise((_, reject) => {
            if (this.isDisposed) {
                return;
            }
            const { appendToken, token, WebSocket, wsUrl } = this.serverSettings;
            let url = coreutils_1.URLExt.join(wsUrl, SERVICE_EVENTS_URL, 'subscribe');
            if (appendToken && token !== '') {
                url += `?token=${encodeURIComponent(token)}`;
            }
            const socket = (this._socket = new WebSocket(url));
            const stream = this._stream;
            socket.onclose = () => reject(new Error('EventManager socket closed'));
            socket.onmessage = msg => msg.data && stream.emit(JSON.parse(msg.data));
        });
    }
}
exports.EventManager = EventManager;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 83676:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module services
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
__exportStar(__webpack_require__(78037), exports);
__exportStar(__webpack_require__(34027), exports);
__exportStar(__webpack_require__(1285), exports);
__exportStar(__webpack_require__(87594), exports);
__exportStar(__webpack_require__(95348), exports);
__exportStar(__webpack_require__(30335), exports);
__exportStar(__webpack_require__(27504), exports);
__exportStar(__webpack_require__(84711), exports);
__exportStar(__webpack_require__(43851), exports);
__exportStar(__webpack_require__(82351), exports);
__exportStar(__webpack_require__(69494), exports);
__exportStar(__webpack_require__(23549), exports);
__exportStar(__webpack_require__(75844), exports);
__exportStar(__webpack_require__(78162), exports);
__exportStar(__webpack_require__(53265), exports);
__exportStar(__webpack_require__(8178), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 35139:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CommHandler = exports.CommsOverSubshells = void 0;
const coreutils_1 = __webpack_require__(72215);
const disposable_1 = __webpack_require__(61533);
const KernelMessage = __importStar(__webpack_require__(70552));
/**
 * The Comm Over Subshell Enum
 */
var CommsOverSubshells;
(function (CommsOverSubshells) {
    CommsOverSubshells["Disabled"] = "disabled";
    CommsOverSubshells["PerComm"] = "perComm";
    CommsOverSubshells["PerCommTarget"] = "perCommTarget";
})(CommsOverSubshells || (exports.CommsOverSubshells = CommsOverSubshells = {}));
/**
 * Comm channel handler.
 */
class CommHandler extends disposable_1.DisposableDelegate {
    /**
     * Construct a new comm channel.
     */
    constructor(target, id, kernel, disposeCb, commsOverSubshells) {
        super(disposeCb);
        this._subshellStarted = new coreutils_1.PromiseDelegate();
        this._subshellId = null;
        this._target = '';
        this._id = '';
        this._id = id;
        this._target = target;
        this._kernel = kernel;
        // Clean subshell ids upon restart
        this._kernel.statusChanged.connect(() => {
            if (this._kernel.status === 'restarting') {
                this._cleanSubshells();
            }
        });
        this.commsOverSubshells =
            commsOverSubshells !== null && commsOverSubshells !== void 0 ? commsOverSubshells : CommsOverSubshells.PerCommTarget;
    }
    /**
     * The unique id for the comm channel.
     */
    get commId() {
        return this._id;
    }
    /**
     * The target name for the comm channel.
     */
    get targetName() {
        return this._target;
    }
    /**
     * The current subshell id.
     */
    get subshellId() {
        return this._subshellId;
    }
    /**
     * Promise that resolves when the subshell started, if any
     */
    get subshellStarted() {
        return this._subshellStarted.promise;
    }
    /**
     * Whether comms are running on a subshell, or not
     */
    get commsOverSubshells() {
        return this._commsOverSubshells;
    }
    /**
     * Set whether comms are running on subshells, or not
     */
    set commsOverSubshells(value) {
        if (value === this._commsOverSubshells) {
            // Do nothing if the value is not changing.
            return;
        }
        const closePromise = this._maybeCloseSubshell(this._commsOverSubshells);
        this._commsOverSubshells = value;
        closePromise
            .then(() => {
            if (this._commsOverSubshells !== CommsOverSubshells.Disabled) {
                void this._maybeStartSubshell();
            }
        })
            .catch(console.warn);
    }
    /**
     * Get the callback for a comm close event.
     *
     * #### Notes
     * This is called when the comm is closed from either the server or client.
     *
     * **See also:** [[ICommClose]], [[close]]
     */
    get onClose() {
        return this._onClose;
    }
    /**
     * Set the callback for a comm close event.
     *
     * #### Notes
     * This is called when the comm is closed from either the server or client. If
     * the function returns a promise, and the kernel was closed from the server,
     * kernel message processing will pause until the returned promise is
     * fulfilled.
     *
     * **See also:** [[close]]
     */
    set onClose(cb) {
        this._onClose = cb;
    }
    /**
     * Get the callback for a comm message received event.
     */
    get onMsg() {
        return this._onMsg;
    }
    /**
     * Set the callback for a comm message received event.
     *
     * #### Notes
     * This is called when a comm message is received. If the function returns a
     * promise, kernel message processing will pause until it is fulfilled.
     */
    set onMsg(cb) {
        this._onMsg = cb;
    }
    /**
     * Open a comm with optional data and metadata.
     *
     * #### Notes
     * This sends a `comm_open` message to the server.
     *
     * **See also:** [[ICommOpen]]
     */
    open(data, metadata, buffers = []) {
        if (this.isDisposed || this._kernel.isDisposed) {
            throw new Error('Cannot open');
        }
        const msg = KernelMessage.createMessage({
            msgType: 'comm_open',
            channel: 'shell',
            username: this._kernel.username,
            session: this._kernel.clientId,
            subshellId: this._subshellId || this._kernel.subshellId,
            content: {
                comm_id: this._id,
                target_name: this._target,
                data: data !== null && data !== void 0 ? data : {}
            },
            metadata,
            buffers
        });
        return this._kernel.sendShellMessage(msg, false, true);
    }
    /**
     * Send a `comm_msg` message to the kernel.
     *
     * #### Notes
     * This is a no-op if the comm has been closed.
     *
     * **See also:** [[ICommMsg]]
     */
    send(data, metadata, buffers = [], disposeOnDone = true) {
        if (this.isDisposed || this._kernel.isDisposed) {
            throw new Error('Cannot send');
        }
        const msg = KernelMessage.createMessage({
            msgType: 'comm_msg',
            channel: 'shell',
            username: this._kernel.username,
            session: this._kernel.clientId,
            subshellId: this._subshellId || this._kernel.subshellId,
            content: {
                comm_id: this._id,
                data: data
            },
            metadata,
            buffers
        });
        return this._kernel.sendShellMessage(msg, false, disposeOnDone);
    }
    /**
     * Close the comm.
     *
     * #### Notes
     * This will send a `comm_close` message to the kernel, and call the
     * `onClose` callback if set.
     *
     * This is a no-op if the comm is already closed.
     *
     * **See also:** [[ICommClose]], [[onClose]]
     */
    close(data, metadata, buffers = []) {
        if (this.isDisposed || this._kernel.isDisposed) {
            throw new Error('Cannot close');
        }
        const msg = KernelMessage.createMessage({
            msgType: 'comm_close',
            channel: 'shell',
            username: this._kernel.username,
            session: this._kernel.clientId,
            subshellId: this._subshellId || this._kernel.subshellId,
            content: {
                comm_id: this._id,
                data: data !== null && data !== void 0 ? data : {}
            },
            metadata,
            buffers
        });
        const future = this._kernel.sendShellMessage(msg, false, true);
        const onClose = this._onClose;
        if (onClose) {
            const ioMsg = KernelMessage.createMessage({
                msgType: 'comm_close',
                channel: 'iopub',
                username: this._kernel.username,
                session: this._kernel.clientId,
                subshellId: this._subshellId || this._kernel.subshellId,
                content: {
                    comm_id: this._id,
                    data: data !== null && data !== void 0 ? data : {}
                },
                metadata,
                buffers
            });
            // In the future, we may want to communicate back to the user the possible
            // promise returned from onClose.
            void onClose(ioMsg);
        }
        this.dispose();
        return future;
    }
    dispose() {
        void this._maybeCloseSubshell(this._commsOverSubshells);
        super.dispose();
    }
    _cleanSubshells() {
        const kernelId = this._kernel.id;
        if (CommHandler._commTargetSubShellsId.hasOwnProperty(kernelId)) {
            delete CommHandler._commTargetSubShellsId[kernelId];
        }
    }
    async _maybeStartSubshell() {
        await this._kernel.info;
        if (!this._kernel.supportsSubshells) {
            return;
        }
        if (this._commsOverSubshells === CommsOverSubshells.PerComm) {
            // Create subshell
            const replyMsg = await this._kernel.requestCreateSubshell({}).done;
            this._subshellId = replyMsg.content.subshell_id;
            this._subshellStarted.resolve();
            return;
        }
        // One shell per comm-target
        const subshellStarted = this._subshellStarted;
        const kernelId = this._kernel.id;
        if (!CommHandler._commTargetSubShellsId.hasOwnProperty(kernelId)) {
            CommHandler._commTargetSubShellsId[kernelId] = {};
        }
        const kernelCommTargetSubshells = CommHandler._commTargetSubShellsId[kernelId];
        const existingEntry = kernelCommTargetSubshells[this._target];
        if (existingEntry) {
            existingEntry.referenceCount += 1;
            try {
                this._subshellId = await existingEntry.subshellId;
                subshellStarted.resolve();
            }
            catch (e) {
                // If the future rejected we need to close the subshell to avoid leaks
                await this._closePerCommTargetSubshell(false);
                subshellStarted.reject(`Per comm-target subshell creation failed: ${e}`);
            }
            return;
        }
        const entry = {
            subshellId: this._kernel
                .requestCreateSubshell({})
                .done.then(replyMsg => replyMsg.content.subshell_id),
            referenceCount: 1
        };
        kernelCommTargetSubshells[this._target] = entry;
        try {
            this._subshellId = await entry.subshellId;
            subshellStarted.resolve();
        }
        catch (e) {
            // If the future rejected we need to close the subshell to avoid leaks
            await this._closePerCommTargetSubshell(false);
            subshellStarted.reject(`Per comm-target subshell creation failed: ${e}`);
        }
    }
    async _closePerCommTargetSubshell(shouldAskKernelToDelete = true) {
        const kernelId = this._kernel.id;
        const target = this._target;
        if (CommHandler._commTargetSubShellsId.hasOwnProperty(kernelId)) {
            // Close the subshell for this target if this is the last comm.
            const kernelTargets = CommHandler._commTargetSubShellsId[kernelId];
            const entry = kernelTargets[target];
            if (entry) {
                entry.referenceCount -= 1;
                if (entry.referenceCount <= 0) {
                    if (shouldAskKernelToDelete) {
                        let subshellId = null;
                        try {
                            subshellId = await entry.subshellId;
                        }
                        catch (e) {
                            console.warn(`Subshell identifier not available in the closeout sequence, will not request deletion: ${e}`);
                        }
                        if (subshellId !== null) {
                            this._kernel.requestDeleteSubshell({ subshell_id: subshellId }, true);
                        }
                    }
                    delete kernelTargets[target];
                }
            }
            if (Object.keys(kernelTargets).length === 0) {
                delete CommHandler._commTargetSubShellsId[kernelId];
            }
            // Clear identifier
            this._subshellId = null;
        }
        // Restart promise delegate to subsequent startup
        this._subshellStarted = new coreutils_1.PromiseDelegate();
    }
    async _maybeCloseSubshell(mode) {
        if (this._kernel.status === 'dead') {
            return;
        }
        switch (mode) {
            case CommsOverSubshells.PerComm: {
                if (this._subshellId) {
                    // Close the only subshell
                    this._kernel.requestDeleteSubshell({ subshell_id: this._subshellId }, true);
                    // Clear identifier
                    this._subshellId = null;
                }
                // Restart promise delegate to subsequent startup
                this._subshellStarted = new coreutils_1.PromiseDelegate();
                break;
            }
            case CommsOverSubshells.PerCommTarget: {
                await this._closePerCommTargetSubshell();
                break;
            }
            case CommsOverSubshells.Disabled: {
                // no-op
                break;
            }
        }
    }
}
exports.CommHandler = CommHandler;
CommHandler._commTargetSubShellsId = {};
//# sourceMappingURL=comm.js.map

/***/ }),

/***/ 45992:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KernelConnection = void 0;
const coreutils_1 = __webpack_require__(4666);
const coreutils_2 = __webpack_require__(72215);
const signaling_1 = __webpack_require__(46257);
const __1 = __webpack_require__(83676);
const comm_1 = __webpack_require__(35139);
const KernelMessage = __importStar(__webpack_require__(70552));
const future_1 = __webpack_require__(77489);
const validate = __importStar(__webpack_require__(92917));
const restapi_1 = __webpack_require__(33505);
const restapi_2 = __webpack_require__(29723);
const coreutils_3 = __webpack_require__(4666);
const KERNEL_INFO_TIMEOUT = 3000;
const RESTARTING_KERNEL_SESSION = '_RESTARTING_';
const STARTING_KERNEL_SESSION = '';
/**
 * Implementation of the Kernel object.
 *
 * #### Notes
 * Messages from the server are handled in the order they were received and
 * asynchronously. Any message handler can return a promise, and message
 * handling will pause until the promise is fulfilled.
 */
class KernelConnection {
    /**
     * Construct a kernel object.
     */
    constructor(options) {
        var _a, _b, _c, _d, _e, _f, _g, _h;
        /**
         * Create the kernel websocket connection and add socket status handlers.
         */
        this._createSocket = (useProtocols = true) => {
            this._errorIfDisposed();
            // Make sure the socket is clear
            this._clearSocket();
            // Update the connection status to reflect opening a new connection.
            this._updateConnectionStatus('connecting');
            const settings = this.serverSettings;
            const partialUrl = coreutils_1.URLExt.join(settings.wsUrl, restapi_1.KERNEL_SERVICE_URL, encodeURIComponent(this._id));
            // Strip any authentication from the display string.
            const display = partialUrl.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/, '$1');
            console.debug(`Starting WebSocket: ${display}`);
            let url = coreutils_1.URLExt.join(partialUrl, 'channels?session_id=' + encodeURIComponent(this._clientId));
            // If token authentication is in use.
            const token = settings.token;
            if (settings.appendToken && token !== '') {
                url = url + `&token=${encodeURIComponent(token)}`;
            }
            // Try opening the websocket with our list of subprotocols.
            // If the server doesn't handle subprotocols,
            // the accepted protocol will be ''.
            // But we cannot send '' as a subprotocol, so if connection fails,
            // reconnect without subprotocols.
            const supportedProtocols = useProtocols ? this._supportedProtocols : [];
            this._ws = new settings.WebSocket(url, supportedProtocols);
            // Ensure incoming binary messages are not Blobs
            this._ws.binaryType = 'arraybuffer';
            let alreadyCalledOnclose = false;
            const getKernelModel = async (evt) => {
                var _a, _b;
                if (this._isDisposed) {
                    return;
                }
                this._reason = '';
                this._model = undefined;
                try {
                    const model = await this._kernelAPIClient.getModel(this._id);
                    this._model = model;
                    if ((model === null || model === void 0 ? void 0 : model.execution_state) === 'dead') {
                        this._updateStatus('dead');
                    }
                    else {
                        this._onWSClose(evt);
                    }
                }
                catch (err) {
                    // Try again, if there is a network failure
                    // Handle network errors, as well as cases where we are on a
                    // JupyterHub and the server is not running. JupyterHub returns a
                    // 503 (<2.0) or 424 (>2.0) in that case.
                    if (err instanceof __1.ServerConnection.NetworkError ||
                        ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||
                        ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {
                        const timeout = Private.getRandomIntInclusive(10, 30) * 1e3;
                        setTimeout(getKernelModel, timeout, evt);
                    }
                    else {
                        this._reason = 'Kernel died unexpectedly';
                        this._updateStatus('dead');
                    }
                }
                return;
            };
            const earlyClose = async (evt) => {
                // If the websocket was closed early, that could mean
                // that the kernel is actually dead. Try getting
                // information about the kernel from the API call,
                // if that fails, then assume the kernel is dead,
                // otherwise just follow the typical websocket closed
                // protocol.
                if (alreadyCalledOnclose) {
                    return;
                }
                alreadyCalledOnclose = true;
                await getKernelModel(evt);
                return;
            };
            this._ws.onmessage = this._onWSMessage;
            this._ws.onopen = this._onWSOpen;
            this._ws.onclose = earlyClose;
            this._ws.onerror = earlyClose;
        };
        // Make websocket callbacks arrow functions so they bind `this`.
        /**
         * Handle a websocket open event.
         */
        this._onWSOpen = (evt) => {
            if (this._ws.protocol !== '' &&
                !this._supportedProtocols.includes(this._ws.protocol)) {
                console.log('Server selected unknown kernel wire protocol:', this._ws.protocol);
                this._updateStatus('dead');
                throw new Error(`Unknown kernel wire protocol:  ${this._ws.protocol}`);
            }
            // Remember the kernel wire protocol selected by the server.
            this._selectedProtocol = this._ws.protocol;
            this._ws.onclose = this._onWSClose;
            this._ws.onerror = this._onWSClose;
            this._updateConnectionStatus('connected');
        };
        /**
         * Handle a websocket message, validating and routing appropriately.
         */
        this._onWSMessage = (evt) => {
            // Notify immediately if there is an error with the message.
            let msg;
            try {
                msg = this.serverSettings.serializer.deserialize(evt.data, this._ws.protocol);
                validate.validateMessage(msg);
            }
            catch (error) {
                error.message = `Kernel message validation error: ${error.message}`;
                // We throw the error so that it bubbles up to the top, and displays the right stack.
                throw error;
            }
            // Update the current kernel session id
            this._kernelSession = msg.header.session;
            // Handle the message asynchronously, in the order received.
            this._msgChain = this._msgChain
                .then(() => {
                // Return so that any promises from handling a message are fulfilled
                // before proceeding to the next message.
                return this._handleMessage(msg);
            })
                .catch(error => {
                // Log any errors in handling the message, thus resetting the _msgChain
                // promise so we can process more messages.
                // Ignore the "Canceled" errors that are thrown during kernel dispose.
                if (error.message.startsWith('Canceled future for ')) {
                    console.error(error);
                }
            });
            // Emit the message receive signal
            this._anyMessage.emit({ msg, direction: 'recv' });
        };
        /**
         * Handle a websocket close event.
         */
        this._onWSClose = (evt) => {
            if (!this.isDisposed) {
                this._reconnect();
            }
        };
        this._id = '';
        this._name = '';
        this._status = 'unknown';
        this._connectionStatus = 'connecting';
        this._kernelSession = '';
        this._isDisposed = false;
        /**
         * Websocket to communicate with kernel.
         */
        this._ws = null;
        this._username = '';
        this._reconnectLimit = 7;
        this._reconnectAttempt = 0;
        this._reconnectTimeout = null;
        this._supportedProtocols = Object.values(KernelMessage.supportedKernelWebSocketProtocols);
        this._selectedProtocol = '';
        this._commsOverSubshells = __1.CommsOverSubshells.PerCommTarget;
        this._futures = new Map();
        this._comms = new Map();
        this._targetRegistry = Object.create(null);
        this._info = new coreutils_2.PromiseDelegate();
        this._pendingMessages = [];
        this._statusChanged = new signaling_1.Signal(this);
        this._connectionStatusChanged = new signaling_1.Signal(this);
        this._disposed = new signaling_1.Signal(this);
        this._iopubMessage = new signaling_1.Signal(this);
        this._anyMessage = new signaling_1.Signal(this);
        this._pendingInput = new signaling_1.Signal(this);
        this._unhandledMessage = new signaling_1.Signal(this);
        this._displayIdToParentIds = new Map();
        this._msgIdToDisplayIds = new Map();
        this._msgChain = Promise.resolve();
        this._hasPendingInput = false;
        this._reason = '';
        this._noOp = () => {
            /* no-op */
        };
        this._supportsSubshells = false;
        this._name = options.model.name;
        this._id = options.model.id;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();
        this._kernelAPIClient =
            (_b = options.kernelAPIClient) !== null && _b !== void 0 ? _b : new restapi_1.KernelAPIClient({ serverSettings: this.serverSettings });
        this._kernelSpecAPIClient =
            (_c = options.kernelSpecAPIClient) !== null && _c !== void 0 ? _c : new restapi_2.KernelSpecAPIClient({ serverSettings: this.serverSettings });
        this._clientId = (_d = options.clientId) !== null && _d !== void 0 ? _d : coreutils_2.UUID.uuid4();
        this._username = (_e = options.username) !== null && _e !== void 0 ? _e : '';
        this.handleComms = (_f = options.handleComms) !== null && _f !== void 0 ? _f : true;
        this._commsOverSubshells =
            (_g = options.commsOverSubshells) !== null && _g !== void 0 ? _g : __1.CommsOverSubshells.PerCommTarget;
        this._subshellId = (_h = options.subshellId) !== null && _h !== void 0 ? _h : null;
        this._createSocket();
    }
    get disposed() {
        return this._disposed;
    }
    /**
     * Whether comm messages should be sent to kernel subshells, if the
     * kernel supports it.
     *
     * #### Notes
     * Sending comm messages over subshells allows processing comms whilst
     * processing execute-request on the "main shell". This prevents blocking
     * comm processing.
     * Options are:
     * - disabled: not using subshells
     * - one subshell per comm-target (default)
     * - one subshell per comm (can lead to issues if creating many comms)
     */
    get commsOverSubshells() {
        return this._commsOverSubshells;
    }
    set commsOverSubshells(value) {
        this._commsOverSubshells = value;
        for (const [_, comm] of this._comms) {
            comm.commsOverSubshells = value;
        }
    }
    /**
     * A signal emitted when the kernel status changes.
     */
    get statusChanged() {
        return this._statusChanged;
    }
    /**
     * A signal emitted when the kernel status changes.
     */
    get connectionStatusChanged() {
        return this._connectionStatusChanged;
    }
    /**
     * A signal emitted for iopub kernel messages.
     *
     * #### Notes
     * This signal is emitted after the iopub message is handled asynchronously.
     */
    get iopubMessage() {
        return this._iopubMessage;
    }
    /**
     * A signal emitted for unhandled kernel message.
     *
     * #### Notes
     * This signal is emitted for a message that was not handled. It is emitted
     * during the asynchronous message handling code.
     */
    get unhandledMessage() {
        return this._unhandledMessage;
    }
    /**
     * The kernel model
     */
    get model() {
        return (this._model || {
            id: this.id,
            name: this.name,
            reason: this._reason
        });
    }
    /**
     * A signal emitted for any kernel message.
     *
     * #### Notes
     * This signal is emitted when a message is received, before it is handled
     * asynchronously.
     *
     * This message is emitted when a message is queued for sending (either in
     * the websocket buffer, or our own pending message buffer). The message may
     * actually be sent across the wire at a later time.
     *
     * The message emitted in this signal should not be modified in any way.
     */
    get anyMessage() {
        return this._anyMessage;
    }
    /**
     * A signal emitted when a kernel has pending inputs from the user.
     */
    get pendingInput() {
        return this._pendingInput;
    }
    /**
     * The id of the server-side kernel.
     */
    get id() {
        return this._id;
    }
    /**
     * The name of the server-side kernel.
     */
    get name() {
        return this._name;
    }
    /**
     * The client username.
     */
    get username() {
        return this._username;
    }
    /**
     * The client unique id.
     */
    get clientId() {
        return this._clientId;
    }
    /**
     * The subshell ID.
     */
    get subshellId() {
        return this._subshellId;
    }
    /**
     * Set the subshell ID.
     */
    set subshellId(value) {
        this._subshellId = value;
    }
    /**
     * The current status of the kernel.
     */
    get status() {
        return this._status;
    }
    /**
     * The current connection status of the kernel connection.
     */
    get connectionStatus() {
        return this._connectionStatus;
    }
    /**
     * Test whether the kernel has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * The cached kernel info.
     *
     * @returns A promise that resolves to the kernel info.
     */
    get info() {
        return this._info.promise;
    }
    /**
     * The kernel spec.
     *
     * @returns A promise that resolves to the kernel spec.
     */
    get spec() {
        if (this._specPromise) {
            return this._specPromise;
        }
        this._specPromise = this._kernelSpecAPIClient.get().then(specs => {
            return specs.kernelspecs[this._name];
        });
        return this._specPromise;
    }
    /**
     * Check if this kernel supports JEP 91 kernel subshells.
     */
    get supportsSubshells() {
        return this._supportsSubshells;
    }
    /**
     * Clone the current kernel with a new clientId.
     */
    clone(options = {}) {
        return new KernelConnection({
            model: this.model,
            username: this.username,
            serverSettings: this.serverSettings,
            // handleComms defaults to false since that is safer
            handleComms: false,
            kernelAPIClient: this._kernelAPIClient,
            commsOverSubshells: __1.CommsOverSubshells.Disabled,
            ...options
        });
    }
    /**
     * Dispose of the resources held by the kernel.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        const cleanup = () => {
            this._isDisposed = true;
            this._disposed.emit();
            this._updateConnectionStatus('disconnected');
            this._clearKernelState();
            this._pendingMessages = [];
            this._clearSocket();
            // Clear Lumino signals
            signaling_1.Signal.clearData(this);
        };
        if (this._subshellId !== null) {
            const future = this.requestDeleteSubshell({ subshell_id: this._subshellId }, true);
            future.onReply = (msg) => {
                // Ignore the response and clean up.
                cleanup();
            };
        }
        else {
            cleanup();
        }
    }
    /**
     * Send a shell message to the kernel.
     *
     * #### Notes
     * Send a message to the kernel's shell channel, yielding a future object
     * for accepting replies.
     *
     * If `expectReply` is given and `true`, the future is disposed when both a
     * shell reply and an idle status message are received. If `expectReply`
     * is not given or is `false`, the future is resolved when an idle status
     * message is received.
     * If `disposeOnDone` is not given or is `true`, the Future is disposed at this point.
     * If `disposeOnDone` is given and `false`, it is up to the caller to dispose of the Future.
     *
     * All replies are validated as valid kernel messages.
     *
     * If the kernel status is `dead`, this will throw an error.
     */
    sendShellMessage(msg, expectReply = false, disposeOnDone = true) {
        return this._sendKernelShellControl(future_1.KernelShellFutureHandler, msg, expectReply, disposeOnDone);
    }
    /**
     * Send a control message to the kernel.
     *
     * #### Notes
     * Send a message to the kernel's control channel, yielding a future object
     * for accepting replies.
     *
     * If `expectReply` is given and `true`, the future is disposed when both a
     * control reply and an idle status message are received. If `expectReply`
     * is not given or is `false`, the future is resolved when an idle status
     * message is received.
     * If `disposeOnDone` is not given or is `true`, the Future is disposed at this point.
     * If `disposeOnDone` is given and `false`, it is up to the caller to dispose of the Future.
     *
     * All replies are validated as valid kernel messages.
     *
     * If the kernel status is `dead`, this will throw an error.
     */
    sendControlMessage(msg, expectReply = false, disposeOnDone = true) {
        return this._sendKernelShellControl(future_1.KernelControlFutureHandler, msg, expectReply, disposeOnDone);
    }
    _sendKernelShellControl(ctor, msg, expectReply = false, disposeOnDone = true) {
        this._sendMessage(msg);
        this._anyMessage.emit({ msg, direction: 'send' });
        const future = new ctor(() => {
            const msgId = msg.header.msg_id;
            this._futures.delete(msgId);
            // Remove stored display id information.
            const displayIds = this._msgIdToDisplayIds.get(msgId);
            if (!displayIds) {
                return;
            }
            displayIds.forEach(displayId => {
                const msgIds = this._displayIdToParentIds.get(displayId);
                if (msgIds) {
                    const idx = msgIds.indexOf(msgId);
                    if (idx === -1) {
                        return;
                    }
                    if (msgIds.length === 1) {
                        this._displayIdToParentIds.delete(displayId);
                    }
                    else {
                        msgIds.splice(idx, 1);
                        this._displayIdToParentIds.set(displayId, msgIds);
                    }
                }
            });
            this._msgIdToDisplayIds.delete(msgId);
        }, msg, expectReply, disposeOnDone, this);
        this._futures.set(msg.header.msg_id, future);
        return future;
    }
    /**
     * Send a message on the websocket.
     *
     * If queue is true, queue the message for later sending if we cannot send
     * now. Otherwise throw an error.
     *
     * #### Notes
     * As an exception to the queueing, if we are sending a kernel_info_request
     * message while we think the kernel is restarting, we send the message
     * immediately without queueing. This is so that we can trigger a message
     * back, which will then clear the kernel restarting state.
     */
    _sendMessage(msg, queue = true) {
        if (this.status === 'dead') {
            throw new Error('Kernel is dead');
        }
        // If we have a kernel_info_request and we are starting or restarting, send the
        // kernel_info_request immediately if we can, and if not throw an error so
        // we can retry later. On restarting we do this because we must get at least one message
        // from the kernel to reset the kernel session (thus clearing the restart
        // status sentinel).
        if ((this._kernelSession === STARTING_KERNEL_SESSION ||
            this._kernelSession === RESTARTING_KERNEL_SESSION) &&
            KernelMessage.isInfoRequestMsg(msg)) {
            if (this.connectionStatus === 'connected') {
                this._ws.send(this.serverSettings.serializer.serialize(msg, this._ws.protocol));
                return;
            }
            else {
                throw new Error('Could not send message: status is not connected');
            }
        }
        // If there are pending messages, add to the queue so we keep messages in order
        if (queue && this._pendingMessages.length > 0) {
            this._pendingMessages.push(msg);
            return;
        }
        // Send if the ws allows it, otherwise queue the message.
        if (this.connectionStatus === 'connected' &&
            this._kernelSession !== RESTARTING_KERNEL_SESSION) {
            this._ws.send(this.serverSettings.serializer.serialize(msg, this._ws.protocol));
        }
        else if (queue) {
            this._pendingMessages.push(msg);
        }
        else {
            throw new Error('Could not send message');
        }
    }
    /**
     * Interrupt a kernel.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels).
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     *
     * It is assumed that the API call does not mutate the kernel id or name.
     *
     * The promise will be rejected if the kernel status is `Dead` or if the
     * request fails or the response is invalid.
     */
    async interrupt() {
        this.hasPendingInput = false;
        if (this.status === 'dead') {
            throw new Error('Kernel is dead');
        }
        return this._kernelAPIClient.interrupt(this.id);
    }
    /**
     * Request a kernel restart.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels)
     * and validates the response model.
     *
     * Any existing Future or Comm objects are cleared once the kernel has
     * actually be restarted.
     *
     * The promise is fulfilled on a valid server response (after the kernel restarts)
     * and rejected otherwise.
     *
     * It is assumed that the API call does not mutate the kernel id or name.
     *
     * The promise will be rejected if the request fails or the response is
     * invalid.
     */
    async restart() {
        if (this.status === 'dead') {
            throw new Error('Kernel is dead');
        }
        this._updateStatus('restarting');
        this._clearKernelState();
        this._kernelSession = RESTARTING_KERNEL_SESSION;
        await this._kernelAPIClient.restart(this.id);
        // Reconnect to the kernel to address cases where kernel ports
        // have changed during the restart.
        await this.reconnect();
        this.hasPendingInput = false;
    }
    /**
     * Reconnect to a kernel.
     *
     * #### Notes
     * This may try multiple times to reconnect to a kernel, and will sever any
     * existing connection.
     */
    reconnect() {
        this._errorIfDisposed();
        const result = new coreutils_2.PromiseDelegate();
        // Set up a listener for the connection status changing, which accepts or
        // rejects after the retries are done.
        const fulfill = (sender, status) => {
            if (status === 'connected') {
                result.resolve();
                this.connectionStatusChanged.disconnect(fulfill, this);
            }
            else if (status === 'disconnected') {
                result.reject(new Error('Kernel connection disconnected'));
                this.connectionStatusChanged.disconnect(fulfill, this);
            }
        };
        this.connectionStatusChanged.connect(fulfill, this);
        // Reset the reconnect limit so we start the connection attempts fresh
        this._reconnectAttempt = 0;
        // Start the reconnection process, which will also clear any existing
        // connection.
        this._reconnect();
        // Return the promise that should resolve on connection or reject if the
        // retries don't work.
        return result.promise;
    }
    /**
     * Shutdown a kernel.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels).
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     *
     * On a valid response, disposes this kernel connection.
     *
     * If the kernel is already `dead`, disposes this kernel connection without
     * a server request.
     */
    async shutdown() {
        if (this.status !== 'dead') {
            await this._kernelAPIClient.shutdown(this.id);
        }
        this.handleShutdown();
    }
    /**
     * Handles a kernel shutdown.
     *
     * #### Notes
     * This method should be called if we know from outside information that a
     * kernel is dead (for example, we cannot find the kernel model on the
     * server).
     */
    handleShutdown() {
        this._updateStatus('dead');
        this.dispose();
    }
    /**
     * Send a `kernel_info_request` message.
     *
     * #### Notes
     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#kernel-info).
     *
     * Fulfills with the `kernel_info_response` content when the shell reply is
     * received and validated.
     */
    async requestKernelInfo() {
        const msg = KernelMessage.createMessage({
            msgType: 'kernel_info_request',
            channel: 'shell',
            username: this._username,
            session: this._clientId,
            subshellId: this._subshellId,
            content: {}
        });
        let reply;
        try {
            reply = (await Private.handleShellMessage(this, msg));
        }
        catch (e) {
            // If we rejected because the future was disposed, ignore and return.
            if (this.isDisposed) {
                return;
            }
            else {
                throw e;
            }
        }
        this._errorIfDisposed();
        if (!reply) {
            return;
        }
        // Kernels sometimes do not include a status field on kernel_info_reply
        // messages, so set a default for now.
        // See https://github.com/jupyterlab/jupyterlab/issues/6760
        if (reply.content.status === undefined) {
            reply.content.status = 'ok';
        }
        if (reply.content.status !== 'ok') {
            this._info.reject('Kernel info reply errored');
            return reply;
        }
        this._info.resolve(reply.content);
        this._kernelSession = reply.header.session;
        const supportedFeatures = reply.content.supported_features;
        this._supportsSubshells =
            supportedFeatures !== undefined &&
                supportedFeatures.includes('kernel subshells');
        return reply;
    }
    /**
     * Send a `complete_request` message.
     *
     * #### Notes
     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#completion).
     *
     * Fulfills with the `complete_reply` content when the shell reply is
     * received and validated.
     */
    requestComplete(content) {
        const msg = KernelMessage.createMessage({
            msgType: 'complete_request',
            channel: 'shell',
            username: this._username,
            session: this._clientId,
            subshellId: this._subshellId,
            content
        });
        return Private.handleShellMessage(this, msg);
    }
    /**
     * Send an `inspect_request` message.
     *
     * #### Notes
     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#introspection).
     *
     * Fulfills with the `inspect_reply` content when the shell reply is
     * received and validated.
     */
    requestInspect(content) {
        const msg = KernelMessage.createMessage({
            msgType: 'inspect_request',
            channel: 'shell',
            username: this._username,
            session: this._clientId,
            subshellId: this._subshellId,
            content: content
        });
        return Private.handleShellMessage(this, msg);
    }
    /**
     * Send a `history_request` message.
     *
     * #### Notes
     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#history).
     *
     * Fulfills with the `history_reply` content when the shell reply is
     * received and validated.
     */
    requestHistory(content) {
        const msg = KernelMessage.createMessage({
            msgType: 'history_request',
            channel: 'shell',
            username: this._username,
            session: this._clientId,
            subshellId: this._subshellId,
            content
        });
        return Private.handleShellMessage(this, msg);
    }
    /**
     * Send an `execute_request` message.
     *
     * #### Notes
     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#execute).
     *
     * Future `onReply` is called with the `execute_reply` content when the
     * shell reply is received and validated. The future will resolve when
     * this message is received and the `idle` iopub status is received.
     * The future will also be disposed at this point unless `disposeOnDone`
     * is specified and `false`, in which case it is up to the caller to dispose
     * of the future.
     *
     * **See also:** [[IExecuteReply]]
     */
    requestExecute(content, disposeOnDone = true, metadata) {
        const defaults = {
            silent: false,
            store_history: true,
            user_expressions: {},
            allow_stdin: true,
            stop_on_error: false
        };
        const msg = KernelMessage.createMessage({
            msgType: 'execute_request',
            channel: 'shell',
            username: this._username,
            session: this._clientId,
            subshellId: this._subshellId,
            content: { ...defaults, ...content },
            metadata
        });
        return this.sendShellMessage(msg, true, disposeOnDone);
    }
    /**
     * Send an experimental `debug_request` message.
     *
     * @hidden
     *
     * #### Notes
     * Debug messages are experimental messages that are not in the official
     * kernel message specification. As such, this function is *NOT* considered
     * part of the public API, and may change without notice.
     */
    requestDebug(content, disposeOnDone = true) {
        const msg = KernelMessage.createMessage({
            msgType: 'debug_request',
            channel: 'control',
            username: this._username,
            session: this._clientId,
            content
        });
        return this.sendControlMessage(msg, true, disposeOnDone);
    }
    /**
     * Send a `create_subshell_request` message.
     *
     * https://github.com/jupyter/enhancement-proposals/pull/91
     */
    requestCreateSubshell(content, disposeOnDone = true) {
        if (!this.supportsSubshells) {
            throw new Error('Kernel subshells are not supported');
        }
        const msg = KernelMessage.createMessage({
            msgType: 'create_subshell_request',
            channel: 'control',
            username: this._username,
            session: this._clientId,
            content
        });
        return this.sendControlMessage(msg, true, disposeOnDone);
    }
    /**
     * Send a `delete_subshell_request` message.
     *
     * https://github.com/jupyter/enhancement-proposals/pull/91
     */
    requestDeleteSubshell(content, disposeOnDone = true) {
        if (!this.supportsSubshells) {
            throw new Error('Kernel subshells are not supported');
        }
        const msg = KernelMessage.createMessage({
            msgType: 'delete_subshell_request',
            channel: 'control',
            username: this._username,
            session: this._clientId,
            content
        });
        return this.sendControlMessage(msg, true, disposeOnDone);
    }
    /**
     * Send a `list_subshell_request` message.
     *
     * https://github.com/jupyter/enhancement-proposals/pull/91
     */
    requestListSubshell(content, disposeOnDone = true) {
        if (!this.supportsSubshells) {
            throw new Error('Kernel subshells are not supported');
        }
        const msg = KernelMessage.createMessage({
            msgType: 'list_subshell_request',
            channel: 'control',
            username: this._username,
            session: this._clientId,
            content
        });
        return this.sendControlMessage(msg, true, disposeOnDone);
    }
    /**
     * Send an `is_complete_request` message.
     *
     * #### Notes
     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#code-completeness).
     *
     * Fulfills with the `is_complete_response` content when the shell reply is
     * received and validated.
     */
    requestIsComplete(content) {
        const msg = KernelMessage.createMessage({
            msgType: 'is_complete_request',
            channel: 'shell',
            username: this._username,
            session: this._clientId,
            subshellId: this._subshellId,
            content
        });
        return Private.handleShellMessage(this, msg);
    }
    /**
     * Send a `comm_info_request` message.
     *
     * #### Notes
     * Fulfills with the `comm_info_reply` content when the shell reply is
     * received and validated.
     */
    requestCommInfo(content) {
        const msg = KernelMessage.createMessage({
            msgType: 'comm_info_request',
            channel: 'shell',
            username: this._username,
            session: this._clientId,
            subshellId: this._subshellId,
            content
        });
        return Private.handleShellMessage(this, msg);
    }
    /**
     * Send an `input_reply` message.
     *
     * #### Notes
     * See [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/latest/messaging.html#messages-on-the-stdin-router-dealer-sockets).
     */
    sendInputReply(content, parent_header) {
        const msg = KernelMessage.createMessage({
            msgType: 'input_reply',
            channel: 'stdin',
            username: this._username,
            session: this._clientId,
            content
        });
        msg.parent_header = parent_header;
        this._sendMessage(msg);
        this._anyMessage.emit({ msg, direction: 'send' });
        this.hasPendingInput = false;
    }
    /**
     * Create a new comm.
     *
     * #### Notes
     * If a client-side comm already exists with the given commId, an error is thrown.
     * If the kernel does not handle comms, an error is thrown.
     */
    createComm(targetName, commId = coreutils_2.UUID.uuid4()) {
        if (!this.handleComms) {
            throw new Error('Comms are disabled on this kernel connection');
        }
        if (this._comms.has(commId)) {
            throw new Error('Comm is already created');
        }
        const comm = new comm_1.CommHandler(targetName, commId, this, () => {
            this._unregisterComm(commId);
        }, this._commsOverSubshells);
        this._comms.set(commId, comm);
        return comm;
    }
    /**
     * Check if a comm exists.
     */
    hasComm(commId) {
        return this._comms.has(commId);
    }
    /**
     * Register a comm target handler.
     *
     * @param targetName - The name of the comm target.
     *
     * @param callback - The callback invoked for a comm open message.
     *
     * @returns A disposable used to unregister the comm target.
     *
     * #### Notes
     * Only one comm target can be registered to a target name at a time, an
     * existing callback for the same target name will be overridden.  A registered
     * comm target handler will take precedence over a comm which specifies a
     * `target_module`.
     *
     * If the callback returns a promise, kernel message processing will pause
     * until the returned promise is fulfilled.
     */
    registerCommTarget(targetName, callback) {
        if (!this.handleComms) {
            return;
        }
        this._targetRegistry[targetName] = callback;
    }
    /**
     * Remove a comm target handler.
     *
     * @param targetName - The name of the comm target to remove.
     *
     * @param callback - The callback to remove.
     *
     * #### Notes
     * The comm target is only removed if the callback argument matches.
     */
    removeCommTarget(targetName, callback) {
        if (!this.handleComms) {
            return;
        }
        if (!this.isDisposed && this._targetRegistry[targetName] === callback) {
            delete this._targetRegistry[targetName];
        }
    }
    /**
     * Register an IOPub message hook.
     *
     * @param msgId - The parent_header message id the hook will intercept.
     *
     * @param hook - The callback invoked for the message.
     *
     * #### Notes
     * The IOPub hook system allows you to preempt the handlers for IOPub
     * messages that are responses to a given message id.
     *
     * The most recently registered hook is run first. A hook can return a
     * boolean or a promise to a boolean, in which case all kernel message
     * processing pauses until the promise is fulfilled. If a hook return value
     * resolves to false, any later hooks will not run and the function will
     * return a promise resolving to false. If a hook throws an error, the error
     * is logged to the console and the next hook is run. If a hook is
     * registered during the hook processing, it will not run until the next
     * message. If a hook is removed during the hook processing, it will be
     * deactivated immediately.
     *
     * See also [[IFuture.registerMessageHook]].
     */
    registerMessageHook(msgId, hook) {
        var _a;
        const future = (_a = this._futures) === null || _a === void 0 ? void 0 : _a.get(msgId);
        if (future) {
            future.registerMessageHook(hook);
        }
    }
    /**
     * Remove an IOPub message hook.
     *
     * @param msgId - The parent_header message id the hook intercepted.
     *
     * @param hook - The callback invoked for the message.
     *
     */
    removeMessageHook(msgId, hook) {
        var _a;
        const future = (_a = this._futures) === null || _a === void 0 ? void 0 : _a.get(msgId);
        if (future) {
            future.removeMessageHook(hook);
        }
    }
    /**
     * Remove the input guard, if any.
     */
    removeInputGuard() {
        this.hasPendingInput = false;
    }
    /**
     * Handle a message with a display id.
     *
     * @returns Whether the message was handled.
     */
    async _handleDisplayId(displayId, msg) {
        var _a, _b;
        const msgId = msg.parent_header.msg_id;
        let parentIds = this._displayIdToParentIds.get(displayId);
        if (parentIds) {
            // We've seen it before, update existing outputs with same display_id
            // by handling display_data as update_display_data.
            const updateMsg = {
                header: coreutils_2.JSONExt.deepCopy(msg.header),
                parent_header: coreutils_2.JSONExt.deepCopy(msg.parent_header),
                metadata: coreutils_2.JSONExt.deepCopy(msg.metadata),
                content: coreutils_2.JSONExt.deepCopy(msg.content),
                channel: msg.channel,
                buffers: msg.buffers ? msg.buffers.slice() : []
            };
            updateMsg.header.msg_type = 'update_display_data';
            await Promise.all(parentIds.map(async (parentId) => {
                const future = this._futures && this._futures.get(parentId);
                if (future) {
                    await future.handleMsg(updateMsg);
                }
            }));
        }
        // We're done here if it's update_display.
        if (msg.header.msg_type === 'update_display_data') {
            // It's an update, don't proceed to the normal display.
            return true;
        }
        // Regular display_data with id, record it for future updating
        // in _displayIdToParentIds for future lookup.
        parentIds = (_a = this._displayIdToParentIds.get(displayId)) !== null && _a !== void 0 ? _a : [];
        if (parentIds.indexOf(msgId) === -1) {
            parentIds.push(msgId);
        }
        this._displayIdToParentIds.set(displayId, parentIds);
        // Add to our map of display ids for this message.
        const displayIds = (_b = this._msgIdToDisplayIds.get(msgId)) !== null && _b !== void 0 ? _b : [];
        if (displayIds.indexOf(msgId) === -1) {
            displayIds.push(msgId);
        }
        this._msgIdToDisplayIds.set(msgId, displayIds);
        // Let the message propagate to the intended recipient.
        return false;
    }
    /**
     * Forcefully clear the socket state.
     *
     * #### Notes
     * This will clear all socket state without calling any handlers and will
     * not update the connection status. If you call this method, you are
     * responsible for updating the connection status as needed and recreating
     * the socket if you plan to reconnect.
     */
    _clearSocket() {
        if (this._ws !== null) {
            // Clear the websocket event handlers and the socket itself.
            this._ws.onopen = this._noOp;
            this._ws.onclose = this._noOp;
            this._ws.onerror = this._noOp;
            this._ws.onmessage = this._noOp;
            this._ws.close();
            this._ws = null;
        }
    }
    /**
     * Handle status iopub messages from the kernel.
     */
    _updateStatus(status) {
        if (this._status === status || this._status === 'dead') {
            return;
        }
        this._status = status;
        Private.logKernelStatus(this);
        this._statusChanged.emit(status);
        if (status === 'dead') {
            this.dispose();
        }
    }
    /**
     * Send pending messages to the kernel.
     */
    _sendPending() {
        // We check to make sure we are still connected each time. For
        // example, if a websocket buffer overflows, it may close, so we should
        // stop sending messages.
        while (this.connectionStatus === 'connected' &&
            this._kernelSession !== RESTARTING_KERNEL_SESSION &&
            this._pendingMessages.length > 0) {
            this._sendMessage(this._pendingMessages[0], false);
            // We shift the message off the queue after the message is sent so that
            // if there is an exception, the message is still pending.
            this._pendingMessages.shift();
        }
    }
    /**
     * Clear the internal state.
     */
    _clearKernelState() {
        this._kernelSession = '';
        this._pendingMessages = [];
        this._futures.forEach(future => {
            future.dispose();
        });
        this._comms.forEach(comm => {
            comm.dispose();
        });
        this._msgChain = Promise.resolve();
        this._futures = new Map();
        this._comms = new Map();
        this._displayIdToParentIds.clear();
        this._msgIdToDisplayIds.clear();
    }
    /**
     * Check to make sure it is okay to proceed to handle a message.
     *
     * #### Notes
     * Because we handle messages asynchronously, before a message is handled the
     * kernel might be disposed or restarted (and have a different session id).
     * This function throws an error in each of these cases. This is meant to be
     * called at the start of an asynchronous message handler to cancel message
     * processing if the message no longer is valid.
     */
    _assertCurrentMessage(msg) {
        this._errorIfDisposed();
        if (msg.header.session !== this._kernelSession) {
            throw new Error(`Canceling handling of old message: ${msg.header.msg_type}`);
        }
    }
    /**
     * Handle a `comm_open` kernel message.
     */
    async _handleCommOpen(msg) {
        this._assertCurrentMessage(msg);
        const content = msg.content;
        const comm = new comm_1.CommHandler(content.target_name, content.comm_id, this, () => {
            this._unregisterComm(content.comm_id);
        }, this.commsOverSubshells);
        this._comms.set(content.comm_id, comm);
        try {
            const target = await Private.loadObject(content.target_name, content.target_module, this._targetRegistry);
            await target(comm, msg);
        }
        catch (e) {
            // Close the comm asynchronously. We cannot block message processing on
            // kernel messages to wait for another kernel message.
            comm.close();
            console.error('Exception opening new comm');
            throw e;
        }
    }
    /**
     * Handle 'comm_close' kernel message.
     */
    async _handleCommClose(msg) {
        this._assertCurrentMessage(msg);
        const content = msg.content;
        const comm = this._comms.get(content.comm_id);
        if (!comm) {
            console.error('Comm not found for comm id ' + content.comm_id);
            return;
        }
        this._unregisterComm(comm.commId);
        const onClose = comm.onClose;
        if (onClose) {
            // tslint:disable-next-line:await-promise
            await onClose(msg);
        }
        comm.dispose();
    }
    /**
     * Handle a 'comm_msg' kernel message.
     */
    async _handleCommMsg(msg) {
        this._assertCurrentMessage(msg);
        const content = msg.content;
        const comm = this._comms.get(content.comm_id);
        if (!comm) {
            return;
        }
        const onMsg = comm.onMsg;
        if (onMsg) {
            // tslint:disable-next-line:await-promise
            await onMsg(msg);
        }
    }
    /**
     * Unregister a comm instance.
     */
    _unregisterComm(commId) {
        this._comms.delete(commId);
    }
    /**
     * Handle connection status changes.
     */
    _updateConnectionStatus(connectionStatus) {
        if (this._connectionStatus === connectionStatus) {
            return;
        }
        this._connectionStatus = connectionStatus;
        // If we are not 'connecting', reset any reconnection attempts.
        if (connectionStatus !== 'connecting') {
            this._reconnectAttempt = 0;
            clearTimeout(this._reconnectTimeout);
        }
        if (this.status !== 'dead') {
            if (connectionStatus === 'connected') {
                let restarting = this._kernelSession === RESTARTING_KERNEL_SESSION;
                // Send a kernel info request to make sure we send at least one
                // message to get kernel status back. Always request kernel info
                // first, to get kernel status back and ensure iopub is fully
                // established. If we are restarting, this message will skip the queue
                // and be sent immediately.
                let p = this.requestKernelInfo();
                // Send any pending messages after the kernelInfo resolves, or after a
                // timeout as a failsafe.
                let sendPendingCalled = false;
                let sendPendingOnce = () => {
                    if (sendPendingCalled) {
                        return;
                    }
                    sendPendingCalled = true;
                    if (restarting && this._kernelSession === RESTARTING_KERNEL_SESSION) {
                        // We were restarting and a message didn't arrive to set the
                        // session, but we just assume the restart succeeded and send any
                        // pending messages.
                        // FIXME: it would be better to retry the kernel_info_request here
                        this._kernelSession = '';
                    }
                    clearTimeout(timeoutHandle);
                    if (this._pendingMessages.length > 0) {
                        this._sendPending();
                    }
                };
                void p.then(sendPendingOnce);
                // FIXME: if sent while zmq subscriptions are not established,
                // kernelInfo may not resolve, so use a timeout to ensure we don't hang forever.
                // It may be preferable to retry kernelInfo rather than give up after one timeout.
                let timeoutHandle = setTimeout(sendPendingOnce, KERNEL_INFO_TIMEOUT);
            }
            else {
                // If the connection is down, then we do not know what is happening
                // with the kernel, so set the status to unknown.
                this._updateStatus('unknown');
            }
        }
        // Notify others that the connection status changed.
        this._connectionStatusChanged.emit(connectionStatus);
    }
    async _handleMessage(msg) {
        var _a, _b;
        let handled = false;
        // Check to see if we have a display_id we need to reroute.
        if (msg.parent_header &&
            msg.channel === 'iopub' &&
            (KernelMessage.isDisplayDataMsg(msg) ||
                KernelMessage.isUpdateDisplayDataMsg(msg) ||
                KernelMessage.isExecuteResultMsg(msg))) {
            // display_data messages may re-route based on their display_id.
            const transient = ((_a = msg.content.transient) !== null && _a !== void 0 ? _a : {});
            const displayId = transient['display_id'];
            if (displayId) {
                handled = await this._handleDisplayId(displayId, msg);
                // The await above may make this message out of date, so check again.
                this._assertCurrentMessage(msg);
            }
        }
        if (!handled && msg.parent_header) {
            const parentHeader = msg.parent_header;
            const future = (_b = this._futures) === null || _b === void 0 ? void 0 : _b.get(parentHeader.msg_id);
            if (future) {
                await future.handleMsg(msg);
                this._assertCurrentMessage(msg);
            }
            else {
                // If the message was sent by us and was not iopub, it is orphaned.
                const owned = parentHeader.session === this.clientId;
                if (msg.channel !== 'iopub' && owned) {
                    this._unhandledMessage.emit(msg);
                }
            }
        }
        if (msg.channel === 'iopub') {
            switch (msg.header.msg_type) {
                case 'status': {
                    const untrackedMessageTypesRaw = coreutils_3.PageConfig.getOption('untracked_message_types');
                    let untrackedMessageTypes = JSON.parse(untrackedMessageTypesRaw || '[]');
                    if (untrackedMessageTypes.includes(msg.parent_header.msg_type)) {
                        break;
                    }
                    // Updating the status is synchronous, and we call no async user code
                    const executionState = msg.content
                        .execution_state;
                    if (executionState === 'restarting') {
                        // The kernel has been auto-restarted by the server. After
                        // processing for this message is completely done, we want to
                        // handle this restart, so we don't await, but instead schedule
                        // the work as a microtask (i.e., in a promise resolution). We
                        // schedule this here so that it comes before any microtasks that
                        // might be scheduled in the status signal emission below.
                        void Promise.resolve().then(async () => {
                            this._updateStatus('autorestarting');
                            this._clearKernelState();
                            // We must reconnect since the kernel connection information may have
                            // changed, and the server only refreshes its zmq connection when a new
                            // websocket is opened.
                            await this.reconnect();
                        });
                    }
                    this._updateStatus(executionState);
                    break;
                }
                case 'comm_open':
                    if (this.handleComms) {
                        await this._handleCommOpen(msg);
                    }
                    break;
                case 'comm_msg':
                    if (this.handleComms) {
                        await this._handleCommMsg(msg);
                    }
                    break;
                case 'comm_close':
                    if (this.handleComms) {
                        await this._handleCommClose(msg);
                    }
                    break;
                default:
                    break;
            }
            // If the message was a status dead message, we might have disposed ourselves.
            if (!this.isDisposed) {
                this._assertCurrentMessage(msg);
                // the message wouldn't be emitted if we were disposed anyway.
                this._iopubMessage.emit(msg);
            }
        }
    }
    /**
     * Attempt a connection if we have not exhausted connection attempts.
     */
    _reconnect() {
        this._errorIfDisposed();
        // Clear any existing reconnection attempt
        clearTimeout(this._reconnectTimeout);
        // Update the connection status and schedule a possible reconnection.
        if (this._reconnectAttempt < this._reconnectLimit) {
            this._updateConnectionStatus('connecting');
            // The first reconnect attempt should happen immediately, and subsequent
            // attempts should pick a random number in a growing range so that we
            // don't overload the server with synchronized reconnection attempts
            // across multiple kernels.
            const timeout = Private.getRandomIntInclusive(0, 1e3 * (Math.pow(2, this._reconnectAttempt) - 1));
            console.warn(`Connection lost, reconnecting in ${Math.floor(timeout / 1000)} seconds.`);
            // Try reconnection with subprotocols if the server had supported them.
            // Otherwise, try reconnection without subprotocols.
            const useProtocols = this._selectedProtocol !== '' ? true : false;
            this._reconnectTimeout = setTimeout(this._createSocket, timeout, useProtocols);
            this._reconnectAttempt += 1;
        }
        else {
            this._updateConnectionStatus('disconnected');
        }
        // Clear the websocket event handlers and the socket itself.
        this._clearSocket();
    }
    /**
     * Utility function to throw an error if this instance is disposed.
     */
    _errorIfDisposed() {
        if (this.isDisposed) {
            throw new Error('Kernel connection is disposed');
        }
    }
    get hasPendingInput() {
        return this._hasPendingInput;
    }
    set hasPendingInput(value) {
        this._hasPendingInput = value;
        this._pendingInput.emit(value);
    }
}
exports.KernelConnection = KernelConnection;
/**
 * A private namespace for the Kernel.
 */
var Private;
(function (Private) {
    /**
     * Log the current kernel status.
     */
    function logKernelStatus(kernel) {
        switch (kernel.status) {
            case 'idle':
            case 'busy':
            case 'unknown':
                return;
            default:
                console.debug(`Kernel: ${kernel.status} (${kernel.id})`);
                break;
        }
    }
    Private.logKernelStatus = logKernelStatus;
    /**
     * Send a kernel message to the kernel and resolve the reply message.
     */
    async function handleShellMessage(kernel, msg) {
        const future = kernel.sendShellMessage(msg, true);
        return future.done;
    }
    Private.handleShellMessage = handleShellMessage;
    /**
     * Try to load an object from a module or a registry.
     *
     * Try to load an object from a module asynchronously if a module
     * is specified, otherwise tries to load an object from the global
     * registry, if the global registry is provided.
     *
     * #### Notes
     * Loading a module uses requirejs.
     */
    function loadObject(name, moduleName, registry) {
        return new Promise((resolve, reject) => {
            // Try loading the module using require.js
            if (moduleName) {
                if (typeof requirejs === 'undefined') {
                    throw new Error('requirejs not found');
                }
                requirejs([moduleName], (mod) => {
                    if (mod[name] === void 0) {
                        const msg = `Object '${name}' not found in module '${moduleName}'`;
                        reject(new Error(msg));
                    }
                    else {
                        resolve(mod[name]);
                    }
                }, reject);
            }
            else {
                if (registry === null || registry === void 0 ? void 0 : registry[name]) {
                    resolve(registry[name]);
                }
                else {
                    reject(new Error(`Object '${name}' not found in registry`));
                }
            }
        });
    }
    Private.loadObject = loadObject;
    /**
     * Get a random integer between min and max, inclusive of both.
     *
     * #### Notes
     * From
     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive
     *
     * From the MDN page: It might be tempting to use Math.round() to accomplish
     * that, but doing so would cause your random numbers to follow a non-uniform
     * distribution, which may not be acceptable for your needs.
     */
    function getRandomIntInclusive(min, max) {
        min = Math.ceil(min);
        max = Math.floor(max);
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }
    Private.getRandomIntInclusive = getRandomIntInclusive;
})(Private || (Private = {}));
//# sourceMappingURL=default.js.map

/***/ }),

/***/ 77489:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KernelShellFutureHandler = exports.KernelControlFutureHandler = exports.KernelFutureHandler = void 0;
const coreutils_1 = __webpack_require__(72215);
const disposable_1 = __webpack_require__(61533);
const KernelMessage = __importStar(__webpack_require__(70552));
/**
 * Implementation of a kernel future.
 *
 * If a reply is expected, the Future is considered done when both a `reply`
 * message and an `idle` iopub status message have been received.  Otherwise, it
 * is considered done when the `idle` status is received.
 *
 */
class KernelFutureHandler extends disposable_1.DisposableDelegate {
    /**
     * Construct a new KernelFutureHandler.
     */
    constructor(cb, msg, expectReply, disposeOnDone, kernel) {
        super(cb);
        this._status = 0;
        this._stdin = Private.noOp;
        this._iopub = Private.noOp;
        this._reply = Private.noOp;
        this._done = new coreutils_1.PromiseDelegate();
        this._hooks = new Private.HookList();
        this._disposeOnDone = true;
        this._msg = msg;
        if (!expectReply) {
            this._setFlag(Private.KernelFutureFlag.GotReply);
        }
        this._disposeOnDone = disposeOnDone;
        this._kernel = kernel;
    }
    /**
     * Get the original outgoing message.
     */
    get msg() {
        return this._msg;
    }
    /**
     * A promise that resolves when the future is done.
     */
    get done() {
        return this._done.promise;
    }
    /**
     * Get the reply handler.
     */
    get onReply() {
        return this._reply;
    }
    /**
     * Set the reply handler.
     */
    set onReply(cb) {
        this._reply = cb;
    }
    /**
     * Get the iopub handler.
     */
    get onIOPub() {
        return this._iopub;
    }
    /**
     * Set the iopub handler.
     */
    set onIOPub(cb) {
        this._iopub = cb;
    }
    /**
     * Get the stdin handler.
     */
    get onStdin() {
        return this._stdin;
    }
    /**
     * Set the stdin handler.
     */
    set onStdin(cb) {
        this._stdin = cb;
    }
    /**
     * Register hook for IOPub messages.
     *
     * @param hook - The callback invoked for an IOPub message.
     *
     * #### Notes
     * The IOPub hook system allows you to preempt the handlers for IOPub
     * messages handled by the future.
     *
     * The most recently registered hook is run first. A hook can return a
     * boolean or a promise to a boolean, in which case all kernel message
     * processing pauses until the promise is fulfilled. If a hook return value
     * resolves to false, any later hooks will not run and the function will
     * return a promise resolving to false. If a hook throws an error, the error
     * is logged to the console and the next hook is run. If a hook is
     * registered during the hook processing, it will not run until the next
     * message. If a hook is removed during the hook processing, it will be
     * deactivated immediately.
     */
    registerMessageHook(hook) {
        if (this.isDisposed) {
            throw new Error('Kernel future is disposed');
        }
        this._hooks.add(hook);
    }
    /**
     * Remove a hook for IOPub messages.
     *
     * @param hook - The hook to remove.
     *
     * #### Notes
     * If a hook is removed during the hook processing, it will be deactivated immediately.
     */
    removeMessageHook(hook) {
        if (this.isDisposed) {
            return;
        }
        this._hooks.remove(hook);
    }
    /**
     * Send an `input_reply` message.
     */
    sendInputReply(content, parent_header) {
        this._kernel.sendInputReply(content, parent_header);
    }
    /**
     * Dispose and unregister the future.
     */
    dispose() {
        this._stdin = Private.noOp;
        this._iopub = Private.noOp;
        this._reply = Private.noOp;
        this._hooks = null;
        if (!this._testFlag(Private.KernelFutureFlag.IsDone)) {
            // TODO: Uncomment the following logging code, and check for any tests that trigger it.
            // let status = [];
            // if (!this._testFlag(Private.KernelFutureFlag.GotIdle)) {
            //   status.push('idle');
            // }
            // if (!this._testFlag(Private.KernelFutureFlag.GotReply)) {
            //   status.push('reply');
            // }
            // console.warn(
            //   `*************** DISPOSED BEFORE DONE: K${this._kernel.id.slice(
            //     0,
            //     6
            //   )} M${this._msg.header.msg_id.slice(0, 6)} missing ${status.join(' ')}`
            // );
            // Reject the `done` promise, but catch its error here in case no one else
            // is waiting for the promise to resolve. This prevents the error from
            // being displayed in the console, but does not prevent it from being
            // caught by a client who is waiting for it.
            // Note: any `.then` and `.finally` attached to the `done` promise
            // will cause the error to be thrown as uncaught anyways.
            this._done.promise.catch(() => {
                /* no-op */
            });
            this._done.reject(new Error(`Canceled future for ${this.msg.header.msg_type} message before replies were done`));
        }
        super.dispose();
    }
    /**
     * Handle an incoming kernel message.
     */
    async handleMsg(msg) {
        switch (msg.channel) {
            case 'control':
            case 'shell':
                if (msg.channel === this.msg.channel &&
                    msg.parent_header.msg_id === this.msg.header.msg_id) {
                    await this._handleReply(msg);
                }
                break;
            case 'stdin':
                await this._handleStdin(msg);
                break;
            case 'iopub':
                await this._handleIOPub(msg);
                break;
            default:
                break;
        }
    }
    async _handleReply(msg) {
        const reply = this._reply;
        if (reply) {
            // tslint:disable-next-line:await-promise
            await reply(msg);
        }
        this._replyMsg = msg;
        this._setFlag(Private.KernelFutureFlag.GotReply);
        if (this._testFlag(Private.KernelFutureFlag.GotIdle)) {
            this._handleDone();
        }
    }
    async _handleStdin(msg) {
        this._kernel.hasPendingInput = true;
        const stdin = this._stdin;
        if (stdin) {
            // tslint:disable-next-line:await-promise
            await stdin(msg);
        }
    }
    async _handleIOPub(msg) {
        const process = await this._hooks.process(msg);
        const iopub = this._iopub;
        if (process && iopub) {
            // tslint:disable-next-line:await-promise
            await iopub(msg);
        }
        if (KernelMessage.isStatusMsg(msg) &&
            msg.content.execution_state === 'idle') {
            this._setFlag(Private.KernelFutureFlag.GotIdle);
            if (this._testFlag(Private.KernelFutureFlag.GotReply)) {
                this._handleDone();
            }
        }
    }
    _handleDone() {
        if (this._testFlag(Private.KernelFutureFlag.IsDone)) {
            return;
        }
        this._setFlag(Private.KernelFutureFlag.IsDone);
        this._done.resolve(this._replyMsg);
        if (this._disposeOnDone) {
            this.dispose();
        }
    }
    /**
     * Test whether the given future flag is set.
     */
    _testFlag(flag) {
        // tslint:disable-next-line
        return (this._status & flag) !== 0;
    }
    /**
     * Set the given future flag.
     */
    _setFlag(flag) {
        // tslint:disable-next-line
        this._status |= flag;
    }
}
exports.KernelFutureHandler = KernelFutureHandler;
class KernelControlFutureHandler extends KernelFutureHandler {
}
exports.KernelControlFutureHandler = KernelControlFutureHandler;
class KernelShellFutureHandler extends KernelFutureHandler {
}
exports.KernelShellFutureHandler = KernelShellFutureHandler;
var Private;
(function (Private) {
    /**
     * A no-op function.
     */
    Private.noOp = () => {
        /* no-op */
    };
    /**
     * Defer a computation.
     *
     * #### NOTES
     * We can't just use requestAnimationFrame since it is not available in node.
     * This implementation is from Phosphor:
     * https://github.com/phosphorjs/phosphor/blob/e88e4321289bb1198f3098e7bda40736501f2ed8/tests/test-messaging/src/index.spec.ts#L63
     */
    const defer = (() => {
        const ok = typeof requestAnimationFrame === 'function';
        return ok ? requestAnimationFrame : setImmediate;
    })();
    class HookList {
        constructor() {
            this._hooks = [];
        }
        /**
         * Register a hook.
         *
         * @param hook - The callback to register.
         */
        add(hook) {
            this.remove(hook);
            this._hooks.push(hook);
        }
        /**
         * Remove a hook, if it exists in the hook list.
         *
         * @param hook - The callback to remove.
         */
        remove(hook) {
            const index = this._hooks.indexOf(hook);
            if (index >= 0) {
                this._hooks[index] = null;
                this._scheduleCompact();
            }
        }
        /**
         * Process a message through the hooks.
         *
         * @returns a promise resolving to false if any hook resolved as false,
         * otherwise true
         *
         * #### Notes
         * The most recently registered hook is run first. A hook can return a
         * boolean or a promise to a boolean, in which case processing pauses until
         * the promise is fulfilled. If a hook return value resolves to false, any
         * later hooks will not run and the function will return a promise resolving
         * to false. If a hook throws an error, the error is logged to the console
         * and the next hook is run. If a hook is registered during the hook
         * processing, it will not run until the next message. If a hook is removed
         * during the hook processing, it will be deactivated immediately.
         */
        async process(msg) {
            // Wait until we can start a new process run.
            await this._processing;
            // Start the next process run.
            const processing = new coreutils_1.PromiseDelegate();
            this._processing = processing.promise;
            let continueHandling;
            // Call the end hook (most recently-added) first. Starting at the end also
            // guarantees that hooks added during the processing will not be run in
            // this process run.
            for (let i = this._hooks.length - 1; i >= 0; i--) {
                const hook = this._hooks[i];
                // If the hook has been removed, continue to the next one.
                if (hook === null) {
                    continue;
                }
                // Execute the hook and log any errors.
                try {
                    // tslint:disable-next-line:await-promise
                    continueHandling = await hook(msg);
                }
                catch (err) {
                    continueHandling = true;
                    console.error(err);
                }
                // If the hook resolved to false, stop processing and return.
                if (continueHandling === false) {
                    processing.resolve(undefined);
                    return false;
                }
            }
            // All hooks returned true (or errored out), so return true.
            processing.resolve(undefined);
            return true;
        }
        /**
         * Schedule a cleanup of the list, removing any hooks that have been nulled out.
         */
        _scheduleCompact() {
            if (!this._compactScheduled) {
                this._compactScheduled = true;
                // Schedule a compaction in between processing runs. We do the
                // scheduling in an animation frame to rate-limit our compactions. If we
                // need to compact more frequently, we can change this to directly
                // schedule the compaction.
                defer(() => {
                    this._processing = this._processing.then(() => {
                        this._compactScheduled = false;
                        this._compact();
                    });
                });
            }
        }
        /**
         * Compact the list, removing any nulls.
         */
        _compact() {
            let numNulls = 0;
            for (let i = 0, len = this._hooks.length; i < len; i++) {
                const hook = this._hooks[i];
                if (this._hooks[i] === null) {
                    numNulls++;
                }
                else {
                    this._hooks[i - numNulls] = hook;
                }
            }
            this._hooks.length -= numNulls;
        }
    }
    Private.HookList = HookList;
    /**
     * Bit flags for the kernel future state.
     */
    let KernelFutureFlag;
    (function (KernelFutureFlag) {
        KernelFutureFlag[KernelFutureFlag["GotReply"] = 1] = "GotReply";
        KernelFutureFlag[KernelFutureFlag["GotIdle"] = 2] = "GotIdle";
        KernelFutureFlag[KernelFutureFlag["IsDone"] = 4] = "IsDone";
        KernelFutureFlag[KernelFutureFlag["DisposeOnDone"] = 8] = "DisposeOnDone";
    })(KernelFutureFlag = Private.KernelFutureFlag || (Private.KernelFutureFlag = {}));
})(Private || (Private = {}));
//# sourceMappingURL=future.js.map

/***/ }),

/***/ 30335:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CommsOverSubshells = exports.KernelConnection = exports.KernelAPI = exports.KernelMessage = exports.Kernel = void 0;
// Namespace some of our modules for convenience and backwards compatibility.
const comm_1 = __webpack_require__(35139);
Object.defineProperty(exports, "CommsOverSubshells", ({ enumerable: true, get: function () { return comm_1.CommsOverSubshells; } }));
const Kernel = __importStar(__webpack_require__(56357));
exports.Kernel = Kernel;
const KernelMessage = __importStar(__webpack_require__(70552));
exports.KernelMessage = KernelMessage;
const KernelAPI = __importStar(__webpack_require__(33505));
exports.KernelAPI = KernelAPI;
const default_1 = __webpack_require__(45992);
Object.defineProperty(exports, "KernelConnection", ({ enumerable: true, get: function () { return default_1.KernelConnection; } }));
__exportStar(__webpack_require__(57729), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 56357:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=kernel.js.map

/***/ }),

/***/ 57729:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KernelManager = void 0;
const polling_1 = __webpack_require__(75205);
const signaling_1 = __webpack_require__(46257);
const __1 = __webpack_require__(83676);
const basemanager_1 = __webpack_require__(78037);
const restapi_1 = __webpack_require__(33505);
const default_1 = __webpack_require__(45992);
const restapi_2 = __webpack_require__(29723);
/**
 * An implementation of a kernel manager.
 */
class KernelManager extends basemanager_1.BaseManager {
    /**
     * Construct a new kernel manager.
     *
     * @param options - The default options for kernel.
     */
    constructor(options = {}) {
        var _a, _b, _c;
        super(options);
        this._commsOverSubshells = __1.CommsOverSubshells.PerCommTarget;
        this._isReady = false;
        this._kernelConnections = new Set();
        this._models = new Map();
        this._runningChanged = new signaling_1.Signal(this);
        this._connectionFailure = new signaling_1.Signal(this);
        this._kernelAPIClient =
            (_a = options.kernelAPIClient) !== null && _a !== void 0 ? _a : new restapi_1.KernelAPIClient({ serverSettings: this.serverSettings });
        this._kernelSpecAPIClient =
            (_b = options.kernelSpecAPIClient) !== null && _b !== void 0 ? _b : new restapi_2.KernelSpecAPIClient({
                serverSettings: this.serverSettings
            });
        // Start model and specs polling with exponential backoff.
        this._pollModels = new polling_1.Poll({
            auto: false,
            factory: () => this.requestRunning(),
            frequency: {
                interval: 10 * 1000,
                backoff: true,
                max: 300 * 1000
            },
            name: `@jupyterlab/services:KernelManager#models`,
            standby: (_c = options.standby) !== null && _c !== void 0 ? _c : 'when-hidden'
        });
        // Initialize internal data.
        this._ready = (async () => {
            await this._pollModels.start();
            await this._pollModels.tick;
            this._isReady = true;
        })();
    }
    /**
     * Test whether the manager is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that fulfills when the manager is ready.
     */
    get ready() {
        return this._ready;
    }
    /**
     * A signal emitted when the running kernels change.
     */
    get runningChanged() {
        return this._runningChanged;
    }
    /**
     * A signal emitted when there is a connection failure.
     */
    get connectionFailure() {
        return this._connectionFailure;
    }
    /**
     * Dispose of the resources used by the manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._models.clear();
        this._kernelConnections.forEach(x => x.dispose());
        this._pollModels.dispose();
        super.dispose();
    }
    /**
     * Connect to an existing kernel.
     *
     * @returns The new kernel connection.
     *
     * #### Notes
     * This will use the manager's server settings and ignore any server
     * settings passed in the options.
     */
    connectTo(options) {
        var _a;
        const { id } = options.model;
        let handleComms = (_a = options.handleComms) !== null && _a !== void 0 ? _a : true;
        // By default, handle comms only if no other kernel connection is.
        if (options.handleComms === undefined) {
            for (const kc of this._kernelConnections) {
                if (kc.id === id && kc.handleComms) {
                    handleComms = false;
                    break;
                }
            }
        }
        options.commsOverSubshells = this._commsOverSubshells;
        const kernelConnection = new default_1.KernelConnection({
            handleComms,
            ...options,
            serverSettings: this.serverSettings,
            kernelAPIClient: this._kernelAPIClient,
            kernelSpecAPIClient: this._kernelSpecAPIClient
        });
        this._onStarted(kernelConnection);
        if (!this._models.has(id)) {
            // We trust the user to connect to an existing kernel, but we verify
            // asynchronously.
            void this.refreshRunning().catch(() => {
                /* no-op */
            });
        }
        return kernelConnection;
    }
    /**
     * Create an iterator over the most recent running kernels.
     *
     * @returns A new iterator over the running kernels.
     */
    running() {
        return this._models.values();
    }
    /**
     * The number of running kernels.
     */
    get runningCount() {
        return this._models.size;
    }
    /**
     * Whether comms are running on subshell or not.
     */
    get commsOverSubshells() {
        return this._commsOverSubshells;
    }
    set commsOverSubshells(value) {
        this._commsOverSubshells = value;
        for (const connection of this._kernelConnections) {
            connection.commsOverSubshells = value;
        }
    }
    /**
     * Force a refresh of the running kernels.
     *
     * @returns A promise that resolves when the running list has been refreshed.
     *
     * #### Notes
     * This is not typically meant to be called by the user, since the
     * manager maintains its own internal state.
     */
    async refreshRunning() {
        await this._pollModels.refresh();
        await this._pollModels.tick;
    }
    /**
     * Start a new kernel.
     *
     * @param createOptions - The kernel creation options
     *
     * @param connectOptions - The kernel connection options
     *
     * @returns A promise that resolves with the kernel connection.
     *
     * #### Notes
     * The manager `serverSettings` will be always be used.
     */
    async startNew(createOptions = {}, connectOptions = {}) {
        const model = await this._kernelAPIClient.startNew(createOptions);
        return this.connectTo({
            ...connectOptions,
            model
        });
    }
    /**
     * Shut down a kernel by id.
     *
     * @param id - The id of the target kernel.
     *
     * @returns A promise that resolves when the operation is complete.
     */
    async shutdown(id) {
        await this._kernelAPIClient.shutdown(id);
        await this.refreshRunning();
    }
    /**
     * Shut down all kernels.
     *
     * @returns A promise that resolves when all of the kernels are shut down.
     */
    async shutdownAll() {
        // Update the list of models to make sure our list is current.
        await this.refreshRunning();
        // Shut down all models.
        await Promise.all([...this._models.keys()].map(id => this._kernelAPIClient.shutdown(id)));
        // Update the list of models to clear out our state.
        await this.refreshRunning();
    }
    /**
     * Find a kernel by id.
     *
     * @param id - The id of the target kernel.
     *
     * @returns A promise that resolves with the kernel's model.
     */
    async findById(id) {
        if (this._models.has(id)) {
            return this._models.get(id);
        }
        await this.refreshRunning();
        return this._models.get(id);
    }
    /**
     * Execute a request to the server to poll running kernels and update state.
     */
    async requestRunning() {
        var _a, _b;
        let models;
        try {
            models = await this._kernelAPIClient.listRunning();
        }
        catch (err) {
            // Handle network errors, as well as cases where we are on a
            // JupyterHub and the server is not running. JupyterHub returns a
            // 503 (<2.0) or 424 (>2.0) in that case.
            if (err instanceof __1.ServerConnection.NetworkError ||
                ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||
                ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {
                this._connectionFailure.emit(err);
            }
            throw err;
        }
        if (this.isDisposed) {
            return;
        }
        if (this._models.size === models.length &&
            models.every(model => {
                const existing = this._models.get(model.id);
                if (!existing) {
                    return false;
                }
                return (existing.connections === model.connections &&
                    existing.execution_state === model.execution_state &&
                    existing.last_activity === model.last_activity &&
                    existing.name === model.name &&
                    existing.reason === model.reason &&
                    existing.traceback === model.traceback);
            })) {
            // Identical models list (presuming models does not contain duplicate
            // ids), so just return
            return;
        }
        this._models = new Map(models.map(x => [x.id, x]));
        // For any kernel connection to a kernel that doesn't exist, notify it of
        // the shutdown.
        this._kernelConnections.forEach(kc => {
            if (!this._models.has(kc.id)) {
                kc.handleShutdown();
            }
        });
        this._runningChanged.emit(models);
    }
    /**
     * Handle a kernel starting.
     */
    _onStarted(kernelConnection) {
        this._kernelConnections.add(kernelConnection);
        kernelConnection.statusChanged.connect(this._onStatusChanged, this);
        kernelConnection.disposed.connect(this._onDisposed, this);
    }
    _onDisposed(kernelConnection) {
        this._kernelConnections.delete(kernelConnection);
        // A dispose emission could mean the server session is deleted, or that
        // the kernel JS object is disposed and the kernel still exists on the
        // server, so we refresh from the server to make sure we reflect the
        // server state.
        void this.refreshRunning().catch(() => {
            /* no-op */
        });
    }
    _onStatusChanged(kernelConnection, status) {
        if (status === 'dead') {
            // We asynchronously update our list of kernels, which asynchronously
            // will dispose them. We do not want to immediately dispose them because
            // there may be other signal handlers that want to be called.
            void this.refreshRunning().catch(() => {
                /* no-op */
            });
        }
    }
}
exports.KernelManager = KernelManager;
/**
 * The namespace for `KernelManager` class statics.
 */
(function (KernelManager) {
    /**
     * A no-op kernel manager to be used when starting kernels.
     */
    class NoopManager extends KernelManager {
        constructor() {
            super(...arguments);
            this._readyPromise = new Promise(() => {
                /* no-op */
            });
        }
        /**
         * Whether the manager is active.
         */
        get isActive() {
            return false;
        }
        /**
         * Used for testing.
         */
        get parentReady() {
            return super.ready;
        }
        /**
         * Start a new kernel - throws an error since it is not supported.
         */
        async startNew(createOptions = {}, connectOptions = {}) {
            return Promise.reject(new Error('Not implemented in no-op Kernel Manager'));
        }
        /**
         * Connect to an existing kernel - throws an error since it is not supported.
         */
        connectTo(options) {
            throw new Error('Not implemented in no-op Kernel Manager');
        }
        /**
         * Shut down a kernel by id - throws an error since it is not supported.
         */
        async shutdown(id) {
            return Promise.reject(new Error('Not implemented in no-op Kernel Manager'));
        }
        /**
         * A promise that fulfills when the manager is ready (never).
         */
        get ready() {
            return this.parentReady.then(() => this._readyPromise);
        }
        /**
         * Execute a request to the server to poll running kernels and update state.
         */
        async requestRunning() {
            return Promise.resolve();
        }
    }
    KernelManager.NoopManager = NoopManager;
})(KernelManager || (exports.KernelManager = KernelManager = {}));
//# sourceMappingURL=manager.js.map

/***/ }),

/***/ 70552:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.supportedKernelWebSocketProtocols = void 0;
exports.createMessage = createMessage;
exports.isStreamMsg = isStreamMsg;
exports.isDisplayDataMsg = isDisplayDataMsg;
exports.isUpdateDisplayDataMsg = isUpdateDisplayDataMsg;
exports.isExecuteInputMsg = isExecuteInputMsg;
exports.isExecuteResultMsg = isExecuteResultMsg;
exports.isErrorMsg = isErrorMsg;
exports.isStatusMsg = isStatusMsg;
exports.isClearOutputMsg = isClearOutputMsg;
exports.isDebugEventMsg = isDebugEventMsg;
exports.isCommOpenMsg = isCommOpenMsg;
exports.isCommCloseMsg = isCommCloseMsg;
exports.isCommMsgMsg = isCommMsgMsg;
exports.isInfoRequestMsg = isInfoRequestMsg;
exports.isExecuteReplyMsg = isExecuteReplyMsg;
exports.isDebugRequestMsg = isDebugRequestMsg;
exports.isDebugReplyMsg = isDebugReplyMsg;
exports.isInputRequestMsg = isInputRequestMsg;
exports.isInputReplyMsg = isInputReplyMsg;
const coreutils_1 = __webpack_require__(72215);
function createMessage(options) {
    var _a, _b, _c, _d, _e, _f;
    return {
        buffers: (_a = options.buffers) !== null && _a !== void 0 ? _a : [],
        channel: options.channel,
        content: options.content,
        header: {
            date: new Date().toISOString(),
            msg_id: (_b = options.msgId) !== null && _b !== void 0 ? _b : coreutils_1.UUID.uuid4(),
            msg_type: options.msgType,
            session: options.session,
            username: (_c = options.username) !== null && _c !== void 0 ? _c : '',
            subshell_id: (_d = options.subshellId) !== null && _d !== void 0 ? _d : null,
            version: '5.2'
        },
        metadata: (_e = options.metadata) !== null && _e !== void 0 ? _e : {},
        parent_header: (_f = options.parentHeader) !== null && _f !== void 0 ? _f : {}
    };
}
/**
 * Test whether a kernel message is a `'stream'` message.
 */
function isStreamMsg(msg) {
    return msg.header.msg_type === 'stream';
}
/**
 * Test whether a kernel message is an `'display_data'` message.
 */
function isDisplayDataMsg(msg) {
    return msg.header.msg_type === 'display_data';
}
/**
 * Test whether a kernel message is an `'update_display_data'` message.
 */
function isUpdateDisplayDataMsg(msg) {
    return msg.header.msg_type === 'update_display_data';
}
/**
 * Test whether a kernel message is an `'execute_input'` message.
 */
function isExecuteInputMsg(msg) {
    return msg.header.msg_type === 'execute_input';
}
/**
 * Test whether a kernel message is an `'execute_result'` message.
 */
function isExecuteResultMsg(msg) {
    return msg.header.msg_type === 'execute_result';
}
/**
 * Test whether a kernel message is an `'error'` message.
 */
function isErrorMsg(msg) {
    return msg.header.msg_type === 'error';
}
/**
 * Test whether a kernel message is a `'status'` message.
 */
function isStatusMsg(msg) {
    return msg.header.msg_type === 'status';
}
/**
 * Test whether a kernel message is a `'clear_output'` message.
 */
function isClearOutputMsg(msg) {
    return msg.header.msg_type === 'clear_output';
}
/**
 * Test whether a kernel message is an experimental `'debug_event'` message.
 *
 * @hidden
 *
 * #### Notes
 * Debug messages are experimental messages that are not in the official
 * kernel message specification. As such, this is *NOT* considered
 * part of the public API, and may change without notice.
 */
function isDebugEventMsg(msg) {
    return msg.header.msg_type === 'debug_event';
}
/**
 * Test whether a kernel message is a `'comm_open'` message.
 */
function isCommOpenMsg(msg) {
    return msg.header.msg_type === 'comm_open';
}
/**
 * Test whether a kernel message is a `'comm_close'` message.
 */
function isCommCloseMsg(msg) {
    return msg.header.msg_type === 'comm_close';
}
/**
 * Test whether a kernel message is a `'comm_msg'` message.
 */
function isCommMsgMsg(msg) {
    return msg.header.msg_type === 'comm_msg';
}
/**
 * Test whether a kernel message is a `'kernel_info_request'` message.
 */
function isInfoRequestMsg(msg) {
    return msg.header.msg_type === 'kernel_info_request';
}
/**
 * Test whether a kernel message is an `'execute_reply'` message.
 */
function isExecuteReplyMsg(msg) {
    return msg.header.msg_type === 'execute_reply';
}
/**
 * Test whether a kernel message is an experimental `'debug_request'` message.
 *
 * @hidden
 *
 * #### Notes
 * Debug messages are experimental messages that are not in the official
 * kernel message specification. As such, this is *NOT* considered
 * part of the public API, and may change without notice.
 */
function isDebugRequestMsg(msg) {
    return msg.header.msg_type === 'debug_request';
}
/**
 * Test whether a kernel message is an experimental `'debug_reply'` message.
 *
 * @hidden
 *
 * #### Notes
 * Debug messages are experimental messages that are not in the official
 * kernel message specification. As such, this is *NOT* considered
 * part of the public API, and may change without notice.
 */
function isDebugReplyMsg(msg) {
    return msg.header.msg_type === 'debug_reply';
}
/**
 * Test whether a kernel message is an `'input_request'` message.
 */
function isInputRequestMsg(msg) {
    return msg.header.msg_type === 'input_request';
}
/**
 * Test whether a kernel message is an `'input_reply'` message.
 */
function isInputReplyMsg(msg) {
    return msg.header.msg_type === 'input_reply';
}
// ///////////////////////////////////////////////
// Message (de)serialization
// ///////////////////////////////////////////////
/**
 * The list of supported kernel wire protocols over websocket.
 */
var supportedKernelWebSocketProtocols;
(function (supportedKernelWebSocketProtocols) {
    supportedKernelWebSocketProtocols["v1KernelWebsocketJupyterOrg"] = "v1.kernel.websocket.jupyter.org";
})(supportedKernelWebSocketProtocols || (exports.supportedKernelWebSocketProtocols = supportedKernelWebSocketProtocols = {}));
//# sourceMappingURL=messages.js.map

/***/ }),

/***/ 33505:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KernelAPIClient = exports.KERNEL_SERVICE_URL = void 0;
exports.listRunning = listRunning;
exports.startNew = startNew;
exports.restartKernel = restartKernel;
exports.interruptKernel = interruptKernel;
exports.shutdownKernel = shutdownKernel;
exports.getKernelModel = getKernelModel;
const serverconnection_1 = __webpack_require__(43851);
const coreutils_1 = __webpack_require__(4666);
const validate_1 = __webpack_require__(92917);
/**
 * The url for the kernel service.
 */
exports.KERNEL_SERVICE_URL = 'api/kernels';
/**
 * Fetch the running kernels.
 *
 * @param settings - The optional server settings.
 *
 * @returns A promise that resolves with the list of running kernels.
 *
 * #### Notes
 * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
 *
 * The promise is fulfilled on a valid response and rejected otherwise.
 */
async function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL);
    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    (0, validate_1.validateModels)(data);
    return data;
}
/**
 * Start a new kernel.
 *
 * @param options - The options used to create the kernel.
 *
 * @returns A promise that resolves with a kernel connection object.
 *
 * #### Notes
 * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
 *
 * The promise is fulfilled on a valid response and rejected otherwise.
 */
async function startNew(options = {}, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL);
    const init = {
        method: 'POST',
        body: JSON.stringify(options)
    };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status !== 201) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    (0, validate_1.validateModel)(data);
    return data;
}
/**
 * Restart a kernel.
 *
 * #### Notes
 * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
 *
 * The promise is fulfilled on a valid response (and thus after a restart) and rejected otherwise.
 */
async function restartKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id), 'restart');
    const init = { method: 'POST' };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    (0, validate_1.validateModel)(data);
}
/**
 * Interrupt a kernel.
 *
 * #### Notes
 * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
 *
 * The promise is fulfilled on a valid response and rejected otherwise.
 */
async function interruptKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id), 'interrupt');
    const init = { method: 'POST' };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status !== 204) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
}
/**
 * Shut down a kernel.
 *
 * @param id - The id of the running kernel.
 *
 * @param settings - The server settings for the request.
 *
 * @returns A promise that resolves when the kernel is shut down.
 *
 *
 * #### Notes
 * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
 *
 * The promise is fulfilled on a valid response and rejected otherwise.
 */
async function shutdownKernel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id));
    const init = { method: 'DELETE' };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status === 404) {
        const msg = `The kernel "${id}" does not exist on the server`;
        console.warn(msg);
    }
    else if (response.status !== 204) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
}
/**
 * Get a full kernel model from the server by kernel id string.
 *
 * #### Notes
 * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
 *
 * The promise is fulfilled on a valid response and rejected otherwise.
 */
async function getKernelModel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.KERNEL_SERVICE_URL, encodeURIComponent(id));
    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);
    if (response.status === 404) {
        return undefined;
    }
    else if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    (0, validate_1.validateModel)(data);
    return data;
}
/**
 * The kernel API client.
 *
 * #### Notes
 * Use this class to interact with the Jupyter Server Kernel API.
 * This class adheres to the Jupyter Server API endpoints.
 */
class KernelAPIClient {
    /**
     * Create a new kernel API client.
     *
     * @param options - The options used to create the client.
     */
    constructor(options = {}) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * List the running kernels.
     *
     * @returns A promise that resolves with the list of running kernel models.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async listRunning() {
        return listRunning(this.serverSettings);
    }
    /**
     * Get a kernel model.
     *
     * @param id - The id of the kernel of interest.
     *
     * @returns A promise that resolves with the kernel model.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     * If the kernel does not exist on the server, the promise is resolved with `undefined`.
     */
    async getModel(id) {
        return getKernelModel(id, this.serverSettings);
    }
    /**
     * Start a new kernel.
     *
     * @param options - The options used to create the kernel.
     *
     * @returns A promise that resolves with the kernel model.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async startNew(options = {}) {
        return startNew(options, this.serverSettings);
    }
    /**
     * Restart a kernel.
     *
     * @param id - The id of the kernel to restart.
     *
     * @returns A promise that resolves when the kernel is restarted.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async restart(id) {
        return restartKernel(id, this.serverSettings);
    }
    /**
     * Interrupt a kernel.
     *
     * @param id - The id of the kernel to interrupt.
     *
     * @returns A promise that resolves when the kernel is interrupted.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async interrupt(id) {
        return interruptKernel(id, this.serverSettings);
    }
    /**
     * Shut down a kernel by id.
     *
     * @param id - The id of the kernel to shut down.
     *
     * @returns A promise that resolves when the kernel is shut down.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernels) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async shutdown(id) {
        return shutdownKernel(id, this.serverSettings);
    }
}
exports.KernelAPIClient = KernelAPIClient;
//# sourceMappingURL=restapi.js.map

/***/ }),

/***/ 81259:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.serialize = serialize;
exports.deserialize = deserialize;
const KernelMessage = __importStar(__webpack_require__(70552));
/**
 * Serialize a kernel message for transport.
 */
function serialize(msg, protocol = '') {
    switch (protocol) {
        case KernelMessage.supportedKernelWebSocketProtocols
            .v1KernelWebsocketJupyterOrg:
            return Private.serializeV1KernelWebsocketJupyterOrg(msg);
        default:
            return Private.serializeDefault(msg);
    }
}
/**
 * Deserialize and return the unpacked message.
 */
function deserialize(data, protocol = '') {
    switch (protocol) {
        case KernelMessage.supportedKernelWebSocketProtocols
            .v1KernelWebsocketJupyterOrg:
            return Private.deserializeV1KernelWebsocketJupyterOrg(data);
        default:
            return Private.deserializeDefault(data);
    }
}
var Private;
(function (Private) {
    /**
     * Deserialize and return the unpacked message.
     * Protocol `v1.kernel.websocket.jupyter.org`
     */
    function deserializeV1KernelWebsocketJupyterOrg(binMsg) {
        let msg;
        const data = new DataView(binMsg);
        const offsetNumber = Number(data.getBigUint64(0, true /* littleEndian */));
        let offsets = [];
        for (let i = 0; i < offsetNumber; i++) {
            // WARNING: we cast our 64-bit unsigned int to a number!
            // so offsets cannot index up to 2**64 bytes
            offsets.push(Number(data.getBigUint64(8 * (i + 1), true /* littleEndian */)));
        }
        const decoder = new TextDecoder('utf8');
        const channel = decoder.decode(binMsg.slice(offsets[0], offsets[1]));
        const header = JSON.parse(decoder.decode(binMsg.slice(offsets[1], offsets[2])));
        const parent_header = JSON.parse(decoder.decode(binMsg.slice(offsets[2], offsets[3])));
        const metadata = JSON.parse(decoder.decode(binMsg.slice(offsets[3], offsets[4])));
        const content = JSON.parse(decoder.decode(binMsg.slice(offsets[4], offsets[5])));
        let buffers = [];
        for (let i = 5; i < offsets.length - 1; i++) {
            buffers.push(new DataView(binMsg.slice(offsets[i], offsets[i + 1])));
        }
        msg = {
            channel,
            header,
            parent_header,
            metadata,
            content,
            buffers
        };
        return msg;
    }
    Private.deserializeV1KernelWebsocketJupyterOrg = deserializeV1KernelWebsocketJupyterOrg;
    /**
     * Serialize a kernel message for transport.
     * Protocol `v1.kernel.websocket.jupyter.org`
     */
    function serializeV1KernelWebsocketJupyterOrg(msg) {
        const header = JSON.stringify(msg.header);
        const parentHeader = msg.parent_header == null ? '{}' : JSON.stringify(msg.parent_header);
        const metadata = JSON.stringify(msg.metadata);
        const content = JSON.stringify(msg.content);
        const buffers = msg.buffers !== undefined ? msg.buffers : [];
        const offsetNumber = 1 + 4 + buffers.length + 1;
        let offsets = [];
        offsets.push(8 * (1 + offsetNumber));
        offsets.push(msg.channel.length + offsets[offsets.length - 1]);
        const encoder = new TextEncoder();
        const channelEncoded = encoder.encode(msg.channel);
        const headerEncoded = encoder.encode(header);
        const parentHeaderEncoded = encoder.encode(parentHeader);
        const metadataEncoded = encoder.encode(metadata);
        const contentEncoded = encoder.encode(content);
        const binMsgNoBuff = new Uint8Array(channelEncoded.length +
            headerEncoded.length +
            parentHeaderEncoded.length +
            metadataEncoded.length +
            contentEncoded.length);
        binMsgNoBuff.set(channelEncoded);
        binMsgNoBuff.set(headerEncoded, channelEncoded.length);
        binMsgNoBuff.set(parentHeaderEncoded, channelEncoded.length + headerEncoded.length);
        binMsgNoBuff.set(metadataEncoded, channelEncoded.length + headerEncoded.length + parentHeaderEncoded.length);
        binMsgNoBuff.set(contentEncoded, channelEncoded.length +
            headerEncoded.length +
            parentHeaderEncoded.length +
            metadataEncoded.length);
        for (let length of [
            headerEncoded.length,
            parentHeaderEncoded.length,
            metadataEncoded.length,
            contentEncoded.length
        ]) {
            offsets.push(length + offsets[offsets.length - 1]);
        }
        let buffersByteLength = 0;
        for (let buffer of buffers) {
            let length = buffer.byteLength;
            offsets.push(length + offsets[offsets.length - 1]);
            buffersByteLength += length;
        }
        const binMsg = new Uint8Array(8 * (1 + offsetNumber) + binMsgNoBuff.byteLength + buffersByteLength);
        const word = new ArrayBuffer(8);
        const data = new DataView(word);
        data.setBigUint64(0, BigInt(offsetNumber), true /* littleEndian */);
        binMsg.set(new Uint8Array(word), 0);
        for (let i = 0; i < offsets.length; i++) {
            data.setBigUint64(0, BigInt(offsets[i]), true /* littleEndian */);
            binMsg.set(new Uint8Array(word), 8 * (i + 1));
        }
        binMsg.set(binMsgNoBuff, offsets[0]);
        for (let i = 0; i < buffers.length; i++) {
            const buffer = buffers[i];
            binMsg.set(new Uint8Array(ArrayBuffer.isView(buffer) ? buffer.buffer : buffer), offsets[5 + i]);
        }
        return binMsg.buffer;
    }
    Private.serializeV1KernelWebsocketJupyterOrg = serializeV1KernelWebsocketJupyterOrg;
    /**
     * Deserialize and return the unpacked message.
     * Default protocol
     *
     * #### Notes
     * Handles JSON blob strings and binary messages.
     */
    function deserializeDefault(data) {
        let value;
        if (typeof data === 'string') {
            value = JSON.parse(data);
        }
        else {
            value = deserializeBinary(data);
        }
        return value;
    }
    Private.deserializeDefault = deserializeDefault;
    /**
     * Serialize a kernel message for transport.
     * Default protocol
     *
     * #### Notes
     * If there is binary content, an `ArrayBuffer` is returned,
     * otherwise the message is converted to a JSON string.
     */
    function serializeDefault(msg) {
        var _a;
        let value;
        if ((_a = msg.buffers) === null || _a === void 0 ? void 0 : _a.length) {
            value = serializeBinary(msg);
        }
        else {
            value = JSON.stringify(msg);
        }
        return value;
    }
    Private.serializeDefault = serializeDefault;
    /**
     * Deserialize a binary message to a Kernel Message.
     */
    function deserializeBinary(buf) {
        const data = new DataView(buf);
        // read the header: 1 + nbufs 32b integers
        const nbufs = data.getUint32(0);
        const offsets = [];
        if (nbufs < 2) {
            throw new Error('Invalid incoming Kernel Message');
        }
        for (let i = 1; i <= nbufs; i++) {
            offsets.push(data.getUint32(i * 4));
        }
        const jsonBytes = new Uint8Array(buf.slice(offsets[0], offsets[1]));
        const msg = JSON.parse(new TextDecoder('utf8').decode(jsonBytes));
        // the remaining chunks are stored as DataViews in msg.buffers
        msg.buffers = [];
        for (let i = 1; i < nbufs; i++) {
            const start = offsets[i];
            const stop = offsets[i + 1] || buf.byteLength;
            msg.buffers.push(new DataView(buf.slice(start, stop)));
        }
        return msg;
    }
    /**
     * Implement the binary serialization protocol.
     *
     * Serialize Kernel message to ArrayBuffer.
     */
    function serializeBinary(msg) {
        const offsets = [];
        const buffers = [];
        const encoder = new TextEncoder();
        let origBuffers = [];
        if (msg.buffers !== undefined) {
            origBuffers = msg.buffers;
            delete msg['buffers'];
        }
        const jsonUtf8 = encoder.encode(JSON.stringify(msg));
        buffers.push(jsonUtf8.buffer);
        for (let i = 0; i < origBuffers.length; i++) {
            // msg.buffers elements could be either views or ArrayBuffers
            // buffers elements are ArrayBuffers
            const b = origBuffers[i];
            buffers.push(ArrayBuffer.isView(b) ? b.buffer : b);
        }
        const nbufs = buffers.length;
        offsets.push(4 * (nbufs + 1));
        for (let i = 0; i + 1 < buffers.length; i++) {
            offsets.push(offsets[offsets.length - 1] + buffers[i].byteLength);
        }
        const msgBuf = new Uint8Array(offsets[offsets.length - 1] + buffers[buffers.length - 1].byteLength);
        // use DataView.setUint32 for network byte-order
        const view = new DataView(msgBuf.buffer);
        // write nbufs to first 4 bytes
        view.setUint32(0, nbufs);
        // write offsets to next 4 * nbufs bytes
        for (let i = 0; i < offsets.length; i++) {
            view.setUint32(4 * (i + 1), offsets[i]);
        }
        // write all the buffers at their respective offsets
        for (let i = 0; i < buffers.length; i++) {
            msgBuf.set(new Uint8Array(buffers[i]), offsets[i]);
        }
        return msgBuf.buffer;
    }
})(Private || (Private = {}));
//# sourceMappingURL=serialize.js.map

/***/ }),

/***/ 92917:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateMessage = validateMessage;
exports.validateModel = validateModel;
exports.validateModels = validateModels;
const validate_1 = __webpack_require__(45669);
/**
 * Required fields for `IKernelHeader`.
 */
const HEADER_FIELDS = ['username', 'version', 'session', 'msg_id', 'msg_type'];
/**
 * Required fields and types for contents of various types of `kernel.IMessage`
 * messages on the iopub channel.
 */
const IOPUB_CONTENT_FIELDS = {
    stream: { name: 'string', text: 'string' },
    display_data: { data: 'object', metadata: 'object' },
    execute_input: { code: 'string', execution_count: 'number' },
    execute_result: {
        execution_count: 'number',
        data: 'object',
        metadata: 'object'
    },
    error: { ename: 'string', evalue: 'string', traceback: 'object' },
    status: {
        execution_state: [
            'string',
            ['starting', 'idle', 'busy', 'restarting', 'dead']
        ]
    },
    clear_output: { wait: 'boolean' },
    comm_open: { comm_id: 'string', target_name: 'string', data: 'object' },
    comm_msg: { comm_id: 'string', data: 'object' },
    comm_close: { comm_id: 'string' },
    shutdown_reply: { restart: 'boolean' } // Emitted by the IPython kernel.
};
/**
 * Validate the header of a kernel message.
 */
function validateHeader(header) {
    for (let i = 0; i < HEADER_FIELDS.length; i++) {
        (0, validate_1.validateProperty)(header, HEADER_FIELDS[i], 'string');
    }
}
/**
 * Validate a kernel message object.
 */
function validateMessage(msg) {
    (0, validate_1.validateProperty)(msg, 'metadata', 'object');
    (0, validate_1.validateProperty)(msg, 'content', 'object');
    (0, validate_1.validateProperty)(msg, 'channel', 'string');
    validateHeader(msg.header);
    if (msg.channel === 'iopub') {
        validateIOPubContent(msg);
    }
}
/**
 * Validate content an kernel message on the iopub channel.
 */
function validateIOPubContent(msg) {
    if (msg.channel === 'iopub') {
        const fields = IOPUB_CONTENT_FIELDS[msg.header.msg_type];
        // Check for unknown message type.
        if (fields === undefined) {
            return;
        }
        const names = Object.keys(fields);
        const content = msg.content;
        for (let i = 0; i < names.length; i++) {
            let args = fields[names[i]];
            if (!Array.isArray(args)) {
                args = [args];
            }
            (0, validate_1.validateProperty)(content, names[i], ...args);
        }
    }
}
/**
 * Validate a `Kernel.IModel` object.
 */
function validateModel(model) {
    (0, validate_1.validateProperty)(model, 'name', 'string');
    (0, validate_1.validateProperty)(model, 'id', 'string');
}
/**
 * Validate an array of `IModel` objects.
 */
function validateModels(models) {
    if (!Array.isArray(models)) {
        throw new Error('Invalid kernel list');
    }
    models.forEach(d => validateModel(d));
}
//# sourceMappingURL=validate.js.map

/***/ }),

/***/ 27504:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KernelSpecAPI = exports.KernelSpec = void 0;
const KernelSpec = __importStar(__webpack_require__(8441));
exports.KernelSpec = KernelSpec;
const KernelSpecAPI = __importStar(__webpack_require__(29723));
exports.KernelSpecAPI = KernelSpecAPI;
__exportStar(__webpack_require__(15691), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 8441:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=kernelspec.js.map

/***/ }),

/***/ 15691:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KernelSpecManager = void 0;
const coreutils_1 = __webpack_require__(72215);
const polling_1 = __webpack_require__(75205);
const signaling_1 = __webpack_require__(46257);
const basemanager_1 = __webpack_require__(78037);
const restapi_1 = __webpack_require__(29723);
/**
 * An implementation of a kernel spec manager.
 */
class KernelSpecManager extends basemanager_1.BaseManager {
    /**
     * Construct a new kernel spec manager.
     *
     * @param options - The default options for kernel.
     */
    constructor(options = {}) {
        var _a, _b;
        super(options);
        this._isReady = false;
        this._connectionFailure = new signaling_1.Signal(this);
        this._specs = null;
        this._specsChanged = new signaling_1.Signal(this);
        this._kernelSpecAPIClient =
            (_a = options.kernelSpecAPIClient) !== null && _a !== void 0 ? _a : new restapi_1.KernelSpecAPIClient({ serverSettings: this.serverSettings });
        // Initialize internal data.
        this._ready = Promise.all([this.requestSpecs()])
            .then(_ => undefined)
            .catch(_ => undefined)
            .then(() => {
            if (this.isDisposed) {
                return;
            }
            this._isReady = true;
        });
        this._pollSpecs = new polling_1.Poll({
            auto: false,
            factory: () => this.requestSpecs(),
            frequency: {
                interval: 61 * 1000,
                backoff: true,
                max: 300 * 1000
            },
            name: `@jupyterlab/services:KernelSpecManager#specs`,
            standby: (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden'
        });
        void this.ready.then(() => {
            void this._pollSpecs.start();
        });
    }
    /**
     * Test whether the manager is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that fulfills when the manager is ready.
     */
    get ready() {
        return this._ready;
    }
    /**
     * Get the most recently fetched kernel specs.
     */
    get specs() {
        return this._specs;
    }
    /**
     * A signal emitted when the specs change.
     */
    get specsChanged() {
        return this._specsChanged;
    }
    /**
     * A signal emitted when there is a connection failure.
     */
    get connectionFailure() {
        return this._connectionFailure;
    }
    /**
     * Dispose of the resources used by the manager.
     */
    dispose() {
        this._pollSpecs.dispose();
        super.dispose();
    }
    /**
     * Force a refresh of the specs from the server.
     *
     * @returns A promise that resolves when the specs are fetched.
     *
     * #### Notes
     * This is intended to be called only in response to a user action,
     * since the manager maintains its internal state.
     */
    async refreshSpecs() {
        await this._pollSpecs.refresh();
        await this._pollSpecs.tick;
    }
    /**
     * Execute a request to the server to poll specs and update state.
     */
    async requestSpecs() {
        const specs = await this._kernelSpecAPIClient.get();
        if (this.isDisposed) {
            return;
        }
        if (!coreutils_1.JSONExt.deepEqual(specs, this._specs)) {
            this._specs = specs;
            this._specsChanged.emit(specs);
        }
    }
}
exports.KernelSpecManager = KernelSpecManager;
//# sourceMappingURL=manager.js.map

/***/ }),

/***/ 29723:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KernelSpecAPIClient = void 0;
exports.getSpecs = getSpecs;
const serverconnection_1 = __webpack_require__(43851);
const validate_1 = __webpack_require__(4891);
const coreutils_1 = __webpack_require__(4666);
/**
 * The url for the kernelspec service.
 */
const KERNELSPEC_SERVICE_URL = 'api/kernelspecs';
/**
 * Fetch all of the kernel specs.
 *
 * @param settings - The optional server settings.
 *
 * @returns A promise that resolves with the kernel specs.
 *
 * #### Notes
 * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernelspecs).
 */
async function getSpecs(settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, KERNELSPEC_SERVICE_URL);
    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    return (0, validate_1.validateSpecModels)(data);
}
/**
 * The Kernel Spec API client.
 *
 * #### Notes
 * Use this class to interact with the Jupyter Server Kernel Spec API.
 * This class adheres to the Jupyter Server API endpoints.
 */
class KernelSpecAPIClient {
    /**
     * Create a new Kernel Spec API client.
     *
     * @param options - The options used to create the client.
     */
    constructor(options = {}) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * Fetch all of the kernel specs.
     *
     * @returns A promise that resolves with the kernel specs.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/kernelspecs).
     */
    async get() {
        return getSpecs(this.serverSettings);
    }
}
exports.KernelSpecAPIClient = KernelSpecAPIClient;
//# sourceMappingURL=restapi.js.map

/***/ }),

/***/ 4891:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateSpecModel = validateSpecModel;
exports.validateSpecModels = validateSpecModels;
const validate_1 = __webpack_require__(45669);
/**
 * Validate a server kernelspec model to a client side model.
 */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function validateSpecModel(data) {
    const spec = data.spec;
    if (!spec) {
        throw new Error('Invalid kernel spec');
    }
    (0, validate_1.validateProperty)(data, 'name', 'string');
    (0, validate_1.validateProperty)(data, 'resources', 'object');
    (0, validate_1.validateProperty)(spec, 'language', 'string');
    (0, validate_1.validateProperty)(spec, 'display_name', 'string');
    (0, validate_1.validateProperty)(spec, 'argv', 'array');
    let metadata = null;
    if (spec.hasOwnProperty('metadata')) {
        (0, validate_1.validateProperty)(spec, 'metadata', 'object');
        metadata = spec.metadata;
    }
    let env = null;
    if (spec.hasOwnProperty('env')) {
        (0, validate_1.validateProperty)(spec, 'env', 'object');
        env = spec.env;
    }
    return {
        name: data.name,
        resources: data.resources,
        language: spec.language,
        display_name: spec.display_name,
        argv: spec.argv,
        metadata,
        env
    };
}
/**
 * Validate a `Kernel.ISpecModels` object.
 */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function validateSpecModels(data) {
    if (!data.hasOwnProperty('kernelspecs')) {
        throw new Error('No kernelspecs found');
    }
    let keys = Object.keys(data.kernelspecs);
    const kernelspecs = Object.create(null);
    let defaultSpec = data.default;
    for (let i = 0; i < keys.length; i++) {
        const ks = data.kernelspecs[keys[i]];
        try {
            kernelspecs[keys[i]] = validateSpecModel(ks);
        }
        catch (err) {
            // Remove the errant kernel spec.
            console.warn(`Removing errant kernel spec: ${keys[i]}`);
        }
    }
    keys = Object.keys(kernelspecs);
    if (!keys.length) {
        throw new Error('No valid kernelspecs found');
    }
    if (!defaultSpec ||
        typeof defaultSpec !== 'string' ||
        !(defaultSpec in kernelspecs)) {
        defaultSpec = keys[0];
        console.warn(`Default kernel not found, using '${keys[0]}'`);
    }
    return {
        default: defaultSpec,
        kernelspecs
    };
}
//# sourceMappingURL=validate.js.map

/***/ }),

/***/ 84711:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ServiceManager = void 0;
const signaling_1 = __webpack_require__(46257);
const builder_1 = __webpack_require__(76418);
const contents_1 = __webpack_require__(87594);
const event_1 = __webpack_require__(95348);
const kernel_1 = __webpack_require__(30335);
const kernelspec_1 = __webpack_require__(27504);
const nbconvert_1 = __webpack_require__(8178);
const serverconnection_1 = __webpack_require__(43851);
const session_1 = __webpack_require__(82351);
const setting_1 = __webpack_require__(69494);
const terminal_1 = __webpack_require__(23549);
const user_1 = __webpack_require__(78162);
const workspace_1 = __webpack_require__(53265);
/**
 * A Jupyter services manager.
 */
class ServiceManager {
    /**
     * Construct a new services provider.
     */
    constructor(options = {}) {
        var _a, _b;
        this._isDisposed = false;
        this._connectionFailure = new signaling_1.Signal(this);
        this._isReady = false;
        const defaultDrive = options.defaultDrive;
        const serverSettings = (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
        const standby = (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden';
        const normalized = { defaultDrive, serverSettings, standby };
        this.serverSettings = serverSettings;
        this.contents = options.contents || new contents_1.ContentsManager(normalized);
        this.events = options.events || new event_1.EventManager(normalized);
        this.kernels = options.kernels || new kernel_1.KernelManager(normalized);
        this.sessions =
            options.sessions ||
                new session_1.SessionManager({
                    ...normalized,
                    kernelManager: this.kernels
                });
        this.settings = options.settings || new setting_1.SettingManager(normalized);
        this.terminals = options.terminals || new terminal_1.TerminalManager(normalized);
        this.builder = options.builder || new builder_1.BuildManager(normalized);
        this.workspaces = options.workspaces || new workspace_1.WorkspaceManager(normalized);
        this.nbconvert = options.nbconvert || new nbconvert_1.NbConvertManager(normalized);
        this.kernelspecs = options.kernelspecs || new kernelspec_1.KernelSpecManager(normalized);
        this.user = options.user || new user_1.UserManager(normalized);
        // Proxy all connection failures from the individual service managers.
        this.kernelspecs.connectionFailure.connect(this._onConnectionFailure, this);
        this.sessions.connectionFailure.connect(this._onConnectionFailure, this);
        this.terminals.connectionFailure.connect(this._onConnectionFailure, this);
        // Define promises that need to be resolved before service manager is ready.
        const readyList = [this.sessions.ready, this.kernelspecs.ready];
        if (this.terminals.isAvailable()) {
            readyList.push(this.terminals.ready);
        }
        this._readyPromise = Promise.all(readyList).then(() => {
            this._isReady = true;
        });
    }
    /**
     * A signal emitted when there is a connection failure with the kernel.
     */
    get connectionFailure() {
        return this._connectionFailure;
    }
    /**
     * Test whether the service manager is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_1.Signal.clearData(this);
        this.contents.dispose();
        this.events.dispose();
        this.sessions.dispose();
        this.terminals.dispose();
    }
    /**
     * Test whether the manager is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that fulfills when the manager is ready.
     */
    get ready() {
        return this._readyPromise;
    }
    _onConnectionFailure(sender, err) {
        this._connectionFailure.emit(err);
    }
}
exports.ServiceManager = ServiceManager;
//# sourceMappingURL=manager.js.map

/***/ }),

/***/ 8178:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NbConvertManager = void 0;
const coreutils_1 = __webpack_require__(4666);
const serverconnection_1 = __webpack_require__(43851);
const coreutils_2 = __webpack_require__(72215);
/**
 * The url for the lab nbconvert service.
 */
const NBCONVERT_SETTINGS_URL = 'api/nbconvert';
/**
 * The url for the nbconvert export service.
 */
const NBCONVERT_EXPORT_URL = 'nbconvert';
/**
 * The nbconvert API service manager.
 */
class NbConvertManager {
    /**
     * Create a new nbconvert manager.
     */
    constructor(options = {}) {
        var _a;
        this._exportFormats = null;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * Fetch and cache the export formats from the expensive nbconvert handler.
     */
    async fetchExportFormats() {
        this._requestingFormats = new coreutils_2.PromiseDelegate();
        this._exportFormats = null;
        const base = this.serverSettings.baseUrl;
        const url = coreutils_1.URLExt.join(base, NBCONVERT_SETTINGS_URL);
        const { serverSettings } = this;
        const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, serverSettings);
        if (response.status !== 200) {
            const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
            throw err;
        }
        const data = await response.json();
        const exportList = {};
        const keys = Object.keys(data);
        keys.forEach(function (key) {
            const mimeType = data[key].output_mimetype;
            exportList[key] = { output_mimetype: mimeType };
        });
        this._exportFormats = exportList;
        this._requestingFormats.resolve(exportList);
        return exportList;
    }
    /**
     * Get the list of export formats, preferring pre-cached ones.
     */
    async getExportFormats(force = true) {
        if (this._requestingFormats) {
            return this._requestingFormats.promise;
        }
        if (force || !this._exportFormats) {
            return await this.fetchExportFormats();
        }
        return this._exportFormats;
    }
    /**
     * Export a notebook to a given format.
     *
     * @param options - The export options.
     * @param options.format - The export format (e.g., 'html', 'pdf').
     * @param options.path - The path to the notebook to export.
     * @param options.exporterOptions.download - Whether to download the file or open it in a new tab. Defaults to false.
     */
    async exportAs(options) {
        const { format, path } = options;
        const { download = false } = options.exporterOptions || {};
        const baseUrl = this.serverSettings.baseUrl;
        const notebookPath = coreutils_1.URLExt.encodeParts(path);
        let url = coreutils_1.URLExt.join(baseUrl, NBCONVERT_EXPORT_URL, format, notebookPath);
        if (download) {
            url += '?download=true';
        }
        // Open the URL in a new tab if in a browser environment.
        window === null || window === void 0 ? void 0 : window.open(url, '_blank', 'noopener');
    }
}
exports.NbConvertManager = NbConvertManager;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 43851:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
/* provided dependency */ var process = __webpack_require__(27061);

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ServerConnection = void 0;
const coreutils_1 = __webpack_require__(4666);
const serialize_1 = __webpack_require__(81259);
let WEBSOCKET;
if (typeof window === 'undefined') {
    // Mangle the require statements so it does not get picked up in the
    // browser assets.
    WEBSOCKET = __webpack_require__(67277);
}
else {
    WEBSOCKET = WebSocket;
}
/**
 * The namespace for ServerConnection functions.
 *
 * #### Notes
 * This is only intended to manage communication with the Jupyter server.
 *
 * The default values can be used in a JupyterLab or Jupyter Notebook context.
 *
 * We use `token` authentication if available, falling back on an XSRF
 * cookie if one has been provided on the `document`.
 *
 * A content type of `'application/json'` is added when using authentication
 * and there is no body data to allow the server to prevent malicious forms.
 */
var ServerConnection;
(function (ServerConnection) {
    /**
     * Create a settings object given a subset of options.
     *
     * @param options - An optional partial set of options.
     *
     * @returns The full settings object.
     */
    function makeSettings(options) {
        return Private.makeSettings(options);
    }
    ServerConnection.makeSettings = makeSettings;
    /**
     * Make an request to the notebook server.
     *
     * @param url - The url for the request.
     *
     * @param init - The initialization options for the request.
     *
     * @param settings - The server settings to apply to the request.
     *
     * @returns a Promise that resolves with the response.
     *
     * @throws If the url of the request is not a notebook server url.
     *
     * #### Notes
     * The `url` must start with `settings.baseUrl`.  The `init` settings are
     * merged with `settings.init`, with `init` taking precedence.
     * The headers in the two objects are not merged.
     * If there is no body data, we set the content type to `application/json`
     * because it is required by the Notebook server.
     */
    function makeRequest(url, init, settings) {
        return Private.handleRequest(url, init, settings);
    }
    ServerConnection.makeRequest = makeRequest;
    /**
     * A wrapped error for a fetch response.
     */
    class ResponseError extends Error {
        /**
         * Create a ResponseError from a response, handling the traceback and message
         * as appropriate.
         *
         * @param response The response object.
         *
         * @returns A promise that resolves with a `ResponseError` object.
         */
        static async create(response) {
            try {
                const data = await response.json();
                const { message, traceback } = data;
                if (traceback) {
                    console.error(traceback);
                }
                return new ResponseError(response, message !== null && message !== void 0 ? message : ResponseError._defaultMessage(response), traceback !== null && traceback !== void 0 ? traceback : '');
            }
            catch (e) {
                console.debug(e);
                return new ResponseError(response);
            }
        }
        /**
         * Create a new response error.
         */
        constructor(response, message = ResponseError._defaultMessage(response), traceback = '') {
            super(message);
            this.response = response;
            this.traceback = traceback;
        }
        static _defaultMessage(response) {
            return `Invalid response: ${response.status} ${response.statusText}`;
        }
    }
    ServerConnection.ResponseError = ResponseError;
    /**
     * A wrapped error for a network error.
     */
    class NetworkError extends TypeError {
        /**
         * Create a new network error.
         */
        constructor(original) {
            super(original.message);
            this.stack = original.stack;
        }
    }
    ServerConnection.NetworkError = NetworkError;
})(ServerConnection || (exports.ServerConnection = ServerConnection = {}));
/**
 * The namespace for module private data.
 */
var Private;
(function (Private) {
    /**
     * Handle the server connection settings, returning a new value.
     */
    function makeSettings(options = {}) {
        var _a;
        const pageBaseUrl = coreutils_1.PageConfig.getBaseUrl();
        const pageWsUrl = coreutils_1.PageConfig.getWsUrl();
        const baseUrl = coreutils_1.URLExt.normalize(options.baseUrl) || pageBaseUrl;
        let wsUrl = options.wsUrl;
        // Prefer the default wsUrl if we are using the default baseUrl.
        if (!wsUrl && baseUrl === pageBaseUrl) {
            wsUrl = pageWsUrl;
        }
        // Otherwise convert the baseUrl to a wsUrl if possible.
        if (!wsUrl && baseUrl.indexOf('http') === 0) {
            wsUrl = 'ws' + baseUrl.slice(4);
        }
        // Otherwise fall back on the default wsUrl.
        wsUrl = wsUrl !== null && wsUrl !== void 0 ? wsUrl : pageWsUrl;
        const appendTokenConfig = coreutils_1.PageConfig.getOption('appendToken').toLowerCase();
        let appendToken;
        if (appendTokenConfig === '') {
            appendToken =
                typeof window === 'undefined' ||
                    (typeof process !== 'undefined' &&
                        ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.JEST_WORKER_ID) !== undefined) ||
                    coreutils_1.URLExt.getHostName(pageBaseUrl) !== coreutils_1.URLExt.getHostName(wsUrl);
        }
        else {
            appendToken = appendTokenConfig === 'true';
        }
        return {
            init: { cache: 'no-store', credentials: 'same-origin' },
            fetch,
            Headers,
            Request,
            WebSocket: WEBSOCKET,
            token: coreutils_1.PageConfig.getToken(),
            appUrl: coreutils_1.PageConfig.getOption('appUrl'),
            appendToken,
            serializer: { serialize: serialize_1.serialize, deserialize: serialize_1.deserialize },
            ...options,
            baseUrl,
            wsUrl
        };
    }
    Private.makeSettings = makeSettings;
    /**
     * Handle a request.
     *
     * @param url - The url for the request.
     *
     * @param init - The overrides for the request init.
     *
     * @param settings - The settings object for the request.
     *
     * #### Notes
     * The `url` must start with `settings.baseUrl`.  The `init` settings
     * take precedence over `settings.init`.
     */
    function handleRequest(url, init, settings) {
        var _a;
        // Handle notebook server requests.
        if (url.indexOf(settings.baseUrl) !== 0) {
            throw new Error('Can only be used for notebook server requests');
        }
        // Use explicit cache buster when `no-store` is set since
        // not all browsers use it properly.
        const cache = (_a = init.cache) !== null && _a !== void 0 ? _a : settings.init.cache;
        if (cache === 'no-store') {
            // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
            url += (/\?/.test(url) ? '&' : '?') + new Date().getTime();
        }
        const request = new settings.Request(url, { ...settings.init, ...init });
        // Handle authentication. Authentication can be overdetermined by
        // settings token and XSRF token.
        let authenticated = false;
        if (settings.token) {
            authenticated = true;
            request.headers.append('Authorization', `token ${settings.token}`);
        }
        if (typeof document !== 'undefined') {
            const xsrfToken = getCookie('_xsrf');
            if (xsrfToken !== undefined) {
                authenticated = true;
                request.headers.append('X-XSRFToken', xsrfToken);
            }
        }
        // Set the content type if there is no given data and we are
        // using an authenticated connection.
        if (!request.headers.has('Content-Type') && authenticated) {
            request.headers.set('Content-Type', 'application/json');
        }
        // Use `call` to avoid a `TypeError` in the browser.
        return settings.fetch.call(null, request).catch((e) => {
            // Convert the TypeError into a more specific error.
            throw new ServerConnection.NetworkError(e);
        });
        // TODO: *this* is probably where we need a system-wide connectionFailure
        // signal we can hook into.
    }
    Private.handleRequest = handleRequest;
    /**
     * Get a cookie from the document.
     */
    function getCookie(name) {
        // From http://www.tornadoweb.org/en/stable/guide/security.html
        let cookie = '';
        try {
            cookie = document.cookie;
        }
        catch (e) {
            // e.g. SecurityError in case of CSP Sandbox
            return;
        }
        const matches = cookie.match('\\b' + name + '=([^;]*)\\b');
        return matches === null || matches === void 0 ? void 0 : matches[1];
    }
})(Private || (Private = {}));
//# sourceMappingURL=serverconnection.js.map

/***/ }),

/***/ 46858:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SessionConnection = void 0;
const signaling_1 = __webpack_require__(46257);
const __1 = __webpack_require__(83676);
const coreutils_1 = __webpack_require__(72215);
const restapi_1 = __webpack_require__(79);
/**
 * Session object for accessing the session REST api. The session
 * should be used to start kernels and then shut them down -- for
 * all other kernel operations, the kernel object should be used.
 */
class SessionConnection {
    /**
     * Construct a new session.
     */
    constructor(options) {
        var _a, _b, _c, _d, _e;
        this._id = '';
        this._path = '';
        this._name = '';
        this._type = '';
        this._kernel = null;
        this._isDisposed = false;
        this._disposed = new signaling_1.Signal(this);
        this._kernelChanged = new signaling_1.Signal(this);
        this._statusChanged = new signaling_1.Signal(this);
        this._connectionStatusChanged = new signaling_1.Signal(this);
        this._pendingInput = new signaling_1.Signal(this);
        this._iopubMessage = new signaling_1.Signal(this);
        this._unhandledMessage = new signaling_1.Signal(this);
        this._anyMessage = new signaling_1.Signal(this);
        this._propertyChanged = new signaling_1.Signal(this);
        this._id = options.model.id;
        this._name = options.model.name;
        this._path = options.model.path;
        this._type = options.model.type;
        this._username = (_a = options.username) !== null && _a !== void 0 ? _a : '';
        this._clientId = (_b = options.clientId) !== null && _b !== void 0 ? _b : coreutils_1.UUID.uuid4();
        this._connectToKernel = options.connectToKernel;
        this._kernelConnectionOptions = (_c = options.kernelConnectionOptions) !== null && _c !== void 0 ? _c : {};
        this.serverSettings =
            (_d = options.serverSettings) !== null && _d !== void 0 ? _d : __1.ServerConnection.makeSettings();
        this._sessionAPIClient =
            (_e = options.sessionAPIClient) !== null && _e !== void 0 ? _e : new restapi_1.SessionAPIClient({ serverSettings: this.serverSettings });
        this.setupKernel(options.model.kernel);
    }
    /**
     * A signal emitted when the session is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * A signal emitted when the kernel changes.
     */
    get kernelChanged() {
        return this._kernelChanged;
    }
    /**
     * A signal proxied from the connection about the kernel status.
     */
    get statusChanged() {
        return this._statusChanged;
    }
    /**
     * A signal proxied from the kernel about the connection status.
     */
    get connectionStatusChanged() {
        return this._connectionStatusChanged;
    }
    /**
     * A signal proxied from the kernel pending input.
     */
    get pendingInput() {
        return this._pendingInput;
    }
    /**
     * A signal proxied from the kernel about iopub kernel messages.
     */
    get iopubMessage() {
        return this._iopubMessage;
    }
    /**
     * A signal proxied from the kernel for an unhandled kernel message.
     */
    get unhandledMessage() {
        return this._unhandledMessage;
    }
    /**
     * A signal proxied from the kernel emitted for any kernel message.
     *
     * #### Notes
     * The behavior is undefined if the message is modified during message
     * handling. As such, it should be treated as read-only.
     */
    get anyMessage() {
        return this._anyMessage;
    }
    /**
     * A signal emitted when a session property changes.
     */
    get propertyChanged() {
        return this._propertyChanged;
    }
    /**
     * Get the session id.
     */
    get id() {
        return this._id;
    }
    /**
     * Get the session kernel connection object.
     *
     * #### Notes
     * This is a read-only property, and can be altered by [changeKernel].
     */
    get kernel() {
        return this._kernel;
    }
    /**
     * Get the session path.
     */
    get path() {
        return this._path;
    }
    /**
     * Get the session type.
     */
    get type() {
        return this._type;
    }
    /**
     * Get the session name.
     */
    get name() {
        return this._name;
    }
    /**
     * Get the model associated with the session.
     */
    get model() {
        return {
            id: this.id,
            kernel: this.kernel && { id: this.kernel.id, name: this.kernel.name },
            path: this._path,
            type: this._type,
            name: this._name
        };
    }
    /**
     * Test whether the session has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Update the session based on a session model from the server.
     *
     * #### Notes
     * This only updates this session connection instance. Use `setPath`,
     * `setName`, `setType`, and `changeKernel` to change the session values on
     * the server.
     */
    update(model) {
        const oldModel = this.model;
        this._path = model.path;
        this._name = model.name;
        this._type = model.type;
        if ((this._kernel === null && model.kernel !== null) ||
            (this._kernel !== null && model.kernel === null) ||
            (this._kernel !== null &&
                model.kernel !== null &&
                this._kernel.id !== model.kernel.id)) {
            if (this._kernel !== null) {
                this._kernel.dispose();
            }
            const oldValue = this._kernel || null;
            this.setupKernel(model.kernel);
            const newValue = this._kernel || null;
            this._kernelChanged.emit({ name: 'kernel', oldValue, newValue });
        }
        this._handleModelChange(oldModel);
    }
    /**
     * Dispose of the resources held by the session.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._disposed.emit();
        if (this._kernel) {
            this._kernel.dispose();
            const oldValue = this._kernel;
            this._kernel = null;
            const newValue = this._kernel;
            this._kernelChanged.emit({ name: 'kernel', oldValue, newValue });
        }
        signaling_1.Signal.clearData(this);
    }
    /**
     * Change the session path.
     *
     * @param path - The new session path.
     *
     * @returns A promise that resolves when the session has renamed.
     *
     * #### Notes
     * This uses the Jupyter REST API, and the response is validated.
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async setPath(path) {
        if (this.isDisposed) {
            throw new Error('Session is disposed');
        }
        await this._patch({ path });
    }
    /**
     * Change the session name.
     */
    async setName(name) {
        if (this.isDisposed) {
            throw new Error('Session is disposed');
        }
        await this._patch({ name });
    }
    /**
     * Change the session type.
     */
    async setType(type) {
        if (this.isDisposed) {
            throw new Error('Session is disposed');
        }
        await this._patch({ type });
    }
    /**
     * Change the kernel.
     *
     * @param options - The name or id of the new kernel.
     *
     * #### Notes
     * This shuts down the existing kernel and creates a new kernel,
     * keeping the existing session ID and session path.
     */
    async changeKernel(options) {
        if (this.isDisposed) {
            throw new Error('Session is disposed');
        }
        await this._patch({ kernel: options });
        return this.kernel;
    }
    /**
     * Kill the kernel and shutdown the session.
     *
     * @returns - The promise fulfilled on a valid response from the server.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/sessions), and validates the response.
     * Disposes of the session and emits a [sessionDied] signal on success.
     */
    async shutdown() {
        if (this.isDisposed) {
            throw new Error('Session is disposed');
        }
        await this._sessionAPIClient.shutdown(this.id);
        this.dispose();
    }
    /**
     * Create a new kernel connection and connect to its signals.
     *
     * #### Notes
     * This method is not meant to be subclassed.
     */
    setupKernel(model) {
        if (model === null) {
            this._kernel = null;
            return;
        }
        const kc = this._connectToKernel({
            ...this._kernelConnectionOptions,
            model,
            username: this._username,
            clientId: this._clientId,
            serverSettings: this.serverSettings
        });
        this._kernel = kc;
        kc.statusChanged.connect(this.onKernelStatus, this);
        kc.connectionStatusChanged.connect(this.onKernelConnectionStatus, this);
        kc.pendingInput.connect(this.onPendingInput, this);
        kc.unhandledMessage.connect(this.onUnhandledMessage, this);
        kc.iopubMessage.connect(this.onIOPubMessage, this);
        kc.anyMessage.connect(this.onAnyMessage, this);
    }
    /**
     * Handle to changes in the Kernel status.
     */
    onKernelStatus(sender, state) {
        this._statusChanged.emit(state);
    }
    /**
     * Handle to changes in the Kernel status.
     */
    onKernelConnectionStatus(sender, state) {
        this._connectionStatusChanged.emit(state);
    }
    /**
     * Handle a change in the pendingInput.
     */
    onPendingInput(sender, state) {
        this._pendingInput.emit(state);
    }
    /**
     * Handle iopub kernel messages.
     */
    onIOPubMessage(sender, msg) {
        this._iopubMessage.emit(msg);
    }
    /**
     * Handle unhandled kernel messages.
     */
    onUnhandledMessage(sender, msg) {
        this._unhandledMessage.emit(msg);
    }
    /**
     * Handle any kernel messages.
     */
    onAnyMessage(sender, args) {
        this._anyMessage.emit(args);
    }
    /**
     * Send a PATCH to the server, updating the session path or the kernel.
     */
    async _patch(body) {
        const model = await this._sessionAPIClient.update({
            ...body,
            id: this._id
        });
        this.update(model);
        return model;
    }
    /**
     * Handle a change to the model.
     */
    _handleModelChange(oldModel) {
        if (oldModel.name !== this._name) {
            this._propertyChanged.emit('name');
        }
        if (oldModel.type !== this._type) {
            this._propertyChanged.emit('type');
        }
        if (oldModel.path !== this._path) {
            this._propertyChanged.emit('path');
        }
    }
}
exports.SessionConnection = SessionConnection;
//# sourceMappingURL=default.js.map

/***/ }),

/***/ 82351:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SessionAPI = exports.Session = void 0;
const Session = __importStar(__webpack_require__(62560));
exports.Session = Session;
const SessionAPI = __importStar(__webpack_require__(79));
exports.SessionAPI = SessionAPI;
__exportStar(__webpack_require__(75028), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 75028:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SessionManager = void 0;
const polling_1 = __webpack_require__(75205);
const signaling_1 = __webpack_require__(46257);
const serverconnection_1 = __webpack_require__(43851);
const basemanager_1 = __webpack_require__(78037);
const default_1 = __webpack_require__(46858);
const restapi_1 = __webpack_require__(79);
/**
 * An implementation of a session manager.
 */
class SessionManager extends basemanager_1.BaseManager {
    /**
     * Construct a new session manager.
     *
     * @param options - The default options for each session.
     */
    constructor(options) {
        var _a, _b;
        super(options);
        this._isReady = false;
        this._sessionConnections = new Set();
        this._models = new Map();
        this._runningChanged = new signaling_1.Signal(this);
        this._connectionFailure = new signaling_1.Signal(this);
        // We define these here so they bind `this` correctly
        this._connectToKernel = (options) => {
            return this._kernelManager.connectTo(options);
        };
        this._kernelManager = options.kernelManager;
        this._sessionAPIClient =
            (_a = options.sessionAPIClient) !== null && _a !== void 0 ? _a : new restapi_1.SessionAPIClient({ serverSettings: options.serverSettings });
        // Start model polling with exponential backoff.
        this._pollModels = new polling_1.Poll({
            auto: false,
            factory: () => this.requestRunning(),
            frequency: {
                interval: 10 * 1000,
                backoff: true,
                max: 300 * 1000
            },
            name: `@jupyterlab/services:SessionManager#models`,
            standby: (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden'
        });
        // Initialize internal data.
        this._ready = (async () => {
            await this._pollModels.start();
            await this._pollModels.tick;
            if (this._kernelManager.isActive) {
                await this._kernelManager.ready;
            }
            this._isReady = true;
        })();
    }
    /**
     * Test whether the manager is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that fulfills when the manager is ready.
     */
    get ready() {
        return this._ready;
    }
    /**
     * A signal emitted when the running sessions change.
     */
    get runningChanged() {
        return this._runningChanged;
    }
    /**
     * A signal emitted when there is a connection failure.
     */
    get connectionFailure() {
        return this._connectionFailure;
    }
    /**
     * Dispose of the resources used by the manager.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._models.clear();
        this._sessionConnections.forEach(x => x.dispose());
        this._pollModels.dispose();
        super.dispose();
    }
    /*
     * Connect to a running session.  See also [[connectToSession]].
     */
    connectTo(options) {
        const sessionConnection = new default_1.SessionConnection({
            ...options,
            connectToKernel: this._connectToKernel,
            serverSettings: this.serverSettings,
            sessionAPIClient: this._sessionAPIClient
        });
        this._onStarted(sessionConnection);
        if (!this._models.has(options.model.id)) {
            // We trust the user to connect to an existing session, but we verify
            // asynchronously.
            void this.refreshRunning().catch(() => {
                /* no-op */
            });
        }
        return sessionConnection;
    }
    /**
     * Create an iterator over the most recent running sessions.
     *
     * @returns A new iterator over the running sessions.
     */
    running() {
        return this._models.values();
    }
    /**
     * Force a refresh of the running sessions.
     *
     * @returns A promise that with the list of running sessions.
     *
     * #### Notes
     * This is not typically meant to be called by the user, since the
     * manager maintains its own internal state.
     */
    async refreshRunning() {
        await this._pollModels.refresh();
        await this._pollModels.tick;
    }
    /**
     * Start a new session.  See also [[startNewSession]].
     *
     * @param createOptions - Options for creating the session
     *
     * @param connectOptions - Options for connecting to the session
     */
    async startNew(createOptions, connectOptions = {}) {
        const model = await this._sessionAPIClient.startNew(createOptions);
        await this.refreshRunning();
        return this.connectTo({ ...connectOptions, model });
    }
    /**
     * Shut down a session by id.
     */
    async shutdown(id) {
        await this._sessionAPIClient.shutdown(id);
        await this.refreshRunning();
    }
    /**
     * Shut down all sessions.
     *
     * @returns A promise that resolves when all of the kernels are shut down.
     */
    async shutdownAll() {
        // Update the list of models to make sure our list is current.
        await this.refreshRunning();
        // Shut down all models.
        await Promise.all([...this._models.keys()].map(id => this._sessionAPIClient.shutdown(id)));
        // Update the list of models to clear out our state.
        await this.refreshRunning();
    }
    /**
     * Find a session associated with a path and stop it if it is the only session
     * using that kernel.
     *
     * @param path - The path in question.
     *
     * @returns A promise that resolves when the relevant sessions are stopped.
     */
    async stopIfNeeded(path) {
        try {
            const sessions = await this._sessionAPIClient.listRunning();
            const matches = sessions.filter(value => value.path === path);
            if (matches.length === 1) {
                const id = matches[0].id;
                await this.shutdown(id);
            }
        }
        catch (error) {
            /* Always succeed. */
        }
    }
    /**
     * Find a session by id.
     */
    async findById(id) {
        if (this._models.has(id)) {
            return this._models.get(id);
        }
        await this.refreshRunning();
        return this._models.get(id);
    }
    /**
     * Find a session by path.
     */
    async findByPath(path) {
        for (const m of this._models.values()) {
            if (m.path === path) {
                return m;
            }
        }
        await this.refreshRunning();
        for (const m of this._models.values()) {
            if (m.path === path) {
                return m;
            }
        }
        return undefined;
    }
    /**
     * Execute a request to the server to poll running kernels and update state.
     */
    async requestRunning() {
        var _a, _b;
        let models;
        try {
            models = await this._sessionAPIClient.listRunning();
        }
        catch (err) {
            // Handle network errors, as well as cases where we are on a
            // JupyterHub and the server is not running. JupyterHub returns a
            // 503 (<2.0) or 424 (>2.0) in that case.
            if (err instanceof serverconnection_1.ServerConnection.NetworkError ||
                ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||
                ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {
                this._connectionFailure.emit(err);
            }
            throw err;
        }
        if (this.isDisposed) {
            return;
        }
        if (this._models.size === models.length &&
            models.every(model => {
                var _a, _b, _c, _d;
                const existing = this._models.get(model.id);
                if (!existing) {
                    return false;
                }
                return (((_a = existing.kernel) === null || _a === void 0 ? void 0 : _a.id) === ((_b = model.kernel) === null || _b === void 0 ? void 0 : _b.id) &&
                    ((_c = existing.kernel) === null || _c === void 0 ? void 0 : _c.name) === ((_d = model.kernel) === null || _d === void 0 ? void 0 : _d.name) &&
                    existing.name === model.name &&
                    existing.path === model.path &&
                    existing.type === model.type);
            })) {
            // Identical models list (presuming models does not contain duplicate
            // ids), so just return
            return;
        }
        this._models = new Map(models.map(x => [x.id, x]));
        this._sessionConnections.forEach(sc => {
            if (this._models.has(sc.id)) {
                sc.update(this._models.get(sc.id));
            }
            else {
                sc.dispose();
            }
        });
        this._runningChanged.emit(models);
    }
    /**
     * Handle a session starting.
     */
    _onStarted(sessionConnection) {
        this._sessionConnections.add(sessionConnection);
        sessionConnection.disposed.connect(this._onDisposed, this);
        sessionConnection.propertyChanged.connect(this._onChanged, this);
        sessionConnection.kernelChanged.connect(this._onChanged, this);
    }
    _onDisposed(sessionConnection) {
        this._sessionConnections.delete(sessionConnection);
        // A session termination emission could mean the server session is deleted,
        // or that the session JS object is disposed and the session still exists on
        // the server, so we refresh from the server to make sure we reflect the
        // server state.
        void this.refreshRunning().catch(() => {
            /* no-op */
        });
    }
    _onChanged() {
        void this.refreshRunning().catch(() => {
            /* no-op */
        });
    }
}
exports.SessionManager = SessionManager;
/**
 * The namespace for `SessionManager` class statics.
 */
(function (SessionManager) {
    /**
     * A no-op session manager to be used when starting sessions is not supported.
     */
    class NoopManager extends SessionManager {
        constructor() {
            super(...arguments);
            this._readyPromise = new Promise(() => {
                /* no-op */
            });
        }
        /**
         * Whether the manager is active.
         */
        get isActive() {
            return false;
        }
        /**
         * Used for testing.
         */
        get parentReady() {
            return super.ready;
        }
        /**
         * Start a new session - throw an error since it is not supported.
         */
        async startNew(createOptions, connectOptions = {}) {
            return Promise.reject(new Error('Not implemented in no-op Session Manager'));
        }
        /*
         * Connect to a running session - throw an error since it is not supported.
         */
        connectTo(options) {
            throw Error('Not implemented in no-op Session Manager');
        }
        /**
         * A promise that fulfills when the manager is ready (never).
         */
        get ready() {
            return this.parentReady.then(() => this._readyPromise);
        }
        /**
         * Shut down a session by id - throw an error since it is not supported.
         */
        async shutdown(id) {
            return Promise.reject(new Error('Not implemented in no-op Session Manager'));
        }
        /**
         * Execute a request to the server to poll running sessions and update state.
         */
        async requestRunning() {
            return Promise.resolve();
        }
    }
    SessionManager.NoopManager = NoopManager;
})(SessionManager || (exports.SessionManager = SessionManager = {}));
//# sourceMappingURL=manager.js.map

/***/ }),

/***/ 79:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SessionAPIClient = exports.SESSION_SERVICE_URL = void 0;
exports.listRunning = listRunning;
exports.getSessionUrl = getSessionUrl;
exports.shutdownSession = shutdownSession;
exports.getSessionModel = getSessionModel;
exports.startSession = startSession;
exports.updateSession = updateSession;
const serverconnection_1 = __webpack_require__(43851);
const coreutils_1 = __webpack_require__(4666);
const validate_1 = __webpack_require__(11180);
/**
 * The url for the session service.
 */
exports.SESSION_SERVICE_URL = 'api/sessions';
/**
 * List the running sessions.
 */
async function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.SESSION_SERVICE_URL);
    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    if (!Array.isArray(data)) {
        throw new Error('Invalid Session list');
    }
    data.forEach(m => {
        (0, validate_1.updateLegacySessionModel)(m);
        (0, validate_1.validateModel)(m);
    });
    return data;
}
/**
 * Get a session url.
 */
function getSessionUrl(baseUrl, id) {
    const servicesBase = coreutils_1.URLExt.join(baseUrl, exports.SESSION_SERVICE_URL);
    const result = coreutils_1.URLExt.join(servicesBase, id);
    if (!result.startsWith(servicesBase)) {
        throw new Error('Can only be used for services requests');
    }
    return result;
}
/**
 * Shut down a session by id.
 */
async function shutdownSession(id, settings = serverconnection_1.ServerConnection.makeSettings()) {
    var _a;
    const url = getSessionUrl(settings.baseUrl, id);
    const init = { method: 'DELETE' };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status === 404) {
        const data = await response.json();
        const msg = (_a = data.message) !== null && _a !== void 0 ? _a : `The session "${id}"" does not exist on the server`;
        console.warn(msg);
    }
    else if (response.status === 410) {
        throw new serverconnection_1.ServerConnection.ResponseError(response, 'The kernel was deleted but the session was not');
    }
    else if (response.status !== 204) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
}
/**
 * Get a full session model from the server by session id string.
 */
async function getSessionModel(id, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = getSessionUrl(settings.baseUrl, id);
    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    (0, validate_1.updateLegacySessionModel)(data);
    (0, validate_1.validateModel)(data);
    return data;
}
/**
 * Create a new session, or return an existing session if the session path
 * already exists.
 */
async function startSession(options, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.SESSION_SERVICE_URL);
    const init = {
        method: 'POST',
        body: JSON.stringify(options)
    };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status !== 201) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    (0, validate_1.updateLegacySessionModel)(data);
    (0, validate_1.validateModel)(data);
    return data;
}
/**
 * Send a PATCH to the server, updating the session path or the kernel.
 */
async function updateSession(model, settings = serverconnection_1.ServerConnection.makeSettings()) {
    const url = getSessionUrl(settings.baseUrl, model.id);
    const init = {
        method: 'PATCH',
        body: JSON.stringify(model)
    };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    (0, validate_1.updateLegacySessionModel)(data);
    (0, validate_1.validateModel)(data);
    return data;
}
/**
 * The session API client.
 *
 * #### Notes
 * Use this class to interact with the Jupyter Server Session API.
 * This class adheres to the Jupyter Server API endpoints.
 */
class SessionAPIClient {
    /**
     * Create a new session API client.
     *
     * @param options - The options used to create the client.
     */
    constructor(options) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * List the running sessions.
     *
     * @returns A promise that resolves with the list of running session models.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/sessions) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async listRunning() {
        return listRunning(this.serverSettings);
    }
    /**
     * Get a session model.
     *
     * @param id - The id of the session of interest.
     *
     * @returns A promise that resolves with the session model.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/sessions) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async getModel(id) {
        return getSessionModel(id, this.serverSettings);
    }
    /**
     * Create a new session.
     *
     * @param options - The options used to create the session.
     *
     * @returns A promise that resolves with the session model.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/sessions) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async startNew(options) {
        return startSession(options, this.serverSettings);
    }
    /**
     * Shut down a session by id.
     *
     * @param id - The id of the session to shut down.
     *
     * @returns A promise that resolves when the session is shut down.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/sessions) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async shutdown(id) {
        return shutdownSession(id, this.serverSettings);
    }
    /**
     * Update a session by id.
     *
     * @param model - The session model to update.
     *
     * @returns A promise that resolves with the updated session model.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#!/sessions) and validates the response model.
     *
     * The promise is fulfilled on a valid response and rejected otherwise.
     */
    async update(model) {
        return updateSession(model, this.serverSettings);
    }
}
exports.SessionAPIClient = SessionAPIClient;
//# sourceMappingURL=restapi.js.map

/***/ }),

/***/ 62560:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=session.js.map

/***/ }),

/***/ 11180:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateModel = validateModel;
exports.updateLegacySessionModel = updateLegacySessionModel;
exports.validateModels = validateModels;
const validate_1 = __webpack_require__(92917);
const validate_2 = __webpack_require__(45669);
/**
 * Validate an `Session.IModel` object.
 */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function validateModel(data) {
    (0, validate_2.validateProperty)(data, 'id', 'string');
    (0, validate_2.validateProperty)(data, 'type', 'string');
    (0, validate_2.validateProperty)(data, 'name', 'string');
    (0, validate_2.validateProperty)(data, 'path', 'string');
    (0, validate_2.validateProperty)(data, 'kernel', 'object');
    (0, validate_1.validateModel)(data.kernel);
}
/**
 * Update model from legacy session data.
 */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function updateLegacySessionModel(data) {
    if (data.path === undefined && data.notebook !== undefined) {
        data.path = data.notebook.path;
        data.type = 'notebook';
        data.name = '';
    }
}
/**
 * Validate an array of `Session.IModel` objects.
 */
function validateModels(models) {
    if (!Array.isArray(models)) {
        throw new Error('Invalid session list');
    }
    models.forEach(d => validateModel(d));
}
//# sourceMappingURL=validate.js.map

/***/ }),

/***/ 69494:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.SettingManager = void 0;
const coreutils_1 = __webpack_require__(4666);
const statedb_1 = __webpack_require__(43988);
const serverconnection_1 = __webpack_require__(43851);
/**
 * The url for the lab settings service.
 */
const SERVICE_SETTINGS_URL = 'api/settings';
/**
 * The settings API service manager.
 */
class SettingManager extends statedb_1.DataConnector {
    /**
     * Create a new setting manager.
     */
    constructor(options = {}) {
        var _a;
        super();
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * Fetch a plugin's settings.
     *
     * @param id - The plugin's ID.
     *
     * @returns A promise that resolves if successful.
     */
    async fetch(id) {
        if (!id) {
            throw new Error('Plugin `id` parameter is required for settings fetch.');
        }
        const { serverSettings } = this;
        const { baseUrl, appUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const base = baseUrl + appUrl;
        const url = Private.url(base, id);
        const response = await makeRequest(url, {}, serverSettings);
        if (response.status !== 200) {
            const err = await ResponseError.create(response);
            throw err;
        }
        // Assert what type the server response is returning.
        return response.json();
    }
    /**
     * Fetch the list of all plugin setting bundles.
     *
     * @returns A promise that resolves if successful.
     */
    async list(query) {
        var _a, _b, _c, _d;
        const { serverSettings } = this;
        const { baseUrl, appUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const base = baseUrl + appUrl;
        const url = Private.url(base, '', query === 'ids');
        const response = await makeRequest(url, {}, serverSettings);
        if (response.status !== 200) {
            throw new ResponseError(response);
        }
        const json = await response.json();
        const ids = (_b = (_a = json === null || json === void 0 ? void 0 : json['settings']) === null || _a === void 0 ? void 0 : _a.map((plugin) => plugin.id)) !== null && _b !== void 0 ? _b : [];
        let values = [];
        if (!query) {
            values =
                (_d = (_c = json === null || json === void 0 ? void 0 : json['settings']) === null || _c === void 0 ? void 0 : _c.map((plugin) => {
                    plugin.data = { composite: {}, user: {} };
                    return plugin;
                })) !== null && _d !== void 0 ? _d : [];
        }
        return { ids, values };
    }
    /**
     * Save a plugin's settings.
     *
     * @param id - The plugin's ID.
     *
     * @param raw - The user setting values as a raw string of JSON with comments.
     *
     * @returns A promise that resolves if successful.
     */
    async save(id, raw) {
        const { serverSettings } = this;
        const { baseUrl, appUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const base = baseUrl + appUrl;
        const url = Private.url(base, id);
        // NOTE: 'raw' is JSON5 (not valid JSON), so we encode it as a string in a valid JSON body
        const init = { body: JSON.stringify({ raw }), method: 'PUT' };
        const response = await makeRequest(url, init, serverSettings);
        if (response.status !== 204) {
            throw new ResponseError(response);
        }
    }
}
exports.SettingManager = SettingManager;
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * Get the url for a plugin's settings.
     */
    function url(base, id, idsOnly) {
        const idsOnlyParam = idsOnly
            ? coreutils_1.URLExt.objectToQueryString({ ids_only: true })
            : '';
        const settingsBase = coreutils_1.URLExt.join(base, SERVICE_SETTINGS_URL);
        const result = coreutils_1.URLExt.join(settingsBase, id);
        if (!result.startsWith(settingsBase)) {
            throw new Error('Can only be used for workspaces requests');
        }
        return `${result}${idsOnlyParam}`;
    }
    Private.url = url;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 67277:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports["default"] = WebSocket;
//# sourceMappingURL=ws.js.map

/***/ }),

/***/ 49253:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TerminalConnection = void 0;
const coreutils_1 = __webpack_require__(4666);
const coreutils_2 = __webpack_require__(72215);
const signaling_1 = __webpack_require__(46257);
const __1 = __webpack_require__(83676);
const restapi_1 = __webpack_require__(11887);
/**
 * An implementation of a terminal interface.
 */
class TerminalConnection {
    /**
     * Construct a new terminal session.
     */
    constructor(options) {
        var _a, _b;
        /**
         * Create the terminal websocket connection and add socket status handlers.
         *
         * #### Notes
         * You are responsible for updating the connection status as appropriate.
         */
        this._createSocket = () => {
            this._errorIfDisposed();
            // Make sure the socket is clear
            this._clearSocket();
            // Update the connection status to reflect opening a new connection.
            this._updateConnectionStatus('connecting');
            const name = this._name;
            const settings = this.serverSettings;
            let url = coreutils_1.URLExt.join(settings.wsUrl, 'terminals', 'websocket', encodeURIComponent(name));
            // If token authentication is in use.
            const token = settings.token;
            if (settings.appendToken && token !== '') {
                url = url + `?token=${encodeURIComponent(token)}`;
            }
            this._ws = new settings.WebSocket(url);
            this._ws.onmessage = this._onWSMessage;
            this._ws.onclose = this._onWSClose;
            this._ws.onerror = this._onWSClose;
        };
        // Websocket messages events are defined as variables to bind `this`
        this._onWSMessage = (event) => {
            if (this._isDisposed) {
                return;
            }
            const data = JSON.parse(event.data);
            // Handle a disconnect message.
            if (data[0] === 'disconnect') {
                this.dispose();
            }
            if (this._connectionStatus === 'connecting') {
                // After reconnection, ignore all messages until a 'setup' message
                // before we are truly connected. Setting the connection status to
                // connected only then means that if we do not get a setup message
                // before our retry timeout, we will delete the websocket and try again.
                if (data[0] === 'setup') {
                    this._updateConnectionStatus('connected');
                }
                return;
            }
            this._messageReceived.emit({
                type: data[0],
                content: data.slice(1)
            });
        };
        this._onWSClose = (event) => {
            console.warn(`Terminal websocket closed: ${event.code}`);
            if (!this.isDisposed) {
                this._reconnect();
            }
        };
        this._connectionStatus = 'connecting';
        this._connectionStatusChanged = new signaling_1.Signal(this);
        this._isDisposed = false;
        this._disposed = new signaling_1.Signal(this);
        this._messageReceived = new signaling_1.Signal(this);
        this._reconnectTimeout = null;
        this._ws = null;
        this._noOp = () => {
            /* no-op */
        };
        this._reconnectLimit = 7;
        this._reconnectAttempt = 0;
        this._pendingMessages = [];
        this._name = options.model.name;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : __1.ServerConnection.makeSettings();
        this._terminalAPIClient =
            (_b = options.terminalAPIClient) !== null && _b !== void 0 ? _b : new restapi_1.TerminalAPIClient({ serverSettings: this.serverSettings });
        this._createSocket();
    }
    /**
     * A signal emitted when the session is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * A signal emitted when a message is received from the server.
     */
    get messageReceived() {
        return this._messageReceived;
    }
    /**
     * Get the name of the terminal session.
     */
    get name() {
        return this._name;
    }
    /**
     * Get the model for the terminal session.
     */
    get model() {
        return { name: this._name };
    }
    /**
     * Test whether the session is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the session.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._disposed.emit();
        this._updateConnectionStatus('disconnected');
        this._clearSocket();
        signaling_1.Signal.clearData(this);
    }
    /**
     * Send a message to the terminal session.
     *
     * #### Notes
     * If the connection is down, the message will be queued for sending when
     * the connection comes back up.
     */
    send(message) {
        this._sendMessage(message);
    }
    /**
     * Send a message on the websocket, or possibly queue for later sending.
     *
     * @param queue - whether to queue the message if it cannot be sent
     */
    _sendMessage(message, queue = true) {
        if (this._isDisposed || !message.content) {
            return;
        }
        if (this.connectionStatus === 'connected' && this._ws) {
            const msg = [message.type, ...message.content];
            this._ws.send(JSON.stringify(msg));
        }
        else if (queue) {
            this._pendingMessages.push(message);
        }
        else {
            throw new Error(`Could not send message: ${JSON.stringify(message)}`);
        }
    }
    /**
     * Send pending messages to the kernel.
     */
    _sendPending() {
        // We check to make sure we are still connected each time. For
        // example, if a websocket buffer overflows, it may close, so we should
        // stop sending messages.
        while (this.connectionStatus === 'connected' &&
            this._pendingMessages.length > 0) {
            this._sendMessage(this._pendingMessages[0], false);
            // We shift the message off the queue after the message is sent so that
            // if there is an exception, the message is still pending.
            this._pendingMessages.shift();
        }
    }
    /**
     * Reconnect to a terminal.
     *
     * #### Notes
     * This may try multiple times to reconnect to a terminal, and will sever
     * any existing connection.
     */
    reconnect() {
        this._errorIfDisposed();
        const result = new coreutils_2.PromiseDelegate();
        // Set up a listener for the connection status changing, which accepts or
        // rejects after the retries are done.
        const fulfill = (sender, status) => {
            if (status === 'connected') {
                result.resolve();
                this.connectionStatusChanged.disconnect(fulfill, this);
            }
            else if (status === 'disconnected') {
                result.reject(new Error('Terminal connection disconnected'));
                this.connectionStatusChanged.disconnect(fulfill, this);
            }
        };
        this.connectionStatusChanged.connect(fulfill, this);
        // Reset the reconnect limit so we start the connection attempts fresh
        this._reconnectAttempt = 0;
        // Start the reconnection process, which will also clear any existing
        // connection.
        this._reconnect();
        // Return the promise that should resolve on connection or reject if the
        // retries don't work.
        return result.promise;
    }
    /**
     * Attempt a connection if we have not exhausted connection attempts.
     */
    _reconnect() {
        this._errorIfDisposed();
        // Clear any existing reconnection attempt
        clearTimeout(this._reconnectTimeout);
        // Update the connection status and schedule a possible reconnection.
        if (this._reconnectAttempt < this._reconnectLimit) {
            this._updateConnectionStatus('connecting');
            // The first reconnect attempt should happen immediately, and subsequent
            // attempts should pick a random number in a growing range so that we
            // don't overload the server with synchronized reconnection attempts
            // across multiple kernels.
            const timeout = Private.getRandomIntInclusive(0, 1e3 * (Math.pow(2, this._reconnectAttempt) - 1));
            console.error(`Connection lost, reconnecting in ${Math.floor(timeout / 1000)} seconds.`);
            this._reconnectTimeout = setTimeout(this._createSocket, timeout);
            this._reconnectAttempt += 1;
        }
        else {
            this._updateConnectionStatus('disconnected');
        }
        // Clear the websocket event handlers and the socket itself.
        this._clearSocket();
    }
    /**
     * Forcefully clear the socket state.
     *
     * #### Notes
     * This will clear all socket state without calling any handlers and will
     * not update the connection status. If you call this method, you are
     * responsible for updating the connection status as needed and recreating
     * the socket if you plan to reconnect.
     */
    _clearSocket() {
        if (this._ws !== null) {
            // Clear the websocket event handlers and the socket itself.
            this._ws.onopen = this._noOp;
            this._ws.onclose = this._noOp;
            this._ws.onerror = this._noOp;
            this._ws.onmessage = this._noOp;
            this._ws.close();
            this._ws = null;
        }
    }
    /**
     * Shut down the terminal session.
     */
    async shutdown() {
        await this._terminalAPIClient.shutdown(this.name);
        this.dispose();
    }
    /**
     * Clone the current terminal connection.
     */
    clone() {
        return new TerminalConnection({
            model: this.model,
            serverSettings: this.serverSettings,
            terminalAPIClient: this._terminalAPIClient
        });
    }
    /**
     * Handle connection status changes.
     */
    _updateConnectionStatus(connectionStatus) {
        if (this._connectionStatus === connectionStatus) {
            return;
        }
        this._connectionStatus = connectionStatus;
        // If we are not 'connecting', stop any reconnection attempts.
        if (connectionStatus !== 'connecting') {
            this._reconnectAttempt = 0;
            clearTimeout(this._reconnectTimeout);
        }
        // Send the pending messages if we just connected.
        if (connectionStatus === 'connected') {
            this._sendPending();
        }
        // Notify others that the connection status changed.
        this._connectionStatusChanged.emit(connectionStatus);
    }
    /**
     * Utility function to throw an error if this instance is disposed.
     */
    _errorIfDisposed() {
        if (this.isDisposed) {
            throw new Error('Terminal connection is disposed');
        }
    }
    /**
     * A signal emitted when the terminal connection status changes.
     */
    get connectionStatusChanged() {
        return this._connectionStatusChanged;
    }
    /**
     * The current connection status of the terminal connection.
     */
    get connectionStatus() {
        return this._connectionStatus;
    }
}
exports.TerminalConnection = TerminalConnection;
var Private;
(function (Private) {
    /**
     * Get a random integer between min and max, inclusive of both.
     *
     * #### Notes
     * From
     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive
     *
     * From the MDN page: It might be tempting to use Math.round() to accomplish
     * that, but doing so would cause your random numbers to follow a non-uniform
     * distribution, which may not be acceptable for your needs.
     */
    function getRandomIntInclusive(min, max) {
        min = Math.ceil(min);
        max = Math.floor(max);
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }
    Private.getRandomIntInclusive = getRandomIntInclusive;
})(Private || (Private = {}));
//# sourceMappingURL=default.js.map

/***/ }),

/***/ 23549:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TerminalAPI = exports.Terminal = void 0;
const Terminal = __importStar(__webpack_require__(95310));
exports.Terminal = Terminal;
const TerminalAPI = __importStar(__webpack_require__(11887));
exports.TerminalAPI = TerminalAPI;
__exportStar(__webpack_require__(52982), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 52982:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TerminalManager = void 0;
const polling_1 = __webpack_require__(75205);
const signaling_1 = __webpack_require__(46257);
const __1 = __webpack_require__(83676);
const basemanager_1 = __webpack_require__(78037);
const restapi_1 = __webpack_require__(11887);
const default_1 = __webpack_require__(49253);
/**
 * A terminal session manager.
 */
class TerminalManager extends basemanager_1.BaseManager {
    /**
     * Construct a new terminal manager.
     */
    constructor(options = {}) {
        var _a, _b;
        super(options);
        this._isReady = false;
        // As an optimization, we unwrap the models to just store the names.
        this._names = [];
        this._terminalConnections = new Set();
        this._runningChanged = new signaling_1.Signal(this);
        this._connectionFailure = new signaling_1.Signal(this);
        this._terminalAPIClient =
            (_a = options.terminalAPIClient) !== null && _a !== void 0 ? _a : new restapi_1.TerminalAPIClient({ serverSettings: this.serverSettings });
        // Check if terminals are available
        if (!this.isAvailable()) {
            this._ready = Promise.reject('Terminals unavailable');
            this._ready.catch(_ => undefined);
            return;
        }
        // Start polling with exponential backoff.
        const pollModels = (this._pollModels = new polling_1.Poll({
            auto: false,
            factory: () => this.requestRunning(),
            frequency: {
                interval: 10 * 1000,
                backoff: true,
                max: 300 * 1000
            },
            name: `@jupyterlab/services:TerminalManager#models`,
            standby: (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden'
        }));
        // Initialize internal data.
        this._ready = (async () => {
            await pollModels.start();
            await pollModels.tick;
            this._isReady = true;
        })();
    }
    /**
     * Test whether the manager is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that fulfills when the manager is ready.
     */
    get ready() {
        return this._ready;
    }
    /**
     * A signal emitted when the running terminals change.
     */
    get runningChanged() {
        return this._runningChanged;
    }
    /**
     * A signal emitted when there is a connection failure.
     */
    get connectionFailure() {
        return this._connectionFailure;
    }
    /**
     * Dispose of the resources used by the manager.
     */
    dispose() {
        var _a;
        if (this.isDisposed) {
            return;
        }
        this._names.length = 0;
        this._terminalConnections.forEach(x => x.dispose());
        (_a = this._pollModels) === null || _a === void 0 ? void 0 : _a.dispose();
        super.dispose();
    }
    /**
     * Whether the terminal service is available.
     */
    isAvailable() {
        return this._terminalAPIClient.isAvailable;
    }
    /*
     * Connect to a running terminal.
     *
     * @param options - The options used to connect to the terminal.
     *
     * @returns The new terminal connection instance.
     *
     * #### Notes
     * The manager `serverSettings` will be used.
     */
    connectTo(options) {
        const terminalConnection = new default_1.TerminalConnection({
            ...options,
            serverSettings: this.serverSettings,
            terminalAPIClient: this._terminalAPIClient
        });
        this._onStarted(terminalConnection);
        if (!this._names.includes(options.model.name)) {
            // We trust the user to connect to an existing session, but we verify
            // asynchronously.
            void this.refreshRunning().catch(() => {
                /* no-op */
            });
        }
        return terminalConnection;
    }
    /**
     * Create an iterator over the most recent running terminals.
     *
     * @returns A new iterator over the running terminals.
     */
    running() {
        return this._models[Symbol.iterator]();
    }
    /**
     * Force a refresh of the running terminals.
     *
     * @returns A promise that with the list of running terminals.
     *
     * #### Notes
     * This is intended to be called only in response to a user action,
     * since the manager maintains its internal state.
     */
    async refreshRunning() {
        if (this._pollModels) {
            await this._pollModels.refresh();
            await this._pollModels.tick;
        }
    }
    /**
     * Create a new terminal session.
     *
     * @param options - The options used to create the terminal.
     *
     * @returns A promise that resolves with the terminal connection instance.
     *
     * #### Notes
     * The manager `serverSettings` will be used unless overridden in the
     * options.
     */
    async startNew(options = {}) {
        const { name, cwd } = options;
        const model = await this._terminalAPIClient.startNew({
            name,
            cwd
        });
        await this.refreshRunning();
        return this.connectTo({ model });
    }
    /**
     * Shut down a terminal session by name.
     */
    async shutdown(name) {
        await this._terminalAPIClient.shutdown(name);
        await this.refreshRunning();
    }
    /**
     * Shut down all terminal sessions.
     *
     * @returns A promise that resolves when all of the sessions are shut down.
     */
    async shutdownAll() {
        // Update the list of models to make sure our list is current.
        await this.refreshRunning();
        // Shut down all models.
        await Promise.all(this._names.map(name => this._terminalAPIClient.shutdown(name)));
        // Update the list of models to clear out our state.
        await this.refreshRunning();
    }
    /**
     * Execute a request to the server to poll running terminals and update state.
     */
    async requestRunning() {
        var _a, _b;
        let models;
        try {
            models = await this._terminalAPIClient.listRunning();
        }
        catch (err) {
            // Handle network errors, as well as cases where we are on a
            // JupyterHub and the server is not running. JupyterHub returns a
            // 503 (<2.0) or 424 (>2.0) in that case.
            if (err instanceof __1.ServerConnection.NetworkError ||
                ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 503 ||
                ((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 424) {
                this._connectionFailure.emit(err);
            }
            throw err;
        }
        if (this.isDisposed) {
            return;
        }
        const names = models.map(({ name }) => name).sort();
        if (names === this._names) {
            // Identical models list, so just return
            return;
        }
        this._names = names;
        this._terminalConnections.forEach(tc => {
            if (!names.includes(tc.name)) {
                tc.dispose();
            }
        });
        this._runningChanged.emit(this._models);
    }
    /**
     * Handle a session starting.
     */
    _onStarted(terminalConnection) {
        this._terminalConnections.add(terminalConnection);
        terminalConnection.disposed.connect(this._onDisposed, this);
    }
    /**
     * Handle a session terminating.
     */
    _onDisposed(terminalConnection) {
        this._terminalConnections.delete(terminalConnection);
        // Update the running models to make sure we reflect the server state
        void this.refreshRunning().catch(() => {
            /* no-op */
        });
    }
    get _models() {
        return this._names.map(name => {
            return { name };
        });
    }
}
exports.TerminalManager = TerminalManager;
/**
 * The namespace for TerminalManager statics.
 */
(function (TerminalManager) {
    /**
     * A no-op terminal manager to be used when starting terminals is not supported.
     */
    class NoopManager extends TerminalManager {
        constructor() {
            super(...arguments);
            this._readyPromise = new Promise(() => {
                /* no-op */
            });
        }
        /**
         * Whether the manager is active.
         */
        get isActive() {
            return false;
        }
        /**
         * Used for testing.
         */
        get parentReady() {
            return super.ready;
        }
        /**
         * A promise that fulfills when the manager is ready (never).
         */
        get ready() {
            return this.parentReady.then(() => this._readyPromise);
        }
        /**
         * Create a new terminal session - throw an error since it is not supported.
         *
         */
        async startNew(options) {
            return Promise.reject(new Error('Not implemented in no-op Terminal Manager'));
        }
        /*
         * Connect to a running terminal - throw an error since it is not supported.
         */
        connectTo(options) {
            throw Error('Not implemented in no-op Terminal Manager');
        }
        /**
         * Shut down a session by id - throw an error since it is not supported.
         */
        async shutdown(id) {
            return Promise.reject(new Error('Not implemented in no-op Terminal Manager'));
        }
        /**
         * Execute a request to the server to poll running sessions and update state.
         */
        async requestRunning() {
            return Promise.resolve();
        }
    }
    TerminalManager.NoopManager = NoopManager;
})(TerminalManager || (exports.TerminalManager = TerminalManager = {}));
//# sourceMappingURL=manager.js.map

/***/ }),

/***/ 11887:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TerminalAPIClient = exports.TERMINAL_SERVICE_URL = void 0;
exports.isAvailable = isAvailable;
exports.startNew = startNew;
exports.listRunning = listRunning;
exports.shutdownTerminal = shutdownTerminal;
const coreutils_1 = __webpack_require__(4666);
const serverconnection_1 = __webpack_require__(43851);
/**
 * The url for the terminal service.
 */
exports.TERMINAL_SERVICE_URL = 'api/terminals';
/**
 * Whether the terminal service is available.
 */
function isAvailable() {
    const available = String(coreutils_1.PageConfig.getOption('terminalsAvailable'));
    return available.toLowerCase() === 'true';
}
/**
 * Start a new terminal session.
 *
 * @param settings - The server settings to use.
 *
 * @param name - The name of the target terminal.
 *
 * @param cwd - The path in which the terminal will start.
 *
 * @returns A promise that resolves with the session model.
 */
async function startNew(settings = serverconnection_1.ServerConnection.makeSettings(), name, cwd) {
    Private.errorIfNotAvailable();
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);
    const init = {
        method: 'POST',
        body: JSON.stringify({ name, cwd })
    };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    // TODO: Validate model
    return data;
}
/**
 * List the running terminal sessions.
 *
 * @param settings - The server settings to use.
 *
 * @returns A promise that resolves with the list of running session models.
 */
async function listRunning(settings = serverconnection_1.ServerConnection.makeSettings()) {
    Private.errorIfNotAvailable();
    const url = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);
    const response = await serverconnection_1.ServerConnection.makeRequest(url, {}, settings);
    if (response.status !== 200) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
    const data = await response.json();
    if (!Array.isArray(data)) {
        throw new Error('Invalid terminal list');
    }
    // TODO: validate each model
    return data;
}
/**
 * Shut down a terminal session by name.
 *
 * @param name - The name of the target session.
 *
 * @param settings - The server settings to use.
 *
 * @returns A promise that resolves when the session is shut down.
 */
async function shutdownTerminal(name, settings = serverconnection_1.ServerConnection.makeSettings()) {
    var _a;
    Private.errorIfNotAvailable();
    const workspacesBase = coreutils_1.URLExt.join(settings.baseUrl, exports.TERMINAL_SERVICE_URL);
    const url = coreutils_1.URLExt.join(workspacesBase, name);
    if (!url.startsWith(workspacesBase)) {
        throw new Error('Can only be used for terminal requests');
    }
    const init = { method: 'DELETE' };
    const response = await serverconnection_1.ServerConnection.makeRequest(url, init, settings);
    if (response.status === 404) {
        const data = await response.json();
        const msg = (_a = data.message) !== null && _a !== void 0 ? _a : `The terminal session "${name}"" does not exist on the server`;
        console.warn(msg);
    }
    else if (response.status !== 204) {
        const err = await serverconnection_1.ServerConnection.ResponseError.create(response);
        throw err;
    }
}
/**
 * The Terminal API client.
 *
 * #### Notes
 * Use this class to interact with the Jupyter Server Terminal API.
 * This class adheres to the Jupyter Server API endpoints.
 */
class TerminalAPIClient {
    /**
     * Create a new Terminal API client.
     */
    constructor(options = {}) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * Whether terminals are available.
     */
    get isAvailable() {
        return isAvailable();
    }
    /**
     * Start a new terminal session.
     *
     * @param options - The options used to create the terminal.
     *
     * @returns A promise that resolves with the terminal session model.
     */
    async startNew(options = {}) {
        const { name, cwd } = options;
        return startNew(this.serverSettings, name, cwd);
    }
    /**
     * List the running terminal sessions.
     *
     * @returns A promise that resolves with the list of running session models.
     */
    async listRunning() {
        return listRunning(this.serverSettings);
    }
    /**
     * Shut down a terminal session by name.
     *
     * @param name - The name of the target session.
     *
     * @returns A promise that resolves when the session is shut down.
     */
    async shutdown(name) {
        return shutdownTerminal(name, this.serverSettings);
    }
}
exports.TerminalAPIClient = TerminalAPIClient;
/**
 * Namespace for private statics.
 */
var Private;
(function (Private) {
    /**
     * Throw an error if terminals are not available.
     */
    function errorIfNotAvailable() {
        if (!isAvailable()) {
            throw new Error('Terminals Unavailable');
        }
    }
    Private.errorIfNotAvailable = errorIfNotAvailable;
})(Private || (Private = {}));
//# sourceMappingURL=restapi.js.map

/***/ }),

/***/ 95310:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isAvailable = void 0;
const restapi_1 = __webpack_require__(11887);
Object.defineProperty(exports, "isAvailable", ({ enumerable: true, get: function () { return restapi_1.isAvailable; } }));
//# sourceMappingURL=terminal.js.map

/***/ }),

/***/ 75844:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.IWorkspaceManager = exports.IUserManager = exports.ITerminalManager = exports.IServiceManager = exports.ISettingManager = exports.ISessionManager = exports.IServerSettings = exports.INbConvertManager = exports.IKernelSpecManager = exports.IKernelManager = exports.IEventManager = exports.IDefaultDrive = exports.IDefaultContentProvider = exports.IContentsManager = exports.IConfigSectionManager = exports.IConnectionStatus = void 0;
const coreutils_1 = __webpack_require__(72215);
/**
 * Token providing the application connection status.
 */
exports.IConnectionStatus = new coreutils_1.Token('@jupyterlab/application:IConnectionStatus', 'A service providing the application connection status.');
/**
 * Token providing the config section manager.
 */
exports.IConfigSectionManager = new coreutils_1.Token('@jupyterlab/services:IConfigSectionManager', 'A service providing the config section manager.');
/**
 * The contents manager token.
 */
exports.IContentsManager = new coreutils_1.Token('@jupyterlab/services:IContentsManager', 'The contents manager token.');
/**
 * The default content provider token.
 * @deprecated Since 4.5.1 and will be removed in 5.0
 */
exports.IDefaultContentProvider = new coreutils_1.Token('@jupyterlab/services:IDefaultContentProvider', 'The default content provider for the contents manager.');
/**
 * The default drive token.
 */
exports.IDefaultDrive = new coreutils_1.Token('@jupyterlab/services:IDefaultDrive', 'The default drive for the contents manager.');
/**
 * The event manager token.
 */
exports.IEventManager = new coreutils_1.Token('@jupyterlab/services:IEventManager', 'The event manager token.');
/**
 * The kernel manager token.
 */
exports.IKernelManager = new coreutils_1.Token('@jupyterlab/services:IKernelManager', 'The kernel manager token.');
/**
 * The kernel spec manager token.
 */
exports.IKernelSpecManager = new coreutils_1.Token('@jupyterlab/services:IKernelSpecManager', 'The kernel spec manager token.');
/**
 * The nbconvert manager token.
 */
exports.INbConvertManager = new coreutils_1.Token('@jupyterlab/services:INbConvertManager', 'The nbconvert manager token.');
/**
 * The server settings token.
 */
exports.IServerSettings = new coreutils_1.Token('@jupyterlab/services:IServerSettings', 'The server settings for the application.');
/**
 * The session manager token.
 */
exports.ISessionManager = new coreutils_1.Token('@jupyterlab/services:ISessionManager', 'The session manager token.');
/**
 * The setting manager token.
 */
exports.ISettingManager = new coreutils_1.Token('@jupyterlab/services:ISettingManager', 'The setting manager token.');
/**
 * The default service manager token.
 */
exports.IServiceManager = new coreutils_1.Token('@jupyterlab/services:IServiceManager', 'The service manager for the application.');
/**
 * The terminal manager token.
 */
exports.ITerminalManager = new coreutils_1.Token('@jupyterlab/services:ITerminalManager', 'The terminal manager token.');
/**
 * The user manager token.
 */
exports.IUserManager = new coreutils_1.Token('@jupyterlab/services:IUserManager', 'The user manager token.');
/**
 * The workspace manager token.
 */
exports.IWorkspaceManager = new coreutils_1.Token('@jupyterlab/services:IWorkspaceManager', 'The workspace manager token.');
//# sourceMappingURL=tokens.js.map

/***/ }),

/***/ 78162:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UserAPI = exports.User = void 0;
const User = __importStar(__webpack_require__(79706));
exports.User = User;
const UserAPI = __importStar(__webpack_require__(27714));
exports.UserAPI = UserAPI;
__exportStar(__webpack_require__(4582), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 4582:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UserManager = void 0;
const coreutils_1 = __webpack_require__(72215);
const polling_1 = __webpack_require__(75205);
const signaling_1 = __webpack_require__(46257);
const basemanager_1 = __webpack_require__(78037);
const restapi_1 = __webpack_require__(27714);
/**
 * The service's ID.
 * Used to uniquely identify the poll, and
 * the item in local storage.
 */
const SERVICE_ID = '@jupyterlab/services:UserManager#user';
/**
 * The user API service manager.
 */
class UserManager extends basemanager_1.BaseManager {
    /**
     * Create a new user manager.
     */
    constructor(options = {}) {
        var _a, _b;
        super(options);
        this._isReady = false;
        this._userChanged = new signaling_1.Signal(this);
        this._connectionFailure = new signaling_1.Signal(this);
        this._userApiClient =
            (_a = options.userApiClient) !== null && _a !== void 0 ? _a : new restapi_1.UserAPIClient({ serverSettings: this.serverSettings });
        // Initialize internal data.
        this._ready = this.requestUser()
            .then(() => {
            if (this.isDisposed) {
                return;
            }
            this._isReady = true;
        })
            .catch(_ => 
        // Return a promise that will never resolve, so user service is never ready
        // This typically occurs when the backend has no user service
        new Promise(() => {
            // no-op
        }));
        this._pollUser = new polling_1.Poll({
            auto: false,
            factory: () => this.requestUser(),
            frequency: {
                interval: 61 * 1000,
                backoff: true,
                max: 300 * 1000
            },
            name: SERVICE_ID,
            standby: (_b = options.standby) !== null && _b !== void 0 ? _b : 'when-hidden'
        });
        void this.ready.then(() => {
            void this._pollUser.start();
        });
    }
    /**
     * Test whether the manager is ready.
     */
    get isReady() {
        return this._isReady;
    }
    /**
     * A promise that fulfills when the manager is ready.
     */
    get ready() {
        return this._ready;
    }
    /**
     * Get the most recently fetched identity.
     */
    get identity() {
        return this._identity;
    }
    /**
     * Get the most recently fetched permissions.
     */
    get permissions() {
        return this._permissions;
    }
    /**
     * A signal emitted when the user changes.
     */
    get userChanged() {
        return this._userChanged;
    }
    /**
     * A signal emitted when there is a connection failure.
     */
    get connectionFailure() {
        return this._connectionFailure;
    }
    /**
     * Dispose of the resources used by the manager.
     */
    dispose() {
        this._pollUser.dispose();
        super.dispose();
    }
    /**
     * Force a refresh of the user data from the server.
     *
     * @returns A promise that resolves when the user info is fetched.
     *
     * #### Notes
     * This is intended to be called only in response to a user action,
     * since the manager maintains its internal state.
     */
    async refreshUser() {
        await this._pollUser.refresh();
        await this._pollUser.tick;
    }
    /**
     * Execute a request to the server to poll the user and update state.
     */
    async requestUser() {
        if (this.isDisposed) {
            return;
        }
        const oldUser = {
            identity: this._identity,
            permissions: this._permissions
        };
        const newUser = await this._userApiClient.get();
        const identity = newUser.identity;
        // store the color and initials for the user
        // this info is not provided by the server
        const { localStorage } = window;
        const data = localStorage.getItem(SERVICE_ID);
        if (data && (!identity.initials || !identity.color)) {
            const localUser = JSON.parse(data);
            identity.initials =
                identity.initials ||
                    localUser.initials ||
                    identity.name.substring(0, 1);
            identity.color =
                identity.color || localUser.color || Private.getRandomColor();
        }
        if (!coreutils_1.JSONExt.deepEqual(newUser, oldUser)) {
            this._identity = identity;
            this._permissions = newUser.permissions;
            localStorage.setItem(SERVICE_ID, JSON.stringify(identity));
            this._userChanged.emit(newUser);
        }
    }
}
exports.UserManager = UserManager;
/**
 * A namespace for module-private functionality.
 *
 * Note: We do not want to export this function
 * to move it to css variables in the Theme.
 */
var Private;
(function (Private) {
    /**
     * Predefined colors for users
     */
    const userColors = [
        'var(--jp-collaborator-color1)',
        'var(--jp-collaborator-color2)',
        'var(--jp-collaborator-color3)',
        'var(--jp-collaborator-color4)',
        'var(--jp-collaborator-color5)',
        'var(--jp-collaborator-color6)',
        'var(--jp-collaborator-color7)'
    ];
    /**
     * Get a random color from the list of colors.
     */
    Private.getRandomColor = () => userColors[Math.floor(Math.random() * userColors.length)];
})(Private || (Private = {}));
//# sourceMappingURL=manager.js.map

/***/ }),

/***/ 27714:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UserAPIClient = void 0;
const serverconnection_1 = __webpack_require__(43851);
const coreutils_1 = __webpack_require__(4666);
/**
 * The url for the user service.
 */
const SERVICE_USER_URL = 'api/me';
/**
 * The User API client.
 *
 * #### Notes
 * Use this class to interact with the Jupyter Server User API.
 * This class adheres to the Jupyter Server API endpoints.
 */
class UserAPIClient {
    /**
     * Create a new User API client.
     *
     * @param options - The options used to create the client.
     */
    constructor(options = {}) {
        var _a;
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * Fetch the user data.
     *
     * @returns A promise that resolves with the user data.
     *
     * #### Notes
     * Uses the [Jupyter Server API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/jupyter_server/services/api/api.yaml#/identity).
     */
    async get() {
        const { baseUrl } = this.serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const url = coreutils_1.URLExt.join(baseUrl, SERVICE_USER_URL);
        const response = await makeRequest(url, {}, this.serverSettings);
        if (response.status !== 200) {
            const err = await ResponseError.create(response);
            throw err;
        }
        // TODO: add validation
        return await response.json();
    }
}
exports.UserAPIClient = UserAPIClient;
//# sourceMappingURL=restapi.js.map

/***/ }),

/***/ 79706:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=user.js.map

/***/ }),

/***/ 45669:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateProperty = validateProperty;
/**
 * Validate a property as being on an object, and optionally
 * of a given type and among a given set of values.
 */
function validateProperty(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
object, name, typeName, values = []) {
    if (!object.hasOwnProperty(name)) {
        throw Error(`Missing property '${name}'`);
    }
    const value = object[name];
    if (typeName !== void 0) {
        let valid = true;
        switch (typeName) {
            case 'array':
                valid = Array.isArray(value);
                break;
            case 'object':
                valid = typeof value !== 'undefined';
                break;
            default:
                valid = typeof value === typeName;
        }
        if (!valid) {
            throw new Error(`Property '${name}' is not of type '${typeName}'`);
        }
        if (values.length > 0) {
            let valid = true;
            switch (typeName) {
                case 'string':
                case 'number':
                case 'boolean':
                    valid = values.includes(value);
                    break;
                default:
                    valid = values.findIndex(v => v === value) >= 0;
                    break;
            }
            if (!valid) {
                throw new Error(`Property '${name}' is not one of the valid values ${JSON.stringify(values)}`);
            }
        }
    }
}
//# sourceMappingURL=validate.js.map

/***/ }),

/***/ 53265:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.WorkspaceManager = void 0;
const coreutils_1 = __webpack_require__(4666);
const statedb_1 = __webpack_require__(43988);
const serverconnection_1 = __webpack_require__(43851);
/**
 * The url for the lab workspaces service.
 */
const SERVICE_WORKSPACES_URL = 'api/workspaces';
/**
 * The workspaces API service manager.
 */
class WorkspaceManager extends statedb_1.DataConnector {
    /**
     * Create a new workspace manager.
     */
    constructor(options = {}) {
        var _a;
        super();
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : serverconnection_1.ServerConnection.makeSettings();
    }
    /**
     * Fetch a workspace.
     *
     * @param id - The workspace's ID.
     *
     * @returns A promise that resolves if successful.
     */
    async fetch(id) {
        const { serverSettings } = this;
        const { baseUrl, appUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const base = baseUrl + appUrl;
        const url = Private.url(base, id);
        const response = await makeRequest(url, {}, serverSettings);
        if (response.status !== 200) {
            const err = await ResponseError.create(response);
            throw err;
        }
        return response.json();
    }
    /**
     * Fetch the list of workspace IDs that exist on the server.
     *
     * @returns A promise that resolves if successful.
     */
    async list() {
        const { serverSettings } = this;
        const { baseUrl, appUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const base = baseUrl + appUrl;
        const url = Private.url(base, '');
        const response = await makeRequest(url, {}, serverSettings);
        if (response.status !== 200) {
            const err = await ResponseError.create(response);
            throw err;
        }
        const result = await response.json();
        return result.workspaces;
    }
    /**
     * Remove a workspace from the server.
     *
     * @param id - The workspaces's ID.
     *
     * @returns A promise that resolves if successful.
     */
    async remove(id) {
        const { serverSettings } = this;
        const { baseUrl, appUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const base = baseUrl + appUrl;
        const url = Private.url(base, id);
        const init = { method: 'DELETE' };
        const response = await makeRequest(url, init, serverSettings);
        if (response.status !== 204) {
            const err = await ResponseError.create(response);
            throw err;
        }
    }
    /**
     * Save a workspace.
     *
     * @param id - The workspace's ID.
     *
     * @param workspace - The workspace being saved.
     *
     * @returns A promise that resolves if successful.
     */
    async save(id, workspace) {
        const { serverSettings } = this;
        const { baseUrl, appUrl } = serverSettings;
        const { makeRequest, ResponseError } = serverconnection_1.ServerConnection;
        const base = baseUrl + appUrl;
        const url = Private.url(base, id);
        const init = { body: JSON.stringify(workspace), method: 'PUT' };
        const response = await makeRequest(url, init, serverSettings);
        if (response.status !== 204) {
            const err = await ResponseError.create(response);
            throw err;
        }
    }
}
exports.WorkspaceManager = WorkspaceManager;
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * Get the url for a workspace.
     */
    function url(base, id) {
        const workspacesBase = coreutils_1.URLExt.join(base, SERVICE_WORKSPACES_URL);
        const result = coreutils_1.URLExt.join(workspacesBase, id);
        if (!result.startsWith(workspacesBase)) {
            throw new Error('Can only be used for workspaces requests');
        }
        return result;
    }
    Private.url = url;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 48133:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/settingeditor/lib/tokens.js
var tokens = __webpack_require__(24758);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/pluginmanager@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/pluginmanager/lib/index.js)
var pluginmanager_lib_index_js_ = __webpack_require__(72201);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor-extension/lib/importSettingsWidget.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


const SettingsImport = (props) => {
    const trans = props.translator.load('jupyterlab');
    const [checkedStates, setCheckedStates] = (0,react_index_js_.useState)(props.importedSettings.reduce((acc, key) => {
        acc[key] = true;
        return acc;
    }, {}));
    const handleCheckboxChange = (key, isChecked) => {
        const updatedStates = { ...checkedStates, [key]: isChecked };
        setCheckedStates(updatedStates);
    };
    return (react_index_js_default().createElement("div", { className: "jp-SettingsImport-container" },
        react_index_js_default().createElement("div", { className: "jp-SettingsImport-header" },
            react_index_js_default().createElement("span", { className: "jp-SettingsImport-title" }, trans.__('Select settings sections to import')),
            react_index_js_default().createElement("button", { className: "jp-Button jp-mod-styled jp-mod-accept", onClick: () => {
                    props.handleImport(Object.keys(checkedStates).filter(key => !checkedStates[key]));
                } }, trans.__('Import'))),
        react_index_js_default().createElement("div", { className: "jp-SettingsImport-list" }, props.importedSettings.map(key => (react_index_js_default().createElement("label", { key: key, className: "jp-SettingsImport-item" },
            react_index_js_default().createElement("span", { className: "jp-SettingsImport-itemKey" }, key),
            react_index_js_default().createElement("input", { type: "checkbox", checked: checkedStates[key], onChange: e => handleCheckboxChange(key, e.target.checked), className: "jp-SettingsImport-checkbox" })))))));
};
/**
 * A widget for importing settings with checkboxes.
 */
class ImportSettingsWidget extends ui_components_lib_index_js_.ReactWidget {
    /**
     * Constructs a new ImportSettingsWidget.
     *
     * @param importedSettings - The settings to display.
     * @param handleImport - A callback for handling imports.
     */
    constructor(options) {
        const { importedSettings, handleImport, translator } = options;
        super();
        this.importedSettings = importedSettings;
        this.handleImport = handleImport;
        this.addClass('jp-SettingsImport-widget');
        this.translator = translator;
    }
    render() {
        return (react_index_js_default().createElement(SettingsImport, { importedSettings: this.importedSettings, handleImport: this.handleImport, translator: this.translator }));
    }
}
const ImportSettingsDialogBody = (props) => {
    return (react_index_js_default().createElement("div", null,
        react_index_js_default().createElement("div", null, props.successMessage),
        props.failureMessage && (react_index_js_default().createElement("div", null,
            react_index_js_default().createElement("br", null),
            react_index_js_default().createElement("div", null, props.failureMessage),
            props.failedSettings &&
                props.failedSettings.map((setting, index) => (react_index_js_default().createElement("div", { key: index }, setting)))))));
};
class ImportSettingsDialogBodyWidget extends ui_components_lib_index_js_.ReactWidget {
    constructor(_props) {
        super();
        this._props = _props;
    }
    render() {
        return react_index_js_default().createElement(ImportSettingsDialogBody, { ...this._props });
    }
}
//# sourceMappingURL=importSettingsWidget.js.map
// EXTERNAL MODULE: consume shared module (default) @codemirror/commands@^6.10.2 (strict) (fallback: ../node_modules/@codemirror/commands/dist/index.js)
var dist_index_js_ = __webpack_require__(55942);
// EXTERNAL MODULE: consume shared module (default) @codemirror/view@~6.39.15 (singleton) (fallback: ../node_modules/@codemirror/view/dist/index.js)
var view_dist_index_js_ = __webpack_require__(1164);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor-extension/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module settingeditor-extension
 */














const HARDCODED_TO_SKIP = [
    '@jupyterlab/application-extension:context-menu',
    '@jupyterlab/mainmenu-extension:plugin'
];
/**
 * The command IDs used by the setting editor.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.open = 'settingeditor:open';
    CommandIDs.openJSON = 'settingeditor:open-json';
    CommandIDs.revert = 'settingeditor:revert';
    CommandIDs.save = 'settingeditor:save';
    CommandIDs.exportSettings = 'settingeditor:export';
    CommandIDs.importSettings = 'settingeditor:import';
})(CommandIDs || (CommandIDs = {}));
/**
 * The default setting editor extension.
 */
const lib_plugin = {
    id: '@jupyterlab/settingeditor-extension:form-ui',
    description: 'Adds the interactive settings editor and provides its tracker.',
    requires: [
        settingregistry_lib_index_js_.ISettingRegistry,
        statedb_lib_index_js_.IStateDB,
        translation_lib_index_js_.ITranslator,
        ui_components_lib_index_js_.IFormRendererRegistry,
        index_js_.ILabStatus
    ],
    optional: [
        index_js_.ILayoutRestorer,
        lib_index_js_.ICommandPalette,
        tokens/* IJSONSettingEditorTracker */.g,
        pluginmanager_lib_index_js_.IPluginManager
    ],
    autoStart: true,
    provides: tokens/* ISettingEditorTracker */.O,
    activate
};
/**
 * Activate the setting editor extension.
 */
function activate(app, registry, state, translator, editorRegistry, status, restorer, palette, jsonEditor, pluginManager) {
    const trans = translator.load('jupyterlab');
    const { commands, shell } = app;
    const namespace = 'setting-editor';
    const tracker = new lib_index_js_.WidgetTracker({
        namespace
    });
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: CommandIDs.open,
            args: widget => ({}),
            name: widget => namespace
        });
    }
    const openUi = async (args) => {
        if (tracker.currentWidget && !tracker.currentWidget.isDisposed) {
            if (!tracker.currentWidget.isAttached) {
                shell.add(tracker.currentWidget, 'main', { type: 'Settings' });
            }
            shell.activateById(tracker.currentWidget.id);
            if (args.query) {
                tracker.currentWidget.content.updateQuery(args.query);
            }
            return;
        }
        const key = lib_plugin.id;
        const { SettingsEditor } = await __webpack_require__.e(/* import() */ 3744).then(__webpack_require__.t.bind(__webpack_require__, 23744, 23));
        // Load the settings to get the configurable toSkip list
        const settings = await registry.load(lib_plugin.id);
        const toSkipSetting = settings.get('toSkip').composite;
        const configurableToSkip = Array.isArray(toSkipSetting)
            ? toSkipSetting
            : [];
        // Combine hardcoded and configurable skip lists, avoiding duplicates
        const toSkip = [...new Set([...HARDCODED_TO_SKIP, ...configurableToSkip])];
        const editor = new lib_index_js_.MainAreaWidget({
            content: new SettingsEditor({
                editorRegistry,
                key,
                registry,
                state,
                commands,
                toSkip,
                translator,
                status,
                query: args.query
            })
        });
        editor.toolbar.addItem('export-settings', new ui_components_lib_index_js_.CommandToolbarButton({
            commands,
            id: CommandIDs.exportSettings,
            icon: ui_components_lib_index_js_.downloadIcon,
            label: trans.__('Export'),
            caption: trans.__('Export settings to a JSON file')
        }));
        editor.toolbar.addItem('import-settings', new ui_components_lib_index_js_.CommandToolbarButton({
            commands,
            id: CommandIDs.importSettings,
            icon: ui_components_lib_index_js_.fileUploadIcon,
            label: trans.__('Import'),
            caption: trans.__('Import settings from a JSON file')
        }));
        editor.toolbar.addItem('spacer', ui_components_lib_index_js_.Toolbar.createSpacerItem());
        if (pluginManager) {
            editor.toolbar.addItem('open-plugin-manager', new ui_components_lib_index_js_.ToolbarButton({
                onClick: async () => {
                    await pluginManager.open();
                },
                icon: ui_components_lib_index_js_.launchIcon,
                label: trans.__('Plugin Manager')
            }));
        }
        if (jsonEditor) {
            editor.toolbar.addItem('open-json-editor', new ui_components_lib_index_js_.CommandToolbarButton({
                commands,
                id: CommandIDs.openJSON,
                icon: ui_components_lib_index_js_.launchIcon,
                label: trans.__('JSON Settings Editor')
            }));
        }
        editor.id = namespace;
        editor.title.icon = ui_components_lib_index_js_.settingsIcon;
        editor.title.label = trans.__('Settings');
        editor.title.closable = true;
        void tracker.add(editor);
        shell.add(editor, 'main', { type: 'Settings' });
    };
    commands.addCommand(CommandIDs.open, {
        execute: async (args) => {
            var _a;
            if (args.settingEditorType === 'ui') {
                void commands.execute(CommandIDs.open, { query: (_a = args.query) !== null && _a !== void 0 ? _a : '' });
            }
            else if (args.settingEditorType === 'json') {
                void commands.execute(CommandIDs.openJSON);
            }
            else {
                void registry.load(lib_plugin.id).then(settings => {
                    var _a;
                    settings.get('settingEditorType').composite ===
                        'json'
                        ? void commands.execute(CommandIDs.openJSON)
                        : void openUi({ query: (_a = args.query) !== null && _a !== void 0 ? _a : '' });
                });
            }
        },
        label: args => {
            if (args.label) {
                return args.label;
            }
            return trans.__('Settings Editor');
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    query: {
                        type: 'string',
                        description: trans.__('Search query to filter settings')
                    },
                    settingEditorType: {
                        type: 'string',
                        enum: ['ui', 'json'],
                        description: trans.__('Type of settings editor to open')
                    },
                    label: {
                        type: 'string',
                        description: trans.__('Custom label for the command')
                    }
                }
            }
        }
    });
    if (palette) {
        palette.addItem({
            category: trans.__('Settings'),
            command: CommandIDs.open,
            args: { settingEditorType: 'ui' }
        });
    }
    return tracker;
}
/**
 * The default setting editor extension.
 */
const jsonPlugin = {
    id: '@jupyterlab/settingeditor-extension:plugin',
    description: 'Adds the JSON settings editor and provides its tracker.',
    requires: [
        settingregistry_lib_index_js_.ISettingRegistry,
        codeeditor_lib_index_js_.IEditorServices,
        statedb_lib_index_js_.IStateDB,
        rendermime_lib_index_js_.IRenderMimeRegistry,
        index_js_.ILabStatus,
        translation_lib_index_js_.ITranslator
    ],
    optional: [index_js_.ILayoutRestorer, lib_index_js_.ICommandPalette],
    autoStart: true,
    provides: tokens/* IJSONSettingEditorTracker */.g,
    activate: activateJSON
};
/**
 * Activate the setting editor extension.
 */
function activateJSON(app, registry, editorServices, state, rendermime, status, translator, restorer, palette) {
    const trans = translator.load('jupyterlab');
    const { commands, shell } = app;
    const namespace = 'json-setting-editor';
    const factoryService = editorServices.factoryService;
    const editorFactory = factoryService.newInlineEditor;
    const tracker = new lib_index_js_.WidgetTracker({
        namespace
    });
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: CommandIDs.openJSON,
            args: widget => ({}),
            name: widget => namespace
        });
    }
    commands.addCommand(CommandIDs.openJSON, {
        execute: async () => {
            if (tracker.currentWidget && !tracker.currentWidget.isDisposed) {
                if (!tracker.currentWidget.isAttached) {
                    shell.add(tracker.currentWidget, 'main', {
                        type: 'Advanced Settings'
                    });
                }
                shell.activateById(tracker.currentWidget.id);
                return;
            }
            const key = lib_plugin.id;
            const when = app.restored;
            const { JsonSettingEditor } = await __webpack_require__.e(/* import() */ 3744).then(__webpack_require__.t.bind(__webpack_require__, 23744, 23));
            const editor = new JsonSettingEditor({
                commands: {
                    registry: commands,
                    revert: CommandIDs.revert,
                    save: CommandIDs.save
                },
                editorFactory: options => {
                    var _a;
                    const cmEditor = editorFactory({
                        ...options,
                        extensions: [
                            ...((_a = options.extensions) !== null && _a !== void 0 ? _a : []),
                            (0,dist_index_js_.history)(), // Adds the CM6 undo/redo history extension
                            view_dist_index_js_.keymap.of(dist_index_js_.historyKeymap) // bind Ctrl+Z / Ctrl+Shift+Z
                        ]
                    });
                    return cmEditor;
                },
                key,
                registry,
                rendermime,
                state,
                translator,
                when
            });
            let disposable = null;
            // Notify the command registry when the visibility status of the setting
            // editor's commands change. The setting editor toolbar listens for this
            // signal from the command registry.
            editor.commandsChanged.connect((sender, args) => {
                args.forEach(id => {
                    commands.notifyCommandChanged(id);
                });
                if (editor.canSaveRaw) {
                    if (!disposable) {
                        disposable = status.setDirty();
                    }
                }
                else if (disposable) {
                    disposable.dispose();
                    disposable = null;
                }
                editor.disposed.connect(() => {
                    if (disposable) {
                        disposable.dispose();
                    }
                });
            });
            const container = new lib_index_js_.MainAreaWidget({
                content: editor
            });
            container.id = namespace;
            container.title.icon = ui_components_lib_index_js_.settingsIcon;
            container.title.label = trans.__('Advanced Settings Editor');
            container.title.closable = true;
            void tracker.add(container);
            shell.add(container, 'main', { type: 'Advanced Settings' });
        },
        label: trans.__('Advanced Settings Editor'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    if (palette) {
        palette.addItem({
            category: trans.__('Settings'),
            command: CommandIDs.openJSON
        });
    }
    commands.addCommand(CommandIDs.revert, {
        execute: () => {
            var _a;
            (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.revert();
        },
        icon: ui_components_lib_index_js_.undoIcon,
        label: trans.__('Revert User Settings'),
        isEnabled: () => { var _a, _b; return (_b = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.canRevertRaw) !== null && _b !== void 0 ? _b : false; },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.save, {
        execute: () => { var _a; return (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.save(); },
        icon: ui_components_lib_index_js_.saveIcon,
        label: trans.__('Save User Settings'),
        isEnabled: () => { var _a, _b; return (_b = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.canSaveRaw) !== null && _b !== void 0 ? _b : false; },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.exportSettings, {
        execute: () => {
            const userSettings = collectUserSettings(registry);
            const jsonContent = JSON.stringify(userSettings, null, 2);
            downloadSettings(jsonContent, 'overrides.json');
        },
        label: trans.__('Export Settings'),
        icon: ui_components_lib_index_js_.downloadIcon,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.importSettings, {
        execute: () => {
            const fileInput = document.createElement('input');
            fileInput.type = 'file';
            fileInput.accept = '.json'; // Accept only JSON files
            const JSON_INDENTATION = 4; // Indentation for the JSON file to be uploaded
            fileInput.addEventListener('change', async (event) => {
                var _a;
                const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
                if (!file) {
                    return;
                }
                try {
                    const fileContent = await file.text();
                    const importedSettings = JSON.parse(fileContent);
                    // Validate the JSON structure
                    if (typeof importedSettings !== 'object' ||
                        Array.isArray(importedSettings)) {
                        throw new Error('Invalid settings file format');
                    }
                    const errorUploading = [];
                    const applySettings = async (settings) => {
                        var _a;
                        const settingsEntries = Object.entries(importedSettings);
                        for (const [pluginId, pluginSettings] of settingsEntries) {
                            if (typeof pluginSettings === 'object' &&
                                !Array.isArray(pluginSettings)) {
                                try {
                                    await registry.upload(pluginId, JSON.stringify(pluginSettings, undefined, JSON_INDENTATION));
                                }
                                catch (error) {
                                    console.warn(`Failed to save settings for ${pluginId}:`, error);
                                    errorUploading.push(pluginId);
                                }
                            }
                            else {
                                console.warn(`Invalid settings for plugin ${pluginId}. Skipping.`);
                            }
                        }
                        (_a = app.shell.currentWidget) === null || _a === void 0 ? void 0 : _a.close();
                        if (settingsEntries.length) {
                            const successCount = settingsEntries.length - errorUploading.length;
                            const successMessage = trans.__(`Imported settings across ${successCount} ${successCount === 1 ? 'category' : 'categories'} successfully.`);
                            const failureMessage = errorUploading.length
                                ? trans.__(`Failed to upload settings for the following ${errorUploading.length} ${errorUploading.length === 1 ? 'plugin' : 'plugins'}`)
                                : '';
                            const body = new ImportSettingsDialogBodyWidget({
                                successMessage,
                                failureMessage,
                                failedSettings: errorUploading
                            });
                            await (0,lib_index_js_.showDialog)({
                                title: trans.__('Settings Imported'),
                                body,
                                buttons: [lib_index_js_.Dialog.okButton()]
                            });
                        }
                    };
                    const settingsKeys = Object.keys(importedSettings);
                    const content = new ImportSettingsWidget({
                        importedSettings: settingsKeys,
                        handleImport: applySettings,
                        translator: translator
                    });
                    const widget = new lib_index_js_.MainAreaWidget({ content });
                    widget.title.label = trans.__('Import Settings');
                    widget.title.icon = ui_components_lib_index_js_.fileUploadIcon;
                    app.shell.add(widget, 'main');
                    app.shell.activateById(widget.id);
                }
                catch (error) {
                    await (0,lib_index_js_.showErrorMessage)('Failed to import settings', error);
                }
            });
            // Trigger the file input
            fileInput.click();
        },
        label: trans.__('Import Settings'),
        icon: ui_components_lib_index_js_.fileUploadIcon,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    /**
     * Collect user settings from the registry.
     */
    function collectUserSettings(registry) {
        const userSettings = {};
        for (const [pluginId, plugin] of Object.entries(registry.plugins)) {
            if (plugin) {
                try {
                    if (plugin.raw) {
                        const withoutSingleLineComments = plugin.raw.replace(/\/\/.*$/gm, '');
                        const withoutComments = withoutSingleLineComments.replace(/\/\*[\s\S]*?\*\//g, '');
                        const preferredSettings = JSON.parse(withoutComments);
                        if (Object.keys(preferredSettings).length > 0) {
                            userSettings[pluginId] = preferredSettings;
                        }
                    }
                }
                catch (error) {
                    console.error(`Error loading settings for plugin ${pluginId}:`, error);
                }
            }
        }
        return userSettings;
    }
    /**
     * Trigger a download of the settings as a JSON file.
     */
    function downloadSettings(jsonContent, filename) {
        const blob = new Blob([jsonContent], { type: 'application/json' });
        const url = URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = filename;
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
        URL.revokeObjectURL(url);
    }
    return tracker;
}
/* harmony default export */ const lib = ([lib_plugin, jsonPlugin]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 58068:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/pluginmanager/style/index.js + 1 modules
var pluginmanager_style = __webpack_require__(96850);
// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var widgets_style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/inspector/style/base.css
var base = __webpack_require__(96967);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/inspector/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/inspector/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/settingeditor/style/base.css
var settingeditor_style_base = __webpack_require__(30313);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/style/base.css

      
      
      
      
      
      
      
      
      

var base_options = {};

base_options.styleTagTransform = (styleTagTransform_default());
base_options.setAttributes = (setAttributesWithoutAttributes_default());

      base_options.insert = insertBySelector_default().bind(null, "head");
    
base_options.domAPI = (styleDomAPI_default());
base_options.insertStyleElement = (insertStyleElement_default());

var base_update = injectStylesIntoStyleTag_default()(settingeditor_style_base/* default */.Z, base_options);




       /* harmony default export */ const _jupyterlab_settingeditor_style_base = (settingeditor_style_base/* default */.Z && settingeditor_style_base/* default */.Z.locals ? settingeditor_style_base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */










;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 63360:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  IJSONSettingEditorTracker: () => (/* reexport */ tokens/* IJSONSettingEditorTracker */.g),
  ISettingEditorTracker: () => (/* reexport */ tokens/* ISettingEditorTracker */.O),
  JsonSettingEditor: () => (/* reexport */ JsonSettingEditor),
  SettingsEditor: () => (/* reexport */ SettingsEditor)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/pluginlist.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/







/**
 * The JupyterLab plugin schema key for the setting editor
 * icon class of a plugin.
 */
const ICON_KEY = 'jupyter.lab.setting-icon';
/**
 * The JupyterLab plugin schema key for the setting editor
 * icon class of a plugin.
 */
const ICON_CLASS_KEY = 'jupyter.lab.setting-icon-class';
/**
 * The JupyterLab plugin schema key for the setting editor
 * icon label of a plugin.
 */
const ICON_LABEL_KEY = 'jupyter.lab.setting-icon-label';
/**
 * A list of plugins with editable settings.
 */
class PluginList extends index_js_.ReactWidget {
    /**
     * Create a new plugin list.
     */
    constructor(options) {
        var _a, _b;
        super();
        this._changed = new index_es6_js_.Signal(this);
        this._handleSelectSignal = new index_es6_js_.Signal(this);
        this._updateFilterSignal = new index_es6_js_.Signal(this);
        this._scrollTop = 0;
        this._selection = '';
        this._registry = this.registry = options.registry;
        this.translator = options.translator || lib_index_js_.nullTranslator;
        this.addClass('jp-PluginList');
        this._confirm = options.confirm;
        this._model = (_a = options.model) !== null && _a !== void 0 ? _a : new PluginList.Model(options);
        this._model.ready
            .then(() => {
            this.update();
            this._model.changed.connect(() => {
                this.update();
            });
        })
            .catch(reason => {
            console.error(`Failed to load the plugin list model:\n${reason}`);
        });
        this.mapPlugins = this.mapPlugins.bind(this);
        this.setFilter = this.setFilter.bind(this);
        this.setFilter(options.query ? (0,ui_components_lib_index_js_.updateFilterFunction)(options.query, false, false) : null);
        this.setError = this.setError.bind(this);
        this._evtMousedown = this._evtMousedown.bind(this);
        this._query = (_b = options.query) !== null && _b !== void 0 ? _b : '';
        this._errors = {};
    }
    /**
     * A signal emitted when a list user interaction happens.
     */
    get changed() {
        return this._changed;
    }
    /**
     * The selection value of the plugin list.
     */
    get scrollTop() {
        var _a;
        return (_a = this.node.querySelector('ul')) === null || _a === void 0 ? void 0 : _a.scrollTop;
    }
    get hasErrors() {
        for (const id in this._errors) {
            if (this._errors[id]) {
                return true;
            }
        }
        return false;
    }
    get filter() {
        return this._filter;
    }
    /**
     * The selection value of the plugin list.
     */
    get selection() {
        return this._selection;
    }
    set selection(selection) {
        this._selection = selection;
        this.update();
    }
    /**
     * Signal that fires when search filter is updated so that settings panel can filter results.
     */
    get updateFilterSignal() {
        return this._updateFilterSignal;
    }
    get handleSelectSignal() {
        return this._handleSelectSignal;
    }
    /**
     * Handle `'update-request'` messages.
     */
    onUpdateRequest(msg) {
        const ul = this.node.querySelector('ul');
        if (ul && this._scrollTop !== undefined) {
            ul.scrollTop = this._scrollTop;
        }
        super.onUpdateRequest(msg);
    }
    /**
     * Handle the `'mousedown'` event for the plugin list.
     *
     * @param event - The DOM event sent to the widget
     */
    _evtMousedown(event) {
        const target = event.currentTarget;
        const id = target.getAttribute('data-id');
        if (!id) {
            return;
        }
        if (this._confirm) {
            this._confirm(id)
                .then(() => {
                this.selection = id;
                this._changed.emit(undefined);
                this.update();
            })
                .catch(() => {
                /* no op */
            });
        }
        else {
            this._scrollTop = this.scrollTop;
            this._selection = id;
            this._handleSelectSignal.emit(id);
            this._changed.emit(undefined);
            this.update();
        }
    }
    /**
     * Check the plugin for a rendering hint's value.
     *
     * #### Notes
     * The order of priority for overridden hints is as follows, from most
     * important to least:
     * 1. Data set by the end user in a settings file.
     * 2. Data set by the plugin author as a schema default.
     * 3. Data set by the plugin author as a top-level key of the schema.
     */
    getHint(key, registry, plugin) {
        // First, give priority to checking if the hint exists in the user data.
        let hint = plugin.data.user[key];
        // Second, check to see if the hint exists in composite data, which folds
        // in default values from the schema.
        if (!hint) {
            hint = plugin.data.composite[key];
        }
        // Third, check to see if the plugin schema has defined the hint.
        if (!hint) {
            hint = plugin.schema[key];
        }
        // Finally, use the defaults from the registry schema.
        if (!hint) {
            const { properties } = registry.schema;
            hint = properties && properties[key] && properties[key].default;
        }
        return typeof hint === 'string' ? hint : '';
    }
    /**
     * Function to recursively filter properties that match search results.
     * @param filter - Function to filter based on search results
     * @param props - Schema properties being filtered
     * @param definitions - Definitions to use for filling in references in properties
     * @param ref - Reference to a definition
     * @returns - String array of properties that match the search results.
     */
    getFilterString(filter, props, definitions, ref) {
        var _a;
        // If properties given are references, populate properties
        // with corresponding definition.
        if (ref && definitions) {
            ref = ref.replace('#/definitions/', '');
            props = (_a = definitions[ref]) !== null && _a !== void 0 ? _a : {};
        }
        // If given properties are an object, advance into the properties
        // for that object instead.
        if (props.properties) {
            props = props.properties;
            // If given properties are an array, advance into the properties
            // for the items instead.
        }
        else if (props.items) {
            props = props.items;
            // Otherwise, you've reached the base case and don't need to check for matching properties
        }
        else {
            return [];
        }
        // If reference found, recurse
        if (props['$ref']) {
            return this.getFilterString(filter, props, definitions, props['$ref']);
        }
        // Make sure props is non-empty before calling reduce
        if (Object.keys(props).length === 0) {
            return [];
        }
        // Iterate through the properties and check for titles / descriptions that match search.
        return Object.keys(props).reduce((acc, value) => {
            var _a, _b;
            // If this is the base case, check for matching title / description
            const subProps = props[value];
            if (!subProps) {
                if (filter((_a = props.title) !== null && _a !== void 0 ? _a : '')) {
                    return props.title;
                }
                if (filter(value)) {
                    return value;
                }
            }
            // If there are properties in the object, check for title / description
            if (filter((_b = subProps.title) !== null && _b !== void 0 ? _b : '')) {
                acc.push(subProps.title);
            }
            if (filter(value)) {
                acc.push(value);
            }
            // Finally, recurse on the properties left.
            acc.concat(this.getFilterString(filter, subProps, definitions, subProps['$ref']));
            return acc;
        }, []);
    }
    /**
     * Updates the filter when the search bar value changes.
     * @param filter Filter function passed by search bar based on search value.
     */
    setFilter(filter, query) {
        if (filter) {
            this._filter = (plugin) => {
                var _a, _b;
                if (!filter || filter((_a = plugin.schema.title) !== null && _a !== void 0 ? _a : '')) {
                    return null;
                }
                const filtered = this.getFilterString(filter, (_b = plugin.schema) !== null && _b !== void 0 ? _b : {}, plugin.schema.definitions);
                return filtered;
            };
        }
        else {
            this._filter = null;
        }
        this._query = query;
        this._updateFilterSignal.emit(this._filter);
        this.update();
    }
    setError(id, error) {
        if (this._errors[id] !== error) {
            this._errors[id] = error;
            this.update();
        }
        else {
            this._errors[id] = error;
        }
    }
    mapPlugins(plugin) {
        var _a, _b, _c, _d;
        const { id, schema, version } = plugin;
        const trans = this.translator.load('jupyterlab');
        const title = typeof schema.title === 'string' ? trans._p('schema', schema.title) : id;
        const highlightedTitleIndices = algorithm_dist_index_es6_js_.StringExt.matchSumOfSquares(title.toLocaleLowerCase(), (_b = (_a = this._query) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) !== null && _b !== void 0 ? _b : '');
        const hightlightedTitle = algorithm_dist_index_es6_js_.StringExt.highlight(title, (_c = highlightedTitleIndices === null || highlightedTitleIndices === void 0 ? void 0 : highlightedTitleIndices.indices) !== null && _c !== void 0 ? _c : [], chunk => {
            return react_index_js_default().createElement("mark", null, chunk);
        });
        const description = typeof schema.description === 'string'
            ? trans._p('schema', schema.description)
            : '';
        const itemTitle = `${description}\n${id}\n${version}`;
        const icon = this.getHint(ICON_KEY, this._registry, plugin);
        const iconClass = this.getHint(ICON_CLASS_KEY, this._registry, plugin);
        const iconTitle = this.getHint(ICON_LABEL_KEY, this._registry, plugin);
        const filteredProperties = this._filter
            ? (_d = this._filter(plugin)) === null || _d === void 0 ? void 0 : _d.map(fieldValue => {
                var _a, _b, _c;
                const highlightedIndices = algorithm_dist_index_es6_js_.StringExt.matchSumOfSquares(fieldValue.toLocaleLowerCase(), (_b = (_a = this._query) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) !== null && _b !== void 0 ? _b : '');
                const highlighted = algorithm_dist_index_es6_js_.StringExt.highlight(fieldValue, (_c = highlightedIndices === null || highlightedIndices === void 0 ? void 0 : highlightedIndices.indices) !== null && _c !== void 0 ? _c : [], chunk => {
                    return react_index_js_default().createElement("mark", null, chunk);
                });
                return react_index_js_default().createElement("li", { key: `${id}-${fieldValue}` },
                    " ",
                    highlighted,
                    " ");
            })
            : undefined;
        return (react_index_js_default().createElement("div", { onClick: this._evtMousedown, className: `${id === this.selection
                ? 'jp-mod-selected jp-PluginList-entry'
                : 'jp-PluginList-entry'} ${this._errors[id] ? 'jp-ErrorPlugin' : ''}`, "data-id": id, key: id, title: itemTitle },
            react_index_js_default().createElement("div", { className: "jp-PluginList-entry-label", role: "tab" },
                react_index_js_default().createElement("div", { className: "jp-SelectedIndicator" }),
                react_index_js_default().createElement(ui_components_lib_index_js_.LabIcon.resolveReact, { icon: icon || (iconClass ? undefined : ui_components_lib_index_js_.settingsIcon), iconClass: (0,ui_components_lib_index_js_.classes)(iconClass, 'jp-Icon'), title: iconTitle, tag: "span", stylesheet: "settingsEditor" }),
                react_index_js_default().createElement("span", { className: "jp-PluginList-entry-label-text" }, hightlightedTitle)),
            react_index_js_default().createElement("ul", null, filteredProperties)));
    }
    render() {
        const trans = this.translator.load('jupyterlab');
        // Filter all plugins based on search value before displaying list.
        const allPlugins = this._model.plugins.filter(plugin => {
            if (!this._filter) {
                return false;
            }
            const filtered = this._filter(plugin);
            return filtered === null || filtered.length > 0;
        });
        const modifiedPlugins = allPlugins.filter(plugin => {
            var _a;
            return (_a = this._model.settings[plugin.id]) === null || _a === void 0 ? void 0 : _a.isModified;
        });
        const modifiedItems = modifiedPlugins.map(this.mapPlugins);
        const otherItems = allPlugins
            .filter(plugin => {
            return !modifiedPlugins.includes(plugin);
        })
            .map(this.mapPlugins);
        return (react_index_js_default().createElement("div", { className: "jp-PluginList-wrapper" },
            react_index_js_default().createElement(ui_components_lib_index_js_.FilterBox, { updateFilter: this.setFilter, useFuzzyFilter: false, placeholder: trans.__('Search settings…'), forceRefresh: false, caseSensitive: false, initialQuery: this._query }),
            modifiedItems.length > 0 && (react_index_js_default().createElement("div", null,
                react_index_js_default().createElement("h1", { className: "jp-PluginList-header" }, trans.__('Modified')),
                react_index_js_default().createElement("ul", null, modifiedItems))),
            otherItems.length > 0 && (react_index_js_default().createElement("div", null,
                react_index_js_default().createElement("h1", { className: "jp-PluginList-header" }, trans.__('Settings')),
                react_index_js_default().createElement("ul", null, otherItems))),
            modifiedItems.length === 0 && otherItems.length === 0 && (react_index_js_default().createElement("p", { className: "jp-PluginList-noResults" }, trans.__('No items match your search.')))));
    }
}
/**
 * A namespace for `PluginList` statics.
 */
(function (PluginList) {
    /**
     * Sort a list of plugins by title and ID.
     * @deprecated - prior to 4.3 this function was used to reimplement
     * the same ordering between the plugin list and editor; it is no
     * longer needed as the order is now tracked by the model.
     */
    function sortPlugins(registry) {
        return Object.keys(registry.plugins)
            .map(plugin => registry.plugins[plugin])
            .sort((a, b) => {
            return (a.schema.title || a.id).localeCompare(b.schema.title || b.id);
        });
    }
    PluginList.sortPlugins = sortPlugins;
    /**
     * Model for plugin list
     */
    class Model {
        /**
         * Create a new plugin list model.
         */
        constructor(options) {
            var _a;
            this._plugins = [];
            this._changed = new index_es6_js_.Signal(this);
            this._ready = new dist_index_js_.PromiseDelegate();
            this._settings = {};
            this._settingsModified = {};
            this._toSkip = (_a = options.toSkip) !== null && _a !== void 0 ? _a : [];
            this._registry = options.registry;
            this._registry.pluginChanged.connect(async (_emitter, pluginId) => {
                let changed = false;
                // Either plugin can be missing (if plugin was not loaded at all yet)
                // or just plugin's settings may be missing (if transform step has no completed).
                if (!this._plugins.map(plugin => plugin.id).includes(pluginId)) {
                    this._plugins = this._loadPlugins();
                    changed = true;
                }
                if (!this._settings[pluginId]) {
                    const pluginsToLoad = this._plugins.filter(plugin => plugin.id === pluginId);
                    await this._loadSettings(pluginsToLoad);
                    changed = true;
                }
                if (changed) {
                    this._changed.emit();
                }
            }, this);
            this._plugins = this._loadPlugins();
            this._loadSettings(this._plugins)
                .then(() => {
                this._ready.resolve(undefined);
            })
                .catch(reason => {
                console.error(`Failed to load the settings:\n${reason}`);
            });
        }
        /**
         * A list of loaded plugins.
         */
        get plugins() {
            return this._plugins;
        }
        /**
         * A promise which resolves when an initial loading of plugins completed.
         *
         * Note: this does not guarantee that all `plugins` nor `settings` are available
         * as these can be also loaded later as plugins are added or transformed.
         */
        get ready() {
            return this._ready.promise;
        }
        /**
         * Settings keyed by plugin name.
         *
         * Note: settings for plugins can be loaded later than the plugin
         * itself, which is the case for plugins using a `transform` step.
         */
        get settings() {
            return this._settings;
        }
        /**
         * Signal emitted when list of plugins change.
         *
         * This signal will be emitted when new plugins are added to the registry,
         * when settings schema of an already present plugin changes, and when the
         * settings state changes from default to modified or vice versa.
         */
        get changed() {
            return this._changed;
        }
        /**
         * Loads, sorts and filters plugins from the registry.
         */
        _loadPlugins() {
            return this._sortPlugins(this._registry).filter(plugin => {
                const { schema } = plugin;
                const deprecated = schema['jupyter.lab.setting-deprecated'] === true;
                const editable = Object.keys(schema.properties || {}).length > 0;
                const extensible = schema.additionalProperties !== false;
                const correctEditor = !this._toSkip.includes(plugin.id);
                return !deprecated && correctEditor && (editable || extensible);
            });
        }
        /**
         * Loads settings and stores them for easy access when displaying search results.
         */
        async _loadSettings(plugins) {
            for (const plugin of plugins) {
                const pluginSettings = (await this._registry.load(plugin.id));
                pluginSettings.changed.connect(() => {
                    if (pluginSettings.isModified !== this._settingsModified[plugin.id]) {
                        this._changed.emit();
                        this._settingsModified[plugin.id] = pluginSettings.isModified;
                    }
                });
                this._settings[plugin.id] = pluginSettings;
                this._settingsModified[plugin.id] = pluginSettings.isModified;
            }
        }
        _sortPlugins(registry) {
            return Object.keys(registry.plugins)
                .map(plugin => registry.plugins[plugin])
                .sort((a, b) => {
                return (a.schema.title || a.id).localeCompare(b.schema.title || b.id);
            });
        }
    }
    PluginList.Model = Model;
})(PluginList || (PluginList = {}));
//# sourceMappingURL=pluginlist.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
// EXTERNAL MODULE: consume shared module (default) @rjsf/validator-ajv8@^5.13.4 (strict) (fallback: ../node_modules/@rjsf/validator-ajv8/lib/index.js)
var validator_ajv8_lib_index_js_ = __webpack_require__(27478);
var validator_ajv8_lib_index_js_default = /*#__PURE__*/__webpack_require__.n(validator_ajv8_lib_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/SettingsFormEditor.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/







/**
 * Indentation to use when saving the settings as JSON document.
 */
const JSON_INDENTATION = 4;
/**
 * A React component that prepares the settings for a
 * given plugin to be rendered in the FormEditor.
 */
class SettingsFormEditor extends (react_index_js_default()).Component {
    constructor(props) {
        super(props);
        /**
         * Handler for the "Restore to defaults" button - clears all
         * modified settings then calls `setFormData` to restore the
         * values.
         */
        this.reset = async (event) => {
            event.stopPropagation();
            for (const field in this.props.settings.user) {
                await this.props.settings.remove(field);
            }
            this._formData = this.props.settings.composite;
            this.setState({ isModified: false });
        };
        this._syncFormDataWithSettings = () => {
            this._formData = this.props.settings.composite;
            this.setState((prevState, props) => ({
                isModified: props.settings.isModified
            }));
        };
        this._onChange = (e) => {
            this.props.hasError(e.errors.length !== 0);
            // Create a deep copy of the current form data to work with
            const updatedFormData = dist_index_js_.JSONExt.deepCopy(this._formData);
            // Only update fields that are actually present in the filtered view
            if (e.formData) {
                // Safely iterate over the keys in e.formData
                Object.keys(e.formData).forEach(key => {
                    // Use type assertion to tell TypeScript this is safe
                    const formData = e.formData;
                    if (formData && key in formData) {
                        updatedFormData[key] = formData[key];
                    }
                });
            }
            // Convert back to ReadonlyJSONObject for this._formData
            this._formData = updatedFormData;
            if (e.errors.length === 0) {
                this.props.updateDirtyState(true);
                void this._debouncer.invoke();
            }
            this.props.onSelect(this.props.settings.id);
        };
        const { settings } = props;
        settings.changed.connect(this._syncFormDataWithSettings);
        this._formData = settings.composite;
        this.state = {
            isModified: settings.isModified,
            uiSchema: {},
            filteredSchema: this.props.settings.schema,
            formContext: {
                defaultFormData: this.props.settings.default(),
                settings: this.props.settings,
                schema: dist_index_js_.JSONExt.deepCopy(this.props.settings.schema)
            }
        };
        this.handleChange = this.handleChange.bind(this);
        this._debouncer = new polling_dist_index_es6_js_.Debouncer(this.handleChange);
    }
    componentDidMount() {
        this._setUiSchema();
        this._setFilteredSchema();
    }
    componentDidUpdate(prevProps) {
        this._setUiSchema(prevProps.renderers[prevProps.settings.id]);
        this._setFilteredSchema(prevProps.filteredValues);
        if (prevProps.settings !== this.props.settings) {
            this.setState(previousState => ({
                formContext: {
                    ...previousState.formContext,
                    settings: this.props.settings,
                    defaultFormData: this.props.settings.default()
                }
            }));
        }
    }
    componentWillUnmount() {
        this._debouncer.dispose();
    }
    /**
     * Handler for edits made in the form editor.
     */
    handleChange() {
        // Prevent unnecessary save when opening settings that haven't been modified.
        if (!this.props.settings.isModified &&
            this._formData &&
            this.props.settings.isDefault(this._formData)) {
            this.props.updateDirtyState(false);
            return;
        }
        this.props.settings
            .save(JSON.stringify(this._formData, undefined, JSON_INDENTATION))
            .then(() => {
            this.props.updateDirtyState(false);
            this.setState({ isModified: this.props.settings.isModified });
        })
            .catch((reason) => {
            this.props.updateDirtyState(false);
            const trans = this.props.translator.load('jupyterlab');
            void (0,index_js_.showErrorMessage)(trans.__('Error saving settings.'), reason);
        });
    }
    render() {
        const trans = this.props.translator.load('jupyterlab');
        return (react_index_js_default().createElement((react_index_js_default()).Fragment, null,
            react_index_js_default().createElement("div", { className: "jp-SettingsHeader" },
                react_index_js_default().createElement("h2", { className: "jp-SettingsHeader-title", title: this.props.settings.schema.description }, this.props.settings.schema.title),
                react_index_js_default().createElement("div", { className: "jp-SettingsHeader-buttonbar" }, this.state.isModified && (react_index_js_default().createElement(ui_components_lib_index_js_.Button, { className: "jp-RestoreButton", onClick: this.reset }, trans.__('Restore to Defaults')))),
                react_index_js_default().createElement("div", { className: "jp-SettingsHeader-description" }, this.props.settings.schema.description)),
            react_index_js_default().createElement(ui_components_lib_index_js_.FormComponent, { validator: (validator_ajv8_lib_index_js_default()), schema: this.state.filteredSchema, formData: this._getFilteredFormData(this.state.filteredSchema), uiSchema: this.state.uiSchema, fields: this.props.renderers[this.props.settings.id], formContext: this.state.formContext, liveValidate: true, idPrefix: `jp-SettingsEditor-${this.props.settings.id}`, onChange: this._onChange, translator: this.props.translator, experimental_defaultFormStateBehavior: {
                    emptyObjectFields: 'populateRequiredDefaults'
                } })));
    }
    _setUiSchema(prevRenderers) {
        var _a;
        const renderers = this.props.renderers[this.props.settings.id];
        if (!dist_index_js_.JSONExt.deepEqual(Object.keys(prevRenderers !== null && prevRenderers !== void 0 ? prevRenderers : {}).sort(), Object.keys(renderers !== null && renderers !== void 0 ? renderers : {}).sort())) {
            /**
             * Construct uiSchema to pass any custom renderers to the form editor.
             */
            const uiSchema = {};
            for (const id in this.props.renderers[this.props.settings.id]) {
                if (Object.keys((_a = this.props.settings.schema.properties) !== null && _a !== void 0 ? _a : {}).includes(id)) {
                    uiSchema[id] = {
                        'ui:field': id
                    };
                }
            }
            this.setState({ uiSchema });
        }
    }
    _setFilteredSchema(prevFilteredValues) {
        var _a, _b, _c, _d;
        // Update the filtered value if the filter or the schema has changed.
        if (prevFilteredValues === undefined ||
            !dist_index_js_.JSONExt.deepEqual(prevFilteredValues, this.props.filteredValues) ||
            !dist_index_js_.JSONExt.deepEqual(this.state.formContext.schema, this.props.settings.schema)) {
            /**
             * Only show fields that match search value.
             */
            const filteredSchema = dist_index_js_.JSONExt.deepCopy(this.props.settings.schema);
            if ((_b = (_a = this.props.filteredValues) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) {
                for (const field in filteredSchema.properties) {
                    if (!((_c = this.props.filteredValues) === null || _c === void 0 ? void 0 : _c.includes((_d = filteredSchema.properties[field].title) !== null && _d !== void 0 ? _d : field))) {
                        delete filteredSchema.properties[field];
                    }
                }
            }
            this.setState(previousState => ({
                filteredSchema,
                formContext: {
                    ...previousState.formContext,
                    schema: dist_index_js_.JSONExt.deepCopy(this.props.settings.schema)
                }
            }));
        }
    }
    _getFilteredFormData(filteredSchema) {
        if (!(filteredSchema === null || filteredSchema === void 0 ? void 0 : filteredSchema.properties)) {
            return this._formData;
        }
        const filteredFormData = dist_index_js_.JSONExt.deepCopy(this._formData);
        for (const field in filteredFormData) {
            if (!filteredSchema.properties[field]) {
                delete filteredFormData[field];
            }
        }
        return filteredFormData;
    }
}
//# sourceMappingURL=SettingsFormEditor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/InstructionsPlaceholder.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

const SettingsEditorPlaceholder = ({ translator }) => {
    const trans = translator.load('jupyterlab');
    return (react_index_js_default().createElement("div", { className: "jp-SettingsEditor-placeholder" },
        react_index_js_default().createElement("div", { className: "jp-SettingsEditor-placeholderContent" },
            react_index_js_default().createElement("h3", null, trans.__('No Plugin Selected')),
            react_index_js_default().createElement("p", null, trans.__('Select a plugin from the list to view and edit its preferences.')))));
};
//# sourceMappingURL=InstructionsPlaceholder.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/settingspanel.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/



/**
 * React component that displays a list of SettingsFormEditor
 * components.
 */
const SettingsPanel = ({ settings, editorRegistry, onSelect, handleSelectSignal, hasError, updateDirtyState, updateFilterSignal, translator, initialFilter }) => {
    const [activePluginId, setActivePluginId] = (0,react_index_js_.useState)(null);
    const [filterPlugin, setFilter] = (0,react_index_js_.useState)(initialFilter ? () => initialFilter : null);
    const wrapperRef = react_index_js_default().useRef(null);
    const editorDirtyStates = react_index_js_default().useRef({});
    (0,react_index_js_.useEffect)(() => {
        var _a;
        const onFilterUpdate = (list, newFilter) => {
            newFilter ? setFilter(() => newFilter) : setFilter(null);
        };
        // When filter updates, only show plugins that match search.
        updateFilterSignal.connect(onFilterUpdate);
        const onSelectChange = (list, pluginId) => {
            setActivePluginId(pluginId);
        };
        (_a = handleSelectSignal === null || handleSelectSignal === void 0 ? void 0 : handleSelectSignal.connect) === null || _a === void 0 ? void 0 : _a.call(handleSelectSignal, onSelectChange);
        return () => {
            var _a;
            updateFilterSignal.disconnect(onFilterUpdate);
            (_a = handleSelectSignal === null || handleSelectSignal === void 0 ? void 0 : handleSelectSignal.disconnect) === null || _a === void 0 ? void 0 : _a.call(handleSelectSignal, onSelectChange);
        };
    }, []);
    const updateDirtyStates = react_index_js_default().useCallback((id, dirty) => {
        if (editorDirtyStates.current) {
            editorDirtyStates.current[id] = dirty;
            for (const editor in editorDirtyStates.current) {
                if (editorDirtyStates.current[editor]) {
                    updateDirtyState(true);
                    return;
                }
            }
        }
        updateDirtyState(false);
    }, [editorDirtyStates, updateDirtyState]);
    const renderers = react_index_js_default().useMemo(() => Object.entries(editorRegistry.renderers).reduce((agg, [id, renderer]) => {
        const splitPosition = id.lastIndexOf('.');
        const pluginId = id.substring(0, splitPosition);
        const propertyName = id.substring(splitPosition + 1);
        if (!agg[pluginId]) {
            agg[pluginId] = {};
        }
        if (!agg[pluginId][propertyName] && renderer.fieldRenderer) {
            agg[pluginId][propertyName] = renderer.fieldRenderer;
        }
        return agg;
    }, {}), [editorRegistry]);
    if (!activePluginId && !filterPlugin) {
        return react_index_js_default().createElement(SettingsEditorPlaceholder, { translator: translator });
    }
    return (react_index_js_default().createElement("div", { className: "jp-SettingsPanel", ref: wrapperRef }, settings.map(pluginSettings => {
        // Pass filtered results to SettingsFormEditor to only display filtered fields.
        const filtered = filterPlugin
            ? filterPlugin(pluginSettings.plugin)
            : null;
        // If filtered results are an array, only show if the array is non-empty.
        if ((activePluginId && activePluginId !== pluginSettings.id) ||
            (filtered !== null && filtered.length === 0)) {
            return undefined;
        }
        return (react_index_js_default().createElement("div", { className: "jp-SettingsForm", key: `${pluginSettings.id}SettingsEditor` },
            react_index_js_default().createElement(SettingsFormEditor, { filteredValues: filtered, settings: pluginSettings, renderers: renderers, hasError: (error) => {
                    hasError(pluginSettings.id, error);
                }, updateDirtyState: (dirty) => {
                    updateDirtyStates(pluginSettings.id, dirty);
                }, onSelect: onSelect, translator: translator })));
    })));
};
//# sourceMappingURL=settingspanel.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/settingseditor.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */








/**
 * Form based interface for editing settings.
 */
class SettingsEditor extends dist_index_es6_js_.SplitPanel {
    constructor(options) {
        super({
            orientation: 'horizontal',
            renderer: dist_index_es6_js_.SplitPanel.defaultRenderer,
            spacing: 1
        });
        this._clearDirty = null;
        this._dirty = false;
        this._saveStateChange = new index_es6_js_.Signal(this);
        this.translator = options.translator || lib_index_js_.nullTranslator;
        this._status = options.status;
        this._listModel = new PluginList.Model({
            registry: options.registry,
            // Filters out a couple of plugins that take too long to load in the new settings editor.
            toSkip: options.toSkip
        });
        this._list = new PluginList({
            registry: options.registry,
            translator: this.translator,
            query: options.query,
            model: this._listModel
        });
        this._listModel.changed.connect(() => {
            this.update();
        });
        this.addWidget(this._list);
        this.setDirtyState = this.setDirtyState.bind(this);
        const settingsPanel = ui_components_lib_index_js_.ReactWidget.create(react_index_js_default().createElement(ui_components_lib_index_js_.UseSignal, { signal: this._listModel.changed }, () => (react_index_js_default().createElement(SettingsPanel, { settings: [...Object.values(this._listModel.settings)], editorRegistry: options.editorRegistry, handleSelectSignal: this._list.handleSelectSignal, onSelect: (id) => (this._list.selection = id), hasError: this._list.setError, updateFilterSignal: this._list.updateFilterSignal, updateDirtyState: this.setDirtyState, translator: this.translator, initialFilter: this._list.filter }))));
        // Initializes the settings panel after loading the schema for all plugins.
        this._listModel.ready
            .then(() => {
            this.addWidget(settingsPanel);
        })
            .catch(reason => {
            console.error(`Failed to load the setting plugins:\n${reason}`);
        });
    }
    /**
     * A signal emitted on the start and end of a saving operation.
     */
    get saveStateChanged() {
        return this._saveStateChange;
    }
    /**
     * Set the dirty state status
     *
     * @param dirty New status
     */
    setDirtyState(dirty) {
        this._dirty = dirty;
        if (this._dirty && !this._clearDirty) {
            this._clearDirty = this._status.setDirty();
        }
        else if (!this._dirty && this._clearDirty) {
            this._clearDirty.dispose();
            this._clearDirty = null;
        }
        if (dirty) {
            if (!this.title.className.includes('jp-mod-dirty')) {
                this.title.className += ' jp-mod-dirty';
            }
        }
        else {
            this.title.className = this.title.className.replace('jp-mod-dirty', '');
        }
        this._saveStateChange.emit(dirty ? 'started' : 'completed');
    }
    /**
     * Updates the filter of the plugin list.
     *
     * @param query The query to filter the plugin list
     */
    updateQuery(query) {
        this._list.setFilter(query ? (0,ui_components_lib_index_js_.updateFilterFunction)(query, false, false) : null, query);
    }
    /**
     * A message handler invoked on a `'close-request'` message.
     *
     * @param msg Widget message
     */
    onCloseRequest(msg) {
        const trans = this.translator.load('jupyterlab');
        if (this._list.hasErrors) {
            void (0,index_js_.showDialog)({
                title: trans.__('Warning'),
                body: trans.__('Unsaved changes due to validation error. Continue without saving?')
            }).then(value => {
                if (value.button.accept) {
                    this.dispose();
                    super.onCloseRequest(msg);
                }
            });
        }
        else if (this._dirty) {
            void (0,index_js_.showDialog)({
                title: trans.__('Warning'),
                body: trans.__('Some changes have not been saved. Continue without saving?')
            }).then(value => {
                if (value.button.accept) {
                    this.dispose();
                    super.onCloseRequest(msg);
                }
            });
        }
        else {
            this.dispose();
            super.onCloseRequest(msg);
        }
    }
}
//# sourceMappingURL=settingseditor.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/codeeditor@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/codeeditor/lib/index.js)
var codeeditor_lib_index_js_ = __webpack_require__(67458);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/inspector/lib/inspector.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * The class name added to inspector panels.
 */
const PANEL_CLASS = 'jp-Inspector';
/**
 * The class name added to inspector content.
 */
const CONTENT_CLASS = 'jp-Inspector-content';
/**
 * The class name added to default inspector content.
 */
const DEFAULT_CONTENT_CLASS = 'jp-Inspector-placeholderContent';
/**
 * A panel which contains a set of inspectors.
 */
class InspectorPanel extends dist_index_es6_js_.Panel {
    /**
     * Construct an inspector.
     */
    constructor(options = {}) {
        super();
        this._source = null;
        this.translator = options.translator || lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        if (options.initialContent instanceof dist_index_es6_js_.Widget) {
            this._content = options.initialContent;
        }
        else if (typeof options.initialContent === 'string') {
            this._content = InspectorPanel._generateContentWidget(`<p>${options.initialContent}</p>`);
        }
        else {
            const placeholderHeadline = `<h3>${this._trans.__('No Documentation')}</h3>`;
            const placeholderText = `<p>${this._trans.__('Move the cursor to a code fragment (e.g. function or object) to request information about it from the kernel attached to the editor.')}</p>`;
            this._content = InspectorPanel._generateContentWidget(`${placeholderHeadline}${placeholderText}`);
        }
        this.addClass(PANEL_CLASS);
        this.layout.addWidget(this._content);
    }
    /**
     * Print in iframe
     */
    [index_js_.Printing.symbol]() {
        return () => index_js_.Printing.printWidget(this);
    }
    /**
     * The source of events the inspector panel listens for.
     */
    get source() {
        return this._source;
    }
    set source(source) {
        if (this._source === source) {
            return;
        }
        // Disconnect old signal handler.
        if (this._source) {
            this._source.standby = true;
            this._source.inspected.disconnect(this.onInspectorUpdate, this);
            this._source.disposed.disconnect(this.onSourceDisposed, this);
        }
        // Reject a source that is already disposed.
        if (source && source.isDisposed) {
            source = null;
        }
        // Update source.
        this._source = source;
        // Connect new signal handler.
        if (this._source) {
            this._source.standby = false;
            this._source.inspected.connect(this.onInspectorUpdate, this);
            this._source.disposed.connect(this.onSourceDisposed, this);
        }
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.source = null;
        super.dispose();
    }
    /**
     * Handle inspector update signals.
     */
    onInspectorUpdate(sender, args) {
        const { content } = args;
        // Update the content of the inspector widget.
        if (!content || content === this._content) {
            return;
        }
        this._content.dispose();
        this._content = content;
        content.addClass(CONTENT_CLASS);
        this.layout.addWidget(content);
    }
    /**
     * Handle source disposed signals.
     */
    onSourceDisposed(sender, args) {
        this.source = null;
    }
    /**
     * Generate content widget from string
     */
    static _generateContentWidget(message) {
        const widget = new dist_index_es6_js_.Widget();
        widget.node.innerHTML = message;
        widget.addClass(CONTENT_CLASS);
        widget.addClass(DEFAULT_CONTENT_CLASS);
        return widget;
    }
}
//# sourceMappingURL=inspector.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var coreutils_lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/inspector/lib/handler.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * An object that handles code inspection.
 */
class InspectionHandler {
    /**
     * Construct a new inspection handler for a widget.
     */
    constructor(options) {
        this._cleared = new index_es6_js_.Signal(this);
        this._disposed = new index_es6_js_.Signal(this);
        this._editor = null;
        this._inspected = new index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._pending = 0;
        this._standby = true;
        this._lastInspectedReply = null;
        this._connector = options.connector;
        this._rendermime = options.rendermime;
        this._debouncer = new polling_dist_index_es6_js_.Debouncer(this.onEditorChange.bind(this), 250);
    }
    /**
     * A signal emitted when the inspector should clear all items.
     */
    get cleared() {
        return this._cleared;
    }
    /**
     * A signal emitted when the handler is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * A signal emitted when an inspector value is generated.
     */
    get inspected() {
        return this._inspected;
    }
    /**
     * The editor widget used by the inspection handler.
     */
    get editor() {
        return this._editor;
    }
    set editor(newValue) {
        if (newValue === this._editor) {
            return;
        }
        // Remove all of our listeners.
        index_es6_js_.Signal.disconnectReceiver(this);
        const editor = (this._editor = newValue);
        if (editor) {
            // Clear the inspector in preparation for a new editor.
            this._cleared.emit(void 0);
            // Call onEditorChange to cover the case where the user changes
            // the active cell
            this.onEditorChange();
            editor.model.selections.changed.connect(this._onChange, this);
            editor.model.sharedModel.changed.connect(this._onChange, this);
        }
    }
    /**
     * Indicates whether the handler makes API inspection requests or stands by.
     *
     * #### Notes
     * The use case for this attribute is to limit the API traffic when no
     * inspector is visible.
     */
    get standby() {
        return this._standby;
    }
    set standby(value) {
        this._standby = value;
    }
    /**
     * Get whether the inspection handler is disposed.
     *
     * #### Notes
     * This is a read-only property.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources used by the handler.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._debouncer.dispose();
        this._disposed.emit(void 0);
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Handle a text changed signal from an editor.
     *
     * #### Notes
     * Update the hints inspector based on a text change.
     */
    onEditorChange(customText) {
        // If the handler is in standby mode, bail.
        if (this._standby) {
            return;
        }
        const editor = this.editor;
        if (!editor) {
            return;
        }
        const text = customText ? customText : editor.model.sharedModel.getSource();
        const position = editor.getCursorPosition();
        const offset = coreutils_lib_index_js_.Text.jsIndexToCharIndex(editor.getOffsetAt(position), text);
        const update = { content: null };
        const pending = ++this._pending;
        void this._connector
            .fetch({ offset, text })
            .then(reply => {
            // If handler has been disposed or a newer request is pending, bail.
            if (!reply || this.isDisposed || pending !== this._pending) {
                this._lastInspectedReply = null;
                this._inspected.emit(update);
                return;
            }
            const { data } = reply;
            // Do not update if there would be no change.
            if (this._lastInspectedReply &&
                dist_index_js_.JSONExt.deepEqual(this._lastInspectedReply, data)) {
                return;
            }
            const mimeType = this._rendermime.preferredMimeType(data);
            if (mimeType) {
                const widget = this._rendermime.createRenderer(mimeType);
                const model = new rendermime_lib_index_js_.MimeModel({ data });
                void widget.renderModel(model);
                update.content = widget;
            }
            this._lastInspectedReply = reply.data;
            this._inspected.emit(update);
        })
            .catch(reason => {
            // Since almost all failures are benign, fail silently.
            this._lastInspectedReply = null;
            this._inspected.emit(update);
        });
    }
    /**
     * Handle changes to the editor state, debouncing.
     */
    _onChange() {
        void this._debouncer.invoke();
    }
}
//# sourceMappingURL=handler.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var statedb_lib_index_js_ = __webpack_require__(43988);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/inspector.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/




/**
 * Create a raw editor inspector.
 */
function createInspector(editor, rendermime, translator) {
    translator = translator || lib_index_js_.nullTranslator;
    const trans = translator.load('jupyterlab');
    const connector = new InspectorConnector(editor, translator);
    const inspector = new InspectorPanel({
        initialContent: trans.__('Any errors will be listed here'),
        translator: translator
    });
    const handler = new InspectionHandler({
        connector,
        rendermime: rendermime ||
            new rendermime_lib_index_js_.RenderMimeRegistry({
                initialFactories: rendermime_lib_index_js_.standardRendererFactories,
                translator: translator
            })
    });
    inspector.addClass('jp-SettingsDebug');
    inspector.source = handler;
    handler.editor = editor.source;
    return inspector;
}
/**
 * The data connector used to populate a code inspector.
 *
 * #### Notes
 * This data connector debounces fetch requests to throttle them at no more than
 * one request per 100ms. This means that using the connector to populate
 * multiple client objects can lead to missed fetch responses.
 */
class InspectorConnector extends statedb_lib_index_js_.DataConnector {
    constructor(editor, translator) {
        super();
        this._current = 0;
        this._editor = editor;
        this._trans = (translator !== null && translator !== void 0 ? translator : lib_index_js_.nullTranslator).load('jupyterlab');
    }
    /**
     * Fetch inspection requests.
     */
    fetch(request) {
        return new Promise(resolve => {
            // Debounce requests at a rate of 100ms.
            const current = (this._current = window.setTimeout(() => {
                if (current !== this._current) {
                    return resolve(undefined);
                }
                const errors = this._validate(request.text);
                if (!errors) {
                    return resolve({
                        data: { 'text/markdown': this._trans.__('No errors found') },
                        metadata: {}
                    });
                }
                resolve({ data: this.render(errors), metadata: {} });
            }, 100));
        });
    }
    /**
     * Render validation errors as an HTML string.
     */
    render(errors) {
        return {
            'text/markdown': errors.map(this.renderError.bind(this)).join('')
        };
    }
    /**
     * Render an individual validation error as a markdown string.
     */
    renderError(error) {
        var _a;
        switch (error.keyword) {
            case 'additionalProperties':
                return `**\`[${this._trans.__('additional property error')}]\`**
          ${this._trans.__('`%1` is not a valid property', (_a = error.params) === null || _a === void 0 ? void 0 : _a.additionalProperty)}`;
            case 'syntax':
                return `**\`[${this._trans.__('syntax error')}]\`** *${error.message}*`;
            case 'type':
                return `**\`[${this._trans.__('type error')}]\`**
          \`${error.instancePath}\` ${error.message}`;
            default:
                return `**\`[${this._trans.__('error')}]\`** *${error.message}*`;
        }
    }
    _validate(raw) {
        const editor = this._editor;
        if (!editor.settings) {
            return null;
        }
        const { id, schema, version } = editor.settings;
        const data = { composite: {}, user: {} };
        const validator = editor.registry.validator;
        return validator.validateData({ data, id, raw, schema, version }, false);
    }
}
//# sourceMappingURL=inspector.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/raweditor.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * A class name added to all raw editors.
 */
const RAW_EDITOR_CLASS = 'jp-SettingsRawEditor';
/**
 * A class name added to the user settings editor.
 */
const USER_CLASS = 'jp-SettingsRawEditor-user';
/**
 * A class name added to the user editor when there are validation errors.
 */
const ERROR_CLASS = 'jp-mod-error';
/**
 * A raw JSON settings editor.
 */
class RawEditor extends dist_index_es6_js_.SplitPanel {
    /**
     * Create a new plugin editor.
     */
    constructor(options) {
        super({
            orientation: 'horizontal',
            renderer: dist_index_es6_js_.SplitPanel.defaultRenderer,
            spacing: 1
        });
        this._canRevert = false;
        this._canSave = false;
        this._commandsChanged = new index_es6_js_.Signal(this);
        this._settings = null;
        this._toolbar = new ui_components_lib_index_js_.Toolbar();
        const { commands, editorFactory, registry, translator } = options;
        this.registry = registry;
        this.translator = translator || lib_index_js_.nullTranslator;
        this._commands = commands;
        // Create read-only defaults editor.
        const defaults = (this._defaults = new codeeditor_lib_index_js_.CodeEditorWrapper({
            editorOptions: {
                config: { readOnly: true }
            },
            model: new codeeditor_lib_index_js_.CodeEditor.Model({ mimeType: 'text/javascript' }),
            factory: editorFactory
        }));
        // Create read-write user settings editor.
        const user = (this._user = new codeeditor_lib_index_js_.CodeEditorWrapper({
            editorOptions: {
                config: { lineNumbers: true }
            },
            model: new codeeditor_lib_index_js_.CodeEditor.Model({ mimeType: 'text/javascript' }),
            factory: editorFactory
        }));
        user.addClass(USER_CLASS);
        user.editor.model.sharedModel.changed.connect(this._onTextChanged, this);
        // Create and set up an inspector.
        this._inspector = createInspector(this, options.rendermime, this.translator);
        this.addClass(RAW_EDITOR_CLASS);
        this._onSaveError = options.onSaveError;
        this.addWidget(Private.defaultsEditor(defaults, this.translator));
        this.addWidget(Private.userEditor(user, this._toolbar, this._inspector, this.translator));
    }
    /**
     * Whether the raw editor revert functionality is enabled.
     */
    get canRevert() {
        return this._canRevert;
    }
    /**
     * Whether the raw editor save functionality is enabled.
     */
    get canSave() {
        return this._canSave;
    }
    /**
     * Emits when the commands passed in at instantiation change.
     */
    get commandsChanged() {
        return this._commandsChanged;
    }
    /**
     * Tests whether the settings have been modified and need saving.
     */
    get isDirty() {
        var _a, _b;
        return ((_b = this._user.editor.model.sharedModel.getSource() !== ((_a = this._settings) === null || _a === void 0 ? void 0 : _a.raw)) !== null && _b !== void 0 ? _b : '');
    }
    /**
     * The plugin settings being edited.
     */
    get settings() {
        return this._settings;
    }
    set settings(settings) {
        if (!settings && !this._settings) {
            return;
        }
        const samePlugin = settings && this._settings && settings.plugin === this._settings.plugin;
        if (samePlugin) {
            return;
        }
        const defaults = this._defaults;
        const user = this._user;
        // Disconnect old settings change handler.
        if (this._settings) {
            this._settings.changed.disconnect(this._onSettingsChanged, this);
        }
        if (settings) {
            this._settings = settings;
            this._settings.changed.connect(this._onSettingsChanged, this);
            this._onSettingsChanged();
        }
        else {
            this._settings = null;
            defaults.editor.model.sharedModel.setSource('');
            user.editor.model.sharedModel.setSource('');
        }
        this.update();
    }
    /**
     * Get the relative sizes of the two editor panels.
     */
    get sizes() {
        return this.relativeSizes();
    }
    set sizes(sizes) {
        this.setRelativeSizes(sizes);
    }
    /**
     * The inspectable source editor for user input.
     */
    get source() {
        return this._user.editor;
    }
    /**
     * Dispose of the resources held by the raw editor.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._defaults.model.dispose();
        this._defaults.dispose();
        this._user.model.dispose();
        this._user.dispose();
        super.dispose();
    }
    /**
     * Revert the editor back to original settings.
     */
    revert() {
        var _a, _b;
        this._user.editor.model.sharedModel.setSource((_b = (_a = this.settings) === null || _a === void 0 ? void 0 : _a.raw) !== null && _b !== void 0 ? _b : '');
        this._updateToolbar(false, false);
    }
    /**
     * Save the contents of the raw editor.
     */
    save() {
        if (!this.isDirty || !this._settings) {
            return Promise.resolve(undefined);
        }
        const settings = this._settings;
        const source = this._user.editor.model.sharedModel.getSource();
        return settings
            .save(source)
            .then(() => {
            this._updateToolbar(false, false);
        })
            .catch(reason => {
            this._updateToolbar(true, false);
            this._onSaveError(reason, this.translator);
        });
    }
    /**
     * Handle `after-attach` messages.
     */
    onAfterAttach(msg) {
        Private.populateToolbar(this._commands, this._toolbar);
        this.update();
    }
    /**
     * Handle text changes in the underlying editor.
     */
    _onTextChanged() {
        const raw = this._user.editor.model.sharedModel.getSource();
        const settings = this._settings;
        this.removeClass(ERROR_CLASS);
        // If there are no settings loaded or there are no changes, bail.
        if (!settings || settings.raw === raw) {
            this._updateToolbar(false, false);
            return;
        }
        const errors = settings.validate(raw);
        if (errors) {
            this.addClass(ERROR_CLASS);
            this._updateToolbar(true, false);
            return;
        }
        this._updateToolbar(true, true);
    }
    /**
     * Handle updates to the settings.
     */
    _onSettingsChanged() {
        var _a, _b;
        const settings = this._settings;
        const defaults = this._defaults;
        const user = this._user;
        defaults.editor.model.sharedModel.setSource((_a = settings === null || settings === void 0 ? void 0 : settings.annotatedDefaults()) !== null && _a !== void 0 ? _a : '');
        user.editor.model.sharedModel.setSource((_b = settings === null || settings === void 0 ? void 0 : settings.raw) !== null && _b !== void 0 ? _b : '');
    }
    _updateToolbar(revert = this._canRevert, save = this._canSave) {
        const commands = this._commands;
        this._canRevert = revert;
        this._canSave = save;
        this._commandsChanged.emit([commands.revert, commands.save]);
    }
}
/**
 * A namespace for private module data.
 */
var Private;
(function (Private) {
    /**
     * Returns the wrapped setting defaults editor.
     */
    function defaultsEditor(editor, translator) {
        translator = translator || lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const widget = new dist_index_es6_js_.Widget();
        const layout = (widget.layout = new dist_index_es6_js_.BoxLayout({ spacing: 0 }));
        const banner = new dist_index_es6_js_.Widget();
        const bar = new ui_components_lib_index_js_.Toolbar();
        bar.node.setAttribute('aria-label', trans.__('Default editor toolbar'));
        const defaultTitle = trans.__('System Defaults');
        banner.node.innerText = defaultTitle;
        bar.insertItem(0, 'banner', banner);
        layout.addWidget(bar);
        layout.addWidget(editor);
        return widget;
    }
    Private.defaultsEditor = defaultsEditor;
    /**
     * Populate the raw editor toolbar.
     */
    function populateToolbar(commands, toolbar) {
        const { registry, revert, save } = commands;
        toolbar.addItem('spacer', ui_components_lib_index_js_.Toolbar.createSpacerItem());
        // Note the button order. The rationale here is that no matter what state
        // the toolbar is in, the relative location of the revert button in the
        // toolbar remains the same.
        [revert, save].forEach(name => {
            const item = new ui_components_lib_index_js_.CommandToolbarButton({ commands: registry, id: name });
            toolbar.addItem(name, item);
        });
    }
    Private.populateToolbar = populateToolbar;
    /**
     * Returns the wrapped user overrides editor.
     */
    function userEditor(editor, toolbar, inspector, translator) {
        translator = translator || lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        const userTitle = trans.__('User Preferences');
        const widget = new dist_index_es6_js_.Widget();
        const layout = (widget.layout = new dist_index_es6_js_.BoxLayout({ spacing: 0 }));
        const banner = new dist_index_es6_js_.Widget();
        banner.node.innerText = userTitle;
        toolbar.insertItem(0, 'banner', banner);
        layout.addWidget(toolbar);
        layout.addWidget(editor);
        layout.addWidget(inspector);
        return widget;
    }
    Private.userEditor = userEditor;
})(Private || (Private = {}));
//# sourceMappingURL=raweditor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/plugineditor.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/






/**
 * The class name added to all plugin editors.
 */
const PLUGIN_EDITOR_CLASS = 'jp-PluginEditor';
/**
 * An individual plugin settings editor.
 */
class PluginEditor extends dist_index_es6_js_.Widget {
    /**
     * Create a new plugin editor.
     *
     * @param options - The plugin editor instantiation options.
     */
    constructor(options) {
        super();
        this._settings = null;
        this._stateChanged = new index_es6_js_.Signal(this);
        this.addClass(PLUGIN_EDITOR_CLASS);
        const { commands, editorFactory, registry, rendermime, translator } = options;
        this.translator = translator || lib_index_js_.nullTranslator;
        this._trans = this.translator.load('jupyterlab');
        // TODO: Remove this layout. We were using this before when we
        // when we had a way to switch between the raw and table editor
        // Now, the raw editor is the only child and probably could merged into
        // this class directly in the future.
        const layout = (this.layout = new dist_index_es6_js_.StackedLayout());
        const { onSaveError } = plugineditor_Private;
        this.raw = this._rawEditor = new RawEditor({
            commands,
            editorFactory,
            onSaveError,
            registry,
            rendermime,
            translator
        });
        this._rawEditor.handleMoved.connect(this._onStateChanged, this);
        layout.addWidget(this._rawEditor);
    }
    /**
     * Tests whether the settings have been modified and need saving.
     */
    get isDirty() {
        return this._rawEditor.isDirty;
    }
    /**
     * The plugin settings being edited.
     */
    get settings() {
        return this._settings;
    }
    set settings(settings) {
        if (this._settings === settings) {
            return;
        }
        const raw = this._rawEditor;
        this._settings = raw.settings = settings;
        this.update();
    }
    /**
     * The plugin editor layout state.
     */
    get state() {
        const plugin = this._settings ? this._settings.id : '';
        const { sizes } = this._rawEditor;
        return { plugin, sizes };
    }
    set state(state) {
        if (dist_index_js_.JSONExt.deepEqual(this.state, state)) {
            return;
        }
        this._rawEditor.sizes = state.sizes;
        this.update();
    }
    /**
     * A signal that emits when editor layout state changes and needs to be saved.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * If the editor is in a dirty state, confirm that the user wants to leave.
     */
    confirm() {
        if (this.isHidden || !this.isAttached || !this.isDirty) {
            return Promise.resolve(undefined);
        }
        return (0,index_js_.showDialog)({
            title: this._trans.__('You have unsaved changes.'),
            body: this._trans.__('Do you want to leave without saving?'),
            buttons: [
                index_js_.Dialog.cancelButton({ label: this._trans.__('Cancel') }),
                index_js_.Dialog.okButton({ label: this._trans.__('Ok') })
            ]
        }).then(result => {
            if (!result.button.accept) {
                throw new Error('User canceled.');
            }
        });
    }
    /**
     * Dispose of the resources held by the plugin editor.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
        this._rawEditor.dispose();
    }
    /**
     * Handle `after-attach` messages.
     */
    onAfterAttach(msg) {
        this.update();
    }
    /**
     * Handle `'update-request'` messages.
     */
    onUpdateRequest(msg) {
        const raw = this._rawEditor;
        const settings = this._settings;
        if (!settings) {
            this.hide();
            return;
        }
        this.show();
        raw.show();
    }
    /**
     * Handle layout state changes that need to be saved.
     */
    _onStateChanged() {
        this.stateChanged.emit(undefined);
    }
}
/**
 * A namespace for private module data.
 */
var plugineditor_Private;
(function (Private) {
    /**
     * Handle save errors.
     */
    function onSaveError(reason, translator) {
        translator = translator || lib_index_js_.nullTranslator;
        const trans = translator.load('jupyterlab');
        console.error(`Saving setting editor value failed: ${reason.message}`);
        void (0,index_js_.showErrorMessage)(trans.__('Your changes were not saved.'), reason);
    }
    Private.onSaveError = onSaveError;
})(plugineditor_Private || (plugineditor_Private = {}));
//# sourceMappingURL=plugineditor.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/jsonsettingeditor.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/








/**
 * The ratio panes in the setting editor.
 */
const DEFAULT_LAYOUT = {
    sizes: [1, 3],
    container: {
        editor: 'raw',
        plugin: '',
        sizes: [1, 1]
    }
};
/**
 * An interface for modifying and saving application settings.
 */
class JsonSettingEditor extends dist_index_es6_js_.SplitPanel {
    /**
     * Create a new setting editor.
     */
    constructor(options) {
        super({
            orientation: 'horizontal',
            renderer: dist_index_es6_js_.SplitPanel.defaultRenderer,
            spacing: 1
        });
        this._fetching = null;
        this._saving = false;
        this._state = dist_index_js_.JSONExt.deepCopy(DEFAULT_LAYOUT);
        this.translator = options.translator || lib_index_js_.nullTranslator;
        this.addClass('jp-SettingEditor');
        this.key = options.key;
        this.state = options.state;
        const { commands, editorFactory, rendermime } = options;
        const registry = (this.registry = options.registry);
        const instructions = (this._instructions = ui_components_lib_index_js_.ReactWidget.create(react_index_js_.createElement(SettingsEditorPlaceholder, { translator: this.translator })));
        instructions.addClass('jp-SettingEditorInstructions');
        const editor = (this._editor = new PluginEditor({
            commands,
            editorFactory,
            registry,
            rendermime,
            translator: this.translator
        }));
        const confirm = () => editor.confirm();
        const list = (this._list = new PluginList({
            confirm,
            registry,
            translator: this.translator
        }));
        const when = options.when;
        if (when) {
            this._when = Array.isArray(when) ? Promise.all(when) : when;
        }
        this.addWidget(list);
        this.addWidget(instructions);
        dist_index_es6_js_.SplitPanel.setStretch(list, 0);
        dist_index_es6_js_.SplitPanel.setStretch(instructions, 1);
        dist_index_es6_js_.SplitPanel.setStretch(editor, 1);
        editor.stateChanged.connect(this._onStateChanged, this);
        list.changed.connect(this._onStateChanged, this);
        this.handleMoved.connect(this._onStateChanged, this);
    }
    /**
     * Whether the raw editor revert functionality is enabled.
     */
    get canRevertRaw() {
        return this._editor.raw.canRevert;
    }
    /**
     * Whether the raw editor save functionality is enabled.
     */
    get canSaveRaw() {
        return this._editor.raw.canSave;
    }
    /**
     * Emits when the commands passed in at instantiation change.
     */
    get commandsChanged() {
        return this._editor.raw.commandsChanged;
    }
    /**
     * The currently loaded settings.
     */
    get settings() {
        return this._editor.settings;
    }
    /**
     * The inspectable raw user editor source for the currently loaded settings.
     */
    get source() {
        return this._editor.raw.source;
    }
    /**
     * Dispose of the resources held by the setting editor.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
        this._editor.dispose();
        this._instructions.dispose();
        this._list.dispose();
    }
    /**
     * Revert raw editor back to original settings.
     */
    revert() {
        this._editor.raw.revert();
    }
    /**
     * Save the contents of the raw editor.
     */
    save() {
        return this._editor.raw.save();
    }
    /**
     * Handle `'after-attach'` messages.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        this.hide();
        this._fetchState()
            .then(() => {
            this.show();
            this._setState();
        })
            .catch(reason => {
            console.error('Fetching setting editor state failed', reason);
            this.show();
            this._setState();
        });
    }
    /**
     * Handle `'close-request'` messages.
     */
    onCloseRequest(msg) {
        this._editor
            .confirm()
            .then(() => {
            super.onCloseRequest(msg);
            this.dispose();
        })
            .catch(() => {
            /* no op */
        });
    }
    /**
     * Get the state of the panel.
     */
    _fetchState() {
        if (this._fetching) {
            return this._fetching;
        }
        const { key, state } = this;
        const promises = [state.fetch(key), this._when];
        return (this._fetching = Promise.all(promises).then(([value]) => {
            this._fetching = null;
            if (this._saving) {
                return;
            }
            this._state = jsonsettingeditor_Private.normalizeState(value, this._state);
        }));
    }
    /**
     * Handle root level layout state changes.
     */
    async _onStateChanged() {
        this._state.sizes = this.relativeSizes();
        this._state.container = this._editor.state;
        this._state.container.plugin = this._list.selection;
        try {
            await this._saveState();
        }
        catch (error) {
            console.error('Saving setting editor state failed', error);
        }
        this._setState();
    }
    /**
     * Set the state of the setting editor.
     */
    async _saveState() {
        const { key, state } = this;
        const value = this._state;
        this._saving = true;
        try {
            await state.save(key, value);
            this._saving = false;
        }
        catch (error) {
            this._saving = false;
            throw error;
        }
    }
    /**
     * Set the layout sizes.
     */
    _setLayout() {
        const editor = this._editor;
        const state = this._state;
        editor.state = state.container;
        // Allow the message queue (which includes fit requests that might disrupt
        // setting relative sizes) to clear before setting sizes.
        requestAnimationFrame(() => {
            this.setRelativeSizes(state.sizes);
        });
    }
    /**
     * Set the presets of the setting editor.
     */
    _setState() {
        const editor = this._editor;
        const list = this._list;
        const { container } = this._state;
        if (!container.plugin) {
            editor.settings = null;
            list.selection = '';
            this._setLayout();
            return;
        }
        if (editor.settings && editor.settings.id === container.plugin) {
            this._setLayout();
            return;
        }
        const instructions = this._instructions;
        this.registry
            .load(container.plugin)
            .then(settings => {
            if (instructions.isAttached) {
                instructions.parent = null;
            }
            if (!editor.isAttached) {
                this.addWidget(editor);
            }
            editor.settings = settings;
            list.selection = container.plugin;
            this._setLayout();
        })
            .catch(reason => {
            console.error(`Loading ${container.plugin} settings failed.`, reason);
            list.selection = this._state.container.plugin = '';
            editor.settings = null;
            this._setLayout();
        });
    }
}
/**
 * A namespace for private module data.
 */
var jsonsettingeditor_Private;
(function (Private) {
    /**
     * Return a normalized restored layout state that defaults to the presets.
     */
    function normalizeState(saved, current) {
        if (!saved) {
            return dist_index_js_.JSONExt.deepCopy(DEFAULT_LAYOUT);
        }
        if (!('sizes' in saved) || !numberArray(saved.sizes)) {
            saved.sizes = dist_index_js_.JSONExt.deepCopy(DEFAULT_LAYOUT.sizes);
        }
        if (!('container' in saved)) {
            saved.container = dist_index_js_.JSONExt.deepCopy(DEFAULT_LAYOUT.container);
            return saved;
        }
        const container = 'container' in saved &&
            saved.container &&
            typeof saved.container === 'object'
            ? saved.container
            : {};
        saved.container = {
            plugin: typeof container.plugin === 'string'
                ? container.plugin
                : DEFAULT_LAYOUT.container.plugin,
            sizes: numberArray(container.sizes)
                ? container.sizes
                : dist_index_js_.JSONExt.deepCopy(DEFAULT_LAYOUT.container.sizes)
        };
        return saved;
    }
    Private.normalizeState = normalizeState;
    /**
     * Tests whether an array consists exclusively of numbers.
     */
    function numberArray(value) {
        return Array.isArray(value) && value.every(x => typeof x === 'number');
    }
})(jsonsettingeditor_Private || (jsonsettingeditor_Private = {}));
//# sourceMappingURL=jsonsettingeditor.js.map
// EXTERNAL MODULE: ../node_modules/@jupyterlab/settingeditor/lib/tokens.js
var tokens = __webpack_require__(24758);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingeditor/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module settingeditor
 */



//# sourceMappingURL=index.js.map

/***/ }),

/***/ 24758:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   O: () => (/* binding */ ISettingEditorTracker),
/* harmony export */   g: () => (/* binding */ IJSONSettingEditorTracker)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The setting editor tracker token.
 */
const ISettingEditorTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/settingeditor:ISettingEditorTracker', `A widget tracker for the interactive setting editor.
  Use this if you want to be able to iterate over and interact with setting editors
  created by the application.`);
/**
 * The setting editor tracker token.
 */
const IJSONSettingEditorTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/settingeditor:IJSONSettingEditorTracker', `A widget tracker for the JSON setting editor.
  Use this if you want to be able to iterate over and interact with setting editors
  created by the application.`);
//# sourceMappingURL=tokens.js.map

/***/ }),

/***/ 5649:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  BaseSettings: () => (/* reexport */ BaseSettings),
  DefaultSchemaValidator: () => (/* reexport */ DefaultSchemaValidator),
  ISettingConnector: () => (/* reexport */ ISettingConnector),
  ISettingRegistry: () => (/* reexport */ ISettingRegistry),
  SettingRegistry: () => (/* reexport */ SettingRegistry),
  Settings: () => (/* reexport */ Settings)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/commands@~2.3.3 (singleton) (fallback: ../node_modules/@lumino/commands/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(88532);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var signaling_dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/settingregistry/node_modules/ajv/dist/ajv.js
var ajv = __webpack_require__(47101);
var ajv_default = /*#__PURE__*/__webpack_require__.n(ajv);
// EXTERNAL MODULE: ../node_modules/json5/dist/index.js
var dist = __webpack_require__(70600);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingregistry/lib/plugin-schema.json
const plugin_schema_namespaceObject = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","title":"JupyterLab Plugin Settings/Preferences Schema","description":"JupyterLab plugin settings/preferences schema","version":"1.0.0","type":"object","additionalProperties":true,"properties":{"jupyter.lab.internationalization":{"type":"object","properties":{"selectors":{"type":"array","items":{"type":"string","minLength":1}},"domain":{"type":"string","minLength":1}}},"jupyter.lab.menus":{"type":"object","properties":{"main":{"title":"Main menu entries","description":"List of menu items to add to the main menubar.","items":{"$ref":"#/definitions/menu"},"type":"array","default":[]},"context":{"title":"The application context menu.","description":"List of context menu items.","items":{"allOf":[{"$ref":"#/definitions/menuItem"},{"properties":{"selector":{"description":"The CSS selector for the context menu item.","type":"string"}}}]},"type":"array","default":[]}},"additionalProperties":false},"jupyter.lab.metadataforms":{"items":{"$ref":"#/definitions/metadataForm"},"type":"array","default":[]},"jupyter.lab.setting-deprecated":{"type":"boolean","default":false},"jupyter.lab.setting-icon":{"type":"string","default":""},"jupyter.lab.setting-icon-class":{"type":"string","default":""},"jupyter.lab.setting-icon-label":{"type":"string","default":"Plugin"},"jupyter.lab.shortcuts":{"items":{"$ref":"#/definitions/shortcut"},"type":"array","default":[]},"jupyter.lab.toolbars":{"properties":{"^\\\\w[\\\\w-\\\\.]*$":{"items":{"$ref":"#/definitions/toolbarItem"},"type":"array","default":[]}},"type":"object","default":{}},"jupyter.lab.transform":{"type":"boolean","default":false}},"definitions":{"menu":{"properties":{"disabled":{"description":"Whether the menu is disabled or not","type":"boolean","default":false},"icon":{"description":"Menu icon id","type":"string"},"id":{"description":"Menu unique id","oneOf":[{"type":"string","enum":["jp-menu-file","jp-menu-file-new","jp-menu-edit","jp-menu-help","jp-menu-kernel","jp-menu-run","jp-menu-settings","jp-menu-view","jp-menu-tabs"]},{"type":"string","pattern":"[a-z][a-z0-9\\\\-_]+"}]},"items":{"description":"Menu items","type":"array","items":{"$ref":"#/definitions/menuItem"}},"label":{"description":"Menu label","type":"string"},"mnemonic":{"description":"Mnemonic index for the label","type":"number","minimum":-1,"default":-1},"rank":{"description":"Menu rank","type":"number","minimum":0}},"required":["id"],"type":"object"},"menuItem":{"properties":{"args":{"description":"Command arguments","type":"object"},"command":{"description":"Command id","type":"string"},"disabled":{"description":"Whether the item is disabled or not","type":"boolean","default":false},"type":{"description":"Item type","type":"string","enum":["command","submenu","separator"],"default":"command"},"rank":{"description":"Item rank","type":"number","minimum":0},"submenu":{"oneOf":[{"$ref":"#/definitions/menu"},{"type":"null"}]}},"type":"object"},"shortcut":{"properties":{"args":{"title":"The arguments for the command","type":"object"},"command":{"title":"The command id","description":"The command executed when the binding is matched.","type":"string"},"disabled":{"description":"Whether this shortcut is disabled or not.","type":"boolean","default":false},"keys":{"title":"The key sequence for the binding","description":"The key shortcut like `Accel A` or the sequence of shortcuts to press like [`Accel A`, `B`]","items":{"type":"string"},"type":"array"},"macKeys":{"title":"The key sequence for the binding on macOS","description":"The key shortcut like `Cmd A` or the sequence of shortcuts to press like [`Cmd A`, `B`]","items":{"type":"string"},"type":"array"},"winKeys":{"title":"The key sequence for the binding on Windows","description":"The key shortcut like `Ctrl A` or the sequence of shortcuts to press like [`Ctrl A`, `B`]","items":{"type":"string"},"type":"array"},"linuxKeys":{"title":"The key sequence for the binding on Linux","description":"The key shortcut like `Ctrl A` or the sequence of shortcuts to press like [`Ctrl A`, `B`]","items":{"type":"string"},"type":"array"},"selector":{"title":"CSS selector","type":"string"}},"required":["command","keys","selector"],"type":"object"},"toolbarItem":{"properties":{"name":{"title":"Unique name","type":"string"},"args":{"title":"Command arguments","type":"object"},"command":{"title":"Command id","type":"string","default":""},"disabled":{"title":"Whether the item is ignored or not","type":"boolean","default":false},"icon":{"title":"Item icon id","description":"If defined, it will override the command icon","type":"string"},"label":{"title":"Item label","description":"If defined, it will override the command label","type":"string"},"caption":{"title":"Item caption","description":"If defined, it will override the command caption","type":"string"},"type":{"title":"Item type","type":"string","enum":["command","spacer"]},"rank":{"title":"Item rank","type":"number","minimum":0,"default":50}},"required":["name"],"additionalProperties":false,"type":"object"},"metadataForm":{"type":"object","properties":{"id":{"type":"string","description":"The section ID"},"metadataSchema":{"type":"object","items":{"$ref":"#/definitions/metadataSchema"}},"uiSchema":{"type":"object"},"metadataOptions":{"type":"object","items":{"$ref":"#/definitions/metadataOptions"}},"label":{"type":"string","description":"The section label"},"rank":{"type":"integer","description":"The rank of the section in the right panel"},"showModified":{"type":"boolean","description":"Whether to show modified values from defaults"}},"required":["id","metadataSchema"]},"metadataSchema":{"properties":{"properties":{"type":"object","description":"The property set up by extension","properties":{"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string"}}}},"type":"object","required":["properties"]},"metadataOptions":{"properties":{"customRenderer":{"type":"string"},"metadataLevel":{"type":"string","enum":["cell","notebook"],"default":"cell"},"cellTypes":{"type":"array","items":{"type":"string","enum":["code","markdown","raw"]}},"writeDefault":{"type":"boolean"}},"type":"object"}}}');
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingregistry/lib/settingregistry.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.







/**
 * An alias for the JSON deep copy function.
 */
const copy = index_js_.JSONExt.deepCopy;
/** Default arguments for Ajv instances.
 *
 * https://ajv.js.org/options.html
 */
const AJV_DEFAULT_OPTIONS = {
    /**
     * @todo the implications of enabling strict mode are beyond the scope of
     *       the initial PR
     */
    strict: false
};
/**
 * The ASCII record separator character.
 */
const RECORD_SEPARATOR = String.fromCharCode(30);
/**
 * The default implementation of a schema validator.
 */
class DefaultSchemaValidator {
    /**
     * Instantiate a schema validator.
     */
    constructor() {
        this._composer = new (ajv_default())({
            useDefaults: true,
            ...AJV_DEFAULT_OPTIONS
        });
        this._validator = new (ajv_default())({ ...AJV_DEFAULT_OPTIONS });
        this._composer.addSchema(plugin_schema_namespaceObject, 'jupyterlab-plugin-schema');
        this._validator.addSchema(plugin_schema_namespaceObject, 'jupyterlab-plugin-schema');
    }
    /**
     * Validate a plugin's schema and user data; populate the `composite` data.
     *
     * @param plugin - The plugin being validated. Its `composite` data will be
     * populated by reference.
     *
     * @param populate - Whether plugin data should be populated, defaults to
     * `true`.
     *
     * @returns A list of errors if either the schema or data fail to validate or
     * `null` if there are no errors.
     */
    validateData(plugin, populate = true) {
        const validate = this._validator.getSchema(plugin.id);
        const compose = this._composer.getSchema(plugin.id);
        // If the schemas do not exist, add them to the validator and continue.
        if (!validate || !compose) {
            if (plugin.schema.type !== 'object') {
                const keyword = 'schema';
                const message = `Setting registry schemas' root-level type must be ` +
                    `'object', rejecting type: ${plugin.schema.type}`;
                return [{ instancePath: 'type', keyword, schemaPath: '', message }];
            }
            const errors = this._addSchema(plugin.id, plugin.schema);
            return errors || this.validateData(plugin);
        }
        // Parse the raw commented JSON into a user map.
        let user;
        try {
            user = dist.parse(plugin.raw);
        }
        catch (error) {
            if (error instanceof SyntaxError) {
                return [
                    {
                        instancePath: '',
                        keyword: 'syntax',
                        schemaPath: '',
                        message: error.message
                    }
                ];
            }
            const { column, description } = error;
            const line = error.lineNumber;
            return [
                {
                    instancePath: '',
                    keyword: 'parse',
                    schemaPath: '',
                    message: `${description} (line ${line} column ${column})`
                }
            ];
        }
        if (!validate(user)) {
            return validate.errors;
        }
        // Copy the user data before merging defaults into composite map.
        const composite = copy(user);
        if (!compose(composite)) {
            return compose.errors;
        }
        if (populate) {
            plugin.data = { composite, user };
        }
        return null;
    }
    /**
     * Add a schema to the validator.
     *
     * @param plugin - The plugin ID.
     *
     * @param schema - The schema being added.
     *
     * @returns A list of errors if the schema fails to validate or `null` if there
     * are no errors.
     *
     * #### Notes
     * It is safe to call this function multiple times with the same plugin name.
     */
    _addSchema(plugin, schema) {
        const composer = this._composer;
        const validator = this._validator;
        const validate = validator.getSchema('jupyterlab-plugin-schema');
        // Validate against the main schema.
        if (!validate(schema)) {
            return validate.errors;
        }
        // Validate against the JSON schema meta-schema.
        if (!validator.validateSchema(schema)) {
            return validator.errors;
        }
        // Remove if schema already exists.
        composer.removeSchema(plugin);
        validator.removeSchema(plugin);
        // Add schema to the validator and composer.
        composer.addSchema(schema, plugin);
        validator.addSchema(schema, plugin);
        return null;
    }
}
/**
 * The default concrete implementation of a setting registry.
 */
class SettingRegistry {
    /**
     * Create a new setting registry.
     */
    constructor(options) {
        /**
         * The schema of the setting registry.
         */
        this.schema = plugin_schema_namespaceObject;
        /**
         * The collection of setting registry plugins.
         */
        this.plugins = Object.create(null);
        this._pluginChanged = new signaling_dist_index_es6_js_.Signal(this);
        this._ready = Promise.resolve();
        this._transformers = Object.create(null);
        this._unloadedPlugins = new Map();
        this.connector = options.connector;
        this.validator = options.validator || new DefaultSchemaValidator();
        // Plugins with transformation may not be loaded if the transformation function is
        // not yet available. To avoid fetching again the associated data when the transformation
        // function is available, the plugin data is kept in cache.
        if (options.plugins) {
            options.plugins
                .filter(plugin => plugin.schema['jupyter.lab.transform'])
                .forEach(plugin => this._unloadedPlugins.set(plugin.id, plugin));
            // Preload with any available data at instantiation-time.
            this._ready = this._preload(options.plugins);
        }
    }
    /**
     * A signal that emits the name of a plugin when its settings change.
     */
    get pluginChanged() {
        return this._pluginChanged;
    }
    /**
     * Get an individual setting.
     *
     * @param plugin - The name of the plugin whose settings are being retrieved.
     *
     * @param key - The name of the setting being retrieved.
     *
     * @returns A promise that resolves when the setting is retrieved.
     */
    async get(plugin, key) {
        // Wait for data preload before allowing normal operation.
        await this._ready;
        const plugins = this.plugins;
        if (plugin in plugins) {
            const { composite, user } = plugins[plugin].data;
            return {
                composite: composite[key] !== undefined ? copy(composite[key]) : undefined,
                user: user[key] !== undefined ? copy(user[key]) : undefined
            };
        }
        return this.load(plugin).then(() => this.get(plugin, key));
    }
    /**
     * Load a plugin's settings into the setting registry.
     *
     * @param plugin - The name of the plugin whose settings are being loaded.
     *
     * @param forceTransform - An optional parameter to force replay the transforms methods.
     *
     * @returns A promise that resolves with a plugin settings object or rejects
     * if the plugin is not found.
     */
    async load(plugin, forceTransform = false) {
        // Wait for data preload before allowing normal operation.
        await this._ready;
        const plugins = this.plugins;
        const registry = this; // eslint-disable-line
        // If the plugin exists, resolve.
        if (plugin in plugins) {
            // Force replaying the transform function if expected.
            if (forceTransform) {
                // Empty the composite and user data before replaying the transforms.
                plugins[plugin].data = { composite: {}, user: {} };
                await this._load(await this._transform('fetch', plugins[plugin]));
                this._pluginChanged.emit(plugin);
            }
            return new Settings({ plugin: plugins[plugin], registry });
        }
        // If the plugin is not loaded but has already been fetched.
        if (this._unloadedPlugins.has(plugin) && plugin in this._transformers) {
            await this._load(await this._transform('fetch', this._unloadedPlugins.get(plugin)));
            if (plugin in plugins) {
                this._pluginChanged.emit(plugin);
                this._unloadedPlugins.delete(plugin);
                return new Settings({ plugin: plugins[plugin], registry });
            }
        }
        // If the plugin needs to be loaded from the data connector, fetch.
        return this.reload(plugin);
    }
    /**
     * Reload a plugin's settings into the registry even if they already exist.
     *
     * @param plugin - The name of the plugin whose settings are being reloaded.
     *
     * @returns A promise that resolves with a plugin settings object or rejects
     * with a list of `ISchemaValidator.IError` objects if it fails.
     */
    async reload(plugin) {
        // Wait for data preload before allowing normal operation.
        await this._ready;
        const fetched = await this.connector.fetch(plugin);
        const plugins = this.plugins; // eslint-disable-line
        const registry = this; // eslint-disable-line
        if (fetched === undefined) {
            throw [
                {
                    instancePath: '',
                    keyword: 'id',
                    message: `Could not fetch settings for ${plugin}.`,
                    schemaPath: ''
                }
            ];
        }
        await this._load(await this._transform('fetch', fetched));
        this._pluginChanged.emit(plugin);
        return new Settings({ plugin: plugins[plugin], registry });
    }
    /**
     * Remove a single setting in the registry.
     *
     * @param plugin - The name of the plugin whose setting is being removed.
     *
     * @param key - The name of the setting being removed.
     *
     * @returns A promise that resolves when the setting is removed.
     */
    async remove(plugin, key) {
        // Wait for data preload before allowing normal operation.
        await this._ready;
        const plugins = this.plugins;
        if (!(plugin in plugins)) {
            return;
        }
        const raw = dist.parse(plugins[plugin].raw);
        // Delete both the value and any associated comment.
        delete raw[key];
        delete raw[`// ${key}`];
        plugins[plugin].raw = Private.annotatedPlugin(plugins[plugin], raw);
        return this._save(plugin);
    }
    /**
     * Set a single setting in the registry.
     *
     * @param plugin - The name of the plugin whose setting is being set.
     *
     * @param key - The name of the setting being set.
     *
     * @param value - The value of the setting being set.
     *
     * @returns A promise that resolves when the setting has been saved.
     *
     */
    async set(plugin, key, value) {
        // Wait for data preload before allowing normal operation.
        await this._ready;
        const plugins = this.plugins;
        if (!(plugin in plugins)) {
            return this.load(plugin).then(() => this.set(plugin, key, value));
        }
        // Parse the raw JSON string removing all comments and return an object.
        const raw = dist.parse(plugins[plugin].raw);
        plugins[plugin].raw = Private.annotatedPlugin(plugins[plugin], {
            ...raw,
            [key]: value
        });
        return this._save(plugin);
    }
    /**
     * Register a plugin transform function to act on a specific plugin.
     *
     * @param plugin - The name of the plugin whose settings are transformed.
     *
     * @param transforms - The transform functions applied to the plugin.
     *
     * @returns A disposable that removes the transforms from the registry.
     *
     * #### Notes
     * - `compose` transformations: The registry automatically overwrites a
     * plugin's default values with user overrides, but a plugin may instead wish
     * to merge values. This behavior can be accomplished in a `compose`
     * transformation.
     * - `fetch` transformations: The registry uses the plugin data that is
     * fetched from its connector. If a plugin wants to override, e.g. to update
     * its schema with dynamic defaults, a `fetch` transformation can be applied.
     */
    transform(plugin, transforms) {
        const transformers = this._transformers;
        if (plugin in transformers) {
            const error = new Error(`${plugin} already has a transformer.`);
            error.name = 'TransformError';
            throw error;
        }
        transformers[plugin] = {
            fetch: transforms.fetch || (plugin => plugin),
            compose: transforms.compose || (plugin => plugin)
        };
        return new dist_index_es6_js_.DisposableDelegate(() => {
            delete transformers[plugin];
        });
    }
    /**
     * Upload a plugin's settings.
     *
     * @param plugin - The name of the plugin whose settings are being set.
     *
     * @param raw - The raw plugin settings being uploaded.
     *
     * @returns A promise that resolves when the settings have been saved.
     */
    async upload(plugin, raw) {
        // Wait for data preload before allowing normal operation.
        await this._ready;
        const plugins = this.plugins;
        if (!(plugin in plugins)) {
            return this.load(plugin).then(() => this.upload(plugin, raw));
        }
        // Set the local copy.
        plugins[plugin].raw = raw;
        return this._save(plugin);
    }
    /**
     * A promise which resolves when the pre-fetched plugins passed to the registry finished pre-loading.
     */
    get ready() {
        return this._ready;
    }
    /**
     * Load a plugin into the registry.
     */
    async _load(data) {
        const plugin = data.id;
        // Validate and preload the item.
        try {
            await this._validate(data);
        }
        catch (errors) {
            const output = [`Validating ${plugin} failed:`];
            errors.forEach((error, index) => {
                const { instancePath, schemaPath, keyword, message } = error;
                if (instancePath || schemaPath) {
                    output.push(`${index} - schema @ ${schemaPath}, data @ ${instancePath}`);
                }
                output.push(`{${keyword}} ${message}`);
            });
            console.warn(output.join('\n'));
            throw errors;
        }
    }
    /**
     * Preload a list of plugins and fail gracefully.
     */
    async _preload(plugins) {
        await Promise.all(plugins.map(async (plugin) => {
            var _a;
            try {
                // Apply a transformation to the plugin if necessary.
                await this._load(await this._transform('fetch', plugin));
            }
            catch (errors) {
                /* Ignore silently if no transformers. */
                if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.keyword) !== 'unset') {
                    console.warn('Ignored setting registry preload errors.', errors);
                }
            }
        }));
    }
    /**
     * Save a plugin in the registry.
     */
    async _save(plugin) {
        const plugins = this.plugins;
        if (!(plugin in plugins)) {
            throw new Error(`${plugin} does not exist in setting registry.`);
        }
        try {
            await this._validate(plugins[plugin]);
        }
        catch (errors) {
            console.warn(`${plugin} validation errors:`, errors);
            throw new Error(`${plugin} failed to validate; check console.`);
        }
        await this.connector.save(plugin, plugins[plugin].raw);
        // Fetch and reload the data to guarantee server and client are in sync.
        const fetched = await this.connector.fetch(plugin);
        if (fetched === undefined) {
            throw [
                {
                    instancePath: '',
                    keyword: 'id',
                    message: `Could not fetch settings for ${plugin}.`,
                    schemaPath: ''
                }
            ];
        }
        await this._load(await this._transform('fetch', fetched));
        this._pluginChanged.emit(plugin);
    }
    /**
     * Transform the plugin if necessary.
     */
    async _transform(phase, plugin) {
        const id = plugin.id;
        const transformers = this._transformers;
        if (!plugin.schema['jupyter.lab.transform']) {
            return plugin;
        }
        if (id in transformers) {
            const transformed = transformers[id][phase].call(null, plugin);
            if (transformed.id !== id) {
                throw [
                    {
                        instancePath: '',
                        keyword: 'id',
                        message: 'Plugin transformations cannot change plugin IDs.',
                        schemaPath: ''
                    }
                ];
            }
            return transformed;
        }
        // If the plugin has no transformers, throw an error and bail.
        throw [
            {
                instancePath: '',
                keyword: 'unset',
                message: `${plugin.id} has no transformers yet.`,
                schemaPath: ''
            }
        ];
    }
    /**
     * Validate and preload a plugin, compose the `composite` data.
     */
    async _validate(plugin) {
        // Validate the user data and create the composite data.
        const errors = this.validator.validateData(plugin);
        if (errors) {
            throw errors;
        }
        // Apply a transformation if necessary and set the local copy.
        this.plugins[plugin.id] = await this._transform('compose', plugin);
    }
}
/**
 * Base settings specified by a JSON schema.
 */
class BaseSettings {
    constructor(options) {
        this._schema = options.schema;
    }
    /**
     * The plugin's schema.
     */
    get schema() {
        return this._schema;
    }
    /**
     * Checks if any fields are different from the default value.
     */
    isDefault(user) {
        for (const key in this.schema.properties) {
            const value = user[key];
            const defaultValue = this.default(key);
            if (value === undefined ||
                defaultValue === undefined ||
                index_js_.JSONExt.deepEqual(value, index_js_.JSONExt.emptyObject) ||
                index_js_.JSONExt.deepEqual(value, index_js_.JSONExt.emptyArray)) {
                continue;
            }
            if (!index_js_.JSONExt.deepEqual(value, defaultValue)) {
                return false;
            }
        }
        return true;
    }
    /**
     * Calculate the default value of a setting by iterating through the schema.
     *
     * @param key - The name of the setting whose default value is calculated.
     *
     * @returns A calculated default JSON value for a specific setting.
     */
    default(key) {
        return Private.reifyDefault(this.schema, key);
    }
}
/**
 * A manager for a specific plugin's settings.
 */
class Settings extends BaseSettings {
    /**
     * Instantiate a new plugin settings manager.
     */
    constructor(options) {
        super({ schema: options.plugin.schema });
        this._changed = new signaling_dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this.id = options.plugin.id;
        this.registry = options.registry;
        this.registry.pluginChanged.connect(this._onPluginChanged, this);
    }
    /**
     * A signal that emits when the plugin's settings have changed.
     */
    get changed() {
        return this._changed;
    }
    /**
     * The composite of user settings and extension defaults.
     */
    get composite() {
        return this.plugin.data.composite;
    }
    /**
     * Test whether the plugin settings manager disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    get plugin() {
        return this.registry.plugins[this.id];
    }
    /**
     * The plugin settings raw text value.
     */
    get raw() {
        return this.plugin.raw;
    }
    /**
     * Whether the settings have been modified by the user or not.
     */
    get isModified() {
        return !this.isDefault(this.user);
    }
    /**
     * The user settings.
     */
    get user() {
        return this.plugin.data.user;
    }
    /**
     * The published version of the NPM package containing these settings.
     */
    get version() {
        return this.plugin.version;
    }
    /**
     * Return the defaults in a commented JSON format.
     */
    annotatedDefaults() {
        return Private.annotatedDefaults(this.schema, this.id);
    }
    /**
     * Dispose of the plugin settings resources.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        signaling_dist_index_es6_js_.Signal.clearData(this);
    }
    /**
     * Get an individual setting.
     *
     * @param key - The name of the setting being retrieved.
     *
     * @returns The setting value.
     *
     * #### Notes
     * This method returns synchronously because it uses a cached copy of the
     * plugin settings that is synchronized with the registry.
     */
    get(key) {
        const { composite, user } = this;
        return {
            composite: composite[key] !== undefined ? copy(composite[key]) : undefined,
            user: user[key] !== undefined ? copy(user[key]) : undefined
        };
    }
    /**
     * Remove a single setting.
     *
     * @param key - The name of the setting being removed.
     *
     * @returns A promise that resolves when the setting is removed.
     *
     * #### Notes
     * This function is asynchronous because it writes to the setting registry.
     */
    remove(key) {
        return this.registry.remove(this.plugin.id, key);
    }
    /**
     * Save all of the plugin's user settings at once.
     */
    save(raw) {
        return this.registry.upload(this.plugin.id, raw);
    }
    /**
     * Set a single setting.
     *
     * @param key - The name of the setting being set.
     *
     * @param value - The value of the setting.
     *
     * @returns A promise that resolves when the setting has been saved.
     *
     * #### Notes
     * This function is asynchronous because it writes to the setting registry.
     */
    set(key, value) {
        return this.registry.set(this.plugin.id, key, value);
    }
    /**
     * Validates raw settings with comments.
     *
     * @param raw - The JSON with comments string being validated.
     *
     * @returns A list of errors or `null` if valid.
     */
    validate(raw) {
        const data = { composite: {}, user: {} };
        const { id, schema } = this.plugin;
        const validator = this.registry.validator;
        const version = this.version;
        return validator.validateData({ data, id, raw, schema, version }, false);
    }
    /**
     * Handle plugin changes in the setting registry.
     */
    _onPluginChanged(sender, plugin) {
        if (plugin === this.plugin.id) {
            this._changed.emit(undefined);
        }
    }
}
/**
 * A namespace for `SettingRegistry` statics.
 */
(function (SettingRegistry) {
    /**
     * Reconcile the menus.
     *
     * @param reference The reference list of menus.
     * @param addition The list of menus to add.
     * @param warn Warn if the command items are duplicated within the same menu.
     * @returns The reconciled list of menus.
     */
    function reconcileMenus(reference, addition, warn = false, addNewItems = true) {
        if (!reference) {
            return addition && addNewItems ? index_js_.JSONExt.deepCopy(addition) : [];
        }
        if (!addition) {
            return index_js_.JSONExt.deepCopy(reference);
        }
        const merged = index_js_.JSONExt.deepCopy(reference);
        addition.forEach(menu => {
            const refIndex = merged.findIndex(ref => ref.id === menu.id);
            if (refIndex >= 0) {
                merged[refIndex] = {
                    ...merged[refIndex],
                    ...menu,
                    items: reconcileItems(merged[refIndex].items, menu.items, warn, addNewItems)
                };
            }
            else {
                if (addNewItems) {
                    merged.push(menu);
                }
            }
        });
        return merged;
    }
    SettingRegistry.reconcileMenus = reconcileMenus;
    /**
     * Merge two set of menu items.
     *
     * @param reference Reference set of menu items
     * @param addition New items to add
     * @param warn Whether to warn if item is duplicated; default to false
     * @returns The merged set of items
     */
    function reconcileItems(reference, addition, warn = false, addNewItems = true) {
        if (!reference) {
            return addition ? index_js_.JSONExt.deepCopy(addition) : undefined;
        }
        if (!addition) {
            return index_js_.JSONExt.deepCopy(reference);
        }
        const items = index_js_.JSONExt.deepCopy(reference);
        // Merge array element depending on the type
        addition.forEach(item => {
            var _a;
            switch ((_a = item.type) !== null && _a !== void 0 ? _a : 'command') {
                case 'separator':
                    if (addNewItems) {
                        items.push({ ...item });
                    }
                    break;
                case 'submenu':
                    if (item.submenu) {
                        const refIndex = items.findIndex(ref => { var _a, _b; return ref.type === 'submenu' && ((_a = ref.submenu) === null || _a === void 0 ? void 0 : _a.id) === ((_b = item.submenu) === null || _b === void 0 ? void 0 : _b.id); });
                        if (refIndex < 0) {
                            if (addNewItems) {
                                items.push(index_js_.JSONExt.deepCopy(item));
                            }
                        }
                        else {
                            items[refIndex] = {
                                ...items[refIndex],
                                ...item,
                                submenu: reconcileMenus(items[refIndex].submenu
                                    ? [items[refIndex].submenu]
                                    : null, [item.submenu], warn, addNewItems)[0]
                            };
                        }
                    }
                    break;
                case 'command':
                    if (item.command) {
                        const refIndex = items.findIndex(ref => {
                            var _a, _b;
                            return ref.command === item.command &&
                                ref.selector === item.selector &&
                                index_js_.JSONExt.deepEqual((_a = ref.args) !== null && _a !== void 0 ? _a : {}, (_b = item.args) !== null && _b !== void 0 ? _b : {});
                        });
                        if (refIndex < 0) {
                            if (addNewItems) {
                                items.push({ ...item });
                            }
                        }
                        else {
                            if (warn) {
                                console.warn(`Menu entry for command '${item.command}' is duplicated.`);
                            }
                            items[refIndex] = { ...items[refIndex], ...item };
                        }
                    }
            }
        });
        return items;
    }
    SettingRegistry.reconcileItems = reconcileItems;
    /**
     * Remove disabled entries from menu items
     *
     * @param items Menu items
     * @returns Filtered menu items
     */
    function filterDisabledItems(items) {
        return items.reduce((final, value) => {
            var _a;
            const copy = { ...value };
            if (!copy.disabled) {
                if (copy.type === 'submenu') {
                    const { submenu } = copy;
                    if (submenu && !submenu.disabled) {
                        copy.submenu = {
                            ...submenu,
                            items: filterDisabledItems((_a = submenu.items) !== null && _a !== void 0 ? _a : [])
                        };
                    }
                }
                final.push(copy);
            }
            return final;
        }, []);
    }
    SettingRegistry.filterDisabledItems = filterDisabledItems;
    /**
     * Reconcile default and user shortcuts and return the composite list.
     *
     * @param defaults - The list of default shortcuts.
     *
     * @param user - The list of user shortcut overrides and additions.
     *
     * @returns A loadable list of shortcuts (omitting disabled and overridden).
     */
    function reconcileShortcuts(defaults, user) {
        const memo = {};
        // If a user shortcut collides with another user shortcut warn and filter.
        user = [
            // Reorder so that disabled are first
            ...user.filter(s => !!s.disabled),
            ...user.filter(s => !s.disabled)
        ].filter(shortcut => {
            const keys = index_es6_js_.CommandRegistry.normalizeKeys(shortcut).join(RECORD_SEPARATOR);
            if (!keys) {
                console.warn('Skipping this shortcut because there are no actionable keys on this platform', shortcut);
                return false;
            }
            if (!(keys in memo)) {
                memo[keys] = {};
            }
            const { disabled, selector } = shortcut;
            if (!(selector in memo[keys])) {
                memo[keys][selector] = {
                    enabledUserShortcut: disabled ? null : shortcut,
                    enabledDefaultShortcut: null,
                    shouldDisableDefaultShortcut: !!disabled
                };
                return !disabled;
            }
            if (memo[keys][selector].enabledUserShortcut === null) {
                if (disabled) {
                    memo[keys][selector].shouldDisableDefaultShortcut = true;
                    return false;
                }
                else {
                    memo[keys][selector].enabledUserShortcut = shortcut;
                    return true;
                }
            }
            else {
                console.warn('Skipping', shortcut, 'shortcut because it collides with another enabled shortcut:', memo[keys][selector].enabledUserShortcut);
                return false;
            }
        });
        // If a default shortcut collides with another default, warn and filter,
        // unless one of the shortcuts is a disabling shortcut (so look through
        // disabled shortcuts first). If a shortcut has already been added by the
        // user preferences, filter it out too (this includes shortcuts that are
        // disabled by user preferences).
        defaults = [
            ...defaults.filter(s => !!s.disabled),
            ...defaults.filter(s => !s.disabled)
        ].filter(shortcut => {
            const keys = index_es6_js_.CommandRegistry.normalizeKeys(shortcut).join(RECORD_SEPARATOR);
            if (!keys) {
                return false;
            }
            if (!(keys in memo)) {
                memo[keys] = {};
            }
            const { disabled, selector } = shortcut;
            if (!(selector in memo[keys])) {
                memo[keys][selector] = {
                    enabledUserShortcut: null, // we would have seen it already as we processed user shortcuts earlier
                    enabledDefaultShortcut: disabled ? null : shortcut,
                    shouldDisableDefaultShortcut: !!disabled
                };
                return !disabled;
            }
            if (memo[keys][selector].enabledDefaultShortcut === null) {
                if (disabled) {
                    memo[keys][selector].shouldDisableDefaultShortcut = true;
                    return false;
                }
                else {
                    if (memo[keys][selector].shouldDisableDefaultShortcut) {
                        // Default shortcut was disabled - no warning
                        return false;
                    }
                    else {
                        memo[keys][selector].enabledDefaultShortcut = shortcut;
                        return true;
                    }
                }
            }
            else {
                if (memo[keys][selector].shouldDisableDefaultShortcut) {
                    // Default shortcut was disabled - no warning
                    return false;
                }
                else {
                    // Default shortcut conflicts - emit warning
                    console.warn('Skipping', shortcut, 'default shortcut because it collides with another enabled default shortcut:', memo[keys][selector].enabledDefaultShortcut);
                    return false;
                }
            }
        });
        // Return all the shortcuts that should be registered
        return Private.upgradeShortcuts(user
            .concat(defaults)
            .filter(shortcut => !shortcut.disabled)
            // Fix shortcuts comparison in rjsf Form to avoid polluting the user settings
            .map(shortcut => {
            return { args: {}, ...shortcut };
        }));
    }
    SettingRegistry.reconcileShortcuts = reconcileShortcuts;
    /**
     * Merge two set of toolbar items.
     *
     * @param reference Reference set of toolbar items
     * @param addition New items to add
     * @param warn Whether to warn if item is duplicated; default to false
     * @returns The merged set of items
     */
    function reconcileToolbarItems(reference, addition, warn = false) {
        if (!reference) {
            return addition ? index_js_.JSONExt.deepCopy(addition) : undefined;
        }
        if (!addition) {
            return index_js_.JSONExt.deepCopy(reference);
        }
        const items = index_js_.JSONExt.deepCopy(reference);
        // Merge array element depending on the type
        addition.forEach(item => {
            // Name must be unique so it's sufficient to only compare it
            const refIndex = items.findIndex(ref => ref.name === item.name);
            if (refIndex < 0) {
                items.push({ ...item });
            }
            else {
                if (warn &&
                    index_js_.JSONExt.deepEqual(Object.keys(item), Object.keys(items[refIndex]))) {
                    console.warn(`Toolbar item '${item.name}' is duplicated.`);
                }
                items[refIndex] = { ...items[refIndex], ...item };
            }
        });
        return items;
    }
    SettingRegistry.reconcileToolbarItems = reconcileToolbarItems;
})(SettingRegistry || (SettingRegistry = {}));
/**
 * A namespace for private module data.
 */
var Private;
(function (Private) {
    /**
     * The default indentation level, uses spaces instead of tabs.
     */
    const indent = '    ';
    /**
     * Replacement text for schema properties missing a `description` field.
     */
    const nondescript = '[missing schema description]';
    /**
     * Replacement text for schema properties missing a `title` field.
     */
    const untitled = '[missing schema title]';
    /**
     * Returns an annotated (JSON with comments) version of a schema's defaults.
     */
    function annotatedDefaults(schema, plugin) {
        const { description, properties, title } = schema;
        const keys = properties
            ? Object.keys(properties).sort((a, b) => a.localeCompare(b))
            : [];
        const length = Math.max((description || nondescript).length, plugin.length);
        return [
            '{',
            prefix(`${title || untitled}`),
            prefix(plugin),
            prefix(description || nondescript),
            prefix('*'.repeat(length)),
            '',
            join(keys.map(key => defaultDocumentedValue(schema, key))),
            '}'
        ].join('\n');
    }
    Private.annotatedDefaults = annotatedDefaults;
    /**
     * Returns an annotated (JSON with comments) version of a plugin's
     * setting data.
     */
    function annotatedPlugin(plugin, data) {
        const { description, title } = plugin.schema;
        const keys = Object.keys(data).sort((a, b) => a.localeCompare(b));
        const length = Math.max((description || nondescript).length, plugin.id.length);
        return [
            '{',
            prefix(`${title || untitled}`),
            prefix(plugin.id),
            prefix(description || nondescript),
            prefix('*'.repeat(length)),
            '',
            join(keys.map(key => documentedValue(plugin.schema, key, data[key]))),
            '}'
        ].join('\n');
    }
    Private.annotatedPlugin = annotatedPlugin;
    /**
     * Returns the default value-with-documentation-string for a
     * specific schema property.
     */
    function defaultDocumentedValue(schema, key) {
        const props = (schema.properties && schema.properties[key]) || {};
        const type = props['type'];
        const description = props['description'] || nondescript;
        const title = props['title'] || '';
        const reified = reifyDefault(schema, key);
        const spaces = indent.length;
        const defaults = reified !== undefined
            ? prefix(`"${key}": ${JSON.stringify(reified, null, spaces)}`, indent)
            : prefix(`"${key}": ${type}`);
        return [prefix(title), prefix(description), defaults]
            .filter(str => str.length)
            .join('\n');
    }
    /**
     * Returns a value-with-documentation-string for a specific schema property.
     */
    function documentedValue(schema, key, value) {
        const props = schema.properties && schema.properties[key];
        const description = (props && props['description']) || nondescript;
        const title = (props && props['title']) || untitled;
        const spaces = indent.length;
        const attribute = prefix(`"${key}": ${JSON.stringify(value, null, spaces)}`, indent);
        return [prefix(title), prefix(description), attribute].join('\n');
    }
    /**
     * Returns a joined string with line breaks and commas where appropriate.
     */
    function join(body) {
        return body.reduce((acc, val, idx) => {
            const rows = val.split('\n');
            const last = rows[rows.length - 1];
            const comment = last.trim().indexOf('//') === 0;
            const comma = comment || idx === body.length - 1 ? '' : ',';
            const separator = idx === body.length - 1 ? '' : '\n\n';
            return acc + val + comma + separator;
        }, '');
    }
    /**
     * Returns a documentation string with a comment prefix added on every line.
     */
    function prefix(source, pre = `${indent}// `) {
        return pre + source.split('\n').join(`\n${pre}`);
    }
    /**
     * Create a fully extrapolated default value for a root key in a schema.
     *
     * @todo This function would ideally reuse `getDefaultFormState` from rjsf
     * with appropriate`defaultFormStateBehavior` setting, as currently
     * these two implementations duplicate each other.
     *
     * Note: absence of a property may mean something else than the default.
     */
    function reifyDefault(schema, root, definitions, required) {
        var _a, _b, _c, _d, _e, _f, _g;
        definitions = definitions !== null && definitions !== void 0 ? definitions : schema.definitions;
        // If the property is at the root level, traverse its schema.
        required = root
            ? schema.required instanceof Array &&
                ((_a = schema.required) === null || _a === void 0 ? void 0 : _a.includes(root))
            : required;
        schema = (root ? (_b = schema.properties) === null || _b === void 0 ? void 0 : _b[root] : schema) || {};
        if (schema.type === 'object') {
            // Make a copy of the default value to populate.
            const result = index_js_.JSONExt.deepCopy(schema.default);
            // Iterate through and populate each child property.
            const props = schema.properties || {};
            for (const property in props) {
                result[property] = reifyDefault(props[property], undefined, definitions, schema.required instanceof Array &&
                    ((_c = schema.required) === null || _c === void 0 ? void 0 : _c.includes(property)));
            }
            return result;
        }
        else if (schema.type === 'array') {
            const defaultDefined = typeof schema.default !== 'undefined';
            const shouldPopulateDefaultArray = defaultDefined || required;
            if (!shouldPopulateDefaultArray) {
                return undefined;
            }
            // Make a copy of the default value to populate.
            const result = defaultDefined
                ? index_js_.JSONExt.deepCopy(schema.default)
                : [];
            // Items defines the properties of each item in the array
            let props = schema.items || {};
            // Use referenced definition if one exists
            if (props['$ref'] && definitions) {
                const ref = props['$ref'].replace('#/definitions/', '');
                props = (_d = definitions[ref]) !== null && _d !== void 0 ? _d : {};
            }
            // Iterate through the items in the array and fill in defaults
            for (const item in result) {
                if (props.type === 'object') {
                    // Use the values that are hard-coded in the default array over the defaults for each field.
                    const reified = (_f = (_e = reifyDefault(props, undefined, definitions)) !== null && _e !== void 0 ? _e : result[item]) !== null && _f !== void 0 ? _f : {};
                    for (const prop in reified) {
                        if ((_g = result[item]) === null || _g === void 0 ? void 0 : _g[prop]) {
                            reified[prop] = result[item][prop];
                        }
                    }
                    result[item] = reified;
                }
            }
            return result;
        }
        else {
            return schema.default;
        }
    }
    Private.reifyDefault = reifyDefault;
    /**
     * Selectors which were previously warned about.
     */
    const selectorsAlreadyWarnedAbout = new Set();
    /**
     * Upgrade shortcuts to ensure no breaking changes between minor versions.
     */
    function upgradeShortcuts(shortcuts) {
        const selectorDeprecationWarnings = new Set();
        const changes = [
            {
                old: '.jp-Notebook:focus.jp-mod-commandMode',
                new: '.jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus',
                versionDeprecated: 'JupyterLab 4.1'
            },
            {
                old: '.jp-Notebook.jp-mod-commandMode :focus:not(:read-write)',
                new: '.jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus',
                versionDeprecated: 'JupyterLab 4.1.1'
            },
            {
                old: '.jp-Notebook:focus',
                new: '.jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus',
                versionDeprecated: 'JupyterLab 4.1'
            },
            {
                old: '[data-jp-traversable]:focus',
                new: '.jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus',
                versionDeprecated: 'JupyterLab 4.1'
            },
            {
                old: '[data-jp-kernel-user]:focus',
                new: '[data-jp-kernel-user]:not(.jp-mod-readWrite) :focus:not(:read-write)',
                versionDeprecated: 'JupyterLab 4.1'
            },
            {
                old: '[data-jp-kernel-user] :focus:not(:read-write)',
                new: '[data-jp-kernel-user]:not(.jp-mod-readWrite) :focus:not(:read-write)',
                versionDeprecated: 'JupyterLab 4.1.1'
            }
        ];
        const upgraded = shortcuts.map(shortcut => {
            const oldSelector = shortcut.selector;
            let newSelector = oldSelector;
            for (const change of changes) {
                if (oldSelector.includes(change.old)) {
                    newSelector = oldSelector.replace(change.old, change.new);
                    if (!selectorsAlreadyWarnedAbout.has(oldSelector)) {
                        selectorDeprecationWarnings.add(`"${change.old}" was replaced with "${change.new}" in ${change.versionDeprecated} (present in "${oldSelector}")`);
                        selectorsAlreadyWarnedAbout.add(oldSelector);
                    }
                }
            }
            shortcut.selector = newSelector;
            return shortcut;
        });
        if (selectorDeprecationWarnings.size > 0) {
            console.warn('Deprecated shortcut selectors: ' +
                [...selectorDeprecationWarnings].join('\n') +
                '\n\nThe selectors will be substituted transparently this time, but need to be updated at source before next major release.');
        }
        return upgraded;
    }
    Private.upgradeShortcuts = upgradeShortcuts;
})(Private || (Private = {}));
//# sourceMappingURL=settingregistry.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingregistry/lib/tokens.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * A service to connect to the settings endpoint.
 */
const ISettingConnector = new index_js_.Token('@jupyterlab/coreutils:ISettingConnector', 'A service to connect to the settings endpoint.');
/**
 * The setting registry token.
 */
const ISettingRegistry = new index_js_.Token('@jupyterlab/coreutils:ISettingRegistry', `A service for the JupyterLab settings system.
  Use this if you want to store settings for your application.
  See "schemaDir" for more information.`);
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/settingregistry/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module settingregistry
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 47101:
/***/ ((module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
const core_1 = __webpack_require__(42089);
const draft7_1 = __webpack_require__(43662);
const discriminator_1 = __webpack_require__(60867);
const draft7MetaSchema = __webpack_require__(61327);
const META_SUPPORT_DATA = ["/properties"];
const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
class Ajv extends core_1.default {
    _addVocabularies() {
        super._addVocabularies();
        draft7_1.default.forEach((v) => this.addVocabulary(v));
        if (this.opts.discriminator)
            this.addKeyword(discriminator_1.default);
    }
    _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        if (!this.opts.meta)
            return;
        const metaSchema = this.opts.$data
            ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)
            : draft7MetaSchema;
        this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
        this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
    }
    defaultMeta() {
        return (this.opts.defaultMeta =
            super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
    }
}
exports.Ajv = Ajv;
module.exports = exports = Ajv;
module.exports.Ajv = Ajv;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports["default"] = Ajv;
var validate_1 = __webpack_require__(58941);
Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } }));
var codegen_1 = __webpack_require__(78380);
Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } }));
Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } }));
Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } }));
Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } }));
Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } }));
Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } }));
var validation_error_1 = __webpack_require__(52582);
Object.defineProperty(exports, "ValidationError", ({ enumerable: true, get: function () { return validation_error_1.default; } }));
var ref_error_1 = __webpack_require__(61326);
Object.defineProperty(exports, "MissingRefError", ({ enumerable: true, get: function () { return ref_error_1.default; } }));
//# sourceMappingURL=ajv.js.map

/***/ }),

/***/ 25875:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
class _CodeOrName {
}
exports._CodeOrName = _CodeOrName;
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
class Name extends _CodeOrName {
    constructor(s) {
        super();
        if (!exports.IDENTIFIER.test(s))
            throw new Error("CodeGen: name must be a valid identifier");
        this.str = s;
    }
    toString() {
        return this.str;
    }
    emptyStr() {
        return false;
    }
    get names() {
        return { [this.str]: 1 };
    }
}
exports.Name = Name;
class _Code extends _CodeOrName {
    constructor(code) {
        super();
        this._items = typeof code === "string" ? [code] : code;
    }
    toString() {
        return this.str;
    }
    emptyStr() {
        if (this._items.length > 1)
            return false;
        const item = this._items[0];
        return item === "" || item === '""';
    }
    get str() {
        var _a;
        return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, "")));
    }
    get names() {
        var _a;
        return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {
            if (c instanceof Name)
                names[c.str] = (names[c.str] || 0) + 1;
            return names;
        }, {})));
    }
}
exports._Code = _Code;
exports.nil = new _Code("");
function _(strs, ...args) {
    const code = [strs[0]];
    let i = 0;
    while (i < args.length) {
        addCodeArg(code, args[i]);
        code.push(strs[++i]);
    }
    return new _Code(code);
}
exports._ = _;
const plus = new _Code("+");
function str(strs, ...args) {
    const expr = [safeStringify(strs[0])];
    let i = 0;
    while (i < args.length) {
        expr.push(plus);
        addCodeArg(expr, args[i]);
        expr.push(plus, safeStringify(strs[++i]));
    }
    optimize(expr);
    return new _Code(expr);
}
exports.str = str;
function addCodeArg(code, arg) {
    if (arg instanceof _Code)
        code.push(...arg._items);
    else if (arg instanceof Name)
        code.push(arg);
    else
        code.push(interpolate(arg));
}
exports.addCodeArg = addCodeArg;
function optimize(expr) {
    let i = 1;
    while (i < expr.length - 1) {
        if (expr[i] === plus) {
            const res = mergeExprItems(expr[i - 1], expr[i + 1]);
            if (res !== undefined) {
                expr.splice(i - 1, 3, res);
                continue;
            }
            expr[i++] = "+";
        }
        i++;
    }
}
function mergeExprItems(a, b) {
    if (b === '""')
        return a;
    if (a === '""')
        return b;
    if (typeof a == "string") {
        if (b instanceof Name || a[a.length - 1] !== '"')
            return;
        if (typeof b != "string")
            return `${a.slice(0, -1)}${b}"`;
        if (b[0] === '"')
            return a.slice(0, -1) + b.slice(1);
        return;
    }
    if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
        return `"${a}${b.slice(1)}`;
    return;
}
function strConcat(c1, c2) {
    return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;
}
exports.strConcat = strConcat;
// TODO do not allow arrays here
function interpolate(x) {
    return typeof x == "number" || typeof x == "boolean" || x === null
        ? x
        : safeStringify(Array.isArray(x) ? x.join(",") : x);
}
function stringify(x) {
    return new _Code(safeStringify(x));
}
exports.stringify = stringify;
function safeStringify(x) {
    return JSON.stringify(x)
        .replace(/\u2028/g, "\\u2028")
        .replace(/\u2029/g, "\\u2029");
}
exports.safeStringify = safeStringify;
function getProperty(key) {
    return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;
}
exports.getProperty = getProperty;
//Does best effort to format the name properly
function getEsmExportName(key) {
    if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
        return new _Code(`${key}`);
    }
    throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
}
exports.getEsmExportName = getEsmExportName;
function regexpCode(rx) {
    return new _Code(rx.toString());
}
exports.regexpCode = regexpCode;
//# sourceMappingURL=code.js.map

/***/ }),

/***/ 78380:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
const code_1 = __webpack_require__(25875);
const scope_1 = __webpack_require__(17686);
var code_2 = __webpack_require__(25875);
Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return code_2._; } }));
Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return code_2.str; } }));
Object.defineProperty(exports, "strConcat", ({ enumerable: true, get: function () { return code_2.strConcat; } }));
Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return code_2.nil; } }));
Object.defineProperty(exports, "getProperty", ({ enumerable: true, get: function () { return code_2.getProperty; } }));
Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return code_2.stringify; } }));
Object.defineProperty(exports, "regexpCode", ({ enumerable: true, get: function () { return code_2.regexpCode; } }));
Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return code_2.Name; } }));
var scope_2 = __webpack_require__(17686);
Object.defineProperty(exports, "Scope", ({ enumerable: true, get: function () { return scope_2.Scope; } }));
Object.defineProperty(exports, "ValueScope", ({ enumerable: true, get: function () { return scope_2.ValueScope; } }));
Object.defineProperty(exports, "ValueScopeName", ({ enumerable: true, get: function () { return scope_2.ValueScopeName; } }));
Object.defineProperty(exports, "varKinds", ({ enumerable: true, get: function () { return scope_2.varKinds; } }));
exports.operators = {
    GT: new code_1._Code(">"),
    GTE: new code_1._Code(">="),
    LT: new code_1._Code("<"),
    LTE: new code_1._Code("<="),
    EQ: new code_1._Code("==="),
    NEQ: new code_1._Code("!=="),
    NOT: new code_1._Code("!"),
    OR: new code_1._Code("||"),
    AND: new code_1._Code("&&"),
    ADD: new code_1._Code("+"),
};
class Node {
    optimizeNodes() {
        return this;
    }
    optimizeNames(_names, _constants) {
        return this;
    }
}
class Def extends Node {
    constructor(varKind, name, rhs) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.rhs = rhs;
    }
    render({ es5, _n }) {
        const varKind = es5 ? scope_1.varKinds.var : this.varKind;
        const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`;
        return `${varKind} ${this.name}${rhs};` + _n;
    }
    optimizeNames(names, constants) {
        if (!names[this.name.str])
            return;
        if (this.rhs)
            this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
    }
    get names() {
        return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
    }
}
class Assign extends Node {
    constructor(lhs, rhs, sideEffects) {
        super();
        this.lhs = lhs;
        this.rhs = rhs;
        this.sideEffects = sideEffects;
    }
    render({ _n }) {
        return `${this.lhs} = ${this.rhs};` + _n;
    }
    optimizeNames(names, constants) {
        if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
            return;
        this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
    }
    get names() {
        const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
        return addExprNames(names, this.rhs);
    }
}
class AssignOp extends Assign {
    constructor(lhs, op, rhs, sideEffects) {
        super(lhs, rhs, sideEffects);
        this.op = op;
    }
    render({ _n }) {
        return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
    }
}
class Label extends Node {
    constructor(label) {
        super();
        this.label = label;
        this.names = {};
    }
    render({ _n }) {
        return `${this.label}:` + _n;
    }
}
class Break extends Node {
    constructor(label) {
        super();
        this.label = label;
        this.names = {};
    }
    render({ _n }) {
        const label = this.label ? ` ${this.label}` : "";
        return `break${label};` + _n;
    }
}
class Throw extends Node {
    constructor(error) {
        super();
        this.error = error;
    }
    render({ _n }) {
        return `throw ${this.error};` + _n;
    }
    get names() {
        return this.error.names;
    }
}
class AnyCode extends Node {
    constructor(code) {
        super();
        this.code = code;
    }
    render({ _n }) {
        return `${this.code};` + _n;
    }
    optimizeNodes() {
        return `${this.code}` ? this : undefined;
    }
    optimizeNames(names, constants) {
        this.code = optimizeExpr(this.code, names, constants);
        return this;
    }
    get names() {
        return this.code instanceof code_1._CodeOrName ? this.code.names : {};
    }
}
class ParentNode extends Node {
    constructor(nodes = []) {
        super();
        this.nodes = nodes;
    }
    render(opts) {
        return this.nodes.reduce((code, n) => code + n.render(opts), "");
    }
    optimizeNodes() {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
            const n = nodes[i].optimizeNodes();
            if (Array.isArray(n))
                nodes.splice(i, 1, ...n);
            else if (n)
                nodes[i] = n;
            else
                nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : undefined;
    }
    optimizeNames(names, constants) {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
            // iterating backwards improves 1-pass optimization
            const n = nodes[i];
            if (n.optimizeNames(names, constants))
                continue;
            subtractNames(names, n.names);
            nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : undefined;
    }
    get names() {
        return this.nodes.reduce((names, n) => addNames(names, n.names), {});
    }
}
class BlockNode extends ParentNode {
    render(opts) {
        return "{" + opts._n + super.render(opts) + "}" + opts._n;
    }
}
class Root extends ParentNode {
}
class Else extends BlockNode {
}
Else.kind = "else";
class If extends BlockNode {
    constructor(condition, nodes) {
        super(nodes);
        this.condition = condition;
    }
    render(opts) {
        let code = `if(${this.condition})` + super.render(opts);
        if (this.else)
            code += "else " + this.else.render(opts);
        return code;
    }
    optimizeNodes() {
        super.optimizeNodes();
        const cond = this.condition;
        if (cond === true)
            return this.nodes; // else is ignored here
        let e = this.else;
        if (e) {
            const ns = e.optimizeNodes();
            e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
        }
        if (e) {
            if (cond === false)
                return e instanceof If ? e : e.nodes;
            if (this.nodes.length)
                return this;
            return new If(not(cond), e instanceof If ? [e] : e.nodes);
        }
        if (cond === false || !this.nodes.length)
            return undefined;
        return this;
    }
    optimizeNames(names, constants) {
        var _a;
        this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
        if (!(super.optimizeNames(names, constants) || this.else))
            return;
        this.condition = optimizeExpr(this.condition, names, constants);
        return this;
    }
    get names() {
        const names = super.names;
        addExprNames(names, this.condition);
        if (this.else)
            addNames(names, this.else.names);
        return names;
    }
}
If.kind = "if";
class For extends BlockNode {
}
For.kind = "for";
class ForLoop extends For {
    constructor(iteration) {
        super();
        this.iteration = iteration;
    }
    render(opts) {
        return `for(${this.iteration})` + super.render(opts);
    }
    optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
            return;
        this.iteration = optimizeExpr(this.iteration, names, constants);
        return this;
    }
    get names() {
        return addNames(super.names, this.iteration.names);
    }
}
class ForRange extends For {
    constructor(varKind, name, from, to) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.from = from;
        this.to = to;
    }
    render(opts) {
        const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
        const { name, from, to } = this;
        return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
    }
    get names() {
        const names = addExprNames(super.names, this.from);
        return addExprNames(names, this.to);
    }
}
class ForIter extends For {
    constructor(loop, varKind, name, iterable) {
        super();
        this.loop = loop;
        this.varKind = varKind;
        this.name = name;
        this.iterable = iterable;
    }
    render(opts) {
        return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
    }
    optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
            return;
        this.iterable = optimizeExpr(this.iterable, names, constants);
        return this;
    }
    get names() {
        return addNames(super.names, this.iterable.names);
    }
}
class Func extends BlockNode {
    constructor(name, args, async) {
        super();
        this.name = name;
        this.args = args;
        this.async = async;
    }
    render(opts) {
        const _async = this.async ? "async " : "";
        return `${_async}function ${this.name}(${this.args})` + super.render(opts);
    }
}
Func.kind = "func";
class Return extends ParentNode {
    render(opts) {
        return "return " + super.render(opts);
    }
}
Return.kind = "return";
class Try extends BlockNode {
    render(opts) {
        let code = "try" + super.render(opts);
        if (this.catch)
            code += this.catch.render(opts);
        if (this.finally)
            code += this.finally.render(opts);
        return code;
    }
    optimizeNodes() {
        var _a, _b;
        super.optimizeNodes();
        (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
        return this;
    }
    optimizeNames(names, constants) {
        var _a, _b;
        super.optimizeNames(names, constants);
        (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
        return this;
    }
    get names() {
        const names = super.names;
        if (this.catch)
            addNames(names, this.catch.names);
        if (this.finally)
            addNames(names, this.finally.names);
        return names;
    }
}
class Catch extends BlockNode {
    constructor(error) {
        super();
        this.error = error;
    }
    render(opts) {
        return `catch(${this.error})` + super.render(opts);
    }
}
Catch.kind = "catch";
class Finally extends BlockNode {
    render(opts) {
        return "finally" + super.render(opts);
    }
}
Finally.kind = "finally";
class CodeGen {
    constructor(extScope, opts = {}) {
        this._values = {};
        this._blockStarts = [];
        this._constants = {};
        this.opts = { ...opts, _n: opts.lines ? "\n" : "" };
        this._extScope = extScope;
        this._scope = new scope_1.Scope({ parent: extScope });
        this._nodes = [new Root()];
    }
    toString() {
        return this._root.render(this.opts);
    }
    // returns unique name in the internal scope
    name(prefix) {
        return this._scope.name(prefix);
    }
    // reserves unique name in the external scope
    scopeName(prefix) {
        return this._extScope.name(prefix);
    }
    // reserves unique name in the external scope and assigns value to it
    scopeValue(prefixOrName, value) {
        const name = this._extScope.value(prefixOrName, value);
        const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());
        vs.add(name);
        return name;
    }
    getScopeValue(prefix, keyOrRef) {
        return this._extScope.getValue(prefix, keyOrRef);
    }
    // return code that assigns values in the external scope to the names that are used internally
    // (same names that were returned by gen.scopeName or gen.scopeValue)
    scopeRefs(scopeName) {
        return this._extScope.scopeRefs(scopeName, this._values);
    }
    scopeCode() {
        return this._extScope.scopeCode(this._values);
    }
    _def(varKind, nameOrPrefix, rhs, constant) {
        const name = this._scope.toName(nameOrPrefix);
        if (rhs !== undefined && constant)
            this._constants[name.str] = rhs;
        this._leafNode(new Def(varKind, name, rhs));
        return name;
    }
    // `const` declaration (`var` in es5 mode)
    const(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
    }
    // `let` declaration with optional assignment (`var` in es5 mode)
    let(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);
    }
    // `var` declaration with optional assignment
    var(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);
    }
    // assignment code
    assign(lhs, rhs, sideEffects) {
        return this._leafNode(new Assign(lhs, rhs, sideEffects));
    }
    // `+=` code
    add(lhs, rhs) {
        return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));
    }
    // appends passed SafeExpr to code or executes Block
    code(c) {
        if (typeof c == "function")
            c();
        else if (c !== code_1.nil)
            this._leafNode(new AnyCode(c));
        return this;
    }
    // returns code for object literal for the passed argument list of key-value pairs
    object(...keyValues) {
        const code = ["{"];
        for (const [key, value] of keyValues) {
            if (code.length > 1)
                code.push(",");
            code.push(key);
            if (key !== value || this.opts.es5) {
                code.push(":");
                (0, code_1.addCodeArg)(code, value);
            }
        }
        code.push("}");
        return new code_1._Code(code);
    }
    // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
    if(condition, thenBody, elseBody) {
        this._blockNode(new If(condition));
        if (thenBody && elseBody) {
            this.code(thenBody).else().code(elseBody).endIf();
        }
        else if (thenBody) {
            this.code(thenBody).endIf();
        }
        else if (elseBody) {
            throw new Error('CodeGen: "else" body without "then" body');
        }
        return this;
    }
    // `else if` clause - invalid without `if` or after `else` clauses
    elseIf(condition) {
        return this._elseNode(new If(condition));
    }
    // `else` clause - only valid after `if` or `else if` clauses
    else() {
        return this._elseNode(new Else());
    }
    // end `if` statement (needed if gen.if was used only with condition)
    endIf() {
        return this._endBlockNode(If, Else);
    }
    _for(node, forBody) {
        this._blockNode(node);
        if (forBody)
            this.code(forBody).endFor();
        return this;
    }
    // a generic `for` clause (or statement if `forBody` is passed)
    for(iteration, forBody) {
        return this._for(new ForLoop(iteration), forBody);
    }
    // `for` statement for a range of values
    forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
    }
    // `for-of` statement (in es5 mode replace with a normal for loop)
    forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
        const name = this._scope.toName(nameOrPrefix);
        if (this.opts.es5) {
            const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
            return this.forRange("_i", 0, (0, code_1._) `${arr}.length`, (i) => {
                this.var(name, (0, code_1._) `${arr}[${i}]`);
                forBody(name);
            });
        }
        return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
    }
    // `for-in` statement.
    // With option `ownProperties` replaced with a `for-of` loop for object keys
    forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
        if (this.opts.ownProperties) {
            return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);
        }
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
    }
    // end `for` loop
    endFor() {
        return this._endBlockNode(For);
    }
    // `label` statement
    label(label) {
        return this._leafNode(new Label(label));
    }
    // `break` statement
    break(label) {
        return this._leafNode(new Break(label));
    }
    // `return` statement
    return(value) {
        const node = new Return();
        this._blockNode(node);
        this.code(value);
        if (node.nodes.length !== 1)
            throw new Error('CodeGen: "return" should have one node');
        return this._endBlockNode(Return);
    }
    // `try` statement
    try(tryBody, catchCode, finallyCode) {
        if (!catchCode && !finallyCode)
            throw new Error('CodeGen: "try" without "catch" and "finally"');
        const node = new Try();
        this._blockNode(node);
        this.code(tryBody);
        if (catchCode) {
            const error = this.name("e");
            this._currNode = node.catch = new Catch(error);
            catchCode(error);
        }
        if (finallyCode) {
            this._currNode = node.finally = new Finally();
            this.code(finallyCode);
        }
        return this._endBlockNode(Catch, Finally);
    }
    // `throw` statement
    throw(error) {
        return this._leafNode(new Throw(error));
    }
    // start self-balancing block
    block(body, nodeCount) {
        this._blockStarts.push(this._nodes.length);
        if (body)
            this.code(body).endBlock(nodeCount);
        return this;
    }
    // end the current self-balancing block
    endBlock(nodeCount) {
        const len = this._blockStarts.pop();
        if (len === undefined)
            throw new Error("CodeGen: not in self-balancing block");
        const toClose = this._nodes.length - len;
        if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {
            throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
        }
        this._nodes.length = len;
        return this;
    }
    // `function` heading (or definition if funcBody is passed)
    func(name, args = code_1.nil, async, funcBody) {
        this._blockNode(new Func(name, args, async));
        if (funcBody)
            this.code(funcBody).endFunc();
        return this;
    }
    // end function definition
    endFunc() {
        return this._endBlockNode(Func);
    }
    optimize(n = 1) {
        while (n-- > 0) {
            this._root.optimizeNodes();
            this._root.optimizeNames(this._root.names, this._constants);
        }
    }
    _leafNode(node) {
        this._currNode.nodes.push(node);
        return this;
    }
    _blockNode(node) {
        this._currNode.nodes.push(node);
        this._nodes.push(node);
    }
    _endBlockNode(N1, N2) {
        const n = this._currNode;
        if (n instanceof N1 || (N2 && n instanceof N2)) {
            this._nodes.pop();
            return this;
        }
        throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
    }
    _elseNode(node) {
        const n = this._currNode;
        if (!(n instanceof If)) {
            throw new Error('CodeGen: "else" without "if"');
        }
        this._currNode = n.else = node;
        return this;
    }
    get _root() {
        return this._nodes[0];
    }
    get _currNode() {
        const ns = this._nodes;
        return ns[ns.length - 1];
    }
    set _currNode(node) {
        const ns = this._nodes;
        ns[ns.length - 1] = node;
    }
}
exports.CodeGen = CodeGen;
function addNames(names, from) {
    for (const n in from)
        names[n] = (names[n] || 0) + (from[n] || 0);
    return names;
}
function addExprNames(names, from) {
    return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
}
function optimizeExpr(expr, names, constants) {
    if (expr instanceof code_1.Name)
        return replaceName(expr);
    if (!canOptimize(expr))
        return expr;
    return new code_1._Code(expr._items.reduce((items, c) => {
        if (c instanceof code_1.Name)
            c = replaceName(c);
        if (c instanceof code_1._Code)
            items.push(...c._items);
        else
            items.push(c);
        return items;
    }, []));
    function replaceName(n) {
        const c = constants[n.str];
        if (c === undefined || names[n.str] !== 1)
            return n;
        delete names[n.str];
        return c;
    }
    function canOptimize(e) {
        return (e instanceof code_1._Code &&
            e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));
    }
}
function subtractNames(names, from) {
    for (const n in from)
        names[n] = (names[n] || 0) - (from[n] || 0);
}
function not(x) {
    return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._) `!${par(x)}`;
}
exports.not = not;
const andCode = mappend(exports.operators.AND);
// boolean AND (&&) expression with the passed arguments
function and(...args) {
    return args.reduce(andCode);
}
exports.and = and;
const orCode = mappend(exports.operators.OR);
// boolean OR (||) expression with the passed arguments
function or(...args) {
    return args.reduce(orCode);
}
exports.or = or;
function mappend(op) {
    return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);
}
function par(x) {
    return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;
}
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 17686:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
const code_1 = __webpack_require__(25875);
class ValueError extends Error {
    constructor(name) {
        super(`CodeGen: "code" for ${name} not defined`);
        this.value = name.value;
    }
}
var UsedValueState;
(function (UsedValueState) {
    UsedValueState[UsedValueState["Started"] = 0] = "Started";
    UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
exports.varKinds = {
    const: new code_1.Name("const"),
    let: new code_1.Name("let"),
    var: new code_1.Name("var"),
};
class Scope {
    constructor({ prefixes, parent } = {}) {
        this._names = {};
        this._prefixes = prefixes;
        this._parent = parent;
    }
    toName(nameOrPrefix) {
        return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
    }
    name(prefix) {
        return new code_1.Name(this._newName(prefix));
    }
    _newName(prefix) {
        const ng = this._names[prefix] || this._nameGroup(prefix);
        return `${prefix}${ng.index++}`;
    }
    _nameGroup(prefix) {
        var _a, _b;
        if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {
            throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
        }
        return (this._names[prefix] = { prefix, index: 0 });
    }
}
exports.Scope = Scope;
class ValueScopeName extends code_1.Name {
    constructor(prefix, nameStr) {
        super(nameStr);
        this.prefix = prefix;
    }
    setValue(value, { property, itemIndex }) {
        this.value = value;
        this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;
    }
}
exports.ValueScopeName = ValueScopeName;
const line = (0, code_1._) `\n`;
class ValueScope extends Scope {
    constructor(opts) {
        super(opts);
        this._values = {};
        this._scope = opts.scope;
        this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
    }
    get() {
        return this._scope;
    }
    name(prefix) {
        return new ValueScopeName(prefix, this._newName(prefix));
    }
    value(nameOrPrefix, value) {
        var _a;
        if (value.ref === undefined)
            throw new Error("CodeGen: ref must be passed in value");
        const name = this.toName(nameOrPrefix);
        const { prefix } = name;
        const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
        let vs = this._values[prefix];
        if (vs) {
            const _name = vs.get(valueKey);
            if (_name)
                return _name;
        }
        else {
            vs = this._values[prefix] = new Map();
        }
        vs.set(valueKey, name);
        const s = this._scope[prefix] || (this._scope[prefix] = []);
        const itemIndex = s.length;
        s[itemIndex] = value.ref;
        name.setValue(value, { property: prefix, itemIndex });
        return name;
    }
    getValue(prefix, keyOrRef) {
        const vs = this._values[prefix];
        if (!vs)
            return;
        return vs.get(keyOrRef);
    }
    scopeRefs(scopeName, values = this._values) {
        return this._reduceValues(values, (name) => {
            if (name.scopePath === undefined)
                throw new Error(`CodeGen: name "${name}" has no value`);
            return (0, code_1._) `${scopeName}${name.scopePath}`;
        });
    }
    scopeCode(values = this._values, usedValues, getCode) {
        return this._reduceValues(values, (name) => {
            if (name.value === undefined)
                throw new Error(`CodeGen: name "${name}" has no value`);
            return name.value.code;
        }, usedValues, getCode);
    }
    _reduceValues(values, valueCode, usedValues = {}, getCode) {
        let code = code_1.nil;
        for (const prefix in values) {
            const vs = values[prefix];
            if (!vs)
                continue;
            const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());
            vs.forEach((name) => {
                if (nameSet.has(name))
                    return;
                nameSet.set(name, UsedValueState.Started);
                let c = valueCode(name);
                if (c) {
                    const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
                    code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;
                }
                else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {
                    code = (0, code_1._) `${code}${c}${this.opts._n}`;
                }
                else {
                    throw new ValueError(name);
                }
                nameSet.set(name, UsedValueState.Completed);
            });
        }
        return code;
    }
}
exports.ValueScope = ValueScope;
//# sourceMappingURL=scope.js.map

/***/ }),

/***/ 26990:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const names_1 = __webpack_require__(25668);
exports.keywordError = {
    message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`,
};
exports.keyword$DataError = {
    message: ({ keyword, schemaType }) => schemaType
        ? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)`
        : (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`,
};
function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
    const { it } = cxt;
    const { gen, compositeRule, allErrors } = it;
    const errObj = errorObjectCode(cxt, error, errorPaths);
    if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {
        addError(gen, errObj);
    }
    else {
        returnErrors(it, (0, codegen_1._) `[${errObj}]`);
    }
}
exports.reportError = reportError;
function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
    const { it } = cxt;
    const { gen, compositeRule, allErrors } = it;
    const errObj = errorObjectCode(cxt, error, errorPaths);
    addError(gen, errObj);
    if (!(compositeRule || allErrors)) {
        returnErrors(it, names_1.default.vErrors);
    }
}
exports.reportExtraError = reportExtraError;
function resetErrorsCount(gen, errsCount) {
    gen.assign(names_1.default.errors, errsCount);
    gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
}
exports.resetErrorsCount = resetErrorsCount;
function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {
    /* istanbul ignore if */
    if (errsCount === undefined)
        throw new Error("ajv implementation error");
    const err = gen.name("err");
    gen.forRange("i", errsCount, names_1.default.errors, (i) => {
        gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);
        gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
        gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);
        if (it.opts.verbose) {
            gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);
            gen.assign((0, codegen_1._) `${err}.data`, data);
        }
    });
}
exports.extendErrors = extendErrors;
function addError(gen, errObj) {
    const err = gen.const("err", errObj);
    gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);
    gen.code((0, codegen_1._) `${names_1.default.errors}++`);
}
function returnErrors(it, errs) {
    const { gen, validateName, schemaEnv } = it;
    if (schemaEnv.$async) {
        gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);
    }
    else {
        gen.assign((0, codegen_1._) `${validateName}.errors`, errs);
        gen.return(false);
    }
}
const E = {
    keyword: new codegen_1.Name("keyword"),
    schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
    params: new codegen_1.Name("params"),
    propertyName: new codegen_1.Name("propertyName"),
    message: new codegen_1.Name("message"),
    schema: new codegen_1.Name("schema"),
    parentSchema: new codegen_1.Name("parentSchema"),
};
function errorObjectCode(cxt, error, errorPaths) {
    const { createErrors } = cxt.it;
    if (createErrors === false)
        return (0, codegen_1._) `{}`;
    return errorObject(cxt, error, errorPaths);
}
function errorObject(cxt, error, errorPaths = {}) {
    const { gen, it } = cxt;
    const keyValues = [
        errorInstancePath(it, errorPaths),
        errorSchemaPath(cxt, errorPaths),
    ];
    extraErrorProps(cxt, error, keyValues);
    return gen.object(...keyValues);
}
function errorInstancePath({ errorPath }, { instancePath }) {
    const instPath = instancePath
        ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`
        : errorPath;
    return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
}
function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
    let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;
    if (schemaPath) {
        schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
    }
    return [E.schemaPath, schPath];
}
function extraErrorProps(cxt, { params, message }, keyValues) {
    const { keyword, data, schemaValue, it } = cxt;
    const { opts, propertyName, topSchemaRef, schemaPath } = it;
    keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]);
    if (opts.messages) {
        keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
    }
    if (opts.verbose) {
        keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
    }
    if (propertyName)
        keyValues.push([E.propertyName, propertyName]);
}
//# sourceMappingURL=errors.js.map

/***/ }),

/***/ 56862:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
const codegen_1 = __webpack_require__(78380);
const validation_error_1 = __webpack_require__(52582);
const names_1 = __webpack_require__(25668);
const resolve_1 = __webpack_require__(20394);
const util_1 = __webpack_require__(75280);
const validate_1 = __webpack_require__(58941);
class SchemaEnv {
    constructor(env) {
        var _a;
        this.refs = {};
        this.dynamicAnchors = {};
        let schema;
        if (typeof env.schema == "object")
            schema = env.schema;
        this.schema = env.schema;
        this.schemaId = env.schemaId;
        this.root = env.root || this;
        this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
        this.schemaPath = env.schemaPath;
        this.localRefs = env.localRefs;
        this.meta = env.meta;
        this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
        this.refs = {};
    }
}
exports.SchemaEnv = SchemaEnv;
// let codeSize = 0
// let nodeCount = 0
// Compiles schema in SchemaEnv
function compileSchema(sch) {
    // TODO refactor - remove compilations
    const _sch = getCompilingSchema.call(this, sch);
    if (_sch)
        return _sch;
    const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails
    const { es5, lines } = this.opts.code;
    const { ownProperties } = this.opts;
    const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
    let _ValidationError;
    if (sch.$async) {
        _ValidationError = gen.scopeValue("Error", {
            ref: validation_error_1.default,
            code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`,
        });
    }
    const validateName = gen.scopeName("validate");
    sch.validateName = validateName;
    const schemaCxt = {
        gen,
        allErrors: this.opts.allErrors,
        data: names_1.default.data,
        parentData: names_1.default.parentData,
        parentDataProperty: names_1.default.parentDataProperty,
        dataNames: [names_1.default.data],
        dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?
        dataLevel: 0,
        dataTypes: [],
        definedProperties: new Set(),
        topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true
            ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }
            : { ref: sch.schema }),
        validateName,
        ValidationError: _ValidationError,
        schema: sch.schema,
        schemaEnv: sch,
        rootId,
        baseId: sch.baseId || rootId,
        schemaPath: codegen_1.nil,
        errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
        errorPath: (0, codegen_1._) `""`,
        opts: this.opts,
        self: this,
    };
    let sourceCode;
    try {
        this._compilations.add(sch);
        (0, validate_1.validateFunctionCode)(schemaCxt);
        gen.optimize(this.opts.code.optimize);
        // gen.optimize(1)
        const validateCode = gen.toString();
        sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
        // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
        if (this.opts.code.process)
            sourceCode = this.opts.code.process(sourceCode, sch);
        // console.log("\n\n\n *** \n", sourceCode)
        const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
        const validate = makeValidate(this, this.scope.get());
        this.scope.value(validateName, { ref: validate });
        validate.errors = null;
        validate.schema = sch.schema;
        validate.schemaEnv = sch;
        if (sch.$async)
            validate.$async = true;
        if (this.opts.code.source === true) {
            validate.source = { validateName, validateCode, scopeValues: gen._values };
        }
        if (this.opts.unevaluated) {
            const { props, items } = schemaCxt;
            validate.evaluated = {
                props: props instanceof codegen_1.Name ? undefined : props,
                items: items instanceof codegen_1.Name ? undefined : items,
                dynamicProps: props instanceof codegen_1.Name,
                dynamicItems: items instanceof codegen_1.Name,
            };
            if (validate.source)
                validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
        }
        sch.validate = validate;
        return sch;
    }
    catch (e) {
        delete sch.validate;
        delete sch.validateName;
        if (sourceCode)
            this.logger.error("Error compiling schema, function code:", sourceCode);
        // console.log("\n\n\n *** \n", sourceCode, this.opts)
        throw e;
    }
    finally {
        this._compilations.delete(sch);
    }
}
exports.compileSchema = compileSchema;
function resolveRef(root, baseId, ref) {
    var _a;
    ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
    const schOrFunc = root.refs[ref];
    if (schOrFunc)
        return schOrFunc;
    let _sch = resolve.call(this, root, ref);
    if (_sch === undefined) {
        const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
        const { schemaId } = this.opts;
        if (schema)
            _sch = new SchemaEnv({ schema, schemaId, root, baseId });
    }
    if (_sch === undefined)
        return;
    return (root.refs[ref] = inlineOrCompile.call(this, _sch));
}
exports.resolveRef = resolveRef;
function inlineOrCompile(sch) {
    if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
        return sch.schema;
    return sch.validate ? sch : compileSchema.call(this, sch);
}
// Index of schema compilation in the currently compiled list
function getCompilingSchema(schEnv) {
    for (const sch of this._compilations) {
        if (sameSchemaEnv(sch, schEnv))
            return sch;
    }
}
exports.getCompilingSchema = getCompilingSchema;
function sameSchemaEnv(s1, s2) {
    return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
}
// resolve and compile the references ($ref)
// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
function resolve(root, // information about the root schema for the current schema
ref // reference to resolve
) {
    let sch;
    while (typeof (sch = this.refs[ref]) == "string")
        ref = sch;
    return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
}
// Resolve schema, its root and baseId
function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
ref // reference to resolve
) {
    const p = this.opts.uriResolver.parse(ref);
    const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
    let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);
    // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
    if (Object.keys(root.schema).length > 0 && refPath === baseId) {
        return getJsonPointer.call(this, p, root);
    }
    const id = (0, resolve_1.normalizeId)(refPath);
    const schOrRef = this.refs[id] || this.schemas[id];
    if (typeof schOrRef == "string") {
        const sch = resolveSchema.call(this, root, schOrRef);
        if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
            return;
        return getJsonPointer.call(this, p, sch);
    }
    if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
        return;
    if (!schOrRef.validate)
        compileSchema.call(this, schOrRef);
    if (id === (0, resolve_1.normalizeId)(ref)) {
        const { schema } = schOrRef;
        const { schemaId } = this.opts;
        const schId = schema[schemaId];
        if (schId)
            baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        return new SchemaEnv({ schema, schemaId, root, baseId });
    }
    return getJsonPointer.call(this, p, schOrRef);
}
exports.resolveSchema = resolveSchema;
const PREVENT_SCOPE_CHANGE = new Set([
    "properties",
    "patternProperties",
    "enum",
    "dependencies",
    "definitions",
]);
function getJsonPointer(parsedRef, { baseId, schema, root }) {
    var _a;
    if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
        return;
    for (const part of parsedRef.fragment.slice(1).split("/")) {
        if (typeof schema === "boolean")
            return;
        const partSchema = schema[(0, util_1.unescapeFragment)(part)];
        if (partSchema === undefined)
            return;
        schema = partSchema;
        // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?
        const schId = typeof schema === "object" && schema[this.opts.schemaId];
        if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
            baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        }
    }
    let env;
    if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
        const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
        env = resolveSchema.call(this, root, $ref);
    }
    // even though resolution failed we need to return SchemaEnv to throw exception
    // so that compileAsync loads missing schema.
    const { schemaId } = this.opts;
    env = env || new SchemaEnv({ schema, schemaId, root, baseId });
    if (env.schema !== env.root.schema)
        return env;
    return undefined;
}
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 25668:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const names = {
    // validation function arguments
    data: new codegen_1.Name("data"), // data passed to validation function
    // args passed from referencing schema
    valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
    instancePath: new codegen_1.Name("instancePath"),
    parentData: new codegen_1.Name("parentData"),
    parentDataProperty: new codegen_1.Name("parentDataProperty"),
    rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function
    dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
    // function scoped variables
    vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors
    errors: new codegen_1.Name("errors"), // counter of validation errors
    this: new codegen_1.Name("this"),
    // "globals"
    self: new codegen_1.Name("self"),
    scope: new codegen_1.Name("scope"),
    // JTD serialize/parse name for JSON string and position
    json: new codegen_1.Name("json"),
    jsonPos: new codegen_1.Name("jsonPos"),
    jsonLen: new codegen_1.Name("jsonLen"),
    jsonPart: new codegen_1.Name("jsonPart"),
};
exports["default"] = names;
//# sourceMappingURL=names.js.map

/***/ }),

/***/ 61326:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const resolve_1 = __webpack_require__(20394);
class MissingRefError extends Error {
    constructor(resolver, baseId, ref, msg) {
        super(msg || `can't resolve reference ${ref} from id ${baseId}`);
        this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
        this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
    }
}
exports["default"] = MissingRefError;
//# sourceMappingURL=ref_error.js.map

/***/ }),

/***/ 20394:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;
const util_1 = __webpack_require__(75280);
const equal = __webpack_require__(66471);
const traverse = __webpack_require__(25127);
// TODO refactor to use keyword definitions
const SIMPLE_INLINED = new Set([
    "type",
    "format",
    "pattern",
    "maxLength",
    "minLength",
    "maxProperties",
    "minProperties",
    "maxItems",
    "minItems",
    "maximum",
    "minimum",
    "uniqueItems",
    "multipleOf",
    "required",
    "enum",
    "const",
]);
function inlineRef(schema, limit = true) {
    if (typeof schema == "boolean")
        return true;
    if (limit === true)
        return !hasRef(schema);
    if (!limit)
        return false;
    return countKeys(schema) <= limit;
}
exports.inlineRef = inlineRef;
const REF_KEYWORDS = new Set([
    "$ref",
    "$recursiveRef",
    "$recursiveAnchor",
    "$dynamicRef",
    "$dynamicAnchor",
]);
function hasRef(schema) {
    for (const key in schema) {
        if (REF_KEYWORDS.has(key))
            return true;
        const sch = schema[key];
        if (Array.isArray(sch) && sch.some(hasRef))
            return true;
        if (typeof sch == "object" && hasRef(sch))
            return true;
    }
    return false;
}
function countKeys(schema) {
    let count = 0;
    for (const key in schema) {
        if (key === "$ref")
            return Infinity;
        count++;
        if (SIMPLE_INLINED.has(key))
            continue;
        if (typeof schema[key] == "object") {
            (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch)));
        }
        if (count === Infinity)
            return Infinity;
    }
    return count;
}
function getFullPath(resolver, id = "", normalize) {
    if (normalize !== false)
        id = normalizeId(id);
    const p = resolver.parse(id);
    return _getFullPath(resolver, p);
}
exports.getFullPath = getFullPath;
function _getFullPath(resolver, p) {
    const serialized = resolver.serialize(p);
    return serialized.split("#")[0] + "#";
}
exports._getFullPath = _getFullPath;
const TRAILING_SLASH_HASH = /#\/?$/;
function normalizeId(id) {
    return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
}
exports.normalizeId = normalizeId;
function resolveUrl(resolver, baseId, id) {
    id = normalizeId(id);
    return resolver.resolve(baseId, id);
}
exports.resolveUrl = resolveUrl;
const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
function getSchemaRefs(schema, baseId) {
    if (typeof schema == "boolean")
        return {};
    const { schemaId, uriResolver } = this.opts;
    const schId = normalizeId(schema[schemaId] || baseId);
    const baseIds = { "": schId };
    const pathPrefix = getFullPath(uriResolver, schId, false);
    const localRefs = {};
    const schemaRefs = new Set();
    traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
        if (parentJsonPtr === undefined)
            return;
        const fullPath = pathPrefix + jsonPtr;
        let innerBaseId = baseIds[parentJsonPtr];
        if (typeof sch[schemaId] == "string")
            innerBaseId = addRef.call(this, sch[schemaId]);
        addAnchor.call(this, sch.$anchor);
        addAnchor.call(this, sch.$dynamicAnchor);
        baseIds[jsonPtr] = innerBaseId;
        function addRef(ref) {
            // eslint-disable-next-line @typescript-eslint/unbound-method
            const _resolve = this.opts.uriResolver.resolve;
            ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
            if (schemaRefs.has(ref))
                throw ambiguos(ref);
            schemaRefs.add(ref);
            let schOrRef = this.refs[ref];
            if (typeof schOrRef == "string")
                schOrRef = this.refs[schOrRef];
            if (typeof schOrRef == "object") {
                checkAmbiguosRef(sch, schOrRef.schema, ref);
            }
            else if (ref !== normalizeId(fullPath)) {
                if (ref[0] === "#") {
                    checkAmbiguosRef(sch, localRefs[ref], ref);
                    localRefs[ref] = sch;
                }
                else {
                    this.refs[ref] = fullPath;
                }
            }
            return ref;
        }
        function addAnchor(anchor) {
            if (typeof anchor == "string") {
                if (!ANCHOR.test(anchor))
                    throw new Error(`invalid anchor "${anchor}"`);
                addRef.call(this, `#${anchor}`);
            }
        }
    });
    return localRefs;
    function checkAmbiguosRef(sch1, sch2, ref) {
        if (sch2 !== undefined && !equal(sch1, sch2))
            throw ambiguos(ref);
    }
    function ambiguos(ref) {
        return new Error(`reference "${ref}" resolves to more than one schema`);
    }
}
exports.getSchemaRefs = getSchemaRefs;
//# sourceMappingURL=resolve.js.map

/***/ }),

/***/ 68817:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getRules = exports.isJSONType = void 0;
const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
const jsonTypes = new Set(_jsonTypes);
function isJSONType(x) {
    return typeof x == "string" && jsonTypes.has(x);
}
exports.isJSONType = isJSONType;
function getRules() {
    const groups = {
        number: { type: "number", rules: [] },
        string: { type: "string", rules: [] },
        array: { type: "array", rules: [] },
        object: { type: "object", rules: [] },
    };
    return {
        types: { ...groups, integer: true, boolean: true, null: true },
        rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
        post: { rules: [] },
        all: {},
        keywords: {},
    };
}
exports.getRules = getRules;
//# sourceMappingURL=rules.js.map

/***/ }),

/***/ 75280:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
const codegen_1 = __webpack_require__(78380);
const code_1 = __webpack_require__(25875);
// TODO refactor to use Set
function toHash(arr) {
    const hash = {};
    for (const item of arr)
        hash[item] = true;
    return hash;
}
exports.toHash = toHash;
function alwaysValidSchema(it, schema) {
    if (typeof schema == "boolean")
        return schema;
    if (Object.keys(schema).length === 0)
        return true;
    checkUnknownRules(it, schema);
    return !schemaHasRules(schema, it.self.RULES.all);
}
exports.alwaysValidSchema = alwaysValidSchema;
function checkUnknownRules(it, schema = it.schema) {
    const { opts, self } = it;
    if (!opts.strictSchema)
        return;
    if (typeof schema === "boolean")
        return;
    const rules = self.RULES.keywords;
    for (const key in schema) {
        if (!rules[key])
            checkStrictMode(it, `unknown keyword: "${key}"`);
    }
}
exports.checkUnknownRules = checkUnknownRules;
function schemaHasRules(schema, rules) {
    if (typeof schema == "boolean")
        return !schema;
    for (const key in schema)
        if (rules[key])
            return true;
    return false;
}
exports.schemaHasRules = schemaHasRules;
function schemaHasRulesButRef(schema, RULES) {
    if (typeof schema == "boolean")
        return !schema;
    for (const key in schema)
        if (key !== "$ref" && RULES.all[key])
            return true;
    return false;
}
exports.schemaHasRulesButRef = schemaHasRulesButRef;
function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
    if (!$data) {
        if (typeof schema == "number" || typeof schema == "boolean")
            return schema;
        if (typeof schema == "string")
            return (0, codegen_1._) `${schema}`;
    }
    return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
}
exports.schemaRefOrVal = schemaRefOrVal;
function unescapeFragment(str) {
    return unescapeJsonPointer(decodeURIComponent(str));
}
exports.unescapeFragment = unescapeFragment;
function escapeFragment(str) {
    return encodeURIComponent(escapeJsonPointer(str));
}
exports.escapeFragment = escapeFragment;
function escapeJsonPointer(str) {
    if (typeof str == "number")
        return `${str}`;
    return str.replace(/~/g, "~0").replace(/\//g, "~1");
}
exports.escapeJsonPointer = escapeJsonPointer;
function unescapeJsonPointer(str) {
    return str.replace(/~1/g, "/").replace(/~0/g, "~");
}
exports.unescapeJsonPointer = unescapeJsonPointer;
function eachItem(xs, f) {
    if (Array.isArray(xs)) {
        for (const x of xs)
            f(x);
    }
    else {
        f(xs);
    }
}
exports.eachItem = eachItem;
function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {
    return (gen, from, to, toName) => {
        const res = to === undefined
            ? from
            : to instanceof codegen_1.Name
                ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
                : from instanceof codegen_1.Name
                    ? (mergeToName(gen, to, from), from)
                    : mergeValues(from, to);
        return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
    };
}
exports.mergeEvaluated = {
    props: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {
            gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));
        }),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {
            if (from === true) {
                gen.assign(to, true);
            }
            else {
                gen.assign(to, (0, codegen_1._) `${to} || {}`);
                setEvaluated(gen, to, from);
            }
        }),
        mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),
        resultToName: evaluatedPropsToName,
    }),
    items: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),
        mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),
        resultToName: (gen, items) => gen.var("items", items),
    }),
};
function evaluatedPropsToName(gen, ps) {
    if (ps === true)
        return gen.var("props", true);
    const props = gen.var("props", (0, codegen_1._) `{}`);
    if (ps !== undefined)
        setEvaluated(gen, props, ps);
    return props;
}
exports.evaluatedPropsToName = evaluatedPropsToName;
function setEvaluated(gen, props, ps) {
    Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));
}
exports.setEvaluated = setEvaluated;
const snippets = {};
function useFunc(gen, f) {
    return gen.scopeValue("func", {
        ref: f,
        code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),
    });
}
exports.useFunc = useFunc;
var Type;
(function (Type) {
    Type[Type["Num"] = 0] = "Num";
    Type[Type["Str"] = 1] = "Str";
})(Type || (exports.Type = Type = {}));
function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
    // let path
    if (dataProp instanceof codegen_1.Name) {
        const isNumber = dataPropType === Type.Num;
        return jsPropertySyntax
            ? isNumber
                ? (0, codegen_1._) `"[" + ${dataProp} + "]"`
                : (0, codegen_1._) `"['" + ${dataProp} + "']"`
            : isNumber
                ? (0, codegen_1._) `"/" + ${dataProp}`
                : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
    }
    return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
}
exports.getErrorPath = getErrorPath;
function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
    if (!mode)
        return;
    msg = `strict mode: ${msg}`;
    if (mode === true)
        throw new Error(msg);
    it.self.logger.warn(msg);
}
exports.checkStrictMode = checkStrictMode;
//# sourceMappingURL=util.js.map

/***/ }),

/***/ 66388:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
function schemaHasRulesForType({ schema, self }, type) {
    const group = self.RULES.types[type];
    return group && group !== true && shouldUseGroup(schema, group);
}
exports.schemaHasRulesForType = schemaHasRulesForType;
function shouldUseGroup(schema, group) {
    return group.rules.some((rule) => shouldUseRule(schema, rule));
}
exports.shouldUseGroup = shouldUseGroup;
function shouldUseRule(schema, rule) {
    var _a;
    return (schema[rule.keyword] !== undefined ||
        ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
}
exports.shouldUseRule = shouldUseRule;
//# sourceMappingURL=applicability.js.map

/***/ }),

/***/ 43720:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
const errors_1 = __webpack_require__(26990);
const codegen_1 = __webpack_require__(78380);
const names_1 = __webpack_require__(25668);
const boolError = {
    message: "boolean schema is false",
};
function topBoolOrEmptySchema(it) {
    const { gen, schema, validateName } = it;
    if (schema === false) {
        falseSchemaError(it, false);
    }
    else if (typeof schema == "object" && schema.$async === true) {
        gen.return(names_1.default.data);
    }
    else {
        gen.assign((0, codegen_1._) `${validateName}.errors`, null);
        gen.return(true);
    }
}
exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
function boolOrEmptySchema(it, valid) {
    const { gen, schema } = it;
    if (schema === false) {
        gen.var(valid, false); // TODO var
        falseSchemaError(it);
    }
    else {
        gen.var(valid, true); // TODO var
    }
}
exports.boolOrEmptySchema = boolOrEmptySchema;
function falseSchemaError(it, overrideAllErrors) {
    const { gen, data } = it;
    // TODO maybe some other interface should be used for non-keyword validation errors...
    const cxt = {
        gen,
        keyword: "false schema",
        data,
        schema: false,
        schemaCode: false,
        schemaValue: false,
        params: {},
        it,
    };
    (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);
}
//# sourceMappingURL=boolSchema.js.map

/***/ }),

/***/ 24307:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
const rules_1 = __webpack_require__(68817);
const applicability_1 = __webpack_require__(66388);
const errors_1 = __webpack_require__(26990);
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
var DataType;
(function (DataType) {
    DataType[DataType["Correct"] = 0] = "Correct";
    DataType[DataType["Wrong"] = 1] = "Wrong";
})(DataType || (exports.DataType = DataType = {}));
function getSchemaTypes(schema) {
    const types = getJSONTypes(schema.type);
    const hasNull = types.includes("null");
    if (hasNull) {
        if (schema.nullable === false)
            throw new Error("type: null contradicts nullable: false");
    }
    else {
        if (!types.length && schema.nullable !== undefined) {
            throw new Error('"nullable" cannot be used without "type"');
        }
        if (schema.nullable === true)
            types.push("null");
    }
    return types;
}
exports.getSchemaTypes = getSchemaTypes;
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
function getJSONTypes(ts) {
    const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
    if (types.every(rules_1.isJSONType))
        return types;
    throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
}
exports.getJSONTypes = getJSONTypes;
function coerceAndCheckDataType(it, types) {
    const { gen, data, opts } = it;
    const coerceTo = coerceToTypes(types, opts.coerceTypes);
    const checkTypes = types.length > 0 &&
        !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
    if (checkTypes) {
        const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
        gen.if(wrongType, () => {
            if (coerceTo.length)
                coerceData(it, types, coerceTo);
            else
                reportTypeError(it);
        });
    }
    return checkTypes;
}
exports.coerceAndCheckDataType = coerceAndCheckDataType;
const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
function coerceToTypes(types, coerceTypes) {
    return coerceTypes
        ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array"))
        : [];
}
function coerceData(it, types, coerceTo) {
    const { gen, data, opts } = it;
    const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`);
    const coerced = gen.let("coerced", (0, codegen_1._) `undefined`);
    if (opts.coerceTypes === "array") {
        gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
            .assign(data, (0, codegen_1._) `${data}[0]`)
            .assign(dataType, (0, codegen_1._) `typeof ${data}`)
            .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
    }
    gen.if((0, codegen_1._) `${coerced} !== undefined`);
    for (const t of coerceTo) {
        if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
            coerceSpecificType(t);
        }
    }
    gen.else();
    reportTypeError(it);
    gen.endIf();
    gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {
        gen.assign(data, coerced);
        assignParentData(it, coerced);
    });
    function coerceSpecificType(t) {
        switch (t) {
            case "string":
                gen
                    .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`)
                    .assign(coerced, (0, codegen_1._) `"" + ${data}`)
                    .elseIf((0, codegen_1._) `${data} === null`)
                    .assign(coerced, (0, codegen_1._) `""`);
                return;
            case "number":
                gen
                    .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
              || (${dataType} == "string" && ${data} && ${data} == +${data})`)
                    .assign(coerced, (0, codegen_1._) `+${data}`);
                return;
            case "integer":
                gen
                    .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
              || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
                    .assign(coerced, (0, codegen_1._) `+${data}`);
                return;
            case "boolean":
                gen
                    .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`)
                    .assign(coerced, false)
                    .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`)
                    .assign(coerced, true);
                return;
            case "null":
                gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`);
                gen.assign(coerced, null);
                return;
            case "array":
                gen
                    .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number"
              || ${dataType} === "boolean" || ${data} === null`)
                    .assign(coerced, (0, codegen_1._) `[${data}]`);
        }
    }
}
function assignParentData({ gen, parentData, parentDataProperty }, expr) {
    // TODO use gen.property
    gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));
}
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
    const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
    let cond;
    switch (dataType) {
        case "null":
            return (0, codegen_1._) `${data} ${EQ} null`;
        case "array":
            cond = (0, codegen_1._) `Array.isArray(${data})`;
            break;
        case "object":
            cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
            break;
        case "integer":
            cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);
            break;
        case "number":
            cond = numCond();
            break;
        default:
            return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;
    }
    return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
    function numCond(_cond = codegen_1.nil) {
        return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);
    }
}
exports.checkDataType = checkDataType;
function checkDataTypes(dataTypes, data, strictNums, correct) {
    if (dataTypes.length === 1) {
        return checkDataType(dataTypes[0], data, strictNums, correct);
    }
    let cond;
    const types = (0, util_1.toHash)(dataTypes);
    if (types.array && types.object) {
        const notObj = (0, codegen_1._) `typeof ${data} != "object"`;
        cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;
        delete types.null;
        delete types.array;
        delete types.object;
    }
    else {
        cond = codegen_1.nil;
    }
    if (types.number)
        delete types.integer;
    for (const t in types)
        cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
    return cond;
}
exports.checkDataTypes = checkDataTypes;
const typeError = {
    message: ({ schema }) => `must be ${schema}`,
    params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,
};
function reportTypeError(it) {
    const cxt = getTypeErrorContext(it);
    (0, errors_1.reportError)(cxt, typeError);
}
exports.reportTypeError = reportTypeError;
function getTypeErrorContext(it) {
    const { gen, data, schema } = it;
    const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
    return {
        gen,
        keyword: "type",
        data,
        schema: schema.type,
        schemaCode,
        schemaValue: schemaCode,
        parentSchema: schema,
        params: {},
        it,
    };
}
//# sourceMappingURL=dataType.js.map

/***/ }),

/***/ 9533:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.assignDefaults = void 0;
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
function assignDefaults(it, ty) {
    const { properties, items } = it.schema;
    if (ty === "object" && properties) {
        for (const key in properties) {
            assignDefault(it, key, properties[key].default);
        }
    }
    else if (ty === "array" && Array.isArray(items)) {
        items.forEach((sch, i) => assignDefault(it, i, sch.default));
    }
}
exports.assignDefaults = assignDefaults;
function assignDefault(it, prop, defaultValue) {
    const { gen, compositeRule, data, opts } = it;
    if (defaultValue === undefined)
        return;
    const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`;
    if (compositeRule) {
        (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
        return;
    }
    let condition = (0, codegen_1._) `${childData} === undefined`;
    if (opts.useDefaults === "empty") {
        condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === ""`;
    }
    // `${childData} === undefined` +
    // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "")
    gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
}
//# sourceMappingURL=defaults.js.map

/***/ }),

/***/ 58941:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;
const boolSchema_1 = __webpack_require__(43720);
const dataType_1 = __webpack_require__(24307);
const applicability_1 = __webpack_require__(66388);
const dataType_2 = __webpack_require__(24307);
const defaults_1 = __webpack_require__(9533);
const keyword_1 = __webpack_require__(34705);
const subschema_1 = __webpack_require__(88171);
const codegen_1 = __webpack_require__(78380);
const names_1 = __webpack_require__(25668);
const resolve_1 = __webpack_require__(20394);
const util_1 = __webpack_require__(75280);
const errors_1 = __webpack_require__(26990);
// schema compilation - generates validation function, subschemaCode (below) is used for subschemas
function validateFunctionCode(it) {
    if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
            topSchemaObjCode(it);
            return;
        }
    }
    validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
}
exports.validateFunctionCode = validateFunctionCode;
function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
    if (opts.code.es5) {
        gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
            gen.code((0, codegen_1._) `"use strict"; ${funcSourceUrl(schema, opts)}`);
            destructureValCxtES5(gen, opts);
            gen.code(body);
        });
    }
    else {
        gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
    }
}
function destructureValCxt(opts) {
    return (0, codegen_1._) `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
}
function destructureValCxtES5(gen, opts) {
    gen.if(names_1.default.valCxt, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`);
        gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
        gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`);
        if (opts.dynamicRef)
            gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
    }, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._) `""`);
        gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`);
        gen.var(names_1.default.rootData, names_1.default.data);
        if (opts.dynamicRef)
            gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`);
    });
}
function topSchemaObjCode(it) {
    const { schema, opts, gen } = it;
    validateFunction(it, () => {
        if (opts.$comment && schema.$comment)
            commentKeyword(it);
        checkNoDefault(it);
        gen.let(names_1.default.vErrors, null);
        gen.let(names_1.default.errors, 0);
        if (opts.unevaluated)
            resetEvaluated(it);
        typeAndKeywords(it);
        returnResults(it);
    });
    return;
}
function resetEvaluated(it) {
    // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated
    const { gen, validateName } = it;
    it.evaluated = gen.const("evaluated", (0, codegen_1._) `${validateName}.evaluated`);
    gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`));
    gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`));
}
function funcSourceUrl(schema, opts) {
    const schId = typeof schema == "object" && schema[opts.schemaId];
    return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil;
}
// schema compilation - this function is used recursively to generate code for sub-schemas
function subschemaCode(it, valid) {
    if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
            subSchemaObjCode(it, valid);
            return;
        }
    }
    (0, boolSchema_1.boolOrEmptySchema)(it, valid);
}
function schemaCxtHasRules({ schema, self }) {
    if (typeof schema == "boolean")
        return !schema;
    for (const key in schema)
        if (self.RULES.all[key])
            return true;
    return false;
}
function isSchemaObj(it) {
    return typeof it.schema != "boolean";
}
function subSchemaObjCode(it, valid) {
    const { schema, gen, opts } = it;
    if (opts.$comment && schema.$comment)
        commentKeyword(it);
    updateContext(it);
    checkAsyncSchema(it);
    const errsCount = gen.const("_errs", names_1.default.errors);
    typeAndKeywords(it, errsCount);
    // TODO var
    gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
}
function checkKeywords(it) {
    (0, util_1.checkUnknownRules)(it);
    checkRefsAndKeywords(it);
}
function typeAndKeywords(it, errsCount) {
    if (it.opts.jtd)
        return schemaKeywords(it, [], false, errsCount);
    const types = (0, dataType_1.getSchemaTypes)(it.schema);
    const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
    schemaKeywords(it, types, !checkedTypes, errsCount);
}
function checkRefsAndKeywords(it) {
    const { schema, errSchemaPath, opts, self } = it;
    if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
        self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
    }
}
function checkNoDefault(it) {
    const { schema, opts } = it;
    if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {
        (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
    }
}
function updateContext(it) {
    const schId = it.schema[it.opts.schemaId];
    if (schId)
        it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
}
function checkAsyncSchema(it) {
    if (it.schema.$async && !it.schemaEnv.$async)
        throw new Error("async schema in sync schema");
}
function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
    const msg = schema.$comment;
    if (opts.$comment === true) {
        gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`);
    }
    else if (typeof opts.$comment == "function") {
        const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`;
        const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
        gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
    }
}
function returnResults(it) {
    const { gen, schemaEnv, validateName, ValidationError, opts } = it;
    if (schemaEnv.$async) {
        // TODO assign unevaluated
        gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`));
    }
    else {
        gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors);
        if (opts.unevaluated)
            assignEvaluated(it);
        gen.return((0, codegen_1._) `${names_1.default.errors} === 0`);
    }
}
function assignEvaluated({ gen, evaluated, props, items }) {
    if (props instanceof codegen_1.Name)
        gen.assign((0, codegen_1._) `${evaluated}.props`, props);
    if (items instanceof codegen_1.Name)
        gen.assign((0, codegen_1._) `${evaluated}.items`, items);
}
function schemaKeywords(it, types, typeErrors, errsCount) {
    const { gen, schema, data, allErrors, opts, self } = it;
    const { RULES } = self;
    if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {
        gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast
        return;
    }
    if (!opts.jtd)
        checkStrictTypes(it, types);
    gen.block(() => {
        for (const group of RULES.rules)
            groupKeywords(group);
        groupKeywords(RULES.post);
    });
    function groupKeywords(group) {
        if (!(0, applicability_1.shouldUseGroup)(schema, group))
            return;
        if (group.type) {
            gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
            iterateKeywords(it, group);
            if (types.length === 1 && types[0] === group.type && typeErrors) {
                gen.else();
                (0, dataType_2.reportTypeError)(it);
            }
            gen.endIf();
        }
        else {
            iterateKeywords(it, group);
        }
        // TODO make it "ok" call?
        if (!allErrors)
            gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`);
    }
}
function iterateKeywords(it, group) {
    const { gen, schema, opts: { useDefaults }, } = it;
    if (useDefaults)
        (0, defaults_1.assignDefaults)(it, group.type);
    gen.block(() => {
        for (const rule of group.rules) {
            if ((0, applicability_1.shouldUseRule)(schema, rule)) {
                keywordCode(it, rule.keyword, rule.definition, group.type);
            }
        }
    });
}
function checkStrictTypes(it, types) {
    if (it.schemaEnv.meta || !it.opts.strictTypes)
        return;
    checkContextTypes(it, types);
    if (!it.opts.allowUnionTypes)
        checkMultipleTypes(it, types);
    checkKeywordTypes(it, it.dataTypes);
}
function checkContextTypes(it, types) {
    if (!types.length)
        return;
    if (!it.dataTypes.length) {
        it.dataTypes = types;
        return;
    }
    types.forEach((t) => {
        if (!includesType(it.dataTypes, t)) {
            strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
        }
    });
    narrowSchemaTypes(it, types);
}
function checkMultipleTypes(it, ts) {
    if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
        strictTypesError(it, "use allowUnionTypes to allow union type keyword");
    }
}
function checkKeywordTypes(it, ts) {
    const rules = it.self.RULES.all;
    for (const keyword in rules) {
        const rule = rules[keyword];
        if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
            const { type } = rule.definition;
            if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
                strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
            }
        }
    }
}
function hasApplicableType(schTs, kwdT) {
    return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer"));
}
function includesType(ts, t) {
    return ts.includes(t) || (t === "integer" && ts.includes("number"));
}
function narrowSchemaTypes(it, withTypes) {
    const ts = [];
    for (const t of it.dataTypes) {
        if (includesType(withTypes, t))
            ts.push(t);
        else if (withTypes.includes("integer") && t === "number")
            ts.push("integer");
    }
    it.dataTypes = ts;
}
function strictTypesError(it, msg) {
    const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
    msg += ` at "${schemaPath}" (strictTypes)`;
    (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
}
class KeywordCxt {
    constructor(it, def, keyword) {
        (0, keyword_1.validateKeywordUsage)(it, def, keyword);
        this.gen = it.gen;
        this.allErrors = it.allErrors;
        this.keyword = keyword;
        this.data = it.data;
        this.schema = it.schema[keyword];
        this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
        this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);
        this.schemaType = def.schemaType;
        this.parentSchema = it.schema;
        this.params = {};
        this.it = it;
        this.def = def;
        if (this.$data) {
            this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
        }
        else {
            this.schemaCode = this.schemaValue;
            if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
                throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);
            }
        }
        if ("code" in def ? def.trackErrors : def.errors !== false) {
            this.errsCount = it.gen.const("_errs", names_1.default.errors);
        }
    }
    result(condition, successAction, failAction) {
        this.failResult((0, codegen_1.not)(condition), successAction, failAction);
    }
    failResult(condition, successAction, failAction) {
        this.gen.if(condition);
        if (failAction)
            failAction();
        else
            this.error();
        if (successAction) {
            this.gen.else();
            successAction();
            if (this.allErrors)
                this.gen.endIf();
        }
        else {
            if (this.allErrors)
                this.gen.endIf();
            else
                this.gen.else();
        }
    }
    pass(condition, failAction) {
        this.failResult((0, codegen_1.not)(condition), undefined, failAction);
    }
    fail(condition) {
        if (condition === undefined) {
            this.error();
            if (!this.allErrors)
                this.gen.if(false); // this branch will be removed by gen.optimize
            return;
        }
        this.gen.if(condition);
        this.error();
        if (this.allErrors)
            this.gen.endIf();
        else
            this.gen.else();
    }
    fail$data(condition) {
        if (!this.$data)
            return this.fail(condition);
        const { schemaCode } = this;
        this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
    }
    error(append, errorParams, errorPaths) {
        if (errorParams) {
            this.setParams(errorParams);
            this._error(append, errorPaths);
            this.setParams({});
            return;
        }
        this._error(append, errorPaths);
    }
    _error(append, errorPaths) {
        ;
        (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
    }
    $dataError() {
        (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
    }
    reset() {
        if (this.errsCount === undefined)
            throw new Error('add "trackErrors" to keyword definition');
        (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
    }
    ok(cond) {
        if (!this.allErrors)
            this.gen.if(cond);
    }
    setParams(obj, assign) {
        if (assign)
            Object.assign(this.params, obj);
        else
            this.params = obj;
    }
    block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
        this.gen.block(() => {
            this.check$data(valid, $dataValid);
            codeBlock();
        });
    }
    check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
        if (!this.$data)
            return;
        const { gen, schemaCode, schemaType, def } = this;
        gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));
        if (valid !== codegen_1.nil)
            gen.assign(valid, true);
        if (schemaType.length || def.validateSchema) {
            gen.elseIf(this.invalid$data());
            this.$dataError();
            if (valid !== codegen_1.nil)
                gen.assign(valid, false);
        }
        gen.else();
    }
    invalid$data() {
        const { gen, schemaCode, schemaType, def, it } = this;
        return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
        function wrong$DataType() {
            if (schemaType.length) {
                /* istanbul ignore if */
                if (!(schemaCode instanceof codegen_1.Name))
                    throw new Error("ajv implementation error");
                const st = Array.isArray(schemaType) ? schemaType : [schemaType];
                return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
            }
            return codegen_1.nil;
        }
        function invalid$DataSchema() {
            if (def.validateSchema) {
                const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone
                return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`;
            }
            return codegen_1.nil;
        }
    }
    subschema(appl, valid) {
        const subschema = (0, subschema_1.getSubschema)(this.it, appl);
        (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);
        (0, subschema_1.extendSubschemaMode)(subschema, appl);
        const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined };
        subschemaCode(nextContext, valid);
        return nextContext;
    }
    mergeEvaluated(schemaCxt, toName) {
        const { it, gen } = this;
        if (!it.opts.unevaluated)
            return;
        if (it.props !== true && schemaCxt.props !== undefined) {
            it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
        }
        if (it.items !== true && schemaCxt.items !== undefined) {
            it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
        }
    }
    mergeValidEvaluated(schemaCxt, valid) {
        const { it, gen } = this;
        if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
            gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
            return true;
        }
    }
}
exports.KeywordCxt = KeywordCxt;
function keywordCode(it, keyword, def, ruleType) {
    const cxt = new KeywordCxt(it, def, keyword);
    if ("code" in def) {
        def.code(cxt, ruleType);
    }
    else if (cxt.$data && def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
    }
    else if ("macro" in def) {
        (0, keyword_1.macroKeywordCode)(cxt, def);
    }
    else if (def.compile || def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
    }
}
const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
function getData($data, { dataLevel, dataNames, dataPathArr }) {
    let jsonPointer;
    let data;
    if ($data === "")
        return names_1.default.rootData;
    if ($data[0] === "/") {
        if (!JSON_POINTER.test($data))
            throw new Error(`Invalid JSON-pointer: ${$data}`);
        jsonPointer = $data;
        data = names_1.default.rootData;
    }
    else {
        const matches = RELATIVE_JSON_POINTER.exec($data);
        if (!matches)
            throw new Error(`Invalid JSON-pointer: ${$data}`);
        const up = +matches[1];
        jsonPointer = matches[2];
        if (jsonPointer === "#") {
            if (up >= dataLevel)
                throw new Error(errorMsg("property/index", up));
            return dataPathArr[dataLevel - up];
        }
        if (up > dataLevel)
            throw new Error(errorMsg("data", up));
        data = dataNames[dataLevel - up];
        if (!jsonPointer)
            return data;
    }
    let expr = data;
    const segments = jsonPointer.split("/");
    for (const segment of segments) {
        if (segment) {
            data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;
            expr = (0, codegen_1._) `${expr} && ${data}`;
        }
    }
    return expr;
    function errorMsg(pointerType, up) {
        return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
    }
}
exports.getData = getData;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 34705:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;
const codegen_1 = __webpack_require__(78380);
const names_1 = __webpack_require__(25668);
const code_1 = __webpack_require__(36461);
const errors_1 = __webpack_require__(26990);
function macroKeywordCode(cxt, def) {
    const { gen, keyword, schema, parentSchema, it } = cxt;
    const macroSchema = def.macro.call(it.self, schema, parentSchema, it);
    const schemaRef = useKeyword(gen, keyword, macroSchema);
    if (it.opts.validateSchema !== false)
        it.self.validateSchema(macroSchema, true);
    const valid = gen.name("valid");
    cxt.subschema({
        schema: macroSchema,
        schemaPath: codegen_1.nil,
        errSchemaPath: `${it.errSchemaPath}/${keyword}`,
        topSchemaRef: schemaRef,
        compositeRule: true,
    }, valid);
    cxt.pass(valid, () => cxt.error(true));
}
exports.macroKeywordCode = macroKeywordCode;
function funcKeywordCode(cxt, def) {
    var _a;
    const { gen, keyword, schema, parentSchema, $data, it } = cxt;
    checkAsyncKeyword(it, def);
    const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
    const validateRef = useKeyword(gen, keyword, validate);
    const valid = gen.let("valid");
    cxt.block$data(valid, validateKeyword);
    cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);
    function validateKeyword() {
        if (def.errors === false) {
            assignValid();
            if (def.modifying)
                modifyData(cxt);
            reportErrs(() => cxt.error());
        }
        else {
            const ruleErrs = def.async ? validateAsync() : validateSync();
            if (def.modifying)
                modifyData(cxt);
            reportErrs(() => addErrs(cxt, ruleErrs));
        }
    }
    function validateAsync() {
        const ruleErrs = gen.let("ruleErrs", null);
        gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e)));
        return ruleErrs;
    }
    function validateSync() {
        const validateErrs = (0, codegen_1._) `${validateRef}.errors`;
        gen.assign(validateErrs, null);
        assignValid(codegen_1.nil);
        return validateErrs;
    }
    function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) {
        const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
        const passSchema = !(("compile" in def && !$data) || def.schema === false);
        gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
    }
    function reportErrs(errors) {
        var _a;
        gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);
    }
}
exports.funcKeywordCode = funcKeywordCode;
function modifyData(cxt) {
    const { gen, data, it } = cxt;
    gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`));
}
function addErrs(cxt, errs) {
    const { gen } = cxt;
    gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => {
        gen
            .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)
            .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);
        (0, errors_1.extendErrors)(cxt);
    }, () => cxt.error());
}
function checkAsyncKeyword({ schemaEnv }, def) {
    if (def.async && !schemaEnv.$async)
        throw new Error("async keyword in sync schema");
}
function useKeyword(gen, keyword, result) {
    if (result === undefined)
        throw new Error(`keyword "${keyword}" failed to compile`);
    return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
}
function validSchemaType(schema, schemaType, allowUndefined = false) {
    // TODO add tests
    return (!schemaType.length ||
        schemaType.some((st) => st === "array"
            ? Array.isArray(schema)
            : st === "object"
                ? schema && typeof schema == "object" && !Array.isArray(schema)
                : typeof schema == st || (allowUndefined && typeof schema == "undefined")));
}
exports.validSchemaType = validSchemaType;
function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
    /* istanbul ignore if */
    if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
        throw new Error("ajv implementation error");
    }
    const deps = def.dependencies;
    if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {
        throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
    }
    if (def.validateSchema) {
        const valid = def.validateSchema(schema[keyword]);
        if (!valid) {
            const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` +
                self.errorsText(def.validateSchema.errors);
            if (opts.validateSchema === "log")
                self.logger.error(msg);
            else
                throw new Error(msg);
        }
    }
}
exports.validateKeywordUsage = validateKeywordUsage;
//# sourceMappingURL=keyword.js.map

/***/ }),

/***/ 88171:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
    if (keyword !== undefined && schema !== undefined) {
        throw new Error('both "keyword" and "schema" passed, only one allowed');
    }
    if (keyword !== undefined) {
        const sch = it.schema[keyword];
        return schemaProp === undefined
            ? {
                schema: sch,
                schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,
                errSchemaPath: `${it.errSchemaPath}/${keyword}`,
            }
            : {
                schema: sch[schemaProp],
                schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,
                errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,
            };
    }
    if (schema !== undefined) {
        if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
            throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
        }
        return {
            schema,
            schemaPath,
            topSchemaRef,
            errSchemaPath,
        };
    }
    throw new Error('either "keyword" or "schema" must be passed');
}
exports.getSubschema = getSubschema;
function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
    if (data !== undefined && dataProp !== undefined) {
        throw new Error('both "data" and "dataProp" passed, only one allowed');
    }
    const { gen } = it;
    if (dataProp !== undefined) {
        const { errorPath, dataPathArr, opts } = it;
        const nextData = gen.let("data", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);
        dataContextProps(nextData);
        subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
        subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;
        subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
    }
    if (data !== undefined) {
        const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once?
        dataContextProps(nextData);
        if (propertyName !== undefined)
            subschema.propertyName = propertyName;
        // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr
    }
    if (dataTypes)
        subschema.dataTypes = dataTypes;
    function dataContextProps(_nextData) {
        subschema.data = _nextData;
        subschema.dataLevel = it.dataLevel + 1;
        subschema.dataTypes = [];
        it.definedProperties = new Set();
        subschema.parentData = it.data;
        subschema.dataNames = [...it.dataNames, _nextData];
    }
}
exports.extendSubschemaData = extendSubschemaData;
function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
    if (compositeRule !== undefined)
        subschema.compositeRule = compositeRule;
    if (createErrors !== undefined)
        subschema.createErrors = createErrors;
    if (allErrors !== undefined)
        subschema.allErrors = allErrors;
    subschema.jtdDiscriminator = jtdDiscriminator; // not inherited
    subschema.jtdMetadata = jtdMetadata; // not inherited
}
exports.extendSubschemaMode = extendSubschemaMode;
//# sourceMappingURL=subschema.js.map

/***/ }),

/***/ 42089:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
var validate_1 = __webpack_require__(58941);
Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } }));
var codegen_1 = __webpack_require__(78380);
Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } }));
Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } }));
Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } }));
Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } }));
Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } }));
Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } }));
const validation_error_1 = __webpack_require__(52582);
const ref_error_1 = __webpack_require__(61326);
const rules_1 = __webpack_require__(68817);
const compile_1 = __webpack_require__(56862);
const codegen_2 = __webpack_require__(78380);
const resolve_1 = __webpack_require__(20394);
const dataType_1 = __webpack_require__(24307);
const util_1 = __webpack_require__(75280);
const $dataRefSchema = __webpack_require__(80705);
const uri_1 = __webpack_require__(63886);
const defaultRegExp = (str, flags) => new RegExp(str, flags);
defaultRegExp.code = "new RegExp";
const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
const EXT_SCOPE_NAMES = new Set([
    "validate",
    "serialize",
    "parse",
    "wrapper",
    "root",
    "schema",
    "keyword",
    "pattern",
    "formats",
    "validate$data",
    "func",
    "obj",
    "Error",
]);
const removedOptions = {
    errorDataPath: "",
    format: "`validateFormats: false` can be used instead.",
    nullable: '"nullable" keyword is supported by default.',
    jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
    extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
    missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
    processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
    sourceCode: "Use option `code: {source: true}`",
    strictDefaults: "It is default now, see option `strict`.",
    strictKeywords: "It is default now, see option `strict`.",
    uniqueItems: '"uniqueItems" keyword is always validated.',
    unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
    cache: "Map is used as cache, schema object as key.",
    serialize: "Map is used as cache, schema object as key.",
    ajvErrors: "It is default now.",
};
const deprecatedOptions = {
    ignoreKeywordsWithRef: "",
    jsPropertySyntax: "",
    unicode: '"minLength"/"maxLength" account for unicode characters by default.',
};
const MAX_EXPRESSION = 200;
// eslint-disable-next-line complexity
function requiredOptions(o) {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
    const s = o.strict;
    const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
    const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;
    const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
    const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
    return {
        strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
        strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
        strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
        strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
        strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
        code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
        loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
        loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
        meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
        messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
        inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
        schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
        addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
        validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
        validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
        unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
        int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
        uriResolver: uriResolver,
    };
}
class Ajv {
    constructor(opts = {}) {
        this.schemas = {};
        this.refs = {};
        this.formats = {};
        this._compilations = new Set();
        this._loading = {};
        this._cache = new Map();
        opts = this.opts = { ...opts, ...requiredOptions(opts) };
        const { es5, lines } = this.opts.code;
        this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
        this.logger = getLogger(opts.logger);
        const formatOpt = opts.validateFormats;
        opts.validateFormats = false;
        this.RULES = (0, rules_1.getRules)();
        checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
        checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
        this._metaOpts = getMetaSchemaOptions.call(this);
        if (opts.formats)
            addInitialFormats.call(this);
        this._addVocabularies();
        this._addDefaultMetaSchema();
        if (opts.keywords)
            addInitialKeywords.call(this, opts.keywords);
        if (typeof opts.meta == "object")
            this.addMetaSchema(opts.meta);
        addInitialSchemas.call(this);
        opts.validateFormats = formatOpt;
    }
    _addVocabularies() {
        this.addKeyword("$async");
    }
    _addDefaultMetaSchema() {
        const { $data, meta, schemaId } = this.opts;
        let _dataRefSchema = $dataRefSchema;
        if (schemaId === "id") {
            _dataRefSchema = { ...$dataRefSchema };
            _dataRefSchema.id = _dataRefSchema.$id;
            delete _dataRefSchema.$id;
        }
        if (meta && $data)
            this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
    }
    defaultMeta() {
        const { meta, schemaId } = this.opts;
        return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined);
    }
    validate(schemaKeyRef, // key, ref or schema object
    // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
    data // to be validated
    ) {
        let v;
        if (typeof schemaKeyRef == "string") {
            v = this.getSchema(schemaKeyRef);
            if (!v)
                throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
        }
        else {
            v = this.compile(schemaKeyRef);
        }
        const valid = v(data);
        if (!("$async" in v))
            this.errors = v.errors;
        return valid;
    }
    compile(schema, _meta) {
        const sch = this._addSchema(schema, _meta);
        return (sch.validate || this._compileSchemaEnv(sch));
    }
    compileAsync(schema, meta) {
        if (typeof this.opts.loadSchema != "function") {
            throw new Error("options.loadSchema should be a function");
        }
        const { loadSchema } = this.opts;
        return runCompileAsync.call(this, schema, meta);
        async function runCompileAsync(_schema, _meta) {
            await loadMetaSchema.call(this, _schema.$schema);
            const sch = this._addSchema(_schema, _meta);
            return sch.validate || _compileAsync.call(this, sch);
        }
        async function loadMetaSchema($ref) {
            if ($ref && !this.getSchema($ref)) {
                await runCompileAsync.call(this, { $ref }, true);
            }
        }
        async function _compileAsync(sch) {
            try {
                return this._compileSchemaEnv(sch);
            }
            catch (e) {
                if (!(e instanceof ref_error_1.default))
                    throw e;
                checkLoaded.call(this, e);
                await loadMissingSchema.call(this, e.missingSchema);
                return _compileAsync.call(this, sch);
            }
        }
        function checkLoaded({ missingSchema: ref, missingRef }) {
            if (this.refs[ref]) {
                throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
            }
        }
        async function loadMissingSchema(ref) {
            const _schema = await _loadSchema.call(this, ref);
            if (!this.refs[ref])
                await loadMetaSchema.call(this, _schema.$schema);
            if (!this.refs[ref])
                this.addSchema(_schema, ref, meta);
        }
        async function _loadSchema(ref) {
            const p = this._loading[ref];
            if (p)
                return p;
            try {
                return await (this._loading[ref] = loadSchema(ref));
            }
            finally {
                delete this._loading[ref];
            }
        }
    }
    // Adds schema to the instance
    addSchema(schema, // If array is passed, `key` will be ignored
    key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
    _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
    _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.
    ) {
        if (Array.isArray(schema)) {
            for (const sch of schema)
                this.addSchema(sch, undefined, _meta, _validateSchema);
            return this;
        }
        let id;
        if (typeof schema === "object") {
            const { schemaId } = this.opts;
            id = schema[schemaId];
            if (id !== undefined && typeof id != "string") {
                throw new Error(`schema ${schemaId} must be string`);
            }
        }
        key = (0, resolve_1.normalizeId)(key || id);
        this._checkUnique(key);
        this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
        return this;
    }
    // Add schema that will be used to validate other schemas
    // options in META_IGNORE_OPTIONS are alway set to false
    addMetaSchema(schema, key, // schema key
    _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema
    ) {
        this.addSchema(schema, key, true, _validateSchema);
        return this;
    }
    //  Validate schema against its meta-schema
    validateSchema(schema, throwOrLogError) {
        if (typeof schema == "boolean")
            return true;
        let $schema;
        $schema = schema.$schema;
        if ($schema !== undefined && typeof $schema != "string") {
            throw new Error("$schema must be a string");
        }
        $schema = $schema || this.opts.defaultMeta || this.defaultMeta();
        if (!$schema) {
            this.logger.warn("meta-schema not available");
            this.errors = null;
            return true;
        }
        const valid = this.validate($schema, schema);
        if (!valid && throwOrLogError) {
            const message = "schema is invalid: " + this.errorsText();
            if (this.opts.validateSchema === "log")
                this.logger.error(message);
            else
                throw new Error(message);
        }
        return valid;
    }
    // Get compiled schema by `key` or `ref`.
    // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
    getSchema(keyRef) {
        let sch;
        while (typeof (sch = getSchEnv.call(this, keyRef)) == "string")
            keyRef = sch;
        if (sch === undefined) {
            const { schemaId } = this.opts;
            const root = new compile_1.SchemaEnv({ schema: {}, schemaId });
            sch = compile_1.resolveSchema.call(this, root, keyRef);
            if (!sch)
                return;
            this.refs[keyRef] = sch;
        }
        return (sch.validate || this._compileSchemaEnv(sch));
    }
    // Remove cached schema(s).
    // If no parameter is passed all schemas but meta-schemas are removed.
    // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
    // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
    removeSchema(schemaKeyRef) {
        if (schemaKeyRef instanceof RegExp) {
            this._removeAllSchemas(this.schemas, schemaKeyRef);
            this._removeAllSchemas(this.refs, schemaKeyRef);
            return this;
        }
        switch (typeof schemaKeyRef) {
            case "undefined":
                this._removeAllSchemas(this.schemas);
                this._removeAllSchemas(this.refs);
                this._cache.clear();
                return this;
            case "string": {
                const sch = getSchEnv.call(this, schemaKeyRef);
                if (typeof sch == "object")
                    this._cache.delete(sch.schema);
                delete this.schemas[schemaKeyRef];
                delete this.refs[schemaKeyRef];
                return this;
            }
            case "object": {
                const cacheKey = schemaKeyRef;
                this._cache.delete(cacheKey);
                let id = schemaKeyRef[this.opts.schemaId];
                if (id) {
                    id = (0, resolve_1.normalizeId)(id);
                    delete this.schemas[id];
                    delete this.refs[id];
                }
                return this;
            }
            default:
                throw new Error("ajv.removeSchema: invalid parameter");
        }
    }
    // add "vocabulary" - a collection of keywords
    addVocabulary(definitions) {
        for (const def of definitions)
            this.addKeyword(def);
        return this;
    }
    addKeyword(kwdOrDef, def // deprecated
    ) {
        let keyword;
        if (typeof kwdOrDef == "string") {
            keyword = kwdOrDef;
            if (typeof def == "object") {
                this.logger.warn("these parameters are deprecated, see docs for addKeyword");
                def.keyword = keyword;
            }
        }
        else if (typeof kwdOrDef == "object" && def === undefined) {
            def = kwdOrDef;
            keyword = def.keyword;
            if (Array.isArray(keyword) && !keyword.length) {
                throw new Error("addKeywords: keyword must be string or non-empty array");
            }
        }
        else {
            throw new Error("invalid addKeywords parameters");
        }
        checkKeyword.call(this, keyword, def);
        if (!def) {
            (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));
            return this;
        }
        keywordMetaschema.call(this, def);
        const definition = {
            ...def,
            type: (0, dataType_1.getJSONTypes)(def.type),
            schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),
        };
        (0, util_1.eachItem)(keyword, definition.type.length === 0
            ? (k) => addRule.call(this, k, definition)
            : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
        return this;
    }
    getKeyword(keyword) {
        const rule = this.RULES.all[keyword];
        return typeof rule == "object" ? rule.definition : !!rule;
    }
    // Remove keyword
    removeKeyword(keyword) {
        // TODO return type should be Ajv
        const { RULES } = this;
        delete RULES.keywords[keyword];
        delete RULES.all[keyword];
        for (const group of RULES.rules) {
            const i = group.rules.findIndex((rule) => rule.keyword === keyword);
            if (i >= 0)
                group.rules.splice(i, 1);
        }
        return this;
    }
    // Add format
    addFormat(name, format) {
        if (typeof format == "string")
            format = new RegExp(format);
        this.formats[name] = format;
        return this;
    }
    errorsText(errors = this.errors, // optional array of validation errors
    { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar`
    ) {
        if (!errors || errors.length === 0)
            return "No errors";
        return errors
            .map((e) => `${dataVar}${e.instancePath} ${e.message}`)
            .reduce((text, msg) => text + separator + msg);
    }
    $dataMetaSchema(metaSchema, keywordsJsonPointers) {
        const rules = this.RULES.all;
        metaSchema = JSON.parse(JSON.stringify(metaSchema));
        for (const jsonPointer of keywordsJsonPointers) {
            const segments = jsonPointer.split("/").slice(1); // first segment is an empty string
            let keywords = metaSchema;
            for (const seg of segments)
                keywords = keywords[seg];
            for (const key in rules) {
                const rule = rules[key];
                if (typeof rule != "object")
                    continue;
                const { $data } = rule.definition;
                const schema = keywords[key];
                if ($data && schema)
                    keywords[key] = schemaOrData(schema);
            }
        }
        return metaSchema;
    }
    _removeAllSchemas(schemas, regex) {
        for (const keyRef in schemas) {
            const sch = schemas[keyRef];
            if (!regex || regex.test(keyRef)) {
                if (typeof sch == "string") {
                    delete schemas[keyRef];
                }
                else if (sch && !sch.meta) {
                    this._cache.delete(sch.schema);
                    delete schemas[keyRef];
                }
            }
        }
    }
    _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
        let id;
        const { schemaId } = this.opts;
        if (typeof schema == "object") {
            id = schema[schemaId];
        }
        else {
            if (this.opts.jtd)
                throw new Error("schema must be object");
            else if (typeof schema != "boolean")
                throw new Error("schema must be object or boolean");
        }
        let sch = this._cache.get(schema);
        if (sch !== undefined)
            return sch;
        baseId = (0, resolve_1.normalizeId)(id || baseId);
        const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
        sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });
        this._cache.set(sch.schema, sch);
        if (addSchema && !baseId.startsWith("#")) {
            // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)
            if (baseId)
                this._checkUnique(baseId);
            this.refs[baseId] = sch;
        }
        if (validateSchema)
            this.validateSchema(schema, true);
        return sch;
    }
    _checkUnique(id) {
        if (this.schemas[id] || this.refs[id]) {
            throw new Error(`schema with key or id "${id}" already exists`);
        }
    }
    _compileSchemaEnv(sch) {
        if (sch.meta)
            this._compileMetaSchema(sch);
        else
            compile_1.compileSchema.call(this, sch);
        /* istanbul ignore if */
        if (!sch.validate)
            throw new Error("ajv implementation error");
        return sch.validate;
    }
    _compileMetaSchema(sch) {
        const currentOpts = this.opts;
        this.opts = this._metaOpts;
        try {
            compile_1.compileSchema.call(this, sch);
        }
        finally {
            this.opts = currentOpts;
        }
    }
}
Ajv.ValidationError = validation_error_1.default;
Ajv.MissingRefError = ref_error_1.default;
exports["default"] = Ajv;
function checkOptions(checkOpts, options, msg, log = "error") {
    for (const key in checkOpts) {
        const opt = key;
        if (opt in options)
            this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
    }
}
function getSchEnv(keyRef) {
    keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line
    return this.schemas[keyRef] || this.refs[keyRef];
}
function addInitialSchemas() {
    const optsSchemas = this.opts.schemas;
    if (!optsSchemas)
        return;
    if (Array.isArray(optsSchemas))
        this.addSchema(optsSchemas);
    else
        for (const key in optsSchemas)
            this.addSchema(optsSchemas[key], key);
}
function addInitialFormats() {
    for (const name in this.opts.formats) {
        const format = this.opts.formats[name];
        if (format)
            this.addFormat(name, format);
    }
}
function addInitialKeywords(defs) {
    if (Array.isArray(defs)) {
        this.addVocabulary(defs);
        return;
    }
    this.logger.warn("keywords option as map is deprecated, pass array");
    for (const keyword in defs) {
        const def = defs[keyword];
        if (!def.keyword)
            def.keyword = keyword;
        this.addKeyword(def);
    }
}
function getMetaSchemaOptions() {
    const metaOpts = { ...this.opts };
    for (const opt of META_IGNORE_OPTIONS)
        delete metaOpts[opt];
    return metaOpts;
}
const noLogs = { log() { }, warn() { }, error() { } };
function getLogger(logger) {
    if (logger === false)
        return noLogs;
    if (logger === undefined)
        return console;
    if (logger.log && logger.warn && logger.error)
        return logger;
    throw new Error("logger must implement log, warn and error methods");
}
const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
function checkKeyword(keyword, def) {
    const { RULES } = this;
    (0, util_1.eachItem)(keyword, (kwd) => {
        if (RULES.keywords[kwd])
            throw new Error(`Keyword ${kwd} is already defined`);
        if (!KEYWORD_NAME.test(kwd))
            throw new Error(`Keyword ${kwd} has invalid name`);
    });
    if (!def)
        return;
    if (def.$data && !("code" in def || "validate" in def)) {
        throw new Error('$data keyword must have "code" or "validate" function');
    }
}
function addRule(keyword, definition, dataType) {
    var _a;
    const post = definition === null || definition === void 0 ? void 0 : definition.post;
    if (dataType && post)
        throw new Error('keyword with "post" flag cannot have "type"');
    const { RULES } = this;
    let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
    if (!ruleGroup) {
        ruleGroup = { type: dataType, rules: [] };
        RULES.rules.push(ruleGroup);
    }
    RULES.keywords[keyword] = true;
    if (!definition)
        return;
    const rule = {
        keyword,
        definition: {
            ...definition,
            type: (0, dataType_1.getJSONTypes)(definition.type),
            schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),
        },
    };
    if (definition.before)
        addBeforeRule.call(this, ruleGroup, rule, definition.before);
    else
        ruleGroup.rules.push(rule);
    RULES.all[keyword] = rule;
    (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
}
function addBeforeRule(ruleGroup, rule, before) {
    const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
    if (i >= 0) {
        ruleGroup.rules.splice(i, 0, rule);
    }
    else {
        ruleGroup.rules.push(rule);
        this.logger.warn(`rule ${before} is not defined`);
    }
}
function keywordMetaschema(def) {
    let { metaSchema } = def;
    if (metaSchema === undefined)
        return;
    if (def.$data && this.opts.$data)
        metaSchema = schemaOrData(metaSchema);
    def.validateSchema = this.compile(metaSchema, true);
}
const $dataRef = {
    $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
};
function schemaOrData(schema) {
    return { anyOf: [schema, $dataRef] };
}
//# sourceMappingURL=core.js.map

/***/ }),

/***/ 16898:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
// https://github.com/ajv-validator/ajv/issues/889
const equal = __webpack_require__(66471);
equal.code = 'require("ajv/dist/runtime/equal").default';
exports["default"] = equal;
//# sourceMappingURL=equal.js.map

/***/ }),

/***/ 59228:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
// https://mathiasbynens.be/notes/javascript-encoding
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
function ucs2length(str) {
    const len = str.length;
    let length = 0;
    let pos = 0;
    let value;
    while (pos < len) {
        length++;
        value = str.charCodeAt(pos++);
        if (value >= 0xd800 && value <= 0xdbff && pos < len) {
            // high surrogate, and there is a next character
            value = str.charCodeAt(pos);
            if ((value & 0xfc00) === 0xdc00)
                pos++; // low surrogate
        }
    }
    return length;
}
exports["default"] = ucs2length;
ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
//# sourceMappingURL=ucs2length.js.map

/***/ }),

/***/ 63886:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const uri = __webpack_require__(83745);
uri.code = 'require("ajv/dist/runtime/uri").default';
exports["default"] = uri;
//# sourceMappingURL=uri.js.map

/***/ }),

/***/ 52582:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
class ValidationError extends Error {
    constructor(errors) {
        super("validation failed");
        this.errors = errors;
        this.ajv = this.validation = true;
    }
}
exports["default"] = ValidationError;
//# sourceMappingURL=validation_error.js.map

/***/ }),

/***/ 26970:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateAdditionalItems = void 0;
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const error = {
    message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
    params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
    keyword: "additionalItems",
    type: "array",
    schemaType: ["boolean", "object"],
    before: "uniqueItems",
    error,
    code(cxt) {
        const { parentSchema, it } = cxt;
        const { items } = parentSchema;
        if (!Array.isArray(items)) {
            (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
            return;
        }
        validateAdditionalItems(cxt, items);
    },
};
function validateAdditionalItems(cxt, items) {
    const { gen, schema, data, keyword, it } = cxt;
    it.items = true;
    const len = gen.const("len", (0, codegen_1._) `${data}.length`);
    if (schema === false) {
        cxt.setParams({ len: items.length });
        cxt.pass((0, codegen_1._) `${len} <= ${items.length}`);
    }
    else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
        const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var
        gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
        cxt.ok(valid);
    }
    function validateItems(valid) {
        gen.forRange("i", items.length, len, (i) => {
            cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
            if (!it.allErrors)
                gen.if((0, codegen_1.not)(valid), () => gen.break());
        });
    }
}
exports.validateAdditionalItems = validateAdditionalItems;
exports["default"] = def;
//# sourceMappingURL=additionalItems.js.map

/***/ }),

/***/ 3077:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const code_1 = __webpack_require__(36461);
const codegen_1 = __webpack_require__(78380);
const names_1 = __webpack_require__(25668);
const util_1 = __webpack_require__(75280);
const error = {
    message: "must NOT have additional properties",
    params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,
};
const def = {
    keyword: "additionalProperties",
    type: ["object"],
    schemaType: ["boolean", "object"],
    allowUndefined: true,
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, schema, parentSchema, data, errsCount, it } = cxt;
        /* istanbul ignore if */
        if (!errsCount)
            throw new Error("ajv implementation error");
        const { allErrors, opts } = it;
        it.props = true;
        if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
            return;
        const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
        const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
        checkAdditionalProperties();
        cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
        function checkAdditionalProperties() {
            gen.forIn("key", data, (key) => {
                if (!props.length && !patProps.length)
                    additionalPropertyCode(key);
                else
                    gen.if(isAdditional(key), () => additionalPropertyCode(key));
            });
        }
        function isAdditional(key) {
            let definedProp;
            if (props.length > 8) {
                // TODO maybe an option instead of hard-coded 8?
                const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
                definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
            }
            else if (props.length) {
                definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));
            }
            else {
                definedProp = codegen_1.nil;
            }
            if (patProps.length) {
                definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
            }
            return (0, codegen_1.not)(definedProp);
        }
        function deleteAdditional(key) {
            gen.code((0, codegen_1._) `delete ${data}[${key}]`);
        }
        function additionalPropertyCode(key) {
            if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) {
                deleteAdditional(key);
                return;
            }
            if (schema === false) {
                cxt.setParams({ additionalProperty: key });
                cxt.error();
                if (!allErrors)
                    gen.break();
                return;
            }
            if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
                const valid = gen.name("valid");
                if (opts.removeAdditional === "failing") {
                    applyAdditionalSchema(key, valid, false);
                    gen.if((0, codegen_1.not)(valid), () => {
                        cxt.reset();
                        deleteAdditional(key);
                    });
                }
                else {
                    applyAdditionalSchema(key, valid);
                    if (!allErrors)
                        gen.if((0, codegen_1.not)(valid), () => gen.break());
                }
            }
        }
        function applyAdditionalSchema(key, valid, errors) {
            const subschema = {
                keyword: "additionalProperties",
                dataProp: key,
                dataPropType: util_1.Type.Str,
            };
            if (errors === false) {
                Object.assign(subschema, {
                    compositeRule: true,
                    createErrors: false,
                    allErrors: false,
                });
            }
            cxt.subschema(subschema, valid);
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=additionalProperties.js.map

/***/ }),

/***/ 22509:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const util_1 = __webpack_require__(75280);
const def = {
    keyword: "allOf",
    schemaType: "array",
    code(cxt) {
        const { gen, schema, it } = cxt;
        /* istanbul ignore if */
        if (!Array.isArray(schema))
            throw new Error("ajv implementation error");
        const valid = gen.name("valid");
        schema.forEach((sch, i) => {
            if ((0, util_1.alwaysValidSchema)(it, sch))
                return;
            const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
            cxt.ok(valid);
            cxt.mergeEvaluated(schCxt);
        });
    },
};
exports["default"] = def;
//# sourceMappingURL=allOf.js.map

/***/ }),

/***/ 30420:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const code_1 = __webpack_require__(36461);
const def = {
    keyword: "anyOf",
    schemaType: "array",
    trackErrors: true,
    code: code_1.validateUnion,
    error: { message: "must match a schema in anyOf" },
};
exports["default"] = def;
//# sourceMappingURL=anyOf.js.map

/***/ }),

/***/ 39194:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const error = {
    message: ({ params: { min, max } }) => max === undefined
        ? (0, codegen_1.str) `must contain at least ${min} valid item(s)`
        : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`,
    params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`,
};
const def = {
    keyword: "contains",
    type: "array",
    schemaType: ["object", "boolean"],
    before: "uniqueItems",
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        let min;
        let max;
        const { minContains, maxContains } = parentSchema;
        if (it.opts.next) {
            min = minContains === undefined ? 1 : minContains;
            max = maxContains;
        }
        else {
            min = 1;
        }
        const len = gen.const("len", (0, codegen_1._) `${data}.length`);
        cxt.setParams({ min, max });
        if (max === undefined && min === 0) {
            (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
            return;
        }
        if (max !== undefined && min > max) {
            (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
            cxt.fail();
            return;
        }
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
            let cond = (0, codegen_1._) `${len} >= ${min}`;
            if (max !== undefined)
                cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`;
            cxt.pass(cond);
            return;
        }
        it.items = true;
        const valid = gen.name("valid");
        if (max === undefined && min === 1) {
            validateItems(valid, () => gen.if(valid, () => gen.break()));
        }
        else if (min === 0) {
            gen.let(valid, true);
            if (max !== undefined)
                gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount);
        }
        else {
            gen.let(valid, false);
            validateItemsWithCount();
        }
        cxt.result(valid, () => cxt.reset());
        function validateItemsWithCount() {
            const schValid = gen.name("_valid");
            const count = gen.let("count", 0);
            validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
        }
        function validateItems(_valid, block) {
            gen.forRange("i", 0, len, (i) => {
                cxt.subschema({
                    keyword: "contains",
                    dataProp: i,
                    dataPropType: util_1.Type.Num,
                    compositeRule: true,
                }, _valid);
                block();
            });
        }
        function checkLimits(count) {
            gen.code((0, codegen_1._) `${count}++`);
            if (max === undefined) {
                gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break());
            }
            else {
                gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break());
                if (min === 1)
                    gen.assign(valid, true);
                else
                    gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true));
            }
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=contains.js.map

/***/ }),

/***/ 84210:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const code_1 = __webpack_require__(36461);
exports.error = {
    message: ({ params: { property, depsCount, deps } }) => {
        const property_ies = depsCount === 1 ? "property" : "properties";
        return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;
    },
    params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},
    missingProperty: ${missingProperty},
    depsCount: ${depsCount},
    deps: ${deps}}`, // TODO change to reference
};
const def = {
    keyword: "dependencies",
    type: "object",
    schemaType: "object",
    error: exports.error,
    code(cxt) {
        const [propDeps, schDeps] = splitDependencies(cxt);
        validatePropertyDeps(cxt, propDeps);
        validateSchemaDeps(cxt, schDeps);
    },
};
function splitDependencies({ schema }) {
    const propertyDeps = {};
    const schemaDeps = {};
    for (const key in schema) {
        if (key === "__proto__")
            continue;
        const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
        deps[key] = schema[key];
    }
    return [propertyDeps, schemaDeps];
}
function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
    const { gen, data, it } = cxt;
    if (Object.keys(propertyDeps).length === 0)
        return;
    const missing = gen.let("missing");
    for (const prop in propertyDeps) {
        const deps = propertyDeps[prop];
        if (deps.length === 0)
            continue;
        const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
        cxt.setParams({
            property: prop,
            depsCount: deps.length,
            deps: deps.join(", "),
        });
        if (it.allErrors) {
            gen.if(hasProperty, () => {
                for (const depProp of deps) {
                    (0, code_1.checkReportMissingProp)(cxt, depProp);
                }
            });
        }
        else {
            gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
            (0, code_1.reportMissingProp)(cxt, missing);
            gen.else();
        }
    }
}
exports.validatePropertyDeps = validatePropertyDeps;
function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
    const { gen, data, keyword, it } = cxt;
    const valid = gen.name("valid");
    for (const prop in schemaDeps) {
        if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
            continue;
        gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {
            const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
            cxt.mergeValidEvaluated(schCxt, valid);
        }, () => gen.var(valid, true) // TODO var
        );
        cxt.ok(valid);
    }
}
exports.validateSchemaDeps = validateSchemaDeps;
exports["default"] = def;
//# sourceMappingURL=dependencies.js.map

/***/ }),

/***/ 59125:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const error = {
    message: ({ params }) => (0, codegen_1.str) `must match "${params.ifClause}" schema`,
    params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`,
};
const def = {
    keyword: "if",
    schemaType: ["object", "boolean"],
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, parentSchema, it } = cxt;
        if (parentSchema.then === undefined && parentSchema.else === undefined) {
            (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored');
        }
        const hasThen = hasSchema(it, "then");
        const hasElse = hasSchema(it, "else");
        if (!hasThen && !hasElse)
            return;
        const valid = gen.let("valid", true);
        const schValid = gen.name("_valid");
        validateIf();
        cxt.reset();
        if (hasThen && hasElse) {
            const ifClause = gen.let("ifClause");
            cxt.setParams({ ifClause });
            gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
        }
        else if (hasThen) {
            gen.if(schValid, validateClause("then"));
        }
        else {
            gen.if((0, codegen_1.not)(schValid), validateClause("else"));
        }
        cxt.pass(valid, () => cxt.error(true));
        function validateIf() {
            const schCxt = cxt.subschema({
                keyword: "if",
                compositeRule: true,
                createErrors: false,
                allErrors: false,
            }, schValid);
            cxt.mergeEvaluated(schCxt);
        }
        function validateClause(keyword, ifClause) {
            return () => {
                const schCxt = cxt.subschema({ keyword }, schValid);
                gen.assign(valid, schValid);
                cxt.mergeValidEvaluated(schCxt, valid);
                if (ifClause)
                    gen.assign(ifClause, (0, codegen_1._) `${keyword}`);
                else
                    cxt.setParams({ ifClause: keyword });
            };
        }
    },
};
function hasSchema(it, keyword) {
    const schema = it.schema[keyword];
    return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema);
}
exports["default"] = def;
//# sourceMappingURL=if.js.map

/***/ }),

/***/ 74810:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const additionalItems_1 = __webpack_require__(26970);
const prefixItems_1 = __webpack_require__(65026);
const items_1 = __webpack_require__(83775);
const items2020_1 = __webpack_require__(65434);
const contains_1 = __webpack_require__(39194);
const dependencies_1 = __webpack_require__(84210);
const propertyNames_1 = __webpack_require__(80217);
const additionalProperties_1 = __webpack_require__(3077);
const properties_1 = __webpack_require__(99474);
const patternProperties_1 = __webpack_require__(48262);
const not_1 = __webpack_require__(27599);
const anyOf_1 = __webpack_require__(30420);
const oneOf_1 = __webpack_require__(71408);
const allOf_1 = __webpack_require__(22509);
const if_1 = __webpack_require__(59125);
const thenElse_1 = __webpack_require__(25246);
function getApplicator(draft2020 = false) {
    const applicator = [
        // any
        not_1.default,
        anyOf_1.default,
        oneOf_1.default,
        allOf_1.default,
        if_1.default,
        thenElse_1.default,
        // object
        propertyNames_1.default,
        additionalProperties_1.default,
        dependencies_1.default,
        properties_1.default,
        patternProperties_1.default,
    ];
    // array
    if (draft2020)
        applicator.push(prefixItems_1.default, items2020_1.default);
    else
        applicator.push(additionalItems_1.default, items_1.default);
    applicator.push(contains_1.default);
    return applicator;
}
exports["default"] = getApplicator;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 83775:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateTuple = void 0;
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const code_1 = __webpack_require__(36461);
const def = {
    keyword: "items",
    type: "array",
    schemaType: ["object", "array", "boolean"],
    before: "uniqueItems",
    code(cxt) {
        const { schema, it } = cxt;
        if (Array.isArray(schema))
            return validateTuple(cxt, "additionalItems", schema);
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        cxt.ok((0, code_1.validateArray)(cxt));
    },
};
function validateTuple(cxt, extraItems, schArr = cxt.schema) {
    const { gen, parentSchema, data, keyword, it } = cxt;
    checkStrictTuple(parentSchema);
    if (it.opts.unevaluated && schArr.length && it.items !== true) {
        it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
    }
    const valid = gen.name("valid");
    const len = gen.const("len", (0, codegen_1._) `${data}.length`);
    schArr.forEach((sch, i) => {
        if ((0, util_1.alwaysValidSchema)(it, sch))
            return;
        gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({
            keyword,
            schemaProp: i,
            dataProp: i,
        }, valid));
        cxt.ok(valid);
    });
    function checkStrictTuple(sch) {
        const { opts, errSchemaPath } = it;
        const l = schArr.length;
        const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
        if (opts.strictTuples && !fullTuple) {
            const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
            (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
        }
    }
}
exports.validateTuple = validateTuple;
exports["default"] = def;
//# sourceMappingURL=items.js.map

/***/ }),

/***/ 65434:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const code_1 = __webpack_require__(36461);
const additionalItems_1 = __webpack_require__(26970);
const error = {
    message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
    params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
    keyword: "items",
    type: "array",
    schemaType: ["object", "boolean"],
    before: "uniqueItems",
    error,
    code(cxt) {
        const { schema, parentSchema, it } = cxt;
        const { prefixItems } = parentSchema;
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        if (prefixItems)
            (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
        else
            cxt.ok((0, code_1.validateArray)(cxt));
    },
};
exports["default"] = def;
//# sourceMappingURL=items2020.js.map

/***/ }),

/***/ 27599:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const util_1 = __webpack_require__(75280);
const def = {
    keyword: "not",
    schemaType: ["object", "boolean"],
    trackErrors: true,
    code(cxt) {
        const { gen, schema, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
            cxt.fail();
            return;
        }
        const valid = gen.name("valid");
        cxt.subschema({
            keyword: "not",
            compositeRule: true,
            createErrors: false,
            allErrors: false,
        }, valid);
        cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
    },
    error: { message: "must NOT be valid" },
};
exports["default"] = def;
//# sourceMappingURL=not.js.map

/***/ }),

/***/ 71408:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const error = {
    message: "must match exactly one schema in oneOf",
    params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`,
};
const def = {
    keyword: "oneOf",
    schemaType: "array",
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, schema, parentSchema, it } = cxt;
        /* istanbul ignore if */
        if (!Array.isArray(schema))
            throw new Error("ajv implementation error");
        if (it.opts.discriminator && parentSchema.discriminator)
            return;
        const schArr = schema;
        const valid = gen.let("valid", false);
        const passing = gen.let("passing", null);
        const schValid = gen.name("_valid");
        cxt.setParams({ passing });
        // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas
        gen.block(validateOneOf);
        cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
        function validateOneOf() {
            schArr.forEach((sch, i) => {
                let schCxt;
                if ((0, util_1.alwaysValidSchema)(it, sch)) {
                    gen.var(schValid, true);
                }
                else {
                    schCxt = cxt.subschema({
                        keyword: "oneOf",
                        schemaProp: i,
                        compositeRule: true,
                    }, schValid);
                }
                if (i > 0) {
                    gen
                        .if((0, codegen_1._) `${schValid} && ${valid}`)
                        .assign(valid, false)
                        .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`)
                        .else();
                }
                gen.if(schValid, () => {
                    gen.assign(valid, true);
                    gen.assign(passing, i);
                    if (schCxt)
                        cxt.mergeEvaluated(schCxt, codegen_1.Name);
                });
            });
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=oneOf.js.map

/***/ }),

/***/ 48262:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const code_1 = __webpack_require__(36461);
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const util_2 = __webpack_require__(75280);
const def = {
    keyword: "patternProperties",
    type: "object",
    schemaType: "object",
    code(cxt) {
        const { gen, schema, data, parentSchema, it } = cxt;
        const { opts } = it;
        const patterns = (0, code_1.allSchemaProperties)(schema);
        const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
        if (patterns.length === 0 ||
            (alwaysValidPatterns.length === patterns.length &&
                (!it.opts.unevaluated || it.props === true))) {
            return;
        }
        const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
        const valid = gen.name("valid");
        if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
            it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
        }
        const { props } = it;
        validatePatternProperties();
        function validatePatternProperties() {
            for (const pat of patterns) {
                if (checkProperties)
                    checkMatchingProperties(pat);
                if (it.allErrors) {
                    validateProperties(pat);
                }
                else {
                    gen.var(valid, true); // TODO var
                    validateProperties(pat);
                    gen.if(valid);
                }
            }
        }
        function checkMatchingProperties(pat) {
            for (const prop in checkProperties) {
                if (new RegExp(pat).test(prop)) {
                    (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
                }
            }
        }
        function validateProperties(pat) {
            gen.forIn("key", data, (key) => {
                gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
                    const alwaysValid = alwaysValidPatterns.includes(pat);
                    if (!alwaysValid) {
                        cxt.subschema({
                            keyword: "patternProperties",
                            schemaProp: pat,
                            dataProp: key,
                            dataPropType: util_2.Type.Str,
                        }, valid);
                    }
                    if (it.opts.unevaluated && props !== true) {
                        gen.assign((0, codegen_1._) `${props}[${key}]`, true);
                    }
                    else if (!alwaysValid && !it.allErrors) {
                        // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)
                        // or if all properties were evaluated (props === true)
                        gen.if((0, codegen_1.not)(valid), () => gen.break());
                    }
                });
            });
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=patternProperties.js.map

/***/ }),

/***/ 65026:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const items_1 = __webpack_require__(83775);
const def = {
    keyword: "prefixItems",
    type: "array",
    schemaType: ["array"],
    before: "uniqueItems",
    code: (cxt) => (0, items_1.validateTuple)(cxt, "items"),
};
exports["default"] = def;
//# sourceMappingURL=prefixItems.js.map

/***/ }),

/***/ 99474:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const validate_1 = __webpack_require__(58941);
const code_1 = __webpack_require__(36461);
const util_1 = __webpack_require__(75280);
const additionalProperties_1 = __webpack_require__(3077);
const def = {
    keyword: "properties",
    type: "object",
    schemaType: "object",
    code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) {
            additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
        }
        const allProps = (0, code_1.allSchemaProperties)(schema);
        for (const prop of allProps) {
            it.definedProperties.add(prop);
        }
        if (it.opts.unevaluated && allProps.length && it.props !== true) {
            it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
        }
        const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
        if (properties.length === 0)
            return;
        const valid = gen.name("valid");
        for (const prop of properties) {
            if (hasDefault(prop)) {
                applyPropertySchema(prop);
            }
            else {
                gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
                applyPropertySchema(prop);
                if (!it.allErrors)
                    gen.else().var(valid, true);
                gen.endIf();
            }
            cxt.it.definedProperties.add(prop);
            cxt.ok(valid);
        }
        function hasDefault(prop) {
            return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;
        }
        function applyPropertySchema(prop) {
            cxt.subschema({
                keyword: "properties",
                schemaProp: prop,
                dataProp: prop,
            }, valid);
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=properties.js.map

/***/ }),

/***/ 80217:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const error = {
    message: "property name must be valid",
    params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`,
};
const def = {
    keyword: "propertyNames",
    type: "object",
    schemaType: ["object", "boolean"],
    error,
    code(cxt) {
        const { gen, schema, data, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        const valid = gen.name("valid");
        gen.forIn("key", data, (key) => {
            cxt.setParams({ propertyName: key });
            cxt.subschema({
                keyword: "propertyNames",
                data: key,
                dataTypes: ["string"],
                propertyName: key,
                compositeRule: true,
            }, valid);
            gen.if((0, codegen_1.not)(valid), () => {
                cxt.error(true);
                if (!it.allErrors)
                    gen.break();
            });
        });
        cxt.ok(valid);
    },
};
exports["default"] = def;
//# sourceMappingURL=propertyNames.js.map

/***/ }),

/***/ 25246:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const util_1 = __webpack_require__(75280);
const def = {
    keyword: ["then", "else"],
    schemaType: ["object", "boolean"],
    code({ keyword, parentSchema, it }) {
        if (parentSchema.if === undefined)
            (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
    },
};
exports["default"] = def;
//# sourceMappingURL=thenElse.js.map

/***/ }),

/***/ 36461:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const names_1 = __webpack_require__(25668);
const util_2 = __webpack_require__(75280);
function checkReportMissingProp(cxt, prop) {
    const { gen, data, it } = cxt;
    gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
        cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);
        cxt.error();
    });
}
exports.checkReportMissingProp = checkReportMissingProp;
function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
    return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));
}
exports.checkMissingProp = checkMissingProp;
function reportMissingProp(cxt, missing) {
    cxt.setParams({ missingProperty: missing }, true);
    cxt.error();
}
exports.reportMissingProp = reportMissingProp;
function hasPropFunc(gen) {
    return gen.scopeValue("func", {
        // eslint-disable-next-line @typescript-eslint/unbound-method
        ref: Object.prototype.hasOwnProperty,
        code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,
    });
}
exports.hasPropFunc = hasPropFunc;
function isOwnProperty(gen, data, property) {
    return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;
}
exports.isOwnProperty = isOwnProperty;
function propertyInData(gen, data, property, ownProperties) {
    const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
    return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;
}
exports.propertyInData = propertyInData;
function noPropertyInData(gen, data, property, ownProperties) {
    const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;
    return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
}
exports.noPropertyInData = noPropertyInData;
function allSchemaProperties(schemaMap) {
    return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
}
exports.allSchemaProperties = allSchemaProperties;
function schemaProperties(it, schemaMap) {
    return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
}
exports.schemaProperties = schemaProperties;
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
    const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
    const valCxt = [
        [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
        [names_1.default.parentData, it.parentData],
        [names_1.default.parentDataProperty, it.parentDataProperty],
        [names_1.default.rootData, names_1.default.rootData],
    ];
    if (it.opts.dynamicRef)
        valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
    const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;
    return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;
}
exports.callValidateCode = callValidateCode;
const newRegExp = (0, codegen_1._) `new RegExp`;
function usePattern({ gen, it: { opts } }, pattern) {
    const u = opts.unicodeRegExp ? "u" : "";
    const { regExp } = opts.code;
    const rx = regExp(pattern, u);
    return gen.scopeValue("pattern", {
        key: rx.toString(),
        ref: rx,
        code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,
    });
}
exports.usePattern = usePattern;
function validateArray(cxt) {
    const { gen, data, keyword, it } = cxt;
    const valid = gen.name("valid");
    if (it.allErrors) {
        const validArr = gen.let("valid", true);
        validateItems(() => gen.assign(validArr, false));
        return validArr;
    }
    gen.var(valid, true);
    validateItems(() => gen.break());
    return valid;
    function validateItems(notValid) {
        const len = gen.const("len", (0, codegen_1._) `${data}.length`);
        gen.forRange("i", 0, len, (i) => {
            cxt.subschema({
                keyword,
                dataProp: i,
                dataPropType: util_1.Type.Num,
            }, valid);
            gen.if((0, codegen_1.not)(valid), notValid);
        });
    }
}
exports.validateArray = validateArray;
function validateUnion(cxt) {
    const { gen, schema, keyword, it } = cxt;
    /* istanbul ignore if */
    if (!Array.isArray(schema))
        throw new Error("ajv implementation error");
    const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
    if (alwaysValid && !it.opts.unevaluated)
        return;
    const valid = gen.let("valid", false);
    const schValid = gen.name("_valid");
    gen.block(() => schema.forEach((_sch, i) => {
        const schCxt = cxt.subschema({
            keyword,
            schemaProp: i,
            compositeRule: true,
        }, schValid);
        gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);
        const merged = cxt.mergeValidEvaluated(schCxt, schValid);
        // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)
        // or if all properties and items were evaluated (it.props === true && it.items === true)
        if (!merged)
            gen.if((0, codegen_1.not)(valid));
    }));
    cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
}
exports.validateUnion = validateUnion;
//# sourceMappingURL=code.js.map

/***/ }),

/***/ 20998:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const def = {
    keyword: "id",
    code() {
        throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
    },
};
exports["default"] = def;
//# sourceMappingURL=id.js.map

/***/ }),

/***/ 61324:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const id_1 = __webpack_require__(20998);
const ref_1 = __webpack_require__(91873);
const core = [
    "$schema",
    "$id",
    "$defs",
    "$vocabulary",
    { keyword: "$comment" },
    "definitions",
    id_1.default,
    ref_1.default,
];
exports["default"] = core;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 91873:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.callRef = exports.getValidate = void 0;
const ref_error_1 = __webpack_require__(61326);
const code_1 = __webpack_require__(36461);
const codegen_1 = __webpack_require__(78380);
const names_1 = __webpack_require__(25668);
const compile_1 = __webpack_require__(56862);
const util_1 = __webpack_require__(75280);
const def = {
    keyword: "$ref",
    schemaType: "string",
    code(cxt) {
        const { gen, schema: $ref, it } = cxt;
        const { baseId, schemaEnv: env, validateName, opts, self } = it;
        const { root } = env;
        if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
            return callRootRef();
        const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
        if (schOrEnv === undefined)
            throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
        if (schOrEnv instanceof compile_1.SchemaEnv)
            return callValidate(schOrEnv);
        return inlineRefSchema(schOrEnv);
        function callRootRef() {
            if (env === root)
                return callRef(cxt, validateName, env, env.$async);
            const rootName = gen.scopeValue("root", { ref: root });
            return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async);
        }
        function callValidate(sch) {
            const v = getValidate(cxt, sch);
            callRef(cxt, v, sch, sch.$async);
        }
        function inlineRefSchema(sch) {
            const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
            const valid = gen.name("valid");
            const schCxt = cxt.subschema({
                schema: sch,
                dataTypes: [],
                schemaPath: codegen_1.nil,
                topSchemaRef: schName,
                errSchemaPath: $ref,
            }, valid);
            cxt.mergeEvaluated(schCxt);
            cxt.ok(valid);
        }
    },
};
function getValidate(cxt, sch) {
    const { gen } = cxt;
    return sch.validate
        ? gen.scopeValue("validate", { ref: sch.validate })
        : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.validate`;
}
exports.getValidate = getValidate;
function callRef(cxt, v, sch, $async) {
    const { gen, it } = cxt;
    const { allErrors, schemaEnv: env, opts } = it;
    const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
    if ($async)
        callAsyncRef();
    else
        callSyncRef();
    function callAsyncRef() {
        if (!env.$async)
            throw new Error("async schema referenced by sync schema");
        const valid = gen.let("valid");
        gen.try(() => {
            gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
            addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result
            if (!allErrors)
                gen.assign(valid, true);
        }, (e) => {
            gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
            addErrorsFrom(e);
            if (!allErrors)
                gen.assign(valid, false);
        });
        cxt.ok(valid);
    }
    function callSyncRef() {
        cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
    }
    function addErrorsFrom(source) {
        const errs = (0, codegen_1._) `${source}.errors`;
        gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged
        gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);
    }
    function addEvaluatedFrom(source) {
        var _a;
        if (!it.opts.unevaluated)
            return;
        const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
        // TODO refactor
        if (it.props !== true) {
            if (schEvaluated && !schEvaluated.dynamicProps) {
                if (schEvaluated.props !== undefined) {
                    it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
                }
            }
            else {
                const props = gen.var("props", (0, codegen_1._) `${source}.evaluated.props`);
                it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
            }
        }
        if (it.items !== true) {
            if (schEvaluated && !schEvaluated.dynamicItems) {
                if (schEvaluated.items !== undefined) {
                    it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
                }
            }
            else {
                const items = gen.var("items", (0, codegen_1._) `${source}.evaluated.items`);
                it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
            }
        }
    }
}
exports.callRef = callRef;
exports["default"] = def;
//# sourceMappingURL=ref.js.map

/***/ }),

/***/ 60867:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const types_1 = __webpack_require__(60987);
const compile_1 = __webpack_require__(56862);
const ref_error_1 = __webpack_require__(61326);
const util_1 = __webpack_require__(75280);
const error = {
    message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
        ? `tag "${tagName}" must be string`
        : `value of tag "${tagName}" must be in oneOf`,
    params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
};
const def = {
    keyword: "discriminator",
    type: "object",
    schemaType: "object",
    error,
    code(cxt) {
        const { gen, data, schema, parentSchema, it } = cxt;
        const { oneOf } = parentSchema;
        if (!it.opts.discriminator) {
            throw new Error("discriminator: requires discriminator option");
        }
        const tagName = schema.propertyName;
        if (typeof tagName != "string")
            throw new Error("discriminator: requires propertyName");
        if (schema.mapping)
            throw new Error("discriminator: mapping is not supported");
        if (!oneOf)
            throw new Error("discriminator: requires oneOf keyword");
        const valid = gen.let("valid", false);
        const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);
        gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
        cxt.ok(valid);
        function validateMapping() {
            const mapping = getMapping();
            gen.if(false);
            for (const tagValue in mapping) {
                gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
                gen.assign(valid, applyTagSchema(mapping[tagValue]));
            }
            gen.else();
            cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
            gen.endIf();
        }
        function applyTagSchema(schemaProp) {
            const _valid = gen.name("valid");
            const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
            cxt.mergeEvaluated(schCxt, codegen_1.Name);
            return _valid;
        }
        function getMapping() {
            var _a;
            const oneOfMapping = {};
            const topRequired = hasRequired(parentSchema);
            let tagRequired = true;
            for (let i = 0; i < oneOf.length; i++) {
                let sch = oneOf[i];
                if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
                    const ref = sch.$ref;
                    sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
                    if (sch instanceof compile_1.SchemaEnv)
                        sch = sch.schema;
                    if (sch === undefined)
                        throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
                }
                const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
                if (typeof propSch != "object") {
                    throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
                }
                tagRequired = tagRequired && (topRequired || hasRequired(sch));
                addMappings(propSch, i);
            }
            if (!tagRequired)
                throw new Error(`discriminator: "${tagName}" must be required`);
            return oneOfMapping;
            function hasRequired({ required }) {
                return Array.isArray(required) && required.includes(tagName);
            }
            function addMappings(sch, i) {
                if (sch.const) {
                    addMapping(sch.const, i);
                }
                else if (sch.enum) {
                    for (const tagValue of sch.enum) {
                        addMapping(tagValue, i);
                    }
                }
                else {
                    throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
                }
            }
            function addMapping(tagValue, i) {
                if (typeof tagValue != "string" || tagValue in oneOfMapping) {
                    throw new Error(`discriminator: "${tagName}" values must be unique strings`);
                }
                oneOfMapping[tagValue] = i;
            }
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 60987:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.DiscrError = void 0;
var DiscrError;
(function (DiscrError) {
    DiscrError["Tag"] = "tag";
    DiscrError["Mapping"] = "mapping";
})(DiscrError || (exports.DiscrError = DiscrError = {}));
//# sourceMappingURL=types.js.map

/***/ }),

/***/ 43662:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const core_1 = __webpack_require__(61324);
const validation_1 = __webpack_require__(13959);
const applicator_1 = __webpack_require__(74810);
const format_1 = __webpack_require__(89119);
const metadata_1 = __webpack_require__(97808);
const draft7Vocabularies = [
    core_1.default,
    validation_1.default,
    (0, applicator_1.default)(),
    format_1.default,
    metadata_1.metadataVocabulary,
    metadata_1.contentVocabulary,
];
exports["default"] = draft7Vocabularies;
//# sourceMappingURL=draft7.js.map

/***/ }),

/***/ 94948:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const error = {
    message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`,
    params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,
};
const def = {
    keyword: "format",
    type: ["number", "string"],
    schemaType: "string",
    $data: true,
    error,
    code(cxt, ruleType) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        const { opts, errSchemaPath, schemaEnv, self } = it;
        if (!opts.validateFormats)
            return;
        if ($data)
            validate$DataFormat();
        else
            validateFormat();
        function validate$DataFormat() {
            const fmts = gen.scopeValue("formats", {
                ref: self.formats,
                code: opts.code.formats,
            });
            const fDef = gen.const("fDef", (0, codegen_1._) `${fmts}[${schemaCode}]`);
            const fType = gen.let("fType");
            const format = gen.let("format");
            // TODO simplify
            gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef));
            cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
            function unknownFmt() {
                if (opts.strictSchema === false)
                    return codegen_1.nil;
                return (0, codegen_1._) `${schemaCode} && !${format}`;
            }
            function invalidFmt() {
                const callFormat = schemaEnv.$async
                    ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`
                    : (0, codegen_1._) `${format}(${data})`;
                const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
                return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
            }
        }
        function validateFormat() {
            const formatDef = self.formats[schema];
            if (!formatDef) {
                unknownFormat();
                return;
            }
            if (formatDef === true)
                return;
            const [fmtType, format, fmtRef] = getFormat(formatDef);
            if (fmtType === ruleType)
                cxt.pass(validCondition());
            function unknownFormat() {
                if (opts.strictSchema === false) {
                    self.logger.warn(unknownMsg());
                    return;
                }
                throw new Error(unknownMsg());
                function unknownMsg() {
                    return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
                }
            }
            function getFormat(fmtDef) {
                const code = fmtDef instanceof RegExp
                    ? (0, codegen_1.regexpCode)(fmtDef)
                    : opts.code.formats
                        ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`
                        : undefined;
                const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
                if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
                    return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];
                }
                return ["string", fmtDef, fmt];
            }
            function validCondition() {
                if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
                    if (!schemaEnv.$async)
                        throw new Error("async format in sync schema");
                    return (0, codegen_1._) `await ${fmtRef}(${data})`;
                }
                return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;
            }
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=format.js.map

/***/ }),

/***/ 89119:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const format_1 = __webpack_require__(94948);
const format = [format_1.default];
exports["default"] = format;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 97808:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.contentVocabulary = exports.metadataVocabulary = void 0;
exports.metadataVocabulary = [
    "title",
    "description",
    "default",
    "deprecated",
    "readOnly",
    "writeOnly",
    "examples",
];
exports.contentVocabulary = [
    "contentMediaType",
    "contentEncoding",
    "contentSchema",
];
//# sourceMappingURL=metadata.js.map

/***/ }),

/***/ 72156:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const equal_1 = __webpack_require__(16898);
const error = {
    message: "must be equal to constant",
    params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`,
};
const def = {
    keyword: "const",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, $data, schemaCode, schema } = cxt;
        if ($data || (schema && typeof schema == "object")) {
            cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
        }
        else {
            cxt.fail((0, codegen_1._) `${schema} !== ${data}`);
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=const.js.map

/***/ }),

/***/ 84010:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const equal_1 = __webpack_require__(16898);
const error = {
    message: "must be equal to one of the allowed values",
    params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,
};
const def = {
    keyword: "enum",
    schemaType: "array",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        if (!$data && schema.length === 0)
            throw new Error("enum must have non-empty array");
        const useLoop = schema.length >= it.opts.loopEnum;
        let eql;
        const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));
        let valid;
        if (useLoop || $data) {
            valid = gen.let("valid");
            cxt.block$data(valid, loopEnum);
        }
        else {
            /* istanbul ignore if */
            if (!Array.isArray(schema))
                throw new Error("ajv implementation error");
            const vSchema = gen.const("vSchema", schemaCode);
            valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));
        }
        cxt.pass(valid);
        function loopEnum() {
            gen.assign(valid, false);
            gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
        }
        function equalCode(vSchema, i) {
            const sch = schema[i];
            return typeof sch === "object" && sch !== null
                ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`
                : (0, codegen_1._) `${data} === ${sch}`;
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=enum.js.map

/***/ }),

/***/ 13959:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const limitNumber_1 = __webpack_require__(79765);
const multipleOf_1 = __webpack_require__(89061);
const limitLength_1 = __webpack_require__(22304);
const pattern_1 = __webpack_require__(27253);
const limitProperties_1 = __webpack_require__(45757);
const required_1 = __webpack_require__(93516);
const limitItems_1 = __webpack_require__(92270);
const uniqueItems_1 = __webpack_require__(17998);
const const_1 = __webpack_require__(72156);
const enum_1 = __webpack_require__(84010);
const validation = [
    // number
    limitNumber_1.default,
    multipleOf_1.default,
    // string
    limitLength_1.default,
    pattern_1.default,
    // object
    limitProperties_1.default,
    required_1.default,
    // array
    limitItems_1.default,
    uniqueItems_1.default,
    // any
    { keyword: "type", schemaType: ["string", "array"] },
    { keyword: "nullable", schemaType: "boolean" },
    const_1.default,
    enum_1.default,
];
exports["default"] = validation;
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 92270:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const error = {
    message({ keyword, schemaCode }) {
        const comp = keyword === "maxItems" ? "more" : "fewer";
        return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`;
    },
    params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
};
const def = {
    keyword: ["maxItems", "minItems"],
    type: "array",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`);
    },
};
exports["default"] = def;
//# sourceMappingURL=limitItems.js.map

/***/ }),

/***/ 22304:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const ucs2length_1 = __webpack_require__(59228);
const error = {
    message({ keyword, schemaCode }) {
        const comp = keyword === "maxLength" ? "more" : "fewer";
        return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`;
    },
    params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
};
const def = {
    keyword: ["maxLength", "minLength"],
    type: "string",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode, it } = cxt;
        const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
        const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;
        cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`);
    },
};
exports["default"] = def;
//# sourceMappingURL=limitLength.js.map

/***/ }),

/***/ 79765:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const ops = codegen_1.operators;
const KWDs = {
    maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
    minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
    exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
    exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE },
};
const error = {
    message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`,
    params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,
};
const def = {
    keyword: Object.keys(KWDs),
    type: "number",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
    },
};
exports["default"] = def;
//# sourceMappingURL=limitNumber.js.map

/***/ }),

/***/ 45757:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const error = {
    message({ keyword, schemaCode }) {
        const comp = keyword === "maxProperties" ? "more" : "fewer";
        return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;
    },
    params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
};
const def = {
    keyword: ["maxProperties", "minProperties"],
    type: "object",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);
    },
};
exports["default"] = def;
//# sourceMappingURL=limitProperties.js.map

/***/ }),

/***/ 89061:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const codegen_1 = __webpack_require__(78380);
const error = {
    message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,
    params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,
};
const def = {
    keyword: "multipleOf",
    type: "number",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, schemaCode, it } = cxt;
        // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)
        const prec = it.opts.multipleOfPrecision;
        const res = gen.let("res");
        const invalid = prec
            ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`
            : (0, codegen_1._) `${res} !== parseInt(${res})`;
        cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
    },
};
exports["default"] = def;
//# sourceMappingURL=multipleOf.js.map

/***/ }),

/***/ 27253:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const code_1 = __webpack_require__(36461);
const codegen_1 = __webpack_require__(78380);
const error = {
    message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern "${schemaCode}"`,
    params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`,
};
const def = {
    keyword: "pattern",
    type: "string",
    schemaType: "string",
    $data: true,
    error,
    code(cxt) {
        const { data, $data, schema, schemaCode, it } = cxt;
        // TODO regexp should be wrapped in try/catchs
        const u = it.opts.unicodeRegExp ? "u" : "";
        const regExp = $data ? (0, codegen_1._) `(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
        cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`);
    },
};
exports["default"] = def;
//# sourceMappingURL=pattern.js.map

/***/ }),

/***/ 93516:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const code_1 = __webpack_require__(36461);
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const error = {
    message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`,
    params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`,
};
const def = {
    keyword: "required",
    type: "object",
    schemaType: "array",
    $data: true,
    error,
    code(cxt) {
        const { gen, schema, schemaCode, data, $data, it } = cxt;
        const { opts } = it;
        if (!$data && schema.length === 0)
            return;
        const useLoop = schema.length >= opts.loopRequired;
        if (it.allErrors)
            allErrorsMode();
        else
            exitOnErrorMode();
        if (opts.strictRequired) {
            const props = cxt.parentSchema.properties;
            const { definedProperties } = cxt.it;
            for (const requiredKey of schema) {
                if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {
                    const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
                    const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
                    (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
                }
            }
        }
        function allErrorsMode() {
            if (useLoop || $data) {
                cxt.block$data(codegen_1.nil, loopAllRequired);
            }
            else {
                for (const prop of schema) {
                    (0, code_1.checkReportMissingProp)(cxt, prop);
                }
            }
        }
        function exitOnErrorMode() {
            const missing = gen.let("missing");
            if (useLoop || $data) {
                const valid = gen.let("valid", true);
                cxt.block$data(valid, () => loopUntilMissing(missing, valid));
                cxt.ok(valid);
            }
            else {
                gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));
                (0, code_1.reportMissingProp)(cxt, missing);
                gen.else();
            }
        }
        function loopAllRequired() {
            gen.forOf("prop", schemaCode, (prop) => {
                cxt.setParams({ missingProperty: prop });
                gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
            });
        }
        function loopUntilMissing(missing, valid) {
            cxt.setParams({ missingProperty: missing });
            gen.forOf(missing, schemaCode, () => {
                gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
                gen.if((0, codegen_1.not)(valid), () => {
                    cxt.error();
                    gen.break();
                });
            }, codegen_1.nil);
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=required.js.map

/***/ }),

/***/ 17998:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
const dataType_1 = __webpack_require__(24307);
const codegen_1 = __webpack_require__(78380);
const util_1 = __webpack_require__(75280);
const equal_1 = __webpack_require__(16898);
const error = {
    message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
    params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`,
};
const def = {
    keyword: "uniqueItems",
    type: "array",
    schemaType: "boolean",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
        if (!$data && !schema)
            return;
        const valid = gen.let("valid");
        const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
        cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);
        cxt.ok(valid);
        function validateUniqueItems() {
            const i = gen.let("i", (0, codegen_1._) `${data}.length`);
            const j = gen.let("j");
            cxt.setParams({ i, j });
            gen.assign(valid, true);
            gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
        }
        function canOptimize() {
            return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
        }
        function loopN(i, j) {
            const item = gen.name("item");
            const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
            const indices = gen.const("indices", (0, codegen_1._) `{}`);
            gen.for((0, codegen_1._) `;${i}--;`, () => {
                gen.let(item, (0, codegen_1._) `${data}[${i}]`);
                gen.if(wrongType, (0, codegen_1._) `continue`);
                if (itemTypes.length > 1)
                    gen.if((0, codegen_1._) `typeof ${item} == "string"`, (0, codegen_1._) `${item} += "_"`);
                gen
                    .if((0, codegen_1._) `typeof ${indices}[${item}] == "number"`, () => {
                    gen.assign(j, (0, codegen_1._) `${indices}[${item}]`);
                    cxt.error();
                    gen.assign(valid, false).break();
                })
                    .code((0, codegen_1._) `${indices}[${item}] = ${i}`);
            });
        }
        function loopN2(i, j) {
            const eql = (0, util_1.useFunc)(gen, equal_1.default);
            const outer = gen.name("outer");
            gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => {
                cxt.error();
                gen.assign(valid, false).break(outer);
            })));
        }
    },
};
exports["default"] = def;
//# sourceMappingURL=uniqueItems.js.map

/***/ }),

/***/ 113:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/commands@~2.3.3 (singleton) (fallback: ../node_modules/@lumino/commands/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(88532);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(61533);
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var domutils_dist_index_es6_js_ = __webpack_require__(19451);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/types.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
/**
 * Identifiers of commands registered by shortcuts UI.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.editBinding = 'shortcuts:edit-keybinding';
    CommandIDs.addBinding = 'shortcuts:add-keybinding';
    CommandIDs.deleteBinding = 'shortcuts:delete-keybinding';
    CommandIDs.toggleSelectors = 'shortcuts:toggle-selectors';
    CommandIDs.resetAll = 'shortcuts:reset-all';
})(CommandIDs || (CommandIDs = {}));
//# sourceMappingURL=types.js.map
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
var react_index_js_default = /*#__PURE__*/__webpack_require__.n(react_index_js_);
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/keyboard@^2.0.4 (strict) (fallback: ../node_modules/@lumino/keyboard/dist/index.es6.js)
var keyboard_dist_index_es6_js_ = __webpack_require__(10743);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/components/ShortcutInput.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */




const CONFLICT_CONTAINER_CLASS = 'jp-Shortcuts-ConflictContainer';
class ShortcutInput extends react_index_js_.Component {
    constructor(props) {
        super(props);
        this.handleSubmit = async () => {
            if (!this._isReplacingExistingKeybinding) {
                await this._updateShortcut();
                this.props.toggleInput();
            }
            else {
                /** don't replace if field has not been edited */
                if (this.state.selected) {
                    this.props.toggleInput();
                }
                else {
                    await this._updateShortcut();
                }
            }
        };
        this._updateShortcut = async () => {
            const keys = [...this.state.keys, this.state.currentChain];
            this.setState({ keys });
            if (this.props.keybinding) {
                await this.props.replaceKeybinding(this.props.shortcut, this.props.keybinding, keys);
            }
            else {
                await this.props.addKeybinding(this.props.shortcut, keys);
            }
        };
        this._handleOverwrite = async (conflicts, keys) => {
            for (const conflict of conflicts) {
                const conflictingBinding = conflict.keybindings.filter(binding => dist_index_js_.JSONExt.deepEqual(binding.keys, keys) ||
                    keys.some(key => dist_index_js_.JSONExt.deepEqual(binding.keys, [key])))[0];
                if (!conflictingBinding) {
                    console.error(`Conflicting binding could not be found for ${conflict} using keys ${keys}`);
                    continue;
                }
                await this.props.deleteKeybinding(conflict, conflictingBinding);
            }
            await this._updateShortcut();
        };
        /** Parse user input for chained shortcuts */
        this.parseChaining = (event, value, userInput, keys, currentChain) => {
            let key = keyboard_dist_index_es6_js_.EN_US.keyForKeydownEvent(event.nativeEvent);
            const modKeys = ['Shift', 'Control', 'Alt', 'Meta', 'Ctrl', 'Accel'];
            if (event.key === 'Backspace') {
                userInput = '';
                value = '';
                keys = [];
                currentChain = '';
                this.setState({
                    value: value,
                    userInput: userInput,
                    keys: keys,
                    currentChain: currentChain
                });
            }
            else if (event.key !== 'CapsLock') {
                const lastKey = userInput
                    .substr(userInput.lastIndexOf(' ') + 1, userInput.length)
                    .trim();
                /** if last key was not a modifier then there is a chain */
                if (modKeys.lastIndexOf(lastKey) === -1 && lastKey != '') {
                    userInput = userInput + ',';
                    keys.push(currentChain);
                    currentChain = '';
                    /** check if a modifier key was held down through chain */
                    if (event.ctrlKey && event.key != 'Control') {
                        userInput = (userInput + ' Ctrl').trim();
                        currentChain = (currentChain + ' Ctrl').trim();
                    }
                    if (event.metaKey && event.key != 'Meta') {
                        userInput = (userInput + ' Accel').trim();
                        currentChain = (currentChain + ' Accel').trim();
                    }
                    if (event.altKey && event.key != 'Alt') {
                        userInput = (userInput + ' Alt').trim();
                        currentChain = (currentChain + ' Alt').trim();
                    }
                    if (event.shiftKey && event.key != 'Shift') {
                        userInput = (userInput + ' Shift').trim();
                        currentChain = (currentChain + ' Shift').trim();
                    }
                    /** if not a modifier key, add to user input and current chain */
                    if (modKeys.lastIndexOf(event.key) === -1) {
                        userInput = (userInput + ' ' + key).trim();
                        currentChain = (currentChain + ' ' + key).trim();
                        /** if a modifier key, add to user input and current chain */
                    }
                    else {
                        if (event.key === 'Meta') {
                            userInput = (userInput + ' Accel').trim();
                            currentChain = (currentChain + ' Accel').trim();
                        }
                        else if (event.key === 'Control') {
                            userInput = (userInput + ' Ctrl').trim();
                            currentChain = (currentChain + ' Ctrl').trim();
                        }
                        else if (event.key === 'Shift') {
                            userInput = (userInput + ' Shift').trim();
                            currentChain = (currentChain + ' Shift').trim();
                        }
                        else if (event.key === 'Alt') {
                            userInput = (userInput + ' Alt').trim();
                            currentChain = (currentChain + ' Alt').trim();
                        }
                        else {
                            userInput = (userInput + ' ' + event.key).trim();
                            currentChain = (currentChain + ' ' + event.key).trim();
                        }
                    }
                    /** if not a chain, add the key to user input and current chain */
                }
                else {
                    /** if modifier key, rename */
                    if (event.key === 'Control') {
                        userInput = (userInput + ' Ctrl').trim();
                        currentChain = (currentChain + ' Ctrl').trim();
                    }
                    else if (event.key === 'Meta') {
                        userInput = (userInput + ' Accel').trim();
                        currentChain = (currentChain + ' Accel').trim();
                    }
                    else if (event.key === 'Shift') {
                        userInput = (userInput + ' Shift').trim();
                        currentChain = (currentChain + ' Shift').trim();
                    }
                    else if (event.key === 'Alt') {
                        userInput = (userInput + ' Alt').trim();
                        currentChain = (currentChain + ' Alt').trim();
                        /** if not a modifier key, add it regularly */
                    }
                    else {
                        userInput = (userInput + ' ' + key).trim();
                        currentChain = (currentChain + ' ' + key).trim();
                    }
                }
            }
            /** update state of keys and currentChain */
            this.setState({
                keys: keys,
                currentChain: currentChain
            });
            return [userInput, keys, currentChain];
        };
        /**
         * Check if shortcut being typed will work
         * (does not end with ctrl, alt, command, or shift)
         * */
        this.checkNonFunctional = () => {
            const dontEnd = ['Ctrl', 'Alt', 'Accel', 'Shift'];
            const shortcutKeys = this.state.currentChain.split(' ');
            const last = shortcutKeys[shortcutKeys.length - 1];
            this.setState({
                isFunctional: !(dontEnd.indexOf(last) !== -1)
            });
            return dontEnd.indexOf(last) !== -1;
        };
        /** Check if shortcut being typed is already taken */
        this.checkShortcutAvailability = (userInput, keys, currentChain) => {
            const conflicts = this.props.findConflictsFor([...keys, currentChain], this.props.shortcut.selector);
            const isAvailable = userInput === '' || conflicts.length === 0;
            // Allow to set shortcut to what it initially was if replacing.
            if (!isAvailable) {
                // TODO: should we keep this logic? It masks what may be a genuine
                // conflict in the defaults or between extensions; ideally we would
                // allow saving, but still warn the user.
                if (conflicts.length === 1 &&
                    conflicts[0].id === this.props.shortcut.id &&
                    this._isReplacingExistingKeybinding) {
                    this.setState({ isAvailable: true });
                    return [];
                }
            }
            this.setState({ isAvailable: isAvailable });
            return conflicts;
        };
        /** Parse and normalize user input */
        this.handleInput = (event) => {
            event.preventDefault();
            this.setState({ selected: false });
            const parsed = this.parseChaining(event, this.state.value, this.state.userInput, this.state.keys, this.state.currentChain);
            const userInput = parsed[0];
            const keys = parsed[1];
            const currentChain = parsed[2];
            const value = this.props.toSymbols(userInput);
            let conflicts = this.checkShortcutAvailability(userInput, keys, currentChain);
            this.setState({
                value: value,
                userInput: userInput,
                keys: keys,
                currentChain: currentChain
            }, () => {
                this.checkNonFunctional();
                this._emitConflicts(conflicts);
            });
        };
        this._handleBlur = (event) => {
            var _a, _b;
            if ((_a = this._ref.current) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget)) {
                // Do not hide when clicking inside the input
                return;
            }
            if ((_b = event.relatedTarget) === null || _b === void 0 ? void 0 : _b.closest(`.${CONFLICT_CONTAINER_CLASS}`)) {
                // Do not hide input when clicking on conflict container as this would destroy the state
                return;
            }
            // Hide the input
            this.props.toggleInput();
        };
        this._ref = react_index_js_.createRef();
        this.state = {
            value: this.props.placeholder,
            userInput: '',
            isAvailable: true,
            isFunctional: this._isReplacingExistingKeybinding,
            keys: [],
            currentChain: '',
            selected: true
        };
    }
    /** Whether this input replaces existing keybinding or creates a new one */
    get _isReplacingExistingKeybinding() {
        return !!this.props.keybinding;
    }
    _emitConflicts(conflicts) {
        const keys = [...this.state.keys, this.state.currentChain];
        this.props.displayConflicts({
            conflictsWith: conflicts,
            keys: this.state.keys,
            overwrite: async () => {
                this.setState({
                    // Since user decided to overwrite, no need to show it as conflicted anymore
                    isAvailable: true
                });
                // Try to overwrite
                await this._handleOverwrite(conflicts, keys);
                // Only hide the input after the overwrite took place
                this.props.toggleInput();
            },
            cancel: () => {
                // Hide the input
                this.props.toggleInput();
            }
        });
    }
    render() {
        const trans = this.props.translator.load('jupyterlab');
        let inputClassName = 'jp-Shortcuts-Input';
        if (!this.state.isAvailable) {
            inputClassName += ' jp-mod-unavailable-Input';
        }
        return (react_index_js_.createElement("div", { className: this.props.displayInput
                ? !this._isReplacingExistingKeybinding
                    ? 'jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew'
                    : 'jp-Shortcuts-InputBox'
                : 'jp-mod-hidden', ref: this._ref, onBlur: this._handleBlur },
            react_index_js_.createElement("div", { tabIndex: 0, className: inputClassName, onKeyDown: this.handleInput, ref: input => input && input.focus(), "data-lm-suppress-shortcuts": "true" },
                react_index_js_.createElement("p", { className: this.state.selected && this._isReplacingExistingKeybinding
                        ? 'jp-Shortcuts-InputText jp-mod-selected-InputText'
                        : this.state.value === ''
                            ? 'jp-Shortcuts-InputText jp-mod-waiting-InputText'
                            : 'jp-Shortcuts-InputText' }, this.state.value === ''
                    ? trans.__('press keys')
                    : this.state.value)),
            react_index_js_.createElement("button", { className: !this.state.isFunctional
                    ? 'jp-Shortcuts-Submit jp-mod-defunc-Submit'
                    : !this.state.isAvailable
                        ? 'jp-Shortcuts-Submit jp-mod-conflict-Submit'
                        : 'jp-Shortcuts-Submit', disabled: !this.state.isAvailable || !this.state.isFunctional, onClick: this.handleSubmit, tabIndex: 0 }, this.state.isAvailable ? react_index_js_.createElement(ui_components_lib_index_js_.checkIcon.react, null) : react_index_js_.createElement(ui_components_lib_index_js_.errorIcon.react, null))));
    }
}
//# sourceMappingURL=ShortcutInput.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/components/ShortcutItem.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/** React component for each command shortcut item */
class ShortcutItem extends react_index_js_.Component {
    constructor(props) {
        super(props);
        /** Toggle display state of input box */
        this.toggleInputNew = () => {
            this.setState({
                displayNewInput: !this.state.displayNewInput,
                // reset conflicts
                conflicts: new Map()
            });
        };
        /** Transform special key names into unicode characters */
        this.toSymbols = (value) => {
            return value.split(' ').reduce((result, key) => {
                if (key === 'Ctrl') {
                    return (result + ' ⌃').trim();
                }
                else if (key === 'Alt') {
                    return (result + ' ⌥').trim();
                }
                else if (key === 'Shift') {
                    return (result + ' ⇧').trim();
                }
                else if (key === 'Accel' && domutils_dist_index_es6_js_.Platform.IS_MAC) {
                    return (result + ' ⌘').trim();
                }
                else if (key === 'Accel') {
                    return (result + ' ⌃').trim();
                }
                else {
                    return (result + ' ' + key).trim();
                }
            }, '');
        };
        this._trans = this.props.external.translator.load('jupyterlab');
        this.state = {
            displayNewInput: false,
            displayReplaceInput: Object.freeze({}),
            conflicts: new Map()
        };
    }
    componentDidMount() {
        this.props.external.actionRequested.connect(this._onActionRequested, this);
    }
    componentWillUnmount() {
        this.props.external.actionRequested.disconnect(this._onActionRequested, this);
    }
    async _onActionRequested(_, action) {
        if ('shortcutId' in action &&
            action.shortcutId !== this.props.shortcut.id) {
            return;
        }
        if (action.request === 'add-keybinding') {
            return this.toggleInputNew();
        }
        if (action.request === 'edit-keybinding') {
            this.toggleInputReplaceMethod(action.keybinding);
        }
        if (action.request === 'delete-keybinding') {
            const target = this.props.shortcut;
            const binding = target.keybindings[action.keybinding];
            this.props.deleteKeybinding(target, binding).catch(console.error);
        }
    }
    getCategoryCell() {
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Cell" }, this.props.shortcut.category));
    }
    getLabelCell() {
        var _a;
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Cell" },
            react_index_js_.createElement("div", { className: "jp-label" }, (_a = this.props.shortcut.label) !== null && _a !== void 0 ? _a : this._trans.__('(Command label missing)'))));
    }
    getResetShortCutLink() {
        return (react_index_js_.createElement("a", { className: "jp-Shortcuts-Reset", onClick: () => this.props.resetKeybindings(this.props.shortcut) }, this._trans.__('Reset')));
    }
    getSourceCell() {
        const allDefault = this.props.shortcut.keybindings.every(binding => binding.isDefault);
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Cell" },
            react_index_js_.createElement("div", { className: "jp-Shortcuts-SourceCell" }, allDefault ? this._trans.__('Default') : this._trans.__('Custom')),
            !allDefault ? this.getResetShortCutLink() : ''));
    }
    getOptionalSelectorCell() {
        return this.props.showSelectors ? (react_index_js_.createElement("div", { className: "jp-Shortcuts-Cell" },
            react_index_js_.createElement("div", { className: "jp-selector" }, this.props.shortcut.selector))) : null;
    }
    getClassNameForShortCuts(nonEmptyBindings) {
        const classes = ['jp-Shortcuts-ShortcutCell'];
        switch (nonEmptyBindings.length) {
            case 1:
                classes.push('jp-Shortcuts-SingleCell');
                break;
            case 0:
                classes.push('jp-Shortcuts-EmptyCell');
                break;
        }
        return classes.join(' ');
    }
    toggleInputReplaceMethod(location) {
        const previous = this.state.displayReplaceInput[location];
        this.setState({
            displayReplaceInput: {
                ...this.state.displayReplaceInput,
                [location]: !previous
            },
            // Clear old conflicts
            conflicts: new Map()
        });
    }
    getDisplayReplaceInput(location) {
        return this.state.displayReplaceInput[location];
    }
    getOrDiplayIfNeeded(force) {
        const classes = ['jp-Shortcuts-Or'];
        if (force || this.state.displayNewInput) {
            classes.push('jp-Shortcuts-Or-Forced');
        }
        return react_index_js_.createElement("div", { className: classes.join(' ') }, this._trans.__('or'));
    }
    getShortCutAsInput(binding, location) {
        return (react_index_js_.createElement(ShortcutInput, { addKeybinding: this.props.addKeybinding, replaceKeybinding: this.props.replaceKeybinding, deleteKeybinding: this.props.deleteKeybinding, findConflictsFor: this.props.findConflictsFor, toggleInput: () => this.toggleInputReplaceMethod(location), shortcut: this.props.shortcut, keybinding: binding, displayConflicts: (data) => {
                const conflicts = new Map(this.state.conflicts);
                conflicts.set(binding, data);
                this.setState({ conflicts });
            }, toSymbols: this.toSymbols, displayInput: this.getDisplayReplaceInput(location), placeholder: this.toSymbols(binding.keys.join(', ')), translator: this.props.external.translator }));
    }
    getShortCutForDisplayOnly(binding) {
        return binding.keys.map((keyboardKey, index) => (react_index_js_.createElement("div", { className: "jp-Shortcuts-ShortcutKeysContainer", key: index },
            react_index_js_.createElement("div", { className: "jp-Shortcuts-ShortcutKeys" }, this.toSymbols(keyboardKey)),
            index + 1 < binding.keys.length ? (react_index_js_.createElement("div", { className: "jp-Shortcuts-Comma" }, ",")) : null)));
    }
    isLocationBeingEdited(location) {
        return this.state.displayReplaceInput[location];
    }
    getDivForKey(index, binding, nonEmptyBindings) {
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-ShortcutContainer", key: this.props.shortcut.id + '_' + index, "data-keybinding": index, "data-shortcut": this.props.shortcut.id, onClick: () => this.toggleInputReplaceMethod(index) },
            this.isLocationBeingEdited(index)
                ? this.getShortCutAsInput(binding, index)
                : this.getShortCutForDisplayOnly(binding),
            !(index === this._nonEmptyBindings.length - 1 &&
                Object.values(this.state.displayReplaceInput).some(Boolean)) &&
                this.getOrDiplayIfNeeded(index < this._nonEmptyBindings.length - 1)));
    }
    getAddLink() {
        return (react_index_js_.createElement("a", { className: !this.state.displayNewInput ? 'jp-Shortcuts-Plus' : '', onClick: () => {
                this.toggleInputNew();
            } }, this._trans.__('Add')));
    }
    getInputBoxWhenToggled() {
        return this.state.displayNewInput ? (react_index_js_.createElement(ShortcutInput, { addKeybinding: this.props.addKeybinding, replaceKeybinding: this.props.replaceKeybinding, deleteKeybinding: this.props.deleteKeybinding, findConflictsFor: this.props.findConflictsFor, toggleInput: this.toggleInputNew, shortcut: this.props.shortcut, displayConflicts: (data) => {
                const conflicts = new Map(this.state.conflicts);
                conflicts.set(null, data);
                this.setState({ conflicts });
            }, toSymbols: this.toSymbols, displayInput: this.state.displayNewInput, placeholder: '', translator: this.props.external.translator })) : (react_index_js_.createElement("div", null));
    }
    getShortCutsCell(nonEmptyBindings) {
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Cell" },
            react_index_js_.createElement("div", { className: this.getClassNameForShortCuts(nonEmptyBindings) },
                nonEmptyBindings.map((key, index) => this.getDivForKey(index, key, nonEmptyBindings)),
                nonEmptyBindings.length >= 1 &&
                    !this.state.displayNewInput &&
                    !Object.values(this.state.displayReplaceInput).some(Boolean) &&
                    this.getAddLink(),
                nonEmptyBindings.length === 0 &&
                    !this.state.displayNewInput &&
                    this.getAddLink(),
                this.getInputBoxWhenToggled())));
    }
    getConflicts() {
        const conflicts = [...this.state.conflicts.values()].filter(conflict => conflict.conflictsWith.length !== 0);
        if (conflicts.length === 0) {
            return react_index_js_.createElement(react_index_js_.Fragment, null);
        }
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Row jp-Shortcuts-RowWithConflict" },
            react_index_js_.createElement("div", { className: CONFLICT_CONTAINER_CLASS }, conflicts.map(conflict => {
                const key = conflict.keys.join(' ') +
                    '_' +
                    conflict.conflictsWith.map(target => target.id).join('');
                return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Conflict", key: key },
                    react_index_js_.createElement("div", { className: "jp-Shortcuts-ErrorMessage" }, this._trans.__('Shortcut already in use by %1. Overwrite it?', conflict.conflictsWith
                        .map(target => { var _a; return (_a = target.label) !== null && _a !== void 0 ? _a : target.command; })
                        .join(', '))),
                    react_index_js_.createElement("div", { className: "jp-Shortcuts-ErrorButton" },
                        react_index_js_.createElement("button", { className: "jp-Button jp-mod-reject jp-mod-styled", onClick: () => {
                                this._clearConflict(conflict);
                                conflict.cancel();
                            } }, this._trans.__('Cancel')),
                        react_index_js_.createElement("button", { className: "jp-Button jp-mod-warn jp-mod-styled", onClick: () => {
                                // Clear the conflict first to prevent user from accidentally clicking this button twice
                                this._clearConflict(conflict);
                                conflict.overwrite();
                            } }, this._trans.__('Overwrite')))));
            }))));
    }
    /**
     * Mark conflict as resolved.
     */
    _clearConflict(conflictToClear) {
        const conflicts = new Map();
        const idToSkip = this._conflictId(conflictToClear);
        for (const [binding, conflict] of this.state.conflicts.entries()) {
            if (this._conflictId(conflict) !== idToSkip) {
                conflicts.set(binding, conflict);
            }
        }
        this.setState({ conflicts });
    }
    /**
     * Create a unique conflict identifier.
     */
    _conflictId(conflict) {
        return (conflict.keys.join(' ') +
            '_' +
            conflict.conflictsWith.map(target => target.id).join(''));
    }
    get _nonEmptyBindings() {
        return this.props.shortcut.keybindings.filter(binding => binding.keys.filter(k => k != '').length !== 0);
    }
    render() {
        return (react_index_js_.createElement(react_index_js_.Fragment, null,
            react_index_js_.createElement("div", { className: "jp-Shortcuts-Row", "data-shortcut": this.props.shortcut.id },
                this.getCategoryCell(),
                this.getLabelCell(),
                this.getShortCutsCell(this._nonEmptyBindings),
                this.getSourceCell(),
                this.getOptionalSelectorCell()),
            this.getConflicts()));
    }
}
//# sourceMappingURL=ShortcutItem.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/components/ShortcutList.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


const TOPNAV_HEIGHT = 115;
/** React component for list of shortcuts */
class ShortcutList extends react_index_js_.Component {
    render() {
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-ShortcutListContainer", style: {
                height: `${this.props.height - TOPNAV_HEIGHT}px`
            }, id: "shortcutListContainer" },
            react_index_js_.createElement("div", { className: "jp-Shortcuts-ShortcutList" }, this.props.shortcuts.map((shortcut) => {
                return (react_index_js_.createElement(ShortcutItem, { key: shortcut.id, addKeybinding: this.props.addKeybinding, replaceKeybinding: this.props.replaceKeybinding, deleteKeybinding: this.props.deleteKeybinding, resetKeybindings: this.props.resetKeybindings, findConflictsFor: this.props.findConflictsFor, shortcut: shortcut, showSelectors: this.props.showSelectors, external: this.props.external }));
            }))));
    }
}
//# sourceMappingURL=ShortcutList.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/components/ShortcutTitleItem.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


class ShortcutTitleItem extends react_index_js_.Component {
    render() {
        return (react_index_js_.createElement("div", { className: this.props.title.toLowerCase() === this.props.active
                ? 'jp-Shortcuts-Header jp-Shortcuts-CurrentHeader'
                : 'jp-Shortcuts-Header', onClick: () => this.props.updateSort(this.props.columnId) },
            this.props.title,
            react_index_js_.createElement(ui_components_lib_index_js_.caretDownEmptyThinIcon.react, { className: 'jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton' })));
    }
}
//# sourceMappingURL=ShortcutTitleItem.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/components/TopNav.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



function Symbols(props) {
    return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Symbols" },
        react_index_js_.createElement("table", null,
            react_index_js_.createElement("tbody", null,
                react_index_js_.createElement("tr", null,
                    react_index_js_.createElement("td", null,
                        react_index_js_.createElement("kbd", null, "Cmd")),
                    react_index_js_.createElement("td", null, "\u2318"),
                    react_index_js_.createElement("td", null,
                        react_index_js_.createElement("kbd", null, "Ctrl")),
                    react_index_js_.createElement("td", null, "\u2303")),
                react_index_js_.createElement("tr", null,
                    react_index_js_.createElement("td", null,
                        react_index_js_.createElement("kbd", null, "Alt")),
                    react_index_js_.createElement("td", null, "\u2325"),
                    react_index_js_.createElement("td", null,
                        react_index_js_.createElement("kbd", null, "Shift")),
                    react_index_js_.createElement("td", null, "\u21E7"))))));
}
function AdvancedOptions(props) {
    const trans = props.translator.load('jupyterlab');
    return (react_index_js_.createElement("div", { className: "jp-Shortcuts-AdvancedOptions" },
        react_index_js_.createElement("a", { className: "jp-Shortcuts-AdvancedOptionsLink", onClick: () => props.toggleSelectors() }, props.showSelectors
            ? trans.__('Hide Selectors')
            : trans.__('Show Selectors')),
        react_index_js_.createElement("a", { className: "jp-Shortcuts-AdvancedOptionsLink", onClick: () => props.resetShortcuts() }, trans.__('Reset All'))));
}
/** React component for top navigation */
class TopNav extends react_index_js_.Component {
    constructor(props) {
        super(props);
    }
    getShortCutTitleItem(title, columnId) {
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Cell" },
            react_index_js_.createElement(ShortcutTitleItem, { title: title, updateSort: this.props.updateSort, active: this.props.currentSort, columnId: columnId })));
    }
    render() {
        const trans = this.props.translator.load('jupyterlab');
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-Top" },
            react_index_js_.createElement("div", { className: "jp-Shortcuts-TopNav" },
                react_index_js_.createElement(Symbols, null),
                react_index_js_.createElement(ui_components_lib_index_js_.FilterBox, { "aria-label": trans.__('Search shortcuts'), updateFilter: (_, query) => this.props.updateSearchQuery(query !== null && query !== void 0 ? query : ''), placeholder: trans.__('Search…'), useFuzzyFilter: false }),
                react_index_js_.createElement(AdvancedOptions, { toggleSelectors: this.props.toggleSelectors, showSelectors: this.props.showSelectors, resetShortcuts: this.props.resetShortcuts, translator: this.props.translator })),
            react_index_js_.createElement("div", { className: "jp-Shortcuts-HeaderRowContainer" },
                react_index_js_.createElement("div", { className: "jp-Shortcuts-HeaderRow" },
                    this.getShortCutTitleItem(trans.__('Category'), 'category'),
                    this.getShortCutTitleItem(trans.__('Command'), 'command'),
                    react_index_js_.createElement("div", { className: "jp-Shortcuts-Cell" },
                        react_index_js_.createElement("div", { className: "title-div" }, trans.__('Shortcut'))),
                    this.getShortCutTitleItem(trans.__('Source'), 'source'),
                    this.props.showSelectors &&
                        this.getShortCutTitleItem(trans.__('Selectors'), 'selector')))));
    }
}
//# sourceMappingURL=TopNav.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/registry.js
/**
 * Shortcut registry used by Shortcut UI component.
 */
class ShortcutRegistry extends Map {
    constructor(options) {
        var _a, _b, _c;
        super();
        const { settings, commandRegistry } = options;
        const userBindings = (_a = settings.user.shortcuts) !== null && _a !== void 0 ? _a : [];
        const setByUser = new Set(userBindings.map(this._computeKeybindingId.bind(this)));
        const luminoKeybindings = (_b = settings.composite.shortcuts) !== null && _b !== void 0 ? _b : [];
        for (const shortcut of luminoKeybindings) {
            const targetKey = this._computeTargetId(shortcut);
            const keybindingKey = this._computeKeybindingId(shortcut);
            const keybinding = {
                keys: shortcut.keys,
                isDefault: !setByUser.has(keybindingKey)
            };
            const shortcutTarget = this.get(targetKey);
            if (shortcutTarget) {
                shortcutTarget.keybindings.push(keybinding);
            }
            else {
                const commandParts = shortcut.command.split(':');
                const label = (_c = commandRegistry.label(shortcut.command, shortcut.args)) !== null && _c !== void 0 ? _c : (commandParts.length > 1 ? commandParts[1] : undefined);
                const category = commandParts[0];
                this.set(targetKey, {
                    id: targetKey,
                    selector: shortcut.selector,
                    command: shortcut.command,
                    category,
                    label,
                    args: shortcut.args,
                    keybindings: [keybinding]
                });
            }
        }
    }
    /**
     * Find targets that would conflict with given keys chord under given sequence.
     */
    findConflictsFor(keys, selector) {
        const checker = new KeybindingsConflictChecker({ registry: this });
        // First check the full chain
        let conflicts = checker.findConflicts(keys, selector);
        if (conflicts.length !== 0) {
            return conflicts;
        }
        // Then check each piece of the chain
        for (const binding of keys) {
            conflicts = checker.findConflicts([binding], selector);
            if (conflicts.length !== 0) {
                return conflicts;
            }
        }
        return [];
    }
    _computeTargetId(shortcut) {
        var _a;
        return (shortcut.command +
            '_' +
            shortcut.selector +
            '_' +
            JSON.stringify((_a = shortcut.args) !== null && _a !== void 0 ? _a : {}));
    }
    _computeKeybindingId(shortcut) {
        var _a;
        return [
            shortcut.command,
            shortcut.selector,
            JSON.stringify((_a = shortcut.args) !== null && _a !== void 0 ? _a : {}),
            shortcut.keys.join(' ')
        ].join('_');
    }
}
/**
 * Allows checking if a given keybinding is available, or directly conflicts with other targets.
 */
class KeybindingsConflictChecker {
    constructor(options) {
        var _a;
        const keybindingsMap = new Map();
        for (const shortcutTarget of options.registry.values()) {
            for (const keybinding of shortcutTarget.keybindings) {
                const hash = this._keybindingHash(keybinding.keys, shortcutTarget.selector);
                const list = (_a = keybindingsMap.get(hash)) !== null && _a !== void 0 ? _a : [];
                list.push(shortcutTarget);
                keybindingsMap.set(hash, list);
            }
        }
        this._keybindingsMap = keybindingsMap;
    }
    findConflicts(keys, selector) {
        var _a;
        const hash = this._keybindingHash(keys, selector);
        return (_a = this._keybindingsMap.get(hash)) !== null && _a !== void 0 ? _a : [];
    }
    _keybindingHash(keys, selector) {
        return keys.join(' ') + '_' + selector;
    }
}
//# sourceMappingURL=registry.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/components/ShortcutUI.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */






/** Normalize the query text for a fuzzy search. */
function normalizeQuery(text) {
    return text.replace(/\s+/g, '').toLowerCase();
}
/** Perform a fuzzy search on a single command item. */
function fuzzySearch(item, query) {
    var _a;
    // Create the source text to be searched.
    const category = item.category.toLowerCase();
    const label = ((_a = item['label']) !== null && _a !== void 0 ? _a : '').toLowerCase();
    const source = `${category} ${label}`;
    // Set up the match score and indices array.
    let score = Infinity;
    let indices = null;
    // The regex for search word boundaries
    const rgx = /\b\w/g;
    // Search the source by word boundary.
    // eslint-disable-next-line
    while (true) {
        // Find the next word boundary in the source.
        const rgxMatch = rgx.exec(source);
        // Break if there is no more source context.
        if (!rgxMatch) {
            break;
        }
        // Run the string match on the relevant substring.
        const match = algorithm_dist_index_es6_js_.StringExt.matchSumOfDeltas(source, query, rgxMatch.index);
        // Break if there is no match.
        if (!match) {
            break;
        }
        // Update the match if the score is better.
        if (match && match.score <= score) {
            score = match.score;
            indices = match.indices;
        }
    }
    // Bail if there was no match.
    if (!indices || score === Infinity) {
        return null;
    }
    // Compute the pivot index between category and label text.
    const pivot = category.length + 1;
    // Find the slice index to separate matched indices.
    const j = algorithm_dist_index_es6_js_.ArrayExt.lowerBound(indices, pivot, (a, b) => a - b);
    // Extract the matched category and label indices.
    const categoryIndices = indices.slice(0, j);
    const labelIndices = indices.slice(j);
    // Adjust the label indices for the pivot offset.
    for (let i = 0, n = labelIndices.length; i < n; ++i) {
        labelIndices[i] -= pivot;
    }
    // Handle a pure label match.
    if (categoryIndices.length === 0) {
        return {
            matchType: 0 /* MatchType.Label */,
            categoryIndices: null,
            labelIndices,
            score,
            item
        };
    }
    // Handle a pure category match.
    if (labelIndices.length === 0) {
        return {
            matchType: 1 /* MatchType.Category */,
            categoryIndices,
            labelIndices: null,
            score,
            item
        };
    }
    // Handle a split match.
    return {
        matchType: 2 /* MatchType.Split */,
        categoryIndices,
        labelIndices,
        score,
        item
    };
}
/** Perform a fuzzy match on an array of command items. */
function matchItems(items, query) {
    // Normalize the query text to lower case with no whitespace.
    query = normalizeQuery(query);
    // Create the array to hold the scores.
    let scores = [];
    // Iterate over the items and match against the query.
    for (const item of items.values()) {
        // If the query is empty, all items are matched by default.
        if (!query) {
            scores.push({
                matchType: 3 /* MatchType.Default */,
                categoryIndices: null,
                labelIndices: null,
                score: 0,
                item
            });
            continue;
        }
        // Run the fuzzy search for the item and query.
        let score = fuzzySearch(item, query);
        // Ignore the item if it is not a match.
        if (!score) {
            continue;
        }
        // Add the score to the results.
        scores.push(score);
    }
    // Return the final array of scores.
    return scores;
}
/** Top level React component for widget */
class ShortcutUI extends react_index_js_.Component {
    constructor(props) {
        super(props);
        /** Set the current search query */
        this.updateSearchQuery = (query) => {
            this.setState({
                searchQuery: query
            }, () => {
                const registry = this.state.shortcutRegistry;
                this.setState({
                    filteredShortcutList: this._searchFilterShortcuts(registry)
                }, () => {
                    this.sortShortcuts();
                });
            });
        };
        /**
         * Reset all keybindings to their defaults
         */
        this.resetShortcuts = async () => {
            const settings = await this.props.external.getSettings();
            await settings.set('shortcuts', []);
            await this._refreshShortcutList();
        };
        /**
         * Reset keybindings for given target to defaults.
         */
        this.resetKeybindings = async (target) => {
            await this._setKeybinding(target, []);
        };
        /**
         * Replace the given keybinding with a new keybinding as defined by given keys.
         */
        this.replaceKeybinding = async (target, keybinding, keys) => {
            return this._setKeybinding(target, keys, keybinding);
        };
        /**
         * Delete a single keybinding for given shortcut target.
         */
        this.deleteKeybinding = async (target, keybinding) => {
            await this._setKeybinding(target, [], keybinding);
        };
        /**
         * Add a new keybinding.
         */
        this.addKeybinding = async (target, keys) => {
            await this._setKeybinding(target, keys);
        };
        /** Toggles showing command selectors */
        this.toggleSelectors = () => {
            this.setState({ showSelectors: !this.state.showSelectors });
        };
        /**
         * Set the sort order for the shortcuts listing.
         */
        this.updateSort = (value) => {
            if (value !== this.state.currentSort) {
                this.setState({ currentSort: value }, this.sortShortcuts);
            }
        };
        this.state = {
            shortcutRegistry: null,
            filteredShortcutList: new Array(),
            shortcutsFetched: false,
            searchQuery: '',
            showSelectors: false,
            currentSort: 'category'
        };
    }
    /** Fetch shortcut list on mount */
    componentDidMount() {
        this.props.external.actionRequested.connect(this._onActionRequested, this);
        void this._refreshShortcutList();
    }
    componentWillUnmount() {
        this.props.external.actionRequested.disconnect(this._onActionRequested, this);
    }
    async _onActionRequested(_, action) {
        if (action.request === 'toggle-selectors') {
            return this.toggleSelectors();
        }
        if (action.request === 'reset-all') {
            await this.resetShortcuts();
        }
    }
    /** Fetch shortcut list from SettingRegistry  */
    async _refreshShortcutList() {
        const settings = await this.props.external.getSettings();
        const shortcutRegistry = new ShortcutRegistry({
            commandRegistry: this.props.external.commandRegistry,
            settings
        });
        this.setState({
            shortcutRegistry: shortcutRegistry,
            filteredShortcutList: this._searchFilterShortcuts(shortcutRegistry),
            shortcutsFetched: true
        }, () => {
            this.sortShortcuts();
        });
    }
    /** Filter shortcut list using current search query */
    _searchFilterShortcuts(registry) {
        if (!registry) {
            return [];
        }
        const filteredShortcuts = matchItems(registry, this.state.searchQuery).map((item) => {
            return item.item;
        });
        return filteredShortcuts;
    }
    /**
     * Replace the given keybinding with a new keybinding as defined by given keys.
     *
     * If keybinding is not given a new keybinding will be created.
     * If keys are empty (or include a single empty string) the keybinding will be deleted.
     * If keybinding is a default keybinding and the provided keys differ from default, it will be disabled.
     */
    async _setKeybinding(target, keys, keybinding) {
        var _a, _b, _c, _d, _e;
        if (keys.length === 1 && keys[0] == '') {
            keys = [];
        }
        const settings = await this.props.external.getSettings();
        const userShortcuts = (_a = settings.user.shortcuts) !== null && _a !== void 0 ? _a : [];
        const newUserShortcuts = [];
        let found = false;
        // Copy over existing user keybindings
        for (let shortcut of userShortcuts) {
            // If this is the query keybinding, update it with new `keys`
            if (shortcut.command === target.command &&
                shortcut.selector === target.selector &&
                dist_index_js_.JSONExt.deepEqual((_b = shortcut.args) !== null && _b !== void 0 ? _b : {}, (_c = target.args) !== null && _c !== void 0 ? _c : {}) &&
                keybinding &&
                dist_index_js_.JSONExt.deepEqual(keybinding.keys, shortcut.keys)) {
                const matchesDefault = keybinding &&
                    keybinding.isDefault &&
                    dist_index_js_.JSONExt.deepEqual(keybinding.keys, keys);
                // If the new `keys` are empty, do not copy this one over.
                // Also, if the keybinding is a default keybinding and the desired
                // new `keys` are the same as default, it does not need to be added.
                if (keys.length !== 0 && !matchesDefault) {
                    newUserShortcuts.push({
                        command: shortcut.command,
                        selector: shortcut.selector,
                        keys: keys
                    });
                }
                found = true;
            }
            else if (shortcut.command === target.command &&
                shortcut.selector === target.selector &&
                dist_index_js_.JSONExt.deepEqual((_d = shortcut.args) !== null && _d !== void 0 ? _d : {}, (_e = target.args) !== null && _e !== void 0 ? _e : {}) &&
                !keybinding &&
                keys.length === 0) {
                continue;
            }
            else {
                newUserShortcuts.push(shortcut);
            }
        }
        if (!found) {
            const requiresChange = !keybinding || !dist_index_js_.JSONExt.deepEqual(keybinding.keys, keys);
            const shouldDisableDefault = keybinding && keybinding.isDefault && requiresChange;
            if (shouldDisableDefault) {
                // If the replaced keybinding is the default, disable it.
                newUserShortcuts.push({
                    command: target.command,
                    selector: target.selector,
                    disabled: true,
                    keys: keybinding.keys
                });
            }
            if (keys.length !== 0) {
                newUserShortcuts.push({
                    command: target.command,
                    selector: target.selector,
                    keys: keys
                });
            }
        }
        await settings.set('shortcuts', newUserShortcuts);
        await this._refreshShortcutList();
    }
    /**
     * Sort shortcut list using current sort property.
     */
    sortShortcuts() {
        const shortcuts = this.state.filteredShortcutList;
        let sortCriteria = this.state.currentSort;
        if (sortCriteria === 'command') {
            sortCriteria = 'label';
        }
        const getValue = (target) => {
            var _a;
            if (sortCriteria === 'source') {
                return target.keybindings.every(k => k.isDefault) ? 'default' : 'other';
            }
            return (_a = target[sortCriteria]) !== null && _a !== void 0 ? _a : '';
        };
        shortcuts.sort((a, b) => {
            var _a, _b;
            const compareA = getValue(a);
            const compareB = getValue(b);
            const compareResult = compareA.localeCompare(compareB);
            if (compareResult) {
                return compareResult;
            }
            else {
                const aLabel = (_a = a['label']) !== null && _a !== void 0 ? _a : '';
                const bLabel = (_b = b['label']) !== null && _b !== void 0 ? _b : '';
                return aLabel.localeCompare(bLabel);
            }
        });
        this.setState({ filteredShortcutList: shortcuts });
    }
    render() {
        if (!this.state.shortcutsFetched) {
            return null;
        }
        return (react_index_js_.createElement("div", { className: "jp-Shortcuts-ShortcutUI", id: "jp-shortcutui" },
            react_index_js_.createElement(TopNav, { updateSearchQuery: this.updateSearchQuery, resetShortcuts: this.resetShortcuts, toggleSelectors: this.toggleSelectors, showSelectors: this.state.showSelectors, updateSort: this.updateSort, currentSort: this.state.currentSort, width: this.props.width, translator: this.props.external.translator }),
            react_index_js_.createElement(ShortcutList, { shortcuts: this.state.filteredShortcutList, resetKeybindings: this.resetKeybindings, addKeybinding: this.addKeybinding, replaceKeybinding: this.replaceKeybinding, deleteKeybinding: this.deleteKeybinding, showSelectors: this.state.showSelectors, findConflictsFor: (keys, selector) => {
                    if (this.state.shortcutRegistry) {
                        return this.state.shortcutRegistry.findConflictsFor(keys, selector);
                    }
                    else {
                        console.error('Cannot search for keybinding conflicts at this time: registry is not ready');
                        return [];
                    }
                }, height: this.props.height, external: this.props.external })));
    }
}
//# sourceMappingURL=ShortcutUI.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/renderer.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


const renderShortCut = (props) => {
    return react_index_js_default().createElement(ShortcutUI, { external: props.external, height: 1000, width: 1000 });
};
//# sourceMappingURL=renderer.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var signaling_dist_index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module shortcuts-extension
 */










const SHORTCUT_PLUGIN_ID = '@jupyterlab/shortcuts-extension:shortcuts';
function getExternalForJupyterLab(settingRegistry, app, translator, actionRequested) {
    return {
        translator,
        getSettings: () => settingRegistry.load(SHORTCUT_PLUGIN_ID, true),
        commandRegistry: app.commands,
        actionRequested
    };
}
/**
 * The default shortcuts extension.
 *
 * #### Notes
 * Shortcut values are stored in the setting system. The default values for each
 * shortcut are preset in the settings schema file of this extension.
 * Additionally, each shortcut can be individually set by the end user by
 * modifying its setting (either in the text editor or by modifying its
 * underlying JSON schema file).
 *
 * When setting shortcut selectors, there are two concepts to consider:
 * specificity and matchability. These two interact in sometimes
 * counterintuitive ways. Keyboard events are triggered from an element and
 * they propagate up the DOM until they reach the `documentElement` (`<body>`).
 *
 * When a registered shortcut sequence is fired, the shortcut manager checks
 * the node that fired the event and each of its ancestors until a node matches
 * one or more registered selectors. The *first* matching selector in the
 * chain of ancestors will invoke the shortcut handler and the traversal will
 * end at that point. If a node matches more than one selector, the handler for
 * whichever selector is more *specific* fires.
 * @see https://www.w3.org/TR/css3-selectors/#specificity
 *
 * The practical consequence of this is that a very broadly matching selector,
 * e.g. `'*'` or `'div'` may match and therefore invoke a handler *before* a
 * more specific selector. The most common pitfall is to use the universal
 * (`'*'`) selector. For almost any use case where a global keyboard shortcut is
 * required, using the `'body'` selector is more appropriate.
 */
const shortcuts = {
    id: SHORTCUT_PLUGIN_ID,
    description: 'Adds the keyboard shortcuts editor.',
    requires: [index_js_.ISettingRegistry],
    optional: [lib_index_js_.ITranslator, ui_components_lib_index_js_.IFormRendererRegistry],
    activate: async (app, registry, translator, editorRegistry) => {
        const translator_ = translator !== null && translator !== void 0 ? translator : lib_index_js_.nullTranslator;
        const trans = translator_.load('jupyterlab');
        const { commands } = app;
        let canonical;
        // Stores initial value of the shortcuts `default` value,
        // which reflects the `overrides.json` contents.
        let cannonicalOverrides;
        let loaded = {};
        if (editorRegistry) {
            const actionRequested = new signaling_dist_index_es6_js_.Signal({});
            const isKeybindingNode = (node) => node.dataset['shortcut'] !== undefined;
            app.commands.addCommand(CommandIDs.editBinding, {
                label: trans.__('Edit Keybinding'),
                caption: trans.__('Edit existing keybinding'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    const node = app.contextMenuHitTest(isKeybindingNode);
                    const keybinding = node === null || node === void 0 ? void 0 : node.dataset['keybinding'];
                    const shortcutId = node === null || node === void 0 ? void 0 : node.dataset['shortcut'];
                    if (!shortcutId || !keybinding) {
                        return console.log('Missing shortcut id/keybinding information');
                    }
                    actionRequested.emit({
                        request: 'edit-keybinding',
                        keybinding: parseInt(keybinding, 10),
                        shortcutId
                    });
                }
            });
            app.commands.addCommand(CommandIDs.deleteBinding, {
                label: trans.__('Delete Keybinding'),
                caption: trans.__('Delete chosen keybinding'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    const node = app.contextMenuHitTest(isKeybindingNode);
                    const keybinding = node === null || node === void 0 ? void 0 : node.dataset['keybinding'];
                    const shortcutId = node === null || node === void 0 ? void 0 : node.dataset['shortcut'];
                    if (!shortcutId || !keybinding) {
                        return console.log('Missing shortcut id/keybinding information');
                    }
                    actionRequested.emit({
                        request: 'delete-keybinding',
                        keybinding: parseInt(keybinding, 10),
                        shortcutId
                    });
                }
            });
            app.commands.addCommand(CommandIDs.addBinding, {
                label: trans.__('Add Keybinding'),
                caption: trans.__('Add new keybinding for existing shortcut target'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    const node = app.contextMenuHitTest(isKeybindingNode);
                    const shortcutId = node === null || node === void 0 ? void 0 : node.dataset['shortcut'];
                    if (!shortcutId) {
                        return console.log('Missing shortcut id to add keybinding to');
                    }
                    actionRequested.emit({
                        request: 'add-keybinding',
                        shortcutId
                    });
                }
            });
            commands.addCommand(CommandIDs.toggleSelectors, {
                label: trans.__('Toggle Selectors'),
                caption: trans.__('Toggle command selectors'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    actionRequested.emit({
                        request: 'toggle-selectors'
                    });
                }
            });
            commands.addCommand(CommandIDs.resetAll, {
                label: trans.__('Reset All'),
                caption: trans.__('Reset all shortcuts'),
                describedBy: {
                    args: {
                        type: 'object',
                        properties: {}
                    }
                },
                execute: () => {
                    actionRequested.emit({
                        request: 'reset-all'
                    });
                }
            });
            const component = {
                fieldRenderer: (props) => {
                    return renderShortCut({
                        external: getExternalForJupyterLab(registry, app, translator_, actionRequested),
                        ...props
                    });
                }
            };
            editorRegistry.addRenderer(`${shortcuts.id}.shortcuts`, component);
        }
        /**
         * Populate the plugin's schema defaults.
         */
        function populate(schema) {
            const commands = app.commands.listCommands().join('\n');
            if (!cannonicalOverrides) {
                cannonicalOverrides = dist_index_js_.JSONExt.deepCopy(schema.properties.shortcuts.default);
            }
            loaded = {};
            schema.properties.shortcuts.default = Object.keys(registry.plugins)
                .map(plugin => {
                const shortcuts = registry.plugins[plugin].schema['jupyter.lab.shortcuts'] || [];
                loaded[plugin] = shortcuts;
                return shortcuts;
            })
                .concat([cannonicalOverrides])
                .reduce((acc, val) => {
                if (domutils_dist_index_es6_js_.Platform.IS_MAC) {
                    return acc.concat(val);
                }
                else {
                    // If platform is not MacOS, remove all shortcuts containing Cmd
                    // as they will be modified; e.g. `Cmd A` becomes `A`
                    return acc.concat(val.filter(shortcut => !shortcut.keys.some(key => {
                        const { cmd } = index_es6_js_.CommandRegistry.parseKeystroke(key);
                        return cmd;
                    })));
                }
            }, []) // flatten one level
                .sort((a, b) => a.command.localeCompare(b.command));
            schema.properties.shortcuts.description = trans.__(`Note: To disable a system default shortcut,
copy it to User Preferences and add the
"disabled" key, for example:
{
    "command": "application:activate-next-tab",
    "keys": [
        "Ctrl Shift ]"
    ],
    "selector": "body",
    "disabled": true
}

List of commands followed by keyboard shortcuts:
%1

List of keyboard shortcuts:`, commands);
        }
        registry.pluginChanged.connect(async (_, plugin) => {
            if (plugin !== shortcuts.id) {
                // If the plugin changed its shortcuts, reload everything.
                const oldShortcuts = loaded[plugin];
                const newShortcuts = registry.plugins[plugin].schema['jupyter.lab.shortcuts'] || [];
                if (oldShortcuts === undefined ||
                    !dist_index_js_.JSONExt.deepEqual(oldShortcuts, newShortcuts)) {
                    // Empty the default values to avoid shortcut collisions.
                    canonical = null;
                    const schema = registry.plugins[shortcuts.id].schema;
                    schema.properties.shortcuts.default = cannonicalOverrides;
                    // Reload the settings.
                    await registry.load(shortcuts.id, true);
                }
            }
        });
        // Transform the plugin object to return different schema than the default.
        registry.transform(shortcuts.id, {
            compose: plugin => {
                var _a, _b, _c, _d;
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                const defaults = (_c = (_b = (_a = canonical.properties) === null || _a === void 0 ? void 0 : _a.shortcuts) === null || _b === void 0 ? void 0 : _b.default) !== null && _c !== void 0 ? _c : [];
                const user = {
                    shortcuts: (_d = plugin.data.user.shortcuts) !== null && _d !== void 0 ? _d : []
                };
                const composite = {
                    shortcuts: index_js_.SettingRegistry.reconcileShortcuts(defaults, user.shortcuts)
                };
                plugin.data = { composite, user };
                return plugin;
            },
            fetch: plugin => {
                // Only override the canonical schema the first time.
                if (!canonical) {
                    canonical = dist_index_js_.JSONExt.deepCopy(plugin.schema);
                    populate(canonical);
                }
                return {
                    data: plugin.data,
                    id: plugin.id,
                    raw: plugin.raw,
                    schema: canonical,
                    version: plugin.version
                };
            }
        });
        try {
            // Repopulate the canonical variable after the setting registry has
            // preloaded all initial plugins.
            canonical = null;
            const settings = await registry.load(shortcuts.id);
            Private.loadShortcuts(commands, settings.composite);
            settings.changed.connect(() => {
                Private.loadShortcuts(commands, settings.composite);
            });
        }
        catch (error) {
            console.error(`Loading ${shortcuts.id} failed.`, error);
        }
    },
    autoStart: true
};
/**
 * Export the shortcut plugin as default.
 */
/* harmony default export */ const lib = (shortcuts);
/**
 * A namespace for private module data.
 */
var Private;
(function (Private) {
    /**
     * The internal collection of currently loaded shortcuts.
     */
    let disposables;
    /**
     * Load the keyboard shortcuts from settings.
     */
    function loadShortcuts(commands, composite) {
        var _a;
        const shortcuts = ((_a = composite === null || composite === void 0 ? void 0 : composite.shortcuts) !== null && _a !== void 0 ? _a : []);
        if (disposables) {
            disposables.dispose();
        }
        disposables = shortcuts.reduce((acc, val) => {
            const options = normalizeOptions(val);
            if (options) {
                acc.add(commands.addKeyBinding(options));
            }
            return acc;
        }, new dist_index_es6_js_.DisposableSet());
    }
    Private.loadShortcuts = loadShortcuts;
    /**
     * Normalize potential keyboard shortcut options.
     */
    function normalizeOptions(value) {
        if (!value || typeof value !== 'object') {
            return undefined;
        }
        const { isArray } = Array;
        const valid = 'command' in value &&
            'keys' in value &&
            'selector' in value &&
            isArray(value.keys);
        return valid ? value : undefined;
    }
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 41346:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/shortcuts-extension/style/base.css
var base = __webpack_require__(23729);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/shortcuts-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 92489:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.DataConnector = void 0;
/**
 * An abstract class that adheres to the data connector interface.
 *
 * @typeparam T - The basic entity response type a service's connector.
 *
 * @typeparam U - The basic entity request type, which is conventionally the
 * same as the response type but may be different if a service's implementation
 * requires input data to be different from output responses. Defaults to `T`.
 *
 * @typeparam V - The basic token applied to a request, conventionally a string
 * ID or filter, but may be set to a different type when an implementation
 * requires it. Defaults to `string`.
 *
 * @typeparam W - The type of the optional `query` parameter of the `list`
 * method. Defaults to `string`.
 *
 * #### Notes
 * The only abstract method in this class is the `fetch` method, which must be
 * reimplemented by all subclasses. The `remove` and `save` methods have a
 * default implementation that returns a promise that will always reject. This
 * class is a convenience superclass for connectors that only need to `fetch`.
 */
class DataConnector {
    /**
     * Retrieve the list of items available from the data connector.
     *
     * @param query - The optional query filter to apply to the connector request.
     *
     * @returns A promise that always rejects with an error.
     *
     * #### Notes
     * Subclasses should reimplement if they support a back-end that can list.
     */
    async list(query) {
        throw new Error('DataConnector#list method has not been implemented.');
    }
    /**
     * Remove a value using the data connector.
     *
     * @param id - The identifier for the data being removed.
     *
     * @returns A promise that always rejects with an error.
     *
     * #### Notes
     * Subclasses should reimplement if they support a back-end that can remove.
     */
    async remove(id) {
        throw new Error('DataConnector#remove method has not been implemented.');
    }
    /**
     * Save a value using the data connector.
     *
     * @param id - The identifier for the data being saved.
     *
     * @param value - The data being saved.
     *
     * @returns A promise that always rejects with an error.
     *
     * #### Notes
     * Subclasses should reimplement if they support a back-end that can save.
     */
    async save(id, value) {
        throw new Error('DataConnector#save method has not been implemented.');
    }
}
exports.DataConnector = DataConnector;
//# sourceMappingURL=dataconnector.js.map

/***/ }),

/***/ 34526:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module statedb
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
__exportStar(__webpack_require__(92489), exports);
__exportStar(__webpack_require__(40379), exports);
__exportStar(__webpack_require__(44089), exports);
__exportStar(__webpack_require__(27130), exports);
__exportStar(__webpack_require__(37209), exports);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 40379:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=interfaces.js.map

/***/ }),

/***/ 44089:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.RestorablePool = void 0;
const coreutils_1 = __webpack_require__(72215);
const properties_1 = __webpack_require__(10249);
const signaling_1 = __webpack_require__(46257);
/**
 * An object pool that supports restoration.
 *
 * @typeparam T - The type of object being tracked.
 */
class RestorablePool {
    /**
     * Create a new restorable pool.
     *
     * @param options - The instantiation options for a restorable pool.
     */
    constructor(options) {
        this._added = new signaling_1.Signal(this);
        this._current = null;
        this._currentChanged = new signaling_1.Signal(this);
        this._hasRestored = false;
        this._isDisposed = false;
        this._objects = new Set();
        this._restore = null;
        this._restored = new coreutils_1.PromiseDelegate();
        this._updated = new signaling_1.Signal(this);
        this.namespace = options.namespace;
    }
    /**
     * A signal emitted when an object object is added.
     *
     * #### Notes
     * This signal will only fire when an object is added to the pool.
     * It will not fire if an object injected into the pool.
     */
    get added() {
        return this._added;
    }
    /**
     * The current object.
     *
     * #### Notes
     * The restorable pool does not set `current`. It is intended for client use.
     *
     * If `current` is set to an object that does not exist in the pool, it is a
     * no-op.
     */
    get current() {
        return this._current;
    }
    set current(obj) {
        if (this._current === obj) {
            return;
        }
        if (obj !== null && this._objects.has(obj)) {
            this._current = obj;
            this._currentChanged.emit(this._current);
        }
    }
    /**
     * A signal emitted when the current widget changes.
     */
    get currentChanged() {
        return this._currentChanged;
    }
    /**
     * Test whether the pool is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * A promise resolved when the restorable pool has been restored.
     */
    get restored() {
        return this._restored.promise;
    }
    /**
     * The number of objects held by the pool.
     */
    get size() {
        return this._objects.size;
    }
    /**
     * A signal emitted when an object is updated.
     */
    get updated() {
        return this._updated;
    }
    /**
     * Add a new object to the pool.
     *
     * @param obj - The object object being added.
     *
     * #### Notes
     * The object passed into the pool is added synchronously; its existence in
     * the pool can be checked with the `has()` method. The promise this method
     * returns resolves after the object has been added and saved to an underlying
     * restoration connector, if one is available.
     */
    async add(obj) {
        var _a, _b;
        if (obj.isDisposed) {
            const warning = 'A disposed object cannot be added.';
            console.warn(warning, obj);
            throw new Error(warning);
        }
        if (this._objects.has(obj)) {
            const warning = 'This object already exists in the pool.';
            console.warn(warning, obj);
            throw new Error(warning);
        }
        this._objects.add(obj);
        obj.disposed.connect(this._onInstanceDisposed, this);
        if (Private.injectedProperty.get(obj)) {
            return;
        }
        if (this._restore) {
            const { connector } = this._restore;
            const objName = this._restore.name(obj);
            if (objName) {
                const name = `${this.namespace}:${objName}`;
                const data = (_b = (_a = this._restore).args) === null || _b === void 0 ? void 0 : _b.call(_a, obj);
                Private.nameProperty.set(obj, name);
                await connector.save(name, { data });
            }
        }
        // Emit the added signal.
        this._added.emit(obj);
    }
    /**
     * Dispose of the resources held by the pool.
     *
     * #### Notes
     * Disposing a pool does not affect the underlying data in the data connector,
     * it simply disposes the client-side pool without making any connector calls.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._current = null;
        this._isDisposed = true;
        this._objects.clear();
        signaling_1.Signal.clearData(this);
    }
    /**
     * Find the first object in the pool that satisfies a filter function.
     *
     * @param fn The filter function to call on each object.
     */
    find(fn) {
        const values = this._objects.values();
        for (const value of values) {
            if (fn(value)) {
                return value;
            }
        }
        return undefined;
    }
    /**
     * Iterate through each object in the pool.
     *
     * @param fn - The function to call on each object.
     */
    forEach(fn) {
        this._objects.forEach(fn);
    }
    /**
     * Filter the objects in the pool based on a predicate.
     *
     * @param fn - The function by which to filter.
     */
    filter(fn) {
        const filtered = [];
        this.forEach(obj => {
            if (fn(obj)) {
                filtered.push(obj);
            }
        });
        return filtered;
    }
    /**
     * Inject an object into the restorable pool without the pool handling its
     * restoration lifecycle.
     *
     * @param obj - The object to inject into the pool.
     */
    inject(obj) {
        Private.injectedProperty.set(obj, true);
        return this.add(obj);
    }
    /**
     * Check if this pool has the specified object.
     *
     * @param obj - The object whose existence is being checked.
     */
    has(obj) {
        return this._objects.has(obj);
    }
    /**
     * Restore the objects in this pool's namespace.
     *
     * @param options - The configuration options that describe restoration.
     *
     * @returns A promise that resolves when restoration has completed.
     *
     * #### Notes
     * This function should almost never be invoked by client code. Its primary
     * use case is to be invoked by a layout restorer plugin that handles
     * multiple restorable pools and, when ready, asks them each to restore their
     * respective objects.
     */
    async restore(options) {
        if (this._hasRestored) {
            throw new Error('This pool has already been restored.');
        }
        this._hasRestored = true;
        const { command, connector, registry, when } = options;
        const namespace = this.namespace;
        const promises = when
            ? [connector.list(namespace)].concat(when)
            : [connector.list(namespace)];
        this._restore = options;
        const [saved] = await Promise.all(promises);
        const values = await Promise.all(saved.ids.map(async (id, index) => {
            const value = saved.values[index];
            const args = value && value.data;
            if (args === undefined) {
                return connector.remove(id);
            }
            // Execute the command and if it fails, delete the state restore data.
            return registry
                .execute(command, args)
                .catch(() => connector.remove(id));
        }));
        this._restored.resolve();
        return values;
    }
    /**
     * Save the restore data for a given object.
     *
     * @param obj - The object being saved.
     */
    async save(obj) {
        var _a, _b;
        const injected = Private.injectedProperty.get(obj);
        if (!this._restore || !this.has(obj) || injected) {
            return;
        }
        const { connector } = this._restore;
        const objName = this._restore.name(obj);
        const oldName = Private.nameProperty.get(obj);
        const newName = objName ? `${this.namespace}:${objName}` : '';
        if (oldName && oldName !== newName) {
            await connector.remove(oldName);
        }
        // Set the name property irrespective of whether the new name is null.
        Private.nameProperty.set(obj, newName);
        if (newName) {
            const data = (_b = (_a = this._restore).args) === null || _b === void 0 ? void 0 : _b.call(_a, obj);
            await connector.save(newName, { data });
        }
        if (oldName !== newName) {
            this._updated.emit(obj);
        }
    }
    /**
     * Clean up after disposed objects.
     */
    _onInstanceDisposed(obj) {
        this._objects.delete(obj);
        if (obj === this._current) {
            this._current = null;
            this._currentChanged.emit(this._current);
        }
        if (Private.injectedProperty.get(obj)) {
            return;
        }
        if (!this._restore) {
            return;
        }
        const { connector } = this._restore;
        const name = Private.nameProperty.get(obj);
        if (name) {
            void connector.remove(name);
        }
    }
}
exports.RestorablePool = RestorablePool;
/*
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * An attached property to indicate whether an object has been injected.
     */
    Private.injectedProperty = new properties_1.AttachedProperty({
        name: 'injected',
        create: () => false
    });
    /**
     * An attached property for an object's ID.
     */
    Private.nameProperty = new properties_1.AttachedProperty({
        name: 'name',
        create: () => ''
    });
})(Private || (Private = {}));
//# sourceMappingURL=restorablepool.js.map

/***/ }),

/***/ 27130:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StateDB = void 0;
const signaling_1 = __webpack_require__(46257);
/**
 * The default concrete implementation of a state database.
 */
class StateDB {
    /**
     * Create a new state database.
     *
     * @param options - The instantiation options for a state database.
     */
    constructor(options = {}) {
        this._changed = new signaling_1.Signal(this);
        const { connector, transform } = options;
        this._connector = connector || new StateDB.Connector();
        if (!transform) {
            this._ready = Promise.resolve(undefined);
        }
        else {
            this._ready = transform.then(transformation => {
                const { contents, type } = transformation;
                switch (type) {
                    case 'cancel':
                        return;
                    case 'clear':
                        return this._clear();
                    case 'merge':
                        return this._merge(contents || {});
                    case 'overwrite':
                        return this._overwrite(contents || {});
                    default:
                        return;
                }
            });
        }
    }
    /**
     * A signal that emits the change type any time a value changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Clear the entire database.
     */
    async clear() {
        await this._ready;
        await this._clear();
    }
    /**
     * Retrieve a saved bundle from the database.
     *
     * @param id - The identifier used to retrieve a data bundle.
     *
     * @returns A promise that bears a data payload if available.
     *
     * #### Notes
     * The `id` values of stored items in the state database are formatted:
     * `'namespace:identifier'`, which is the same convention that command
     * identifiers in JupyterLab use as well. While this is not a technical
     * requirement for `fetch()`, `remove()`, and `save()`, it *is* necessary for
     * using the `list(namespace: string)` method.
     *
     * The promise returned by this method may be rejected if an error occurs in
     * retrieving the data. Non-existence of an `id` will succeed with the `value`
     * `undefined`.
     */
    async fetch(id) {
        await this._ready;
        return this._fetch(id);
    }
    /**
     * Retrieve all the saved bundles for a namespace.
     *
     * @param namespace The namespace prefix to retrieve.
     *
     * @returns A promise that bears a collection of payloads for a namespace.
     *
     * #### Notes
     * Namespaces are entirely conventional entities. The `id` values of stored
     * items in the state database are formatted: `'namespace:identifier'`, which
     * is the same convention that command identifiers in JupyterLab use as well.
     *
     * If there are any errors in retrieving the data, they will be logged to the
     * console in order to optimistically return any extant data without failing.
     * This promise will always succeed.
     */
    async list(namespace) {
        await this._ready;
        return this._list(namespace);
    }
    /**
     * Remove a value from the database.
     *
     * @param id - The identifier for the data being removed.
     *
     * @returns A promise that is rejected if remove fails and succeeds otherwise.
     */
    async remove(id) {
        await this._ready;
        await this._remove(id);
        this._changed.emit({ id, type: 'remove' });
    }
    /**
     * Save a value in the database.
     *
     * @param id - The identifier for the data being saved.
     *
     * @param value - The data being saved.
     *
     * @returns A promise that is rejected if saving fails and succeeds otherwise.
     *
     * #### Notes
     * The `id` values of stored items in the state database are formatted:
     * `'namespace:identifier'`, which is the same convention that command
     * identifiers in JupyterLab use as well. While this is not a technical
     * requirement for `fetch()`, `remove()`, and `save()`, it *is* necessary for
     * using the `list(namespace: string)` method.
     */
    async save(id, value) {
        await this._ready;
        await this._save(id, value);
        this._changed.emit({ id, type: 'save' });
    }
    /**
     * Return a serialized copy of the state database's entire contents.
     *
     * @returns A promise that resolves with the database contents as JSON.
     */
    async toJSON() {
        await this._ready;
        const { ids, values } = await this._list();
        return values.reduce((acc, val, idx) => {
            acc[ids[idx]] = val;
            return acc;
        }, {});
    }
    /**
     * Clear the entire database.
     */
    async _clear() {
        await Promise.all((await this._list()).ids.map(id => this._remove(id)));
    }
    /**
     * Fetch a value from the database.
     */
    async _fetch(id) {
        const value = await this._connector.fetch(id);
        if (value) {
            return JSON.parse(value).v;
        }
    }
    /**
     * Fetch a list from the database.
     */
    async _list(namespace = '') {
        const { ids, values } = await this._connector.list(namespace);
        return {
            ids,
            values: values.map(val => JSON.parse(val).v)
        };
    }
    /**
     * Merge data into the state database.
     */
    async _merge(contents) {
        await Promise.all(Object.keys(contents).map(key => contents[key] && this._save(key, contents[key])));
    }
    /**
     * Overwrite the entire database with new contents.
     */
    async _overwrite(contents) {
        await this._clear();
        await this._merge(contents);
    }
    /**
     * Remove a key in the database.
     */
    async _remove(id) {
        return this._connector.remove(id);
    }
    /**
     * Save a key and its value in the database.
     */
    async _save(id, value) {
        return this._connector.save(id, JSON.stringify({ v: value }));
    }
}
exports.StateDB = StateDB;
/**
 * A namespace for StateDB statics.
 */
(function (StateDB) {
    /**
     * An in-memory string key/value data connector.
     */
    class Connector {
        constructor() {
            this._storage = {};
        }
        /**
         * Retrieve an item from the data connector.
         */
        async fetch(id) {
            return this._storage[id];
        }
        /**
         * Retrieve the list of items available from the data connector.
         *
         * @param namespace - If not empty, only keys whose first token before `:`
         * exactly match `namespace` will be returned, e.g. `foo` in `foo:bar`.
         */
        async list(namespace = '') {
            return Object.keys(this._storage).reduce((acc, val) => {
                if (namespace === '' ? true : namespace === val.split(':')[0]) {
                    acc.ids.push(val);
                    acc.values.push(this._storage[val]);
                }
                return acc;
            }, { ids: [], values: [] });
        }
        /**
         * Remove a value using the data connector.
         */
        async remove(id) {
            delete this._storage[id];
        }
        /**
         * Save a value using the data connector.
         */
        async save(id, value) {
            this._storage[id] = value;
        }
    }
    StateDB.Connector = Connector;
})(StateDB || (exports.StateDB = StateDB = {}));
//# sourceMappingURL=statedb.js.map

/***/ }),

/***/ 37209:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.IStateDB = void 0;
const coreutils_1 = __webpack_require__(72215);
/**
 * The default state database token.
 */
exports.IStateDB = new coreutils_1.Token('@jupyterlab/coreutils:IStateDB', `A service for the JupyterLab state database.
  Use this if you want to store data that will persist across page loads.
  See "state database" for more information.`);
//# sourceMappingURL=tokens.js.map

/***/ }),

/***/ 53680:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  GroupItem: () => (/* reexport */ GroupItem),
  IStatusBar: () => (/* reexport */ IStatusBar),
  Popup: () => (/* reexport */ Popup),
  ProgressBar: () => (/* reexport */ ProgressBar),
  ProgressCircle: () => (/* reexport */ ProgressCircle),
  StatusBar: () => (/* reexport */ StatusBar),
  TextItem: () => (/* reexport */ TextItem),
  showPopup: () => (/* reexport */ showPopup)
});

// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var index_js_ = __webpack_require__(78156);
var index_js_default = /*#__PURE__*/__webpack_require__.n(index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/components/group.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A tsx component for a set of items logically grouped together.
 */
function GroupItem(props) {
    const { spacing, children, className, ...rest } = props;
    // Filter out null or undefined children for clean rendering.
    const validChildren = index_js_.Children.toArray(children).filter(Boolean);
    const numChildren = validChildren.length;
    return (index_js_.createElement("div", { className: `jp-StatusBar-GroupItem ${className || ''}`, ...rest }, validChildren.map((child, i) => {
        const key = `group-item-${i}`;
        if (i === 0) {
            return (index_js_.createElement("div", { key: key, style: { marginRight: `${spacing}px` } }, child));
        }
        else if (i === numChildren - 1) {
            return (index_js_.createElement("div", { key: key, style: { marginLeft: `${spacing}px` } }, child));
        }
        else {
            return (index_js_.createElement("div", { key: key, style: { margin: `0px ${spacing}px` } }, child));
        }
    })));
}
//# sourceMappingURL=group.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/components/hover.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * Create and show a popup component.
 *
 * @param options - options for the popup
 *
 * @returns the popup that was created.
 */
function showPopup(options) {
    const dialog = new Popup(options);
    if (!options.startHidden) {
        dialog.launch();
    }
    return dialog;
}
/**
 * A class for a Popup widget.
 */
class Popup extends index_es6_js_.Widget {
    /**
     * Construct a new Popup.
     */
    constructor(options) {
        super();
        this.addClass('jp-ThemedContainer');
        this._body = options.body;
        this._body.addClass('jp-StatusBar-HoverItem');
        this._anchor = options.anchor;
        this._align = options.align;
        if (options.hasDynamicSize) {
            this._observer = new ResizeObserver(() => {
                this.update();
            });
        }
        const layout = (this.layout = new index_es6_js_.PanelLayout());
        layout.addWidget(options.body);
        this._body.node.addEventListener('resize', () => {
            this.update();
        });
    }
    /**
     * Attach the popup widget to the page.
     */
    launch() {
        this._setGeometry();
        index_es6_js_.Widget.attach(this, document.body);
        this.update();
        this._anchor.addClass('jp-mod-clicked');
        this._anchor.removeClass('jp-mod-highlight');
    }
    /**
     * Handle `'update'` messages for the widget.
     */
    onUpdateRequest(msg) {
        this._setGeometry();
        super.onUpdateRequest(msg);
    }
    /**
     * Handle `'after-attach'` messages for the widget.
     */
    onAfterAttach(msg) {
        var _a;
        document.addEventListener('click', this, false);
        this.node.addEventListener('keydown', this, false);
        window.addEventListener('resize', this, false);
        (_a = this._observer) === null || _a === void 0 ? void 0 : _a.observe(this._body.node);
    }
    /**
     * Handle `'before-detach'` messages for the widget.
     */
    onBeforeDetach(msg) {
        var _a;
        (_a = this._observer) === null || _a === void 0 ? void 0 : _a.disconnect();
        document.removeEventListener('click', this, false);
        this.node.removeEventListener('keydown', this, false);
        window.removeEventListener('resize', this, false);
    }
    /**
     * Handle `'resize'` messages for the widget.
     */
    onResize() {
        this.update();
    }
    /**
     * Dispose of the widget.
     */
    dispose() {
        var _a;
        (_a = this._observer) === null || _a === void 0 ? void 0 : _a.disconnect();
        super.dispose();
        this._anchor.removeClass('jp-mod-clicked');
        this._anchor.addClass('jp-mod-highlight');
    }
    /**
     * Handle DOM events for the widget.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'keydown':
                this._evtKeydown(event);
                break;
            case 'click':
                this._evtClick(event);
                break;
            case 'resize':
                this.onResize();
                break;
            default:
                break;
        }
    }
    _evtClick(event) {
        if (!!event.target &&
            !(this._body.node.contains(event.target) ||
                this._anchor.node.contains(event.target))) {
            this.dispose();
        }
    }
    _evtKeydown(event) {
        // Check for escape key
        switch (event.keyCode) {
            case 27: // Escape.
                event.stopPropagation();
                event.preventDefault();
                this.dispose();
                break;
            default:
                break;
        }
    }
    _setGeometry() {
        let aligned = 0;
        const anchorRect = this._anchor.node.getBoundingClientRect();
        const bodyRect = this._body.node.getBoundingClientRect();
        if (this._align === 'right') {
            aligned = -(bodyRect.width - anchorRect.width);
        }
        const style = window.getComputedStyle(this._body.node);
        lib_index_js_.HoverBox.setGeometry({
            anchor: anchorRect,
            host: document.body,
            maxHeight: 500,
            minHeight: 20,
            node: this._body.node,
            offset: {
                horizontal: aligned
            },
            privilege: 'forceAbove',
            style
        });
    }
}
//# sourceMappingURL=hover.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/components/progressBar.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A functional tsx component for a progress bar.
 */
function ProgressBar(props) {
    const { width, percentage, ...rest } = props;
    return (index_js_.createElement("div", { className: 'jp-Statusbar-ProgressBar-progress-bar', role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percentage },
        index_js_.createElement(Filler, { percentage, ...rest, contentWidth: width })));
}
/**
 * A functional tsx component for a partially filled div.
 */
function Filler(props) {
    return (index_js_.createElement("div", { style: {
            width: `${props.percentage}%`
        } },
        index_js_.createElement("p", null, props.content)));
}
//# sourceMappingURL=progressBar.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/components/text.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A functional tsx component for a text item.
 */
function TextItem(props) {
    const { title, source, className, ...rest } = props;
    return (index_js_.createElement("span", { className: className
            ? `jp-StatusBar-TextItem ${className}`
            : 'jp-StatusBar-TextItem', title: title, ...rest }, source));
}
//# sourceMappingURL=text.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/components/progressCircle.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

function ProgressCircle(props) {
    const radius = 104;
    const d = (progress) => {
        const angle = Math.max(progress * 3.6, 0.1);
        const rad = (angle * Math.PI) / 180, x = Math.sin(rad) * radius, y = Math.cos(rad) * -radius, mid = angle < 180 ? 1 : 0, shape = `M 0 0 v -${radius} A ${radius} ${radius} 1 ` +
            mid +
            ' 0 ' +
            x.toFixed(4) +
            ' ' +
            y.toFixed(4) +
            ' z';
        return shape;
    };
    return (index_js_default().createElement("div", { className: 'jp-Statusbar-ProgressCircle', role: "progressbar", "aria-label": props.label || 'Unlabelled progress circle', "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": props.progress, onClick: props.onClick },
        index_js_default().createElement("svg", { viewBox: "0 0 250 250" },
            index_js_default().createElement("circle", { cx: "125", cy: "125", r: `${radius}`, stroke: "var(--jp-inverse-layout-color3)", strokeWidth: "20", fill: "none" }),
            index_js_default().createElement("path", { className: 'jp-Statusbar-ProgressCirclePath', transform: "translate(125,125) scale(.9)", d: d(props.progress), fill: 'var(--jp-inverse-layout-color3)' }))));
}
//# sourceMappingURL=progressCircle.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/components/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/statusbar.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Main status bar object which contains all items.
 */
class StatusBar extends index_es6_js_.Widget {
    constructor() {
        super();
        this._isWindowNarrow = () => {
            // The value for 630px was chosen by trial and error.
            // When the screen width drops below 630px, there is no
            // longer enough space for all the items in the status bar
            // (with notebook open), and items become clipped.
            return window.innerWidth <= 630;
        };
        this._leftRankItems = [];
        this._rightRankItems = [];
        this._statusItems = {};
        this._disposables = new disposable_dist_index_es6_js_.DisposableSet();
        this.addClass('jp-StatusBar-Widget');
        const rootLayout = (this.layout = new index_es6_js_.PanelLayout());
        const leftPanel = (this._leftSide = new index_es6_js_.Panel());
        const middlePanel = (this._middlePanel = new index_es6_js_.Panel());
        const rightPanel = (this._rightSide = new index_es6_js_.Panel());
        leftPanel.addClass('jp-StatusBar-Left');
        middlePanel.addClass('jp-StatusBar-Middle');
        rightPanel.addClass('jp-StatusBar-Right');
        rightPanel.node.style.flexDirection = 'row';
        rootLayout.addWidget(leftPanel);
        rootLayout.addWidget(middlePanel);
        rootLayout.addWidget(rightPanel);
    }
    /**
     * Register a new status item.
     *
     * @param id - a unique id for the status item.
     * @param statusItem - The item to add to the status bar.
     *
     * @returns Disposable status bar item
     */
    registerStatusItem(id, statusItem) {
        if (id in this._statusItems) {
            throw new Error(`Status item ${id} already registered.`);
        }
        // Populate defaults for the optional properties of the status item.
        const fullStatusItem = {
            ...Private.statusItemDefaults,
            ...statusItem
        };
        const { align, item, rank, priority } = fullStatusItem;
        // Connect the activeStateChanged signal to refreshing the status item,
        // if the signal was provided.
        const onActiveStateChanged = () => {
            this._refreshItem(id);
        };
        if (fullStatusItem.activeStateChanged) {
            fullStatusItem.activeStateChanged.connect(onActiveStateChanged);
        }
        const rankItem = { id, rank, priority };
        fullStatusItem.item.addClass('jp-StatusBar-Item');
        this._statusItems[id] = fullStatusItem;
        if (align === 'left') {
            const insertIndex = this._findInsertIndex(this._leftRankItems, rankItem);
            if (insertIndex === -1) {
                this._leftSide.addWidget(item);
                this._leftRankItems.push(rankItem);
            }
            else {
                dist_index_es6_js_.ArrayExt.insert(this._leftRankItems, insertIndex, rankItem);
                this._leftSide.insertWidget(insertIndex, item);
            }
        }
        else if (align === 'right') {
            const insertIndex = dist_index_es6_js_.ArrayExt.findFirstIndex(this._rightRankItems, item => item.rank < rankItem.rank);
            if (insertIndex === -1) {
                this._rightSide.addWidget(item);
                this._rightRankItems.push(rankItem);
            }
            else {
                dist_index_es6_js_.ArrayExt.insert(this._rightRankItems, insertIndex, rankItem);
                this._rightSide.insertWidget(insertIndex, item);
            }
        }
        else {
            this._middlePanel.addWidget(item);
        }
        this._refreshItem(id); // Initially refresh the status item.
        const disposable = new disposable_dist_index_es6_js_.DisposableDelegate(() => {
            delete this._statusItems[id];
            if (fullStatusItem.activeStateChanged) {
                fullStatusItem.activeStateChanged.disconnect(onActiveStateChanged);
            }
            item.parent = null;
            item.dispose();
        });
        this._disposables.add(disposable);
        return disposable;
    }
    /**
     * Dispose of the status bar.
     */
    dispose() {
        this._leftRankItems.length = 0;
        this._rightRankItems.length = 0;
        this._disposables.dispose();
        super.dispose();
    }
    /**
     * Handle an 'update-request' message to the status bar.
     */
    onUpdateRequest(msg) {
        this._refreshAll();
        super.onUpdateRequest(msg);
    }
    _findInsertIndex(side, newItem) {
        return dist_index_es6_js_.ArrayExt.findFirstIndex(side, item => item.rank > newItem.rank);
    }
    _refreshItem(id) {
        const statusItem = this._statusItems[id];
        if (statusItem.isActive() &&
            !(statusItem.priority === 0 && this._isWindowNarrow())) {
            statusItem.item.show();
            statusItem.item.update();
        }
        else {
            statusItem.item.hide();
        }
    }
    _refreshAll() {
        Object.keys(this._statusItems).forEach(id => {
            this._refreshItem(id);
        });
    }
}
/**
 * A namespace for private functionality.
 */
var Private;
(function (Private) {
    /**
     * Default options for a status item, less the item itself.
     */
    Private.statusItemDefaults = {
        align: 'left',
        rank: 0,
        priority: 0,
        isActive: () => true,
        activeStateChanged: undefined
    };
})(Private || (Private = {}));
//# sourceMappingURL=statusbar.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

// tslint:disable-next-line:variable-name
const IStatusBar = new dist_index_js_.Token('@jupyterlab/statusbar:IStatusBar', 'A service for the status bar on the application. Use this if you want to add new status bar items.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/lib/index.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module statusbar
 */



//# sourceMappingURL=index.js.map

/***/ }),

/***/ 546:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/statusbar/style/base.css
var base = __webpack_require__(81435);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/statusbar/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






/***/ }),

/***/ 80357:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ lib)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/application@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/application/lib/index.js)
var index_js_ = __webpack_require__(56732);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/documentsearch@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/documentsearch/lib/index.js)
var documentsearch_lib_index_js_ = __webpack_require__(3894);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/launcher@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/launcher/lib/index.js)
var launcher_lib_index_js_ = __webpack_require__(62961);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/mainmenu@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/mainmenu/lib/index.js)
var mainmenu_lib_index_js_ = __webpack_require__(38911);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/running@^4.5.6 (strict) (fallback: ../node_modules/@jupyterlab/running/lib/index.js)
var running_lib_index_js_ = __webpack_require__(64008);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/settingregistry@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/settingregistry/lib/index.js)
var settingregistry_lib_index_js_ = __webpack_require__(86420);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/terminal@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/terminal/lib/index.js)
var terminal_lib_index_js_ = __webpack_require__(70377);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var ui_components_lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) color@^5.0.0 (strict) (fallback: ../node_modules/color/index.js)
var color_index_js_ = __webpack_require__(85097);
var color_index_js_default = /*#__PURE__*/__webpack_require__.n(color_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal-extension/lib/searchprovider.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * Terminal search provider.
 */
class TerminalSearchProvider extends documentsearch_lib_index_js_.SearchProvider {
    /**
     * Constructor.
     *
     * @param widget The widget to search in.
     */
    constructor(widget) {
        super(widget);
        this.widget = widget;
        this.isReadOnly = true;
        this._currentMatchIndex = null;
        this._matchesCount = null;
        const terminal = this.widget.content;
        terminal.searchAddon.onDidChangeResults(event => {
            const { resultCount, resultIndex } = event;
            this._currentMatchIndex = resultCount > 0 ? resultIndex : null;
            this._matchesCount = resultCount > 0 ? resultCount : null;
        });
        terminal.themeChanged.connect(() => {
            this._onThemeChanged();
        });
        // Get initial theme colors.
        this._onThemeChanged();
    }
    /**
     * Create a search provider for the terminal widget.
     *
     * Note the widget provided is always checked using `isApplicable` before calling this
     * function.
     *
     * @param widget The terminal widget to search in.
     * @param translator [optional] The translator object.
     *
     * @returns The search provider for the terminal widget.
     */
    static createNew(widget, translator) {
        return new TerminalSearchProvider(widget);
    }
    /**
     * Report whether or not this provider has the ability to search on the given object.
     */
    static isApplicable(domain) {
        return (domain instanceof lib_index_js_.MainAreaWidget && domain.content instanceof terminal_lib_index_js_.Terminal);
    }
    /**
     * Clear currently highlighted match.
     */
    async clearHighlight() {
        this._clear();
        return Promise.resolve();
    }
    /**
     * The current index of the selected match.
     */
    get currentMatchIndex() {
        return this._currentMatchIndex;
    }
    /**
     * Stop a search and clear any internal state of the search provider.
     */
    async endQuery() {
        this._clear();
        return Promise.resolve();
    }
    /**
     * Highlight the next match.
     *
     * @returns The next match if available
     */
    async highlightNext() {
        this._next();
        return Promise.resolve(undefined);
    }
    /**
     * Highlight the previous match.
     *
     * @returns The previous match if available.
     */
    async highlightPrevious() {
        this._previous();
        return Promise.resolve(undefined);
    }
    /**
     * The number of matches.
     */
    get matchesCount() {
        return this._matchesCount;
    }
    /**
     * Replace the currently selected match with the provided text
     * Not implemented in the terminal as it is read-only.
     *
     * @returns A promise that resolves once the action has completed.
     */
    async replaceCurrentMatch(newText, loop, options) {
        return Promise.resolve(false);
    }
    /**
     * Replace all matches in the widget with the provided text
     * Not implemented in the terminal as it is read-only.
     *
     * @returns A promise that resolves once the action has completed.
     */
    async replaceAllMatches(newText, options) {
        return Promise.resolve(false);
    }
    /**
     * Start a search using the provided query.
     *
     * @param query A RegExp to be use to perform the search
     */
    async startQuery(query) {
        this._query = query;
        this._next();
        return Promise.resolve();
    }
    /**
     * Clear current search.
     */
    _clear() {
        this._query = undefined;
        this._currentMatchIndex = null;
        this._matchesCount = null;
        this.widget.content.searchAddon.clearDecorations();
    }
    /**
     * Convert a color to the '#rrggbb' format expected by xtermjs SearchAddon.
     *
     * @param color Color to convert.
     * @param backgroundColor Background color to mix with `color` if it is not opaque.
     * @returns Color string of form '#rrggbb'
     */
    _colorToRRGGBB(color, backgroundColor) {
        try {
            let converted = color_index_js_default()(color);
            const alpha = converted.alpha();
            if (alpha < 1) {
                converted = converted.mix(color_index_js_default()(backgroundColor), alpha);
            }
            return converted.hex();
        }
        catch (e) {
            // Return a valid color rather than propagate exception.
            return '#888888';
        }
    }
    _next() {
        if (this._query !== undefined) {
            const { flags, source } = this._query;
            this.widget.content.searchAddon.findNext(source, this._searchOptions(flags));
        }
    }
    /**
     * Update cached xtermjs search decoration options following a theme change.
     * If a search is currently displayed, rerun it to update the colors.
     */
    _onThemeChanged() {
        const theme = this.widget.content.getXTermTheme();
        const { background } = theme;
        const activeMatchBackground = this._colorToRRGGBB(theme.activeMatchBackground, background);
        // matchBackground uses the theme's selectionBackground.
        const matchBackground = this._colorToRRGGBB(theme.selectionBackground, background);
        this._searchDecorationOptions = {
            // The following two need to be in string #rrggbb format to be acceptable to xtermjs.
            activeMatchBackground,
            matchBackground,
            // The following two are compulsory so they need to be set but we do not use them.
            matchOverviewRuler: '',
            activeMatchColorOverviewRuler: ''
        };
        if (this._query !== undefined) {
            // To update the displayed search colors, need to remove colors and rerun the search.
            this.widget.content.searchAddon.clearDecorations();
            this._next();
        }
    }
    _previous() {
        if (this._query !== undefined) {
            const { flags, source } = this._query;
            this.widget.content.searchAddon.findPrevious(source, this._searchOptions(flags));
        }
    }
    /**
     * Return xtermjs search options based on regex query flags and theme colors.
     *
     * @param flags Regex query flags.
     *
     * @returns xtermjs search options.
     */
    _searchOptions(flags) {
        return {
            caseSensitive: !flags.includes('i'),
            incremental: false,
            regex: true,
            wholeWord: false, // Dealt with by regex
            decorations: this._searchDecorationOptions
        };
    }
}
//# sourceMappingURL=searchprovider.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal-extension/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module terminal-extension
 */













/**
 * The command IDs used by the terminal plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.copy = 'terminal:copy';
    CommandIDs.createNew = 'terminal:create-new';
    CommandIDs.open = 'terminal:open';
    CommandIDs.refresh = 'terminal:refresh';
    CommandIDs.increaseFont = 'terminal:increase-font';
    CommandIDs.decreaseFont = 'terminal:decrease-font';
    CommandIDs.paste = 'terminal:paste';
    CommandIDs.setTheme = 'terminal:set-theme';
    CommandIDs.shutdown = 'terminal:shut-down';
})(CommandIDs || (CommandIDs = {}));
/**
 * The default terminal extension.
 */
const lib_plugin = {
    activate,
    id: '@jupyterlab/terminal-extension:plugin',
    description: 'Adds terminal and provides its tracker.',
    provides: terminal_lib_index_js_.ITerminalTracker,
    requires: [settingregistry_lib_index_js_.ISettingRegistry, translation_lib_index_js_.ITranslator],
    optional: [
        lib_index_js_.ICommandPalette,
        launcher_lib_index_js_.ILauncher,
        index_js_.ILayoutRestorer,
        mainmenu_lib_index_js_.IMainMenu,
        lib_index_js_.IThemeManager,
        running_lib_index_js_.IRunningSessionManagers,
        documentsearch_lib_index_js_.ISearchProviderRegistry
    ],
    autoStart: true
};
/**
 * Export the plugin as default.
 */
/* harmony default export */ const lib = (lib_plugin);
/**
 * Activate the terminal plugin.
 */
function activate(app, settingRegistry, translator, palette, launcher, restorer, mainMenu, themeManager, runningSessionManagers, searchRegistry) {
    const trans = translator.load('jupyterlab');
    const { serviceManager, commands } = app;
    const category = trans.__('Terminal');
    const namespace = 'terminal';
    const tracker = new lib_index_js_.WidgetTracker({
        namespace
    });
    // Bail if there are no terminals available.
    if (!serviceManager.terminals.isAvailable()) {
        console.warn('Disabling terminals plugin because they are not available on the server');
        return tracker;
    }
    // Handle state restoration.
    if (restorer) {
        void restorer.restore(tracker, {
            command: CommandIDs.createNew,
            args: widget => ({ name: widget.content.session.name }),
            name: widget => widget.content.session.name
        });
    }
    // The cached terminal options from the setting editor.
    const options = {};
    /**
     * Update the cached option values.
     */
    function updateOptions(settings) {
        // Update the cached options by doing a shallow copy of key/values.
        // This is needed because options is passed and used in addcommand-palette and needs
        // to reflect the current cached values.
        Object.keys(settings.composite).forEach((key) => {
            options[key] = settings.composite[key];
        });
    }
    /**
     * Update terminal
     */
    function updateTerminal(widget) {
        const terminal = widget.content;
        if (!terminal) {
            return;
        }
        Object.keys(options).forEach((key) => {
            terminal.setOption(key, options[key]);
        });
    }
    /**
     * Update the settings of the current tracker instances.
     */
    function updateTracker() {
        tracker.forEach(widget => updateTerminal(widget));
    }
    // Fetch the initial state of the settings.
    settingRegistry
        .load(lib_plugin.id)
        .then(settings => {
        updateOptions(settings);
        updateTracker();
        settings.changed.connect(() => {
            updateOptions(settings);
            updateTracker();
        });
    })
        .catch(Private.showErrorMessage);
    // Subscribe to changes in theme. This is needed as the theme
    // is computed dynamically based on the string value and DOM
    // properties.
    themeManager === null || themeManager === void 0 ? void 0 : themeManager.themeChanged.connect((sender, args) => {
        tracker.forEach(widget => {
            const terminal = widget.content;
            if (terminal.getOption('theme') === 'inherit') {
                terminal.setOption('theme', 'inherit');
            }
        });
    });
    addCommands(app, tracker, settingRegistry, translator, options);
    if (mainMenu) {
        // Add "Terminal Theme" menu below "Theme" menu.
        const themeMenu = new index_es6_js_.Menu({ commands });
        themeMenu.title.label = trans._p('menu', 'Terminal Theme');
        themeMenu.addItem({
            command: CommandIDs.setTheme,
            args: {
                theme: 'inherit',
                displayName: trans.__('Inherit'),
                isPalette: false
            }
        });
        themeMenu.addItem({
            command: CommandIDs.setTheme,
            args: {
                theme: 'light',
                displayName: trans.__('Light'),
                isPalette: false
            }
        });
        themeMenu.addItem({
            command: CommandIDs.setTheme,
            args: { theme: 'dark', displayName: trans.__('Dark'), isPalette: false }
        });
        // Add some commands to the "View" menu.
        mainMenu.settingsMenu.addGroup([
            { command: CommandIDs.increaseFont },
            { command: CommandIDs.decreaseFont },
            { type: 'submenu', submenu: themeMenu }
        ], 40);
        // Add terminal creation to the file menu.
        mainMenu.fileMenu.newMenu.addItem({
            command: CommandIDs.createNew,
            rank: 20
        });
        // Add terminal close-and-shutdown to the file menu.
        mainMenu.fileMenu.closeAndCleaners.add({
            id: CommandIDs.shutdown,
            isEnabled: (w) => tracker.currentWidget !== null && tracker.has(w)
        });
    }
    if (palette) {
        // Add command palette items.
        [
            CommandIDs.createNew,
            CommandIDs.refresh,
            CommandIDs.increaseFont,
            CommandIDs.decreaseFont
        ].forEach(command => {
            palette.addItem({ command, category, args: { isPalette: true } });
        });
        palette.addItem({
            command: CommandIDs.setTheme,
            category,
            args: {
                theme: 'inherit',
                displayName: trans.__('Inherit'),
                isPalette: true
            }
        });
        palette.addItem({
            command: CommandIDs.setTheme,
            category,
            args: { theme: 'light', displayName: trans.__('Light'), isPalette: true }
        });
        palette.addItem({
            command: CommandIDs.setTheme,
            category,
            args: { theme: 'dark', displayName: trans.__('Dark'), isPalette: true }
        });
    }
    // Add a launcher item if the launcher is available.
    if (launcher) {
        launcher.add({
            command: CommandIDs.createNew,
            category: trans.__('Other'),
            rank: 0
        });
    }
    // Add a sessions manager if the running extension is available
    if (runningSessionManagers) {
        addRunningSessionManager(runningSessionManagers, app, translator);
    }
    if (searchRegistry) {
        searchRegistry.add('terminal', TerminalSearchProvider);
    }
    return tracker;
}
/**
 * Add the running terminal manager to the running panel.
 */
function addRunningSessionManager(managers, app, translator) {
    const trans = translator.load('jupyterlab');
    const manager = app.serviceManager.terminals;
    class RunningTerminal {
        constructor(model) {
            this._model = model;
        }
        open() {
            void app.commands.execute('terminal:open', { name: this._model.name });
        }
        icon() {
            return ui_components_lib_index_js_.terminalIcon;
        }
        label() {
            return `terminals/${this._model.name}`;
        }
        shutdown() {
            return manager.shutdown(this._model.name);
        }
    }
    managers.add({
        name: trans.__('Terminals'),
        supportsMultipleViews: false,
        running: () => Array.from(manager.running()).map(model => new RunningTerminal(model)),
        shutdownAll: () => manager.shutdownAll(),
        refreshRunning: () => manager.refreshRunning(),
        runningChanged: manager.runningChanged,
        shutdownLabel: trans.__('Shut Down'),
        shutdownAllLabel: trans.__('Shut Down All'),
        shutdownAllConfirmationText: trans.__('Are you sure you want to permanently shut down all running terminals?')
    });
}
/**
 * Add the commands for the terminal.
 */
function addCommands(app, tracker, settingRegistry, translator, options) {
    var _a;
    const trans = translator.load('jupyterlab');
    const { commands, serviceManager } = app;
    const isEnabled = () => tracker.currentWidget !== null &&
        tracker.currentWidget === app.shell.currentWidget;
    // Add terminal commands.
    commands.addCommand(CommandIDs.createNew, {
        label: args => args['isPalette'] ? trans.__('New Terminal') : trans.__('Terminal'),
        caption: trans.__('Start a new terminal session'),
        icon: args => (args['isPalette'] ? undefined : ui_components_lib_index_js_.terminalIcon),
        execute: async (args) => {
            const name = args['name'];
            const cwd = args['cwd'];
            const localPath = cwd
                ? serviceManager.contents.localPath(cwd)
                : undefined;
            let session;
            if (name) {
                const models = await services_lib_index_js_.TerminalAPI.listRunning(serviceManager.serverSettings);
                if (models.map(d => d.name).includes(name)) {
                    // we are restoring a terminal widget and the corresponding terminal exists
                    // let's connect to it
                    session = serviceManager.terminals.connectTo({ model: { name } });
                }
                else {
                    // we are restoring a terminal widget but the corresponding terminal was closed
                    // let's start a new terminal with the original name
                    session = await serviceManager.terminals.startNew({
                        name,
                        cwd: localPath
                    });
                }
            }
            else {
                // we are creating a new terminal widget with a new terminal
                // let the server choose the terminal name
                session = await serviceManager.terminals.startNew({ cwd: localPath });
            }
            const term = new terminal_lib_index_js_.Terminal(session, options, translator);
            term.title.icon = ui_components_lib_index_js_.terminalIcon;
            term.title.label = '...';
            const main = new lib_index_js_.MainAreaWidget({ content: term, reveal: term.ready });
            app.shell.add(main, 'main', { type: 'Terminal' });
            void tracker.add(main);
            app.shell.activateById(main.id);
            return main;
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    name: {
                        type: 'string',
                        description: trans.__('Terminal session name')
                    },
                    cwd: {
                        type: 'string',
                        description: trans.__('Current working directory for the terminal')
                    },
                    isPalette: {
                        type: 'boolean',
                        description: trans.__('Whether the command is called from the command palette')
                    }
                }
            }
        }
    });
    commands.addCommand(CommandIDs.open, {
        label: trans.__('Open a terminal by its `name`.'),
        execute: args => {
            const name = args['name'];
            // Check for a running terminal with the given name.
            const widget = tracker.find(value => {
                const content = value.content;
                return content.session.name === name || false;
            });
            if (widget) {
                app.shell.activateById(widget.id);
            }
            else {
                // Otherwise, create a new terminal with a given name.
                return commands.execute(CommandIDs.createNew, { name });
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    name: {
                        type: 'string',
                        description: trans.__('Terminal session name to open')
                    }
                },
                required: ['name']
            }
        }
    });
    commands.addCommand(CommandIDs.refresh, {
        label: trans.__('Refresh Terminal'),
        caption: trans.__('Refresh the current terminal session'),
        execute: async () => {
            const current = tracker.currentWidget;
            if (!current) {
                return;
            }
            app.shell.activateById(current.id);
            try {
                await current.content.refresh();
                if (current) {
                    current.content.activate();
                }
            }
            catch (err) {
                Private.showErrorMessage(err);
            }
        },
        icon: args => args['isPalette']
            ? undefined
            : ui_components_lib_index_js_.refreshIcon.bindprops({ stylesheet: 'menuItem' }),
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    isPalette: {
                        type: 'boolean',
                        description: trans.__('Whether the command is called from the command palette')
                    }
                }
            }
        }
    });
    /**
     * Add copy command
     */
    commands.addCommand(CommandIDs.copy, {
        execute: () => {
            var _a;
            const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
            if (!widget) {
                return;
            }
            const text = widget.getSelection();
            if (text) {
                lib_index_js_.Clipboard.copyToSystem(text);
                // Focus the widget to ensure user can continue typing
                widget.activate();
            }
        },
        isEnabled: () => {
            var _a;
            if (!isEnabled()) {
                return false;
            }
            const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
            if (!widget) {
                return false;
            }
            // Enable command if there is a text selection in the terminal
            return widget.hasSelection();
        },
        icon: ui_components_lib_index_js_.copyIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Copy'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    /**
     * Add paste command
     */
    commands.addCommand(CommandIDs.paste, {
        execute: async () => {
            var _a;
            const widget = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
            if (!widget) {
                return;
            }
            // Get data from clipboard
            const clipboard = window.navigator.clipboard;
            const clipboardData = await clipboard.readText();
            if (clipboardData) {
                // Paste data to the terminal
                widget.paste(clipboardData);
                // Focus the widget to ensure user can continue typing
                widget.activate();
            }
        },
        isEnabled: () => { var _a; return Boolean(isEnabled() && ((_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content)); },
        icon: ui_components_lib_index_js_.pasteIcon.bindprops({ stylesheet: 'menuItem' }),
        label: trans.__('Paste'),
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.shutdown, {
        label: trans.__('Shutdown Terminal'),
        execute: () => {
            const current = tracker.currentWidget;
            if (!current) {
                return;
            }
            // The widget is automatically disposed upon session shutdown.
            return current.content.session.shutdown();
        },
        isEnabled,
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.increaseFont, {
        label: trans.__('Increase Terminal Font Size'),
        execute: async () => {
            const { fontSize } = options;
            if (fontSize && fontSize < 72) {
                try {
                    await settingRegistry.set(lib_plugin.id, 'fontSize', fontSize + 1);
                }
                catch (err) {
                    Private.showErrorMessage(err);
                }
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    commands.addCommand(CommandIDs.decreaseFont, {
        label: trans.__('Decrease Terminal Font Size'),
        execute: async () => {
            const { fontSize } = options;
            if (fontSize && fontSize > 9) {
                try {
                    await settingRegistry.set(lib_plugin.id, 'fontSize', fontSize - 1);
                }
                catch (err) {
                    Private.showErrorMessage(err);
                }
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {}
            }
        }
    });
    const themeDisplayedName = {
        inherit: trans.__('Inherit'),
        light: trans.__('Light'),
        dark: trans.__('Dark')
    };
    commands.addCommand(CommandIDs.setTheme, {
        label: args => {
            if (args.theme === undefined) {
                return trans.__('Set terminal theme to the provided `theme`.');
            }
            const theme = args['theme'];
            const displayName = theme in themeDisplayedName
                ? themeDisplayedName[theme]
                : trans.__(theme[0].toUpperCase() + theme.slice(1));
            return args['isPalette']
                ? trans.__('Use Terminal Theme: %1', displayName)
                : displayName;
        },
        caption: trans.__('Set the terminal theme'),
        isToggled: args => {
            const { theme } = options;
            return args['theme'] === theme;
        },
        execute: async (args) => {
            const theme = args['theme'];
            try {
                await settingRegistry.set(lib_plugin.id, 'theme', theme);
                commands.notifyCommandChanged(CommandIDs.setTheme);
            }
            catch (err) {
                console.log(err);
                Private.showErrorMessage(err);
            }
        },
        describedBy: {
            args: {
                type: 'object',
                properties: {
                    theme: {
                        type: 'string',
                        enum: ['inherit', 'light', 'dark'],
                        description: trans.__('Terminal theme to set')
                    },
                    isPalette: {
                        type: 'boolean',
                        description: 'Whether the command is called from the command palette'
                    }
                },
                required: ['theme']
            }
        }
    });
    // All commands with isEnabled defined directly or in a semantic commands
    const commandIds = [
        CommandIDs.refresh,
        CommandIDs.copy,
        CommandIDs.paste,
        CommandIDs.shutdown
    ];
    const notify = () => {
        commandIds.forEach(id => commands.notifyCommandChanged(id));
    };
    tracker.currentChanged.connect(notify);
    (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(notify);
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     *  Utility function for consistent error reporting
     */
    function showErrorMessage(error) {
        console.error(`Failed to configure ${lib_plugin.id}: ${error.message}`);
    }
    Private.showErrorMessage = showErrorMessage;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 47639:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/documentsearch/style/index.js + 1 modules
var documentsearch_style = __webpack_require__(13737);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/launcher/style/index.js + 1 modules
var launcher_style = __webpack_require__(22640);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/mainmenu/style/index.js
var mainmenu_style = __webpack_require__(70022);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/running/style/index.js + 1 modules
var running_style = __webpack_require__(37133);
// EXTERNAL MODULE: ../node_modules/@xterm/xterm/css/xterm.css
var xterm = __webpack_require__(13300);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/terminal/style/base.css
var base = __webpack_require__(81835);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */






;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */











/***/ }),

/***/ 53213:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ITerminal: () => (/* reexport */ ITerminal),
  ITerminalTracker: () => (/* reexport */ ITerminalTracker),
  Terminal: () => (/* reexport */ Terminal)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The editor tracker token.
 */
const ITerminalTracker = new index_js_.Token('@jupyterlab/terminal:ITerminalTracker', `A widget tracker for terminals.
  Use this if you want to be able to iterate over and interact with terminals
  created by the application.`);
/**
 * The namespace for terminals. Separated from the widget so it can be lazy
 * loaded.
 */
var ITerminal;
(function (ITerminal) {
    /**
     * The default options used for creating terminals.
     */
    ITerminal.defaultOptions = {
        theme: 'inherit',
        fontFamily: 'Menlo, Consolas, "DejaVu Sans Mono", monospace',
        fontSize: 13,
        lineHeight: 1.0,
        scrollback: 1000,
        shutdownOnClose: false,
        closeOnExit: true,
        cursorBlink: true,
        initialCommand: '',
        screenReaderMode: false, // False by default, can cause scrollbar mouse interaction issues.
        pasteWithCtrlV: true,
        autoFit: true,
        macOptionIsMeta: false
    };
})(ITerminal || (ITerminal = {}));
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: consume shared module (default) @lumino/domutils@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/domutils/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(19451);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var signaling_dist_index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var widgets_dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) color@^5.0.0 (strict) (fallback: ../node_modules/color/index.js)
var color_index_js_ = __webpack_require__(85097);
var color_index_js_default = /*#__PURE__*/__webpack_require__.n(color_index_js_);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.








/**
 * The class name added to a terminal widget.
 */
const TERMINAL_CLASS = 'jp-Terminal';
/**
 * The class name added to a terminal body.
 */
const TERMINAL_BODY_CLASS = 'jp-Terminal-body';
/**
 * A widget which manages a terminal session.
 */
class Terminal extends widgets_dist_index_es6_js_.Widget {
    /**
     * Construct a new terminal widget.
     *
     * @param session - The terminal session object.
     *
     * @param options - The terminal configuration options.
     *
     * @param translator - The language translator.
     */
    constructor(session, options = {}, translator) {
        super();
        this._needsResize = true;
        this._offsetWidth = -1;
        this._offsetHeight = -1;
        this._isReady = false;
        this._ready = new index_js_.PromiseDelegate();
        this._termOpened = false;
        this._themeChanged = new signaling_dist_index_es6_js_.Signal(this);
        translator = translator || lib_index_js_.nullTranslator;
        this._trans = translator.load('jupyterlab');
        this.session = session;
        // Initialize settings.
        this._options = { ...ITerminal.defaultOptions, ...options };
        const { theme, ...other } = this._options;
        const xtermOptions = {
            theme: Private.getXTermTheme(theme),
            allowProposedApi: true, // To support xtermjs SearchAddon coloring.
            ...other
        };
        this.addClass(TERMINAL_CLASS);
        this._setThemeAttribute(theme);
        // Buffer session message while waiting for the terminal
        let buffer = '';
        const bufferMessage = (sender, msg) => {
            switch (msg.type) {
                case 'stdout':
                    if (msg.content) {
                        buffer += msg.content[0];
                    }
                    break;
                default:
                    break;
            }
        };
        session.messageReceived.connect(bufferMessage);
        session.disposed.connect(() => {
            if (this.getOption('closeOnExit')) {
                this.dispose();
            }
        }, this);
        // Create the xterm.
        Private.createTerminal(xtermOptions)
            .then(([term, fitAddon, searchAddon]) => {
            this._term = term;
            this._fitAddon = fitAddon;
            this._searchAddon = searchAddon;
            this._initializeTerm();
            this.id = `jp-Terminal-${Private.id++}`;
            this.title.label = this._trans.__('Terminal');
            this._isReady = true;
            this._ready.resolve();
            if (buffer) {
                this._term.write(buffer);
            }
            session.messageReceived.disconnect(bufferMessage);
            session.messageReceived.connect(this._onMessage, this);
            if (session.connectionStatus === 'connected') {
                this._initialConnection();
            }
            else {
                session.connectionStatusChanged.connect(this._initialConnection, this);
            }
            this.update();
        })
            .catch(reason => {
            console.error('Failed to create a terminal.\n', reason);
            this._ready.reject(reason);
        });
    }
    /**
     * A promise that is fulfilled when the terminal is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Get a config option for the terminal.
     */
    getOption(option) {
        return this._options[option];
    }
    /**
     * Set a config option for the terminal.
     */
    setOption(option, value) {
        if (option !== 'theme' &&
            (this._options[option] === value || option === 'initialCommand')) {
            return;
        }
        this._options[option] = value;
        switch (option) {
            case 'fontFamily':
                this._term.options.fontFamily = value;
                break;
            case 'fontSize':
                this._term.options.fontSize = value;
                break;
            case 'lineHeight':
                this._term.options.lineHeight = value;
                break;
            case 'screenReaderMode':
                this._term.options.screenReaderMode = value;
                break;
            case 'scrollback':
                this._term.options.scrollback = value;
                break;
            case 'theme':
                this._term.options.theme = {
                    ...Private.getXTermTheme(value)
                };
                this._setThemeAttribute(value);
                this._themeChanged.emit();
                break;
            case 'macOptionIsMeta':
                this._term.options.macOptionIsMeta = value;
                break;
            default:
                // Do not transmit options not listed above to XTerm
                break;
        }
        this._needsResize = true;
        this.update();
    }
    /**
     * Dispose of the resources held by the terminal widget.
     */
    dispose() {
        if (!this.session.isDisposed) {
            if (this.getOption('shutdownOnClose')) {
                this.session.shutdown().catch(reason => {
                    console.error(`Terminal not shut down: ${reason}`);
                });
            }
        }
        void this.ready.then(() => {
            this._term.dispose();
        });
        super.dispose();
    }
    /**
     * Refresh the terminal session.
     *
     * #### Notes
     * Failure to reconnect to the session should be caught appropriately
     */
    async refresh() {
        if (!this.isDisposed && this._isReady) {
            await this.session.reconnect();
            this._term.clear();
        }
    }
    /**
     * Check if terminal has any text selected.
     */
    hasSelection() {
        if (!this.isDisposed && this._isReady) {
            return this._term.hasSelection();
        }
        return false;
    }
    /**
     * Paste text into terminal.
     */
    paste(data) {
        if (!this.isDisposed && this._isReady) {
            return this._term.paste(data);
        }
    }
    /**
     * Get selected text from terminal.
     */
    getSelection() {
        if (!this.isDisposed && this._isReady) {
            return this._term.getSelection();
        }
        return null;
    }
    /**
     * Process a message sent to the widget.
     *
     * @param msg - The message sent to the widget.
     *
     * #### Notes
     * Subclasses may reimplement this method as needed.
     */
    processMessage(msg) {
        super.processMessage(msg);
        switch (msg.type) {
            case 'fit-request':
                this.onFitRequest(msg);
                break;
            default:
                break;
        }
    }
    /**
     * Return xtermjs SearchAddon.
     * Public as needed by TerminalSearchProvider
     */
    get searchAddon() {
        return this._searchAddon;
    }
    /**
     * Return terminal theme.
     * Public as needed by TerminalSearchProvider
     */
    getXTermTheme() {
        const { theme } = this._options;
        return Private.getXTermTheme(theme);
    }
    /**
     * A signal emitted when the terminal theme changes, this includes the when the lab theme
     * changes if the terminal theme is 'inherit'.
     */
    get themeChanged() {
        return this._themeChanged;
    }
    /**
     * Set the size of the terminal when attached if dirty.
     */
    onAfterAttach(msg) {
        this.update();
    }
    /**
     * Set the size of the terminal when shown if dirty.
     */
    onAfterShow(msg) {
        this.update();
    }
    /**
     * On resize, use the computed row and column sizes to resize the terminal.
     */
    onResize(msg) {
        this._offsetWidth = msg.width;
        this._offsetHeight = msg.height;
        this._needsResize = true;
        this.update();
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        var _a;
        if (!this.isVisible || !this.isAttached || !this._isReady) {
            return;
        }
        // Open the terminal if necessary.
        if (!this._termOpened) {
            this._term.open(this.node);
            (_a = this._term.element) === null || _a === void 0 ? void 0 : _a.classList.add(TERMINAL_BODY_CLASS);
            this._termOpened = true;
        }
        if (this._needsResize) {
            this._resizeTerminal();
        }
    }
    /**
     * A message handler invoked on an `'fit-request'` message.
     */
    onFitRequest(msg) {
        const resize = widgets_dist_index_es6_js_.Widget.ResizeMessage.UnknownSize;
        dist_index_es6_js_.MessageLoop.sendMessage(this, resize);
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        var _a;
        (_a = this._term) === null || _a === void 0 ? void 0 : _a.focus();
    }
    _initialConnection() {
        if (this.isDisposed) {
            return;
        }
        if (this.session.connectionStatus !== 'connected') {
            return;
        }
        this.title.label = this._trans.__('Terminal %1', this.session.name);
        this._setSessionSize();
        if (this._options.initialCommand) {
            this.session.send({
                type: 'stdin',
                content: [this._options.initialCommand + '\r']
            });
        }
        // Only run this initial connection logic once.
        this.session.connectionStatusChanged.disconnect(this._initialConnection, this);
    }
    /**
     * Initialize the terminal object.
     */
    _initializeTerm() {
        const term = this._term;
        term.onData((data) => {
            if (this.isDisposed) {
                return;
            }
            this.session.send({
                type: 'stdin',
                content: [data]
            });
        });
        term.onTitleChange((title) => {
            this.title.label = title;
        });
        // Do not add any Ctrl+C/Ctrl+V handling on macOS,
        // where Cmd+C/Cmd+V works as intended.
        if (index_es6_js_.Platform.IS_MAC) {
            return;
        }
        term.attachCustomKeyEventHandler(event => {
            if (event.ctrlKey && event.key === 'c' && term.hasSelection()) {
                // Return so that the usual OS copy happens
                // instead of interrupt signal.
                return false;
            }
            if (event.ctrlKey && event.key === 'v' && this._options.pasteWithCtrlV) {
                // Return so that the usual paste happens.
                return false;
            }
            return true;
        });
    }
    /**
     * Handle a message from the terminal session.
     */
    _onMessage(sender, msg) {
        switch (msg.type) {
            case 'stdout':
                if (msg.content) {
                    this._term.write(msg.content[0]);
                }
                break;
            case 'disconnect':
                this._term.write('\r\n\r\n[Finished… Term Session]\r\n');
                break;
            default:
                break;
        }
    }
    /**
     * Resize the terminal based on computed geometry.
     */
    _resizeTerminal() {
        if (this._options.autoFit) {
            this._fitAddon.fit();
        }
        if (this._offsetWidth === -1) {
            this._offsetWidth = this.node.offsetWidth;
        }
        if (this._offsetHeight === -1) {
            this._offsetHeight = this.node.offsetHeight;
        }
        this._setSessionSize();
        this._needsResize = false;
    }
    /**
     * Set the size of the terminal in the session.
     */
    _setSessionSize() {
        const content = [
            this._term.rows,
            this._term.cols,
            this._offsetHeight,
            this._offsetWidth
        ];
        if (!this.isDisposed) {
            this.session.send({ type: 'set_size', content });
        }
    }
    _setThemeAttribute(theme) {
        if (this.isDisposed) {
            return;
        }
        this.node.setAttribute('data-term-theme', theme ? theme.toLowerCase() : 'inherit');
    }
}
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * An incrementing counter for ids.
     */
    Private.id = 0;
    /**
     * The light terminal theme.
     */
    Private.lightTheme = {
        foreground: '#000',
        background: '#fff',
        cursor: '#616161', // md-grey-700
        cursorAccent: '#F5F5F5', // md-grey-100
        selectionBackground: 'rgba(97, 97, 97, 0.3)', // md-grey-700
        selectionInactiveBackground: 'rgba(189, 189, 189, 0.3)', // md-grey-400
        activeMatchBackground: '#ffee58' // md-yellow-400
    };
    /**
     * The dark terminal theme.
     */
    Private.darkTheme = {
        foreground: '#fff',
        background: '#000',
        cursor: '#fff',
        cursorAccent: '#000',
        selectionBackground: 'rgba(255, 255, 255, 0.3)',
        selectionInactiveBackground: 'rgba(238, 238, 238, 0.3)', // md-grey-200
        activeMatchBackground: '#F57F17' // md-yellow-900
    };
    /**
     * The current theme.
     */
    Private.inheritTheme = () => {
        const bodyStyle = getComputedStyle(document.body);
        const background = bodyStyle.getPropertyValue('--jp-layout-color0').trim();
        let activeMatchBackground = '#ffee58'; // md-yellow-400 for light mode background
        try {
            if (color_index_js_default()(background).isDark()) {
                activeMatchBackground = '#F57F17'; // md-yellow-900 for dark mode background
            }
        }
        catch (e) {
            // Use the light mode default.
        }
        return {
            foreground: bodyStyle.getPropertyValue('--jp-ui-font-color0').trim(),
            background,
            cursor: bodyStyle.getPropertyValue('--jp-ui-font-color1').trim(),
            cursorAccent: bodyStyle
                .getPropertyValue('--jp-ui-inverse-font-color0')
                .trim(),
            selectionBackground: bodyStyle
                .getPropertyValue('--jp-layout-color3')
                .trim(),
            selectionInactiveBackground: bodyStyle
                .getPropertyValue('--jp-layout-color2')
                .trim(),
            activeMatchBackground
        };
    };
    function getXTermTheme(theme) {
        switch (theme) {
            case 'light':
                return Private.lightTheme;
            case 'dark':
                return Private.darkTheme;
            case 'inherit':
            default:
                return Private.inheritTheme();
        }
    }
    Private.getXTermTheme = getXTermTheme;
})(Private || (Private = {}));
/**
 * Utility functions for creating a Terminal widget
 */
(function (Private) {
    let supportWebGL = false;
    let Xterm_;
    let FitAddon_;
    let WeblinksAddon_;
    let SearchAddon_;
    let Renderer_;
    /**
     * Detect if the browser supports WebGL or not.
     *
     * Reference: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/By_example/Detect_WebGL
     */
    function hasWebGLContext() {
        // Create canvas element. The canvas is not added to the
        // document itself, so it is never displayed in the
        // browser window.
        const canvas = document.createElement('canvas');
        // Get WebGLRenderingContext from canvas element.
        const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
        // Report the result.
        try {
            return gl instanceof WebGLRenderingContext;
        }
        catch (error) {
            return false;
        }
    }
    function addRenderer(term) {
        let renderer = new Renderer_();
        term.loadAddon(renderer);
        if (supportWebGL) {
            renderer.onContextLoss(event => {
                console.debug('WebGL context lost - reinitialize Xtermjs renderer.');
                renderer.dispose();
                // If the Webgl context is lost, reinitialize the addon
                addRenderer(term);
            });
        }
    }
    /**
     * Create a xterm.js terminal asynchronously.
     */
    async function createTerminal(options) {
        var _a;
        if (!Xterm_) {
            supportWebGL = hasWebGLContext();
            const [xterm_, fitAddon_, renderer_, weblinksAddon_, searchAddon_] = await Promise.all([
                __webpack_require__.e(/* import() */ 4708).then(__webpack_require__.t.bind(__webpack_require__, 54708, 23)),
                __webpack_require__.e(/* import() */ 4430).then(__webpack_require__.t.bind(__webpack_require__, 44430, 23)),
                supportWebGL
                    ? __webpack_require__.e(/* import() */ 7884).then(__webpack_require__.t.bind(__webpack_require__, 47884, 23))
                    : __webpack_require__.e(/* import() */ 3462).then(__webpack_require__.t.bind(__webpack_require__, 63462, 23)),
                __webpack_require__.e(/* import() */ 6521).then(__webpack_require__.t.bind(__webpack_require__, 86521, 23)),
                __webpack_require__.e(/* import() */ 7730).then(__webpack_require__.t.bind(__webpack_require__, 87730, 23))
            ]);
            Xterm_ = xterm_.Terminal;
            FitAddon_ = fitAddon_.FitAddon;
            Renderer_ =
                (_a = renderer_.WebglAddon) !== null && _a !== void 0 ? _a : renderer_.CanvasAddon;
            WeblinksAddon_ = weblinksAddon_.WebLinksAddon;
            SearchAddon_ = searchAddon_.SearchAddon;
        }
        const term = new Xterm_(options);
        addRenderer(term);
        const fitAddon = new FitAddon_();
        term.loadAddon(fitAddon);
        const searchAddon = new SearchAddon_();
        term.loadAddon(new WeblinksAddon_());
        term.loadAddon(searchAddon);
        return [term, fitAddon, searchAddon];
    }
    Private.createTerminal = createTerminal;
})(Private || (Private = {}));
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/terminal/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module terminal
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 6627:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module theme-dark-extension
 */


/**
 * A plugin for the Jupyter Dark Theme.
 */
const plugin = {
    id: '@jupyterlab/theme-dark-extension:plugin',
    description: 'Adds a dark theme.',
    requires: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.IThemeManager, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.ITranslator],
    activate: (app, manager, translator) => {
        const trans = translator.load('jupyterlab');
        const style = '@jupyterlab/theme-dark-extension/index.css';
        manager.register({
            name: 'JupyterLab Dark',
            displayName: trans.__('JupyterLab Dark'),
            isLight: false,
            themeScrollbars: true,
            load: () => manager.loadCSS(style),
            unload: () => Promise.resolve(undefined)
        });
    },
    autoStart: true
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 95254:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module theme-dark-high-contrast-extension
 */


/**
 * A plugin for the Jupyter Dark Theme.
 */
const plugin = {
    id: '@jupyterlab/theme-dark-high-contrast-extension:plugin',
    description: 'Adds a dark high contrast theme.',
    requires: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.IThemeManager, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.ITranslator],
    activate: (app, manager, translator) => {
        const trans = translator.load('jupyterlab');
        const style = '@jupyterlab/theme-dark-high-contrast-extension/index.css';
        manager.register({
            name: 'JupyterLab Dark High Contrast',
            displayName: trans.__('JupyterLab Dark High Contrast'),
            isLight: false,
            themeScrollbars: true,
            load: () => manager.loadCSS(style),
            unload: () => Promise.resolve(undefined)
        });
    },
    autoStart: true
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 45426:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module theme-light-extension
 */


/**
 * A plugin for the Jupyter Light Theme.
 */
const plugin = {
    id: '@jupyterlab/theme-light-extension:plugin',
    description: 'Adds a light theme.',
    requires: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.IThemeManager, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.ITranslator],
    activate: (app, manager, translator) => {
        const trans = translator.load('jupyterlab');
        const style = '@jupyterlab/theme-light-extension/index.css';
        manager.register({
            name: 'JupyterLab Light',
            displayName: trans.__('JupyterLab Light'),
            isLight: true,
            themeScrollbars: false,
            load: () => manager.loadCSS(style),
            unload: () => Promise.resolve(undefined)
        });
    },
    autoStart: true
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 40062:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74853);
/* harmony import */ var _jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_toc__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_4__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module toc-extension
 */





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

/***/ }),

/***/ 65315:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/toc/style/index.js + 1 modules
var toc_style = __webpack_require__(91302);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/toc-extension/style/base.css
var base = __webpack_require__(96384);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







/***/ }),

/***/ 75921:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ITableOfContentsRegistry: () => (/* reexport */ ITableOfContentsRegistry),
  ITableOfContentsTracker: () => (/* reexport */ ITableOfContentsTracker),
  TableOfContents: () => (/* reexport */ TableOfContents),
  TableOfContentsFactory: () => (/* reexport */ TableOfContentsFactory),
  TableOfContentsItem: () => (/* reexport */ TableOfContentsItem),
  TableOfContentsModel: () => (/* reexport */ TableOfContentsModel),
  TableOfContentsPanel: () => (/* reexport */ TableOfContentsPanel),
  TableOfContentsRegistry: () => (/* reexport */ TableOfContentsRegistry),
  TableOfContentsTracker: () => (/* reexport */ TableOfContentsTracker),
  TableOfContentsTree: () => (/* reexport */ TableOfContentsTree),
  TableOfContentsUtils: () => (/* reexport */ utils_namespaceObject),
  TableOfContentsWidget: () => (/* reexport */ TableOfContentsWidget)
});

// NAMESPACE OBJECT: ../node_modules/@jupyterlab/toc/lib/utils/markdown.js
var markdown_namespaceObject = {};
__webpack_require__.r(markdown_namespaceObject);
__webpack_require__.d(markdown_namespaceObject, {
  getHeadingId: () => (getHeadingId),
  getHeadings: () => (getHeadings),
  isMarkdown: () => (isMarkdown),
  parseHeadings: () => (parseHeadings)
});

// NAMESPACE OBJECT: ../node_modules/@jupyterlab/toc/lib/utils/index.js
var utils_namespaceObject = {};
__webpack_require__.r(utils_namespaceObject);
__webpack_require__.d(utils_namespaceObject, {
  Markdown: () => (markdown_namespaceObject),
  NUMBERING_CLASS: () => (NUMBERING_CLASS),
  addPrefix: () => (addPrefix),
  clearNumbering: () => (clearNumbering),
  filterHeadings: () => (filterHeadings),
  getHTMLHeadings: () => (getHTMLHeadings),
  getPrefix: () => (getPrefix),
  isHTML: () => (isHTML)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var index_js_ = __webpack_require__(4666);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/factory.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Timeout for throttling ToC rendering following model changes.
 *
 * @private
 */
const RENDER_TIMEOUT = 200;
/**
 * Abstract table of contents model factory for IDocumentWidget.
 */
class TableOfContentsFactory {
    /**
     * Constructor
     *
     * @param tracker Widget tracker
     */
    constructor(tracker) {
        this.tracker = tracker;
    }
    /**
     * Whether the factory can handle the widget or not.
     *
     * @param widget - widget
     * @returns boolean indicating a ToC can be generated
     */
    isApplicable(widget) {
        if (!this.tracker.has(widget)) {
            return false;
        }
        return true;
    }
    /**
     * Create a new table of contents model for the widget
     *
     * @param widget - widget
     * @param configuration - Table of contents configuration
     * @returns The table of contents model
     */
    createNew(widget, configuration) {
        const model = this._createNew(widget, configuration);
        const context = widget.context;
        const updateHeadings = () => {
            model.refresh().catch(reason => {
                console.error('Failed to update the table of contents.', reason);
            });
        };
        const monitor = new index_js_.ActivityMonitor({
            signal: context.model.contentChanged,
            timeout: RENDER_TIMEOUT
        });
        monitor.activityStopped.connect(updateHeadings);
        const updateTitle = () => {
            model.title = index_js_.PathExt.basename(context.localPath);
        };
        context.pathChanged.connect(updateTitle);
        context.ready
            .then(() => {
            updateTitle();
            updateHeadings();
        })
            .catch(reason => {
            console.error(`Failed to initiate headings for ${context.localPath}.`);
        });
        widget.disposed.connect(() => {
            monitor.activityStopped.disconnect(updateHeadings);
            context.pathChanged.disconnect(updateTitle);
        });
        return model;
    }
}
//# sourceMappingURL=factory.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Table of contents registry token.
 */
const ITableOfContentsRegistry = new dist_index_js_.Token('@jupyterlab/toc:ITableOfContentsRegistry', 'A service to register table of content factory.');
/**
 * Table of contents tracker token.
 */
const ITableOfContentsTracker = new dist_index_js_.Token('@jupyterlab/toc:ITableOfContentsTracker', 'A widget tracker for table of contents.');
/**
 * Namespace for table of contents interface
 */
var TableOfContents;
(function (TableOfContents) {
    /**
     * Default table of content configuration
     */
    TableOfContents.defaultConfig = {
        baseNumbering: 1,
        maximalDepth: 4,
        numberingH1: true,
        numberHeaders: false,
        includeOutput: true,
        syncCollapseState: false
    };
})(TableOfContents || (TableOfContents = {}));
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/model.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * Abstract table of contents model.
 */
class TableOfContentsModel extends lib_index_js_.VDomModel {
    /**
     * Constructor
     *
     * @param widget The widget to search in
     * @param configuration Default model configuration
     */
    constructor(widget, configuration) {
        super();
        this.widget = widget;
        this._activeHeading = null;
        this._activeHeadingChanged = new index_es6_js_.Signal(this);
        this._collapseChanged = new index_es6_js_.Signal(this);
        this._configuration = configuration !== null && configuration !== void 0 ? configuration : { ...TableOfContents.defaultConfig };
        this._headings = new Array();
        this._headingsChanged = new index_es6_js_.Signal(this);
        this._isActive = false;
        this._isRefreshing = false;
        this._needsRefreshing = false;
    }
    /**
     * Current active entry.
     *
     * @returns table of contents active entry
     */
    get activeHeading() {
        return this._activeHeading;
    }
    /**
     * Signal emitted when the active heading changes.
     */
    get activeHeadingChanged() {
        return this._activeHeadingChanged;
    }
    /**
     * Signal emitted when a table of content section collapse state changes.
     */
    get collapseChanged() {
        return this._collapseChanged;
    }
    /**
     * Model configuration
     */
    get configuration() {
        return this._configuration;
    }
    /**
     * List of headings.
     *
     * @returns table of contents list of headings
     */
    get headings() {
        return this._headings;
    }
    /**
     * Signal emitted when the headings changes.
     */
    get headingsChanged() {
        return this._headingsChanged;
    }
    /**
     * Whether the model is active or not.
     *
     * #### Notes
     * An active model means it is displayed in the table of contents.
     * This can be used by subclass to limit updating the headings.
     */
    get isActive() {
        return this._isActive;
    }
    set isActive(v) {
        this._isActive = v;
        // Refresh on activation expect if it is always active
        //  => a ToC model is always active e.g. when displaying numbering in the document
        if (this._isActive && !this.isAlwaysActive) {
            this.refresh().catch(reason => {
                console.error('Failed to refresh ToC model.', reason);
            });
        }
    }
    /**
     * Whether the model gets updated even if the table of contents panel
     * is hidden or not.
     *
     * #### Notes
     * For example, ToC models use to add title numbering will
     * set this to true.
     */
    get isAlwaysActive() {
        return false;
    }
    /**
     * List of configuration options supported by the model.
     */
    get supportedOptions() {
        return ['maximalDepth'];
    }
    /**
     * Document title
     */
    get title() {
        return this._title;
    }
    set title(v) {
        if (v !== this._title) {
            this._title = v;
            this.stateChanged.emit();
        }
    }
    /**
     * Refresh the headings list.
     */
    async refresh() {
        if (this._isRefreshing) {
            // Schedule a refresh if one is in progress
            this._needsRefreshing = true;
            return Promise.resolve();
        }
        this._isRefreshing = true;
        try {
            const newHeadings = await this.getHeadings();
            if (this._needsRefreshing) {
                this._needsRefreshing = false;
                this._isRefreshing = false;
                return this.refresh();
            }
            if (newHeadings && !this._areHeadingsEqual(newHeadings, this._headings)) {
                this._headings = newHeadings;
                this.stateChanged.emit();
                this._headingsChanged.emit();
            }
        }
        finally {
            this._isRefreshing = false;
        }
    }
    /**
     * Set a new active heading.
     *
     * @param heading The new active heading
     * @param emitSignal Whether to emit the activeHeadingChanged signal or not.
     */
    setActiveHeading(heading, emitSignal = true) {
        if (this._activeHeading !== heading) {
            this._activeHeading = heading;
            this.stateChanged.emit();
        }
        if (emitSignal) {
            // Always emit the signal to trigger a scroll even if the value did not change
            this._activeHeadingChanged.emit(this._activeHeading);
        }
    }
    /**
     * Model configuration setter.
     *
     * @param c New configuration
     */
    setConfiguration(c) {
        const newConfiguration = { ...this._configuration, ...c };
        if (!dist_index_js_.JSONExt.deepEqual(this._configuration, newConfiguration)) {
            this._configuration = newConfiguration;
            this.refresh().catch(reason => {
                console.error('Failed to update the table of contents.', reason);
            });
        }
    }
    /**
     * Callback on heading collapse.
     *
     * @param options.heading The heading to change state (all headings if not provided)
     * @param options.collapsed The new collapsed status (toggle existing status if not provided)
     */
    toggleCollapse(options) {
        var _a, _b;
        if (options.heading) {
            options.heading.collapsed =
                (_a = options.collapsed) !== null && _a !== void 0 ? _a : !options.heading.collapsed;
            this.stateChanged.emit();
            this._collapseChanged.emit(options.heading);
        }
        else {
            // Use the provided state or collapsed all except if all are collapsed
            const newState = (_b = options.collapsed) !== null && _b !== void 0 ? _b : !this.headings.some(h => { var _a; return !((_a = h.collapsed) !== null && _a !== void 0 ? _a : false); });
            this.headings.forEach(h => (h.collapsed = newState));
            this.stateChanged.emit();
            this._collapseChanged.emit(null);
        }
    }
    /**
     * Test if two headings are equal or not.
     *
     * @param heading1 First heading
     * @param heading2 Second heading
     * @returns Whether the headings are equal.
     */
    isHeadingEqual(heading1, heading2) {
        return (heading1.level === heading2.level &&
            heading1.text === heading2.text &&
            heading1.prefix === heading2.prefix);
    }
    /**
     * Test if two list of headings are equal or not.
     *
     * @param headings1 First list of headings
     * @param headings2 Second list of headings
     * @returns Whether the array are equal.
     */
    _areHeadingsEqual(headings1, headings2) {
        if (headings1.length === headings2.length) {
            for (let i = 0; i < headings1.length; i++) {
                if (!this.isHeadingEqual(headings1[i], headings2[i])) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }
}
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var react_index_js_ = __webpack_require__(78156);
// EXTERNAL MODULE: consume shared module (default) @jupyter/react-components@~0.16.7 (singleton) (fallback: ../node_modules/@jupyter/react-components/lib/index.js)
var react_components_lib_index_js_ = __webpack_require__(75816);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/tocitem.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * React component for a table of contents entry.
 */
class TableOfContentsItem extends react_index_js_.PureComponent {
    /**
     * Renders a table of contents entry.
     *
     * @returns rendered entry
     */
    render() {
        const { children, isActive, heading, onCollapse, onMouseDown } = this.props;
        // Handling toggle of collapse and expand
        const handleToggle = (event) => {
            // This will toggle the state and call the appropriate collapse or expand function
            if (!event.defaultPrevented &&
                event.target.expanded !== !heading.collapsed) {
                event.preventDefault();
                onCollapse(heading);
            }
        };
        return (react_index_js_.createElement(react_components_lib_index_js_.TreeItem, { className: 'jp-tocItem jp-TreeItem nested', selected: isActive, expanded: !heading.collapsed, onExpand: handleToggle, onMouseDown: (event) => {
                // React only on deepest item
                if (!event.defaultPrevented) {
                    event.preventDefault();
                    onMouseDown(heading);
                }
            }, onKeyUp: event => {
                // React on key up because key down is used for tree view navigation
                // and therefore key-down on Enter is default prevented to change the
                // selection state
                if (!event.defaultPrevented && event.key === 'Enter' && !isActive) {
                    event.preventDefault();
                    onMouseDown(heading);
                }
            } },
            react_index_js_.createElement("div", { className: "jp-tocItem-heading" },
                react_index_js_.createElement("span", { className: "jp-tocItem-content", title: heading.text, ...heading.dataset },
                    heading.prefix,
                    heading.text)),
            children));
    }
}
//# sourceMappingURL=tocitem.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/toctree.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * React component for a table of contents tree.
 */
class TableOfContentsTree extends react_index_js_.PureComponent {
    /**
     * Renders a table of contents tree.
     */
    render() {
        const { documentType } = this.props;
        return (react_index_js_.createElement(react_components_lib_index_js_.TreeView, { className: 'jp-TableOfContents-content jp-TreeView', 'data-document-type': documentType }, this.buildTree()));
    }
    /**
     * Convert the flat headings list to a nested tree list
     */
    buildTree() {
        if (this.props.headings.length === 0) {
            return [];
        }
        const buildOneTree = (currentIndex) => {
            const items = this.props.headings;
            const children = new Array();
            const current = items[currentIndex];
            let nextCandidateIndex = currentIndex + 1;
            while (nextCandidateIndex < items.length) {
                const candidateItem = items[nextCandidateIndex];
                if (candidateItem.level <= current.level) {
                    break;
                }
                const [child, nextIndex] = buildOneTree(nextCandidateIndex);
                children.push(child);
                nextCandidateIndex = nextIndex;
            }
            const currentTree = (react_index_js_.createElement(TableOfContentsItem, { key: `${current.level}-${currentIndex}-${current.text}`, isActive: !!this.props.activeHeading && current === this.props.activeHeading, heading: current, onMouseDown: this.props.setActiveHeading, onCollapse: this.props.onCollapseChange }, children.length ? children : null));
            return [currentTree, nextCandidateIndex];
        };
        const trees = new Array();
        let currentIndex = 0;
        while (currentIndex < this.props.headings.length) {
            const [tree, nextIndex] = buildOneTree(currentIndex);
            trees.push(tree);
            currentIndex = nextIndex;
        }
        return trees;
    }
}
//# sourceMappingURL=toctree.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/treeview.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Table of contents widget.
 */
class TableOfContentsWidget extends lib_index_js_.VDomRenderer {
    /**
     * Constructor
     *
     * @param options Widget options
     */
    constructor(options) {
        super(options.model);
        this._placeholderHeadline = options.placeholderHeadline;
        this._placeholderText = options.placeholderText;
    }
    /**
     * Render the content of this widget using the virtual DOM.
     *
     * This method will be called anytime the widget needs to be rendered, which
     * includes layout triggered rendering.
     */
    render() {
        if (!this.model || this.model.headings.length === 0) {
            return (react_index_js_.createElement("div", { className: "jp-TableOfContents-placeholder" },
                react_index_js_.createElement("div", { className: "jp-TableOfContents-placeholderContent" },
                    react_index_js_.createElement("h3", null, this._placeholderHeadline),
                    react_index_js_.createElement("p", null, this._placeholderText))));
        }
        return (react_index_js_.createElement(TableOfContentsTree, { activeHeading: this.model.activeHeading, documentType: this.model.documentType, headings: this.model.headings, onCollapseChange: (heading) => {
                this.model.toggleCollapse({ heading });
            }, setActiveHeading: (heading) => {
                this.model.setActiveHeading(heading);
            } }));
    }
}
//# sourceMappingURL=treeview.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/panel.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * Table of contents sidebar panel.
 */
class TableOfContentsPanel extends lib_index_js_.SidePanel {
    /**
     * Constructor
     *
     * @param translator - Translator tool
     */
    constructor(translator) {
        super({ content: new dist_index_es6_js_.Panel(), translator });
        this._model = null;
        this.addClass('jp-TableOfContents');
        this._title = new Private.Header(this._trans.__('Table of Contents'));
        this.header.addWidget(this._title);
        this._treeview = new TableOfContentsWidget({
            placeholderHeadline: this._trans.__('No Headings'),
            placeholderText: this._trans.__('The table of contents shows headings in notebooks and supported files.')
        });
        this._treeview.addClass('jp-TableOfContents-tree');
        this.content.addWidget(this._treeview);
    }
    /**
     * Get the current model.
     */
    get model() {
        return this._model;
    }
    set model(newValue) {
        var _a, _b;
        if (this._model !== newValue) {
            (_a = this._model) === null || _a === void 0 ? void 0 : _a.stateChanged.disconnect(this._onTitleChanged, this);
            this._model = newValue;
            if (this._model) {
                this._model.isActive = this.isVisible;
            }
            (_b = this._model) === null || _b === void 0 ? void 0 : _b.stateChanged.connect(this._onTitleChanged, this);
            this._onTitleChanged();
            this._treeview.model = this._model;
        }
    }
    onAfterHide(msg) {
        super.onAfterHide(msg);
        if (this._model) {
            this._model.isActive = false;
        }
    }
    onBeforeShow(msg) {
        super.onBeforeShow(msg);
        if (this._model) {
            this._model.isActive = true;
        }
    }
    _onTitleChanged() {
        var _a, _b;
        this._title.setTitle((_b = (_a = this._model) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : this._trans.__('Table of Contents'));
    }
}
/**
 * Private helpers namespace
 */
var Private;
(function (Private) {
    /**
     * Panel header
     */
    class Header extends dist_index_es6_js_.Widget {
        /**
         * Constructor
         *
         * @param title - Title text
         */
        constructor(title) {
            const node = document.createElement('h2');
            node.textContent = title;
            node.classList.add('jp-text-truncated');
            super({ node });
            this._title = node;
        }
        /**
         * Set the header title.
         */
        setTitle(title) {
            this._title.textContent = title;
        }
    }
    Private.Header = Header;
})(Private || (Private = {}));
//# sourceMappingURL=panel.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/registry.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Class for registering table of contents generators.
 */
class TableOfContentsRegistry {
    constructor() {
        this._generators = new Map();
        this._idCounter = 0;
    }
    /**
     * Finds a table of contents model for a widget.
     *
     * ## Notes
     *
     * -   If unable to find a table of contents model, the method return `undefined`.
     *
     * @param widget - widget
     * @param configuration - Default model configuration
     * @returns Table of contents model
     */
    getModel(widget, configuration) {
        for (const generator of this._generators.values()) {
            if (generator.isApplicable(widget)) {
                return generator.createNew(widget, configuration);
            }
        }
    }
    /**
     * Adds a table of contents generator to the registry.
     *
     * @param generator - table of contents generator
     */
    add(generator) {
        const id = this._idCounter++;
        this._generators.set(id, generator);
        return new disposable_dist_index_es6_js_.DisposableDelegate(() => {
            this._generators.delete(id);
        });
    }
}
//# sourceMappingURL=registry.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/tracker.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * Table of contents tracker
 */
class TableOfContentsTracker {
    /**
     * Constructor
     */
    constructor() {
        this.modelMapping = new WeakMap();
    }
    /**
     * Track a given model.
     *
     * @param widget Widget
     * @param model Table of contents model
     */
    add(widget, model) {
        this.modelMapping.set(widget, model);
    }
    /**
     * Get the table of contents model associated with a given widget.
     *
     * @param widget Widget
     * @returns The table of contents model
     */
    get(widget) {
        const model = this.modelMapping.get(widget);
        return !model || model.isDisposed ? null : model;
    }
}
//# sourceMappingURL=tracker.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/utils/common.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Class used to mark numbering prefix for headings in a document.
 */
const NUMBERING_CLASS = 'numbering-entry';
/**
 * Filter headings for table of contents and compute associated prefix
 *
 * @param headings Headings to process
 * @param options Options
 * @param initialLevels Initial levels for prefix computation
 * @returns Extracted headings
 */
function filterHeadings(headings, options, initialLevels = []) {
    const config = {
        ...TableOfContents.defaultConfig,
        ...options
    };
    const levels = initialLevels;
    let previousLevel = levels.length;
    const filteredHeadings = new Array();
    for (const heading of headings) {
        if (heading.skip) {
            continue;
        }
        const level = heading.level;
        if (level > 0 && level <= config.maximalDepth) {
            const prefix = getPrefix(level, previousLevel, levels, config);
            previousLevel = level;
            filteredHeadings.push({
                ...heading,
                prefix
            });
        }
    }
    return filteredHeadings;
}
/**
 * Returns whether a MIME type corresponds to either HTML.
 *
 * @param mime - MIME type string
 * @returns boolean indicating whether a provided MIME type corresponds to either HTML
 *
 * @example
 * const bool = isHTML('text/html');
 * // returns true
 *
 * @example
 * const bool = isHTML('text/plain');
 * // returns false
 */
function isHTML(mime) {
    return mime === 'text/html';
}
/**
 * Parse a HTML string for headings.
 *
 * ### Notes
 * The html string is not sanitized - use with caution
 *
 * @param html HTML string to parse
 * @param force Whether to ignore HTML headings with class jp-toc-ignore and tocSkip or not
 * @returns Extracted headings
 */
function getHTMLHeadings(html, force = true) {
    var _a;
    const container = document.createElement('div');
    container.innerHTML = html;
    const headings = new Array();
    const headers = container.querySelectorAll('h1, h2, h3, h4, h5, h6');
    for (const h of headers) {
        const level = parseInt(h.tagName[1], 10);
        headings.push({
            text: (_a = h.textContent) !== null && _a !== void 0 ? _a : '',
            level,
            id: h === null || h === void 0 ? void 0 : h.getAttribute('id'),
            skip: h.classList.contains('jp-toc-ignore') || h.classList.contains('tocSkip')
        });
    }
    return headings;
}
/**
 * Add an heading prefix to a HTML node.
 *
 * @param container HTML node containing the heading
 * @param selector Heading selector
 * @param prefix Title prefix to add
 * @returns The modified HTML element
 */
function addPrefix(container, selector, prefix) {
    let element = container.querySelector(selector);
    if (!element) {
        return null;
    }
    if (!element.querySelector(`span.${NUMBERING_CLASS}`)) {
        addNumbering(element, prefix);
    }
    else {
        // There are likely multiple elements with the same selector
        //  => use the first one without prefix
        const allElements = container.querySelectorAll(selector);
        for (const el of allElements) {
            if (!el.querySelector(`span.${NUMBERING_CLASS}`)) {
                element = el;
                addNumbering(el, prefix);
                break;
            }
        }
    }
    return element;
}
/**
 * Update the levels and create the numbering prefix
 *
 * @param level Current level
 * @param previousLevel Previous level
 * @param levels Levels list
 * @param options Options
 * @returns The numbering prefix
 */
function getPrefix(level, previousLevel, levels, options) {
    const { baseNumbering, numberingH1, numberHeaders } = options;
    let prefix = '';
    if (numberHeaders) {
        const highestLevel = numberingH1 ? 1 : 2;
        if (level > previousLevel) {
            // Initialize the new levels
            for (let l = previousLevel; l < level - 1; l++) {
                levels[l] = 0;
            }
            levels[level - 1] = level === highestLevel ? baseNumbering : 1;
        }
        else {
            // Increment the current level
            levels[level - 1] += 1;
            // Drop higher levels
            if (level < previousLevel) {
                levels.splice(level);
            }
        }
        // If the header list skips some level, replace missing elements by 0
        if (numberingH1) {
            prefix = levels.map(level => level !== null && level !== void 0 ? level : 0).join('.') + '. ';
        }
        else {
            if (levels.length > 1) {
                prefix =
                    levels
                        .slice(1)
                        .map(level => level !== null && level !== void 0 ? level : 0)
                        .join('.') + '. ';
            }
        }
    }
    return prefix;
}
/**
 * Add a numbering prefix to a HTML element.
 *
 * @param el HTML element
 * @param numbering Numbering prefix to add
 */
function addNumbering(el, numbering) {
    el.insertAdjacentHTML('afterbegin', `<span class="${NUMBERING_CLASS}">${numbering}</span>`);
}
/**
 * Remove all numbering nodes from element
 * @param element Node to clear
 */
function clearNumbering(element) {
    element === null || element === void 0 ? void 0 : element.querySelectorAll(`span.${NUMBERING_CLASS}`).forEach(el => {
        el.remove();
    });
}
//# sourceMappingURL=common.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/apputils@~4.6.6 (singleton) (fallback: ../node_modules/@jupyterlab/apputils/lib/index.js)
var apputils_lib_index_js_ = __webpack_require__(40124);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/utils/markdown.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * Build the heading html id.
 *
 * @param raw Raw markdown heading
 * @param level Heading level
 * @param sanitizer HTML sanitizer
 */
async function getHeadingId(markdownParser, raw, level, sanitizer) {
    try {
        const host = document.createElement('div');
        await (0,rendermime_lib_index_js_.renderMarkdown)({
            markdownParser,
            host,
            source: raw,
            trusted: false,
            sanitizer: sanitizer !== null && sanitizer !== void 0 ? sanitizer : new apputils_lib_index_js_.Sanitizer(),
            shouldTypeset: false,
            resolver: null,
            linkHandler: null,
            latexTypesetter: null
        });
        const header = host.querySelector(`h${level}`);
        if (!header) {
            return null;
        }
        return (sanitizer === null || sanitizer === void 0 ? void 0 : sanitizer.allowNamedProperties)
            ? header.id
            : header.getAttribute('data-jupyter-id');
    }
    catch (reason) {
        console.error('Failed to parse a heading.', reason);
    }
    return null;
}
/**
 * Parses the provided string and returns a list of headings.
 *
 * @param text - Markdown text
 * @param parser - A Markdown parser instance used to render the content to HTML.
 * @returns List of headings
 *
 * @remarks
 * Renders Markdown to HTML and extracts `<h1>`–`<h6>` elements.
 * Returns an empty list if the parser is `null`.
 */
async function parseHeadings(markdownText, parser) {
    if (!parser || !parser.getHeadingTokens) {
        console.warn('Unable to parse headings; Markdown parser is missing or does not implement getHeadingTokens().');
        return [];
    }
    // Get the heading tokens from the parser, including the source line metadata
    const headingTokens = await parser.getHeadingTokens(markdownText);
    // Convert each heading token into HTML and extract the heading elements,
    // as this provides a clean and reliable way to retrieve the headings.
    const parseHeadings = await Promise.all(headingTokens.map(async (token) => {
        const renderedHtml = await parser.render(token.raw);
        const dom = new DOMParser().parseFromString(renderedHtml, 'text/html');
        const htmlHeadings = Array.from(dom.querySelectorAll('h1, h2, h3, h4, h5, h6'));
        return htmlHeadings.map(e => {
            var _a;
            return ({
                text: ((_a = e.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '',
                line: token.line,
                level: parseInt(e.tagName[1], 10),
                raw: token.raw.replace(/\n+$/, ''),
                skip: skipHeading.test(token.raw)
            });
        });
    }));
    return parseHeadings.reduce((acc, curr) => acc.concat(curr), []);
}
/**
 * @deprecated in favour of async parseHeadings()
 *
 * Parses the provided string and returns a list of headings.
 *
 * @param text - Input text
 * @returns List of headings
 *
 */
function getHeadings(text) {
    // Split the text into lines:
    const lines = text.split('\n');
    // Iterate over the lines to get the header level and text for each line:
    const headings = new Array();
    let isCodeBlock;
    let openingFence = 0;
    let fenceType;
    let lineIdx = 0;
    // Don't check for Markdown headings if in a YAML frontmatter block.
    // We can only start a frontmatter block on the first line of the file.
    // At other positions in a markdown file, '---' represents a horizontal rule.
    if (lines[lineIdx] === '---') {
        // Search for another '---' and treat that as the end of the frontmatter.
        // If we don't find one, treat the file as containing no frontmatter.
        for (let frontmatterEndLineIdx = lineIdx + 1; frontmatterEndLineIdx < lines.length; frontmatterEndLineIdx++) {
            if (lines[frontmatterEndLineIdx] === '---') {
                lineIdx = frontmatterEndLineIdx + 1;
                break;
            }
        }
    }
    for (; lineIdx < lines.length; lineIdx++) {
        const line = lines[lineIdx];
        if (line === '') {
            // Bail early
            continue;
        }
        // Don't check for Markdown headings if in a code block
        if (line.startsWith('```') || line.startsWith('~~~')) {
            const closingFence = extractLeadingFences(line);
            if (closingFence === 0)
                continue;
            if (openingFence === 0) {
                fenceType = line.charAt(0);
                isCodeBlock = !isCodeBlock;
                openingFence = closingFence;
                continue;
            }
            else if (fenceType === line.charAt(0) && closingFence >= openingFence) {
                isCodeBlock = !isCodeBlock;
                openingFence = 0;
                fenceType = '';
            }
        }
        if (isCodeBlock) {
            continue;
        }
        const heading = parseHeading(line, lines[lineIdx + 1]); // append the next line to capture alternative style Markdown headings
        if (heading) {
            headings.push({
                ...heading,
                line: lineIdx
            });
        }
    }
    return headings;
}
// Returns the length of ``` or ~~~ fences.
function extractLeadingFences(line) {
    let match;
    if (line.startsWith('`'))
        match = line.match(/^(`{3,})/);
    else
        match = line.match(/^(~{3,})/);
    return match ? match[0].length : 0;
}
const MARKDOWN_MIME_TYPE = [
    'text/x-ipythongfm',
    'text/x-markdown',
    'text/x-gfm',
    'text/markdown'
];
/**
 * Returns whether a MIME type corresponds to a Markdown flavor.
 *
 * @param mime - MIME type string
 * @returns boolean indicating whether a provided MIME type corresponds to a Markdown flavor
 *
 * @example
 * const bool = isMarkdown('text/markdown');
 * // returns true
 *
 * @example
 * const bool = isMarkdown('text/plain');
 * // returns false
 */
function isMarkdown(mime) {
    return MARKDOWN_MIME_TYPE.includes(mime);
}
/**
 * Parses a heading, if one exists, from a provided string.
 *
 * ## Notes
 *
 * -   Heading examples:
 *
 *     -   Markdown heading:
 *
 *         ```
 *         # Foo
 *         ```
 *
 *     -   Markdown heading (alternative style):
 *
 *         ```
 *         Foo
 *         ===
 *         ```
 *
 *         ```
 *         Foo
 *         ---
 *         ```
 *
 *     -   HTML heading:
 *
 *         ```
 *         <h3>Foo</h3>
 *         ```
 *
 * @private
 * @param line - Line to parse
 * @param nextLine - The line after the one to parse
 * @returns heading info
 *
 * @example
 * const out = parseHeading('### Foo\n');
 * // returns {'text': 'Foo', 'level': 3}
 *
 * @example
 * const out = parseHeading('Foo\n===\n');
 * // returns {'text': 'Foo', 'level': 1}
 *
 * @example
 * const out = parseHeading('<h4>Foo</h4>\n');
 * // returns {'text': 'Foo', 'level': 4}
 *
 * @example
 * const out = parseHeading('Foo');
 * // returns null
 */
function parseHeading(line, nextLine) {
    // Case: Markdown heading
    let match = line.match(/^([#]{1,6}) (.*)/);
    if (match) {
        return {
            text: cleanTitle(match[2]),
            level: match[1].length,
            raw: line,
            skip: skipHeading.test(match[0])
        };
    }
    // Case: Markdown heading (alternative style)
    if (nextLine) {
        match = nextLine.match(/^ {0,3}([=]{2,}|[-]{2,})\s*$/);
        if (match) {
            return {
                text: cleanTitle(line),
                level: match[1][0] === '=' ? 1 : 2,
                raw: [line, nextLine].join('\n'),
                skip: skipHeading.test(line)
            };
        }
    }
    // Case: HTML heading (WARNING: this is not particularly robust, as HTML headings can span multiple lines)
    match = line.match(/<h([1-6]).*>(.*)<\/h\1>/i);
    if (match) {
        return {
            text: match[2],
            level: parseInt(match[1], 10),
            skip: skipHeading.test(match[0]),
            raw: line
        };
    }
    return null;
}
function cleanTitle(heading) {
    // take special care to parse Markdown links into raw text
    return heading.replace(/\[(.+)\]\(.+\)/g, '$1');
}
/**
 * Ignore title with html tag with a class name equal to `jp-toc-ignore` or `tocSkip`
 */
const skipHeading = /<\w+\s(.*?\s)?class="(.*?\s)?(jp-toc-ignore|tocSkip)(\s.*?)?"(\s.*?)?>/;
//# sourceMappingURL=markdown.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/utils/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module toc
 */









// Namespace the utils

//# sourceMappingURL=index.js.map

/***/ }),

/***/ 91302:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/toc/style/base.css
var base = __webpack_require__(34037);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/toc/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */









/***/ }),

/***/ 6604:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_console__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69897);
/* harmony import */ var _jupyterlab_console__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_console__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4666);
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82591);
/* harmony import */ var _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(58448);
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(61832);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59835);
/* harmony import */ var _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(78839);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_8__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module tooltip-extension
 */









/**
 * The command IDs used by the tooltip plugin.
 */
var CommandIDs;
(function (CommandIDs) {
    CommandIDs.dismiss = 'tooltip:dismiss';
    CommandIDs.launchConsole = 'tooltip:launch-console';
    CommandIDs.launchNotebook = 'tooltip:launch-notebook';
    CommandIDs.launchFile = 'tooltip:launch-file';
})(CommandIDs || (CommandIDs = {}));
/**
 * The main tooltip manager plugin.
 */
const manager = {
    id: '@jupyterlab/tooltip-extension:manager',
    description: 'Provides the tooltip manager.',
    autoStart: true,
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],
    provides: _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager,
    activate: (app, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');
        let tooltip = null;
        // Add tooltip dismiss command.
        app.commands.addCommand(CommandIDs.dismiss, {
            label: trans.__('Dismiss the tooltip'),
            execute: () => {
                if (tooltip) {
                    tooltip.dispose();
                    tooltip = null;
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
        return {
            invoke(options) {
                const detail = 0;
                const { anchor, editor, kernel, rendermime } = options;
                if (tooltip) {
                    tooltip.dispose();
                    tooltip = null;
                }
                return Private.fetch({ detail, editor, kernel })
                    .then(bundle => {
                    tooltip = new _jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.Tooltip({ anchor, bundle, editor, rendermime });
                    _lumino_widgets__WEBPACK_IMPORTED_MODULE_8__.Widget.attach(tooltip, document.body);
                })
                    .catch(() => {
                    /* Fails silently. */
                });
            }
        };
    }
};
/**
 * The console tooltip plugin.
 */
const consoles = {
    // FIXME This should be in @jupyterlab/console-extension
    id: '@jupyterlab/tooltip-extension:consoles',
    description: 'Adds the tooltip capability to consoles.',
    autoStart: true,
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],
    requires: [_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager, _jupyterlab_console__WEBPACK_IMPORTED_MODULE_0__.IConsoleTracker],
    activate: (app, manager, consoles, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');
        // Add tooltip launch command.
        app.commands.addCommand(CommandIDs.launchConsole, {
            label: trans.__('Open the tooltip'),
            execute: () => {
                var _a, _b;
                const parent = consoles.currentWidget;
                if (!parent) {
                    return;
                }
                const anchor = parent.console;
                const editor = (_a = anchor.promptCell) === null || _a === void 0 ? void 0 : _a.editor;
                const kernel = (_b = anchor.sessionContext.session) === null || _b === void 0 ? void 0 : _b.kernel;
                const rendermime = anchor.rendermime;
                // If all components necessary for rendering exist, create a tooltip.
                if (!!editor && !!kernel && !!rendermime) {
                    return manager.invoke({ anchor, editor, kernel, rendermime });
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
    }
};
/**
 * The notebook tooltip plugin.
 */
const notebooks = {
    // FIXME This should be in @jupyterlab/notebook-extension
    id: '@jupyterlab/tooltip-extension:notebooks',
    description: 'Adds the tooltip capability to notebooks.',
    autoStart: true,
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],
    requires: [_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager, _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_3__.INotebookTracker],
    activate: (app, manager, notebooks, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');
        // Add tooltip launch command.
        app.commands.addCommand(CommandIDs.launchNotebook, {
            label: trans.__('Open the tooltip'),
            execute: () => {
                var _a, _b;
                const parent = notebooks.currentWidget;
                if (!parent) {
                    return;
                }
                const anchor = parent.content;
                const editor = (_a = anchor.activeCell) === null || _a === void 0 ? void 0 : _a.editor;
                const kernel = (_b = parent.sessionContext.session) === null || _b === void 0 ? void 0 : _b.kernel;
                const rendermime = anchor.rendermime;
                // If all components necessary for rendering exist, create a tooltip.
                if (!!editor && !!kernel && !!rendermime) {
                    return manager.invoke({ anchor, editor, kernel, rendermime });
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
    }
};
/**
 * The file editor tooltip plugin.
 */
const files = {
    // FIXME This should be in @jupyterlab/fileeditor-extension
    id: '@jupyterlab/tooltip-extension:files',
    description: 'Adds the tooltip capability to file editors.',
    autoStart: true,
    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],
    requires: [_jupyterlab_tooltip__WEBPACK_IMPORTED_MODULE_5__.ITooltipManager, _jupyterlab_fileeditor__WEBPACK_IMPORTED_MODULE_2__.IEditorTracker, _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_4__.IRenderMimeRegistry],
    activate: (app, manager, editorTracker, rendermime, translator) => {
        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');
        // Keep a list of active ISessions so that we can
        // clean them up when they are no longer needed.
        const activeSessions = {};
        const sessions = app.serviceManager.sessions;
        // When the list of running sessions changes,
        // check to see if there are any kernels with a
        // matching path for the file editors.
        const onRunningChanged = (sender, models) => {
            editorTracker.forEach(file => {
                const model = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_7__.find)(models, m => file.context.path === m.path);
                if (model) {
                    const oldSession = activeSessions[file.id];
                    // If there is a matching path, but it is the same
                    // session as we previously had, do nothing.
                    if (oldSession && oldSession.id === model.id) {
                        return;
                    }
                    // Otherwise, dispose of the old session and reset to
                    // a new CompletionConnector.
                    if (oldSession) {
                        delete activeSessions[file.id];
                        oldSession.dispose();
                    }
                    const session = sessions.connectTo({ model });
                    activeSessions[file.id] = session;
                }
                else {
                    const session = activeSessions[file.id];
                    if (session) {
                        session.dispose();
                        delete activeSessions[file.id];
                    }
                }
            });
        };
        onRunningChanged(sessions, sessions.running());
        sessions.runningChanged.connect(onRunningChanged);
        // Clean up after a widget when it is disposed
        editorTracker.widgetAdded.connect((sender, widget) => {
            widget.disposed.connect(w => {
                const session = activeSessions[w.id];
                if (session) {
                    session.dispose();
                    delete activeSessions[w.id];
                }
            });
        });
        // Add tooltip launch command.
        app.commands.addCommand(CommandIDs.launchFile, {
            label: trans.__('Open the tooltip'),
            execute: async () => {
                const parent = editorTracker.currentWidget;
                const kernel = parent &&
                    activeSessions[parent.id] &&
                    activeSessions[parent.id].kernel;
                if (!kernel) {
                    return;
                }
                const anchor = parent.content;
                const editor = anchor === null || anchor === void 0 ? void 0 : anchor.editor;
                // If all components necessary for rendering exist, create a tooltip.
                if (!!editor && !!kernel && !!rendermime) {
                    return manager.invoke({ anchor, editor, kernel, rendermime });
                }
            },
            describedBy: {
                args: {
                    type: 'object',
                    properties: {}
                }
            }
        });
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    manager,
    consoles,
    notebooks,
    files
];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);
/**
 * A namespace for private data.
 */
var Private;
(function (Private) {
    /**
     * A counter for outstanding requests.
     */
    let pending = 0;
    /**
     * Fetch a tooltip's content from the API server.
     */
    function fetch(options) {
        const { detail, editor, kernel } = options;
        const code = editor.model.sharedModel.getSource();
        const position = editor.getCursorPosition();
        const offset = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.Text.jsIndexToCharIndex(editor.getOffsetAt(position), code);
        // Clear hints if the new text value is empty or kernel is unavailable.
        if (!code || !kernel) {
            return Promise.reject(void 0);
        }
        const contents = {
            code,
            cursor_pos: offset,
            detail_level: detail || 0
        };
        const current = ++pending;
        return kernel.requestInspect(contents).then(msg => {
            const value = msg.content;
            // If a newer request is pending, bail.
            if (current !== pending) {
                return Promise.reject(void 0);
            }
            // If request fails or returns negative results, bail.
            if (value.status !== 'ok' || !value.found) {
                return Promise.reject(void 0);
            }
            return Promise.resolve(value.data);
        });
    }
    Private.fetch = fetch;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 87635:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/codeeditor/style/index.js + 1 modules
var codeeditor_style = __webpack_require__(7526);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/rendermime/style/index.js + 1 modules
var rendermime_style = __webpack_require__(45304);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/console/style/index.js + 1 modules
var console_style = __webpack_require__(42249);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/fileeditor/style/index.js + 1 modules
var fileeditor_style = __webpack_require__(44696);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/notebook/style/index.js + 1 modules
var notebook_style = __webpack_require__(47456);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js + 1 modules
var ui_components_style = __webpack_require__(26238);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/tooltip/style/base.css
var base = __webpack_require__(10398);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/tooltip/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/tooltip/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */







;// CONCATENATED MODULE: ../node_modules/@jupyterlab/tooltip-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */










/***/ }),

/***/ 51647:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ITooltipManager: () => (/* reexport */ ITooltipManager),
  Tooltip: () => (/* reexport */ Tooltip)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/tooltip/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The tooltip manager token.
 */
const ITooltipManager = new index_js_.Token('@jupyterlab/tooltip:ITooltipManager', 'A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.');
//# sourceMappingURL=tokens.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/ui-components@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/ui-components/lib/index.js)
var lib_index_js_ = __webpack_require__(12331);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/rendermime@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/rendermime/lib/index.js)
var rendermime_lib_index_js_ = __webpack_require__(61832);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(23055);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/tooltip/lib/widget.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * The class name added to each tooltip.
 */
const TOOLTIP_CLASS = 'jp-Tooltip';
/**
 * The class name added to the tooltip content.
 */
const CONTENT_CLASS = 'jp-Tooltip-content';
/**
 * The class added to the body when a tooltip exists on the page.
 */
const BODY_CLASS = 'jp-mod-tooltip';
/**
 * The minimum height of a tooltip widget.
 */
const MIN_HEIGHT = 20;
/**
 * The maximum height of a tooltip widget.
 */
const MAX_HEIGHT = 250;
/**
 * A flag to indicate that event handlers are caught in the capture phase.
 */
const USE_CAPTURE = true;
/**
 * A tooltip widget.
 */
class Tooltip extends index_es6_js_.Widget {
    /**
     * Instantiate a tooltip.
     */
    constructor(options) {
        super();
        this._content = null;
        this.addClass('jp-ThemedContainer');
        const layout = (this.layout = new index_es6_js_.PanelLayout());
        const model = new rendermime_lib_index_js_.MimeModel({ data: options.bundle });
        this.anchor = options.anchor;
        this.addClass(TOOLTIP_CLASS);
        this.hide();
        this._editor = options.editor;
        this._position = options.position;
        this._rendermime = options.rendermime;
        const mimeType = this._rendermime.preferredMimeType(options.bundle, 'any');
        if (!mimeType) {
            return;
        }
        this._content = this._rendermime.createRenderer(mimeType);
        this._content
            .renderModel(model)
            .then(() => this._setGeometry())
            .catch(error => console.error('tooltip rendering failed', error));
        this._content.addClass(CONTENT_CLASS);
        layout.addWidget(this._content);
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this._content) {
            this._content.dispose();
            this._content = null;
        }
        super.dispose();
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the dock panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        if (this.isHidden || this.isDisposed) {
            return;
        }
        const { node } = this;
        const target = event.target;
        switch (event.type) {
            case 'keydown':
                if (node.contains(target)) {
                    return;
                }
                this.dispose();
                break;
            case 'mousedown':
                if (node.contains(target)) {
                    this.activate();
                    return;
                }
                this.dispose();
                break;
            case 'scroll':
                this._evtScroll(event);
                break;
            default:
                break;
        }
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        this.node.tabIndex = 0;
        this.node.focus();
    }
    /**
     * Handle `'after-attach'` messages.
     */
    onAfterAttach(msg) {
        document.body.classList.add(BODY_CLASS);
        document.addEventListener('keydown', this, USE_CAPTURE);
        document.addEventListener('mousedown', this, USE_CAPTURE);
        this.anchor.node.addEventListener('scroll', this, USE_CAPTURE);
        this.update();
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        document.body.classList.remove(BODY_CLASS);
        document.removeEventListener('keydown', this, USE_CAPTURE);
        document.removeEventListener('mousedown', this, USE_CAPTURE);
        this.anchor.node.removeEventListener('scroll', this, USE_CAPTURE);
    }
    /**
     * Handle `'update-request'` messages.
     */
    onUpdateRequest(msg) {
        if (this.isHidden) {
            this.show();
        }
        this._setGeometry();
        super.onUpdateRequest(msg);
    }
    /**
     * Handle scroll events for the widget
     */
    _evtScroll(event) {
        // All scrolls except scrolls in the actual hover box node may cause the
        // referent editor that anchors the node to move, so the only scroll events
        // that can safely be ignored are ones that happen inside the hovering node.
        if (this.node.contains(event.target)) {
            return;
        }
        this.update();
    }
    /**
     * Find the position of the first character of the current token.
     */
    _getTokenPosition() {
        const editor = this._editor;
        const cursor = editor.getCursorPosition();
        const end = editor.getOffsetAt(cursor);
        const line = editor.getLine(cursor.line);
        if (!line) {
            return;
        }
        const tokens = line.substring(0, end).split(/\W+/);
        const last = tokens[tokens.length - 1];
        const start = last ? end - last.length : end;
        return editor.getPositionAt(start);
    }
    /**
     * Set the geometry of the tooltip widget.
     */
    _setGeometry() {
        // determine position for hover box placement
        const position = this._position ? this._position : this._getTokenPosition();
        if (!position) {
            return;
        }
        const editor = this._editor;
        const anchor = editor.getCoordinateForPosition(position);
        if (!anchor) {
            return;
        }
        const style = window.getComputedStyle(this.node);
        const paddingLeft = parseInt(style.paddingLeft, 10) || 0;
        const host = editor.host.closest('.jp-MainAreaWidget > .lm-Widget') ||
            editor.host;
        // Calculate the geometry of the tooltip.
        lib_index_js_.HoverBox.setGeometry({
            anchor,
            host,
            maxHeight: MAX_HEIGHT,
            minHeight: MIN_HEIGHT,
            node: this.node,
            offset: { horizontal: -1 * paddingLeft },
            privilege: 'below',
            outOfViewDisplay: {
                top: 'stick-inside',
                bottom: 'stick-inside'
            },
            style: style
        });
    }
}
//# sourceMappingURL=widget.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/tooltip/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module tooltip
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 56815:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38911);
/* harmony import */ var _jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86420);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);
/* ----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module translation-extension
 */





/**
 * Translation plugins
 */
const PLUGIN_ID = '@jupyterlab/translation-extension:plugin';
/**
 * Provide the translator connector as a separate plugin to allow for alternative
 * implementations that may want to fetch translation bundles from a different
 * source or endpoint.
 */
const translatorConnector = {
    id: '@jupyterlab/translation-extension:translator-connector',
    description: 'Provides the application translation connector.',
    autoStart: true,
    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths],
    provides: _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslatorConnector,
    activate: (app, paths) => {
        const url = paths.urls.translations;
        const serverSettings = app.serviceManager.serverSettings;
        return new _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.TranslatorConnector(url, serverSettings);
    }
};
/**
 * The main translator plugin.
 */
const translator = {
    id: '@jupyterlab/translation-extension:translator',
    description: 'Provides the application translation object.',
    autoStart: true,
    requires: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterFrontEnd.IPaths, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__.ISettingRegistry],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslatorConnector],
    provides: _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator,
    activate: async (app, paths, settings, labShell, connector) => {
        const setting = await settings.load(PLUGIN_ID);
        const currentLocale = setting.get('locale').composite;
        let stringsPrefix = setting.get('stringsPrefix')
            .composite;
        const displayStringsPrefix = setting.get('displayStringsPrefix')
            .composite;
        stringsPrefix = displayStringsPrefix ? stringsPrefix : '';
        const serverSettings = app.serviceManager.serverSettings;
        const translationManager = new _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.TranslationManager(paths.urls.translations, stringsPrefix, serverSettings, connector !== null && connector !== void 0 ? connector : undefined);
        // As we wait for fetching the translation, ITranslator is guarantee to be
        // ready when consumed in other plugins.
        await translationManager.fetch(currentLocale);
        // Set the document language after optionally fetching the system language
        // if the setting 'locale' is set to 'default'
        document.documentElement.lang = translationManager.languageCode;
        // Set translator to UI
        if (labShell) {
            labShell.translator = translationManager;
        }
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.translator = translationManager;
        return translationManager;
    }
};
/**
 * Initialization data for the extension.
 */
const langMenu = {
    id: PLUGIN_ID,
    description: 'Adds translation commands and settings.',
    requires: [_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__.ISettingRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslatorConnector],
    optional: [_jupyterlab_mainmenu__WEBPACK_IMPORTED_MODULE_2__.IMainMenu, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],
    autoStart: true,
    activate: (app, settings, translator, translatorConnector, mainMenu, palette) => {
        var _a;
        const trans = translator.load('jupyterlab');
        const { commands } = app;
        // Create a languages menu
        const languagesMenu = mainMenu
            ? (_a = mainMenu.settingsMenu.items.find(item => {
                var _a;
                return item.type === 'submenu' &&
                    ((_a = item.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-settings-language';
            })) === null || _a === void 0 ? void 0 : _a.submenu
            : null;
        // Get list of available locales
        translatorConnector
            .fetch()
            .then(languageList => {
            const appLocale = translator.languageCode.replace('-', '_');
            for (const locale in languageList.data) {
                const value = languageList.data[locale];
                const displayName = value.displayName;
                const nativeName = value.nativeName;
                const toggled = appLocale === locale;
                const label = toggled
                    ? `${displayName}`
                    : `${displayName} - ${nativeName}`;
                // Add a command per language
                const command = `jupyterlab-translation:${locale}`;
                commands.addCommand(command, {
                    label: label,
                    caption: trans.__('Change interface language to %1', label),
                    isEnabled: () => !toggled,
                    isToggled: () => toggled,
                    execute: async () => {
                        const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
                            title: trans.__('Change interface language?'),
                            body: trans.__('After changing the interface language to %1, you will need to reload JupyterLab to see the changes.', label),
                            buttons: [
                                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton(),
                                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton({ label: trans.__('Change and reload') })
                            ]
                        });
                        if (result.button.accept) {
                            try {
                                await settings.set(PLUGIN_ID, 'locale', locale);
                                window.location.reload();
                            }
                            catch (reason) {
                                console.error(`Failed to update language locale to ${locale}`, reason);
                            }
                        }
                    },
                    describedBy: {
                        args: {
                            type: 'object',
                            properties: {}
                        }
                    }
                });
                // Add the language command to the menu
                if (languagesMenu) {
                    languagesMenu.addItem({
                        command,
                        args: {}
                    });
                }
                if (palette) {
                    palette.addItem({
                        category: trans.__('Display Languages'),
                        command
                    });
                }
            }
        })
            .catch(reason => {
            console.error(`Available locales errored!\n${reason}`);
        });
    }
};
/**
 * Export the plugins as default.
 */
const plugins = [
    translatorConnector,
    translator,
    langMenu
];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 37609:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _jupyterlab_apputils_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57261);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67663);
/* harmony import */ var _jupyterlab_mainmenu_style_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70022);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 57819:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  DEFAULT_LANGUAGE_CODE: () => (/* reexport */ DEFAULT_LANGUAGE_CODE),
  Gettext: () => (/* reexport */ Gettext),
  ITranslator: () => (/* reexport */ ITranslator),
  ITranslatorConnector: () => (/* reexport */ ITranslatorConnector),
  NullTranslator: () => (/* reexport */ NullTranslator),
  TranslationManager: () => (/* reexport */ TranslationManager),
  TranslatorConnector: () => (/* reexport */ TranslatorConnector),
  nullTranslator: () => (/* reexport */ nullTranslator),
  requestTranslationsAPI: () => (/* reexport */ requestTranslationsAPI)
});

// EXTERNAL MODULE: consume shared module (default) @jupyterlab/statedb@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/statedb/lib/index.js)
var index_js_ = __webpack_require__(43988);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/services@~7.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/services/lib/index.js)
var services_lib_index_js_ = __webpack_require__(37253);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/translation/lib/server.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * The url for the translations service.
 */
const TRANSLATIONS_SETTINGS_URL = 'api/translations';
/**
 * Call the API extension
 *
 * @param locale API REST end point for the extension
 * @param init Initial values for the request
 * @returns The response body interpreted as JSON
 */
async function requestTranslationsAPI(translationsUrl = '', locale = '', init = {}, serverSettings = undefined) {
    // Make request to Jupyter API
    const settings = serverSettings !== null && serverSettings !== void 0 ? serverSettings : services_lib_index_js_.ServerConnection.makeSettings();
    translationsUrl =
        translationsUrl || `${settings.appUrl}/${TRANSLATIONS_SETTINGS_URL}`;
    const translationsBase = lib_index_js_.URLExt.join(settings.baseUrl, translationsUrl);
    const requestUrl = lib_index_js_.URLExt.join(translationsBase, locale);
    if (!requestUrl.startsWith(translationsBase)) {
        throw new Error('Can only be used for translations requests');
    }
    let response;
    try {
        response = await services_lib_index_js_.ServerConnection.makeRequest(requestUrl, init, settings);
    }
    catch (error) {
        throw new services_lib_index_js_.ServerConnection.NetworkError(error);
    }
    let data = await response.text();
    if (data.length > 0) {
        try {
            data = JSON.parse(data);
        }
        catch (error) {
            console.error('Not a JSON response body.', response);
        }
    }
    if (!response.ok) {
        throw new services_lib_index_js_.ServerConnection.ResponseError(response, data.message || data);
    }
    return data;
}
//# sourceMappingURL=server.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/translation/lib/tokens.js
/* ----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/



/**
 * Application default locale.
 */
const DEFAULT_LANGUAGE_CODE = 'en';
/**
 * A service to connect to the server translation endpoint
 */
const ITranslatorConnector = new dist_index_js_.Token('@jupyterlab/translation:ITranslatorConnector', 'A service to connect to the server translation endpoint.');
class TranslatorConnector extends index_js_.DataConnector {
    constructor(translationsUrl = '', serverSettings) {
        super();
        this._translationsUrl = translationsUrl;
        this._serverSettings = serverSettings;
    }
    async fetch(opts) {
        var _a;
        return requestTranslationsAPI(this._translationsUrl, (_a = opts === null || opts === void 0 ? void 0 : opts.language) !== null && _a !== void 0 ? _a : '', {}, this._serverSettings);
    }
}
/**
 * Translation provider token
 */
const ITranslator = new dist_index_js_.Token('@jupyterlab/translation:ITranslator', 'A service to translate strings.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/translation/lib/utils.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
/**
 * Normalize domain
 *
 * @param domain Domain to normalize
 * @returns Normalized domain
 */
function normalizeDomain(domain) {
    return domain.replace('-', '_');
}
//# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/translation/lib/gettext.js
/* ----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|
| Base gettext.js implementation.
| Copyright (c) Guillaume Potier.
| Distributed under the terms of the Modified MIT License.
| See: https://github.com/guillaumepotier/gettext.js
|
| Type definitions.
| Copyright (c) Julien Crouzet and Florian Schwingenschlögl.
| Distributed under the terms of the Modified MIT License.
| See: https://github.com/DefinitelyTyped/DefinitelyTyped
|----------------------------------------------------------------------------*/


/**
 * Gettext class providing localization methods.
 */
class Gettext {
    constructor(options) {
        options = options || {};
        // default values that could be overridden in Gettext() constructor
        this._defaults = {
            domain: 'messages',
            locale: document.documentElement.getAttribute('lang') || DEFAULT_LANGUAGE_CODE,
            pluralFunc: function (n) {
                return { nplurals: 2, plural: n != 1 ? 1 : 0 };
            },
            contextDelimiter: String.fromCharCode(4), // \u0004
            stringsPrefix: ''
        };
        // Ensure the correct separator is used
        this._locale = (options.locale || this._defaults.locale).replace('_', '-');
        this._domain = normalizeDomain(options.domain || this._defaults.domain);
        this._contextDelimiter =
            options.contextDelimiter || this._defaults.contextDelimiter;
        this._stringsPrefix = options.stringsPrefix || this._defaults.stringsPrefix;
        this._pluralFuncs = {};
        this._dictionary = {};
        this._pluralForms = {};
        if (options.messages) {
            this._dictionary[this._domain] = {};
            this._dictionary[this._domain][this._locale] = options.messages;
        }
        if (options.pluralForms) {
            this._pluralForms[this._locale] = options.pluralForms;
        }
    }
    /**
     * Set current context delimiter.
     *
     * @param delimiter - The delimiter to set.
     */
    setContextDelimiter(delimiter) {
        this._contextDelimiter = delimiter;
    }
    /**
     * Get current context delimiter.
     *
     * @returns The current delimiter.
     */
    getContextDelimiter() {
        return this._contextDelimiter;
    }
    /**
     * Set current locale.
     *
     * @param locale - The locale to set.
     */
    setLocale(locale) {
        this._locale = locale.replace('_', '-');
    }
    /**
     * Get current locale.
     *
     * @returns The current locale.
     */
    getLocale() {
        return this._locale;
    }
    /**
     * Set current domain.
     *
     * @param domain - The domain to set.
     */
    setDomain(domain) {
        this._domain = normalizeDomain(domain);
    }
    /**
     * Get current domain.
     *
     * @returns The current domain string.
     */
    getDomain() {
        return this._domain;
    }
    /**
     * Set current strings prefix.
     *
     * @param prefix - The string prefix to set.
     */
    setStringsPrefix(prefix) {
        this._stringsPrefix = prefix;
    }
    /**
     * Get current strings prefix.
     *
     * @returns The strings prefix.
     */
    getStringsPrefix() {
        return this._stringsPrefix;
    }
    /**
     * `sprintf` equivalent, takes a string and some arguments to make a
     * computed string.
     *
     * @param fmt - The string to interpolate.
     * @param args - The variables to use in interpolation.
     *
     * ### Examples
     * strfmt("%1 dogs are in %2", 7, "the kitchen"); => "7 dogs are in the kitchen"
     * strfmt("I like %1, bananas and %1", "apples"); => "I like apples, bananas and apples"
     */
    static strfmt(fmt, ...args) {
        return (fmt
            // put space after double % to prevent placeholder replacement of such matches
            .replace(/%%/g, '%% ')
            // replace placeholders
            .replace(/%(\d+)/g, function (str, p1) {
            return args[p1 - 1];
        })
            // replace double % and space with single %
            .replace(/%% /g, '%'));
    }
    /**
     * Load json translations strings (In Jed 2.x format).
     *
     * @param jsonData - The translation strings plus metadata.
     * @param domain - The translation domain, e.g. "jupyterlab".
     */
    loadJSON(jsonData, domain) {
        if (!jsonData[''] ||
            !jsonData['']['language'] ||
            !jsonData['']['pluralForms']) {
            throw new Error(`Wrong jsonData, it must have an empty key ("") with "language" and "pluralForms" information: ${jsonData}`);
        }
        domain = normalizeDomain(domain);
        let headers = jsonData[''];
        let jsonDataCopy = JSON.parse(JSON.stringify(jsonData));
        delete jsonDataCopy[''];
        this.setMessages(domain || this._defaults.domain, headers['language'], jsonDataCopy, headers['pluralForms']);
    }
    /**
     * Shorthand for gettext.
     *
     * @param msgid - The singular string to translate.
     * @param args - Any additional values to use with interpolation.
     *
     * @returns A translated string if found, or the original string.
     *
     * ### Notes
     * This is not a private method (starts with an underscore) it is just
     * a shorter and standard way to call these methods.
     */
    __(msgid, ...args) {
        return this.gettext(msgid, ...args);
    }
    /**
     * Shorthand for ngettext.
     *
     * @param msgid - The singular string to translate.
     * @param msgid_plural - The plural string to translate.
     * @param n - The number for pluralization.
     * @param args - Any additional values to use with interpolation.
     *
     * @returns A translated string if found, or the original string.
     *
     * ### Notes
     * This is not a private method (starts with an underscore) it is just
     * a shorter and standard way to call these methods.
     */
    _n(msgid, msgid_plural, n, ...args) {
        return this.ngettext(msgid, msgid_plural, n, ...args);
    }
    /**
     * Shorthand for pgettext.
     *
     * @param msgctxt - The message context.
     * @param msgid - The singular string to translate.
     * @param args - Any additional values to use with interpolation.
     *
     * @returns A translated string if found, or the original string.
     *
     * ### Notes
     * This is not a private method (starts with an underscore) it is just
     * a shorter and standard way to call these methods.
     */
    _p(msgctxt, msgid, ...args) {
        return this.pgettext(msgctxt, msgid, ...args);
    }
    /**
     * Shorthand for npgettext.
     *
     * @param msgctxt - The message context.
     * @param msgid - The singular string to translate.
     * @param msgid_plural - The plural string to translate.
     * @param n - The number for pluralization.
     * @param args - Any additional values to use with interpolation.
     *
     * @returns A translated string if found, or the original string.
     *
     * ### Notes
     * This is not a private method (starts with an underscore) it is just
     * a shorter and standard way to call these methods.
     */
    _np(msgctxt, msgid, msgid_plural, n, ...args) {
        return this.npgettext(msgctxt, msgid, msgid_plural, n, ...args);
    }
    /**
     * Translate a singular string with extra interpolation values.
     *
     * @param msgid - The singular string to translate.
     * @param args - Any additional values to use with interpolation.
     *
     * @returns A translated string if found, or the original string.
     */
    gettext(msgid, ...args) {
        return this.dcnpgettext('', '', msgid, '', 0, ...args);
    }
    /**
     * Translate a plural string with extra interpolation values.
     *
     * @param msgid - The singular string to translate.
     * @param args - Any additional values to use with interpolation.
     *
     * @returns A translated string if found, or the original string.
     */
    ngettext(msgid, msgid_plural, n, ...args) {
        return this.dcnpgettext('', '', msgid, msgid_plural, n, ...args);
    }
    /**
     * Translate a contextualized singular string with extra interpolation values.
     *
     * @param msgctxt - The message context.
     * @param msgid - The singular string to translate.
     * @param args - Any additional values to use with interpolation.
     *
     * @returns A translated string if found, or the original string.
     *
     * ### Notes
     * This is not a private method (starts with an underscore) it is just
     * a shorter and standard way to call these methods.
     */
    pgettext(msgctxt, msgid, ...args) {
        return this.dcnpgettext('', msgctxt, msgid, '', 0, ...args);
    }
    /**
     * Translate a contextualized plural string with extra interpolation values.
     *
     * @param msgctxt - The message context.
     * @param msgid - The singular string to translate.
     * @param msgid_plural - The plural string to translate.
     * @param n - The number for pluralization.
     * @param args - Any additional values to use with interpolation
     *
     * @returns A translated string if found, or the original string.
     */
    npgettext(msgctxt, msgid, msgid_plural, n, ...args) {
        return this.dcnpgettext('', msgctxt, msgid, msgid_plural, n, ...args);
    }
    /**
     * Translate a singular string with extra interpolation values.
     *
     * @param domain - The translations domain.
     * @param msgctxt - The message context.
     * @param msgid - The singular string to translate.
     * @param msgid_plural - The plural string to translate.
     * @param n - The number for pluralization.
     * @param args - Any additional values to use with interpolation
     *
     * @returns A translated string if found, or the original string.
     */
    dcnpgettext(domain, msgctxt, msgid, msgid_plural, n, ...args) {
        domain = normalizeDomain(domain) || this._domain;
        let translation;
        let key = msgctxt
            ? msgctxt + this._contextDelimiter + msgid
            : msgid;
        let options = { pluralForm: false };
        let exist = false;
        let locale = this._locale;
        let locales = this.expandLocale(this._locale);
        for (let i in locales) {
            locale = locales[i];
            exist =
                this._dictionary[domain] &&
                    this._dictionary[domain][locale] &&
                    this._dictionary[domain][locale][key];
            // check condition are valid (.length)
            // because it's not possible to define both a singular and a plural form of the same msgid,
            // we need to check that the stored form is the same as the expected one.
            // if not, we'll just ignore the translation and consider it as not translated.
            if (msgid_plural) {
                exist = exist && this._dictionary[domain][locale][key].length > 1;
            }
            else {
                exist = exist && this._dictionary[domain][locale][key].length == 1;
            }
            if (exist) {
                // This ensures that a variation is used.
                options.locale = locale;
                break;
            }
        }
        if (!exist) {
            translation = [msgid];
            options.pluralFunc = this._defaults.pluralFunc;
        }
        else {
            translation = this._dictionary[domain][locale][key];
        }
        // Singular form
        if (!msgid_plural) {
            return this.t(translation, n, options, ...args);
        }
        // Plural one
        options.pluralForm = true;
        let value = exist ? translation : [msgid, msgid_plural];
        return this.t(value, n, options, ...args);
    }
    /**
     * Split a locale into parent locales. "es-CO" -> ["es-CO", "es"]
     *
     * @param locale - The locale string.
     *
     * @returns An array of locales.
     */
    expandLocale(locale) {
        let locales = [locale];
        let i = locale.lastIndexOf('-');
        while (i > 0) {
            locale = locale.slice(0, i);
            locales.push(locale);
            i = locale.lastIndexOf('-');
        }
        return locales;
    }
    /**
     * Split a locale into parent locales. "es-CO" -> ["es-CO", "es"]
     *
     * @param pluralForm - Plural form string..
     * @returns An function to compute plural forms.
     */
    // eslint-disable-next-line @typescript-eslint/ban-types
    getPluralFunc(pluralForm) {
        // Plural form string regexp
        // taken from https://github.com/Orange-OpenSource/gettext.js/blob/master/lib.gettext.js
        // plural forms list available here http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html
        let pf_re = new RegExp('^\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;n0-9_()])+');
        if (!pf_re.test(pluralForm))
            throw new Error(Gettext.strfmt('The plural form "%1" is not valid', pluralForm));
        // Careful here, this is a hidden eval() equivalent..
        // Risk should be reasonable though since we test the pluralForm through regex before
        // taken from https://github.com/Orange-OpenSource/gettext.js/blob/master/lib.gettext.js
        // TODO: should test if https://github.com/soney/jsep present and use it if so
        return new Function('n', 'let plural, nplurals; ' +
            pluralForm +
            ' return { nplurals: nplurals, plural: (plural === true ? 1 : (plural ? plural : 0)) };');
    }
    /**
     * Remove the context delimiter from string.
     *
     * @param str - Translation string.
     * @returns A translation string without context.
     */
    removeContext(str) {
        // if there is context, remove it
        if (str.indexOf(this._contextDelimiter) !== -1) {
            let parts = str.split(this._contextDelimiter);
            return parts[1];
        }
        return str;
    }
    /**
     * Proper translation function that handle plurals and directives.
     *
     * @param messages - List of translation strings.
     * @param n - The number for pluralization.
     * @param options - Translation options.
     * @param args - Any variables to interpolate.
     *
     * @returns A translation string without context.
     *
     * ### Notes
     * Contains juicy parts of https://github.com/Orange-OpenSource/gettext.js/blob/master/lib.gettext.js
     */
    t(messages, n, options, ...args) {
        // Singular is very easy, just pass dictionary message through strfmt
        if (!options.pluralForm)
            return (this._stringsPrefix +
                Gettext.strfmt(this.removeContext(messages[0]), ...args));
        let plural;
        // if a plural func is given, use that one
        if (options.pluralFunc) {
            plural = options.pluralFunc(n);
            // if plural form never interpreted before, do it now and store it
        }
        else if (!this._pluralFuncs[options.locale || '']) {
            this._pluralFuncs[options.locale || ''] = this.getPluralFunc(this._pluralForms[options.locale || '']);
            plural = this._pluralFuncs[options.locale || ''](n);
            // we have the plural function, compute the plural result
        }
        else {
            plural = this._pluralFuncs[options.locale || ''](n);
        }
        // If there is a problem with plurals, fallback to singular one
        if ('undefined' === typeof !plural.plural ||
            plural.plural > plural.nplurals ||
            messages.length <= plural.plural)
            plural.plural = 0;
        return (this._stringsPrefix +
            Gettext.strfmt(this.removeContext(messages[plural.plural]), ...[n].concat(args)));
    }
    /**
     * Set messages after loading them.
     *
     * @param domain - The translation domain.
     * @param locale - The translation locale.
     * @param messages - List of translation strings.
     * @param pluralForms - Plural form string.
     *
     * ### Notes
     * Contains juicy parts of https://github.com/Orange-OpenSource/gettext.js/blob/master/lib.gettext.js
     */
    setMessages(domain, locale, messages, pluralForms) {
        domain = normalizeDomain(domain);
        if (pluralForms)
            this._pluralForms[locale] = pluralForms;
        if (!this._dictionary[domain])
            this._dictionary[domain] = {};
        this._dictionary[domain][locale] = messages;
    }
}

//# sourceMappingURL=gettext.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/translation/lib/base.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A translator that loads a dummy language bundle that returns the same input
 * strings.
 */
class NullTranslator {
    constructor(bundle) {
        this.languageCode = DEFAULT_LANGUAGE_CODE;
        this._languageBundle = bundle;
    }
    load(domain) {
        return this._languageBundle;
    }
}
/**
 * A language bundle that returns the same input strings.
 */
class NullLanguageBundle {
    __(msgid, ...args) {
        return this.gettext(msgid, ...args);
    }
    _n(msgid, msgid_plural, n, ...args) {
        return this.ngettext(msgid, msgid_plural, n, ...args);
    }
    _p(msgctxt, msgid, ...args) {
        return this.pgettext(msgctxt, msgid, ...args);
    }
    _np(msgctxt, msgid, msgid_plural, n, ...args) {
        return this.npgettext(msgctxt, msgid, msgid_plural, n, ...args);
    }
    gettext(msgid, ...args) {
        return Gettext.strfmt(msgid, ...args);
    }
    ngettext(msgid, msgid_plural, n, ...args) {
        return Gettext.strfmt(n == 1 ? msgid : msgid_plural, ...[n].concat(args));
    }
    pgettext(msgctxt, msgid, ...args) {
        return Gettext.strfmt(msgid, ...args);
    }
    npgettext(msgctxt, msgid, msgid_plural, n, ...args) {
        return this.ngettext(msgid, msgid_plural, n, ...args);
    }
    dcnpgettext(domain, msgctxt, msgid, msgid_plural, n, ...args) {
        return this.ngettext(msgid, msgid_plural, n, ...args);
    }
}
/**
 * The application null translator instance that just returns the same text.
 * Also provides interpolation.
 */
const nullTranslator = new NullTranslator(new NullLanguageBundle());
//# sourceMappingURL=base.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/translation/lib/manager.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Translation Manager.
 */
class TranslationManager {
    /**
     * Construct a new TranslationManager.
     *
     * @param translationsUrl The URL of the translation server.
     * @param stringsPrefix (optional) The prefix for translation strings.
     * @param serverSettings (optional) The server settings.
     * @param connector (optional) The translation connector. If provided, the `translationsUrl` and `serverSettings` parameters will be ignored.
     */
    constructor(translationsUrl = '', stringsPrefix, serverSettings, connector) {
        this._domainData = {};
        this._translationBundles = {};
        this._connector =
            connector !== null && connector !== void 0 ? connector : new TranslatorConnector(translationsUrl, serverSettings);
        this._stringsPrefix = stringsPrefix || '';
        this._englishBundle = new Gettext({ stringsPrefix: this._stringsPrefix });
        this._currentLocale = DEFAULT_LANGUAGE_CODE;
    }
    /**
     * Get the language code (tag) of the current locale.
     *
     * It respects BCP47 (RFC5646): https://datatracker.ietf.org/doc/html/rfc5646
     */
    get languageCode() {
        return this._currentLocale;
    }
    /**
     * Fetch the localization data from the server.
     *
     * @param locale The language locale to use for translations.
     */
    async fetch(locale) {
        var _a, _b, _c, _d;
        this._languageData = await this._connector.fetch({ language: locale });
        let serverLocale;
        if (this._languageData && locale === 'default') {
            try {
                for (const lang of Object.values((_a = this._languageData.data) !== null && _a !== void 0 ? _a : {})) {
                    serverLocale =
                        // If the language is provided by the system set up, we need to retrieve the final
                        // language. This is done through the `""` entry in `_languageData` that contains
                        // language metadata.
                        lang['']['language'];
                    break;
                }
            }
            catch (reason) {
                // no-op
            }
        }
        this._currentLocale = (locale !== 'default' ? locale : serverLocale !== null && serverLocale !== void 0 ? serverLocale : DEFAULT_LANGUAGE_CODE).replace('_', '-');
        this._domainData = (_c = (_b = this._languageData) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : {};
        const message = (_d = this._languageData) === null || _d === void 0 ? void 0 : _d.message;
        if (message && this._currentLocale !== DEFAULT_LANGUAGE_CODE) {
            console.warn(message);
        }
    }
    /**
     * Load translation bundles for a given domain.
     *
     * @param domain The translation domain to use for translations.
     */
    load(domain) {
        if (this._domainData) {
            if (this._currentLocale == DEFAULT_LANGUAGE_CODE) {
                return this._englishBundle;
            }
            else {
                domain = normalizeDomain(domain);
                if (!(domain in this._translationBundles)) {
                    let translationBundle = new Gettext({
                        domain: domain,
                        locale: this._currentLocale,
                        stringsPrefix: this._stringsPrefix
                    });
                    if (domain in this._domainData) {
                        const metadata = this._domainData[domain][''];
                        const harmonizedData = {
                            ...this._domainData[domain],
                            '': {
                                ...metadata,
                                pluralForms: metadata.plural_forms
                            }
                        };
                        translationBundle.loadJSON(harmonizedData, domain);
                    }
                    this._translationBundles[domain] = translationBundle;
                }
                return this._translationBundles[domain];
            }
        }
        else {
            return this._englishBundle;
        }
    }
}
//# sourceMappingURL=manager.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/translation/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module translation
 */
// Note: keep in alphabetical order...





//# sourceMappingURL=index.js.map

/***/ }),

/***/ 73863:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12331);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__);
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module ui-components-extension
 */

/**
 * Placeholder for future extension that will provide an icon manager class
 * to assist with overriding/replacing particular sets of icons
 */
const labiconManager = {
    id: '@jupyterlab/ui-components-extension:labicon-manager',
    description: 'Provides the icon manager.',
    provides: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__.ILabIconManager,
    autoStart: true,
    activate: (app) => {
        return Object.create(null);
    }
};
/**
 * Sets up the renderer registry to be used by the FormEditor component.
 */
const formRendererRegistryPlugin = {
    id: '@jupyterlab/ui-components-extension:form-renderer-registry',
    description: 'Provides the settings form renderer registry.',
    provides: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__.IFormRendererRegistry,
    autoStart: true,
    activate: (app) => {
        const formRendererRegistry = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__.FormRendererRegistry();
        return formRendererRegistry;
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([labiconManager, formRendererRegistryPlugin]);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 49733:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var _jupyterlab_ui_components_style_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26238);
/* harmony import */ var _jupyterlab_application_style_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67663);
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */




/***/ }),

/***/ 63461:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  AddButton: () => (/* reexport */ AddButton),
  Button: () => (/* reexport */ Button),
  Collapser: () => (/* reexport */ Collapser),
  CommandPaletteSvg: () => (/* reexport */ CommandPaletteSvg),
  CommandToolbarButton: () => (/* reexport */ CommandToolbarButton),
  CommandToolbarButtonComponent: () => (/* reexport */ CommandToolbarButtonComponent),
  ContextMenuSvg: () => (/* reexport */ ContextMenuSvg),
  DEFAULT_STYLE_CLASS: () => (/* reexport */ DEFAULT_STYLE_CLASS),
  DEFAULT_UI_OPTIONS: () => (/* reexport */ DEFAULT_UI_OPTIONS),
  DockPanelSvg: () => (/* reexport */ DockPanelSvg),
  DropButton: () => (/* reexport */ DropButton),
  FilenameSearcher: () => (/* reexport */ FilenameSearcher),
  FilterBox: () => (/* reexport */ FilterBox),
  FormComponent: () => (/* reexport */ FormComponent),
  FormRendererRegistry: () => (/* reexport */ FormRendererRegistry),
  HTMLSelect: () => (/* reexport */ HTMLSelect),
  HTML_SELECT_CLASS: () => (/* reexport */ HTML_SELECT_CLASS),
  HoverBox: () => (/* reexport */ HoverBox),
  IFormRendererRegistry: () => (/* reexport */ IFormRendererRegistry),
  IFrame: () => (/* reexport */ IFrame),
  ILabIconManager: () => (/* reexport */ ILabIconManager),
  IRankedMenu: () => (/* reexport */ IRankedMenu),
  InputGroup: () => (/* reexport */ InputGroup),
  LabIcon: () => (/* reexport */ LabIcon),
  MenuSvg: () => (/* reexport */ MenuSvg),
  MoveButton: () => (/* reexport */ MoveButton),
  PanelWithToolbar: () => (/* reexport */ PanelWithToolbar),
  RankedMenu: () => (/* reexport */ RankedMenu),
  ReactWidget: () => (/* reexport */ ReactWidget),
  ReactiveToolbar: () => (/* reexport */ ReactiveToolbar),
  SidePanel: () => (/* reexport */ SidePanel),
  Spinner: () => (/* reexport */ Spinner),
  Styling: () => (/* reexport */ Styling),
  Switch: () => (/* reexport */ Switch),
  TABLE_CLASS: () => (/* reexport */ TABLE_CLASS),
  TabBarSvg: () => (/* reexport */ TabBarSvg),
  TabPanelSvg: () => (/* reexport */ TabPanelSvg),
  Table: () => (/* reexport */ Table),
  Toolbar: () => (/* reexport */ Toolbar),
  ToolbarButton: () => (/* reexport */ ToolbarButton),
  ToolbarButtonComponent: () => (/* reexport */ ToolbarButtonComponent),
  UseSignal: () => (/* reexport */ UseSignal),
  VDomModel: () => (/* reexport */ VDomModel),
  VDomRenderer: () => (/* reexport */ VDomRenderer),
  WindowedLayout: () => (/* reexport */ WindowedLayout),
  WindowedList: () => (/* reexport */ WindowedList),
  WindowedListModel: () => (/* reexport */ WindowedListModel),
  addAboveIcon: () => (/* reexport */ addAboveIcon),
  addBelowIcon: () => (/* reexport */ addBelowIcon),
  addCommandToolbarButtonClass: () => (/* reexport */ addCommandToolbarButtonClass),
  addIcon: () => (/* reexport */ addIcon),
  addToolbarButtonClass: () => (/* reexport */ addToolbarButtonClass),
  audioIcon: () => (/* reexport */ audioIcon),
  badIcon: () => (/* reexport */ badIcon),
  bellIcon: () => (/* reexport */ bellIcon),
  blankIcon: () => (/* reexport */ blankIcon),
  breakpointIcon: () => (/* reexport */ breakpointIcon),
  bugDotIcon: () => (/* reexport */ bugDotIcon),
  bugIcon: () => (/* reexport */ bugIcon),
  buildIcon: () => (/* reexport */ buildIcon),
  caretDownEmptyIcon: () => (/* reexport */ caretDownEmptyIcon),
  caretDownEmptyThinIcon: () => (/* reexport */ caretDownEmptyThinIcon),
  caretDownIcon: () => (/* reexport */ caretDownIcon),
  caretLeftIcon: () => (/* reexport */ caretLeftIcon),
  caretRightIcon: () => (/* reexport */ caretRightIcon),
  caretUpEmptyThinIcon: () => (/* reexport */ caretUpEmptyThinIcon),
  caretUpIcon: () => (/* reexport */ caretUpIcon),
  caseSensitiveIcon: () => (/* reexport */ caseSensitiveIcon),
  checkIcon: () => (/* reexport */ checkIcon),
  circleEmptyIcon: () => (/* reexport */ circleEmptyIcon),
  circleIcon: () => (/* reexport */ circleIcon),
  classes: () => (/* reexport */ classes),
  classesDedupe: () => (/* reexport */ classesDedupe),
  cleaningIcon: () => (/* reexport */ cleaningIcon),
  clearIcon: () => (/* reexport */ clearIcon),
  closeAllIcon: () => (/* reexport */ closeAllIcon),
  closeIcon: () => (/* reexport */ closeIcon),
  codeCheckIcon: () => (/* reexport */ codeCheckIcon),
  codeIcon: () => (/* reexport */ codeIcon),
  collapseAllIcon: () => (/* reexport */ collapseAllIcon),
  collapseIcon: () => (/* reexport */ collapseIcon),
  consoleIcon: () => (/* reexport */ consoleIcon),
  copyIcon: () => (/* reexport */ copyIcon),
  copyrightIcon: () => (/* reexport */ copyrightIcon),
  cutIcon: () => (/* reexport */ cutIcon),
  deleteIcon: () => (/* reexport */ deleteIcon),
  dockBottomIcon: () => (/* reexport */ dockBottomIcon),
  dockLeftIcon: () => (/* reexport */ dockLeftIcon),
  dockRightIcon: () => (/* reexport */ dockRightIcon),
  dockTopIcon: () => (/* reexport */ dockTopIcon),
  dotsIcon: () => (/* reexport */ dotsIcon),
  downloadIcon: () => (/* reexport */ downloadIcon),
  duplicateIcon: () => (/* reexport */ duplicateIcon),
  editIcon: () => (/* reexport */ editIcon),
  ellipsesIcon: () => (/* reexport */ ellipsesIcon),
  errorIcon: () => (/* reexport */ errorIcon),
  exceptionsIcon: () => (/* reexport */ exceptionsIcon),
  expandAllIcon: () => (/* reexport */ expandAllIcon),
  expandIcon: () => (/* reexport */ expandIcon),
  extensionIcon: () => (/* reexport */ extensionIcon),
  fastForwardIcon: () => (/* reexport */ fastForwardIcon),
  fileIcon: () => (/* reexport */ fileIcon),
  fileUploadIcon: () => (/* reexport */ fileUploadIcon),
  filterDotIcon: () => (/* reexport */ filterDotIcon),
  filterIcon: () => (/* reexport */ filterIcon),
  filterListIcon: () => (/* reexport */ filterListIcon),
  folderFavoriteIcon: () => (/* reexport */ folderFavoriteIcon),
  folderIcon: () => (/* reexport */ folderIcon),
  fuzzySearch: () => (/* reexport */ fuzzySearch),
  getReactAttrs: () => (/* reexport */ getReactAttrs),
  getTreeItemElement: () => (/* reexport */ getTreeItemElement),
  historyIcon: () => (/* reexport */ historyIcon),
  homeIcon: () => (/* reexport */ homeIcon),
  html5Icon: () => (/* reexport */ html5Icon),
  imageIcon: () => (/* reexport */ imageIcon),
  infoIcon: () => (/* reexport */ infoIcon),
  inspectorIcon: () => (/* reexport */ inspectorIcon),
  jsonIcon: () => (/* reexport */ jsonIcon),
  juliaIcon: () => (/* reexport */ juliaIcon),
  jupyterFaviconIcon: () => (/* reexport */ jupyterFaviconIcon),
  jupyterIcon: () => (/* reexport */ jupyterIcon),
  jupyterlabWordmarkIcon: () => (/* reexport */ jupyterlabWordmarkIcon),
  kernelIcon: () => (/* reexport */ kernelIcon),
  keyboardIcon: () => (/* reexport */ keyboardIcon),
  launchIcon: () => (/* reexport */ launchIcon),
  launcherIcon: () => (/* reexport */ launcherIcon),
  lineFormIcon: () => (/* reexport */ lineFormIcon),
  linkIcon: () => (/* reexport */ linkIcon),
  listIcon: () => (/* reexport */ listIcon),
  lockIcon: () => (/* reexport */ lockIcon),
  markdownIcon: () => (/* reexport */ markdownIcon),
  mermaidIcon: () => (/* reexport */ mermaidIcon),
  moveDownIcon: () => (/* reexport */ moveDownIcon),
  moveUpIcon: () => (/* reexport */ moveUpIcon),
  newFolderIcon: () => (/* reexport */ newFolderIcon),
  notTrustedIcon: () => (/* reexport */ notTrustedIcon),
  notebookIcon: () => (/* reexport */ notebookIcon),
  numberingIcon: () => (/* reexport */ numberingIcon),
  offlineBoltIcon: () => (/* reexport */ offlineBoltIcon),
  openKernelSourceIcon: () => (/* reexport */ openKernelSourceIcon),
  paletteIcon: () => (/* reexport */ paletteIcon),
  pasteIcon: () => (/* reexport */ pasteIcon),
  pauseIcon: () => (/* reexport */ pauseIcon),
  pdfIcon: () => (/* reexport */ pdfIcon),
  pythonIcon: () => (/* reexport */ pythonIcon),
  rKernelIcon: () => (/* reexport */ rKernelIcon),
  reactIcon: () => (/* reexport */ reactIcon),
  redoIcon: () => (/* reexport */ redoIcon),
  refreshIcon: () => (/* reexport */ refreshIcon),
  regexIcon: () => (/* reexport */ regexIcon),
  runIcon: () => (/* reexport */ runIcon),
  runningIcon: () => (/* reexport */ runningIcon),
  saveIcon: () => (/* reexport */ saveIcon),
  searchIcon: () => (/* reexport */ searchIcon),
  selectedBreakpointIcon: () => (/* reexport */ selectedBreakpointIcon),
  settingsIcon: () => (/* reexport */ settingsIcon),
  shareIcon: () => (/* reexport */ shareIcon),
  spreadsheetIcon: () => (/* reexport */ spreadsheetIcon),
  stepIntoIcon: () => (/* reexport */ stepIntoIcon),
  stepOutIcon: () => (/* reexport */ stepOutIcon),
  stepOverIcon: () => (/* reexport */ stepOverIcon),
  stopIcon: () => (/* reexport */ stopIcon),
  tabIcon: () => (/* reexport */ tabIcon),
  tableRowsIcon: () => (/* reexport */ tableRowsIcon),
  tagIcon: () => (/* reexport */ tagIcon),
  terminalIcon: () => (/* reexport */ terminalIcon),
  textEditorIcon: () => (/* reexport */ textEditorIcon),
  tocIcon: () => (/* reexport */ tocIcon),
  treeViewIcon: () => (/* reexport */ treeViewIcon),
  trustedIcon: () => (/* reexport */ trustedIcon),
  undoIcon: () => (/* reexport */ undoIcon),
  updateFilterFunction: () => (/* reexport */ updateFilterFunction),
  userIcon: () => (/* reexport */ userIcon),
  usersIcon: () => (/* reexport */ usersIcon),
  variableIcon: () => (/* reexport */ variableIcon),
  vegaIcon: () => (/* reexport */ vegaIcon),
  videoIcon: () => (/* reexport */ videoIcon),
  viewBreakpointIcon: () => (/* reexport */ viewBreakpointIcon),
  wordIcon: () => (/* reexport */ wordIcon),
  yamlIcon: () => (/* reexport */ yamlIcon)
});

// EXTERNAL MODULE: consume shared module (default) react@~18.2.0 (singleton) (fallback: ../node_modules/react/index.js)
var index_js_ = __webpack_require__(78156);
var index_js_default = /*#__PURE__*/__webpack_require__.n(index_js_);
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/coreutils@~6.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/coreutils/lib/index.js)
var lib_index_js_ = __webpack_require__(4666);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/utils.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * Inner works of class combining functions
 */
function _classes(classes) {
    return classes
        .map(c => c && typeof c === 'object'
        ? Object.keys(c).map(key => !!c[key] && key)
        : typeof c === 'string'
            ? c.split(/\s+/)
            : [])
        .reduce((flattened, c) => flattened.concat(c), [])
        .filter(c => !!c);
}
/**
 * Combines classNames.
 *
 * @param classes - A list of classNames
 *
 * @returns A single string with the combined className
 */
function classes(...classes) {
    return _classes(classes).join(' ');
}
/**
 * Combines classNames. Removes all duplicates
 *
 * @param classes - A list of classNames
 *
 * @returns A single string with the combined className
 */
function classesDedupe(...classes) {
    return [...new Set(_classes(classes))].join(' ');
}
/**
 * Translates the attributes of a DOM element into attributes that can
 * be understood by React. Currently not comprehensive, we will add special
 * cases as they become relevant.
 *
 * @param elem - A DOM element
 *
 * @param ignore - An optional list of attribute names to ignore
 *
 * @returns An object with key:value pairs that are the React-friendly
 * translation of elem's attributes
 */
function getReactAttrs(elem, { ignore = [] } = {}) {
    return elem
        .getAttributeNames()
        .reduce((d, name) => {
        if (name === 'style' || ignore.includes(name)) {
            void 0;
        }
        else if (name.startsWith('data') || name.startsWith('aria')) {
            d[name] = elem.getAttribute(name);
        }
        else {
            d[lib_index_js_.Text.camelCase(name)] = elem.getAttribute(name);
        }
        return d;
    }, {});
}
// Toolkit helpers
/**
 * Test whether an object is a tree item or not.
 * @param el Element to test
 * @returns Result
 */
function isTreeItemElement(el) {
    return el instanceof HTMLElement && el.getAttribute('role') === 'treeitem';
}
/**
 * Find the tree item encapsulating the element.
 *
 * @param el Starting element
 * @returns The tree item
 */
function getTreeItemElement(el) {
    let item = el;
    while (item && !isTreeItemElement(item)) {
        item = item.parentElement;
    }
    return isTreeItemElement(item) ? item : null;
}
//# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/button.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


/**
 * Button component
 *
 * @param props Component properties
 * @returns Component
 */
function Button(props) {
    const { minimal, small, children, ...others } = props;
    return (index_js_default().createElement("button", { ...others, className: classes(props.className, minimal ? 'jp-mod-minimal' : '', small ? 'jp-mod-small' : '', 'jp-Button') }, children));
}
//# sourceMappingURL=button.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(46257);
// EXTERNAL MODULE: consume shared module (default) @lumino/widgets@~2.7.5 (singleton) (fallback: ../node_modules/@lumino/widgets/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(23055);
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var dist_index_js_ = __webpack_require__(72215);
// EXTERNAL MODULE: ../node_modules/react-dom/client.js
var client = __webpack_require__(37634);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/debug/bad.svg
const bad_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n    <path\n        class=\"jp-icon0\"\n        fill=\"#000\"\n        d=\"M24 20.188l-8.315-8.209 8.2-8.282-3.697-3.697-8.212 8.318-8.31-8.203-3.666 3.666 8.321 8.24-8.206 8.313 3.666 3.666 8.237-8.318 8.285 8.203z\"\n    />\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/debug/blank.svg
const blank_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n    <path\n        fill=\"#000\"\n        fill-opacity=\"0.0\"\n        d=\"M24 20.188l-8.315-8.209 8.2-8.282-3.697-3.697-8.212 8.318-8.31-8.203-3.666 3.666 8.321 8.24-8.206 8.313 3.666 3.666 8.237-8.318 8.285 8.203z\"\n    />\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/refresh.svg
const refresh_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M9 13.5c-2.49 0-4.5-2.01-4.5-4.5S6.51 4.5 9 4.5c1.24 0 2.36.52 3.17 1.33L10 8h5V3l-1.76 1.76A6 6 0 0 0 9 3C5.69 3 3.01 5.69 3.01 9S5.69 15 9 15a5.98 5.98 0 0 0 5.9-5h-1.52c-.46 2-2.24 3.5-4.38 3.5\" class=\"jp-icon3\"/>\n</svg>\n";
// EXTERNAL MODULE: ../node_modules/typestyle/lib/index.js
var lib = __webpack_require__(73062);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/style/icon.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

var LabIconStyle;
(function (LabIconStyle) {
    /**
     * The builtin stylesheets
     */
    const builtinSheets = {
        breadCrumb: {
            container: {
                $nest: {
                    // `&` will be substituted for the generated classname (interpolation)
                    '&:first-child svg': {
                        bottom: '1px',
                        marginLeft: '0px',
                        position: 'relative'
                    },
                    '&:hover': {
                        backgroundColor: 'var(--jp-layout-color2)'
                    },
                    ['.jp-mod-dropTarget&']: {
                        backgroundColor: 'var(--jp-brand-color2)',
                        opacity: 0.7
                    }
                }
            },
            element: {
                borderRadius: 'var(--jp-border-radius)',
                cursor: 'pointer',
                margin: '0px 2px',
                padding: '0px 2px',
                height: '16px',
                width: '16px',
                verticalAlign: 'middle'
            }
        },
        commandPaletteHeader: {
            container: {
                height: '14px',
                margin: '0 14px 0 auto'
            },
            element: {
                height: '14px',
                width: '14px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        commandPaletteItem: {
            element: {
                height: '16px',
                width: '16px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        launcherCard: {
            container: {
                height: '52px',
                width: '52px'
            },
            element: {
                height: '52px',
                width: '52px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        launcherSection: {
            container: {
                boxSizing: 'border-box',
                marginRight: '12px',
                height: '32px',
                width: '32px'
            },
            element: {
                height: '32px',
                width: '32px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        listing: {
            container: {
                flex: '0 0 20px',
                marginRight: '4px',
                position: 'relative'
            },
            element: {
                height: '16px',
                width: '16px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        listingHeaderItem: {
            container: {
                display: 'inline',
                height: '16px',
                width: '16px'
            },
            element: {
                height: 'auto',
                margin: '-2px 0 0 0',
                width: '20px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        mainAreaTab: {
            container: {
                $nest: {
                    '.lm-DockPanel-tabBar &': {
                        marginRight: '4px'
                    }
                }
            },
            element: {
                $nest: {
                    '.lm-DockPanel-tabBar &': {
                        height: '14px',
                        width: '14px'
                    }
                }
            },
            options: {
                elementPosition: 'center'
            }
        },
        menuItem: {
            container: {
                display: 'inline-block',
                verticalAlign: 'middle'
            },
            element: {
                height: '16px',
                width: '16px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        runningItem: {
            container: {
                margin: '0px 4px 0px 4px'
            },
            element: {
                height: '16px',
                width: '16px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        select: {
            container: {
                pointerEvents: 'none'
            },
            element: {
                position: 'absolute',
                height: 'auto',
                width: '16px'
            }
        },
        settingsEditor: {
            container: {
                display: 'flex',
                flex: '0 0 20px',
                margin: '0 3px 0 0',
                position: 'relative',
                height: '20px',
                width: '20px'
            },
            element: {
                height: '16px',
                width: '16px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        sideBar: {
            element: {
                height: 'auto',
                width: '20px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        splash: {
            container: {
                animation: '0.3s fade-in linear forwards',
                height: '100%',
                width: '100%',
                zIndex: 1
            },
            element: {
                // width no height
                width: '100px'
            },
            options: {
                elementPosition: 'center'
            }
        },
        statusBar: {
            element: {
                left: '0px',
                top: '0px',
                height: '18px',
                width: '20px',
                position: 'relative'
            }
        },
        toolbarButton: {
            container: {
                display: 'inline-block',
                verticalAlign: 'middle'
            },
            element: {
                height: '16px',
                width: '16px'
            },
            options: {
                elementPosition: 'center'
            }
        }
    };
    function _elementPositionFactory(extra) {
        return {
            container: {
                alignItems: 'center',
                display: 'flex'
            },
            element: {
                display: 'block',
                ...extra
            }
        };
    }
    /**
     * Styles to help with positioning
     */
    const positionSheets = {
        center: _elementPositionFactory({ margin: '0 auto', width: '100%' }),
        top: _elementPositionFactory({ margin: '0 0 auto 0' }),
        right: _elementPositionFactory({ margin: '0 0 0 auto' }),
        bottom: _elementPositionFactory({ margin: 'auto 0 0 0' }),
        left: _elementPositionFactory({ margin: '0 auto 0 0' }),
        'top right': _elementPositionFactory({ margin: '0 0 auto auto' }),
        'bottom right': _elementPositionFactory({ margin: 'auto 0 0 auto' }),
        'bottom left': _elementPositionFactory({ margin: 'auto auto 0 0' }),
        'top left': _elementPositionFactory({ margin: '0 auto 0 auto' })
    };
    function _elementSizeFactory(size) {
        return {
            element: {
                height: size,
                width: size
            }
        };
    }
    /**
     * sheets that establish some default sizes
     */
    const sizeSheets = {
        small: _elementSizeFactory('14px'),
        normal: _elementSizeFactory('16px'),
        large: _elementSizeFactory('20px'),
        xlarge: _elementSizeFactory('24px')
    };
    /**
     * Merge two or more icon sheets into a single "pure"
     * icon style (ie collections of CSS props only)
     */
    function mergeSheets(sheets) {
        return {
            container: Object.assign({}, ...sheets.map(s => s.container)),
            element: Object.assign({}, ...sheets.map(s => s.element))
        };
    }
    /**
     * Resolve one or more stylesheets that may just be a string naming
     * one of the builtin stylesheets to an array of proper ISheet objects
     */
    function resolveSheet(stylesheet) {
        if (!stylesheet) {
            return [];
        }
        if (!Array.isArray(stylesheet)) {
            // wrap in array
            stylesheet = [stylesheet];
        }
        return stylesheet.map(k => (typeof k === 'string' ? builtinSheets[k] : k));
    }
    /**
     * Resolve and merge multiple icon stylesheets
     */
    function applySheetOptions(sheets) {
        const options = Object.assign({}, ...sheets.map(s => s.options));
        if (options.elementPosition) {
            sheets.unshift(positionSheets[options.elementPosition]);
        }
        if (options.elementSize) {
            sheets.unshift(sizeSheets[options.elementSize]);
        }
        return mergeSheets(sheets);
    }
    /**
     * Resolve a pure icon stylesheet into a typestyle class
     */
    function resolveStyleClass(stylesheet) {
        var _a;
        return (0,lib/* style */.oB)({
            ...stylesheet.container,
            $nest: {
                ...(_a = stylesheet.container) === null || _a === void 0 ? void 0 : _a.$nest,
                ['svg']: stylesheet.element
            }
        });
    }
    // cache style classes for builtin stylesheets
    const _styleClassCache = new Map();
    /**
     * Get a typestyle class, given a set of icon styling props
     */
    function styleClass(props) {
        if (!props || Object.keys(props).length === 0) {
            // props is empty
            return '';
        }
        let { elementPosition, elementSize, stylesheet, ...elementCSS } = props;
        // add option args with defined values to overrides
        const options = {
            ...(elementPosition && { elementPosition }),
            ...(elementSize && { elementSize })
        };
        // try to look up the style class in the cache
        const cacheable = typeof stylesheet === 'string' && Object.keys(elementCSS).length === 0;
        const cacheKey = cacheable
            ? [stylesheet, elementPosition, elementSize].join(',')
            : '';
        if (cacheable && _styleClassCache.has(cacheKey)) {
            return _styleClassCache.get(cacheKey);
        }
        // resolve kind to an array of sheets, then stick overrides on the end
        const sheets = resolveSheet(stylesheet);
        sheets.push({ element: elementCSS, options });
        // apply style options/merge sheets, then convert to typestyle class
        const cls = resolveStyleClass(applySheetOptions(sheets));
        if (cacheable) {
            // store in cache for later reuse
            _styleClassCache.set(cacheKey, cls);
        }
        return cls;
    }
    LabIconStyle.styleClass = styleClass;
})(LabIconStyle || (LabIconStyle = {}));
//# sourceMappingURL=icon.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/icon/labicon.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.









class LabIcon {
    /** *********
     * statics *
     ***********/
    /**
     * Remove any rendered icon from the element that contains it
     *
     * @param container - a DOM node into which an icon was
     * previously rendered
     *
     * @returns the cleaned container
     */
    static remove(container) {
        // clean up all children
        while (container.firstChild) {
            container.firstChild.remove();
        }
        // remove all classes
        container.className = '';
        return container;
    }
    /**
     * Resolve an icon name or a \{name, svgstr\} pair into an
     * actual LabIcon.
     *
     * @param options - icon: either a string with the name of an existing icon
     * or an object with \{name: string, svgstr: string\} fields.
     *
     * @returns a LabIcon instance
     */
    static resolve({ icon }) {
        if (icon instanceof LabIcon) {
            // icon already is a LabIcon; nothing to do here
            return icon;
        }
        if (typeof icon === 'string') {
            // do a dynamic lookup of existing icon by name
            const resolved = LabIcon._instances.get(icon);
            if (resolved) {
                return resolved;
            }
            // lookup failed
            if (LabIcon._debug) {
                // fail noisily
                console.warn(`Lookup failed for icon, creating loading icon. icon: ${icon}`);
            }
            // no matching icon currently registered, create a new loading icon
            // TODO: find better icon (maybe animate?) for loading icon
            return new LabIcon({ name: icon, svgstr: refresh_namespaceObject, _loading: true });
        }
        // icon was provided as a non-LabIcon \{name, svgstr\} pair, communicating
        // an intention to create a new icon
        return new LabIcon(icon);
    }
    /**
     * Resolve an icon name or a \{name, svgstr\} pair into a DOM element.
     * If icon arg is undefined, the function will fall back to trying to render
     * the icon as a CSS background image, via the iconClass arg.
     * If both icon and iconClass are undefined, this function will return
     * an empty div.
     *
     * @param icon - optional, either a string with the name of an existing icon
     * or an object with \{name: string, svgstr: string\} fields
     *
     * @param iconClass - optional, if the icon arg is not set, the iconClass arg
     * should be a CSS class associated with an existing CSS background-image
     *
     * @param fallback - DEPRECATED, optional, a LabIcon instance that will
     * be used if neither icon nor iconClass are defined
     *
     * @param props - any additional args are passed though to the element method
     * of the resolved icon on render
     *
     * @returns a DOM node with the resolved icon rendered into it
     */
    static resolveElement({ icon, iconClass, fallback, ...props }) {
        if (!Private.isResolvable(icon)) {
            if (!iconClass && fallback) {
                // if neither icon nor iconClass are defined/resolvable, use fallback
                return fallback.element(props);
            }
            // set the icon's class to iconClass plus props.className
            props.className = classes(iconClass, props.className);
            // render icon as css background image, assuming one is set on iconClass
            return Private.blankElement(props);
        }
        return LabIcon.resolve({ icon }).element(props);
    }
    /**
     * Resolve an icon name or a \{name, svgstr\} pair into a React component.
     * If icon arg is undefined, the function will fall back to trying to render
     * the icon as a CSS background image, via the iconClass arg.
     * If both icon and iconClass are undefined, the returned component
     * will simply render an empty div.
     *
     * @param icon - optional, either a string with the name of an existing icon
     * or an object with \{name: string, svgstr: string\} fields
     *
     * @param iconClass - optional, if the icon arg is not set, the iconClass arg
     * should be a CSS class associated with an existing CSS background-image
     *
     * @param fallback - DEPRECATED, optional, a LabIcon instance that will
     * be used if neither icon nor iconClass are defined
     *
     * @param props - any additional args are passed though to the React component
     * of the resolved icon on render
     *
     * @returns a React component that will render the resolved icon
     */
    static resolveReact({ icon, iconClass, fallback, ...props }) {
        if (!Private.isResolvable(icon)) {
            if (!iconClass && fallback) {
                // if neither icon nor iconClass are defined/resolvable, use fallback
                return index_js_default().createElement(fallback.react, { ...props });
            }
            // set the icon's class to iconClass plus props.className
            props.className = classes(iconClass, props.className);
            // render icon as css background image, assuming one is set on iconClass
            return index_js_default().createElement(Private.blankReact, { ...props });
        }
        const resolved = LabIcon.resolve({ icon });
        return index_js_default().createElement(resolved.react, { ...props });
    }
    /**
     * Resolve a \{name, svgstr\} pair into an actual svg node.
     */
    static resolveSvg({ name, svgstr }) {
        const svgDoc = new DOMParser().parseFromString(Private.svgstrShim(svgstr), 'image/svg+xml');
        const svgError = svgDoc.querySelector('parsererror');
        // structure of error element varies by browser, search at top level
        if (svgError) {
            // parse failed, svgElement will be an error box
            const errmsg = `SVG HTML was malformed for LabIcon instance.\nname: ${name}, svgstr: ${svgstr}`;
            if (LabIcon._debug) {
                // fail noisily, render the error box
                console.error(errmsg);
                return svgError;
            }
            else {
                // bad svg is always a real error, fail silently but warn
                console.warn(errmsg);
                return null;
            }
        }
        else {
            // parse succeeded
            return svgDoc.documentElement;
        }
    }
    /**
     * Toggle icon debug from off-to-on, or vice-versa.
     *
     * @param debug - optional boolean to force debug on or off
     */
    static toggleDebug(debug) {
        LabIcon._debug = debug !== null && debug !== void 0 ? debug : !LabIcon._debug;
    }
    /** *********
     * members *
     ***********/
    constructor({ name, svgstr, render, unrender, _loading = false }) {
        this._props = {};
        this._svgReplaced = new index_es6_js_.Signal(this);
        /**
         * Cache for svg parsing intermediates
         *   - undefined: the cache has not yet been populated
         *   - null: a valid, but empty, value
         */
        this._svgElement = undefined;
        this._svgInnerHTML = undefined;
        this._svgReactAttrs = undefined;
        if (!(name && svgstr)) {
            // sanity check failed
            console.error(`When defining a new LabIcon, name and svgstr must both be non-empty strings. name: ${name}, svgstr: ${svgstr}`);
            return badIcon;
        }
        // currently this needs to be set early, before checks for existing icons
        this._loading = _loading;
        // check to see if this is a redefinition of an existing icon
        if (LabIcon._instances.has(name)) {
            // fetch the existing icon, replace its svg, then return it
            const icon = LabIcon._instances.get(name);
            if (this._loading) {
                // replace the placeholder svg in icon
                icon.svgstr = svgstr;
                this._loading = false;
                return icon;
            }
            else {
                // already loaded icon svg exists; replace it and warn
                if (LabIcon._debug) {
                    console.warn(`Redefining previously loaded icon svgstr. name: ${name}, svgstrOld: ${icon.svgstr}, svgstr: ${svgstr}`);
                }
                icon.svgstr = svgstr;
                return icon;
            }
        }
        this.name = name;
        this.react = this._initReact(name);
        this.svgstr = svgstr;
        // setup custom render/unrender methods, if passed in
        this._initRender({ render, unrender });
        LabIcon._instances.set(this.name, this);
    }
    /**
     * Get a view of this icon that is bound to the specified icon/style props
     *
     * @param optional icon/style props (same as args for .element
     * and .react methods). These will be bound to the resulting view
     *
     * @returns a view of this LabIcon instance
     */
    bindprops(props) {
        const view = Object.create(this);
        view._props = props;
        view.react = view._initReact(view.name + '_bind');
        return view;
    }
    /**
     * Create an icon as a DOM element
     *
     * @param className - a string that will be used as the class
     * of the container element. Overrides any existing class
     *
     * @param container - a preexisting DOM element that
     * will be used as the container for the svg element
     *
     * @param label - text that will be displayed adjacent
     * to the icon
     *
     * @param title - a tooltip for the icon
     *
     * @param tag - if container is not explicitly
     * provided, this tag will be used when creating the container
     *
     * @param stylesheet - optional string naming a builtin icon
     * stylesheet, for example 'menuItem' or `statusBar`. Can also be an
     * object defining a custom icon stylesheet, or a list of builtin
     * stylesheet names and/or custom stylesheet objects. If array,
     * the given stylesheets will be merged.
     *
     *   See @jupyterlab/ui-components/src/style/icon.ts for details
     *
     * @param elementPosition - optional position for the inner svg element
     *
     * @param elementSize - optional size for the inner svg element.
     * Set to 'normal' to get a standard 16px x 16px icon
     *
     * @param ...elementCSS - all additional args are treated as
     * overrides for the CSS props applied to the inner svg element
     *
     * @returns A DOM element that contains an (inline) svg element
     * that displays an icon
     */
    element(props = {}) {
        var _a;
        let { className, container, label, title, tag = 'div', ...styleProps } = { ...this._props, ...props };
        // check if icon element is already set
        const maybeSvgElement = container === null || container === void 0 ? void 0 : container.firstChild;
        if (((_a = maybeSvgElement === null || maybeSvgElement === void 0 ? void 0 : maybeSvgElement.dataset) === null || _a === void 0 ? void 0 : _a.iconId) === this._uuid) {
            // return the existing icon element
            return maybeSvgElement;
        }
        // ensure that svg html is valid
        if (!this.svgElement) {
            // bail if failing silently, return blank element
            return document.createElement('div');
        }
        if (container) {
            // take ownership by removing any existing children
            while (container.firstChild) {
                container.firstChild.remove();
            }
        }
        else if (tag) {
            // create a container if needed
            container = document.createElement(tag);
        }
        const svgElement = this.svgElement.cloneNode(true);
        if (!container) {
            if (label) {
                console.warn();
            }
            return svgElement;
        }
        if (label != null) {
            container.textContent = label;
        }
        Private.initContainer({
            container: container,
            className,
            styleProps,
            title
        });
        // add the svg node to the container
        container.appendChild(svgElement);
        return container;
    }
    render(container, options) {
        var _a;
        let label = (_a = options === null || options === void 0 ? void 0 : options.children) === null || _a === void 0 ? void 0 : _a[0];
        // narrow type of label
        if (typeof label !== 'string') {
            label = undefined;
        }
        this.element({
            container,
            label,
            ...options === null || options === void 0 ? void 0 : options.props
        });
    }
    get svgElement() {
        if (this._svgElement === undefined) {
            this._svgElement = this._initSvg({ uuid: this._uuid });
        }
        return this._svgElement;
    }
    get svgInnerHTML() {
        if (this._svgInnerHTML === undefined) {
            if (this.svgElement === null) {
                // the svg element resolved to null, mark this null too
                this._svgInnerHTML = null;
            }
            else {
                this._svgInnerHTML = this.svgElement.innerHTML;
            }
        }
        return this._svgInnerHTML;
    }
    get svgReactAttrs() {
        if (this._svgReactAttrs === undefined) {
            if (this.svgElement === null) {
                // the svg element resolved to null, mark this null too
                this._svgReactAttrs = null;
            }
            else {
                this._svgReactAttrs = getReactAttrs(this.svgElement, {
                    ignore: ['data-icon-id']
                });
            }
        }
        return this._svgReactAttrs;
    }
    get svgstr() {
        return this._svgstr;
    }
    set svgstr(svgstr) {
        this._svgstr = svgstr;
        // associate a new unique id with this particular svgstr
        const uuid = dist_index_js_.UUID.uuid4();
        const uuidOld = this._uuid;
        this._uuid = uuid;
        // empty the svg parsing intermediates cache
        this._svgElement = undefined;
        this._svgInnerHTML = undefined;
        this._svgReactAttrs = undefined;
        // update icon elements created using .element method
        document
            .querySelectorAll(`[data-icon-id="${uuidOld}"]`)
            .forEach(oldSvgElement => {
            if (this.svgElement) {
                oldSvgElement.replaceWith(this.svgElement.cloneNode(true));
            }
        });
        // trigger update of icon elements created using other methods
        this._svgReplaced.emit();
    }
    _initReact(displayName) {
        const component = index_js_default().forwardRef((props = {}, ref) => {
            const { className, container, label, title, slot, tag = 'div', ...styleProps } = { ...this._props, ...props };
            // set up component state via useState hook
            const [, setId] = index_js_default().useState(this._uuid);
            // subscribe to svg replacement via useEffect hook
            index_js_default().useEffect(() => {
                const onSvgReplaced = () => {
                    setId(this._uuid);
                };
                this._svgReplaced.connect(onSvgReplaced);
                // specify cleanup callback as hook return
                return () => {
                    this._svgReplaced.disconnect(onSvgReplaced);
                };
            });
            // make it so that tag can be used as a jsx component
            const Tag = tag !== null && tag !== void 0 ? tag : (index_js_default()).Fragment;
            // ensure that svg html is valid
            if (!(this.svgInnerHTML && this.svgReactAttrs)) {
                // bail if failing silently
                return index_js_default().createElement((index_js_default()).Fragment, null);
            }
            const svgProps = { ...this.svgReactAttrs };
            if (!tag) {
                Object.assign(svgProps, {
                    className: className || styleProps
                        ? classes(className, LabIconStyle.styleClass(styleProps))
                        : undefined,
                    title: title,
                    slot: slot
                });
            }
            const svgComponent = (index_js_default().createElement("svg", { ...svgProps, ...this.svgReactAttrs, dangerouslySetInnerHTML: { __html: this.svgInnerHTML }, ref: ref }));
            if (container) {
                Private.initContainer({ container, className, styleProps, title });
                return (index_js_default().createElement((index_js_default()).Fragment, null,
                    svgComponent,
                    label));
            }
            else {
                let attributes = {};
                if (Tag !== (index_js_default()).Fragment) {
                    attributes = {
                        className: className || styleProps
                            ? classes(className, LabIconStyle.styleClass(styleProps))
                            : undefined,
                        title: title,
                        slot: slot
                    };
                }
                return (index_js_default().createElement(Tag, { ...attributes },
                    svgComponent,
                    label));
            }
        });
        component.displayName = `LabIcon_${displayName}`;
        return component;
    }
    _initRender({ render, unrender }) {
        if (render) {
            this.render = render;
            if (unrender) {
                this.unrender = unrender;
            }
        }
        else if (unrender) {
            console.warn('In _initRender, ignoring unrender arg since render is undefined');
        }
    }
    _initSvg({ title, uuid } = {}) {
        const svgElement = LabIcon.resolveSvg(this);
        if (!svgElement) {
            // bail on null svg element
            return svgElement;
        }
        if (svgElement.tagName !== 'parsererror') {
            // svgElement is an actual svg node, augment it
            svgElement.dataset.icon = this.name;
            if (uuid) {
                svgElement.dataset.iconId = uuid;
            }
            if (title) {
                Private.setTitleSvg(svgElement, title);
            }
            else {
                // mark as a decorative
                svgElement.setAttribute('aria-hidden', 'true');
            }
        }
        return svgElement;
    }
}
LabIcon._debug = false;
LabIcon._instances = new Map();
var Private;
(function (Private) {
    function blankElement({ className = '', container, label, title, tag = 'div', slot, ...styleProps }) {
        if ((container === null || container === void 0 ? void 0 : container.className) === className) {
            // nothing needs doing, return the icon node
            return container;
        }
        if (container) {
            // take ownership by removing any existing children
            while (container.firstChild) {
                container.firstChild.remove();
            }
        }
        else {
            // create a container if needed
            container = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');
        }
        if (label != null) {
            container.textContent = label;
        }
        Private.initContainer({ container, className, styleProps, title });
        return container;
    }
    Private.blankElement = blankElement;
    Private.blankReact = index_js_default().forwardRef(({ className = '', container, label, title, tag = 'div', ...styleProps }, ref) => {
        // make it so that tag can be used as a jsx component
        const Tag = tag !== null && tag !== void 0 ? tag : 'div';
        if (container) {
            initContainer({ container, className, styleProps, title });
            return index_js_default().createElement((index_js_default()).Fragment, null);
        }
        else {
            // if ref is defined, we create a blank svg node and point ref to it
            return (index_js_default().createElement(Tag, { className: classes(className, LabIconStyle.styleClass(styleProps)) },
                ref && blankIcon.react({ ref }),
                label));
        }
    });
    Private.blankReact.displayName = 'BlankReact';
    function initContainer({ container, className, styleProps, title }) {
        if (title != null) {
            container.title = title;
        }
        const styleClass = LabIconStyle.styleClass(styleProps);
        if (className != null) {
            // override the container class with explicitly passed-in class + style class
            const classResolved = classes(className, styleClass);
            container.className = classResolved;
            return classResolved;
        }
        else if (styleClass) {
            // add the style class to the container class
            container.classList.add(styleClass);
            return styleClass;
        }
        else {
            return '';
        }
    }
    Private.initContainer = initContainer;
    function isResolvable(icon) {
        return !!(icon &&
            (typeof icon === 'string' ||
                (icon.name && icon.svgstr)));
    }
    Private.isResolvable = isResolvable;
    function setTitleSvg(svgNode, title) {
        // add a title node to the top level svg node
        const titleNodes = svgNode.getElementsByTagName('title');
        if (titleNodes.length) {
            titleNodes[0].textContent = title;
        }
        else {
            const titleNode = document.createElement('title');
            titleNode.textContent = title;
            svgNode.appendChild(titleNode);
        }
    }
    Private.setTitleSvg = setTitleSvg;
    /**
     * A shim for svgstrs loaded using any loader other than raw-loader.
     * This function assumes that svgstr will look like one of:
     *
     * - the raw contents of an .svg file:
     *   <svg...</svg>
     *
     * - a data URL:
     *   data:[<mediatype>][;base64],<svg...</svg>
     *
     * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
     */
    function svgstrShim(svgstr, strict = true) {
        // decode any uri escaping, condense leading/lagging whitespace,
        // then match to raw svg string
        const [, base64, raw] = decodeURIComponent(svgstr)
            .replace(/>\s*\n\s*</g, '><')
            .replace(/\s*\n\s*/g, ' ')
            .match(strict
            ? // match based on data url schema
                /^(?:data:.*?(;base64)?,)?(.*)/
            : // match based on open of svg tag
                /(?:(base64).*)?(<svg.*)/);
        // decode from base64, if needed
        return base64 ? atob(raw) : raw;
    }
    Private.svgstrShim = svgstrShim;
    /**
     * TODO: figure out story for independent Renderers.
     * Base implementation of IRenderer.
     */
    class Renderer {
        constructor(_icon, _rendererOptions) {
            this._icon = _icon;
            this._rendererOptions = _rendererOptions;
        }
        // eslint-disable-next-line
        render(container, options) { }
    }
    Private.Renderer = Renderer;
    /**
     * TODO: figure out story for independent Renderers.
     * Implementation of IRenderer that creates the icon svg node
     * as a DOM element.
     */
    class ElementRenderer extends Renderer {
        render(container, options) {
            var _a, _b;
            let label = (_a = options === null || options === void 0 ? void 0 : options.children) === null || _a === void 0 ? void 0 : _a[0];
            // narrow type of label
            if (typeof label !== 'string') {
                label = undefined;
            }
            this._icon.element({
                container,
                label,
                ...(_b = this._rendererOptions) === null || _b === void 0 ? void 0 : _b.props,
                ...options === null || options === void 0 ? void 0 : options.props
            });
        }
    }
    Private.ElementRenderer = ElementRenderer;
    /**
     * TODO: figure out story for independent Renderers.
     * Implementation of IRenderer that creates the icon svg node
     * as a React component.
     */
    class ReactRenderer extends Renderer {
        constructor() {
            super(...arguments);
            this._rootDOM = null;
        }
        render(container, options) {
            var _a, _b;
            let label = (_a = options === null || options === void 0 ? void 0 : options.children) === null || _a === void 0 ? void 0 : _a[0];
            // narrow type of label
            if (typeof label !== 'string') {
                label = undefined;
            }
            const icon = this._icon;
            if (this._rootDOM !== null) {
                this._rootDOM.unmount();
            }
            this._rootDOM = (0,client/* createRoot */.s)(container);
            this._rootDOM.render(index_js_default().createElement(icon.react, { container: container, label: label, ...(_b = this._rendererOptions) === null || _b === void 0 ? void 0 : _b.props, ...options === null || options === void 0 ? void 0 : options.props }));
        }
        unrender(container) {
            if (this._rootDOM !== null) {
                this._rootDOM.unmount();
                this._rootDOM = null;
            }
        }
    }
    Private.ReactRenderer = ReactRenderer;
})(Private || (Private = {}));
// need to be at the bottom since constructor depends on Private
const badIcon = new LabIcon({
    name: 'ui-components:bad',
    svgstr: bad_namespaceObject
});
const blankIcon = new LabIcon({
    name: 'ui-components:blank',
    svgstr: blank_namespaceObject
});
//# sourceMappingURL=labicon.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/add-above.svg
const add_above_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 14 14\">\n  <g clip-path=\"url(#addabovea)\">\n    <path fill=\"#616161\" stroke=\"#616161\" stroke-width=\".7\" d=\"M4.75 4.93h1.875v1.876c0 .206.169.375.375.375a.376.376 0 0 0 .375-.375V4.93H9.25a.376.376 0 0 0 .375-.375.376.376 0 0 0-.375-.375H7.375V2.306A.376.376 0 0 0 7 1.93a.376.376 0 0 0-.375.375V4.18H4.75a.376.376 0 0 0-.375.375c0 .206.169.375.375.375Z\" class=\"jp-icon3\"/>\n  </g>\n  <path fill=\"#616161\" fill-rule=\"evenodd\" d=\"M11.5 9.5v2h-9v-2zM12 8a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z\" class=\"jp-icon3\" clip-rule=\"evenodd\"/>\n  <defs>\n    <clipPath id=\"addabovea\">\n      <path fill=\"#fff\" d=\"M10 1.556H4v6h6z\" class=\"jp-icon3\"/>\n    </clipPath>\n  </defs>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/add-below.svg
const add_below_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 14 14\">\n  <g clip-path=\"url(#addbelowa)\">\n    <path fill=\"#616161\" stroke=\"#616161\" stroke-width=\".7\" d=\"M9.25 10.07H7.375V8.193A.376.376 0 0 0 7 7.82a.376.376 0 0 0-.375.375v1.875H4.75a.376.376 0 0 0-.375.375c0 .207.169.375.375.375h1.875v1.875c0 .207.169.375.375.375a.376.376 0 0 0 .375-.375V10.82H9.25a.376.376 0 0 0 .375-.375.376.376 0 0 0-.375-.375Z\" class=\"jp-icon3\"/>\n  </g>\n  <path fill=\"#616161\" fill-rule=\"evenodd\" d=\"M2.5 5.5v-2h9v2zM2 7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1z\" class=\"jp-icon3\" clip-rule=\"evenodd\"/>\n  <defs>\n    <clipPath id=\"addbelowa\">\n      <path fill=\"#fff\" d=\"M4 13.444h6v-6H4z\" class=\"jp-icon3\"/>\n    </clipPath>\n  </defs>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/add.svg
const add_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/audio.svg
const audio_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\r\n  <path class=\"jp-icon3 jp-icon-selectable\" fill=\"#616161\" d=\"M13,4V20a1,1,0,0,1-2,0V4a1,1,0,0,1,2,0ZM8,5A1,1,0,0,0,7,6V18a1,1,0,0,0,2,0V6A1,1,0,0,0,8,5ZM4,7A1,1,0,0,0,3,8v8a1,1,0,0,0,2,0V8A1,1,0,0,0,4,7ZM16,5a1,1,0,0,0-1,1V18a1,1,0,0,0,2,0V6A1,1,0,0,0,16,5Zm4,2a1,1,0,0,0-1,1v8a1,1,0,0,0,2,0V8A1,1,0,0,0,20,7Z\"/>\r\n</svg>\r\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/statusbar/bell.svg
const bell_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\">\n  <path fill=\"#333\" d=\"M8 .29c-1.4 0-2.7.73-3.6 1.8-1.2 1.5-1.4 3.4-1.5 5.2-.18 2.2-.44 4-2.3 5.3l.28 1.3h5c.026.66.32 1.1.71 1.5.84.61 2 .61 2.8 0 .52-.4.6-1 .71-1.5h5l.28-1.3c-1.9-.97-2.2-3.3-2.3-5.3-.13-1.8-.26-3.7-1.5-5.2-.85-1-2.2-1.8-3.6-1.8zm0 1.4c.88 0 1.9.55 2.5 1.3.88 1.1 1.1 2.7 1.2 4.4.13 1.7.23 3.6 1.3 5.2H3c1.1-1.6 1.2-3.4 1.3-5.2.13-1.7.3-3.3 1.2-4.4.59-.72 1.6-1.3 2.5-1.3m-.74 12h1.5c-.001.28.015.79-.74.79-.73.002-.72-.53-.74-.79z\" class=\"jp-icon2 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/breakpoint.svg
const breakpoint_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\">\n  <g fill=\"var(--jp-error-color1, #d32f2f)\">\n    <circle cx=\"10\" cy=\"7\" r=\"6\" />\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/bug-dot.svg
const bug_dot_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3 jp-icon-selectable\">\n    <path fill-rule=\"evenodd\" d=\"M17.19 8H20v2h-2.09c.05.33.09.66.09 1v1h2v2h-2v.027a4.5 4.5 0 0 0-3.545 6.447A5.997 5.997 0 0 1 6.81 18H4v-2h2.09c-.05-.33-.09-.66-.09-1v-1H4v-2h2v-1c0-.34.04-.67.09-1H4V8h2.81c.45-.78 1.07-1.45 1.81-1.96L7 4.41 8.41 3l2.18 2.17c.45-.11.92-.17 1.41-.17s.96.06 1.42.17L15.59 3 17 4.41l-1.63 1.63c.75.51 1.37 1.18 1.82 1.96M10 16h4v-2h-4zm0-4h4v-2h-4z\" clip-rule=\"evenodd\"/>\n    <path d=\"M22 18.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/bug.svg
const bug_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M20 8h-2.81a6 6 0 0 0-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/build.svg
const build_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M14.9 17.45c1.35 0 2.45-1.1 2.45-2.45s-1.1-2.45-2.45-2.45c-1.36 0-2.45 1.1-2.45 2.45s1.09 2.45 2.45 2.45m5.2-1.77 1.48 1.16c.13.11.17.29.08.45l-1.4 2.42a.35.35 0 0 1-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.27 1.85c-.02.17-.17.3-.34.3h-2.8c-.18 0-.32-.13-.35-.3l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.75.7c-.15.06-.34 0-.42-.15l-1.4-2.42a.35.35 0 0 1 .08-.45l1.48-1.16-.05-.68.05-.69-1.48-1.15a.35.35 0 0 1-.08-.45l1.4-2.42c.08-.16.27-.22.42-.16l1.75.71c.36-.28.75-.52 1.18-.69l.26-1.86c.03-.16.17-.29.35-.29h2.8c.17 0 .32.13.34.29l.27 1.86c.42.17.82.41 1.18.69l1.74-.71c.17-.06.34 0 .43.16l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.15.05.69zM7.33 7.445A1.566 1.566 0 0 0 7.904 5.3a1.575 1.575 0 1 0-.574 2.145m2.327-2.65 1.21.157c.096.025.173.12.171.236v1.8a.214.214 0 0 1-.183.223l-1.195.17-.42.75.43 1.126c.037.106 0 .22-.096.275l-1.559.9a.23.23 0 0 1-.294-.05l-.734-.95-.878-.001-.762.96c-.058.08-.173.1-.275.043l-1.56-.901a.23.23 0 0 1-.101-.276l.452-1.116-.246-.366-.194-.396-1.192-.166a.23.23 0 0 1-.189-.226V5.186c.002-.117.077-.206.175-.217l1.204-.175.446-.766-.456-1.11a.23.23 0 0 1 .104-.28l1.56-.9a.225.225 0 0 1 .285.054l.76.936.86.01.745-.949a.214.214 0 0 1 .284-.048l1.56.9a.24.24 0 0 1 .118.267l-.47 1.126.246.366z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/arrow/caret-down-empty.svg
const caret_down_empty_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M5.2 5.9 9 9.7l3.8-3.8L14 7.1l-4.9 5-4.9-5z\" class=\"jp-icon3\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/arrow/caret-down-empty-thin.svg
const caret_down_empty_thin_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 20 20\">\n  <path fill=\"#616161\" d=\"M9.9 13.6 3.6 7.4l.8-.8 5.5 5.6 5.5-5.5.7.7z\" class=\"jp-icon3\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/arrow/caret-down.svg
const caret_down_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M5.2 7.5 9 11.2l3.8-3.8H5.2z\" class=\"jp-icon3\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/arrow/caret-left.svg
const caret_left_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M10.8 12.8 7.1 9l3.8-3.8v7.6z\" class=\"jp-icon3\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/arrow/caret-right.svg
const caret_right_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M7.2 5.2 10.9 9l-3.8 3.8V5.2z\" class=\"jp-icon3\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/arrow/caret-up-empty-thin.svg
const caret_up_empty_thin_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 20 20\">\n  <path fill=\"#616161\" d=\"M15.4 13.3 9.9 7.7l-5.5 5.5-.8-.7 6.3-6.2 6.2 6.3z\" class=\"jp-icon3\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/arrow/caret-up.svg
const caret_up_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M5.2 10.5 9 6.8l3.8 3.8H5.2z\" class=\"jp-icon3\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/search/case-sensitive.svg
const case_sensitive_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 20 20\">\n  <path fill=\"#414141\" d=\"M2 2h16v16H2z\" class=\"jp-icon2\"/>\n  <path fill=\"#FFF\" d=\"M7.6 8h.9l3.5 8h-1.1l-.9-2H6l-.9 2H4zM8 9.1 6.4 13h3.2zm8.6.7c-.2.1-.4.1-.7.1-.2 0-.4-.1-.6-.2-.1-.1-.2-.4-.2-.7-.3.3-.6.5-.9.7-.3.1-.7.2-1.1.2-.3 0-.5 0-.7-.1l-.6-.3c-.2-.1-.3-.3-.4-.5s-.1-.4-.1-.7.1-.6.2-.8.3-.4.4-.5c.1 0 .3-.1.6-.2.2-.1.5-.1.7-.2.3-.1.5-.1.7-.1s.4-.1.6-.1.3-.1.4-.2.2-.2.2-.4c0-1-1.1-1-1.3-1-.4 0-1.4 0-1.4 1.2h-.9c0-.4.1-.7.2-1 .1-.2.3-.4.5-.6s.5-.3.8-.3c.3-.1.6-.1.9-.1s.5 0 .8.1c.3 0 .5.1.7.2s.4.3.5.5.1.4.1.8V9c0 .1.1.2.3.2h.3zm-1.4-2.9c-1.2.6-3.1.2-3.1 1.4 0 1.4 3.1 1 3.1-.5z\" class=\"jp-icon-accent2\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/check.svg
const check_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/circle-empty.svg
const circle_empty_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/circle.svg
const circle_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <circle cx=\"9\" cy=\"9\" r=\"8\" fill=\"#616161\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/cleaning.svg
const cleaning_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M16 11h-1V3c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v8H8c-2.76 0-5 2.24-5 5v7h18v-7c0-2.76-2.24-5-5-5m3 10h-2v-3c0-.55-.45-1-1-1s-1 .45-1 1v3h-2v-3c0-.55-.45-1-1-1s-1 .45-1 1v3H9v-3c0-.55-.45-1-1-1s-1 .45-1 1v3H5v-5c0-1.65 1.35-3 3-3h8c1.65 0 3 1.35 3 3z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/clear.svg
const clear_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <mask id=\"cleara\">\n    <path fill=\"#fff\" d=\"M0 0h24v24H0z\"/>\n    <circle cx=\"12\" cy=\"12\" r=\"8\" fill=\"#000\"/>\n  </mask>\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <path d=\"M4.929 6.343 6.343 4.93l12.728 12.728-1.414 1.414z\"/>\n    <circle cx=\"12\" cy=\"12\" r=\"10\" mask=\"url(#cleara)\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/close-all.svg
const close_all_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <path d=\"M16.48 17.248A7.5 7.5 0 0 0 6.32 7.706a7 7 0 1 1 10.16 9.542\"/>\n    <path d=\"M19.16 14.248A7.5 7.5 0 0 0 9 4.706a7 7 0 1 1 10.16 9.542M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0m-4.209-4L13 12.209 10.209 15 13 17.791 11.791 19 9 16.209 6.209 19 5 17.791 7.791 15 5 12.209 6.209 11 9 13.791z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/close.svg
const close_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <circle cx=\"12\" cy=\"12\" r=\"11\" fill=\"none\" class=\"jp-icon-none jp-icon-selectable-inverse jp-icon3-hover\"/>\n  <path fill=\"#616161\" d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" class=\"jp-icon3 jp-icon-selectable jp-icon-accent2-hover\"/>\n  <circle cx=\"12\" cy=\"12\" r=\"7\" fill=\"none\" class=\"jp-icon-none jp-icon-busy\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/lsp/code-check.svg
const code_check_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M6.59 3.41 2 8l4.59 4.6L8 11.18 4.82 8 8 4.82zm5.82 0L11 4.82 14.18 8 11 11.18l1.41 1.42L17 8zm9.18 8.18-8.09 8.09L9.83 16l-1.41 1.41 5.08 5.09L23 13z\" class=\"jp-icon3 jp-icon-selectable\" shape-rendering=\"geometricPrecision\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/code.svg
const code_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 28 28\">\n  <path fill=\"#616161\" d=\"M11.4 18.6 6.8 14l4.6-4.6L10 8l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L18 8l6 6-6 6z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/collapse-all.svg
const collapse_all_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <path d=\"M8 2h12c1 0 2 1 2 2v12c0 1 0 2-2 2V4H6c0-2 1-2 2-2\"/>\n    <path d=\"M18 8c0-1-1-2-2-2H4C3 6 2 7 2 8v12c0 1 1 2 2 2h12c1 0 2-1 2-2zm-2 0v12H4V8z\"/>\n    <path d=\"M6 13v2h8v-2z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/output/collapse.svg
const collapse_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 8.5 10.5\">\n  <g fill=\"#BDBDBD\" class=\"jp-icon-output\">\n    <path d=\"M.019 0h8.458v1.064H.019zM0 9.52h8.491v1.059H0zm4.776-6.608H3.72V1.323h1.056z\"/>\n    <path d=\"m4.244 5.243-1.06-1.167-1.06-1.167h4.24l-1.06 1.167zm.528 4.014H3.716V7.665h1.056z\"/>\n    <path d=\"M4.242 5.332 5.302 6.5l1.06 1.167h-4.24L3.182 6.5z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/console.svg
const console_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 200 200\">\n  <path fill=\"#0288D1\" d=\"M20 19.8h160v159.9H20z\" class=\"jp-console-icon-background-color jp-icon-selectable\"/>\n  <path fill=\"#fff\" d=\"M105 127.3h40v12.8h-40zM51.1 77 74 99.9l-23.3 23.3 10.5 10.5 23.3-23.3L95 99.9 84.5 89.4 61.6 66.5z\" class=\"jp-console-icon-color jp-icon-selectable-inverse\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/copy.svg
const copy_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M11.9 1H3.2c-.8 0-1.5.7-1.5 1.5v10.2h1.5V2.5h8.7zm2.2 2.9h-8c-.8 0-1.5.7-1.5 1.5v10.2c0 .8.7 1.5 1.5 1.5h8c.8 0 1.5-.7 1.5-1.5V5.4c-.1-.8-.7-1.5-1.5-1.5m0 11.6h-8V5.4h8z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/licenses/copyright.svg
const copyright_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M11.88 9.14c1.28.06 1.61 1.15 1.63 1.66h1.79c-.08-1.98-1.49-3.19-3.45-3.19C9.64 7.61 8 9 8 12.14c0 1.94.93 4.24 3.84 4.24 2.22 0 3.41-1.65 3.44-2.95h-1.79c-.03.59-.45 1.38-1.63 1.44-1.31-.04-1.86-1.06-1.86-2.73 0-2.89 1.28-2.98 1.88-3M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/cut.svg
const cut_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2m0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2m6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5M19 3l-6 6 2 2 7-7V3z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/delete.svg
const delete_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#626262\" d=\"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/dock-bottom.svg
const dock_bottom_namespaceObject = "<svg width=\"16\" version=\"1.1\" viewBox=\"0 0 22 22\" xmlns=\"http://www.w3.org/2000/svg\">\n <path class=\"jp-icon3\" d=\"m19.8 19.8v-17.6h-17.6v17.6zm-15.408-2.2v-3.8027h13.208v3.8027zm13.208-5.5301h-13.218v-7.6699h13.218z\" fill=\"#616161\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/dock-left.svg
const dock_left_namespaceObject = "<svg width=\"16\" version=\"1.1\" viewBox=\"0 0 22 22\" xmlns=\"http://www.w3.org/2000/svg\">\n <path class=\"jp-icon3\" d=\"m2.2 19.8h17.6v-17.6h-17.6zm2.2-15.408h3.8027v13.208h-3.8027zm5.5301 13.208v-13.218h7.6699v13.218z\" fill=\"#616161\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/dock-right.svg
const dock_right_namespaceObject = "<svg width=\"16\" version=\"1.1\" viewBox=\"0 0 22 22\" xmlns=\"http://www.w3.org/2000/svg\">\n <path class=\"jp-icon3\" d=\"m19.8 2.2h-17.6v17.6h17.6zm-2.2 15.408h-3.8027v-13.208h3.8027zm-5.5301-13.208v13.218h-7.6699v-13.218z\" fill=\"#616161\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/dock-top.svg
const dock_top_namespaceObject = "<svg width=\"16\" version=\"1.1\" viewBox=\"0 0 22 22\" xmlns=\"http://www.w3.org/2000/svg\">\n <path class=\"jp-icon3\" d=\"m2.2 2.2v17.6h17.6v-17.6zm15.408 2.2v3.8027h-13.208v-3.8027zm-13.208 5.5301h13.218v7.6699h-13.218z\" fill=\"#616161\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/dots.svg
const dots_namespaceObject = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"16\" version=\"1.1\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"jp-icon3\" transform=\"rotate(90,12,12)\" fill=\"#616161\">\n  <circle cx=\"5\" cy=\"12\" r=\"2\"/>\n  <circle cx=\"12\" cy=\"12\" r=\"2\"/>\n  <circle cx=\"19\" cy=\"12\" r=\"2\"/>\n </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/download.svg
const download_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/duplicate.svg
const duplicate_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 14 14\">\n  <path fill=\"#616161\" fill-rule=\"evenodd\" d=\"M2.8.875h6.096c.305 0 .554.264.554.587s-.25.587-.554.587H3.354c-.305 0-.554.264-.554.587V9.68c0 .322-.25.587-.554.587s-.554-.264-.554-.587V2.049c0-.646.498-1.174 1.108-1.174M5.367 11.9V4.55h5.716v7.35zM4.142 4.142c0-.451.365-.817.816-.817h6.534c.45 0 .816.366.816.817v8.166a.817.817 0 0 1-.816.817H4.958a.817.817 0 0 1-.816-.817z\" class=\"jp-icon3\" clip-rule=\"evenodd\"/>\n  <path fill=\"#616161\" stroke=\"#616161\" stroke-width=\".5\" d=\"M9.436 8.265H8.364v1.071a.215.215 0 0 1-.214.215.215.215 0 0 1-.214-.215v-1.07H6.864a.215.215 0 0 1-.214-.215c0-.118.096-.215.214-.215h1.072v-1.07a.214.214 0 1 1 .428-.001v1.072h1.072c.118 0 .214.096.214.214a.215.215 0 0 1-.214.214Z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/edit.svg
const edit_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/ellipses.svg
const ellipses_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <circle cx=\"5\" cy=\"12\" r=\"2\"/>\n    <circle cx=\"12\" cy=\"12\" r=\"2\"/>\n    <circle cx=\"19\" cy=\"12\" r=\"2\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/error.svg
const error_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <circle cx=\"12\" cy=\"19\" r=\"2\"/>\n    <path d=\"M10 3h4v12h-4z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/exceptions.svg
const exceptions_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <path d=\"m12.039.5-.753 1.506L.5 23.576l23.082-.001zm.001 4.017 8.528 17.05-17.055.001z\"/>\n    <path d=\"M11 8h2v10h-2zm0 11h2v2h-2z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/expand-all.svg
const expand_all_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <path d=\"M8 2h12c1 0 2 1 2 2v12c0 1 0 2-2 2V4H6c0-2 1-2 2-2\"/>\n    <path d=\"M18 8c0-1-1-2-2-2H4C3 6 2 7 2 8v12c0 1 1 2 2 2h12c1 0 2-1 2-2zm-2 0v12H4V8z\"/>\n    <path d=\"M11 10H9v3H6v2h3v3h2v-3h3v-2h-3z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/output/expand.svg
const expand_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 8.5 10.5\">\n  <g fill=\"#BDBDBD\" class=\"jp-icon-output\">\n    <path d=\"M.019 0h8.458v1.064H.019zM0 9.521h8.491v1.059H0zm3.712-5.822h1.056v1.589H3.712z\"/>\n    <path d=\"m4.244 1.368 1.06 1.167 1.06 1.167h-4.24l1.06-1.167zm-.532 3.92h1.056V6.88H3.712z\"/>\n    <path d=\"m4.242 9.213-1.06-1.167-1.06-1.167h4.24l-1.06 1.167z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/extension.svg
const extension_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5a2.5 2.5 0 0 0-5 0V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5a2.5 2.5 0 0 0 0-5\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/fast-forward.svg
const fast_forward_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"m4 18 8.5-6L4 6zm9-12v12l8.5-6z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/file.svg
const file_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <path fill=\"#616161\" d=\"m19.3 8.2-5.5-5.5c-.3-.3-.7-.5-1.2-.5H3.9c-.8.1-1.6.9-1.6 1.8v14.1c0 .9.7 1.6 1.6 1.6h14.2c.9 0 1.6-.7 1.6-1.6V9.4c.1-.5-.1-.9-.4-1.2m-5.8-3.3 3.4 3.6h-3.4zm3.9 12.7H4.7c-.1 0-.2 0-.2-.2V4.7c0-.2.1-.3.2-.3h7.2v4.4s0 .8.3 1.1 1.1.3 1.1.3h4.3v7.2s-.1.2-.2.2\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/file-upload.svg
const file_upload_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/search/filter-dot.svg
const filter_dot_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#FFF\" d=\"M14 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0l-2.01-2.01a.99.99 0 0 1-.29-.83V12h-.03L4.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L14.03 12z\" class=\"jp-icon3\"/>\n  <circle cx=\"18\" cy=\"17\" r=\"3\" fill=\"#FFF\" class=\"jp-icon-dot\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/filter-list.svg
const filter_list_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/search/filter.svg
const filter_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#FFF\" d=\"M14 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0l-2.01-2.01a.99.99 0 0 1-.29-.83V12h-.03L4.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L14.03 12z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/folder-favorite.svg
const folder_favorite_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"#000\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24z\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/folder.svg
const folder_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/history.svg
const history_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M13.5 8H12v5l4.28 2.54.72-1.21-3.5-2.08zM13 3a9 9 0 0 0-9 9H1l3.96 4.03L9 12H6a7 7 0 0 1 7-7 7 7 0 0 1 7 7 7 7 0 0 1-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.9 8.9 0 0 0 13 21a9 9 0 0 0 9-9 9 9 0 0 0-9-9\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/home.svg
const home_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"#000\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/html5.svg
const html5_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 512 512\">\n  <path fill=\"#000\" d=\"M108.4 0h23v22.8h21.2V0h23v69h-23V46h-21v23h-23.2M206 23h-20.3V0h63.7v23H229v46h-23m53.5-69h24.1l14.8 24.3L313.2 0h24.1v69h-23V34.8l-16.1 24.8-16.1-24.8V69h-22.6m89.2-69h23v46.2h32.6V69h-55.6\" class=\"jp-icon0 jp-icon-selectable\"/>\n  <path fill=\"#e44d26\" d=\"m107.6 471-33-370.4h362.8l-33 370.2L255.7 512\" class=\"jp-icon-selectable\"/>\n  <path fill=\"#f16529\" d=\"M256 480.5V131h148.3L376 447\" class=\"jp-icon-selectable\"/>\n  <path fill=\"#ebebeb\" d=\"M142 176.3h114v45.4h-64.2l4.2 46.5h60v45.3H154.4m2 22.8H202l3.2 36.3 50.8 13.6v47.4l-93.2-26\" class=\"jp-icon-selectable-inverse\"/>\n  <path fill=\"#fff\" d=\"M369.6 176.3H255.8v45.4h109.6m-4.1 46.5H255.8v45.4h56l-5.3 59-50.7 13.6v47.2l93-25.8\" class=\"jp-icon-selectable-inverse\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/image.svg
const image_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <path fill=\"#FFF\" d=\"M2.2 2.2h17.5v17.5H2.2z\" class=\"jp-icon-brand4 jp-icon-selectable-inverse\"/>\n  <path fill=\"#3F51B5\" d=\"M2.2 2.2v17.5h17.5l.1-17.5zm12.1 2.2c1.2 0 2.2 1 2.2 2.2s-1 2.2-2.2 2.2-2.2-1-2.2-2.2 1-2.2 2.2-2.2M4.4 17.6l3.3-8.8 3.3 6.6 2.2-3.2 4.4 5.4z\" class=\"jp-icon-brand0 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/info.svg
const info_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 50.978 50.978\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <path d=\"M43.52 7.458C38.711 2.648 32.307 0 25.489 0 18.67 0 12.266 2.648 7.458 7.458c-9.943 9.941-9.943 26.119 0 36.062 4.809 4.809 11.212 7.456 18.031 7.458h.002c6.816 0 13.221-2.648 18.029-7.458 4.809-4.809 7.457-11.212 7.457-18.03 0-6.82-2.649-13.224-7.457-18.032m-1.414 34.647c-4.432 4.431-10.332 6.872-16.615 6.872h-.002c-6.285-.001-12.187-2.441-16.617-6.872-9.162-9.163-9.162-24.071 0-33.233C13.303 4.44 19.204 2 25.489 2c6.284 0 12.186 2.44 16.617 6.872 4.431 4.431 6.871 10.332 6.871 16.617 0 6.283-2.441 12.186-6.871 16.616\"/>\n    <path d=\"M23.578 32.218q-.034-2.602.496-3.972t2.272-3.253q.702-.805 1.367-1.575.939-1.13 1.436-2.175.496-1.061.495-2.5 0-1.643-.779-2.979-.848-1.319-2.806-1.369-2.703.085-3.55 1.832a5.3 5.3 0 0 0-.607 1.814 11.3 11.3 0 0 0-.207 2.174h-2.937q-.136-3.312 1.493-5.719 1.593-2.459 5.378-2.527 3.24.034 5.141 1.758 1.918 1.74 1.95 4.811 0 1.712-.41 2.911a7.6 7.6 0 0 1-1.268 2.243 22 22 0 0 1-1.73 2.002 34 34 0 0 0-1.987 2.346 5.2 5.2 0 0 0-.565 1.199q-.24 1.438-.171 2.979zm0 6.002v-3.484h3.076v3.484z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/inspector.svg
const inspector_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z\" class=\"jp-inspector-icon-color jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/json.svg
const json_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <g fill=\"#F9A825\" class=\"jp-json-icon-color jp-icon-selectable\">\n    <path d=\"M20.2 11.8c-1.6 0-1.7.5-1.7 1 0 .4.1.9.1 1.3.1.5.1.9.1 1.3 0 1.7-1.4 2.3-3.5 2.3h-.9v-1.9h.5c1.1 0 1.4 0 1.4-.8 0-.3 0-.6-.1-1 0-.4-.1-.8-.1-1.2 0-1.3 0-1.8 1.3-2-1.3-.2-1.3-.7-1.3-2 0-.4.1-.8.1-1.2.1-.4.1-.7.1-1 0-.8-.4-.7-1.4-.8h-.5V4.1h.9c2.2 0 3.5.7 3.5 2.3 0 .4-.1.9-.1 1.3-.1.5-.1.9-.1 1.3 0 .5.2 1 1.7 1zM1.8 10.1c1.6 0 1.7-.5 1.7-1 0-.4-.1-.9-.1-1.3-.1-.5-.1-.9-.1-1.3 0-1.6 1.4-2.3 3.5-2.3h.9v1.9h-.5c-1 0-1.4 0-1.4.8 0 .3 0 .6.1 1 0 .2.1.6.1 1 0 1.3 0 1.8-1.3 2C6 11.2 6 11.7 6 13c0 .4-.1.8-.1 1.2-.1.3-.1.7-.1 1 0 .8.3.8 1.4.8h.5v1.9h-.9c-2.1 0-3.5-.6-3.5-2.3 0-.4.1-.9.1-1.3.1-.5.1-.9.1-1.3 0-.5-.2-1-1.7-1z\"/>\n    <circle cx=\"11\" cy=\"13.8\" r=\"2.1\"/>\n    <circle cx=\"11\" cy=\"8.2\" r=\"2.1\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/julia.svg
const julia_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 325 300\">\n  <path fill=\"#cb3c33\" d=\"M150.898 225c0 41.422-33.578 75-75 75s-75-33.578-75-75 33.579-75 75-75 75 33.578 75 75\" class=\"jp-brand0 jp-icon-selectable\"/>\n  <path fill=\"#389826\" d=\"M237.5 75c0 41.422-33.578 75-75 75s-75-33.578-75-75 33.578-75 75-75 75 33.578 75 75\" class=\"jp-brand0 jp-icon-selectable\"/>\n  <path fill=\"#9558b2\" d=\"M324.102 225c0 41.422-33.579 75-75 75s-75-33.578-75-75 33.578-75 75-75 75 33.578 75 75\" class=\"jp-brand0 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/jupyter/jupyter-favicon.svg
const jupyter_favicon_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"152\" height=\"165\" version=\"1.1\" viewBox=\"0 0 152 165\">\n  <path fill=\"#F37726\" d=\"M76.021 140.163c-32.64 0-61.145-11.927-75.942-29.58 5.51 15.84 15.781 29.567 29.39 39.278a80.17 80.17 0 0 0 46.57 14.929 80.17 80.17 0 0 0 46.57-14.929c13.61-9.711 23.88-23.437 29.391-39.278-14.833 17.653-43.338 29.58-75.979 29.58m-.005-114.832c32.64 0 61.146 11.927 75.943 29.58a80.9 80.9 0 0 0-29.391-39.278A80.16 80.16 0 0 0 75.998.705a80.16 80.16 0 0 0-46.57 14.928A80.9 80.9 0 0 0 .038 54.912c14.832-17.617 43.338-29.58 75.978-29.58\" class=\"jp-jupyter-icon-color\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/jupyter/jupyter.svg
const jupyter_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"39\" height=\"51\" viewBox=\"0 0 39 51\">\n  <path fill=\"#F37726\" d=\"M20.005 38.114c-7.85 0-14.706-2.876-18.265-7.134a19.5 19.5 0 0 0 7.069 9.473 19.24 19.24 0 0 0 11.2 3.6c4.013 0 7.927-1.258 11.2-3.6a19.5 19.5 0 0 0 7.069-9.473c-3.567 4.258-10.423 7.134-18.273 7.134m-.002-27.694c7.85 0 14.706 2.876 18.265 7.133a19.5 19.5 0 0 0-7.069-9.473A19.24 19.24 0 0 0 20 4.48a19.24 19.24 0 0 0-11.2 3.6 19.5 19.5 0 0 0-7.069 9.473c3.567-4.248 10.423-7.134 18.273-7.134\" class=\"jp-jupyter-icon-color\"/>\n  <path fill=\"#616161\" d=\"M37.194 3.154a3 3 0 0 1-.426 1.672 2.96 2.96 0 0 1-1.275 1.153 2.93 2.93 0 0 1-3.238-.505 3 3 0 0 1-.776-3.21c.2-.553.558-1.033 1.029-1.38a2.93 2.93 0 0 1 3.733.209c.576.532.919 1.274.953 2.061M9.228 46.393a3.77 3.77 0 0 1-.536 2.11 3.73 3.73 0 0 1-1.608 1.452 3.69 3.69 0 0 1-4.082-.638 3.75 3.75 0 0 1-1.097-1.875 3.8 3.8 0 0 1 .122-2.173 3.74 3.74 0 0 1 1.299-1.739 3.696 3.696 0 0 1 4.704.268 3.76 3.76 0 0 1 1.198 2.595M2.635 9.456a2.17 2.17 0 0 1-1.227-.318 2.2 2.2 0 0 1-.845-.951A2.22 2.22 0 0 1 .935 5.77a2.16 2.16 0 0 1 2.356-.577c.405.15.757.418 1.011.77a2.21 2.21 0 0 1-.156 2.783 2.17 2.17 0 0 1-1.511.71\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/jupyter/jupyterlab-wordmark.svg
const jupyterlab_wordmark_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" viewBox=\"0 0 1860.8 475\">\n  <path fill=\"#4E4E4E\" d=\"M53.324 293.087c0 48.7-3.7 64.7-13.6 76.4-10.8 10-25 15.5-39.7 15.5l3.7 29c22.8.3 44.8-7.9 61.9-23.1 17.8-18.5 24-44.1 24-83.3v-184.3h-36.4v170.1zm271.42-22.179c0 21 0 39.5 1.7 55.4h-31.8l-2.1-33.3h-.8c-6.7 11.6-16.4 21.3-28 27.9s-24.8 10-38.2 9.8c-31.4 0-69-17.7-69-89v-118.8h36.4v112.7c0 38.7 11.6 64.7 44.6 64.7 10.3-.2 20.4-3.5 28.9-9.4s15.1-14.3 18.9-23.9c2.2-6.1 3.3-12.5 3.3-18.9v-125h36.4v147.8zm68.512-81.525c0-26-.8-47-1.7-66.7h32.7l1.7 34.8h.8c7.1-12.5 17.5-22.8 30.1-29.7 12.5-7 26.7-10.3 41-9.8 48.3 0 84.7 41.7 84.7 103.3 0 73.1-43.7 109.2-91 109.2-12.1.5-24.2-2.2-35-7.8s-19.9-13.9-26.6-24.2h-.8v110.5h-36v-220zm36 54.2c.1 5.1.6 10.1 1.7 15.1 3 12.3 9.9 23.3 19.8 31.1s22.1 12.1 34.7 12.1c38.5 0 60.7-31.9 60.7-78.5 0-40.7-21.1-75.6-59.5-75.6-12.9.4-25.3 5.1-35.3 13.4-9.9 8.3-16.9 19.7-19.6 32.4-1.5 4.9-2.3 10-2.5 15.1zm217.572-120.485 43.7 120.1c4.5 13.4 9.5 29.4 12.8 41.7h.8c3.7-12.2 7.9-27.7 12.8-42.4l39.7-119.2h38.5l-54.4 144.8c-26 69.7-43.7 105.4-68.6 127.2-12.5 11.7-27.9 20-44.6 23.9l-9.1-31.1c11.7-3.9 22.5-10.1 31.8-18.1 13.2-11.1 23.7-25.2 30.6-41.2 1.5-2.8 2.5-5.7 2.9-8.8-.3-3.3-1.2-6.6-2.5-9.7l-73.8-187.1h39.7zM890.649 64.65v58.3h52v28.2h-52v109.5c0 25 7 39.5 27.3 39.5 7.1.1 14.2-.7 21.1-2.5l1.7 27.7c-10.3 3.7-21.3 5.4-32.2 5-7.3.4-14.6-.7-21.3-3.4-6.8-2.7-12.9-6.8-17.9-12.1-10.3-10.9-14.1-29-14.1-52.9v-110.8h-31v-28.2h31v-48.7zm119.111 166.711c.8 50 32.2 70.6 68.6 70.6 19 .6 37.9-3 55.3-10.5l6.2 26.4c-20.9 8.9-43.5 13.1-66.2 12.6-61.5 0-98.3-41.2-98.3-102.5 0-61.4 35.5-109.6 93.7-109.6 65.2 0 82.7 58.3 82.7 95.7-.1 5.8-.5 11.5-1.2 17.2h-140.8zm106.6-26.4c.4-23.5-9.5-60.1-50.4-60.1-36.8 0-52.8 34.4-55.7 60.1zm88.317-18.505c0-23.9-.4-44.5-1.7-63.4h31.8l1.2 39.9h1.7c9.1-27.3 31-44.5 55.3-44.5 3.5-.1 7 .4 10.3 1.2v34.8c-4.1-.9-8.2-1.3-12.4-1.2-25.6 0-43.7 19.7-48.7 47.4-1 5.7-1.6 11.5-1.7 17.2v108.3h-36v-139.7z\" class=\"jp-icon2\"/>\n  <path fill=\"#F37726\" d=\"M1352.3 326.2h37V28h-37zm252.5 0c-2.5-13.9-3.4-31.1-3.4-48.7v-76c0-40.7-15.1-83.1-77.3-83.1-25.6 0-50 7.1-66.8 18.1l8.4 24.4c14.3-9.2 34-15.1 53-15.1 41.6 0 46.2 30.2 46.2 47v4.2c-78.6-.4-122.3 26.5-122.3 75.6 0 29.4 21 58.4 62.2 58.4 29 0 50.9-14.3 62.2-30.2h1.3l2.9 25.6h33.6zm-39.1-68.5c0 3.8-.8 8-2.1 11.8-5.9 17.2-22.7 34-49.2 34-18.9 0-34.9-11.3-34.9-35.3 0-39.5 45.8-46.6 86.2-45.8zm132.8 68.5 1.7-33.6h1.3c15.1 26.9 38.7 38.2 68.1 38.2 45.4 0 91.2-36.1 91.2-108.8.4-61.7-35.3-103.7-85.7-103.7-32.8 0-56.3 14.7-69.3 37.4h-.8V28h-36.6v245.7c0 18.1-.8 38.6-1.7 52.5zm6.3-118c0-5.9 1.3-10.9 2.1-15.1 7.6-28.1 31.1-45.4 56.3-45.4 39.5 0 60.5 34.9 60.5 75.6 0 46.6-23.1 78.1-61.8 78.1-26.9 0-48.3-17.6-55.5-43.3-.8-4.2-1.7-8.8-1.7-13.4v-36.5z\" class=\"jp-jupyter-icon-color\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/statusbar/kernel.svg
const kernel_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M15 9H9v6h6zm-2 4h-2v-2h2zm8-2V9h-2V7c0-1.1-.9-2-2-2h-2V3h-2v2h-2V3H9v2H7c-1.1 0-2 .9-2 2v2H3v2h2v2H3v2h2v2c0 1.1.9 2 2 2h2v2h2v-2h2v2h2v-2h2c1.1 0 2-.9 2-2v-2h2v-2h-2v-2zm-4 6H7V7h10z\" class=\"jp-icon2\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/keyboard.svg
const keyboard_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m-9 3h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-1 2H5v-2h2zm0-3H5V8h2zm9 7H8v-2h8zm0-4h-2v-2h2zm0-3h-2V8h2zm3 3h-2v-2h2zm0-3h-2V8h2z\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/launch.svg
const launch_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" viewBox=\"0 0 32 32\">\n  <g fill=\"#616161\" class=\"jp-icon3 jp-icon-selectable\">\n    <path d=\"M26 28H6a2.003 2.003 0 0 1-2-2V6a2.003 2.003 0 0 1 2-2h10v2H6v20h20V16h2v10a2.003 2.003 0 0 1-2 2\"/>\n    <path d=\"M20 2v2h6.586L18 12.586 19.414 14 28 5.414V12h2V2z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/launcher.svg
const launcher_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/statusbar/line-form.svg
const line_form_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#fff\" d=\"M5.88 4.12 13.76 12l-7.88 7.88L8 22l10-10L8 2z\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/link.svg
const link_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/statusbar/list.svg
const list_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z\" class=\"jp-icon2 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/lock.svg
const lock_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 23\">\n  <path fill=\"#333\" d=\"M12 17a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m6-9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2h1V6a5 5 0 0 1 5-5 5 5 0 0 1 5 5v2zm-6-5a3 3 0 0 0-3 3v2h6V6a3 3 0 0 0-3-3\" class=\"jp-icon4\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/markdown.svg
const markdown_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <path fill=\"#7B1FA2\" d=\"M5 14.9h12l-6.1 6zm9.4-6.8c0-1.3-.1-2.9-.1-4.5-.4 1.4-.9 2.9-1.3 4.3l-1.3 4.3h-2L8.5 7.9c-.4-1.3-.7-2.9-1-4.3-.1 1.6-.1 3.2-.2 4.6L7 12.4H4.8l.7-11h3.3L10 5c.4 1.2.7 2.7 1 3.9.3-1.2.7-2.6 1-3.9l1.2-3.7h3.3l.6 11h-2.4z\" class=\"jp-icon-contrast0 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/mermaid.svg
const mermaid_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" version=\"1.1\" viewBox=\"0 0 491 675\">\n  <path fill=\"#ff3670\" d=\"M85 92c-46 0-85 37-85 85v321c0 46 37 85 85 85h321c46 0 85-37 85-85V177c0-46-37-85-85-85zm-2 111c72-3.1 139 41 162 109 25-67 91-112 162-109 2.4 57-25 111-72 144-24 16-39 44-39 74v51H192v-51c.08-29-15-57-39-74-47-32-75-86-72-144z\" class=\"jp-icon-contrast2 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/move-down.svg
const move_down_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 14 14\">\n  <path fill=\"#616161\" d=\"M12.471 7.529a.748.748 0 0 0-1.057-1.058L7.75 10.127V1.75a.75.75 0 0 0-1.5 0v8.378l-3.653-3.66a.753.753 0 1 0-1.065 1.064l4.76 4.76a1 1 0 0 0 1.415 0z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/move-up.svg
const move_up_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 14 14\">\n  <path fill=\"#616161\" d=\"M1.529 6.471a.748.748 0 0 0 1.057 1.058L6.25 3.873v8.377a.75.75 0 0 0 1.5 0V3.873l3.653 3.659a.753.753 0 1 0 1.065-1.064l-4.76-4.76a1 1 0 0 0-1.415 0z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/new-folder.svg
const new_folder_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-1 8h-3v3h-2v-3h-3v-2h3V9h2v3h3z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/statusbar/not-trusted.svg
const not_trusted_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" fill=\"none\" viewBox=\"0 0 25 25\">\n  <path stroke=\"#333\" stroke-width=\"2\" d=\"M4.86 14.44c-1.034-2.67-.996-5.382-.61-7.24 1.232-.267 2.83-.797 4.351-1.355a92 92 0 0 0 4.387-1.75 68 68 0 0 0 4.23 1.748c1.532.57 3.182 1.11 4.536 1.37.382 1.859.417 4.564-.615 7.228-1.109 2.862-3.472 5.743-8.139 7.494-4.667-1.75-7.03-4.632-8.14-7.494Zm11.824-5.12-7.368 7.365m7.368-.001L9.316 9.319\" class=\"jp-icon2\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/notebook.svg
const notebook_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <g fill=\"#EF6C00\" class=\"jp-notebook-icon-color jp-icon-selectable\">\n    <path d=\"M18.7 3.3v15.4H3.3V3.3zm1.5-1.5H1.8v18.3h18.3z\"/>\n    <path d=\"m16.5 16.5-5.4-4.3-5.6 4.3v-11h11z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/numbering.svg
const numbering_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 28 28\">\n  <path fill=\"#616161\" d=\"M4 19h2v.5H5v1h1v.5H4v1h3v-4H4zm1-9h1V6H4v1h1zm-1 3h1.8L4 15.1v.9h3v-1H5.2L7 12.9V12H4zm5-6v2h14V7zm0 14h14v-2H9zm0-6h14v-2H9z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/offline-bolt.svg
const offline_bolt_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M12 2.02c-5.51 0-9.98 4.47-9.98 9.98s4.47 9.98 9.98 9.98 9.98-4.47 9.98-9.98S17.51 2.02 12 2.02M11.48 20v-6.26H8L13 4v6.26h3.35z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/open-kernel-source.svg
const open_kernel_source_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M5 2h10l5 5v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6h1v2l4-3-4-3v2H3V4a2 2 0 0 1 2-2m7 16h4v-2h-4zm0-4h6v-2h-6zm0-4h6V8h-6zm-2 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2m-7-2v2H1v-2z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/palette.svg
const palette_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\">\n    <path d=\"M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5zm1.3-4.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12zM15.5 9a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5\"/>\n    <path fill-rule=\"evenodd\" d=\"M4 6h5.019a6.5 6.5 0 0 0 3.015 6H9v2h7v-1.019c.57-.043 1.12-.16 1.64-.341L18 13v7H4zm4 2H6v2h2zm-2 4h2v2H6zm2 4H6v2h2zm1 0h7v2H9z\" clip-rule=\"evenodd\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/paste.svg
const paste_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m7 18H5V4h2v3h10V4h2z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/pause.svg
const pause_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M7 6h4v12H7Zm6 0h4v12h-4z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/pdf.svg
const pdf_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <path fill=\"#FF2A2A\" d=\"m17.933 13.667 3.987 3.987-1.117 1.117-2.51-2.51-1.066 1.067 2.36 2.36-1.117 1.117-2.36-2.36-2.43 2.429-1.477-1.478zm-6.163-3.93-3.496 3.496.53.53q.905.906 1.83.932.929.031 1.784-.825.852-.852.822-1.773t-.94-1.83zm-.36-2.594 1.557 1.558q1.305 1.305 1.754 2.13.456.825.468 1.727.015.79-.296 1.493-.31.702-.951 1.343-.649.648-1.355.963-.702.31-1.493.295-.905-.015-1.738-.472-.829-.46-2.118-1.75L5.68 12.874zm-5.76-5.76L8.1 3.835Q9.195 4.93 9.291 6q.103 1.07-.795 1.968-.901.902-1.976.802-1.067-.1-2.16-1.193l-.975-.975L1.397 8.59-.08 7.113Zm.406 2.548-1.6 1.6.817.818q.43.43.871.457.445.023.829-.361t.357-.825-.457-.871z\" class=\"jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/python.svg
const python_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"-10 -10 131.161 132.389\">\n  <path fill=\"#306998\" d=\"M54.919 0c-4.584.022-8.961.413-12.813 1.095C30.76 3.099 28.7 7.295 28.7 15.032v10.219h26.813v3.406H18.638c-7.793 0-14.616 4.684-16.75 13.594-2.462 10.213-2.571 16.586 0 27.25 1.905 7.938 6.457 13.594 14.25 13.594h9.218v-12.25c0-8.85 7.657-16.657 16.75-16.657h26.782c7.454 0 13.406-6.138 13.406-13.625v-25.53c0-7.267-6.13-12.726-13.406-13.938C64.282.328 59.502-.02 54.918 0m-14.5 8.22c2.77 0 5.031 2.298 5.031 5.125 0 2.816-2.262 5.093-5.031 5.093-2.78 0-5.031-2.277-5.031-5.093 0-2.827 2.251-5.125 5.03-5.125\" class=\"jp-icon-selectable\"/>\n  <path fill=\"#ffd43b\" d=\"M85.638 28.657v11.906c0 9.231-7.826 17-16.75 17H42.106c-7.336 0-13.406 6.279-13.406 13.625V96.72c0 7.266 6.319 11.54 13.406 13.625 8.488 2.495 16.627 2.946 26.782 0 6.75-1.955 13.406-5.888 13.406-13.625V86.5H55.513v-3.405H95.7c7.793 0 10.696-5.436 13.406-13.594 2.8-8.399 2.68-16.476 0-27.25-1.925-7.758-5.604-13.594-13.406-13.594zM70.575 93.313c2.78 0 5.031 2.278 5.031 5.094 0 2.827-2.251 5.125-5.031 5.125-2.77 0-5.031-2.298-5.031-5.125 0-2.816 2.261-5.094 5.031-5.094\" class=\"jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/r-kernel.svg
const r_kernel_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\"  preserveAspectRatio=\"xMidYMid\" width=\"16\" height=\"16\" viewBox=\"0 0 724 561\">\n  <path class=\"jp-icon-selectable\" d=\"M361.453,485.937 C162.329,485.937 0.906,377.828 0.906,244.469 C0.906,111.109 162.329,3.000 361.453,3.000 C560.578,3.000 722.000,111.109 722.000,244.469 C722.000,377.828 560.578,485.937 361.453,485.937 ZM416.641,97.406 C265.289,97.406 142.594,171.314 142.594,262.484 C142.594,353.654 265.289,427.562 416.641,427.562 C567.992,427.562 679.687,377.033 679.687,262.484 C679.687,147.971 567.992,97.406 416.641,97.406 Z\" fill=\"rgb(179,179,179)\" fill-rule=\"evenodd\"/>\n  <path class=\"jp-icon-selectable\" d=\"M550.000,377.000 C550.000,377.000 571.822,383.585 584.500,390.000 C588.899,392.226 596.510,396.668 602.000,402.500 C607.378,408.212 610.000,414.000 610.000,414.000 L696.000,559.000 L557.000,559.062 L492.000,437.000 C492.000,437.000 478.690,414.131 470.500,407.500 C463.668,401.969 460.755,400.000 454.000,400.000 C449.298,400.000 420.974,400.000 420.974,400.000 L421.000,558.974 L298.000,559.026 L298.000,152.938 L545.000,152.938 C545.000,152.938 657.500,154.967 657.500,262.000 C657.500,369.033 550.000,377.000 550.000,377.000 ZM496.500,241.024 L422.037,240.976 L422.000,310.026 L496.500,310.002 C496.500,310.002 531.000,309.895 531.000,274.877 C531.000,239.155 496.500,241.024 496.500,241.024 Z\" fill=\"rgb(52,101,176)\" fill-rule=\"evenodd\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/react.svg
const react_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"150 150 541.9 295.3\">\n  <g fill=\"#61DAFB\" class=\"jp-icon-brand2 jp-icon-selectable\">\n    <path d=\"M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4\"/>\n    <circle cx=\"420.9\" cy=\"296.5\" r=\"45.7\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/redo.svg
const redo_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8 8 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/search/regex.svg
const regex_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 20 20\">\n  <path fill=\"#414141\" d=\"M2 2h16v16H2z\" class=\"jp-icon2\"/>\n  <g fill=\"#FFF\" class=\"jp-icon-accent2\">\n    <circle cx=\"5.5\" cy=\"14.5\" r=\"1.5\"/>\n    <path d=\"M12 4h1v8h-1z\"/>\n    <path d=\"m8.786 9.567 6.928-4 .5.866-6.928 4z\"/>\n    <path d=\"m8.786 6.433.5-.866 6.928 4-.5.866z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/run.svg
const run_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M8 5v14l11-7z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/running.svg
const running_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 512 512\">\n  <path fill=\"#616161\" d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8m96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/save.svg
const save_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/search.svg
const search_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 18 18\">\n  <path fill=\"#616161\" d=\"M12.1 10.9h-.7l-.2-.2c.8-.9 1.3-2.2 1.3-3.5 0-3-2.4-5.4-5.4-5.4S1.8 4.2 1.8 7.1s2.4 5.4 5.4 5.4c1.3 0 2.5-.5 3.5-1.3l.2.2v.7l4.1 4.1 1.2-1.2zm-5 0c-2.1 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7 3.7 1.7 3.7 3.7-1.6 3.7-3.7 3.7\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/selected-breakpoint.svg
const selected_breakpoint_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\">\n  <circle cx=\"10\" cy=\"7\" r=\"6\" fill=\"var(--jp-warn-color1, #f57c00)\" />\n  <circle cx=\"10\" cy=\"7\" r=\"4\" stroke=\"var(--jp-layout-color0, #fff)\" stroke-width=\"1.3\" />\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/settings.svg
const settings_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.49.49 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/share.svg
const share_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M18 2c-1.645 0-3 1.355-3 3 0 .191.022.377.057.559L7.922 9.72A2.97 2.97 0 0 0 6 9c-1.645 0-3 1.355-3 3s1.355 3 3 3c.732 0 1.399-.278 1.922-.72l7.135 4.16A3 3 0 0 0 15 19c0 1.645 1.355 3 3 3s3-1.355 3-3-1.355-3-3-3a2.97 2.97 0 0 0-1.922.723l-7.135-4.164C8.978 12.377 9 12.19 9 12s-.022-.377-.057-.559l7.135-4.162C16.601 7.722 17.268 8 18 8c1.645 0 3-1.355 3-3s-1.355-3-3-3m0 2c.564 0 1 .436 1 1s-.436 1-1 1-1-.436-1-1 .436-1 1-1M6 11c.564 0 1 .436 1 1s-.436 1-1 1-1-.436-1-1 .436-1 1-1m12 7c.564 0 1 .436 1 1s-.436 1-1 1-1-.436-1-1 .436-1 1-1\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/spreadsheet.svg
const spreadsheet_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <path fill=\"#4CAF50\" d=\"M2.2 2.2v17.6h17.6V2.2zm15.4 7.7h-5.5V4.4h5.5zM9.9 4.4v5.5H4.4V4.4zm-5.5 7.7h5.5v5.5H4.4zm7.7 5.5v-5.5h5.5v5.5z\" class=\"jp-icon-contrast1 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/step-into.svg
const step_into_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n  <path fill=\"#616161\" d=\"M8 9.532h.542l3.905-3.905-1.061-1.06-2.637 2.61V1H7.251v6.177l-2.637-2.61-1.061 1.06 3.905 3.905zm1.956 3.481a2 2 0 1 1-4 0 2 2 0 0 1 4 0\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/step-out.svg
const step_out_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n  <path fill=\"#616161\" d=\"M8 1h-.542L3.553 4.905l1.061 1.06 2.637-2.61v6.177h1.498V3.355l2.637 2.61 1.061-1.06L8.542 1zm1.956 12.013a2 2 0 1 1-4 0 2 2 0 0 1 4 0\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/step-over.svg
const step_over_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n  <path fill=\"#616161\" d=\"M14.25 5.75v-4h-1.5v2.542c-1.145-1.359-2.911-2.209-4.84-2.209-3.177 0-5.92 2.307-6.16 5.398l-.02.269h1.5l.022-.226c.212-2.195 2.202-3.94 4.656-3.94 1.736 0 3.244.875 4.05 2.166h-2.83v1.5h4.163l.962-.975V5.75zM8 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/stop.svg
const stop_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M6 6h12v12H6z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/tab.svg
const tab_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H3V5h10v4h8z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/table-rows.svg
const table_rows_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M21 8H3V4h18zm0 2H3v4h18zm0 6H3v4h18z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/tag.svg
const tag_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"28\" height=\"28\" viewBox=\"0 0 43 28\">\n  <path fill=\"#616161\" d=\"M28.833 12.334 33 16.501l4.166-4.167zM16.21 21.61c-.523.52-1.366.52-1.885 0l-7.342-6.885c-.41-.386-.9-1.115-.935-1.677-.095-1.52-.028-4.429.018-5.971A1.093 1.093 0 0 1 7.118 6.03c1.97-.046 6.146-.095 6.534.293l8.085 7.315c.519.52.048 1.833-.475 2.356zM9.775 8.265a1.126 1.126 0 1 0-1.593 1.592 1.126 1.126 0 0 0 1.593-1.592\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/statusbar/terminal.svg
const terminal_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#333\" d=\"M2 2h20v20H2z\" class=\"jp-terminal-icon-background-color jp-icon-selectable\"/>\n  <path fill=\"#fff\" d=\"M9.01 14.762q0-.246-.077-.434a.9.9 0 0 0-.234-.351 1.6 1.6 0 0 0-.422-.288 5 5 0 0 0-.627-.263q-.592-.211-1.078-.446a3.5 3.5 0 0 1-.832-.544 2.2 2.2 0 0 1-.528-.721 2.4 2.4 0 0 1-.187-.985q0-.498.17-.908a2.1 2.1 0 0 1 .48-.72q.31-.306.75-.493.44-.188.979-.24V7.11h.937v1.272q.527.07.95.287.421.217.714.568.3.345.457.82.165.47.164 1.055H8.998q0-.709-.323-1.072-.322-.37-.873-.37-.299 0-.521.083a.9.9 0 0 0-.358.223.9.9 0 0 0-.21.334q-.066.194-.065.421 0 .23.064.41a.9.9 0 0 0 .229.329q.165.152.428.293.263.134.656.275.591.223 1.072.463.48.235.82.55.346.312.528.727.187.41.187.973 0 .515-.17.932-.17.41-.486.709t-.762.48a3.7 3.7 0 0 1-.996.229v1.148h-.931V17.1a4 4 0 0 1-.967-.217 2.6 2.6 0 0 1-.832-.504 2.4 2.4 0 0 1-.574-.826q-.217-.505-.217-1.207h1.635q0 .421.123.709.123.281.316.45.2.165.451.235.252.07.516.07.627 0 .949-.292a.98.98 0 0 0 .322-.756m8.36 3.51h-5.343V17h5.344z\" class=\"jp-terminal-icon-color jp-icon-selectable-inverse\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/text-editor.svg
const text_editor_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z\" class=\"jp-text-editor-icon-color jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/toc.svg
const toc_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M7 5h14v2H7zm0 8v-2h14v2zM4 4.5A1.5 1.5 0 0 1 5.5 6 1.5 1.5 0 0 1 4 7.5 1.5 1.5 0 0 1 2.5 6 1.5 1.5 0 0 1 4 4.5m0 6A1.5 1.5 0 0 1 5.5 12 1.5 1.5 0 0 1 4 13.5 1.5 1.5 0 0 1 2.5 12 1.5 1.5 0 0 1 4 10.5M7 19v-2h14v2zm-3-2.5A1.5 1.5 0 0 1 5.5 18 1.5 1.5 0 0 1 4 19.5 1.5 1.5 0 0 1 2.5 18 1.5 1.5 0 0 1 4 16.5\" class=\"jp-icon3 jp-icon-selectable\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/tree-view.svg
const tree_view_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/statusbar/trusted.svg
const trusted_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" fill=\"none\" viewBox=\"0 0 24 25\">\n  <path stroke=\"#333\" stroke-width=\"2\" d=\"M3.86 14.44c-1.034-2.67-.996-5.382-.61-7.24 1.232-.267 2.83-.797 4.351-1.355a92 92 0 0 0 4.387-1.75 68 68 0 0 0 4.23 1.748c1.532.57 3.182 1.11 4.536 1.37.382 1.859.417 4.564-.615 7.228-1.109 2.862-3.472 5.743-8.139 7.494-4.667-1.75-7.03-4.632-8.14-7.494Z\" class=\"jp-icon2\"/>\n  <path fill=\"#333\" stroke=\"#333\" d=\"m10.86 14.733-2.133-1.866-.727.63L10.86 16 16 10.5l-.721-.632z\" class=\"jp-icon2\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/toolbar/undo.svg
const undo_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/user.svg
const user_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0m-4 7a7 7 0 0 0-7 7h14a7 7 0 0 0-7-7\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/sidebar/users.svg
const users_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" version=\"1.1\" viewBox=\"0 0 36 24\">\n  <g fill=\"#616161\" class=\"jp-icon3\" transform=\"translate(-3.628 .1)scale(1.7327)\">\n    <path d=\"M18.279 5.265c-1.58 0-2.964.85-3.718 2.115a6.7 6.7 0 0 1 2.81 2.21h5.23a4.32 4.32 0 0 0-4.322-4.325m2.186-2.875a2.19 2.19 0 0 1-2.188 2.188 2.19 2.19 0 0 1-2.189-2.189A2.19 2.19 0 0 1 18.277.201a2.19 2.19 0 0 1 2.188 2.188M5.385 6.633a3.02 3.02 0 0 0-3.02 3.02h4.22a6.7 6.7 0 0 1 1.44-1.467 3.02 3.02 0 0 0-2.64-1.553m1.53-2.01a1.53 1.53 0 0 1-1.529 1.53 1.53 1.53 0 0 1-1.53-1.53 1.53 1.53 0 0 1 1.53-1.53 1.53 1.53 0 0 1 1.53 1.53m-.781 8.912a5.865 5.865 0 0 1 11.73 0z\"/>\n    <circle cx=\"12\" cy=\"3.768\" r=\"2.969\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/variable.svg
const variable_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\">\n  <path fill=\"#007ACC\" fill-rule=\"evenodd\" d=\"m1.5 4-.5.5v8l.5.5H4v-1H2V5h2V4zm13 9 .5-.5v-8l-.5-.5H12v1h2v7h-2v1zM8.797 5l-4.5 2L4 7.457v2.5l.243.429 2.5 1.5.46.028 4.5-2L12 9.457v-2.5l-.243-.429-2.5-1.5zM5 8.34v1.334l1.5.9V9.24zm2.5.942v1.406L11 9.131V7.726zm2.918-2.391-1.452-.872-3.384 1.504 1.452.871z\" clip-rule=\"evenodd\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/vega.svg
const vega_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <g fill=\"#212121\" class=\"jp-icon1 jp-icon-selectable\">\n    <path d=\"m10.6 5.4 2.2-3.2H2.2v7.3l4-6.6z\"/>\n    <path d=\"m15.8 2.2-4.4 6.6L7 6.3l-4.8 8v5.5h17.6V2.2zm-7 15.4H5.5v-4.4h3.3zm4.4 0H9.8V9.8h3.4zm4.4 0h-3.4V6.5h3.4z\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/video.svg
const video_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 24 24\">\n    <path class=\"jp-icon3 jp-icon-selectable\" fill=\"#616161\" d=\"M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3h-2zM8 17H6v-2h2v2zm0-4H6v-2h2v2zm0-4H6V7h2v2zm10 8h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V7h2v2z\"/>\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/debugger/view-breakpoint.svg
const view_breakpoint_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n  <path fill=\"#616161\" d=\"M5 2h10l5 5v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6h1v2l4-3-4-3v2H3V4a2 2 0 0 1 2-2m7 16h4v-2h-4zm0-4h6v-2h-6zm0-4h6V8h-6zm-2 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2m-7-2v2H1v-2z\" class=\"jp-icon3\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/search/word.svg
const word_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 20 20\">\n  <path fill=\"#414141\" d=\"M2 2h16v16H2z\" class=\"jp-icon2\"/>\n  <path fill=\"#fff\" d=\"M4.57 8.8q.068-1.89 2.42-1.89 1.16 0 1.68.42.567.41.567 1.16v3.47q0 .462.514.462.103 0 .2-.023v.714q-.399.103-.651.103-.452 0-.693-.22-.231-.2-.284-.662-.956.872-2 .872-.903 0-1.47-.472-.525-.472-.525-1.26 0-.262.045-.472.057-.22.116-.378.068-.168.231-.304l.262-.242q.116-.091.368-.168.262-.091.4-.126.135-.045.471-.103t.504-.08l.567-.08q.556-.068.777-.22.22-.153.22-.442v-.252q0-.43-.357-.662-.336-.23-.976-.23-.662 0-.998.261-.336.252-.399.798zm1.89 3.68q.788 0 1.26-.41.504-.42.504-.903v-1.05q-.284.136-.861.231l-.987.158q-.42.068-.766.326-.336.252-.336.704t.304.704.861.252zm3.97-7.88h.945v3.15q.651-.976 1.89-.976 1.16 0 1.89.84.682.84.682 2.31t-.704 2.42q-.704.882-1.89.882-1.26 0-1.89-1.02v.766h-.85zm2.62 3.04q-.746 0-1.16.64-.452.63-.452 1.68t.452 1.68 1.16.63q.777 0 1.26-.63.494-.64.494-1.68 0-1.05-.472-1.68-.462-.64-1.26-.64zm-9.89 8.2 13.6.008c.007 0 0-2.6 0-2.6 0-.008-1.15 0-1.15 0-.007 0-.008 1.5-.008 1.5l-11.3-.001-.006-1.5c0-.008-1.17.001-1.17.001z\" class=\"jp-icon-accent2\"/>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/icons/filetype/yaml.svg
const yaml_namespaceObject = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" viewBox=\"0 0 22 22\">\n  <g fill=\"#D81B60\" class=\"jp-icon-contrast2 jp-icon-selectable\">\n    <path d=\"M7.2 18.6v-5.4L3 5.6h3.3l1.4 3.1c.3.9.6 1.6 1 2.5.3-.8.6-1.6 1-2.5l1.4-3.1h3.4l-4.4 7.6v5.5z\"/>\n    <circle cx=\"17.6\" cy=\"16.5\" r=\"2.1\"/>\n    <circle cx=\"17.6\" cy=\"11\" r=\"2.1\"/>\n  </g>\n</svg>\n";
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/icon/iconimports.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/* This file was auto-generated by ensureUiComponents() in @jupyterlab/buildutils */

// icon svg import statements



























































































































// LabIcon instance construction
const addAboveIcon = new LabIcon({ name: 'ui-components:add-above', svgstr: add_above_namespaceObject });
const addBelowIcon = new LabIcon({ name: 'ui-components:add-below', svgstr: add_below_namespaceObject });
const addIcon = new LabIcon({ name: 'ui-components:add', svgstr: add_namespaceObject });
const audioIcon = new LabIcon({ name: 'ui-components:audio', svgstr: audio_namespaceObject });
const bellIcon = new LabIcon({ name: 'ui-components:bell', svgstr: bell_namespaceObject });
const breakpointIcon = new LabIcon({ name: 'ui-components:breakpoint', svgstr: breakpoint_namespaceObject });
const bugDotIcon = new LabIcon({ name: 'ui-components:bug-dot', svgstr: bug_dot_namespaceObject });
const bugIcon = new LabIcon({ name: 'ui-components:bug', svgstr: bug_namespaceObject });
const buildIcon = new LabIcon({ name: 'ui-components:build', svgstr: build_namespaceObject });
const caretDownEmptyIcon = new LabIcon({ name: 'ui-components:caret-down-empty', svgstr: caret_down_empty_namespaceObject });
const caretDownEmptyThinIcon = new LabIcon({ name: 'ui-components:caret-down-empty-thin', svgstr: caret_down_empty_thin_namespaceObject });
const caretDownIcon = new LabIcon({ name: 'ui-components:caret-down', svgstr: caret_down_namespaceObject });
const caretLeftIcon = new LabIcon({ name: 'ui-components:caret-left', svgstr: caret_left_namespaceObject });
const caretRightIcon = new LabIcon({ name: 'ui-components:caret-right', svgstr: caret_right_namespaceObject });
const caretUpEmptyThinIcon = new LabIcon({ name: 'ui-components:caret-up-empty-thin', svgstr: caret_up_empty_thin_namespaceObject });
const caretUpIcon = new LabIcon({ name: 'ui-components:caret-up', svgstr: caret_up_namespaceObject });
const caseSensitiveIcon = new LabIcon({ name: 'ui-components:case-sensitive', svgstr: case_sensitive_namespaceObject });
const checkIcon = new LabIcon({ name: 'ui-components:check', svgstr: check_namespaceObject });
const circleEmptyIcon = new LabIcon({ name: 'ui-components:circle-empty', svgstr: circle_empty_namespaceObject });
const circleIcon = new LabIcon({ name: 'ui-components:circle', svgstr: circle_namespaceObject });
const cleaningIcon = new LabIcon({ name: 'ui-components:cleaning', svgstr: cleaning_namespaceObject });
const clearIcon = new LabIcon({ name: 'ui-components:clear', svgstr: clear_namespaceObject });
const closeAllIcon = new LabIcon({ name: 'ui-components:close-all', svgstr: close_all_namespaceObject });
const closeIcon = new LabIcon({ name: 'ui-components:close', svgstr: close_namespaceObject });
const codeCheckIcon = new LabIcon({ name: 'ui-components:code-check', svgstr: code_check_namespaceObject });
const codeIcon = new LabIcon({ name: 'ui-components:code', svgstr: code_namespaceObject });
const collapseAllIcon = new LabIcon({ name: 'ui-components:collapse-all', svgstr: collapse_all_namespaceObject });
const collapseIcon = new LabIcon({ name: 'ui-components:collapse', svgstr: collapse_namespaceObject });
const consoleIcon = new LabIcon({ name: 'ui-components:console', svgstr: console_namespaceObject });
const copyIcon = new LabIcon({ name: 'ui-components:copy', svgstr: copy_namespaceObject });
const copyrightIcon = new LabIcon({ name: 'ui-components:copyright', svgstr: copyright_namespaceObject });
const cutIcon = new LabIcon({ name: 'ui-components:cut', svgstr: cut_namespaceObject });
const deleteIcon = new LabIcon({ name: 'ui-components:delete', svgstr: delete_namespaceObject });
const dockBottomIcon = new LabIcon({ name: 'ui-components:dock-bottom', svgstr: dock_bottom_namespaceObject });
const dockLeftIcon = new LabIcon({ name: 'ui-components:dock-left', svgstr: dock_left_namespaceObject });
const dockRightIcon = new LabIcon({ name: 'ui-components:dock-right', svgstr: dock_right_namespaceObject });
const dockTopIcon = new LabIcon({ name: 'ui-components:dock-top', svgstr: dock_top_namespaceObject });
const dotsIcon = new LabIcon({ name: 'ui-components:dots', svgstr: dots_namespaceObject });
const downloadIcon = new LabIcon({ name: 'ui-components:download', svgstr: download_namespaceObject });
const duplicateIcon = new LabIcon({ name: 'ui-components:duplicate', svgstr: duplicate_namespaceObject });
const editIcon = new LabIcon({ name: 'ui-components:edit', svgstr: edit_namespaceObject });
const ellipsesIcon = new LabIcon({ name: 'ui-components:ellipses', svgstr: ellipses_namespaceObject });
const errorIcon = new LabIcon({ name: 'ui-components:error', svgstr: error_namespaceObject });
const exceptionsIcon = new LabIcon({ name: 'ui-components:exceptions', svgstr: exceptions_namespaceObject });
const expandAllIcon = new LabIcon({ name: 'ui-components:expand-all', svgstr: expand_all_namespaceObject });
const expandIcon = new LabIcon({ name: 'ui-components:expand', svgstr: expand_namespaceObject });
const extensionIcon = new LabIcon({ name: 'ui-components:extension', svgstr: extension_namespaceObject });
const fastForwardIcon = new LabIcon({ name: 'ui-components:fast-forward', svgstr: fast_forward_namespaceObject });
const fileIcon = new LabIcon({ name: 'ui-components:file', svgstr: file_namespaceObject });
const fileUploadIcon = new LabIcon({ name: 'ui-components:file-upload', svgstr: file_upload_namespaceObject });
const filterDotIcon = new LabIcon({ name: 'ui-components:filter-dot', svgstr: filter_dot_namespaceObject });
const filterIcon = new LabIcon({ name: 'ui-components:filter', svgstr: filter_namespaceObject });
const filterListIcon = new LabIcon({ name: 'ui-components:filter-list', svgstr: filter_list_namespaceObject });
const folderFavoriteIcon = new LabIcon({ name: 'ui-components:folder-favorite', svgstr: folder_favorite_namespaceObject });
const folderIcon = new LabIcon({ name: 'ui-components:folder', svgstr: folder_namespaceObject });
const historyIcon = new LabIcon({ name: 'ui-components:history', svgstr: history_namespaceObject });
const homeIcon = new LabIcon({ name: 'ui-components:home', svgstr: home_namespaceObject });
const html5Icon = new LabIcon({ name: 'ui-components:html5', svgstr: html5_namespaceObject });
const imageIcon = new LabIcon({ name: 'ui-components:image', svgstr: image_namespaceObject });
const infoIcon = new LabIcon({ name: 'ui-components:info', svgstr: info_namespaceObject });
const inspectorIcon = new LabIcon({ name: 'ui-components:inspector', svgstr: inspector_namespaceObject });
const jsonIcon = new LabIcon({ name: 'ui-components:json', svgstr: json_namespaceObject });
const juliaIcon = new LabIcon({ name: 'ui-components:julia', svgstr: julia_namespaceObject });
const jupyterFaviconIcon = new LabIcon({ name: 'ui-components:jupyter-favicon', svgstr: jupyter_favicon_namespaceObject });
const jupyterIcon = new LabIcon({ name: 'ui-components:jupyter', svgstr: jupyter_namespaceObject });
const jupyterlabWordmarkIcon = new LabIcon({ name: 'ui-components:jupyterlab-wordmark', svgstr: jupyterlab_wordmark_namespaceObject });
const kernelIcon = new LabIcon({ name: 'ui-components:kernel', svgstr: kernel_namespaceObject });
const keyboardIcon = new LabIcon({ name: 'ui-components:keyboard', svgstr: keyboard_namespaceObject });
const launchIcon = new LabIcon({ name: 'ui-components:launch', svgstr: launch_namespaceObject });
const launcherIcon = new LabIcon({ name: 'ui-components:launcher', svgstr: launcher_namespaceObject });
const lineFormIcon = new LabIcon({ name: 'ui-components:line-form', svgstr: line_form_namespaceObject });
const linkIcon = new LabIcon({ name: 'ui-components:link', svgstr: link_namespaceObject });
const listIcon = new LabIcon({ name: 'ui-components:list', svgstr: list_namespaceObject });
const lockIcon = new LabIcon({ name: 'ui-components:lock', svgstr: lock_namespaceObject });
const markdownIcon = new LabIcon({ name: 'ui-components:markdown', svgstr: markdown_namespaceObject });
const mermaidIcon = new LabIcon({ name: 'ui-components:mermaid', svgstr: mermaid_namespaceObject });
const moveDownIcon = new LabIcon({ name: 'ui-components:move-down', svgstr: move_down_namespaceObject });
const moveUpIcon = new LabIcon({ name: 'ui-components:move-up', svgstr: move_up_namespaceObject });
const newFolderIcon = new LabIcon({ name: 'ui-components:new-folder', svgstr: new_folder_namespaceObject });
const notTrustedIcon = new LabIcon({ name: 'ui-components:not-trusted', svgstr: not_trusted_namespaceObject });
const notebookIcon = new LabIcon({ name: 'ui-components:notebook', svgstr: notebook_namespaceObject });
const numberingIcon = new LabIcon({ name: 'ui-components:numbering', svgstr: numbering_namespaceObject });
const offlineBoltIcon = new LabIcon({ name: 'ui-components:offline-bolt', svgstr: offline_bolt_namespaceObject });
const openKernelSourceIcon = new LabIcon({ name: 'ui-components:open-kernel-source', svgstr: open_kernel_source_namespaceObject });
const paletteIcon = new LabIcon({ name: 'ui-components:palette', svgstr: palette_namespaceObject });
const pasteIcon = new LabIcon({ name: 'ui-components:paste', svgstr: paste_namespaceObject });
const pauseIcon = new LabIcon({ name: 'ui-components:pause', svgstr: pause_namespaceObject });
const pdfIcon = new LabIcon({ name: 'ui-components:pdf', svgstr: pdf_namespaceObject });
const pythonIcon = new LabIcon({ name: 'ui-components:python', svgstr: python_namespaceObject });
const rKernelIcon = new LabIcon({ name: 'ui-components:r-kernel', svgstr: r_kernel_namespaceObject });
const reactIcon = new LabIcon({ name: 'ui-components:react', svgstr: react_namespaceObject });
const redoIcon = new LabIcon({ name: 'ui-components:redo', svgstr: redo_namespaceObject });
const refreshIcon = new LabIcon({ name: 'ui-components:refresh', svgstr: refresh_namespaceObject });
const regexIcon = new LabIcon({ name: 'ui-components:regex', svgstr: regex_namespaceObject });
const runIcon = new LabIcon({ name: 'ui-components:run', svgstr: run_namespaceObject });
const runningIcon = new LabIcon({ name: 'ui-components:running', svgstr: running_namespaceObject });
const saveIcon = new LabIcon({ name: 'ui-components:save', svgstr: save_namespaceObject });
const searchIcon = new LabIcon({ name: 'ui-components:search', svgstr: search_namespaceObject });
const selectedBreakpointIcon = new LabIcon({ name: 'ui-components:selected-breakpoint', svgstr: selected_breakpoint_namespaceObject });
const settingsIcon = new LabIcon({ name: 'ui-components:settings', svgstr: settings_namespaceObject });
const shareIcon = new LabIcon({ name: 'ui-components:share', svgstr: share_namespaceObject });
const spreadsheetIcon = new LabIcon({ name: 'ui-components:spreadsheet', svgstr: spreadsheet_namespaceObject });
const stepIntoIcon = new LabIcon({ name: 'ui-components:step-into', svgstr: step_into_namespaceObject });
const stepOutIcon = new LabIcon({ name: 'ui-components:step-out', svgstr: step_out_namespaceObject });
const stepOverIcon = new LabIcon({ name: 'ui-components:step-over', svgstr: step_over_namespaceObject });
const stopIcon = new LabIcon({ name: 'ui-components:stop', svgstr: stop_namespaceObject });
const tabIcon = new LabIcon({ name: 'ui-components:tab', svgstr: tab_namespaceObject });
const tableRowsIcon = new LabIcon({ name: 'ui-components:table-rows', svgstr: table_rows_namespaceObject });
const tagIcon = new LabIcon({ name: 'ui-components:tag', svgstr: tag_namespaceObject });
const terminalIcon = new LabIcon({ name: 'ui-components:terminal', svgstr: terminal_namespaceObject });
const textEditorIcon = new LabIcon({ name: 'ui-components:text-editor', svgstr: text_editor_namespaceObject });
const tocIcon = new LabIcon({ name: 'ui-components:toc', svgstr: toc_namespaceObject });
const treeViewIcon = new LabIcon({ name: 'ui-components:tree-view', svgstr: tree_view_namespaceObject });
const trustedIcon = new LabIcon({ name: 'ui-components:trusted', svgstr: trusted_namespaceObject });
const undoIcon = new LabIcon({ name: 'ui-components:undo', svgstr: undo_namespaceObject });
const userIcon = new LabIcon({ name: 'ui-components:user', svgstr: user_namespaceObject });
const usersIcon = new LabIcon({ name: 'ui-components:users', svgstr: users_namespaceObject });
const variableIcon = new LabIcon({ name: 'ui-components:variable', svgstr: variable_namespaceObject });
const vegaIcon = new LabIcon({ name: 'ui-components:vega', svgstr: vega_namespaceObject });
const videoIcon = new LabIcon({ name: 'ui-components:video', svgstr: video_namespaceObject });
const viewBreakpointIcon = new LabIcon({ name: 'ui-components:view-breakpoint', svgstr: view_breakpoint_namespaceObject });
const wordIcon = new LabIcon({ name: 'ui-components:word', svgstr: word_namespaceObject });
const yamlIcon = new LabIcon({ name: 'ui-components:yaml', svgstr: yaml_namespaceObject });
//# sourceMappingURL=iconimports.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/collapser.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



const COLLAPSE_CLASS = 'jp-Collapse';
const CONTENTS_CLASS = 'jp-Collapse-contents';
const HEADER_CLASS = 'jp-Collapse-header';
const HEADER_COLLAPSED_CLASS = 'jp-Collapse-header-collapsed';
const ICON_CLASS = 'jp-Collapser-icon';
const TITLE_CLASS = 'jp-Collapser-title';
/**
 * A panel that supports a collapsible header made from the widget's title.
 * Clicking on the title expands or contracts the widget.
 */
class Collapser extends dist_index_es6_js_.Widget {
    constructor(options) {
        super(options);
        this._collapseChanged = new index_es6_js_.Signal(this);
        const { widget, collapsed = true } = options;
        this.addClass(COLLAPSE_CLASS);
        this._header = new dist_index_es6_js_.Widget();
        this._header.addClass(HEADER_CLASS);
        if (collapsed) {
            this._header.addClass(HEADER_COLLAPSED_CLASS);
        }
        this._header.node.appendChild(caretDownIcon.element({
            className: ICON_CLASS
        }));
        const titleSpan = document.createElement('span');
        titleSpan.classList.add(TITLE_CLASS);
        titleSpan.textContent = widget.title.label;
        this._header.node.appendChild(titleSpan);
        this._content = new dist_index_es6_js_.Panel();
        this._content.addClass(CONTENTS_CLASS);
        const layout = new dist_index_es6_js_.PanelLayout();
        this.layout = layout;
        layout.addWidget(this._header);
        layout.addWidget(this._content);
        this.widget = widget;
        this.collapsed = collapsed;
    }
    /**
     * The widget inside the collapse panel.
     */
    get widget() {
        return this._widget;
    }
    set widget(widget) {
        const oldWidget = this._widget;
        if (oldWidget) {
            oldWidget.title.changed.disconnect(this._onTitleChanged, this);
            oldWidget.parent = null;
        }
        this._widget = widget;
        widget.title.changed.connect(this._onTitleChanged, this);
        this._onTitleChanged(widget.title);
        this._content.addWidget(widget);
    }
    /**
     * The collapsed state of the panel.
     */
    get collapsed() {
        return this._collapsed;
    }
    set collapsed(value) {
        if (value === this._collapsed) {
            return;
        }
        if (value) {
            this._collapse();
        }
        else {
            this._uncollapse();
        }
    }
    /**
     * A signal for when the widget collapse state changes.
     */
    get collapseChanged() {
        return this._collapseChanged;
    }
    /**
     * Toggle the collapse state of the panel.
     */
    toggle() {
        this.collapsed = !this.collapsed;
    }
    /**
     * Dispose the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        // Delete references we explicitly hold to other widgets.
        this._header = null;
        this._widget = null;
        this._content = null;
        super.dispose();
    }
    /**
     * Handle the DOM events for the Collapser widget.
     *
     * @param event - The DOM event sent to the panel.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'click':
                this._evtClick(event);
                break;
            default:
                break;
        }
    }
    onAfterAttach(msg) {
        this._header.node.addEventListener('click', this);
    }
    onBeforeDetach(msg) {
        this._header.node.removeEventListener('click', this);
    }
    _collapse() {
        this._collapsed = true;
        if (this._content) {
            this._content.hide();
        }
        this._setHeader();
        this._collapseChanged.emit(void 0);
    }
    _uncollapse() {
        this._collapsed = false;
        if (this._content) {
            this._content.show();
        }
        this._setHeader();
        this._collapseChanged.emit(void 0);
    }
    _evtClick(event) {
        this.toggle();
    }
    /**
     * Handle the `changed` signal of a title object.
     */
    _onTitleChanged(sender) {
        this._setHeader();
    }
    _setHeader() {
        if (this._collapsed) {
            this._header.addClass(HEADER_COLLAPSED_CLASS);
        }
        else {
            this._header.removeClass(HEADER_COLLAPSED_CLASS);
        }
    }
}
//# sourceMappingURL=collapser.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyterlab/translation@~4.5.6 (singleton) (fallback: ../node_modules/@jupyterlab/translation/lib/index.js)
var translation_lib_index_js_ = __webpack_require__(17968);
// EXTERNAL MODULE: ../node_modules/@rjsf/core/lib/index.js + 55 modules
var core_lib = __webpack_require__(40018);
// EXTERNAL MODULE: consume shared module (default) @rjsf/utils@^5.13.4 (strict) (fallback: ../node_modules/@rjsf/utils/lib/index.js)
var utils_lib_index_js_ = __webpack_require__(24885);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/form.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */






/**
 * Default `ui:options` for the UiSchema.
 */
const DEFAULT_UI_OPTIONS = {
    /**
     * This prevents the submit button from being rendered, by default, as it is
     * almost never what is wanted.
     *
     * Provide any `uiSchema#/ui:options/submitButtonOptions` to override this.
     */
    submitButtonOptions: {
        norender: true
    }
};
/**
 * Button to move an item.
 *
 * @returns - the button as a react element.
 */
const MoveButton = (props) => {
    var _a;
    const trans = ((_a = props.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
    let buttonContent;
    /**
     * Whether the button is disabled or not.
     */
    const disabled = () => {
        if (props.direction === 'up') {
            return !props.item.hasMoveUp;
        }
        else {
            return !props.item.hasMoveDown;
        }
    };
    if (props.buttonStyle === 'icons') {
        const iconProps = {
            tag: 'span',
            elementSize: 'xlarge',
            elementPosition: 'center'
        };
        buttonContent =
            props.direction === 'up' ? (index_js_default().createElement(caretUpIcon.react, { ...iconProps })) : (index_js_default().createElement(caretDownIcon.react, { ...iconProps }));
    }
    else {
        buttonContent =
            props.direction === 'up' ? trans.__('Move up') : trans.__('Move down');
    }
    const moveTo = props.direction === 'up' ? props.item.index - 1 : props.item.index + 1;
    return (index_js_default().createElement("button", { className: "jp-mod-styled jp-mod-reject jp-ArrayOperationsButton", onClick: props.item.onReorderClick(props.item.index, moveTo), disabled: disabled() }, buttonContent));
};
/**
 * Button to drop an item.
 *
 * @returns - the button as a react element.
 */
const DropButton = (props) => {
    var _a;
    const trans = ((_a = props.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
    let buttonContent;
    if (props.buttonStyle === 'icons') {
        buttonContent = (index_js_default().createElement(closeIcon.react, { tag: "span", elementSize: "xlarge", elementPosition: "center" }));
    }
    else {
        buttonContent = trans.__('Remove');
    }
    return (index_js_default().createElement("button", { className: "jp-mod-styled jp-mod-warn jp-ArrayOperationsButton", onClick: props.item.onDropIndexClick(props.item.index) }, buttonContent));
};
/**
 * Button to add an item.
 *
 * @returns - the button as a react element.
 */
const AddButton = (props) => {
    var _a;
    const trans = ((_a = props.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
    let buttonContent;
    if (props.buttonStyle === 'icons') {
        buttonContent = (index_js_default().createElement(addIcon.react, { tag: "span", elementSize: "xlarge", elementPosition: "center" }));
    }
    else {
        buttonContent = trans.__('Add');
    }
    return (index_js_default().createElement("button", { className: "jp-mod-styled jp-mod-reject jp-ArrayOperationsButton", onClick: props.onAddClick }, buttonContent));
};
function customizeForLab(options) {
    const { component, name, buttonStyle, compact, showModifiedFromDefault, translator } = options;
    const isCompact = compact !== null && compact !== void 0 ? compact : false;
    const button = buttonStyle !== null && buttonStyle !== void 0 ? buttonStyle : (isCompact ? 'icons' : 'text');
    const factory = (props) => component({
        ...props,
        buttonStyle: button,
        compact: isCompact,
        showModifiedFromDefault: showModifiedFromDefault !== null && showModifiedFromDefault !== void 0 ? showModifiedFromDefault : true,
        translator: translator !== null && translator !== void 0 ? translator : translation_lib_index_js_.nullTranslator
    });
    if (name) {
        factory.displayName = name;
    }
    return factory;
}
/**
 * Fetch field templates from RJSF.
 */
function getTemplates(registry, uiSchema) {
    const TitleField = (0,utils_lib_index_js_.getTemplate)('TitleFieldTemplate', registry, uiSchema);
    const DescriptionField = (0,utils_lib_index_js_.getTemplate)('DescriptionFieldTemplate', registry, uiSchema);
    return { TitleField, DescriptionField };
}
/**
 * Template to allow for custom buttons to re-order/remove entries in an array.
 * Necessary to create accessible buttons.
 */
const CustomArrayTemplateFactory = (options) => customizeForLab({
    ...options,
    name: 'JupyterLabArrayTemplate',
    component: props => {
        var _a;
        const { schema, registry, uiSchema, required } = props;
        const commonProps = { schema, registry, uiSchema, required };
        const { TitleField, DescriptionField } = getTemplates(registry, uiSchema);
        return (index_js_default().createElement("div", { className: props.className },
            props.compact ? (index_js_default().createElement("div", { className: "jp-FormGroup-compactTitle" },
                index_js_default().createElement("div", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem", id: `${props.idSchema.$id}__title` }, props.title || ''),
                index_js_default().createElement("div", { className: "jp-FormGroup-description", id: `${props.idSchema.$id}-description` }, props.schema.description || ''))) : (index_js_default().createElement((index_js_default()).Fragment, null,
                props.title && (index_js_default().createElement(TitleField, { ...commonProps, title: props.title, id: `${props.idSchema.$id}-title` })),
                index_js_default().createElement(DescriptionField, { ...commonProps, id: `${props.idSchema.$id}-description`, description: (_a = props.schema.description) !== null && _a !== void 0 ? _a : '' }))),
            props.items.map(item => {
                return (index_js_default().createElement("div", { key: item.key, className: item.className },
                    item.children,
                    index_js_default().createElement("div", { className: "jp-ArrayOperations" },
                        index_js_default().createElement(MoveButton, { buttonStyle: props.buttonStyle, translator: props.translator, item: item, direction: "up" }),
                        index_js_default().createElement(MoveButton, { buttonStyle: props.buttonStyle, translator: props.translator, item: item, direction: "down" }),
                        index_js_default().createElement(DropButton, { buttonStyle: props.buttonStyle, translator: props.translator, item: item }))));
            }),
            props.canAdd && (index_js_default().createElement(AddButton, { onAddClick: props.onAddClick, buttonStyle: props.buttonStyle, translator: props.translator }))));
    }
});
/**
 * Template with custom add button, necessary for accessibility and internationalization.
 */
const CustomObjectTemplateFactory = (options) => customizeForLab({
    ...options,
    name: 'JupyterLabObjectTemplate',
    component: props => {
        var _a;
        const { schema, registry, uiSchema, required } = props;
        const commonProps = { schema, registry, uiSchema, required };
        const { TitleField, DescriptionField } = getTemplates(registry, uiSchema);
        return (index_js_default().createElement("fieldset", { id: props.idSchema.$id },
            props.compact ? (index_js_default().createElement("div", { className: "jp-FormGroup-compactTitle" },
                index_js_default().createElement("div", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem", id: `${props.idSchema.$id}__title` }, props.title || ''),
                index_js_default().createElement("div", { className: "jp-FormGroup-description", id: `${props.idSchema.$id}__description` }, props.schema.description || ''))) : (index_js_default().createElement((index_js_default()).Fragment, null,
                (props.title ||
                    (props.uiSchema || dist_index_js_.JSONExt.emptyObject)['ui:title']) && (index_js_default().createElement(TitleField, { ...commonProps, id: `${props.idSchema.$id}__title`, title: props.title ||
                        `${(props.uiSchema || dist_index_js_.JSONExt.emptyObject)['ui:title']}` ||
                        '' })),
                index_js_default().createElement(DescriptionField, { ...commonProps, id: `${props.idSchema.$id}__description`, description: (_a = props.schema.description) !== null && _a !== void 0 ? _a : '' }))),
            props.properties.map(property => property.content),
            (0,utils_lib_index_js_.canExpand)(props.schema, props.uiSchema, props.formData) && (index_js_default().createElement(AddButton, { onAddClick: props.onAddClick(props.schema), buttonStyle: props.buttonStyle, translator: props.translator }))));
    }
});
/**
 * Renders the modified indicator and errors
 */
const CustomTemplateFactory = (options) => customizeForLab({
    ...options,
    name: 'JupyterLabFieldTemplate',
    component: props => {
        var _a;
        const trans = ((_a = props.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        let isModified = false;
        let defaultValue;
        const { formData, schema, label, displayLabel, id, formContext, errors, rawErrors, children, onKeyChange, onDropPropertyClick } = props;
        const { defaultFormData } = formContext;
        const schemaIds = id.split('_');
        schemaIds.shift();
        const schemaId = schemaIds.join('.');
        const isRoot = schemaId === '';
        const hasCustomField = schemaId === (props.uiSchema || dist_index_js_.JSONExt.emptyObject)['ui:field'];
        if (props.showModifiedFromDefault) {
            /**
             * Determine if the field has been modified.
             * Schema Id is formatted as 'root_<field name>.<nested field name>'
             * This logic parses out the field name to find the default value
             * before determining if the field has been modified.
             */
            defaultValue = schemaIds.reduce((acc, key) => acc === null || acc === void 0 ? void 0 : acc[key], defaultFormData);
            isModified =
                !isRoot &&
                    formData !== undefined &&
                    defaultValue !== undefined &&
                    !schema.properties &&
                    schema.type !== 'array' &&
                    !dist_index_js_.JSONExt.deepEqual(formData, defaultValue);
        }
        const needsDescription = !isRoot &&
            schema.type != 'object' &&
            id !=
                'jp-SettingsEditor-@jupyterlab/shortcuts-extension:shortcuts_shortcuts';
        // While we can implement "remove" button for array items in array template,
        // object templates do not provide a way to do this instead we need to add
        // buttons here (and first check if the field can be removed = is additional).
        const isAdditional = schema.hasOwnProperty(utils_lib_index_js_.ADDITIONAL_PROPERTY_FLAG);
        const isItem = !(schema.type === 'object' || schema.type === 'array');
        return (index_js_default().createElement("div", { className: `form-group ${displayLabel || schema.type === 'boolean' ? 'small-field' : ''}` },
            !hasCustomField &&
                ((rawErrors === null || rawErrors === void 0 ? void 0 : rawErrors.length) ? (
                // Shows a red indicator for fields that have validation errors
                index_js_default().createElement("div", { className: "jp-modifiedIndicator jp-errorIndicator" })) : (
                // Only show the modified indicator if there are no errors
                isModified && index_js_default().createElement("div", { className: "jp-modifiedIndicator" }))),
            index_js_default().createElement("div", { className: `jp-FormGroup-content ${props.compact
                    ? 'jp-FormGroup-contentCompact'
                    : 'jp-FormGroup-contentNormal'}` },
                isItem && displayLabel && !isRoot && label && !isAdditional ? (props.compact ? (index_js_default().createElement("div", { className: "jp-FormGroup-compactTitle" },
                    index_js_default().createElement("div", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem" }, label),
                    isItem && schema.description && needsDescription && (index_js_default().createElement("div", { className: "jp-FormGroup-description" }, schema.description)))) : (index_js_default().createElement("h3", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem" }, label))) : (index_js_default().createElement((index_js_default()).Fragment, null)),
                isAdditional && (index_js_default().createElement("input", { className: "jp-FormGroup-contentItem jp-mod-styled", type: "text", onBlur: event => onKeyChange(event.target.value), defaultValue: label })),
                index_js_default().createElement("div", { className: `${isRoot
                        ? 'jp-root'
                        : schema.type === 'object'
                            ? 'jp-objectFieldWrapper'
                            : schema.type === 'array'
                                ? 'jp-arrayFieldWrapper'
                                : 'jp-inputFieldWrapper jp-FormGroup-contentItem'}` }, children),
                isAdditional && (index_js_default().createElement("button", { className: "jp-FormGroup-contentItem jp-mod-styled jp-mod-warn jp-FormGroup-removeButton", onClick: onDropPropertyClick(label) }, trans.__('Remove'))),
                !props.compact && schema.description && needsDescription && (index_js_default().createElement("div", { className: "jp-FormGroup-description" }, schema.description)),
                isModified &&
                    defaultValue !== undefined &&
                    schema.type !== 'object' && (index_js_default().createElement("div", { className: "jp-FormGroup-default" }, trans.__('Default: %1', defaultValue !== null
                    ? defaultValue.toLocaleString()
                    : 'null'))),
                index_js_default().createElement("div", { className: "validationErrors" }, errors))));
    }
});
/**
 * Generic rjsf form component for JupyterLab UI.
 */
function FormComponent(props) {
    const { buttonStyle, compact, showModifiedFromDefault, translator, formContext, ...others } = props;
    const uiSchema = { ...(others.uiSchema || dist_index_js_.JSONExt.emptyObject) };
    uiSchema['ui:options'] = { ...DEFAULT_UI_OPTIONS, ...uiSchema['ui:options'] };
    others.uiSchema = uiSchema;
    const { FieldTemplate, ArrayFieldTemplate, ObjectFieldTemplate } = props.templates || dist_index_js_.JSONExt.emptyObject;
    const customization = {
        buttonStyle,
        compact,
        showModifiedFromDefault,
        translator
    };
    const fieldTemplate = index_js_default().useMemo(() => FieldTemplate !== null && FieldTemplate !== void 0 ? FieldTemplate : CustomTemplateFactory(customization), [FieldTemplate, buttonStyle, compact, showModifiedFromDefault, translator]);
    const arrayTemplate = index_js_default().useMemo(() => ArrayFieldTemplate !== null && ArrayFieldTemplate !== void 0 ? ArrayFieldTemplate : CustomArrayTemplateFactory(customization), [
        ArrayFieldTemplate,
        buttonStyle,
        compact,
        showModifiedFromDefault,
        translator
    ]);
    const objectTemplate = index_js_default().useMemo(() => ObjectFieldTemplate !== null && ObjectFieldTemplate !== void 0 ? ObjectFieldTemplate : CustomObjectTemplateFactory(customization), [
        ObjectFieldTemplate,
        buttonStyle,
        compact,
        showModifiedFromDefault,
        translator
    ]);
    const templates = {
        FieldTemplate: fieldTemplate,
        ArrayFieldTemplate: arrayTemplate,
        ObjectFieldTemplate: objectTemplate
    };
    return (index_js_default().createElement(core_lib/* default */.ZP, { templates: templates, formContext: formContext, ...others }));
}
//# sourceMappingURL=form.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/interface.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
const DEFAULT_STYLE_CLASS = 'jp-DefaultStyle';
//# sourceMappingURL=interface.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/htmlselect.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




const HTML_SELECT_CLASS = 'jp-HTMLSelect';
class HTMLSelect extends index_js_.Component {
    render() {
        const { className, defaultStyle = true, disabled, elementRef, iconProps, icon = caretDownEmptyIcon, options = [], ...htmlProps } = this.props;
        const cls = classes(HTML_SELECT_CLASS, {
            [DEFAULT_STYLE_CLASS]: defaultStyle
        }, className);
        // If the HTMLSelect is integrated to a toolbar, we avoid propagating the focus
        // to the element with tabindex=0.
        const handleFocus = (event) => {
            event.stopPropagation();
        };
        const optionChildren = options.map(option => {
            const props = typeof option === 'object' ? option : { value: option };
            return (index_js_.createElement("option", { ...props, key: props.value }, props.label || props.value));
        });
        return (index_js_.createElement("div", { className: cls },
            index_js_.createElement("select", { onFocus: handleFocus, disabled: disabled, ref: elementRef, ...htmlProps, multiple: false },
                optionChildren,
                htmlProps.children),
            index_js_.createElement(icon.react, { tag: 'span',
                stylesheet: 'select',
                right: '4px',
                top: '8px',
                ...iconProps })));
    }
}
//# sourceMappingURL=htmlselect.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/iframe.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A Lumino widget which wraps an IFrame.
 */
class IFrame extends dist_index_es6_js_.Widget {
    /**
     * Create a new IFrame widget.
     */
    constructor(options = {}) {
        super({ node: iframe_Private.createNode() });
        this._sandbox = [];
        this.addClass('jp-IFrame');
        this.sandbox = options.sandbox || [];
        this.referrerPolicy = options.referrerPolicy || 'no-referrer';
        this.loading = options.loading || 'eager';
    }
    /**
     * Referrer policy for the iframe.
     *
     * #### Notes
     * By default, `no-referrer` is chosen.
     *
     * For more information, see
     * https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
     */
    get referrerPolicy() {
        return this._referrerPolicy;
    }
    set referrerPolicy(value) {
        if (this._referrerPolicy === value) {
            return;
        }
        this._referrerPolicy = value;
        const iframe = this.node.querySelector('iframe');
        iframe.setAttribute('referrerpolicy', value);
    }
    /**
     * Loading for the iFrame
     *
     * ### Notes
     * By default, 'eager' loading is chosen
     *
     * For more information, see
     * https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/loading
     */
    get loading() {
        return this._loading;
    }
    set loading(value) {
        if (this._loading === value) {
            return;
        }
        this._loading = value;
        const iframe = this.node.querySelector('iframe');
        iframe.setAttribute('loading', value);
    }
    /**
     * Exceptions to the sandboxing.
     *
     * #### Notes
     * By default, all sandboxing security policies are enabled.
     * This setting allows the user to selectively disable these
     * policies. This should be done with care, as it can
     * introduce security risks, and possibly allow malicious
     * sites to execute code in a JupyterLab session.
     *
     * For more information, see
     * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
     */
    get sandbox() {
        return this._sandbox.slice();
    }
    set sandbox(values) {
        this._sandbox = values.slice();
        const iframe = this.node.querySelector('iframe');
        const exceptions = values.length ? values.join(' ') : '';
        iframe.setAttribute('sandbox', exceptions);
    }
    /**
     * The url of the IFrame.
     */
    get url() {
        return this.node.querySelector('iframe').getAttribute('src') || '';
    }
    set url(url) {
        this.node.querySelector('iframe').setAttribute('src', url);
    }
}
/**
 * A namespace for private data.
 */
var iframe_Private;
(function (Private) {
    /**
     * Create the main content node of an iframe widget.
     */
    function createNode() {
        const node = document.createElement('div');
        const iframe = document.createElement('iframe');
        iframe.setAttribute('sandbox', '');
        iframe.style.height = '100%';
        iframe.style.width = '100%';
        node.appendChild(iframe);
        return node;
    }
    Private.createNode = createNode;
})(iframe_Private || (iframe_Private = {}));
//# sourceMappingURL=iframe.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/inputgroup.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */



/**
 * InputGroup component
 *
 * @param props Component properties
 * @returns Component
 */
function InputGroup(props) {
    const { className, inputRef, rightIcon, ...others } = props;
    return (index_js_default().createElement("div", { className: classes('jp-InputGroup', className) },
        index_js_default().createElement("input", { ref: inputRef, ...others }),
        rightIcon && (index_js_default().createElement("span", { className: "jp-InputGroupAction" }, typeof rightIcon === 'string' ? (index_js_default().createElement(LabIcon.resolveReact, { icon: rightIcon, elementPosition: "center", tag: "span" })) : (index_js_default().createElement(rightIcon.react, { elementPosition: "center", tag: "span" }))))));
}
//# sourceMappingURL=inputgroup.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var algorithm_dist_index_es6_js_ = __webpack_require__(78839);
// EXTERNAL MODULE: consume shared module (default) @lumino/disposable@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/disposable/dist/index.es6.js)
var disposable_dist_index_es6_js_ = __webpack_require__(61533);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/menu.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/* global WeakRef */




/**
 * Namespace for JupyterLabMenu interfaces
 */
var IRankedMenu;
(function (IRankedMenu) {
    /**
     * Default menu item rank
     */
    IRankedMenu.DEFAULT_RANK = 100;
})(IRankedMenu || (IRankedMenu = {}));
/**
 * An extensible menu for JupyterLab application menus.
 */
class RankedMenu extends dist_index_es6_js_.Menu {
    /**
     * Construct a new menu.
     *
     * @param options - Options for the lumino menu.
     */
    constructor(options) {
        var _a;
        super(options);
        this._ranks = [];
        this.addClass('jp-ThemedContainer');
        this._rank = options.rank;
        this._includeSeparators = (_a = options.includeSeparators) !== null && _a !== void 0 ? _a : true;
    }
    /**
     * Menu rank.
     */
    get rank() {
        return this._rank;
    }
    /**
     * Add a group of menu items specific to a particular
     * plugin.
     *
     * The rank can be set for all items in the group using the
     * function argument or per item.
     *
     * @param items - the list of menu items to add.
     * @param rank - the default rank in the menu in which to insert the group.
     * @returns Disposable of the group
     */
    addGroup(items, rank) {
        if (items.length === 0) {
            return new disposable_dist_index_es6_js_.DisposableDelegate(() => void 0);
        }
        const defaultRank = rank !== null && rank !== void 0 ? rank : IRankedMenu.DEFAULT_RANK;
        const sortedItems = items
            .map(item => {
            var _a;
            return { ...item, rank: (_a = item.rank) !== null && _a !== void 0 ? _a : defaultRank };
        })
            .sort((a, b) => a.rank - b.rank);
        // Insert the plugin group into the menu.
        let insertIndex = this._ranks.findIndex(rank => sortedItems[0].rank < rank);
        if (insertIndex < 0) {
            insertIndex = this._ranks.length; // Insert at the end of the menu
        }
        // Keep an array of the menu items that have been created.
        const added = [];
        // Insert a separator before the group.
        // Lumino takes care of superfluous leading,
        // trailing, and duplicate separators.
        if (this._includeSeparators) {
            added.push(this.insertItem(insertIndex++, { type: 'separator', rank: defaultRank }));
        }
        // Insert the group.
        added.push(...sortedItems.map(item => {
            return this.insertItem(insertIndex++, item);
        }));
        // Insert a separator after the group.
        if (this._includeSeparators) {
            added.push(this.insertItem(insertIndex++, { type: 'separator', rank: defaultRank }));
        }
        return new disposable_dist_index_es6_js_.DisposableDelegate(() => {
            added.forEach(i => i.dispose());
        });
    }
    /**
     * Add a menu item to the end of the menu.
     *
     * @param options - The options for creating the menu item.
     *
     * @returns The menu item added to the menu.
     */
    addItem(options) {
        let insertIndex = -1;
        if (options.rank) {
            insertIndex = this._ranks.findIndex(rank => options.rank < rank);
        }
        if (insertIndex < 0) {
            insertIndex = this._ranks.length; // Insert at the end of the menu
        }
        return this.insertItem(insertIndex, options);
    }
    /**
     * Remove all menu items from the menu.
     */
    clearItems() {
        this._ranks.length = 0;
        super.clearItems();
    }
    /**
     * Dispose of the resources held by the menu.
     */
    dispose() {
        this._ranks.length = 0;
        super.dispose();
    }
    /**
     * Get the rank of the item at index.
     *
     * @param index Item index.
     * @returns Rank of the item.
     */
    getRankAt(index) {
        return this._ranks[index];
    }
    /**
     * Insert a menu item into the menu at the specified index.
     *
     * @param index - The index at which to insert the item.
     *
     * @param options - The options for creating the menu item.
     *
     * @returns The menu item added to the menu.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     */
    insertItem(index, options) {
        var _a, _b;
        const clampedIndex = Math.max(0, Math.min(index, this._ranks.length));
        algorithm_dist_index_es6_js_.ArrayExt.insert(this._ranks, clampedIndex, (_a = options.rank) !== null && _a !== void 0 ? _a : Math.max(IRankedMenu.DEFAULT_RANK, (_b = this._ranks[this._ranks.length - 1]) !== null && _b !== void 0 ? _b : IRankedMenu.DEFAULT_RANK));
        const item = super.insertItem(clampedIndex, options);
        return new DisposableMenuItem(item, this);
    }
    /**
     * Remove the item at a given index from the menu.
     *
     * @param index - The index of the item to remove.
     *
     * #### Notes
     * This is a no-op if the index is out of range.
     */
    removeItemAt(index) {
        algorithm_dist_index_es6_js_.ArrayExt.removeAt(this._ranks, index);
        super.removeItemAt(index);
    }
}
/**
 * Disposable Menu Item
 */
class DisposableMenuItem {
    /**
     * Create a disposable menu item from an item and the menu it belongs to
     *
     * @param item Menu item
     * @param menu Menu
     */
    constructor(item, menu) {
        this._item = new WeakRef(item);
        this._menu = menu;
        // dispose this item if the parent menu is disposed
        const dispose = (menu) => {
            menu.disposed.disconnect(dispose, this);
            this.dispose();
        };
        this._menu.disposed.connect(dispose, this);
    }
    /**
     * Whether the menu item is disposed or not.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * The type of the menu item.
     */
    get type() {
        return this._item.deref().type;
    }
    /**
     * The command to execute when the item is triggered.
     */
    get command() {
        return this._item.deref().command;
    }
    /**
     * The arguments for the command.
     */
    get args() {
        return this._item.deref().args;
    }
    /**
     * The submenu for a `'submenu'` type item.
     */
    get submenu() {
        return this._item.deref().submenu;
    }
    /**
     * The display label for the menu item.
     */
    get label() {
        return this._item.deref().label;
    }
    /**
     * The mnemonic index for the menu item.
     */
    get mnemonic() {
        return this._item.deref().mnemonic;
    }
    /**
     * The icon renderer for the menu item.
     */
    get icon() {
        return this._item.deref().icon;
    }
    /**
     * The icon class for the menu item.
     */
    get iconClass() {
        return this._item.deref().iconClass;
    }
    /**
     * The icon label for the menu item.
     */
    get iconLabel() {
        return this._item.deref().iconLabel;
    }
    /**
     * The display caption for the menu item.
     */
    get caption() {
        return this._item.deref().caption;
    }
    /**
     * The extra class name for the menu item.
     */
    get className() {
        return this._item.deref().className;
    }
    /**
     * The dataset for the menu item.
     */
    get dataset() {
        return this._item.deref().dataset;
    }
    /**
     * Whether the menu item is enabled.
     */
    get isEnabled() {
        return this._item.deref().isEnabled;
    }
    /**
     * Whether the menu item is toggled.
     */
    get isToggled() {
        return this._item.deref().isToggled;
    }
    /**
     * Whether the menu item is visible.
     */
    get isVisible() {
        return this._item.deref().isVisible;
    }
    /**
     * The key binding for the menu item.
     */
    get keyBinding() {
        return this._item.deref().keyBinding;
    }
    /**
     * Dispose the menu item by removing it from its menu.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        const item = this._item.deref();
        if (item && !this._menu.isDisposed) {
            this._menu.removeItem(item);
        }
        index_es6_js_.Signal.clearData(this);
    }
}
//# sourceMappingURL=menu.js.map
// EXTERNAL MODULE: consume shared module (default) @jupyter/react-components@~0.16.7 (singleton) (fallback: ../node_modules/@jupyter/react-components/lib/index.js)
var react_components_lib_index_js_ = __webpack_require__(75816);
// EXTERNAL MODULE: consume shared module (default) @jupyter/web-components@~0.16.7 (singleton) (fallback: ../node_modules/@jupyter/web-components/dist/esm/index.js)
var esm_index_js_ = __webpack_require__(83074);
// EXTERNAL MODULE: consume shared module (default) @lumino/commands@~2.3.3 (singleton) (fallback: ../node_modules/@lumino/commands/dist/index.es6.js)
var commands_dist_index_es6_js_ = __webpack_require__(88532);
// EXTERNAL MODULE: consume shared module (default) @lumino/messaging@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/messaging/dist/index.es6.js)
var messaging_dist_index_es6_js_ = __webpack_require__(87297);
// EXTERNAL MODULE: consume shared module (default) @lumino/properties@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/properties/dist/index.es6.js)
var properties_dist_index_es6_js_ = __webpack_require__(10249);
// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var polling_dist_index_es6_js_ = __webpack_require__(75205);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/vdom.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * An abstract class for a Lumino widget which renders a React component.
 */
class ReactWidget extends dist_index_es6_js_.Widget {
    constructor() {
        super();
        this._rootDOM = null;
    }
    /**
     * Creates a new `ReactWidget` that renders a constant element.
     * @param element React element to render.
     */
    static create(element) {
        return new (class extends ReactWidget {
            render() {
                return element;
            }
        })();
    }
    /**
     * Called to update the state of the widget.
     *
     * The default implementation of this method triggers
     * VDOM based rendering by calling the `renderDOM` method.
     */
    onUpdateRequest(msg) {
        this.renderPromise = this.renderDOM();
    }
    /**
     * Called after the widget is attached to the DOM
     */
    onAfterAttach(msg) {
        // Make *sure* the widget is rendered.
        messaging_dist_index_es6_js_.MessageLoop.sendMessage(this, dist_index_es6_js_.Widget.Msg.UpdateRequest);
    }
    /**
     * Called before the widget is detached from the DOM.
     */
    onBeforeDetach(msg) {
        // Unmount the component so it can tear down.
        if (this._rootDOM !== null) {
            this._rootDOM.unmount();
            this._rootDOM = null;
        }
    }
    /**
     * Render the React nodes to the DOM.
     *
     * @returns a promise that resolves when the rendering is done.
     */
    renderDOM() {
        return new Promise(resolve => {
            const vnode = this.render();
            if (this._rootDOM === null) {
                this._rootDOM = (0,client/* createRoot */.s)(this.node);
            }
            // Split up the array/element cases so type inference chooses the right
            // signature.
            if (Array.isArray(vnode)) {
                this._rootDOM.render(vnode);
                // Resolves after the widget has been rendered.
                // https://github.com/reactwg/react-18/discussions/5#discussioncomment-798304
                requestIdleCallback(() => resolve());
            }
            else if (vnode) {
                this._rootDOM.render(vnode);
                // Resolves after the widget has been rendered.
                // https://github.com/reactwg/react-18/discussions/5#discussioncomment-798304
                requestIdleCallback(() => resolve());
            }
            else {
                // If the virtual node is null, unmount the node content
                this._rootDOM.unmount();
                this._rootDOM = null;
                requestIdleCallback(() => resolve());
            }
        });
    }
}
/**
 * An abstract ReactWidget with a model.
 */
class VDomRenderer extends ReactWidget {
    /**
     * Create a new VDomRenderer
     */
    constructor(model) {
        super();
        this._modelChanged = new index_es6_js_.Signal(this);
        this.model = (model !== null && model !== void 0 ? model : null);
    }
    /**
     * A signal emitted when the model changes.
     */
    get modelChanged() {
        return this._modelChanged;
    }
    /**
     * Set the model and fire changed signals.
     */
    set model(newValue) {
        if (this._model === newValue) {
            return;
        }
        if (this._model) {
            this._model.stateChanged.disconnect(this.update, this);
        }
        this._model = newValue;
        if (newValue) {
            newValue.stateChanged.connect(this.update, this);
        }
        this.update();
        this._modelChanged.emit(void 0);
    }
    /**
     * Get the current model.
     */
    get model() {
        return this._model;
    }
    /**
     * Dispose this widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._model = null;
        super.dispose();
    }
}
/**
 * UseSignal provides a way to hook up a Lumino signal to a React element,
 * so that the element is re-rendered every time the signal fires.
 *
 * It is implemented through the "render props" technique, using the `children`
 * prop as a function to render, so that it can be used either as a prop or as a child
 * of this element
 * https://reactjs.org/docs/render-props.html
 *
 *
 * Example as child:
 *
 * ```
 * function LiveButton(isActiveSignal: ISignal<any, boolean>) {
 *  return (
 *    <UseSignal signal={isActiveSignal} initialArgs={true}>
 *     {(_, isActive) => <Button isActive={isActive}>}
 *    </UseSignal>
 *  )
 * }
 * ```
 *
 * Example as prop:
 *
 * ```
 * function LiveButton(isActiveSignal: ISignal<any, boolean>) {
 *  return (
 *    <UseSignal
 *      signal={isActiveSignal}
 *      initialArgs={true}
 *      children={(_, isActive) => <Button isActive={isActive}>}
 *    />
 *  )
 * }
 * ```
 */
class UseSignal extends index_js_.Component {
    constructor(props) {
        super(props);
        this.slot = (sender, args) => {
            // skip setting new state if we have a shouldUpdate function and it returns false
            if (this.props.shouldUpdate && !this.props.shouldUpdate(sender, args)) {
                return;
            }
            this.setState({ value: [sender, args] });
        };
        this.state = { value: [this.props.initialSender, this.props.initialArgs] };
    }
    componentDidMount() {
        this.props.signal.connect(this.slot);
    }
    componentWillUnmount() {
        this.props.signal.disconnect(this.slot);
    }
    render() {
        return this.props.children(...this.state.value);
    }
}
/**
 * Concrete implementation of VDomRenderer model.
 */
class VDomModel {
    constructor() {
        /**
         * A signal emitted when any model state changes.
         */
        this.stateChanged = new index_es6_js_.Signal(this);
        this._isDisposed = false;
    }
    /**
     * Test whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        index_es6_js_.Signal.clearData(this);
    }
}
//# sourceMappingURL=vdom.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/toolbar.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.













(0,esm_index_js_.provideJupyterDesignSystem)().register([(0,esm_index_js_.jpButton)(), (0,esm_index_js_.jpToolbar)()]);
(0,esm_index_js_.addJupyterLabThemeChangeListener)();
/**
 * The class name added to toolbars.
 */
const TOOLBAR_CLASS = 'jp-Toolbar';
/**
 * The class name added to toolbar items.
 */
const TOOLBAR_ITEM_CLASS = 'jp-Toolbar-item';
/**
 * Toolbar pop-up opener button name
 */
const TOOLBAR_OPENER_NAME = 'toolbar-popup-opener';
/**
 * The class name added to toolbar spacer.
 */
const TOOLBAR_SPACER_CLASS = 'jp-Toolbar-spacer';
/**
 * A layout for toolbars.
 *
 * #### Notes
 * This layout automatically collapses its height if there are no visible
 * toolbar widgets, and expands to the standard toolbar height if there are
 * visible toolbar widgets.
 */
class ToolbarLayout extends dist_index_es6_js_.PanelLayout {
    constructor() {
        super(...arguments);
        this._dirty = false;
    }
    /**
     * A message handler invoked on a `'fit-request'` message.
     *
     * If any child widget is visible, expand the toolbar height to the normal
     * toolbar height.
     */
    onFitRequest(msg) {
        super.onFitRequest(msg);
        if (this.parent.isAttached) {
            // If there are any widgets not explicitly hidden, expand the toolbar to
            // accommodate them.
            if ((0,algorithm_dist_index_es6_js_.some)(this.widgets, w => !w.isHidden)) {
                this.parent.node.style.minHeight = 'var(--jp-private-toolbar-height)';
                this.parent.removeClass('jp-Toolbar-micro');
            }
            else {
                this.parent.node.style.minHeight = '';
                this.parent.addClass('jp-Toolbar-micro');
            }
        }
        // Set the dirty flag to ensure only a single update occurs.
        this._dirty = true;
        // Notify the ancestor that it should fit immediately. This may
        // cause a resize of the parent, fulfilling the required update.
        if (this.parent.parent) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(this.parent.parent, dist_index_es6_js_.Widget.Msg.FitRequest);
        }
        // If the dirty flag is still set, the parent was not resized.
        // Trigger the required update on the parent widget immediately.
        if (this._dirty) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(this.parent, dist_index_es6_js_.Widget.Msg.UpdateRequest);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        super.onUpdateRequest(msg);
        if (this.parent.isVisible) {
            this._dirty = false;
        }
    }
    /**
     * A message handler invoked on a `'child-shown'` message.
     */
    onChildShown(msg) {
        super.onChildShown(msg);
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-hidden'` message.
     */
    onChildHidden(msg) {
        super.onChildHidden(msg);
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        super.onBeforeAttach(msg);
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    attachWidget(index, widget) {
        super.attachWidget(index, widget);
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    detachWidget(index, widget) {
        super.detachWidget(index, widget);
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
}
/**
 * A class which provides a toolbar widget.
 */
class Toolbar extends dist_index_es6_js_.Widget {
    /**
     * Construct a new toolbar widget.
     */
    constructor(options = {}) {
        var _a, _b;
        super({ node: document.createElement('jp-toolbar') });
        this.addClass(TOOLBAR_CLASS);
        this.layout = (_a = options.layout) !== null && _a !== void 0 ? _a : new ToolbarLayout();
        this.noFocusOnClick = (_b = options.noFocusOnClick) !== null && _b !== void 0 ? _b : false;
    }
    /**
     * Get an iterator over the ordered toolbar item names.
     *
     * @returns An iterator over the toolbar item names.
     */
    names() {
        const layout = this.layout;
        return (0,algorithm_dist_index_es6_js_.map)(layout.widgets, widget => {
            return toolbar_Private.nameProperty.get(widget);
        });
    }
    /**
     * Add an item to the end of the toolbar.
     *
     * @param name - The name of the widget to add to the toolbar.
     *
     * @param widget - The widget to add to the toolbar.
     *
     * @returns Whether the item was added to toolbar. Returns false if
     *   an item of the same name is already in the toolbar.
     *
     * #### Notes
     * The item can be removed from the toolbar by setting its parent to `null`.
     */
    addItem(name, widget) {
        const layout = this.layout;
        return this.insertItem(layout.widgets.length, name, widget);
    }
    /**
     * Insert an item into the toolbar at the specified index.
     *
     * @param index - The index at which to insert the item.
     *
     * @param name - The name of the item.
     *
     * @param widget - The widget to add.
     *
     * @returns Whether the item was added to the toolbar. Returns false if
     *   an item of the same name is already in the toolbar.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     * The item can be removed from the toolbar by setting its parent to `null`.
     */
    insertItem(index, name, widget) {
        const existing = (0,algorithm_dist_index_es6_js_.find)(this.names(), value => value === name);
        if (existing) {
            return false;
        }
        widget.addClass(TOOLBAR_ITEM_CLASS);
        const layout = this.layout;
        const j = Math.max(0, Math.min(index, layout.widgets.length));
        layout.insertWidget(j, widget);
        toolbar_Private.nameProperty.set(widget, name);
        widget.node.dataset['jpItemName'] = name;
        if (this.noFocusOnClick) {
            widget.node.dataset['noFocusOnClick'] = 'true';
        }
        return true;
    }
    /**
     * Insert an item into the toolbar at the after a target item.
     *
     * @param at - The target item to insert after.
     *
     * @param name - The name of the item.
     *
     * @param widget - The widget to add.
     *
     * @returns Whether the item was added to the toolbar. Returns false if
     *   an item of the same name is already in the toolbar.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     * The item can be removed from the toolbar by setting its parent to `null`.
     */
    insertAfter(at, name, widget) {
        return this.insertRelative(at, 1, name, widget);
    }
    /**
     * Insert an item into the toolbar at the before a target item.
     *
     * @param at - The target item to insert before.
     *
     * @param name - The name of the item.
     *
     * @param widget - The widget to add.
     *
     * @returns Whether the item was added to the toolbar. Returns false if
     *   an item of the same name is already in the toolbar.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     * The item can be removed from the toolbar by setting its parent to `null`.
     */
    insertBefore(at, name, widget) {
        return this.insertRelative(at, 0, name, widget);
    }
    /**
     * Insert an item relatively to an other item.
     */
    insertRelative(at, offset, name, widget) {
        const nameWithIndex = (0,algorithm_dist_index_es6_js_.map)(this.names(), (name, i) => {
            return { name: name, index: i };
        });
        const target = (0,algorithm_dist_index_es6_js_.find)(nameWithIndex, x => x.name === at);
        if (target) {
            return this.insertItem(target.index + offset, name, widget);
        }
        return false;
    }
    /**
     * Handle the DOM events for the widget.
     *
     * @param event - The DOM event sent to the widget.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the dock panel's node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'click':
                this.handleClick(event);
                break;
            default:
                break;
        }
    }
    /**
     * Handle a DOM click event.
     */
    handleClick(event) {
        // Stop propagating the click outside the toolbar
        event.stopPropagation();
        // Clicking a label focuses the corresponding control
        // that is linked with `for` attribute, so let it be.
        if (event.target instanceof HTMLLabelElement) {
            const forId = event.target.getAttribute('for');
            if (forId && this.node.querySelector(`#${forId}`)) {
                return;
            }
        }
        // If this click already focused a control, let it be.
        if (this.node.contains(document.activeElement)) {
            return;
        }
        // Otherwise, activate the parent widget, which may take focus if desired.
        if (this.parent) {
            this.parent.activate();
        }
    }
    /**
     * Handle `after-attach` messages for the widget.
     */
    onAfterAttach(msg) {
        this.node.addEventListener('click', this);
    }
    /**
     * Handle `before-detach` messages for the widget.
     */
    onBeforeDetach(msg) {
        this.node.removeEventListener('click', this);
    }
}
/**
 * A class which provides a toolbar widget.
 */
class ReactiveToolbar extends Toolbar {
    /**
     * Construct a new toolbar widget.
     */
    constructor(options = {}) {
        super(options);
        this.popupOpener = new ToolbarPopupOpener();
        this._widgetWidths = new Map();
        this._widgetPositions = new Map();
        this._zoomChanged = true;
        this.insertItem(0, TOOLBAR_OPENER_NAME, this.popupOpener);
        this.popupOpener.hide();
        this._resizer = new polling_dist_index_es6_js_.Throttler(async (callTwice = false) => {
            await this._onResize(callTwice);
        }, 500);
    }
    /**
     * Dispose of the widget and its descendant widgets.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        if (this._resizer) {
            this._resizer.dispose();
        }
        super.dispose();
    }
    /**
     * Insert an item into the toolbar at the after a target item.
     *
     * @param at - The target item to insert after.
     *
     * @param name - The name of the item.
     *
     * @param widget - The widget to add.
     *
     * @returns Whether the item was added to the toolbar. Returns false if
     *   an item of the same name is already in the toolbar or if the target
     *   is the toolbar pop-up opener.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     * The item can be removed from the toolbar by setting its parent to `null`.
     */
    insertAfter(at, name, widget) {
        if (at === TOOLBAR_OPENER_NAME) {
            return false;
        }
        return super.insertAfter(at, name, widget);
    }
    /**
     * Insert an item relatively to an other item.
     */
    insertRelative(at, offset, name, widget) {
        const targetPosition = this._widgetPositions.get(at);
        const position = (targetPosition !== null && targetPosition !== void 0 ? targetPosition : 0) + offset;
        return this.insertItem(position, name, widget);
    }
    /**
     * Insert an item into the toolbar at the specified index.
     *
     * @param index - The index at which to insert the item.
     *
     * @param name - The name of the item.
     *
     * @param widget - The widget to add.
     *
     * @returns Whether the item was added to the toolbar. Returns false if
     *   an item of the same name is already in the toolbar.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     * The item can be removed from the toolbar by setting its parent to `null`.
     */
    insertItem(index, name, widget) {
        var _a;
        let status;
        if (widget instanceof ToolbarPopupOpener) {
            status = super.insertItem(index, name, widget);
        }
        else {
            // Insert the widget in the toolbar at expected index if possible, otherwise
            // before the popup opener. This position may change when invoking the resizer
            // at the end of this function.
            const j = Math.max(0, Math.min(index, this.layout.widgets.length - 1));
            status = super.insertItem(j, name, widget);
            if (j !== index) {
                // This happens if the widget has been inserted at a wrong position:
                // - not enough widgets in the toolbar to insert it at the expected index
                // - the widget at the expected index should be in the popup
                // In the first situation, the stored index should be changed to match a
                // realistic index.
                index = Math.max(0, Math.min(index, this._widgetPositions.size));
            }
        }
        // Save the widgets position when a widget is inserted or moved.
        if (name !== TOOLBAR_OPENER_NAME &&
            this._widgetPositions.get(name) !== index) {
            // If the widget is inserted, set its current position as last.
            const currentPosition = (_a = this._widgetPositions.get(name)) !== null && _a !== void 0 ? _a : this._widgetPositions.size;
            // Change the position of moved widgets.
            this._widgetPositions.forEach((value, key) => {
                if (key !== TOOLBAR_OPENER_NAME) {
                    if (value >= index && value < currentPosition) {
                        this._widgetPositions.set(key, value + 1);
                    }
                    else if (value <= index && value > currentPosition) {
                        this._widgetPositions.set(key, value - 1);
                    }
                }
            });
            // Save the new position of the widget.
            this._widgetPositions.set(name, index);
            // Invokes resizing to ensure correct display of items after an addition, only
            // if the toolbar is rendered.
            if (this.isVisible) {
                void this._resizer.invoke();
            }
        }
        return status;
    }
    /**
     * A message handler invoked on an `'after-show'` message.
     *
     * Invokes resizing to ensure correct display of items.
     */
    onAfterShow(msg) {
        void this._resizer.invoke(true);
    }
    /**
     * A message handler invoked on a `'before-hide'` message.
     *
     * It will hide the pop-up panel
     */
    onBeforeHide(msg) {
        this.popupOpener.hidePopup();
        super.onBeforeHide(msg);
    }
    onResize(msg) {
        super.onResize(msg);
        // Check if the resize event is due to a zoom change.
        const zoom = Math.round((window.outerWidth / window.innerWidth) * 100);
        if (zoom !== this._zoom) {
            this._zoomChanged = true;
            this._zoom = zoom;
        }
        if (msg.width > 0 && this._resizer) {
            void this._resizer.invoke();
        }
    }
    /**
     * Move the toolbar items between the reactive toolbar and the popup toolbar,
     * depending on the width of the toolbar and the width of each item.
     *
     * @param callTwice - whether to call the function twice.
     *
     * **NOTES**
     * The `callTwice` parameter is useful when the toolbar is displayed the first time,
     * because the size of the items is unknown before their first rendering. The first
     * call will usually add all the items in the main toolbar, and the second call will
     * reorganize the items between the main toolbar and the popup toolbar.
     */
    async _onResize(callTwice = false) {
        if (!(this.parent && this.parent.isAttached)) {
            return;
        }
        const toolbarWidth = this.node.clientWidth;
        const opener = this.popupOpener;
        const openerWidth = 32;
        // left and right padding.
        const toolbarPadding = 2 + 5;
        let width = opener.isHidden ? toolbarPadding : toolbarPadding + openerWidth;
        return this._getWidgetsToRemove(width, toolbarWidth, openerWidth)
            .then(async (values) => {
            var _a, _b;
            let { width, widgetsToRemove } = values;
            while (widgetsToRemove.length > 0) {
                // Insert the widget at the right position in the opener popup, relatively
                // to the saved position of the first item of the popup toolbar.
                // Get the saved position of the widget to insert.
                const widget = widgetsToRemove.pop();
                const name = toolbar_Private.nameProperty.get(widget);
                width -= this._widgetWidths.get(name) || 0;
                const position = (_a = this._widgetPositions.get(name)) !== null && _a !== void 0 ? _a : 0;
                // Get the saved position of the first item in the popup toolbar.
                // If there is no widget, set the value at last item.
                let openerFirstIndex = this._widgetPositions.size;
                const openerFirst = opener.widgetAt(0);
                if (openerFirst) {
                    const openerFirstName = toolbar_Private.nameProperty.get(openerFirst);
                    openerFirstIndex =
                        (_b = this._widgetPositions.get(openerFirstName)) !== null && _b !== void 0 ? _b : openerFirstIndex;
                }
                // Insert the widget in the popup toolbar.
                const index = position - openerFirstIndex;
                opener.insertWidget(index, widget);
            }
            if (opener.widgetCount() > 0) {
                const widgetsToAdd = [];
                let index = 0;
                const widgetCount = opener.widgetCount();
                while (index < widgetCount) {
                    let widget = opener.widgetAt(index);
                    if (widget) {
                        width += this._getWidgetWidth(widget);
                        if (widgetCount - widgetsToAdd.length === 1) {
                            width -= openerWidth;
                        }
                    }
                    else {
                        break;
                    }
                    if (width < toolbarWidth) {
                        widgetsToAdd.push(widget);
                    }
                    else {
                        break;
                    }
                    index++;
                }
                while (widgetsToAdd.length > 0) {
                    // Insert the widget in the right position in the toolbar.
                    const widget = widgetsToAdd.shift();
                    const name = toolbar_Private.nameProperty.get(widget);
                    if (this._widgetPositions.has(name)) {
                        this.insertItem(this._widgetPositions.get(name), name, widget);
                    }
                    else {
                        this.addItem(name, widget);
                    }
                }
            }
            if (opener.widgetCount() > 0) {
                opener.updatePopup();
                opener.show();
            }
            else {
                opener.hide();
            }
            if (callTwice) {
                await this._onResize();
            }
        })
            .catch(msg => {
            console.error('Error while computing the ReactiveToolbar', msg);
        });
    }
    async _getWidgetsToRemove(width, toolbarWidth, openerWidth) {
        var _a;
        const opener = this.popupOpener;
        const widgets = [...this.layout.widgets];
        const toIndex = widgets.length - 1;
        const widgetsToRemove = [];
        let index = 0;
        while (index < toIndex) {
            const widget = widgets[index];
            const name = toolbar_Private.nameProperty.get(widget);
            // Compute the widget size only if
            // - the zoom has changed.
            // - the widget size has not been computed yet.
            let widgetWidth;
            if (this._zoomChanged) {
                widgetWidth = await this._saveWidgetWidth(name, widget);
            }
            else {
                // The widget widths can be 0px if it has been added to the toolbar but
                // not rendered, this is why we must use '||' instead of '??'.
                widgetWidth =
                    this._getWidgetWidth(widget) ||
                        (await this._saveWidgetWidth(name, widget));
            }
            width += widgetWidth;
            if (widgetsToRemove.length === 0 &&
                opener.isHidden &&
                width + openerWidth > toolbarWidth) {
                width += openerWidth;
            }
            // Remove the widget if it is out of the toolbar or incorrectly positioned.
            // Incorrect positioning can occur when the widget is added after the toolbar
            // has been rendered and should be in the popup. E.g. debugger icon with a
            // narrow notebook toolbar.
            if (width > toolbarWidth ||
                ((_a = this._widgetPositions.get(name)) !== null && _a !== void 0 ? _a : 0) > index) {
                widgetsToRemove.push(widget);
            }
            index++;
        }
        this._zoomChanged = false;
        return {
            width: width,
            widgetsToRemove: widgetsToRemove
        };
    }
    async _saveWidgetWidth(name, widget) {
        if (widget instanceof ReactWidget) {
            await widget.renderPromise;
        }
        const widgetWidth = widget.hasClass(TOOLBAR_SPACER_CLASS)
            ? 2
            : widget.node.clientWidth;
        this._widgetWidths.set(name, widgetWidth);
        return widgetWidth;
    }
    _getWidgetWidth(widget) {
        const widgetName = toolbar_Private.nameProperty.get(widget);
        return this._widgetWidths.get(widgetName) || 0;
    }
}
/**
 * The namespace for Toolbar class statics.
 */
(function (Toolbar) {
    /**
     * Create a toolbar spacer item.
     *
     * #### Notes
     * It is a flex spacer that separates the left toolbar items
     * from the right toolbar items.
     */
    function createSpacerItem() {
        return new toolbar_Private.Spacer();
    }
    Toolbar.createSpacerItem = createSpacerItem;
})(Toolbar || (Toolbar = {}));
/**
 * React component for a toolbar button.
 *
 * @param props - The props for ToolbarButtonComponent.
 */
function ToolbarButtonComponent(props) {
    var _a, _b, _c;
    // In some browsers, a button click event moves the focus from the main
    // content to the button (see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus).
    const handleClick = ((_a = props.noFocusOnClick) !== null && _a !== void 0 ? _a : false)
        ? undefined
        : (event) => {
            var _a;
            if (event.button === 0) {
                (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
                // In safari, the focus do not move to the button on click (see
                // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus).
                event.target.focus();
            }
        };
    // To avoid focusing the button, we avoid a click event by calling preventDefault in
    // mousedown, and we bind the button action to `mousedown`.
    // Currently this is mostly useful for the notebook panel, to retrieve the focused
    // cell before the click event.
    const handleMouseDown = ((_b = props.noFocusOnClick) !== null && _b !== void 0 ? _b : false)
        ? (event) => {
            var _a;
            // Fire action only when left button is pressed.
            if (event.button === 0) {
                event.preventDefault();
                (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
            }
        }
        : undefined;
    const handleKeyDown = (event) => {
        var _a;
        const { key } = event;
        if (key === 'Enter' || key === ' ') {
            (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
        }
    };
    const getTooltip = () => {
        if (props.enabled === false && props.disabledTooltip) {
            return props.disabledTooltip;
        }
        else if (props.pressed && props.pressedTooltip) {
            return props.pressedTooltip;
        }
        else {
            return props.tooltip || props.iconLabel;
        }
    };
    const title = getTooltip();
    const disabled = props.enabled === false;
    return (index_js_.createElement(react_components_lib_index_js_.Button, { appearance: "stealth", className: props.className
            ? props.className + ' jp-ToolbarButtonComponent'
            : 'jp-ToolbarButtonComponent', "aria-disabled": disabled, "aria-label": props.label || title, "aria-pressed": props.pressed, "aria-haspopup": props['aria-haspopup'], "aria-expanded": props['aria-expanded'], "aria-controls": props['aria-controls'], ...toolbar_Private.normalizeDataset(props.dataset), disabled: disabled, onClick: handleClick, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, title: title },
        (props.icon || props.iconClass) && (index_js_.createElement(LabIcon.resolveReact, { icon: props.pressed ? (_c = props.pressedIcon) !== null && _c !== void 0 ? _c : props.icon : props.icon, iconClass: 
            // add some extra classes for proper support of icons-as-css-background
            classes(props.iconClass, 'jp-Icon'), tag: null })),
        props.label && (index_js_.createElement("span", { className: "jp-ToolbarButtonComponent-label" }, props.label))));
}
/**
 * Adds the toolbar button class to the toolbar widget.
 * @param w Toolbar button widget.
 */
function addToolbarButtonClass(w) {
    w.addClass('jp-ToolbarButton');
    return w;
}
/**
 * Lumino Widget version of static ToolbarButtonComponent.
 */
class ToolbarButton extends ReactWidget {
    /**
     * Creates a toolbar button
     * @param props props for underlying `ToolbarButton` component
     */
    constructor(props = {}) {
        var _a, _b;
        super();
        this.props = props;
        addToolbarButtonClass(this);
        this._enabled = (_a = props.enabled) !== null && _a !== void 0 ? _a : true;
        this._pressed = this._enabled && ((_b = props.pressed) !== null && _b !== void 0 ? _b : false);
        this._onClick = props.onClick;
    }
    /**
     * Sets the pressed state for the button
     * @param value true if button is pressed, false otherwise
     */
    set pressed(value) {
        if (this.enabled && value !== this._pressed) {
            this._pressed = value;
            this.update();
        }
    }
    /**
     * Returns true if button is pressed, false otherwise
     */
    get pressed() {
        return this._pressed;
    }
    /**
     * Sets the enabled state for the button
     * @param value true to enable the button, false otherwise
     */
    set enabled(value) {
        if (value != this._enabled) {
            this._enabled = value;
            if (!this._enabled) {
                this._pressed = false;
            }
            this.update();
        }
    }
    /**
     * Returns true if button is enabled, false otherwise
     */
    get enabled() {
        return this._enabled;
    }
    /**
     * Sets the click handler for the button
     * @param value click handler
     */
    set onClick(value) {
        if (value !== this._onClick) {
            this._onClick = value;
            this.update();
        }
    }
    /**
     * Returns the click handler for the button
     */
    get onClick() {
        return this._onClick;
    }
    render() {
        return (index_js_.createElement(ToolbarButtonComponent, { ...this.props, noFocusOnClick: this.props.noFocusOnClick, pressed: this.pressed, enabled: this.enabled, onClick: this.onClick }));
    }
}
/**
 * React component for a toolbar button that wraps a command.
 *
 * This wraps the ToolbarButtonComponent and watches the command registry
 * for changes to the command.
 */
function CommandToolbarButtonComponent(props) {
    return (index_js_.createElement(UseSignal, { signal: props.commands.commandChanged, shouldUpdate: (sender, args) => (args.id === props.id && args.type === 'changed') ||
            args.type === 'many-changed' }, () => props.commands.listCommands().includes(props.id) ? (index_js_.createElement(ToolbarButtonComponent, { ...toolbar_Private.propsFromCommand(props) })) : null));
}
/*
 * Adds the command toolbar button class to the command toolbar widget.
 * @param w Command toolbar button widget.
 */
function addCommandToolbarButtonClass(w) {
    w.addClass('jp-CommandToolbarButton');
    return w;
}
/**
 * Lumino widget version of CommandToolbarButtonComponent.
 */
class CommandToolbarButton extends ReactWidget {
    /**
     * Creates a command toolbar button
     * @param props props for underlying `CommandToolbarButtonComponent` component
     */
    constructor(props) {
        super();
        this.props = props;
        const { commands, id, args } = props;
        addCommandToolbarButtonClass(this);
        this.setCommandAttributes(commands, id, args);
        commands.commandChanged.connect((_, change) => {
            if (change.id === props.id) {
                this.setCommandAttributes(commands, id, args);
            }
        }, this);
    }
    setCommandAttributes(commands, id, args) {
        if (commands.isToggled(id, args)) {
            this.addClass('lm-mod-toggled');
        }
        else {
            this.removeClass('lm-mod-toggled');
        }
        if (commands.isVisible(id, args)) {
            this.removeClass('lm-mod-hidden');
        }
        else {
            this.addClass('lm-mod-hidden');
        }
        if (commands.isEnabled(id, args)) {
            if ('disabled' in this.node) {
                this.node.disabled = false;
            }
        }
        else {
            if ('disabled' in this.node) {
                this.node.disabled = true;
            }
        }
    }
    render() {
        return index_js_.createElement(CommandToolbarButtonComponent, { ...this.props });
    }
    /**
     * Identifier of the underlying command.
     */
    get commandId() {
        return this.props.id;
    }
}
/**
 *  A class which provides a toolbar popup
 *  used to store widgets that don't fit
 *  in the toolbar when it is resized
 */
class ToolbarPopup extends dist_index_es6_js_.Widget {
    /**
     *  Construct a new ToolbarPopup
     */
    constructor() {
        super({ node: document.createElement('jp-toolbar') });
        this.width = 0;
        this.node.setAttribute('aria-label', 'Responsive popup toolbar');
        this.addClass('jp-Toolbar');
        this.addClass('jp-Toolbar-responsive-popup');
        this.addClass('jp-ThemedContainer');
        this.layout = new dist_index_es6_js_.PanelLayout();
        dist_index_es6_js_.Widget.attach(this, document.body);
        this.hide();
    }
    /**
     * Updates the width of the popup, this
     * should match with the toolbar width
     *
     * @param width - The width to resize to
     * @protected
     */
    updateWidth(width) {
        if (width > 0) {
            this.width = width;
            this.node.style.width = `${width}px`;
        }
    }
    /**
     * Aligns the popup to left bottom of widget
     *
     * @param widget the widget to align to
     * @private
     */
    alignTo(widget) {
        const { height: widgetHeight, width: widgetWidth, x: widgetX, y: widgetY } = widget.node.getBoundingClientRect();
        const width = this.width;
        this.node.style.left = `${widgetX + widgetWidth - width + 1}px`;
        this.node.style.top = `${widgetY + widgetHeight + 1}px`;
    }
    /**
     * Inserts the widget at specified index
     * @param index the index
     * @param widget widget to add
     */
    insertWidget(index, widget) {
        this.layout.insertWidget(index, widget);
    }
    /**
     *  Total number of widgets in the popup
     */
    widgetCount() {
        return this.layout.widgets.length;
    }
    /**
     * Returns the widget at index
     * @param index the index
     */
    widgetAt(index) {
        return this.layout.widgets[index];
    }
}
/**
 *  A class that provides a ToolbarPopupOpener,
 *  which is a button added to toolbar when
 *  the toolbar items overflow toolbar width
 */
class ToolbarPopupOpener extends ToolbarButton {
    /**
     *  Create a new popup opener
     */
    constructor(props = {}) {
        const trans = (props.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab');
        super({
            icon: ellipsesIcon,
            onClick: () => {
                this.handleClick();
            },
            tooltip: trans.__('More commands')
        });
        this.addClass('jp-Toolbar-responsive-opener');
        this.popup = new ToolbarPopup();
    }
    /**
     * Add widget to the popup, prepends widgets
     * @param widget the widget to add
     */
    addWidget(widget) {
        this.popup.insertWidget(0, widget);
    }
    /**
     * Insert widget to the popup.
     * @param widget the widget to add
     */
    insertWidget(index, widget) {
        this.popup.insertWidget(index, widget);
    }
    /**
     * Dispose of the widget and its descendant widgets.
     *
     * #### Notes
     * It is unsafe to use the widget after it has been disposed.
     *
     * All calls made to this method after the first are a no-op.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.popup.dispose();
        super.dispose();
    }
    /**
     * Hides the opener and the popup
     */
    hide() {
        super.hide();
        this.hidePopup();
    }
    /**
     * Hides the popup
     */
    hidePopup() {
        this.popup.hide();
    }
    /**
     *  Updates width and position of the popup
     *  to align with the toolbar
     */
    updatePopup() {
        this.popup.updateWidth(this.parent.node.clientWidth);
        this.popup.alignTo(this.parent);
    }
    /**
     * Returns widget at index in the popup
     * @param index
     */
    widgetAt(index) {
        return this.popup.widgetAt(index);
    }
    /**
     * Returns total number of widgets in the popup
     *
     * @returns Number of widgets
     */
    widgetCount() {
        return this.popup.widgetCount();
    }
    handleClick() {
        this.updatePopup();
        this.popup.setHidden(!this.popup.isHidden);
    }
}
/**
 * A namespace for private data.
 */
var toolbar_Private;
(function (Private) {
    /**
     * Ensures all dataset keys have the 'data-' prefix.
     * @param dataset object
     */
    function normalizeDataset(dataset) {
        if (!dataset) {
            return undefined;
        }
        const normalized = {};
        for (const [key, value] of Object.entries(dataset)) {
            const normalizedKey = key.startsWith('data-') ? key : `data-${key}`;
            normalized[normalizedKey] = value;
        }
        return normalized;
    }
    Private.normalizeDataset = normalizeDataset;
    function propsFromCommand(options) {
        var _a, _b;
        const { commands, id, args } = options;
        const iconClass = commands.iconClass(id, args);
        const iconLabel = commands.iconLabel(id, args);
        const icon = (_a = options.icon) !== null && _a !== void 0 ? _a : commands.icon(id, args);
        const label = commands.label(id, args);
        let className = commands.className(id, args);
        // Add the boolean state classes and aria attributes.
        let pressed;
        if (commands.isToggleable(id, args)) {
            pressed = commands.isToggled(id, args);
            if (pressed) {
                className += ' lm-mod-toggled';
            }
        }
        if (!commands.isVisible(id, args)) {
            className += ' lm-mod-hidden';
        }
        const labelOverride = typeof options.label === 'function'
            ? options.label(args !== null && args !== void 0 ? args : {})
            : options.label;
        let tooltip = commands.caption(id, args) || labelOverride || label || iconLabel;
        // Shows hot keys in tooltips
        const binding = commands.keyBindings.find(b => b.command === id);
        if (binding) {
            const ks = binding.keys.map(commands_dist_index_es6_js_.CommandRegistry.formatKeystroke).join(', ');
            tooltip = `${tooltip} (${ks})`;
        }
        const onClick = () => {
            void commands.execute(id, args);
        };
        const enabled = commands.isEnabled(id, args);
        const ariaProps = options;
        const { 'aria-haspopup': ariaHaspopup, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls } = ariaProps;
        return {
            className,
            dataset: { 'data-command': options.id },
            noFocusOnClick: options.noFocusOnClick,
            icon,
            iconClass,
            tooltip: (_b = options.caption) !== null && _b !== void 0 ? _b : tooltip,
            onClick,
            enabled,
            label: labelOverride !== null && labelOverride !== void 0 ? labelOverride : label,
            pressed,
            'aria-haspopup': ariaHaspopup,
            'aria-expanded': ariaExpanded,
            'aria-controls': ariaControls
        };
    }
    Private.propsFromCommand = propsFromCommand;
    /**
     * An attached property for the name of a toolbar item.
     */
    Private.nameProperty = new properties_dist_index_es6_js_.AttachedProperty({
        name: 'name',
        create: () => ''
    });
    /**
     * A spacer widget.
     */
    class Spacer extends dist_index_es6_js_.Widget {
        /**
         * Construct a new spacer widget.
         */
        constructor() {
            super();
            this.addClass(TOOLBAR_SPACER_CLASS);
        }
    }
    Private.Spacer = Spacer;
})(toolbar_Private || (toolbar_Private = {}));
//# sourceMappingURL=toolbar.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/panelwithtoolbar.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


/**
 * A base class for panel widget with toolbar.
 */
class PanelWithToolbar extends dist_index_es6_js_.Panel {
    constructor(options = {}) {
        super(options);
        this._toolbar = new Toolbar();
    }
    /**
     * Widget toolbar
     */
    get toolbar() {
        return this._toolbar;
    }
}
//# sourceMappingURL=panelwithtoolbar.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/search.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





/**
 * Perform a fuzzy search on a single item.
 */
function fuzzySearch(source, query) {
    // Set up the match score and indices array.
    let score = Infinity;
    let indices = null;
    // Look for letters (including in Asian scripts), numbers, and diacritical marks.
    const rgx = /[\p{L}\p{N}\p{M}]+/gu;
    let continueSearch = true;
    // Search the source by word boundary.
    while (continueSearch) {
        // Find the next word boundary in the source.
        let rgxMatch = rgx.exec(source);
        // Break if there is no more source context.
        if (!rgxMatch) {
            break;
        }
        // Run the string match on the relevant substring.
        let match = algorithm_dist_index_es6_js_.StringExt.matchSumOfDeltas(source, query, rgxMatch.index);
        // Break if there is no match.
        if (!match) {
            break;
        }
        // Update the match if the score is better.
        if (match && match.score <= score) {
            score = match.score;
            indices = match.indices;
        }
    }
    // Bail if there was no match.
    if (!indices || score === Infinity) {
        return null;
    }
    // Handle a split match.
    return {
        score,
        indices
    };
}
const updateFilterFunction = (value, useFuzzyFilter, caseSensitive) => {
    return (item) => {
        if (useFuzzyFilter) {
            // Run the fuzzy search for the item and query.
            const query = value.toLowerCase();
            // Ignore the item if it is not a match.
            return fuzzySearch(item, query);
        }
        if (!caseSensitive) {
            item = item.toLocaleLowerCase();
            value = value.toLocaleLowerCase();
        }
        const i = item.indexOf(value);
        if (i === -1) {
            return null;
        }
        return {
            indices: [...Array(value.length).keys()].map(x => x + i)
        };
    };
};
const FilterBox = (props) => {
    var _a, _b, _c;
    const [filter, setFilter] = (0,index_js_.useState)((_a = props.initialQuery) !== null && _a !== void 0 ? _a : '');
    if (props.forceRefresh) {
        (0,index_js_.useEffect)(() => {
            props.updateFilter((item) => {
                return {};
            });
        }, []);
    }
    const firstRender = (0,index_js_.useRef)(true);
    const inputRef = (_b = props.inputRef) !== null && _b !== void 0 ? _b : (0,index_js_.useRef)();
    (0,index_js_.useEffect)(() => {
        // If there is an initial search value, pass the parent the initial filter function for that value.
        if (firstRender.current) {
            firstRender.current = false;
            if (props.initialQuery !== undefined) {
                props.updateFilter(updateFilterFunction(props.initialQuery, props.useFuzzyFilter, props.caseSensitive), props.initialQuery);
            }
        }
        else {
            if (inputRef.current) {
                // If filter settings changed, update the filter
                props.updateFilter(updateFilterFunction(inputRef.current.value, props.useFuzzyFilter, props.caseSensitive), inputRef.current.value);
            }
        }
    }, [props.updateFilter, props.useFuzzyFilter, props.caseSensitive]);
    /**
     * Handler for search input changes.
     */
    const handleChange = (0,index_js_.useCallback)((e) => {
        const target = e.target;
        setFilter(target.value);
        props.updateFilter(updateFilterFunction(target.value, props.useFuzzyFilter, props.caseSensitive), target.value);
    }, [props.updateFilter, props.useFuzzyFilter, props.caseSensitive]);
    // Show the icon by default, or if the caller specifically requests it
    const showSearchIcon = (_c = props.showIcon) !== null && _c !== void 0 ? _c : true;
    // Cast typing is required because HTMLInputElement and JupyterSearch element types don't exactly match
    return (index_js_default().createElement(react_components_lib_index_js_.Search, { role: "search", className: "jp-FilterBox", ref: props.inputRef, value: filter, onChange: handleChange, onInput: handleChange, placeholder: props.placeholder, disabled: props.disabled }, showSearchIcon && index_js_default().createElement(searchIcon.react, { slot: "end", tag: null })));
};
/**
 * A widget which hosts a input textbox to filter on file names.
 */
class FilenameSearcherWidget extends ReactWidget {
    constructor(props) {
        var _a;
        super();
        this._filterBoxProps = { ...props };
        (_a = props === null || props === void 0 ? void 0 : props.filterSettingsChanged) === null || _a === void 0 ? void 0 : _a.connect((_, args) => {
            this._updateProps(args);
        }, this);
    }
    render() {
        return index_js_default().createElement(FilterBox, { ...this._filterBoxProps });
    }
    /**
     * Update a specific prop.
     */
    _updateProps(props) {
        Object.assign(this._filterBoxProps, props);
        this.update();
    }
}
/**
 * Function which returns a widget that hosts an input textbox to filter on file names.
 */
const FilenameSearcher = (props) => {
    return new FilenameSearcherWidget(props);
};
//# sourceMappingURL=search.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/accordiontoolbar.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



/**
 * Accordion panel layout that adds a toolbar in widget title if present.
 */
class AccordionToolbarLayout extends dist_index_es6_js_.AccordionLayout {
    constructor() {
        super(...arguments);
        this._toolbars = new WeakMap();
    }
    /**
     * Insert a widget into the layout at the specified index.
     *
     * @param index - The index at which to insert the widget.
     *
     * @param widget - The widget to insert into the layout.
     *
     * #### Notes
     * The index will be clamped to the bounds of the widgets.
     *
     * If the widget is already added to the layout, it will be moved.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     */
    insertWidget(index, widget) {
        if (widget.toolbar) {
            this._toolbars.set(widget, widget.toolbar);
            widget.toolbar.addClass('jp-AccordionPanel-toolbar');
        }
        super.insertWidget(index, widget);
    }
    /**
     * Remove the widget at a given index from the layout.
     *
     * @param index - The index of the widget to remove.
     *
     * #### Notes
     * A widget is automatically removed from the layout when its `parent`
     * is set to `null`. This method should only be invoked directly when
     * removing a widget from a layout which has yet to be installed on a
     * parent widget.
     *
     * This method does *not* modify the widget's `parent`.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     */
    removeWidgetAt(index) {
        const widget = this.widgets[index];
        super.removeWidgetAt(index);
        // Remove the toolbar after the widget has `removeWidgetAt` will call `detachWidget`
        if (widget && this._toolbars.has(widget)) {
            this._toolbars.delete(widget);
        }
    }
    /**
     * Called when a title attribute has changed, to attach again the toolbar node.
     */
    updateTitle(index, widget) {
        super.updateTitle(index, widget);
        this._addToolbar(index, widget);
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     */
    attachWidget(index, widget) {
        super.attachWidget(index, widget);
        this._addToolbar(index, widget);
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     */
    detachWidget(index, widget) {
        const toolbar = this._toolbars.get(widget);
        if (toolbar) {
            // Send a `'before-detach'` message if the parent is attached.
            if (this.parent.isAttached) {
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(toolbar, dist_index_es6_js_.Widget.Msg.BeforeDetach);
            }
            // Remove the toolbar in the title node.
            this.titles[index].removeChild(toolbar.node);
            // Send an `'after-detach'` message if the parent is attached.
            if (this.parent.isAttached) {
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(toolbar, dist_index_es6_js_.Widget.Msg.AfterDetach);
            }
        }
        super.detachWidget(index, widget);
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onBeforeAttach(msg) {
        this.notifyToolbars(msg);
        super.onBeforeAttach(msg);
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        this.notifyToolbars(msg);
    }
    /**
     * A message handler invoked on a `'before-detach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onBeforeDetach(msg) {
        this.notifyToolbars(msg);
        super.onBeforeDetach(msg);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onAfterDetach(msg) {
        super.onAfterDetach(msg);
        this.notifyToolbars(msg);
    }
    /**
     * Add the toolbar to the title widget.
     */
    _addToolbar(index, widget) {
        const toolbar = this._toolbars.get(widget);
        if (toolbar) {
            // Send a `'before-attach'` message if the parent is attached.
            if (this.parent.isAttached) {
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(toolbar, dist_index_es6_js_.Widget.Msg.BeforeAttach);
            }
            // Insert the toolbar in the title node.
            this.titles[index].appendChild(toolbar.node);
            // Send an `'after-attach'` message if the parent is attached.
            if (this.parent.isAttached) {
                messaging_dist_index_es6_js_.MessageLoop.sendMessage(toolbar, dist_index_es6_js_.Widget.Msg.AfterAttach);
            }
        }
    }
    notifyToolbars(msg) {
        this.widgets.forEach(widget => {
            const toolbar = this._toolbars.get(widget);
            if (toolbar) {
                toolbar.processMessage(msg);
            }
        });
    }
}
var AccordionToolbar;
(function (AccordionToolbar) {
    /**
     * Custom renderer for the SidePanel
     */
    class Renderer extends dist_index_es6_js_.AccordionPanel.Renderer {
        /**
         * Render the collapse indicator for a section title.
         *
         * @param data - The data to use for rendering the section title.
         *
         * @returns A element representing the collapse indicator.
         */
        createCollapseIcon(data) {
            const iconDiv = document.createElement('div');
            caretDownIcon.element({
                container: iconDiv
            });
            return iconDiv;
        }
        /**
         * Render the element for a section title.
         *
         * @param data - The data to use for rendering the section title.
         *
         * @returns A element representing the section title.
         */
        createSectionTitle(data) {
            const handle = super.createSectionTitle(data);
            handle.classList.add('jp-AccordionPanel-title');
            return handle;
        }
    }
    AccordionToolbar.Renderer = Renderer;
    AccordionToolbar.defaultRenderer = new Renderer();
    /**
     * Create an accordion layout for accordion panel with toolbar in the title.
     *
     * @param options Panel options
     * @returns Panel layout
     *
     * #### Note
     *
     * Default titleSpace is 32 px (default var(--jp-private-toolbar-height) - but not styled)
     */
    function createLayout(options) {
        var _a;
        return (options.layout ||
            new AccordionToolbarLayout({
                renderer: options.renderer || AccordionToolbar.defaultRenderer,
                orientation: options.orientation,
                alignment: options.alignment,
                spacing: options.spacing,
                titleSpace: (_a = options.titleSpace) !== null && _a !== void 0 ? _a : 32
            }));
    }
    AccordionToolbar.createLayout = createLayout;
})(AccordionToolbar || (AccordionToolbar = {}));
//# sourceMappingURL=accordiontoolbar.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/sidepanel.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.




/**
 * A widget meant to be contained in sidebars.
 *
 * #### Note
 * By default the content widget is an accordion panel that supports widget with
 * associated toolbar to be displayed in the widget title.
 */
class SidePanel extends dist_index_es6_js_.Widget {
    constructor(options = {}) {
        var _a;
        super();
        const layout = (this.layout = new dist_index_es6_js_.PanelLayout());
        this.addClass('jp-SidePanel');
        const trans = (this._trans = (options.translator || translation_lib_index_js_.nullTranslator).load('jupyterlab'));
        if (options.header) {
            this.addHeader(options.header);
        }
        const content = (this._content =
            (_a = options.content) !== null && _a !== void 0 ? _a : new dist_index_es6_js_.AccordionPanel({
                ...options,
                layout: AccordionToolbar.createLayout(options)
            }));
        content.node.setAttribute('role', 'region');
        content.node.setAttribute('aria-label', trans.__('side panel content'));
        content.addClass('jp-SidePanel-content');
        layout.addWidget(content);
        if (options.toolbar) {
            this.addToolbar(options.toolbar);
        }
    }
    /**
     * The content hosted by the widget.
     */
    get content() {
        return this._content;
    }
    /**
     * A panel for widgets that sit on top of the widget.
     */
    get header() {
        if (!this._header) {
            this.addHeader();
        }
        return this._header;
    }
    /**
     * The toolbar hosted by the widget.
     *
     * It sits between the header and the content
     */
    get toolbar() {
        if (!this._toolbar) {
            this.addToolbar();
        }
        return this._toolbar;
    }
    /**
     * A read-only array of the widgets in the content panel.
     */
    get widgets() {
        return this.content.widgets;
    }
    /**
     * Add a widget to the content panel bottom.
     *
     * @param widget Widget to add
     */
    addWidget(widget) {
        this.content.addWidget(widget);
    }
    /**
     * Insert a widget at the given position in the content panel.
     *
     * @param index Position
     * @param widget Widget to insert
     */
    insertWidget(index, widget) {
        this.content.insertWidget(index, widget);
    }
    addHeader(header) {
        const theHeader = (this._header = header || new dist_index_es6_js_.Panel());
        theHeader.addClass('jp-SidePanel-header');
        this.layout.insertWidget(0, theHeader);
    }
    addToolbar(toolbar) {
        const theToolbar = (this._toolbar = toolbar !== null && toolbar !== void 0 ? toolbar : new Toolbar());
        theToolbar.addClass('jp-SidePanel-toolbar');
        this.layout.insertWidget(this.layout.widgets.length - 1, theToolbar);
    }
}
//# sourceMappingURL=sidepanel.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/spinner.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/**
 * The spinner class.
 */
class Spinner extends dist_index_es6_js_.Widget {
    /**
     * Construct a spinner widget.
     */
    constructor() {
        super();
        this.addClass('jp-Spinner');
        this.node.tabIndex = -1;
        const content = document.createElement('div');
        content.className = 'jp-SpinnerContent';
        this.node.appendChild(content);
    }
    /**
     * Handle `'activate-request'` messages.
     */
    onActivateRequest(msg) {
        this.node.focus();
    }
}
//# sourceMappingURL=spinner.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/styling.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * A namespace for node styling.
 */
var Styling;
(function (Styling) {
    /**
     * Style a node and its child elements with the default tag names.
     *
     * @param node - The base node.
     *
     * @param className - The optional CSS class to add to styled nodes.
     */
    function styleNode(node, className = '') {
        styleNodeByTag(node, 'select', className);
        styleNodeByTag(node, 'textarea', className);
        styleNodeByTag(node, 'input', className);
        styleNodeByTag(node, 'button', className);
    }
    Styling.styleNode = styleNode;
    /**
     * Style a node and its elements that have a given tag name.
     *
     * @param node - The base node.
     *
     * @param tagName - The html tag name to style.
     *
     * @param className - The optional CSS class to add to styled nodes.
     */
    function styleNodeByTag(node, tagName, className = '') {
        if (node.localName === tagName) {
            node.classList.add('jp-mod-styled');
        }
        if (node.localName === 'select') {
            const multiple = node.hasAttribute('multiple');
            wrapSelect(node, multiple);
        }
        const nodes = node.getElementsByTagName(tagName);
        for (let i = 0; i < nodes.length; i++) {
            const child = nodes[i];
            child.classList.add('jp-mod-styled');
            if (className) {
                child.classList.add(className);
            }
            if (tagName === 'select') {
                const multiple = child.hasAttribute('multiple');
                wrapSelect(child, multiple);
            }
        }
    }
    Styling.styleNodeByTag = styleNodeByTag;
    /**
     * Wrap a select node.
     */
    function wrapSelect(node, multiple) {
        const wrapper = document.createElement('div');
        wrapper.classList.add('jp-select-wrapper');
        node.addEventListener('focus', styling_Private.onFocus);
        node.addEventListener('blur', styling_Private.onFocus);
        node.classList.add('jp-mod-styled');
        if (node.parentElement) {
            node.parentElement.replaceChild(wrapper, node);
        }
        wrapper.appendChild(node);
        if (multiple) {
            wrapper.classList.add('multiple');
        }
        else {
            // add the icon node
            wrapper.appendChild(caretDownEmptyIcon.element({
                tag: 'span',
                stylesheet: 'select',
                right: '8px',
                top: '5px',
                width: '18px'
            }));
        }
        return wrapper;
    }
    Styling.wrapSelect = wrapSelect;
})(Styling || (Styling = {}));
/**
 * The namespace for module private data.
 */
var styling_Private;
(function (Private) {
    /**
     * Handle a focus event on a styled select.
     */
    function onFocus(event) {
        const target = event.target;
        const parent = target.parentElement;
        if (!parent) {
            return;
        }
        if (event.type === 'focus') {
            parent.classList.add('jp-mod-focused');
        }
        else {
            parent.classList.remove('jp-mod-focused');
        }
    }
    Private.onFocus = onFocus;
})(styling_Private || (styling_Private = {}));
//# sourceMappingURL=styling.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/switch.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


/**
 * A Switch widget
 */
class Switch extends dist_index_es6_js_.Widget {
    constructor() {
        super();
        this._button = document.createElement('button');
        this._label = document.createElement('label');
        this._valueChanged = new index_es6_js_.Signal(this);
        // switch accessibility refs:
        // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Switch_role
        // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Accessibility_concerns
        this._button.className = 'jp-switch';
        this._button.setAttribute('role', 'switch');
        this._button.setAttribute('aria-checked', this._value ? this._value.toString() : 'false');
        this._label.className = 'jp-switch-label';
        const track = document.createElement('div');
        track.className = 'jp-switch-track';
        track.setAttribute('aria-hidden', 'true');
        this._button.appendChild(this._label);
        this._button.appendChild(track);
        this.node.appendChild(this._button);
    }
    /**
     * The value of the switch.
     */
    get value() {
        return this._value;
    }
    set value(newValue) {
        const oldValue = this._value;
        if (oldValue === newValue) {
            return;
        }
        this._button.setAttribute('aria-checked', newValue.toString());
        this._value = newValue;
        this._valueChanged.emit({ name: 'value', oldValue, newValue });
    }
    /**
     * A signal emitted when the value changes.
     */
    get valueChanged() {
        return this._valueChanged;
    }
    /**
     * The visible label of the switch.
     */
    get label() {
        var _a;
        return (_a = this._label.textContent) !== null && _a !== void 0 ? _a : '';
    }
    set label(x) {
        this._label.textContent = x;
    }
    /**
     * The caption (title) of the switch.
     */
    get caption() {
        return this._button.title;
    }
    set caption(x) {
        this._button.title = x;
        this._label.title = x;
    }
    handleEvent(event) {
        switch (event.type) {
            case 'click':
                this.value = !this.value;
                break;
            default:
                break;
        }
    }
    onAfterAttach() {
        this._button.addEventListener('click', this);
    }
    onBeforeDetach() {
        this._button.removeEventListener('click', this);
    }
}
//# sourceMappingURL=switch.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/table.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


const TABLE_CLASS = 'jp-sortable-table';
/**
 * Sortable table component for small datasets.
 *
 * For large datasets use `DataGrid` from `@lumino/datagrid`.
 */
function Table(props) {
    const [sortState, setSortState] = (0,index_js_.useState)({
        sortKey: props.sortKey,
        sortDirection: props.sortDirection || 1
    });
    const sort = (key) => {
        if (key === sortState.sortKey) {
            setSortState({
                sortKey: key,
                sortDirection: (sortState.sortDirection * -1)
            });
        }
        else {
            setSortState({ sortKey: key, sortDirection: 1 });
        }
    };
    let rows = props.rows;
    const sortedColumn = props.columns.filter(column => column.id === sortState.sortKey)[0];
    if (sortedColumn) {
        const sorter = sortedColumn.sort.bind(sortedColumn);
        rows = props.rows.sort((a, b) => sorter(a.data, b.data) * sortState.sortDirection);
    }
    const visibleColumns = props.columns.filter(column => (column.isAvailable ? column.isAvailable() : true) && !column.isHidden);
    const elements = rows.map(row => {
        const cells = visibleColumns.map(column => (index_js_default().createElement("td", { key: column.id + '-' + row.key }, column.renderCell(row.data))));
        return (index_js_default().createElement("tr", { key: row.key, "data-key": row.key, onClick: props.onRowClick, className: 'jp-sortable-table-tr' }, cells));
    });
    const columnsHeaders = visibleColumns.map(column => (index_js_default().createElement(SortableTH, { label: column.label, id: column.id, state: sortState, key: column.id, onSort: () => {
            sort(column.id);
        } })));
    return (index_js_default().createElement("table", { className: TABLE_CLASS },
        index_js_default().createElement("thead", null,
            index_js_default().createElement("tr", { className: 'jp-sortable-table-tr' }, columnsHeaders)),
        index_js_default().createElement("tbody", null, elements)));
}
function SortableTH(props) {
    const isSortKey = props.id === props.state.sortKey;
    const sortIcon = !isSortKey || props.state.sortDirection === 1 ? caretUpIcon : caretDownIcon;
    return (index_js_default().createElement("th", { key: props.id, onClick: () => props.onSort(), className: isSortKey ? 'jp-sorted-header' : undefined, "data-id": props.id },
        index_js_default().createElement("div", { className: "jp-sortable-table-th-wrapper" },
            index_js_default().createElement("label", null, props.label),
            index_js_default().createElement(sortIcon.react, { tag: "span", className: "jp-sort-icon" }))));
}
//# sourceMappingURL=table.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/windowedlist.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */






/**
 * For how long after the scroll request should the target position
 * be corrected to account for resize of other widgets?
 *
 * The time is given in milliseconds.
 */
const MAXIMUM_TIME_REMAINING = 3000;
/*
 * Feature detection
 *
 * Ref: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
 */
let passiveIfSupported = false;
try {
    // @ts-expect-error unknown signature
    window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
        get: function () {
            passiveIfSupported = { passive: true };
        }
    }));
}
catch (err) {
    // pass no-op
}
/**
 * Windowed list abstract model.
 */
class WindowedListModel {
    /**
     * Constructor
     *
     * @param options Constructor options
     */
    constructor(options = {}) {
        var _a, _b, _c, _d, _e, _f;
        /**
         * The overlap threshold used to decide whether to scroll down to an item
         * below the viewport (smart mode). If the item overlap with the viewport
         * is greater or equal this threshold the item is considered sufficiently
         * visible and will not be scrolled to. The value is the number of pixels
         * in overlap if greater than one, or otherwise a fraction of item height.
         * By default the item is scrolled to if not full visible in the viewport.
         */
        this.scrollDownThreshold = 1;
        /**
         * The underlap threshold used to decide whether to scroll up to an item
         * above the viewport (smart mode). If the item part outside the viewport
         * (underlap) is greater than this threshold then the item is considered
         * not sufficiently visible and will be scrolled to.
         * The value is the number of pixels in underlap if greater than one, or
         * otherwise a fraction of the item height.
         * By default the item is scrolled to if not full visible in the viewport.
         */
        this.scrollUpThreshold = 0;
        /**
         * Top padding of the the outer window node.
         */
        this.paddingTop = 0;
        /**
         * Default widget size estimation
         *
         * @deprecated we always use {@link estimateWidgetSize}
         */
        this._estimatedWidgetSize = WindowedList.DEFAULT_WIDGET_SIZE;
        this._stateChanged = new index_es6_js_.Signal(this);
        this._currentWindow = [-1, -1, -1, -1];
        this._height = 0;
        this._isDisposed = false;
        this._itemsList = null;
        this._measuredAllUntilIndex = -1;
        this._overscanCount = 1;
        this._scrollOffset = 0;
        this._widgetCount = 0;
        this._widgetSizers = [];
        this._windowingActive = true;
        this._widgetCount = (_c = (_b = (_a = options.itemsList) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : options.count) !== null && _c !== void 0 ? _c : 0;
        this._overscanCount = (_d = options.overscanCount) !== null && _d !== void 0 ? _d : 1;
        this._windowingActive = (_e = options.windowingActive) !== null && _e !== void 0 ? _e : true;
        this.itemsList = (_f = options.itemsList) !== null && _f !== void 0 ? _f : null;
    }
    /**
     * List widget height
     */
    get height() {
        return this._height;
    }
    set height(h) {
        this._height = h;
    }
    /**
     * Test whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Items list to be rendered
     */
    get itemsList() {
        return this._itemsList;
    }
    set itemsList(v) {
        var _a, _b, _c;
        if (this._itemsList !== v) {
            if (this._itemsList) {
                this._itemsList.changed.disconnect(this.onListChanged, this);
            }
            const oldValue = this._itemsList;
            this._itemsList = v;
            if (this._itemsList) {
                this._itemsList.changed.connect(this.onListChanged, this);
            }
            else {
                this._widgetCount = 0;
            }
            this._stateChanged.emit({
                name: 'list',
                newValue: this._itemsList,
                oldValue
            });
            this._stateChanged.emit({
                name: 'count',
                newValue: (_b = (_a = this._itemsList) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0,
                oldValue: (_c = oldValue === null || oldValue === void 0 ? void 0 : oldValue.length) !== null && _c !== void 0 ? _c : 0
            });
        }
    }
    /**
     * Number of widgets to render in addition to those
     * visible in the viewport.
     */
    get overscanCount() {
        return this._overscanCount;
    }
    set overscanCount(newValue) {
        if (newValue >= 1) {
            if (this._overscanCount !== newValue) {
                const oldValue = this._overscanCount;
                this._overscanCount = newValue;
                this._stateChanged.emit({ name: 'overscanCount', newValue, oldValue });
            }
        }
        else {
            console.error(`Forbidden non-positive overscan count: got ${newValue}`);
        }
    }
    /**
     * Viewport scroll offset.
     */
    get scrollOffset() {
        return this._scrollOffset;
    }
    set scrollOffset(offset) {
        this._scrollOffset = offset;
    }
    /**
     * Total number of widgets in the list
     */
    get widgetCount() {
        return this._itemsList ? this._itemsList.length : this._widgetCount;
    }
    set widgetCount(newValue) {
        if (this.itemsList) {
            console.error('It is not allow to change the widgets count of a windowed list if a items list is used.');
            return;
        }
        if (newValue >= 0) {
            if (this._widgetCount !== newValue) {
                const oldValue = this._widgetCount;
                this._widgetCount = newValue;
                this._stateChanged.emit({ name: 'count', newValue, oldValue });
            }
        }
        else {
            console.error(`Forbidden negative widget count: got ${newValue}`);
        }
    }
    /**
     * Whether windowing is active or not.
     *
     * This is true by default.
     */
    get windowingActive() {
        return this._windowingActive;
    }
    set windowingActive(newValue) {
        if (newValue !== this._windowingActive) {
            const oldValue = this._windowingActive;
            this._windowingActive = newValue;
            this._currentWindow = [-1, -1, -1, -1];
            this._measuredAllUntilIndex = -1;
            this._widgetSizers = [];
            this._stateChanged.emit({ name: 'windowingActive', newValue, oldValue });
        }
    }
    /**
     * A signal emitted when any model state changes.
     */
    get stateChanged() {
        return this._stateChanged;
    }
    /**
     * Dispose the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        index_es6_js_.Signal.clearData(this);
    }
    /**
     * Get the total list size.
     *
     * @returns Total estimated size
     */
    getEstimatedTotalSize() {
        let totalSizeOfInitialItems = 0;
        if (this._measuredAllUntilIndex >= this.widgetCount) {
            this._measuredAllUntilIndex = this.widgetCount - 1;
        }
        // These items are all measured already
        if (this._measuredAllUntilIndex >= 0) {
            const itemMetadata = this._widgetSizers[this._measuredAllUntilIndex];
            totalSizeOfInitialItems = itemMetadata.offset + itemMetadata.size;
        }
        // These items might have measurements, but some will be missing
        let totalSizeOfRemainingItems = 0;
        for (let i = this._measuredAllUntilIndex + 1; i < this.widgetCount; i++) {
            const sizer = this._widgetSizers[i];
            totalSizeOfRemainingItems += (sizer === null || sizer === void 0 ? void 0 : sizer.measured)
                ? sizer.size
                : this.estimateWidgetSize(i);
        }
        return totalSizeOfInitialItems + totalSizeOfRemainingItems;
    }
    /**
     * Get the scroll offset to display an item in the viewport.
     *
     * By default, the list will scroll as little as possible to ensure the item is fully visible (`auto`).
     * You can control the alignment of the item though by specifying a second alignment parameter.
     * Acceptable values are:
     *
     *   auto - Automatically align with the top or bottom minimising the amount scrolled,
     *          If `alignPreference` is given, follow such preferred alignment.
     *          If item is smaller than the viewport and fully visible, do not scroll at all.
     *   smart - If the item is significantly visible, don't scroll at all (regardless of whether it fits in the viewport).
     *           If the item is less than one viewport away, scroll so that it becomes fully visible (following the `auto` heuristics).
     *           If the item is more than one viewport away, scroll so that it is centered within the viewport (`center` if smaller than viewport, `top-center` otherwise).
     *   center - Align the middle of the item with the middle of the viewport (it only works well for items smaller than the viewport).
     *   top-center - Align the top of the item with the middle of the viewport (works well for items larger than the viewport).
     *   end - Align the bottom of the item to the bottom of the list.
     *   start - Align the top of item to the top of the list.
     *
     * An item is considered significantly visible if:
     *  - it overlaps with the viewport by the amount specified by `scrollDownThreshold` when below the viewport
     *  - it exceeds the viewport by the amount less than specified by `scrollUpThreshold` when above the viewport.
     *
     * @param index Item index
     * @param align Where to align the item in the viewport
     * @param margin The proportion of viewport to add when aligning with the top/bottom of the list.
     * @param precomputed Precomputed values to use when windowing is disabled.
     * @param alignPreference Allows to override the alignment of item when the `auto` heuristic decides that the item needs to be scrolled into view.
     * @returns The needed scroll offset
     */
    getOffsetForIndexAndAlignment(index, align = 'auto', margin = 0, precomputed, alignPreference) {
        const boundedMargin = Math.min(Math.max(0.0, margin), 1.0);
        const size = this._height;
        const itemMetadata = precomputed
            ? precomputed.itemMetadata
            : this._getItemMetadata(index);
        const scrollDownThreshold = this.scrollDownThreshold <= 1
            ? itemMetadata.size * this.scrollDownThreshold
            : this.scrollDownThreshold;
        const scrollUpThreshold = this.scrollUpThreshold <= 1
            ? itemMetadata.size * this.scrollUpThreshold
            : this.scrollUpThreshold;
        // When pre-computed values are not available (we are in windowing mode),
        // `getEstimatedTotalSize` is called after ItemMetadata is computed
        // to ensure it reflects actual measurements instead of just estimates.
        const estimatedTotalSize = precomputed
            ? precomputed.totalSize
            : this.getEstimatedTotalSize();
        const topOffset = Math.max(0, Math.min(estimatedTotalSize - size, itemMetadata.offset));
        const bottomOffset = Math.max(0, itemMetadata.offset - size + itemMetadata.size);
        // Current offset (+/- padding) is the top edge of the viewport.
        const currentOffset = precomputed
            ? precomputed.currentOffset
            : this._scrollOffset;
        const viewportPadding = this._windowingActive ? this.paddingTop : 0;
        const itemTop = itemMetadata.offset;
        const itemBottom = itemMetadata.offset + itemMetadata.size;
        const bottomEdge = currentOffset - viewportPadding + size;
        const topEdge = currentOffset - viewportPadding;
        const crossingBottomEdge = bottomEdge > itemTop && bottomEdge < itemBottom;
        const crossingTopEdge = topEdge > itemTop && topEdge < itemBottom;
        const isFullyWithinViewport = bottomEdge > itemBottom && topEdge < itemTop;
        if (align === 'smart') {
            const edgeLessThanOneViewportAway = currentOffset >= bottomOffset - size &&
                currentOffset <= topOffset + size;
            const visiblePartBottom = bottomEdge - itemTop;
            const hiddenPartTop = topEdge - itemTop;
            if (isFullyWithinViewport ||
                (crossingBottomEdge && visiblePartBottom >= scrollDownThreshold) ||
                (crossingTopEdge && hiddenPartTop < scrollUpThreshold)) {
                return currentOffset;
            }
            else if (edgeLessThanOneViewportAway) {
                // Possibly less than one viewport away, scroll so that it becomes visible (including the margin)
                align = 'auto';
            }
            else {
                // More than one viewport away, scroll so that it is centered within the list:
                // - if the item is smaller than viewport align the middle of the item with the middle of the viewport
                // - if the item is larger than viewport align the top of the item with the middle of the viewport
                if (itemMetadata.size > size) {
                    align = 'top-center';
                }
                else {
                    align = 'center';
                }
            }
        }
        if (align === 'auto') {
            if (isFullyWithinViewport) {
                // No need to change the position, return the current offset.
                return currentOffset;
            }
            else if (alignPreference !== undefined) {
                align = alignPreference;
            }
            else if (crossingBottomEdge || bottomEdge <= itemBottom) {
                align = 'end';
            }
            else {
                align = 'start';
            }
        }
        switch (align) {
            case 'start':
                // Align item top to the top edge.
                return Math.max(0, topOffset - boundedMargin * size) + viewportPadding;
            case 'end':
                // Align item bottom to the bottom edge.
                return bottomOffset + boundedMargin * size + viewportPadding;
            case 'center':
                // Align item centre to the middle of the viewport
                return bottomOffset + (topOffset - bottomOffset) / 2;
            case 'top-center':
                // Align item top to the middle of the viewport
                return topOffset - size / 2;
        }
    }
    /**
     * Compute the items range to display.
     *
     * It returns ``null`` if the range does not need to be updated.
     *
     * @param options - Control how the range is computed.
     *   - `virtual`: If `true`, return a virtual range without updating
     *     the current window.
     *     If `false` or omitted, update and return the actual window range.
     * @returns The current items range to display
     */
    getRangeToRender(options) {
        if (options === null || options === void 0 ? void 0 : options.virtual) {
            return this._computeVirtualRange();
        }
        let newWindowIndex = [
            0,
            Math.max(this.widgetCount - 1, -1),
            0,
            Math.max(this.widgetCount - 1, -1)
        ];
        const previousLastMeasuredIndex = this._measuredAllUntilIndex;
        if (this.windowingActive) {
            newWindowIndex = this._computeVirtualRange();
        }
        const [startIndex, stopIndex] = newWindowIndex;
        if (previousLastMeasuredIndex <= stopIndex ||
            this._currentWindow[0] !== startIndex ||
            this._currentWindow[1] !== stopIndex) {
            this._currentWindow = newWindowIndex;
            return newWindowIndex;
        }
        return newWindowIndex !== null && newWindowIndex !== void 0 ? newWindowIndex : null;
    }
    /**
     * Return the viewport top position and height for range spanning from
     * ``startIndex`` to ``stopIndex``.
     *
     * @param startIndex First item in viewport index
     * @param stopIndex Last item in viewport index
     * @returns The viewport top position and its height
     */
    getSpan(startIndex, stopIndex) {
        const startSizer = this._getItemMetadata(startIndex);
        const top = startSizer.offset;
        const stopSizer = this._getItemMetadata(stopIndex);
        const height = stopSizer.offset - startSizer.offset + stopSizer.size;
        return [top, height];
    }
    /**
     * WindowedListModel caches offsets and measurements for each index for performance purposes.
     * This method clears that cached data for all items after (and including) the specified index.
     *
     * The list will automatically re-render after the index is reset.
     *
     * @param index
     */
    resetAfterIndex(index) {
        const oldValue = this._measuredAllUntilIndex;
        this._measuredAllUntilIndex = Math.min(index, this._measuredAllUntilIndex);
        // Because `resetAfterIndex` is always called after an operation modifying
        // the list of widget sizers, we need to ensure that offsets are correct;
        // e.g. removing a cell would make the offsets of all following cells too high.
        // The simplest way to "heal" the offsets is to recompute them all.
        for (const [i, sizer] of this._widgetSizers.entries()) {
            if (i === 0) {
                continue;
            }
            const previous = this._widgetSizers[i - 1];
            sizer.offset = previous.offset + previous.size;
        }
        if (this._measuredAllUntilIndex !== oldValue) {
            this._stateChanged.emit({ name: 'index', newValue: index, oldValue });
        }
    }
    /**
     * Update item sizes.
     *
     * This should be called when the real item sizes has been
     * measured.
     *
     * @param sizes New sizes per item index
     * @returns Whether some sizes changed or not
     */
    setWidgetSize(sizes) {
        if (this._windowingActive || this._currentWindow[0] >= 0) {
            let minIndex = Infinity;
            let measuredAllItemsUntil = -1;
            let offsetDelta = 0;
            let allPreviousMeasured = true;
            const sizesMap = new Map(sizes.map(i => [i.index, i.size]));
            const highestIndex = Math.max(...sizesMap.keys());
            // add sizers at the end if needed
            const entries = [
                ...this._widgetSizers.entries()
            ];
            for (let i = this._widgetSizers.length; i <= highestIndex; i++) {
                entries.push([i, null]);
            }
            for (let [index, sizer] of entries) {
                const measuredSize = sizesMap.get(index);
                let itemDelta = 0;
                const hadSizer = !!sizer;
                if (!sizer) {
                    const previous = this._widgetSizers[index - 1];
                    const newSizer = {
                        offset: previous ? previous.offset + previous.size : 0,
                        size: measuredSize !== undefined
                            ? measuredSize
                            : this.estimateWidgetSize(index),
                        measured: measuredSize !== undefined
                    };
                    this._widgetSizers[index] = newSizer;
                    sizer = newSizer;
                }
                if (measuredSize !== undefined) {
                    // If the we learned about the size, update it and compute atomic offset for following item (`itemDelta`)
                    if (sizer.size != measuredSize) {
                        itemDelta = measuredSize - sizer.size;
                        sizer.size = measuredSize;
                        minIndex = Math.min(minIndex, index);
                    }
                    // Always set the flag in case the size estimator provides perfect result
                    sizer.measured = true;
                }
                // If all items so far have actual size measurements...
                if (allPreviousMeasured) {
                    if (sizer.measured) {
                        // and this item has a size measurement, we can say that
                        // all items until now have measurements:
                        measuredAllItemsUntil = index;
                    }
                    else {
                        allPreviousMeasured = false;
                    }
                }
                if (hadSizer && offsetDelta !== 0) {
                    // Adjust offsets for all items where it is needed
                    sizer.offset += offsetDelta;
                }
                // Keep track of the overall change in offset that will need to be applied to following items
                offsetDelta += itemDelta;
            }
            if (measuredAllItemsUntil !== -1) {
                this._measuredAllUntilIndex = measuredAllItemsUntil;
            }
            // If some sizes changed
            if (minIndex !== Infinity) {
                return true;
            }
        }
        return false;
    }
    /**
     * Callback on list changes
     *
     * @param list List items
     * @param changes List change
     */
    onListChanged(list, changes) {
        switch (changes.type) {
            case 'add':
                this._widgetSizers.splice(changes.newIndex, 0, ...new Array(changes.newValues.length).fill(undefined).map((_, i) => {
                    return { offset: 0, size: this.estimateWidgetSize(i) };
                }));
                this.resetAfterIndex(changes.newIndex - 1);
                break;
            case 'move':
                algorithm_dist_index_es6_js_.ArrayExt.move(this._widgetSizers, changes.oldIndex, changes.newIndex);
                this.resetAfterIndex(Math.min(changes.newIndex, changes.oldIndex) - 1);
                break;
            case 'remove':
                this._widgetSizers.splice(changes.oldIndex, changes.oldValues.length);
                this.resetAfterIndex(changes.oldIndex - 1);
                break;
            case 'set':
                this.resetAfterIndex(changes.newIndex - 1);
                break;
            case 'clear':
                this._widgetSizers.length = 0;
                this.resetAfterIndex(-1);
                break;
        }
    }
    _getItemMetadata(index) {
        var _a;
        if (index > this._measuredAllUntilIndex) {
            let offset = 0;
            if (this._measuredAllUntilIndex >= 0) {
                const itemMetadata = this._widgetSizers[this._measuredAllUntilIndex];
                offset = itemMetadata.offset + itemMetadata.size;
            }
            for (let i = this._measuredAllUntilIndex + 1; i <= index; i++) {
                let size;
                let measured = false;
                if ((_a = this._widgetSizers[i]) === null || _a === void 0 ? void 0 : _a.measured) {
                    size = this._widgetSizers[i].size;
                    measured = true;
                }
                else {
                    const widget = this.widgetRenderer(i);
                    if ((widget === null || widget === void 0 ? void 0 : widget.node) && widget.node.isConnected) {
                        size = widget.node.getBoundingClientRect().height;
                        measured = true;
                    }
                    else {
                        size = this.estimateWidgetSize(i);
                        measured = false;
                    }
                }
                this._widgetSizers[i] = { offset, size, measured };
                offset += size;
            }
            // Because the loop above updates estimated sizes,
            // we need to fix (heal) offsets of the remaining items.
            for (let i = index + 1; i < this._widgetSizers.length; i++) {
                const sizer = this._widgetSizers[i];
                const previous = this._widgetSizers[i - 1];
                sizer.offset = previous.offset + previous.size;
            }
        }
        for (let i = 0; i <= this._measuredAllUntilIndex; i++) {
            const sizer = this._widgetSizers[i];
            if (i === 0) {
                if (sizer.offset !== 0) {
                    throw new Error('First offset is not null');
                }
            }
            else {
                const previous = this._widgetSizers[i - 1];
                if (sizer.offset !== previous.offset + previous.size) {
                    throw new Error(`Sizer ${i} has incorrect offset.`);
                }
            }
        }
        return this._widgetSizers[index];
    }
    _findNearestItem(offset) {
        const lastContinouslyMeasuredItemOffset = this._measuredAllUntilIndex > 0
            ? this._widgetSizers[this._measuredAllUntilIndex].offset
            : 0;
        if (lastContinouslyMeasuredItemOffset >= offset) {
            // If we've already measured items within this range just use a binary search as it's faster.
            return this._findNearestItemBinarySearch(this._measuredAllUntilIndex, 0, offset);
        }
        else {
            // If we haven't yet measured this high, fallback to an exponential search with an inner binary search.
            // The exponential search avoids pre-computing sizes for the full set of items as a binary search would.
            // The overall complexity for this approach is O(log n).
            return this._findNearestItemExponentialSearch(Math.max(0, this._measuredAllUntilIndex), offset);
        }
    }
    _findNearestItemBinarySearch(high, low, offset) {
        while (low <= high) {
            const middle = low + Math.floor((high - low) / 2);
            const currentOffset = this._getItemMetadata(middle).offset;
            if (currentOffset === offset) {
                return middle;
            }
            else if (currentOffset < offset) {
                low = middle + 1;
            }
            else if (currentOffset > offset) {
                high = middle - 1;
            }
        }
        if (low > 0) {
            return low - 1;
        }
        else {
            return 0;
        }
    }
    _findNearestItemExponentialSearch(index, offset) {
        let interval = 1;
        while (index < this.widgetCount &&
            this._getItemMetadata(index).offset < offset) {
            index += interval;
            interval *= 2;
        }
        return this._findNearestItemBinarySearch(Math.min(index, this.widgetCount - 1), Math.floor(index / 2), offset);
    }
    /**
     * Compute the virtual range of items to render.
     */
    _computeVirtualRange() {
        const widgetCount = this.widgetCount;
        if (widgetCount === 0) {
            return [-1, -1, -1, -1];
        }
        const startIndex = this._getStartIndexForOffset(this._scrollOffset);
        const stopIndex = this._getStopIndexForStartIndex(startIndex, this._scrollOffset);
        const overscanBackward = Math.max(1, this.overscanCount);
        const overscanForward = Math.max(1, this.overscanCount);
        return [
            Math.max(0, startIndex - overscanBackward),
            Math.max(0, Math.min(widgetCount - 1, stopIndex + overscanForward)),
            startIndex,
            stopIndex
        ];
    }
    _getStartIndexForOffset(offset) {
        return this._findNearestItem(offset);
    }
    _getStopIndexForStartIndex(startIndex, scrollOffset) {
        const size = this._height;
        const itemMetadata = this._getItemMetadata(startIndex);
        const maxOffset = scrollOffset + size;
        let offset = itemMetadata.offset + itemMetadata.size;
        let stopIndex = startIndex;
        while (stopIndex < this.widgetCount - 1 && offset < maxOffset) {
            stopIndex++;
            offset += this._getItemMetadata(stopIndex).size;
        }
        return stopIndex;
    }
}
/**
 * Windowed list widget
 */
class WindowedList extends dist_index_es6_js_.Widget {
    /**
     * Constructor
     *
     * @param options Constructor options
     */
    constructor(options) {
        var _a, _b;
        const renderer = (_a = options.renderer) !== null && _a !== void 0 ? _a : WindowedList.defaultRenderer;
        const node = document.createElement('div');
        node.className = 'jp-WindowedPanel';
        const scrollbarElement = node.appendChild(document.createElement('div'));
        scrollbarElement.classList.add('jp-WindowedPanel-scrollbar');
        const indicator = scrollbarElement.appendChild(renderer.createScrollbarViewportIndicator
            ? renderer.createScrollbarViewportIndicator()
            : WindowedList.defaultRenderer.createScrollbarViewportIndicator());
        indicator.classList.add('jp-WindowedPanel-scrollbar-viewportIndicator');
        const list = scrollbarElement.appendChild(renderer.createScrollbar());
        list.classList.add('jp-WindowedPanel-scrollbar-content');
        const outerElement = node.appendChild(renderer.createOuter());
        outerElement.classList.add('jp-WindowedPanel-outer');
        const innerElement = outerElement.appendChild(document.createElement('div'));
        innerElement.className = 'jp-WindowedPanel-inner';
        const viewport = innerElement.appendChild(renderer.createViewport());
        viewport.classList.add('jp-WindowedPanel-viewport');
        super({ node });
        /**
         * A signal that emits the index when the virtual scrollbar jumps to an item.
         */
        this.jumped = new index_es6_js_.Signal(this);
        this._scrollbarItems = {};
        this._viewportPaddingTop = 0;
        this._viewportPaddingBottom = 0;
        this._needsUpdate = false;
        this._requiresTotalSizeUpdate = false;
        this._timerToClearScrollStatus = null;
        super.layout = (_b = options.layout) !== null && _b !== void 0 ? _b : new WindowedLayout();
        this.renderer = renderer;
        this._viewportIndicator = indicator;
        this._innerElement = innerElement;
        this._isScrolling = null;
        this._outerElement = outerElement;
        this._itemsResizeObserver = null;
        this._scrollbarElement = scrollbarElement;
        this._scrollToItem = null;
        this._scrollRepaint = null;
        this._scrollUpdateWasRequested = false;
        this._updater = new polling_dist_index_es6_js_.Throttler(() => this.update(), 50);
        this._viewModel = options.model;
        this._viewport = viewport;
        if (options.scrollbar) {
            node.classList.add('jp-mod-virtual-scrollbar');
        }
        this.viewModel.stateChanged.connect(this.onStateChanged, this);
    }
    /**
     * Whether the parent is hidden or not.
     *
     * This should be set externally if a container is hidden to
     * stop updating the widget size when hidden.
     */
    get isParentHidden() {
        return this._isParentHidden;
    }
    set isParentHidden(v) {
        this._isParentHidden = v;
    }
    /**
     * Widget layout
     */
    get layout() {
        return super.layout;
    }
    /**
     * The outer container of the windowed list.
     */
    get outerNode() {
        return this._outerElement;
    }
    /**
     * Viewport
     */
    get viewportNode() {
        return this._viewport;
    }
    /**
     * Flag to enable virtual scrollbar.
     */
    get scrollbar() {
        return this.node.classList.contains('jp-mod-virtual-scrollbar');
    }
    set scrollbar(enabled) {
        if (enabled) {
            this.node.classList.add('jp-mod-virtual-scrollbar');
        }
        else {
            this.node.classList.remove('jp-mod-virtual-scrollbar');
        }
        this._adjustDimensionsForScrollbar();
        this.update();
    }
    /**
     * Windowed list view model
     */
    get viewModel() {
        return this._viewModel;
    }
    /**
     * Dispose the windowed list.
     */
    dispose() {
        this._updater.dispose();
        super.dispose();
    }
    /**
     * Callback on event.
     *
     * @param event Event
     */
    handleEvent(event) {
        switch (event.type) {
            case 'pointerdown':
                this._evtPointerDown(event);
                // Stop propagation of this event; a `mousedown` event will still
                // be automatically dispatched and handled by the parent notebook
                // (which will close any open context menu, etc.)
                event.stopPropagation();
                break;
            case 'scrollend':
                this._onScrollEnd();
                break;
            case 'scroll':
                this.onScroll(event);
                break;
        }
    }
    /**
     * Scroll to the specified offset `scrollTop`.
     *
     * @param scrollOffset Offset to scroll
     *
     * @deprecated since v4 This is an internal helper. Prefer calling `scrollToItem`.
     */
    scrollTo(scrollOffset) {
        this._renderScrollbar();
        if (!this.viewModel.windowingActive) {
            this._outerElement.scrollTo({ top: scrollOffset });
            // Scrolling done with browser-native code above
            this._markProgrammaticScrollingDone();
            return;
        }
        scrollOffset = Math.max(0, scrollOffset);
        if (scrollOffset !== this.viewModel.scrollOffset) {
            this.viewModel.scrollOffset = scrollOffset;
            this._scrollUpdateWasRequested = true;
            // Scroll will happen in udpate() routine
            this.update();
        }
        else {
            // No further scrolling will happen
            this._markProgrammaticScrollingDone();
        }
    }
    /**
     * Scroll to the specified item.
     *
     * By default, the list will scroll as little as possible to ensure the item is fully visible (`auto`).
     * You can control the alignment of the item though by specifying a second alignment parameter.
     * Acceptable values are:
     *
     *   auto - Automatically align with the top or bottom minimising the amount scrolled,
     *          If `alignPreference` is given, follow such preferred alignment.
     *          If item is smaller than the viewport and fully visible, do not scroll at all.
     *   smart - If the item is significantly visible, don't scroll at all (regardless of whether it fits in the viewport).
     *           If the item is less than one viewport away, scroll so that it becomes fully visible (following the `auto` heuristics).
     *           If the item is more than one viewport away, scroll so that it is centered within the viewport (`center` if smaller than viewport, `top-center` otherwise).
     *   center - Align the middle of the item with the middle of the viewport (it only works well for items smaller than the viewport).
     *   top-center - Align the top of the item with the middle of the viewport (works well for items larger than the viewport).
     *   end - Align the bottom of the item to the bottom of the list.
     *   start - Align the top of item to the top of the list.
     *
     * @param index Item index to scroll to
     * @param align Type of alignment
     * @param margin In 'smart' mode the viewport proportion to add
     * @param alignPreference Allows to override the alignment of item when the `auto` heuristic decides that the item needs to be scrolled into view.
     */
    scrollToItem(index, align = 'auto', margin = 0.25, alignPreference) {
        let deletage;
        if (!this._isScrolling ||
            this._scrollToItem === null ||
            this._scrollToItem[0] !== index ||
            this._scrollToItem[1] !== align) {
            if (this._isScrolling) {
                this._isScrolling.reject('Scrolling to a new item is requested.');
            }
            deletage = new dist_index_js_.PromiseDelegate();
            this._isScrolling = deletage;
            // Catch the internal reject, as otherwise this will
            // result in an unhandled promise rejection in test.
            deletage.promise.catch(console.debug);
        }
        else {
            deletage = this._isScrolling;
        }
        this._scrollToItem = [index, align, margin, alignPreference];
        this._resetScrollToItem();
        let precomputed = undefined;
        if (!this.viewModel.windowingActive) {
            const item = this._innerElement.querySelector(`[data-windowed-list-index="${index}"]`);
            if (!item || !(item instanceof HTMLElement)) {
                // Note: this can happen when scroll is requested when a cell is getting added
                console.debug(`Element with index ${index} not found`);
                return Promise.resolve();
            }
            precomputed = {
                totalSize: this._outerElement.scrollHeight,
                itemMetadata: {
                    offset: item.offsetTop,
                    size: item.clientHeight
                },
                currentOffset: this._outerElement.scrollTop
            };
        }
        this.scrollTo(this.viewModel.getOffsetForIndexAndAlignment(Math.max(0, Math.min(index, this.viewModel.widgetCount - 1)), align, margin, precomputed, alignPreference));
        return deletage.promise;
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     */
    onAfterAttach(msg) {
        super.onAfterAttach(msg);
        if (this.viewModel.windowingActive) {
            this._applyWindowingStyles();
        }
        else {
            this._applyNoWindowingStyles();
        }
        this._addListeners();
        this.viewModel.height = this.node.getBoundingClientRect().height;
        const viewportStyle = window.getComputedStyle(this._viewport);
        this.viewModel.paddingTop = parseFloat(viewportStyle.paddingTop);
        this._viewportPaddingTop = this.viewModel.paddingTop;
        this._viewportPaddingBottom = parseFloat(viewportStyle.paddingBottom);
        this._scrollbarElement.addEventListener('pointerdown', this);
        this._outerElement.addEventListener('scrollend', this);
    }
    /**
     * A message handler invoked on an `'before-detach'` message.
     */
    onBeforeDetach(msg) {
        this._removeListeners();
        this._scrollbarElement.removeEventListener('pointerdown', this);
        this._outerElement.removeEventListener('scrollend', this);
        super.onBeforeDetach(msg);
    }
    /**
     * Callback on scroll event
     *
     * @param event Scroll event
     */
    onScroll(event) {
        const { clientHeight, scrollHeight, scrollTop } = event.currentTarget;
        // TBC Firefox is emitting two events one with 1px diff then the _real_ scroll
        if (!this._scrollUpdateWasRequested &&
            Math.abs(this.viewModel.scrollOffset - scrollTop) > 1) {
            // Test if the scroll event is jumping to the list bottom
            // if (Math.abs(scrollHeight - clientHeight - scrollTop) < 1) {
            //   // FIXME Does not work because it happens in multiple segments in between which the sizing is changing
            //   // due to widget resizing. A possible fix would be to keep track of the "old" scrollHeight - clientHeight
            //   // up to some quiet activity.
            //   this.scrollToItem(this.widgetCount, 'end');
            // } else {
            const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
            this.viewModel.scrollOffset = scrollOffset;
            this._renderScrollbar();
            if (this.viewModel.windowingActive) {
                this._scrollUpdateWasRequested = false;
                if (this._viewport.dataset.isScrolling != 'true') {
                    this._viewport.dataset.isScrolling = 'true';
                }
                if (this._timerToClearScrollStatus) {
                    window.clearTimeout(this._timerToClearScrollStatus);
                }
                // TODO: remove once `scrollend` event is supported by Safari
                this._timerToClearScrollStatus = window.setTimeout(() => {
                    this._onScrollEnd();
                }, 750);
                this.update();
                // }
            }
            // }
        }
    }
    /**
     * A message handler invoked on an `'resize-request'` message.
     */
    onResize(msg) {
        const previousHeight = this.viewModel.height;
        this.viewModel.height =
            msg.height >= 0 ? msg.height : this.node.getBoundingClientRect().height;
        if (this.viewModel.height !== previousHeight) {
            void this._updater.invoke();
        }
        super.onResize(msg);
        void this._updater.invoke();
    }
    /**
     * Callback on view model change
     *
     * @param model Windowed list model
     * @param changes Change
     */
    onStateChanged(model, changes) {
        switch (changes.name) {
            case 'windowingActive':
                this._removeListeners();
                if (this.viewModel.windowingActive) {
                    this._applyWindowingStyles();
                    this.onScroll({ currentTarget: this.node });
                    this._addListeners();
                    // Bail as onScroll will trigger update
                    return;
                }
                else {
                    this._applyNoWindowingStyles();
                    this._addListeners();
                }
                break;
            case 'estimatedWidgetSize':
                // This only impact the container height and should not
                // impact the elements in the viewport.
                this._updateTotalSize();
                return;
        }
        this.update();
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onUpdateRequest(msg) {
        if (this.viewModel.windowingActive) {
            // Throttle update request
            if (this._scrollRepaint === null) {
                this._needsUpdate = false;
                this._scrollRepaint = window.requestAnimationFrame(() => {
                    this._scrollRepaint = null;
                    this._update();
                    if (this._needsUpdate) {
                        this.update();
                    }
                });
            }
            else {
                // Force re rendering if some changes happen during rendering.
                this._needsUpdate = true;
            }
        }
        else {
            this._update();
        }
    }
    /*
     * Hide the native scrollbar if necessary and update dimensions
     */
    _adjustDimensionsForScrollbar() {
        const outer = this._outerElement;
        const scrollbar = this._scrollbarElement;
        if (this.scrollbar) {
            // Query DOM
            let outerScrollbarWidth = outer.offsetWidth - outer.clientWidth;
            // Update DOM
            // 1) The native scrollbar is hidden by shifting it out of view.
            if (outerScrollbarWidth == 0) {
                // If the scrollbar width is zero, one of the following is true:
                // - (a) the content is not overflowing
                // - (b) the browser uses overlay scrollbars
                // In (b) the overlay scrollbars could show up even even if
                // occluded by a child element; to prevent this resulting in
                // double scrollbar we shift the content by an arbitrary offset.
                outerScrollbarWidth = 1000;
                outer.style.paddingRight = `${outerScrollbarWidth}px`;
                outer.style.boxSizing = 'border-box';
            }
            else {
                outer.style.paddingRight = '0';
            }
            outer.style.width = `calc(100% + ${outerScrollbarWidth}px)`;
            // 2) The inner window is shrank to accommodate the virtual scrollbar
            this._innerElement.style.marginRight = `${scrollbar.offsetWidth}px`;
        }
        else {
            // Reset all styles that may have been touched.
            outer.style.width = '100%';
            this._innerElement.style.marginRight = '';
            outer.style.paddingRight = '0';
            outer.style.boxSizing = '';
        }
    }
    /**
     * Add listeners for viewport, contents and the virtual scrollbar.
     */
    _addListeners() {
        // Scrollbar resize
        if (!this._scrollbarResizeObserver) {
            this._scrollbarResizeObserver = new ResizeObserver(this._adjustDimensionsForScrollbar.bind(this));
            this._scrollbarResizeObserver.observe(this._outerElement);
            this._scrollbarResizeObserver.observe(this._scrollbarElement);
        }
        // Observe all items for size changes, regardless of windowing mode
        if (!this._itemsResizeObserver) {
            this._itemsResizeObserver = new ResizeObserver(this._onItemResize.bind(this));
        }
        for (const widget of this.layout.widgets) {
            this._itemsResizeObserver.observe(widget.node);
            widget.disposed.connect(() => { var _a; return (_a = this._itemsResizeObserver) === null || _a === void 0 ? void 0 : _a.unobserve(widget.node); });
        }
        if (!this._areaResizeObserver && this.viewModel.windowingActive) {
            // This is taken care by browser scroll anchoring outside of full windowing mode.
            this._areaResizeObserver = new ResizeObserver(this._onAreaResize.bind(this));
            this._areaResizeObserver.observe(this._innerElement);
        }
        this._outerElement.addEventListener('scroll', this, passiveIfSupported);
    }
    /**
     * Turn off windowing related styles in the viewport.
     */
    _applyNoWindowingStyles() {
        this._outerElement.style.removeProperty('overflow-anchor');
        this._viewport.style.position = 'relative';
        this._viewport.style.contain = '';
        this._viewport.style.top = '0px';
        this._viewport.style.minHeight = '';
        this._innerElement.style.height = '';
    }
    /**
     * Turn on windowing related styles in the viewport.
     */
    _applyWindowingStyles() {
        this._outerElement.style.setProperty('overflow-anchor', 'none');
        this._viewport.style.position = 'absolute';
        this._viewport.style.contain = 'layout';
    }
    /**
     * Remove listeners for viewport and contents (but not the virtual scrollbar).
     */
    _removeListeners() {
        var _a, _b, _c;
        this._outerElement.removeEventListener('scroll', this);
        (_a = this._areaResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
        this._areaResizeObserver = null;
        (_b = this._itemsResizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
        this._itemsResizeObserver = null;
        (_c = this._scrollbarResizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
        this._scrollbarResizeObserver = null;
    }
    /**
     * Update viewport and DOM state.
     */
    _update() {
        var _a;
        if (this.isDisposed || !this.layout) {
            return;
        }
        const newWindowIndex = this.viewModel.getRangeToRender();
        if (newWindowIndex !== null) {
            const [startIndex, stopIndex] = newWindowIndex;
            this._renderScrollbar();
            const toAdd = [];
            if (stopIndex >= 0) {
                for (let index = startIndex; index <= stopIndex; index++) {
                    const widget = this.viewModel.widgetRenderer(index);
                    widget.dataset.windowedListIndex = `${index}`;
                    toAdd.push(widget);
                }
            }
            const nWidgets = this.layout.widgets.length;
            // Remove not needed widgets
            for (let itemIdx = nWidgets - 1; itemIdx >= 0; itemIdx--) {
                if (!toAdd.includes(this.layout.widgets[itemIdx])) {
                    (_a = this._itemsResizeObserver) === null || _a === void 0 ? void 0 : _a.unobserve(this.layout.widgets[itemIdx].node);
                    this.layout.removeWidget(this.layout.widgets[itemIdx]);
                }
            }
            for (let index = 0; index < toAdd.length; index++) {
                const item = toAdd[index];
                if (this._itemsResizeObserver && !this.layout.widgets.includes(item)) {
                    this._itemsResizeObserver.observe(item.node);
                    item.disposed.connect(() => { var _a; return (_a = this._itemsResizeObserver) === null || _a === void 0 ? void 0 : _a.unobserve(item.node); });
                }
                // The widget may have moved due to drag-and-drop
                this.layout.insertWidget(index, item);
            }
            if (this.viewModel.windowingActive) {
                if (stopIndex >= 0) {
                    // Read this value after creating the cells.
                    // So their actual sizes are taken into account
                    this._updateTotalSize();
                    // Update position of window container
                    let [top, _minHeight] = this.viewModel.getSpan(startIndex, stopIndex);
                    this._viewport.style.transform = `translateY(${top}px)`;
                }
                else {
                    // Update inner container height
                    this._innerElement.style.height = `0px`;
                    // Update position of viewport node
                    this._viewport.style.top = `0px`;
                    this._viewport.style.minHeight = `0px`;
                }
                // Update scroll
                if (this._scrollUpdateWasRequested) {
                    this._outerElement.scrollTop = this.viewModel.scrollOffset;
                    this._scrollUpdateWasRequested = false;
                    this._markProgrammaticScrollingDone();
                }
            }
        }
        let index2 = -1;
        for (const w of this._viewport.children) {
            const currentIdx = parseInt(w.dataset.windowedListIndex, 10);
            if (currentIdx < index2) {
                throw new Error('Inconsistent dataset index');
            }
            else {
                index2 = currentIdx;
            }
        }
    }
    /**
     * Handle viewport area resize.
     */
    _onAreaResize(_entries) {
        this._scrollBackToItemOnResize();
    }
    /**
     * Handle viewport content (i.e. items) resize.
     */
    _onItemResize(entries) {
        this._resetScrollToItem();
        if (this.isHidden || this.isParentHidden) {
            return;
        }
        const newSizes = [];
        for (let entry of entries) {
            // Update size only if item is attached to the DOM
            if (entry.target.isConnected) {
                // Rely on the data attribute as some nodes may be hidden instead of detach
                // to preserve state.
                newSizes.push({
                    index: parseInt(entry.target.dataset.windowedListIndex, 10),
                    size: entry.borderBoxSize[0].blockSize
                });
            }
        }
        // If some sizes changed
        if (this.viewModel.setWidgetSize(newSizes)) {
            this._scrollBackToItemOnResize();
            // Update the list
            this.update();
        }
    }
    /**
     * Scroll to the item which was most recently requested.
     *
     * This method ensures that the app scrolls to the item even if a resize event
     * occurs shortly after the scroll. Consider the following sequence of events:
     *
     * 1. User is at the nth cell, presses Shift+Enter (run current cell and
     *    advance to next)
     * 2. App scrolls to the next (n+1) cell
     * 3. The nth cell finishes running and renders the output, pushing the
     *    (n+1) cell down out of view
     * 4. This triggers the resize observer, which calls this method and scrolls
     *    the (n+1) cell back into view
     *
     * On implementation level, this is ensured by scrolling to `this._scrollToItem`
     * which is cleared after a short timeout once the scrolling settles
     * (see `this._resetScrollToItem()`).
     *
     * This is taken care by browser scroll anchoring outside of full windowing mode.
     */
    _scrollBackToItemOnResize() {
        if (!this.viewModel.windowingActive) {
            return;
        }
        if (!this._scrollToItem) {
            return;
        }
        this.scrollToItem(...this._scrollToItem).catch(reason => {
            console.log(reason);
        });
    }
    /**
     * Clear any outstanding timeout and enqueue scrolling to a new item.
     */
    _resetScrollToItem() {
        if (this._resetScrollToItemTimeout) {
            clearTimeout(this._resetScrollToItemTimeout);
        }
        if (this._scrollToItem) {
            this._resetScrollToItemTimeout = window.setTimeout(() => {
                this._scrollToItem = null;
                this._markProgrammaticScrollingDone();
            }, MAXIMUM_TIME_REMAINING);
        }
    }
    /**
     * Mark the current promise for programmatic scrolling as compelted.
     */
    _markProgrammaticScrollingDone() {
        if (this._isScrolling) {
            this._isScrolling.resolve();
            this._isScrolling = null;
        }
    }
    /**
     * Render virtual scrollbar.
     */
    _renderScrollbar() {
        var _a, _b;
        if (!this.scrollbar) {
            return [];
        }
        const { node, renderer, viewModel } = this;
        const content = node.querySelector('.jp-WindowedPanel-scrollbar-content');
        const elements = [];
        const visitedKeys = new Set();
        const getElement = (item, index) => {
            if (item instanceof HTMLElement) {
                return item;
            }
            visitedKeys.add(item.key);
            const props = { index };
            const cachedItem = this._scrollbarItems[item.key];
            if (cachedItem && !cachedItem.isDisposed) {
                try {
                    return cachedItem.render(props);
                }
                catch (_a) {
                    return document.createElement('div'); // fallback for tests
                }
            }
            else {
                this._scrollbarItems[item.key] = item;
                try {
                    return item.render(props);
                }
                catch (_b) {
                    return document.createElement('div'); // fallback for tests
                }
            }
        };
        const list = viewModel.itemsList;
        const count = (_a = list === null || list === void 0 ? void 0 : list.length) !== null && _a !== void 0 ? _a : viewModel.widgetCount;
        for (let index = 0; index < count; index++) {
            const model = (_b = list === null || list === void 0 ? void 0 : list.get) === null || _b === void 0 ? void 0 : _b.call(list, index);
            const item = renderer.createScrollbarItem(this, index, model);
            const element = getElement(item, index);
            element.classList.add('jp-WindowedPanel-scrollbar-item');
            element.dataset.index = `${index}`;
            elements.push(element);
        }
        // dispose of any elements which are no longer in the scrollbar
        const keysNotSeen = Object.keys(this._scrollbarItems).filter(key => !visitedKeys.has(key));
        for (const key of keysNotSeen) {
            this._scrollbarItems[key].dispose();
            delete this._scrollbarItems[key];
        }
        const oldNodes = [...content.childNodes];
        if (oldNodes.length !== elements.length ||
            !oldNodes.every((node, index) => elements[index] === node)) {
            content.replaceChildren(...elements);
        }
        if (this.scrollbar) {
            const newWindowIndex = this.viewModel.getRangeToRender({ virtual: true });
            if (newWindowIndex !== null) {
                const [firstVisibleIndex, lastVisibleIndex] = newWindowIndex;
                const first = elements[firstVisibleIndex];
                const last = elements[lastVisibleIndex];
                this._viewportIndicator.style.top = first.offsetTop - 1 + 'px';
                this._viewportIndicator.style.height =
                    last.offsetTop - first.offsetTop + last.offsetHeight + 'px';
            }
        }
        return elements;
    }
    /**
     * Handle `pointerdown` events on the virtual scrollbar.
     */
    _evtPointerDown(event) {
        let target = event.target;
        while (target && target.parentElement) {
            if (target.hasAttribute('data-index')) {
                const index = parseInt(target.getAttribute('data-index'), 10);
                return void (async () => {
                    await this.scrollToItem(index);
                    this.jumped.emit(index);
                })();
            }
            target = target.parentElement;
        }
    }
    /**
     * Handle `scrollend` events on the scroller.
     */
    _onScrollEnd() {
        if (this._timerToClearScrollStatus) {
            window.clearTimeout(this._timerToClearScrollStatus);
        }
        this._viewport.dataset.isScrolling = 'false';
        if (this._requiresTotalSizeUpdate) {
            this._updateTotalSize();
        }
        this._requiresTotalSizeUpdate = false;
    }
    /**
     * Update the total size
     */
    _updateTotalSize() {
        if (this.viewModel.windowingActive) {
            if (this._viewport.dataset.isScrolling == 'true') {
                // Do not update while scrolling, delay until later
                this._requiresTotalSizeUpdate = true;
                return;
            }
            const estimatedTotalHeight = this.viewModel.getEstimatedTotalSize();
            const heightWithPadding = estimatedTotalHeight +
                this._viewportPaddingTop +
                this._viewportPaddingBottom;
            // Update inner container height
            this._innerElement.style.height = `${heightWithPadding}px`;
        }
    }
}
/**
 * Default widget size
 */
WindowedList.DEFAULT_WIDGET_SIZE = 50;
/**
 * Customized layout for windowed list container.
 */
class WindowedLayout extends dist_index_es6_js_.PanelLayout {
    /**
     * Constructor
     */
    constructor() {
        super({ fitPolicy: 'set-no-constraint' });
    }
    /**
     * Specialized parent type definition
     */
    get parent() {
        return super.parent;
    }
    set parent(value) {
        super.parent = value;
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation adds the widgets's node to the parent's
     * node at the proper location, and sends the appropriate attach
     * messages to the widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is added to the parent's node.
     */
    attachWidget(index, widget) {
        // Look up the next sibling reference node.
        let ref = this.parent.viewportNode.children[index];
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, dist_index_es6_js_.Widget.Msg.BeforeAttach);
        }
        // Insert the widget's node before the sibling.
        this.parent.viewportNode.insertBefore(widget.node, ref);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, dist_index_es6_js_.Widget.Msg.AfterAttach);
        }
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation removes the widget's node from the
     * parent's node, and sends the appropriate detach messages to the
     * widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is removed from the parent's node.
     */
    detachWidget(index, widget) {
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, dist_index_es6_js_.Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.viewportNode.removeChild(widget.node);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            messaging_dist_index_es6_js_.MessageLoop.sendMessage(widget, dist_index_es6_js_.Widget.Msg.AfterDetach);
        }
    }
    /**
     * Move a widget in the parent's DOM node.
     *
     * @param fromIndex - The previous index of the widget in the layout.
     *
     * @param toIndex - The current index of the widget in the layout.
     *
     * @param widget - The widget to move in the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation moves the widget's node to the proper
     * location in the parent's node and sends the appropriate attach and
     * detach messages to the widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is moved in the parent's node.
     */
    moveWidget(fromIndex, toIndex, widget) {
        // Optimize move without de-/attaching as motion appends with parent attached
        // Case fromIndex === toIndex, already checked in PanelLayout.insertWidget
        // Look up the next sibling reference node.
        let ref = this.parent.viewportNode.children[toIndex];
        if (fromIndex < toIndex) {
            ref.insertAdjacentElement('afterend', widget.node);
        }
        else {
            ref.insertAdjacentElement('beforebegin', widget.node);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     *
     * #### Notes
     * This is a reimplementation of the base class method,
     * and is a no-op.
     */
    onUpdateRequest(msg) {
        // This is a no-op.
    }
}
/**
 * A namespace for windowed list
 */
(function (WindowedList) {
    /**
     * The default renderer class for windowed lists.
     */
    class Renderer {
        /**
         * Create the outer, root element of the windowed list.
         */
        createOuter() {
            return document.createElement('div');
        }
        /**
         * Create the virtual scrollbar element.
         */
        createScrollbar() {
            return document.createElement('ol');
        }
        /**
         * Create the virtual scrollbar viewport indicator.
         */
        createScrollbarViewportIndicator() {
            return document.createElement('div');
        }
        /**
         * Create an individual item rendered in the scrollbar.
         */
        createScrollbarItem(_, index) {
            const li = document.createElement('li');
            li.appendChild(document.createTextNode(`${index}`));
            return li;
        }
        /**
         * Create the viewport element into which virtualized children are added.
         */
        createViewport() {
            return document.createElement('div');
        }
    }
    WindowedList.Renderer = Renderer;
    /**
     * The default renderer for windowed lists.
     */
    WindowedList.defaultRenderer = new Renderer();
})(WindowedList || (WindowedList = {}));
//# sourceMappingURL=windowedlist.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/components/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.


















//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/virtualdom@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/virtualdom/dist/index.es6.js)
var virtualdom_dist_index_es6_js_ = __webpack_require__(17197);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/icon/widgets/commandpalettesvg.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.





const searchHeaderIcon = filterListIcon.bindprops({
    stylesheet: 'commandPaletteHeader',
    className: 'jp-icon-hoverShow-content'
});
var CommandPaletteSvg;
(function (CommandPaletteSvg) {
    /**
     * a modified implementation of the CommandPalette Renderer
     */
    class Renderer extends dist_index_es6_js_.CommandPalette.Renderer {
        /**
         * Render the virtual element for a command palette header.
         *
         * @param data - The data to use for rendering the header.
         *
         * @returns A virtual element representing the header.
         */
        renderHeader(data) {
            const content = this.formatHeader(data);
            return virtualdom_dist_index_es6_js_.h.li({
                className: classes('lm-CommandPalette-header', 'jp-icon-hoverShow')
            }, content, virtualdom_dist_index_es6_js_.h.span(searchHeaderIcon));
        }
        /**
         * Render the icon for a command palette item.
         *
         * @param data - The data to use for rendering the icon.
         *
         * @returns A virtual element representing the icon.
         */
        renderItemIcon(data) {
            const className = this.createIconClass(data);
            if (data.item.isToggled) {
                // check mark icon takes precedence
                return virtualdom_dist_index_es6_js_.h.div({ className }, checkIcon, data.item.iconLabel);
            }
            // if data.item.icon is undefined, it will be ignored
            return virtualdom_dist_index_es6_js_.h.div({ className }, data.item.icon, data.item.iconLabel);
        }
        /**
         * Create the class name for the command item icon.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the item icon.
         */
        createIconClass(data) {
            let name = 'lm-CommandPalette-itemIcon';
            return classes(LabIconStyle.styleClass({
                stylesheet: 'commandPaletteItem'
            }), data.item.iconClass, name);
        }
    }
    CommandPaletteSvg.Renderer = Renderer;
    CommandPaletteSvg.defaultRenderer = new Renderer();
})(CommandPaletteSvg || (CommandPaletteSvg = {}));
//# sourceMappingURL=commandpalettesvg.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/icon/widgets/menusvg.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






const submenuIcon = caretRightIcon.bindprops({
    stylesheet: 'menuItem'
});
/**
 * An object which implements a universal context menu.
 * Tweaked to use inline svg icons
 */
class ContextMenuSvg extends dist_index_es6_js_.ContextMenu {
    /**
     * Construct a new context menu.
     *
     * @param options - The options for initializing the menu.
     */
    constructor(options) {
        super(options);
        this._isDisposed = false;
        this._opened = new index_es6_js_.Signal(this);
        // override the vanilla .menu
        this.menu = new MenuSvg(options);
    }
    /**
     * Test whether the context menu is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * A signal fired when the context menu is opened.
     */
    get opened() {
        return this._opened;
    }
    /**
     * Dispose of the resources held by the context menu.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this.menu.dispose();
        index_es6_js_.Signal.disconnectSender(this);
    }
    /**
     * Open the context menu in response to a `'contextmenu'` event.
     *
     * @param event - The `'contextmenu'` event of interest.
     *
     * @returns `true` if the menu was opened, or `false` if no items
     *   matched the event and the menu was not opened.
     *
     * #### Notes
     * This method will populate the context menu with items which match
     * the propagation path of the event, then open the menu at the mouse
     * position indicated by the event.
     */
    open(event) {
        if (this._isDisposed) {
            return false;
        }
        const hasItems = super.open(event);
        if (hasItems) {
            this._opened.emit();
        }
        return hasItems;
    }
}
/**
 * a widget which displays items as a canonical menu.
 * Tweaked to use inline svg icons
 */
class MenuSvg extends dist_index_es6_js_.Menu {
    /**
     * construct a new menu. Overrides the default renderer
     *
     * @param options - The options for initializing the tab bar.
     */
    constructor(options) {
        options.renderer = options.renderer || MenuSvg.defaultRenderer;
        super(options);
        this.addClass('jp-ThemedContainer');
    }
    /**
     * insert a menu item into the menu at the specified index. Replaces the
     * default renderer for submenus
     *
     * @param index - The index at which to insert the item.
     *
     * @param options - The options for creating the menu item.
     *
     * @returns The menu item added to the menu.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     */
    insertItem(index, options) {
        if (options.submenu) {
            MenuSvg.overrideDefaultRenderer(options.submenu);
        }
        return super.insertItem(index, options);
    }
}
(function (MenuSvg) {
    function overrideDefaultRenderer(menu) {
        // override renderer, if needed
        if (menu.renderer === dist_index_es6_js_.Menu.defaultRenderer) {
            // cast away readonly on menu.renderer
            menu.renderer = MenuSvg.defaultRenderer;
        }
        // ensure correct renderer on any submenus that get added in the future
        const originalInsertItem = menu.insertItem.bind(menu);
        menu.insertItem = (index, options) => {
            if (options.submenu) {
                MenuSvg.overrideDefaultRenderer(options.submenu);
            }
            return originalInsertItem(index, options);
        };
        // recurse through submenus
        for (const item of menu._items) {
            if (item.submenu) {
                overrideDefaultRenderer(item.submenu);
            }
        }
    }
    MenuSvg.overrideDefaultRenderer = overrideDefaultRenderer;
    /**
     * a modified implementation of the Menu Renderer
     */
    class Renderer extends dist_index_es6_js_.Menu.Renderer {
        /**
         * Render the icon element for a menu item.
         *
         * @param data - The data to use for rendering the icon.
         *
         * @returns A virtual element representing the item icon.
         */
        renderIcon(data) {
            const className = this.createIconClass(data);
            if (data.item.isToggled) {
                // check mark icon takes precedence
                return virtualdom_dist_index_es6_js_.h.div({ className }, checkIcon, data.item.iconLabel);
            }
            // if data.item.icon is undefined, it will be ignored
            return virtualdom_dist_index_es6_js_.h.div({ className }, data.item.icon, data.item.iconLabel);
        }
        /**
         * Create the class name for the menu item icon.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the item icon.
         */
        createIconClass(data) {
            let name = 'lm-Menu-itemIcon';
            if (data.item.type === 'separator') {
                return classes(data.item.iconClass, name);
            }
            else {
                return classes(LabIconStyle.styleClass({ stylesheet: 'menuItem' }), data.item.iconClass, name);
            }
        }
        /**
         * Render the submenu icon element for a menu item.
         *
         * @param data - The data to use for rendering the submenu icon.
         *
         * @returns A virtual element representing the submenu icon.
         */
        renderSubmenu(data) {
            const className = 'lm-Menu-itemSubmenuIcon';
            if (data.item.type === 'submenu') {
                return virtualdom_dist_index_es6_js_.h.div({ className }, submenuIcon);
            }
            else {
                return virtualdom_dist_index_es6_js_.h.div({ className });
            }
        }
    }
    MenuSvg.Renderer = Renderer;
    MenuSvg.defaultRenderer = new Renderer();
})(MenuSvg || (MenuSvg = {}));
//# sourceMappingURL=menusvg.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/icon/widgets/tabbarsvg.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.






/**
 * a widget which displays titles as a single row or column of tabs.
 * Tweaked to use an inline svg as the close icon
 */
class TabBarSvg extends dist_index_es6_js_.TabBar {
    /**
     * Construct a new tab bar. Overrides the default renderer.
     *
     * @param options - The options for initializing the tab bar.
     */
    constructor(options = {}) {
        var _a;
        super({ renderer: TabBarSvg.defaultRenderer, ...options });
        const trans = ((_a = TabBarSvg.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
        addIcon.element({
            container: this.addButtonNode,
            title: trans.__('New Launcher')
        });
    }
}
/**
 * Translator object
 */
TabBarSvg.translator = null;
(function (TabBarSvg) {
    /**
     * A modified implementation of the TabBar Renderer.
     */
    class Renderer extends dist_index_es6_js_.TabBar.Renderer {
        /**
         * Render the close icon element for a tab.
         *
         * @param data - The data to use for rendering the tab.
         *
         * @returns A virtual element representing the tab close icon.
         */
        renderCloseIcon(data) {
            var _a;
            const trans = ((_a = TabBarSvg.translator) !== null && _a !== void 0 ? _a : translation_lib_index_js_.nullTranslator).load('jupyterlab');
            const title = data.title.label
                ? trans.__('Close %1', data.title.label)
                : trans.__('Close tab');
            const className = classes('jp-icon-hover lm-TabBar-tabCloseIcon', LabIconStyle.styleClass({
                elementPosition: 'center',
                height: '16px',
                width: '16px'
            }));
            return (0,virtualdom_dist_index_es6_js_.hpass)('div', { className, title }, closeIcon);
        }
    }
    TabBarSvg.Renderer = Renderer;
    TabBarSvg.defaultRenderer = new Renderer();
})(TabBarSvg || (TabBarSvg = {}));
/**
 * a widget which provides a flexible docking area for widgets.
 * Tweaked to use an inline svg as the close icon
 */
class DockPanelSvg extends dist_index_es6_js_.DockPanel {
    /**
     * Construct a new dock panel.
     *
     * @param options - The options for initializing the panel.
     */
    constructor(options = {}) {
        super({
            renderer: DockPanelSvg.defaultRenderer,
            ...options
        });
    }
}
(function (DockPanelSvg) {
    /**
     * A modified implementation of the DockPanel Renderer.
     */
    class Renderer extends dist_index_es6_js_.DockPanel.Renderer {
        /**
         * Create a new tab bar (with inline svg icons enabled
         * for use with a dock panel.
         *
         * @returns A new tab bar for a dock panel.
         */
        createTabBar() {
            const bar = new TabBarSvg();
            bar.addClass('lm-DockPanel-tabBar');
            return bar;
        }
    }
    DockPanelSvg.Renderer = Renderer;
    DockPanelSvg.defaultRenderer = new Renderer();
})(DockPanelSvg || (DockPanelSvg = {}));
/**
 * A widget which combines a `TabBar` and a `StackedPanel`.
 * Tweaked to use an inline svg as the close icon
 */
class TabPanelSvg extends dist_index_es6_js_.TabPanel {
    /**
     * Construct a new tab panel.
     *
     * @param options - The options for initializing the tab panel.
     */
    constructor(options = {}) {
        options.renderer = options.renderer || TabBarSvg.defaultRenderer;
        super(options);
    }
}
//# sourceMappingURL=tabbarsvg.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/icon/widgets/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/icon/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.



//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/hoverbox.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * The class name added to all hover boxes.
 */
const HOVERBOX_CLASS = 'jp-HoverBox';
/**
 * The z-index used to hide hovering node that is scrolled out of view.
 */
const OUTOFVIEW_Z_INDEX = '-1000';
/**
 * A namespace for `HoverBox` members.
 */
var HoverBox;
(function (HoverBox) {
    /**
     * Set the visible dimensions of a hovering box anchored to an editor cursor.
     *
     * @param options - The hover box geometry calculation options.
     */
    function setGeometry(options) {
        const { anchor, host, node, privilege, outOfViewDisplay } = options;
        const hostRect = host.getBoundingClientRect();
        // Add hover box class if it does not exist.
        if (!node.classList.contains(HOVERBOX_CLASS)) {
            node.classList.add(HOVERBOX_CLASS);
        }
        // Start with the node displayed as if it was in view.
        if (node.style.visibility) {
            node.style.visibility = '';
        }
        if (node.style.zIndex === '') {
            node.style.zIndex = '';
        }
        // Clear any previously set max-height.
        node.style.maxHeight = '';
        // Clear any programmatically set margin-top.
        node.style.marginTop = '';
        const style = options.style || window.getComputedStyle(node);
        const spaceAbove = anchor.top - hostRect.top;
        const spaceBelow = hostRect.bottom - anchor.bottom;
        const marginTop = parseInt(style.marginTop, 10) || 0;
        const marginLeft = parseInt(style.marginLeft, 10) || 0;
        const minHeight = parseInt(style.minHeight, 10) || options.minHeight;
        let maxHeight = parseInt(style.maxHeight, 10) || options.maxHeight;
        // Determine whether to render above or below; check privilege.
        const renderBelow = privilege === 'forceAbove'
            ? false
            : privilege === 'forceBelow'
                ? true
                : privilege === 'above'
                    ? spaceAbove < maxHeight && spaceAbove < spaceBelow
                    : spaceBelow >= maxHeight || spaceBelow >= spaceAbove;
        if (renderBelow) {
            maxHeight = Math.min(spaceBelow - marginTop, maxHeight);
        }
        else {
            maxHeight = Math.min(spaceAbove, maxHeight);
            // If the box renders above the text, its top margin is irrelevant.
            node.style.marginTop = '0px';
        }
        node.style.maxHeight = `${maxHeight}px`;
        // Make sure the box ought to be visible.
        const withinBounds = maxHeight >= minHeight &&
            (spaceBelow >= minHeight || spaceAbove >= minHeight);
        if (!withinBounds) {
            node.style.zIndex = OUTOFVIEW_Z_INDEX;
            node.style.visibility = 'hidden';
            return;
        }
        if (options.size) {
            node.style.width = `${options.size.width}px`;
            node.style.height = `${options.size.height}px`;
            node.style.contain = 'strict';
        }
        else {
            node.style.contain = '';
            node.style.width = 'auto';
            node.style.height = '';
        }
        // Position the box vertically.
        const initialHeight = options.size
            ? options.size.height
            : node.getBoundingClientRect().height;
        const offsetAbove = (options.offset &&
            options.offset.vertical &&
            options.offset.vertical.above) ||
            0;
        const offsetBelow = (options.offset &&
            options.offset.vertical &&
            options.offset.vertical.below) ||
            0;
        let top = renderBelow
            ? hostRect.bottom - spaceBelow + offsetBelow
            : hostRect.top + spaceAbove - initialHeight + offsetAbove;
        node.style.top = `${Math.floor(top)}px`;
        // Position the box horizontally.
        const offsetHorizontal = (options.offset && options.offset.horizontal) || 0;
        let left = anchor.left + offsetHorizontal;
        node.style.left = `${Math.ceil(left)}px`;
        let rect = node.getBoundingClientRect();
        // Move left to fit in the window.
        let right = rect.right;
        if (right > window.innerWidth) {
            left -= right - window.innerWidth;
            right = window.innerWidth;
            node.style.left = `${Math.ceil(left)}px`;
        }
        // Move right to fit in the window
        if (left < offsetHorizontal - marginLeft) {
            left = offsetHorizontal - marginLeft;
            node.style.left = `${Math.ceil(left)}px`;
        }
        // Hide the hover box before querying the DOM for the anchor coordinates.
        // Using z-index set directly for performance.
        node.style.zIndex = '-1000';
        const bottom = rect.bottom;
        const includesLeftTop = host.contains(document.elementFromPoint(left, top));
        const includesRightTop = host.contains(document.elementFromPoint(right, top));
        const includesRightBottom = host.contains(document.elementFromPoint(right, bottom));
        const includesLeftBottom = host.contains(document.elementFromPoint(left, bottom));
        node.style.zIndex = '';
        const topEdgeInside = includesLeftTop || includesRightTop;
        const bottomEdgeInside = includesLeftBottom || includesRightBottom;
        const leftEdgeInside = includesLeftTop || includesLeftBottom;
        const rightEdgeInside = includesRightBottom || includesRightTop;
        const height = bottom - top;
        const width = right - left;
        const overTheTop = top < hostRect.top;
        const belowTheBottom = bottom > hostRect.bottom;
        const beforeTheLeft = left + marginLeft < hostRect.left;
        const afterTheRight = right > hostRect.right;
        let hide = false;
        let leftChanged = false;
        let topChanged = false;
        if (overTheTop) {
            switch ((outOfViewDisplay === null || outOfViewDisplay === void 0 ? void 0 : outOfViewDisplay.top) || 'hidden-inside') {
                case 'hidden-inside':
                    if (!topEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'hidden-outside':
                    if (!bottomEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'stick-inside':
                    if (hostRect.top > top) {
                        top = hostRect.top;
                        topChanged = true;
                    }
                    break;
                case 'stick-outside':
                    if (hostRect.top > bottom) {
                        top = hostRect.top - height;
                        topChanged = true;
                    }
                    break;
            }
        }
        if (belowTheBottom) {
            switch ((outOfViewDisplay === null || outOfViewDisplay === void 0 ? void 0 : outOfViewDisplay.bottom) || 'hidden-outside') {
                case 'hidden-inside':
                    if (!bottomEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'hidden-outside':
                    if (!topEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'stick-inside':
                    if (hostRect.bottom < bottom) {
                        top = hostRect.bottom - height;
                        topChanged = true;
                    }
                    break;
                case 'stick-outside':
                    if (hostRect.bottom < top) {
                        top = hostRect.bottom;
                        topChanged = true;
                    }
                    break;
            }
        }
        if (beforeTheLeft) {
            switch ((outOfViewDisplay === null || outOfViewDisplay === void 0 ? void 0 : outOfViewDisplay.left) || 'hidden-inside') {
                case 'hidden-inside':
                    if (!leftEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'hidden-outside':
                    if (!rightEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'stick-inside':
                    if (hostRect.left > left + marginLeft) {
                        left = hostRect.left - marginLeft;
                        leftChanged = true;
                    }
                    break;
                case 'stick-outside':
                    if (hostRect.left > right) {
                        left = hostRect.left - marginLeft - width;
                        leftChanged = true;
                    }
                    break;
            }
        }
        if (afterTheRight) {
            switch ((outOfViewDisplay === null || outOfViewDisplay === void 0 ? void 0 : outOfViewDisplay.right) || 'hidden-outside') {
                case 'hidden-inside':
                    if (!rightEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'hidden-outside':
                    if (!leftEdgeInside) {
                        hide = true;
                    }
                    break;
                case 'stick-inside':
                    if (hostRect.right < right) {
                        left = hostRect.right - width;
                        leftChanged = true;
                    }
                    break;
                case 'stick-outside':
                    if (hostRect.right < left) {
                        left = hostRect.right;
                        leftChanged = true;
                    }
                    break;
            }
        }
        if (hide) {
            node.style.zIndex = OUTOFVIEW_Z_INDEX;
            node.style.visibility = 'hidden';
        }
        if (leftChanged) {
            node.style.left = `${Math.ceil(left)}px`;
        }
        if (topChanged) {
            node.style.top = `${Math.ceil(top)}px`;
        }
    }
    HoverBox.setGeometry = setGeometry;
})(HoverBox || (HoverBox = {}));
//# sourceMappingURL=hoverbox.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The token for the form component registry.
 */
const IFormRendererRegistry = new dist_index_js_.Token('@jupyterlab/ui-components:IFormRendererRegistry', 'A service for settings form renderer registration.');
/**
 * The ILabIconManager token.
 */
const ILabIconManager = new dist_index_js_.Token('@jupyterlab/ui-components:ILabIconManager', 'A service to register and request icons.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/FormRendererRegistry.js
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * A registry for property renderers used in the FormEditor component.
 */
class FormRendererRegistry {
    constructor() {
        this._renderers = {};
    }
    /**
     * Adds a renderer for a given property of a given settings plugin.
     *
     * The id must follow that structure `<ISettingRegistry.IPlugin.id>.<propertyName>`
     *
     * @param id - Unique ID for the given renderer.
     * @param renderer - A renderer interfacing IFormRenderer.
     */
    addRenderer(id, renderer) {
        if (this._renderers[id]) {
            throw new Error(`A renderer with id '${id}' is already registered.`);
        }
        if (!renderer.fieldRenderer && !renderer.widgetRenderer) {
            throw new Error(`The component for '${id}' cannot be registered as it does not define 'fieldRenderer' nor 'widgetRenderer'.`);
        }
        const splitPosition = id.lastIndexOf('.');
        const pluginId = id.substring(0, splitPosition);
        const propertyName = id.substring(splitPosition + 1);
        if (pluginId.length == 0 || propertyName.length == 0) {
            throw new Error(`Form renderer id must follows the structure '<ISettingRegistry.IPlugin.id>.<propertyName>'; got ${id}.`);
        }
        this._renderers[id] = renderer;
    }
    /**
     * Returns all registered renderers in dictionary form.
     * @returns - A dictionary that maps an id to a renderer.
     */
    get renderers() {
        return this._renderers;
    }
    /**
     * Returns the renderer for the given id
     * @param id - The unique id for the renderer.
     * @returns - A renderer interfacing IFormRenderer.
     */
    getRenderer(id) {
        return this._renderers[id];
    }
}
//# sourceMappingURL=FormRendererRegistry.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module ui-components
 */






//# sourceMappingURL=index.js.map

/***/ }),

/***/ 26238:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/ui-components/style/base.css
var base = __webpack_require__(56620);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/ui-components/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 16061:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RenderedVega: () => (/* binding */ RenderedVega),
/* harmony export */   VEGALITE3_MIME_TYPE: () => (/* binding */ VEGALITE3_MIME_TYPE),
/* harmony export */   VEGALITE4_MIME_TYPE: () => (/* binding */ VEGALITE4_MIME_TYPE),
/* harmony export */   VEGALITE5_MIME_TYPE: () => (/* binding */ VEGALITE5_MIME_TYPE),
/* harmony export */   VEGA_MIME_TYPE: () => (/* binding */ VEGA_MIME_TYPE),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   rendererFactory: () => (/* binding */ rendererFactory)
/* harmony export */ });
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_0__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module vega5-extension
 */

/**
 * The CSS class to add to the Vega and Vega-Lite widget.
 */
const VEGA_COMMON_CLASS = 'jp-RenderedVegaCommon5';
/**
 * The CSS class to add to the Vega.
 */
const VEGA_CLASS = 'jp-RenderedVega5';
/**
 * The CSS class to add to the Vega-Lite.
 */
const VEGALITE_CLASS = 'jp-RenderedVegaLite';
/**
 * The MIME type for Vega.
 *
 * #### Notes
 * The version of this follows the major version of Vega.
 */
const VEGA_MIME_TYPE = 'application/vnd.vega.v5+json';
/**
 * The MIME type for Vega-Lite.
 *
 * #### Notes
 * The version of this follows the major version of Vega-Lite.
 */
const VEGALITE3_MIME_TYPE = 'application/vnd.vegalite.v3+json';
/**
 * The MIME type for Vega-Lite.
 *
 * #### Notes
 * The version of this follows the major version of Vega-Lite.
 */
const VEGALITE4_MIME_TYPE = 'application/vnd.vegalite.v4+json';
/**
 * The MIME type for Vega-Lite.
 *
 * #### Notes
 * The version of this follows the major version of Vega-Lite.
 */
const VEGALITE5_MIME_TYPE = 'application/vnd.vegalite.v5+json';
/**
 * A widget for rendering Vega or Vega-Lite data, for usage with rendermime.
 */
class RenderedVega extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_0__.Widget {
    /**
     * Create a new widget for rendering Vega/Vega-Lite.
     */
    constructor(options) {
        super();
        this._mimeType = options.mimeType;
        this._resolver = options.resolver;
        this.addClass(VEGA_COMMON_CLASS);
        this.addClass(this._mimeType === VEGA_MIME_TYPE ? VEGA_CLASS : VEGALITE_CLASS);
    }
    /**
     * Render Vega/Vega-Lite into this widget's node.
     */
    async renderModel(model) {
        const spec = model.data[this._mimeType];
        if (spec === undefined) {
            return;
        }
        const metadata = model.metadata[this._mimeType];
        const embedOptions = metadata && metadata.embed_options ? metadata.embed_options : {};
        // If the JupyterLab theme is dark, render this using a dark Vega theme.
        let bodyThemeDark = document.body.dataset.jpThemeLight === 'false';
        if (bodyThemeDark) {
            embedOptions.theme = 'dark';
        }
        const mode = this._mimeType === VEGA_MIME_TYPE ? 'vega' : 'vega-lite';
        const vega = Private.vega != null ? Private.vega : await Private.ensureVega();
        const el = document.createElement('div');
        // clear the output before attaching a chart
        this.node.textContent = '';
        this.node.appendChild(el);
        if (this._result) {
            this._result.finalize();
        }
        const loader = vega.vega.loader({
            http: { credentials: 'same-origin' }
        });
        const sanitize = async (uri, options) => {
            // Use the resolver for any URIs it wants to handle
            const resolver = this._resolver;
            if ((resolver === null || resolver === void 0 ? void 0 : resolver.isLocal) && resolver.isLocal(uri)) {
                const absPath = await resolver.resolveUrl(uri);
                uri = await resolver.getDownloadUrl(absPath);
            }
            return loader.sanitize(uri, options);
        };
        this._result = await vega.default(el, spec, {
            actions: true,
            defaultStyle: true,
            ...embedOptions,
            mode,
            loader: { ...loader, sanitize }
        });
        if (model.data['image/png']) {
            return;
        }
        // Add png representation of vega chart to output
        const imageURL = await this._result.view.toImageURL('png', typeof embedOptions.scaleFactor === 'number'
            ? embedOptions.scaleFactor
            : embedOptions.scaleFactor
                ? embedOptions.scaleFactor.png
                : embedOptions.scaleFactor);
        model.setData({
            data: { ...model.data, 'image/png': imageURL.split(',')[1] }
        });
    }
    dispose() {
        if (this._result) {
            this._result.finalize();
        }
        super.dispose();
    }
}
/**
 * A mime renderer factory for vega data.
 */
const rendererFactory = {
    safe: true,
    mimeTypes: [
        VEGA_MIME_TYPE,
        VEGALITE3_MIME_TYPE,
        VEGALITE4_MIME_TYPE,
        VEGALITE5_MIME_TYPE
    ],
    createRenderer: options => new RenderedVega(options)
};
const extension = {
    id: '@jupyterlab/vega5-extension:factory',
    description: 'Provides a renderer for Vega 5 and Vega-Lite 3 to 5 content.',
    rendererFactory,
    rank: 57,
    dataType: 'json',
    documentWidgetFactoryOptions: [
        {
            name: 'Vega5',
            primaryFileType: 'vega5',
            fileTypes: ['vega5', 'json'],
            defaultFor: ['vega5']
        },
        {
            name: 'Vega-Lite5',
            primaryFileType: 'vega-lite5',
            fileTypes: ['vega-lite3', 'vega-lite4', 'vega-lite5', 'json'],
            defaultFor: ['vega-lite3', 'vega-lite4', 'vega-lite5']
        }
    ],
    fileTypes: [
        {
            mimeTypes: [VEGA_MIME_TYPE],
            name: 'vega5',
            extensions: ['.vg', '.vg.json', '.vega'],
            icon: 'ui-components:vega'
        },
        {
            mimeTypes: [VEGALITE5_MIME_TYPE],
            name: 'vega-lite5',
            extensions: ['.vl', '.vl.json', '.vegalite'],
            icon: 'ui-components:vega'
        },
        {
            mimeTypes: [VEGALITE4_MIME_TYPE],
            name: 'vega-lite4',
            extensions: [],
            icon: 'ui-components:vega'
        },
        {
            mimeTypes: [VEGALITE3_MIME_TYPE],
            name: 'vega-lite3',
            extensions: [],
            icon: 'ui-components:vega'
        }
    ]
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (extension);
/**
 * A namespace for private module data.
 */
var Private;
(function (Private) {
    /**
     * Lazy-load and cache the vega-embed library
     */
    function ensureVega() {
        if (Private.vegaReady) {
            return Private.vegaReady;
        }
        Private.vegaReady = Promise.all(/* import() */[__webpack_require__.e(6577), __webpack_require__.e(5114)]).then(__webpack_require__.bind(__webpack_require__, 5114));
        return Private.vegaReady;
    }
    Private.ensureVega = ensureVega;
})(Private || (Private = {}));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 40745:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/vega5-extension/style/base.css
var base = __webpack_require__(47611);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/vega5-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/vega5-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */





/***/ }),

/***/ 62559:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   VideoDocumentWidget: () => (/* binding */ VideoDocumentWidget),
/* harmony export */   VideoViewer: () => (/* binding */ VideoViewer),
/* harmony export */   VideoViewerFactory: () => (/* binding */ VideoViewerFactory),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56732);
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40124);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34992);
/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37253);
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17968);
/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_5__);
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module video-extension
 */






/**
 * The class name added to a video viewer.
 */
const VIDEO_CLASS = 'jp-VideoViewer';
/**
 * The name of the factory that creates video widgets.
 */
const FACTORY_VIDEO = 'VideoViewer';
/**
 * Content provider ID for video streaming
 */
const VIDEO_CONTENT_PROVIDER_ID = 'video-provider';
/**
 * Get video file types from the document registry
 */
function getVideoFileTypes(docRegistry) {
    const videoFileTypes = [];
    // Find all video file types
    for (const fileType of docRegistry.fileTypes()) {
        if (fileType.mimeTypes.some(mimeType => mimeType.startsWith('video/'))) {
            videoFileTypes.push(fileType.name);
        }
    }
    return videoFileTypes;
}
/**
 * A video viewer widget.
 */
class VideoViewer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_5__.Widget {
    /**
     * Construct a new video viewer widget.
     */
    constructor(options) {
        super();
        this.addClass(VIDEO_CLASS);
        this._context = options.context;
        this._contentsManager = options.contentsManager;
        this._video = document.createElement('video');
        this._video.controls = true;
        this.node.appendChild(this._video);
        void this._context.ready.then(() => {
            void this._updateVideo();
        });
        this._context.model.contentChanged.connect(this._updateVideo, this);
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
    }
    /**
     * Handle `resize` messages for the widget.
     */
    onResize(msg) {
        super.onResize(msg);
        if (this._video) {
            this._video.style.width = '100%';
            this._video.style.height = '100%';
        }
    }
    /**
     * Update the video source.
     */
    async _updateVideo() {
        // Use getDownloadUrl for proper URL encoding and security tokens
        const videoUrl = await this._contentsManager.getDownloadUrl(this._context.path);
        this._video.src = videoUrl;
    }
}
/**
 * A document widget for videos.
 */
class VideoDocumentWidget extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__.DocumentWidget {
    constructor(options) {
        super(options);
    }
}
/**
 * A widget factory for video viewers.
 */
class VideoViewerFactory extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__.ABCWidgetFactory {
    /**
     * Construct a new video viewer factory.
     */
    constructor(options) {
        super(options);
        this._contentsManager = options.contentsManager;
    }
    /**
     * Create a new widget given a context.
     */
    createNewWidget(context) {
        const content = new VideoViewer({
            context,
            contentsManager: this._contentsManager
        });
        const widget = new VideoDocumentWidget({
            content,
            context
        });
        return widget;
    }
}
/**
 * A content provider for video files.
 *
 * This overrides the default behavior of the RestContentProvider to not include the file content.
 */
class VideoContentProvider extends _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__.RestContentProvider {
    constructor(options) {
        super(options);
    }
    /**
     * Get a file or directory.
     *
     * @param localPath - The path to the file.
     * @param options - The options used to fetch the file.
     *
     * @returns A promise which resolves with the file content.
     */
    async get(localPath, options) {
        return super.get(localPath, { ...options, content: false });
    }
}
/**
 * The video extension.
 */
const plugin = {
    id: '@jupyterlab/video-extension:plugin',
    description: 'Adds a viewer for video files',
    autoStart: true,
    requires: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.ITranslator, _jupyterlab_services__WEBPACK_IMPORTED_MODULE_3__.IDefaultDrive],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
    activate: (app, translator, defaultDrive, restorer) => {
        const trans = translator.load('jupyterlab');
        const { contents, serverSettings } = app.serviceManager;
        // Get video file types from the document registry
        const videoFileTypes = getVideoFileTypes(app.docRegistry);
        // Register the video stream content provider once
        const registry = defaultDrive.contentProviderRegistry;
        if (registry) {
            const videoContentProvider = new VideoContentProvider({
                apiEndpoint: '/api/contents',
                serverSettings
            });
            registry.register(VIDEO_CONTENT_PROVIDER_ID, videoContentProvider);
        }
        // Create tracker for all video widgets
        const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
            namespace: 'videoviewer'
        });
        // Create single factory for all video types
        const factory = new VideoViewerFactory({
            name: FACTORY_VIDEO,
            label: trans.__('Video Viewer'),
            fileTypes: videoFileTypes,
            defaultFor: videoFileTypes,
            readOnly: true,
            translator,
            modelName: 'base64',
            contentProviderId: VIDEO_CONTENT_PROVIDER_ID,
            contentsManager: contents
        });
        app.docRegistry.addWidgetFactory(factory);
        factory.widgetCreated.connect(async (sender, widget) => {
            // Track the widget
            void tracker.add(widget);
            // Notify the widget tracker if restore data needs to update
            widget.context.pathChanged.connect(() => {
                void tracker.save(widget);
            });
            // Set appropriate icon based on file type from document registry
            const fileTypes = app.docRegistry.getFileTypesForPath(widget.context.path);
            const videoFileType = fileTypes.find(ft => ft.mimeTypes.some(mimeType => mimeType.startsWith('video/')));
            if (videoFileType) {
                widget.title.icon = videoFileType.icon;
                widget.title.iconClass = videoFileType.iconClass || '';
                widget.title.iconLabel = videoFileType.iconLabel || '';
            }
        });
        if (restorer) {
            // Handle state restoration for all video types
            void restorer.restore(tracker, {
                command: 'docmanager:open',
                args: widget => ({
                    path: widget.context.path,
                    factory: FACTORY_VIDEO
                }),
                name: widget => widget.context.path
            });
        }
    }
};
/**
 * Export the plugin as default.
 */
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 28437:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@lumino/widgets/style/index.js + 1 modules
var style = __webpack_require__(20959);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/apputils/style/index.js + 1 modules
var apputils_style = __webpack_require__(57261);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/docregistry/style/index.js + 1 modules
var docregistry_style = __webpack_require__(30507);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/application/style/index.js + 1 modules
var application_style = __webpack_require__(67663);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@jupyterlab/video-extension/style/base.css
var base = __webpack_require__(61163);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/video-extension/style/base.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(base/* default */.Z, options);




       /* harmony default export */ const style_base = (base/* default */.Z && base/* default */.Z.locals ? base/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@jupyterlab/video-extension/style/index.js
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */








/***/ }),

/***/ 11828:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  IWorkspaceCommands: () => (/* reexport */ IWorkspaceCommands),
  IWorkspacesModel: () => (/* reexport */ IWorkspacesModel),
  WorkspacesModel: () => (/* reexport */ WorkspacesModel)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/polling@^2.1.5 (strict) (fallback: ../node_modules/@lumino/polling/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(75205);
// EXTERNAL MODULE: consume shared module (default) @lumino/signaling@~2.1.5 (singleton) (fallback: ../node_modules/@lumino/signaling/dist/index.es6.js)
var dist_index_es6_js_ = __webpack_require__(46257);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/workspaces/lib/model.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */


/**
 * The default duration of the auto-refresh in ms
 */
const DEFAULT_REFRESH_INTERVAL = 10000;
/**
 * An implementation of a workspaces model.
 */
class WorkspacesModel {
    constructor(options) {
        var _a;
        this._refreshed = new dist_index_es6_js_.Signal(this);
        this._isDisposed = false;
        this._workspaceData = {
            ids: [],
            values: []
        };
        this._manager = options.manager;
        const refreshInterval = options.refreshInterval || DEFAULT_REFRESH_INTERVAL;
        this._poll = new index_es6_js_.Poll({
            auto: (_a = options.auto) !== null && _a !== void 0 ? _a : true,
            name: '@jupyterlab/workspaces:Model',
            factory: () => this._fetchList(),
            frequency: {
                interval: refreshInterval,
                backoff: true,
                max: 300 * 1000
            },
            standby: options.refreshStandby || 'when-hidden'
        });
    }
    /**
     * The list of available workspaces.
     */
    get workspaces() {
        return this._workspaceData.values;
    }
    /**
     * The list of workspace identifiers.
     */
    get identifiers() {
        return this._workspaceData.ids;
    }
    /**
     * Create an empty workspace.
     */
    async create(workspaceId) {
        await this._manager.save(workspaceId, {
            metadata: { id: workspaceId },
            data: {}
        });
        await this.refresh();
    }
    /**
     * A signal emitted when the workspaces list is refreshed.
     */
    get refreshed() {
        return this._refreshed;
    }
    /**
     * Force a refresh of the workspaces list.
     */
    async refresh() {
        await this._poll.refresh();
        await this._poll.tick;
    }
    /**
     * Rename a workspace.
     */
    async rename(workspaceId, newName) {
        const workspace = await this._manager.fetch(workspaceId);
        workspace.metadata.id = newName;
        await this._manager.save(newName, workspace);
        await this._manager.remove(workspaceId);
        await this.refresh();
    }
    /**
     * Reset a workspace.
     */
    async reset(workspaceId) {
        const workspace = await this._manager.fetch(workspaceId);
        workspace.data = {};
        await this._manager.save(workspaceId, workspace);
        await this.refresh();
    }
    /**
     * Remove a workspace.
     */
    async remove(workspaceId) {
        await this._manager.remove(workspaceId);
        await this.refresh();
    }
    /**
     * Save workspace under a different name.
     */
    async saveAs(workspaceId, newName) {
        const data = await this._manager.fetch(workspaceId);
        data.metadata.id = newName;
        await this._manager.save(newName, data);
        await this.refresh();
    }
    /**
     * Get whether the model is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the model.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._poll.dispose();
        dist_index_es6_js_.Signal.clearData(this);
    }
    async _fetchList() {
        this._workspaceData = await this._manager.list();
        this._refreshed.emit(void 0);
    }
}
//# sourceMappingURL=model.js.map
// EXTERNAL MODULE: consume shared module (default) @lumino/coreutils@~2.2.2 (singleton) (fallback: ../node_modules/@lumino/coreutils/dist/index.js)
var index_js_ = __webpack_require__(72215);
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/workspaces/lib/tokens.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

/**
 * The token that provides the identifiers of workspace commands for reuse.
 */
const IWorkspaceCommands = new index_js_.Token('@jupyterlab/workspaces:IWorkspaceCommands', 'Provides identifiers of workspace commands.');
/**
 * The token that provides the identifiers of workspace commands for reuse.
 */
const IWorkspacesModel = new index_js_.Token('@jupyterlab/workspaces:IWorkspacesModel', 'Provides a model for available workspaces.');
//# sourceMappingURL=tokens.js.map
;// CONCATENATED MODULE: ../node_modules/@jupyterlab/workspaces/lib/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * @packageDocumentation
 * @module workspaces
 */


//# sourceMappingURL=index.js.map

/***/ }),

/***/ 15614:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ArrayExt: () => (/* binding */ ArrayExt),
/* harmony export */   StringExt: () => (/* binding */ StringExt),
/* harmony export */   chain: () => (/* binding */ chain),
/* harmony export */   each: () => (/* binding */ each),
/* harmony export */   empty: () => (/* binding */ empty),
/* harmony export */   enumerate: () => (/* binding */ enumerate),
/* harmony export */   every: () => (/* binding */ every),
/* harmony export */   filter: () => (/* binding */ filter),
/* harmony export */   find: () => (/* binding */ find),
/* harmony export */   findIndex: () => (/* binding */ findIndex),
/* harmony export */   map: () => (/* binding */ map),
/* harmony export */   max: () => (/* binding */ max),
/* harmony export */   min: () => (/* binding */ min),
/* harmony export */   minmax: () => (/* binding */ minmax),
/* harmony export */   once: () => (/* binding */ once),
/* harmony export */   range: () => (/* binding */ range),
/* harmony export */   reduce: () => (/* binding */ reduce),
/* harmony export */   repeat: () => (/* binding */ repeat),
/* harmony export */   retro: () => (/* binding */ retro),
/* harmony export */   some: () => (/* binding */ some),
/* harmony export */   stride: () => (/* binding */ stride),
/* harmony export */   take: () => (/* binding */ take),
/* harmony export */   toArray: () => (/* binding */ toArray),
/* harmony export */   toObject: () => (/* binding */ toObject),
/* harmony export */   topologicSort: () => (/* binding */ topologicSort),
/* harmony export */   zip: () => (/* binding */ zip)
/* harmony export */ });
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * The namespace for array-specific algorithms.
 */
var ArrayExt;
(function (ArrayExt) {
    /**
     * Find the index of the first occurrence of a value in an array.
     *
     * @param array - The array-like object to search.
     *
     * @param value - The value to locate in the array. Values are
     *   compared using strict `===` equality.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the first occurrence of the value, or `-1`
     *   if the value is not found.
     *
     * #### Notes
     * If `stop < start` the search will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or `stop` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = ['one', 'two', 'three', 'four', 'one'];
     * ArrayExt.firstIndexOf(data, 'red');        // -1
     * ArrayExt.firstIndexOf(data, 'one');        // 0
     * ArrayExt.firstIndexOf(data, 'one', 1);     // 4
     * ArrayExt.firstIndexOf(data, 'two', 2);     // -1
     * ArrayExt.firstIndexOf(data, 'two', 2, 1);  // 1
     * ```
     */
    function firstIndexOf(array, value, start = 0, stop = -1) {
        let n = array.length;
        if (n === 0) {
            return -1;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let span;
        if (stop < start) {
            span = stop + 1 + (n - start);
        }
        else {
            span = stop - start + 1;
        }
        for (let i = 0; i < span; ++i) {
            let j = (start + i) % n;
            if (array[j] === value) {
                return j;
            }
        }
        return -1;
    }
    ArrayExt.firstIndexOf = firstIndexOf;
    /**
     * Find the index of the last occurrence of a value in an array.
     *
     * @param array - The array-like object to search.
     *
     * @param value - The value to locate in the array. Values are
     *   compared using strict `===` equality.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the last occurrence of the value, or `-1`
     *   if the value is not found.
     *
     * #### Notes
     * If `start < stop` the search will wrap at the front of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or `stop` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = ['one', 'two', 'three', 'four', 'one'];
     * ArrayExt.lastIndexOf(data, 'red');        // -1
     * ArrayExt.lastIndexOf(data, 'one');        // 4
     * ArrayExt.lastIndexOf(data, 'one', 1);     // 0
     * ArrayExt.lastIndexOf(data, 'two', 0);     // -1
     * ArrayExt.lastIndexOf(data, 'two', 0, 1);  // 1
     * ```
     */
    function lastIndexOf(array, value, start = -1, stop = 0) {
        let n = array.length;
        if (n === 0) {
            return -1;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let span;
        if (start < stop) {
            span = start + 1 + (n - stop);
        }
        else {
            span = start - stop + 1;
        }
        for (let i = 0; i < span; ++i) {
            let j = (start - i + n) % n;
            if (array[j] === value) {
                return j;
            }
        }
        return -1;
    }
    ArrayExt.lastIndexOf = lastIndexOf;
    /**
     * Find the index of the first value which matches a predicate.
     *
     * @param array - The array-like object to search.
     *
     * @param fn - The predicate function to apply to the values.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the first matching value, or `-1` if no
     *   matching value is found.
     *
     * #### Notes
     * If `stop < start` the search will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or `stop` which is non-integral.
     *
     * Modifying the length of the array while searching.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function isEven(value: number): boolean {
     *   return value % 2 === 0;
     * }
     *
     * let data = [1, 2, 3, 4, 3, 2, 1];
     * ArrayExt.findFirstIndex(data, isEven);       // 1
     * ArrayExt.findFirstIndex(data, isEven, 4);    // 5
     * ArrayExt.findFirstIndex(data, isEven, 6);    // -1
     * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1
     * ```
     */
    function findFirstIndex(array, fn, start = 0, stop = -1) {
        let n = array.length;
        if (n === 0) {
            return -1;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let span;
        if (stop < start) {
            span = stop + 1 + (n - start);
        }
        else {
            span = stop - start + 1;
        }
        for (let i = 0; i < span; ++i) {
            let j = (start + i) % n;
            if (fn(array[j], j)) {
                return j;
            }
        }
        return -1;
    }
    ArrayExt.findFirstIndex = findFirstIndex;
    /**
     * Find the index of the last value which matches a predicate.
     *
     * @param array - The array-like object to search.
     *
     * @param fn - The predicate function to apply to the values.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the last matching value, or `-1` if no
     *   matching value is found.
     *
     * #### Notes
     * If `start < stop` the search will wrap at the front of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or `stop` which is non-integral.
     *
     * Modifying the length of the array while searching.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function isEven(value: number): boolean {
     *   return value % 2 === 0;
     * }
     *
     * let data = [1, 2, 3, 4, 3, 2, 1];
     * ArrayExt.findLastIndex(data, isEven);        // 5
     * ArrayExt.findLastIndex(data, isEven, 4);     // 3
     * ArrayExt.findLastIndex(data, isEven, 0);     // -1
     * ArrayExt.findLastIndex(data, isEven, 0, 1);  // 5
     * ```
     */
    function findLastIndex(array, fn, start = -1, stop = 0) {
        let n = array.length;
        if (n === 0) {
            return -1;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let d;
        if (start < stop) {
            d = start + 1 + (n - stop);
        }
        else {
            d = start - stop + 1;
        }
        for (let i = 0; i < d; ++i) {
            let j = (start - i + n) % n;
            if (fn(array[j], j)) {
                return j;
            }
        }
        return -1;
    }
    ArrayExt.findLastIndex = findLastIndex;
    /**
     * Find the first value which matches a predicate.
     *
     * @param array - The array-like object to search.
     *
     * @param fn - The predicate function to apply to the values.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The first matching value, or `undefined` if no matching
     *   value is found.
     *
     * #### Notes
     * If `stop < start` the search will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or `stop` which is non-integral.
     *
     * Modifying the length of the array while searching.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function isEven(value: number): boolean {
     *   return value % 2 === 0;
     * }
     *
     * let data = [1, 2, 3, 4, 3, 2, 1];
     * ArrayExt.findFirstValue(data, isEven);       // 2
     * ArrayExt.findFirstValue(data, isEven, 2);    // 4
     * ArrayExt.findFirstValue(data, isEven, 6);    // undefined
     * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2
     * ```
     */
    function findFirstValue(array, fn, start = 0, stop = -1) {
        let index = findFirstIndex(array, fn, start, stop);
        return index !== -1 ? array[index] : undefined;
    }
    ArrayExt.findFirstValue = findFirstValue;
    /**
     * Find the last value which matches a predicate.
     *
     * @param object - The array-like object to search.
     *
     * @param fn - The predicate function to apply to the values.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The last matching value, or `undefined` if no matching
     *   value is found.
     *
     * #### Notes
     * If `start < stop` the search will wrap at the front of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or `stop` which is non-integral.
     *
     * Modifying the length of the array while searching.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function isEven(value: number): boolean {
     *   return value % 2 === 0;
     * }
     *
     * let data = [1, 2, 3, 4, 3, 2, 1];
     * ArrayExt.findLastValue(data, isEven);        // 2
     * ArrayExt.findLastValue(data, isEven, 4);     // 4
     * ArrayExt.findLastValue(data, isEven, 0);     // undefined
     * ArrayExt.findLastValue(data, isEven, 0, 1);  // 2
     * ```
     */
    function findLastValue(array, fn, start = -1, stop = 0) {
        let index = findLastIndex(array, fn, start, stop);
        return index !== -1 ? array[index] : undefined;
    }
    ArrayExt.findLastValue = findLastValue;
    /**
     * Find the index of the first element which compares `>=` to a value.
     *
     * @param array - The sorted array-like object to search.
     *
     * @param value - The value to locate in the array.
     *
     * @param fn - The 3-way comparison function to apply to the values.
     *   It should return `< 0` if an element is less than a value, `0` if
     *   an element is equal to a value, or `> 0` if an element is greater
     *   than a value.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the first element which compares `>=` to the
     *   value, or `length` if there is no such element. If the computed
     *   index for `stop` is less than `start`, then the computed index
     *   for `start` is returned.
     *
     * #### Notes
     * The array must already be sorted in ascending order according to
     * the comparison function.
     *
     * #### Complexity
     * Logarithmic.
     *
     * #### Undefined Behavior
     * Searching a range which is not sorted in ascending order.
     *
     * A `start` or `stop` which is non-integral.
     *
     * Modifying the length of the array while searching.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function numberCmp(a: number, b: number): number {
     *   return a - b;
     * }
     *
     * let data = [0, 3, 4, 7, 7, 9];
     * ArrayExt.lowerBound(data, 0, numberCmp);   // 0
     * ArrayExt.lowerBound(data, 6, numberCmp);   // 3
     * ArrayExt.lowerBound(data, 7, numberCmp);   // 3
     * ArrayExt.lowerBound(data, -1, numberCmp);  // 0
     * ArrayExt.lowerBound(data, 10, numberCmp);  // 6
     * ```
     */
    function lowerBound(array, value, fn, start = 0, stop = -1) {
        let n = array.length;
        if (n === 0) {
            return 0;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let begin = start;
        let span = stop - start + 1;
        while (span > 0) {
            let half = span >> 1;
            let middle = begin + half;
            if (fn(array[middle], value) < 0) {
                begin = middle + 1;
                span -= half + 1;
            }
            else {
                span = half;
            }
        }
        return begin;
    }
    ArrayExt.lowerBound = lowerBound;
    /**
     * Find the index of the first element which compares `>` than a value.
     *
     * @param array - The sorted array-like object to search.
     *
     * @param value - The value to locate in the array.
     *
     * @param fn - The 3-way comparison function to apply to the values.
     *   It should return `< 0` if an element is less than a value, `0` if
     *   an element is equal to a value, or `> 0` if an element is greater
     *   than a value.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the first element which compares `>` than the
     *   value, or `length` if there is no such element. If the computed
     *   index for `stop` is less than `start`, then the computed index
     *   for `start` is returned.
     *
     * #### Notes
     * The array must already be sorted in ascending order according to
     * the comparison function.
     *
     * #### Complexity
     * Logarithmic.
     *
     * #### Undefined Behavior
     * Searching a range which is not sorted in ascending order.
     *
     * A `start` or `stop` which is non-integral.
     *
     * Modifying the length of the array while searching.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function numberCmp(a: number, b: number): number {
     *   return a - b;
     * }
     *
     * let data = [0, 3, 4, 7, 7, 9];
     * ArrayExt.upperBound(data, 0, numberCmp);   // 1
     * ArrayExt.upperBound(data, 6, numberCmp);   // 3
     * ArrayExt.upperBound(data, 7, numberCmp);   // 5
     * ArrayExt.upperBound(data, -1, numberCmp);  // 0
     * ArrayExt.upperBound(data, 10, numberCmp);  // 6
     * ```
     */
    function upperBound(array, value, fn, start = 0, stop = -1) {
        let n = array.length;
        if (n === 0) {
            return 0;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let begin = start;
        let span = stop - start + 1;
        while (span > 0) {
            let half = span >> 1;
            let middle = begin + half;
            if (fn(array[middle], value) > 0) {
                span = half;
            }
            else {
                begin = middle + 1;
                span -= half + 1;
            }
        }
        return begin;
    }
    ArrayExt.upperBound = upperBound;
    /**
     * Test whether two arrays are shallowly equal.
     *
     * @param a - The first array-like object to compare.
     *
     * @param b - The second array-like object to compare.
     *
     * @param fn - The comparison function to apply to the elements. It
     *   should return `true` if the elements are "equal". The default
     *   compares elements using strict `===` equality.
     *
     * @returns Whether the two arrays are shallowly equal.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * Modifying the length of the arrays while comparing.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let d1 = [0, 3, 4, 7, 7, 9];
     * let d2 = [0, 3, 4, 7, 7, 9];
     * let d3 = [42];
     * ArrayExt.shallowEqual(d1, d2);  // true
     * ArrayExt.shallowEqual(d2, d3);  // false
     * ```
     */
    function shallowEqual(a, b, fn) {
        // Check for object identity first.
        if (a === b) {
            return true;
        }
        // Bail early if the lengths are different.
        if (a.length !== b.length) {
            return false;
        }
        // Compare each element for equality.
        for (let i = 0, n = a.length; i < n; ++i) {
            if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {
                return false;
            }
        }
        // The array are shallowly equal.
        return true;
    }
    ArrayExt.shallowEqual = shallowEqual;
    /**
     * Create a slice of an array subject to an optional step.
     *
     * @param array - The array-like object of interest.
     *
     * @param options - The options for configuring the slice.
     *
     * @returns A new array with the specified values.
     *
     * @throws An exception if the slice `step` is `0`.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start`, `stop`, or `step` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 3, 4, 7, 7, 9];
     * ArrayExt.slice(data);                         // [0, 3, 4, 7, 7, 9]
     * ArrayExt.slice(data, { start: 2 });           // [4, 7, 7, 9]
     * ArrayExt.slice(data, { start: 0, stop: 4 });  // [0, 3, 4, 7]
     * ArrayExt.slice(data, { step: 2 });            // [0, 4, 7]
     * ArrayExt.slice(data, { step: -1 });           // [9, 7, 7, 4, 3, 0]
     * ```
     */
    function slice(array, options = {}) {
        // Extract the options.
        let { start, stop, step } = options;
        // Set up the `step` value.
        if (step === undefined) {
            step = 1;
        }
        // Validate the step size.
        if (step === 0) {
            throw new Error('Slice `step` cannot be zero.');
        }
        // Look up the length of the array.
        let n = array.length;
        // Set up the `start` value.
        if (start === undefined) {
            start = step < 0 ? n - 1 : 0;
        }
        else if (start < 0) {
            start = Math.max(start + n, step < 0 ? -1 : 0);
        }
        else if (start >= n) {
            start = step < 0 ? n - 1 : n;
        }
        // Set up the `stop` value.
        if (stop === undefined) {
            stop = step < 0 ? -1 : n;
        }
        else if (stop < 0) {
            stop = Math.max(stop + n, step < 0 ? -1 : 0);
        }
        else if (stop >= n) {
            stop = step < 0 ? n - 1 : n;
        }
        // Compute the slice length.
        let length;
        if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {
            length = 0;
        }
        else if (step < 0) {
            length = Math.floor((stop - start + 1) / step + 1);
        }
        else {
            length = Math.floor((stop - start - 1) / step + 1);
        }
        // Compute the sliced result.
        let result = [];
        for (let i = 0; i < length; ++i) {
            result[i] = array[start + i * step];
        }
        // Return the result.
        return result;
    }
    ArrayExt.slice = slice;
    /**
     * Move an element in an array from one index to another.
     *
     * @param array - The mutable array-like object of interest.
     *
     * @param fromIndex - The index of the element to move. Negative
     *   values are taken as an offset from the end of the array.
     *
     * @param toIndex - The target index of the element. Negative
     *   values are taken as an offset from the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `fromIndex` or `toIndex` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 1, 2, 3, 4];
     * ArrayExt.move(data, 1, 2);  // [0, 2, 1, 3, 4]
     * ArrayExt.move(data, 4, 2);  // [0, 2, 4, 1, 3]
     * ```
     */
    function move(array, fromIndex, toIndex) {
        let n = array.length;
        if (n <= 1) {
            return;
        }
        if (fromIndex < 0) {
            fromIndex = Math.max(0, fromIndex + n);
        }
        else {
            fromIndex = Math.min(fromIndex, n - 1);
        }
        if (toIndex < 0) {
            toIndex = Math.max(0, toIndex + n);
        }
        else {
            toIndex = Math.min(toIndex, n - 1);
        }
        if (fromIndex === toIndex) {
            return;
        }
        let value = array[fromIndex];
        let d = fromIndex < toIndex ? 1 : -1;
        for (let i = fromIndex; i !== toIndex; i += d) {
            array[i] = array[i + d];
        }
        array[toIndex] = value;
    }
    ArrayExt.move = move;
    /**
     * Reverse an array in-place.
     *
     * @param array - The mutable array-like object of interest.
     *
     * @param start - The index of the first element in the range to be
     *   reversed, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   reversed, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or  `stop` index which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 1, 2, 3, 4];
     * ArrayExt.reverse(data, 1, 3);  // [0, 3, 2, 1, 4]
     * ArrayExt.reverse(data, 3);     // [0, 3, 2, 4, 1]
     * ArrayExt.reverse(data);        // [1, 4, 2, 3, 0]
     * ```
     */
    function reverse(array, start = 0, stop = -1) {
        let n = array.length;
        if (n <= 1) {
            return;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        while (start < stop) {
            let a = array[start];
            let b = array[stop];
            array[start++] = b;
            array[stop--] = a;
        }
    }
    ArrayExt.reverse = reverse;
    /**
     * Rotate the elements of an array in-place.
     *
     * @param array - The mutable array-like object of interest.
     *
     * @param delta - The amount of rotation to apply to the elements. A
     *   positive value will rotate the elements to the left. A negative
     *   value will rotate the elements to the right.
     *
     * @param start - The index of the first element in the range to be
     *   rotated, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   rotated, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `delta`, `start`, or `stop` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 1, 2, 3, 4];
     * ArrayExt.rotate(data, 2);        // [2, 3, 4, 0, 1]
     * ArrayExt.rotate(data, -2);       // [0, 1, 2, 3, 4]
     * ArrayExt.rotate(data, 10);       // [0, 1, 2, 3, 4]
     * ArrayExt.rotate(data, 9);        // [4, 0, 1, 2, 3]
     * ArrayExt.rotate(data, 2, 1, 3);  // [4, 2, 0, 1, 3]
     * ```
     */
    function rotate(array, delta, start = 0, stop = -1) {
        let n = array.length;
        if (n <= 1) {
            return;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        if (start >= stop) {
            return;
        }
        let length = stop - start + 1;
        if (delta > 0) {
            delta = delta % length;
        }
        else if (delta < 0) {
            delta = ((delta % length) + length) % length;
        }
        if (delta === 0) {
            return;
        }
        let pivot = start + delta;
        reverse(array, start, pivot - 1);
        reverse(array, pivot, stop);
        reverse(array, start, stop);
    }
    ArrayExt.rotate = rotate;
    /**
     * Fill an array with a static value.
     *
     * @param array - The mutable array-like object to fill.
     *
     * @param value - The static value to use to fill the array.
     *
     * @param start - The index of the first element in the range to be
     *   filled, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   filled, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * #### Notes
     * If `stop < start` the fill will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * A `start` or `stop` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = ['one', 'two', 'three', 'four'];
     * ArrayExt.fill(data, 'r');        // ['r', 'r', 'r', 'r']
     * ArrayExt.fill(data, 'g', 1);     // ['r', 'g', 'g', 'g']
     * ArrayExt.fill(data, 'b', 2, 3);  // ['r', 'g', 'b', 'b']
     * ArrayExt.fill(data, 'z', 3, 1);  // ['z', 'z', 'b', 'z']
     * ```
     */
    function fill(array, value, start = 0, stop = -1) {
        let n = array.length;
        if (n === 0) {
            return;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let span;
        if (stop < start) {
            span = stop + 1 + (n - start);
        }
        else {
            span = stop - start + 1;
        }
        for (let i = 0; i < span; ++i) {
            array[(start + i) % n] = value;
        }
    }
    ArrayExt.fill = fill;
    /**
     * Insert a value into an array at a specific index.
     *
     * @param array - The array of interest.
     *
     * @param index - The index at which to insert the value. Negative
     *   values are taken as an offset from the end of the array.
     *
     * @param value - The value to set at the specified index.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 1, 2];
     * ArrayExt.insert(data, 0, -1);  // [-1, 0, 1, 2]
     * ArrayExt.insert(data, 2, 12);  // [-1, 0, 12, 1, 2]
     * ArrayExt.insert(data, -1, 7);  // [-1, 0, 12, 1, 7, 2]
     * ArrayExt.insert(data, 6, 19);  // [-1, 0, 12, 1, 7, 2, 19]
     * ```
     */
    function insert(array, index, value) {
        let n = array.length;
        if (index < 0) {
            index = Math.max(0, index + n);
        }
        else {
            index = Math.min(index, n);
        }
        for (let i = n; i > index; --i) {
            array[i] = array[i - 1];
        }
        array[index] = value;
    }
    ArrayExt.insert = insert;
    /**
     * Remove and return a value at a specific index in an array.
     *
     * @param array - The array of interest.
     *
     * @param index - The index of the value to remove. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The value at the specified index, or `undefined` if the
     *   index is out of range.
     *
     * #### Complexity
     * Linear.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 12, 23, 39, 14, 12, 75];
     * ArrayExt.removeAt(data, 2);   // 23
     * ArrayExt.removeAt(data, -2);  // 12
     * ArrayExt.removeAt(data, 10);  // undefined;
     * ```
     */
    function removeAt(array, index) {
        let n = array.length;
        if (index < 0) {
            index += n;
        }
        if (index < 0 || index >= n) {
            return undefined;
        }
        let value = array[index];
        for (let i = index + 1; i < n; ++i) {
            array[i - 1] = array[i];
        }
        array.length = n - 1;
        return value;
    }
    ArrayExt.removeAt = removeAt;
    /**
     * Remove the first occurrence of a value from an array.
     *
     * @param array - The array of interest.
     *
     * @param value - The value to remove from the array. Values are
     *   compared using strict `===` equality.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the removed value, or `-1` if the value
     *   is not contained in the array.
     *
     * #### Notes
     * If `stop < start` the search will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 12, 23, 39, 14, 12, 75];
     * ArrayExt.removeFirstOf(data, 12);        // 1
     * ArrayExt.removeFirstOf(data, 17);        // -1
     * ArrayExt.removeFirstOf(data, 39, 3);     // -1
     * ArrayExt.removeFirstOf(data, 39, 3, 2);  // 2
     * ```
     */
    function removeFirstOf(array, value, start = 0, stop = -1) {
        let index = firstIndexOf(array, value, start, stop);
        if (index !== -1) {
            removeAt(array, index);
        }
        return index;
    }
    ArrayExt.removeFirstOf = removeFirstOf;
    /**
     * Remove the last occurrence of a value from an array.
     *
     * @param array - The array of interest.
     *
     * @param value - The value to remove from the array. Values are
     *   compared using strict `===` equality.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The index of the removed value, or `-1` if the value
     *   is not contained in the array.
     *
     * #### Notes
     * If `start < stop` the search will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [0, 12, 23, 39, 14, 12, 75];
     * ArrayExt.removeLastOf(data, 12);        // 5
     * ArrayExt.removeLastOf(data, 17);        // -1
     * ArrayExt.removeLastOf(data, 39, 2);     // -1
     * ArrayExt.removeLastOf(data, 39, 2, 3);  // 3
     * ```
     */
    function removeLastOf(array, value, start = -1, stop = 0) {
        let index = lastIndexOf(array, value, start, stop);
        if (index !== -1) {
            removeAt(array, index);
        }
        return index;
    }
    ArrayExt.removeLastOf = removeLastOf;
    /**
     * Remove all occurrences of a value from an array.
     *
     * @param array - The array of interest.
     *
     * @param value - The value to remove from the array. Values are
     *   compared using strict `===` equality.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The number of elements removed from the array.
     *
     * #### Notes
     * If `stop < start` the search will conceptually wrap at the end of
     * the array, however the array will be traversed front-to-back.
     *
     * #### Complexity
     * Linear.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * let data = [14, 12, 23, 39, 14, 12, 19, 14];
     * ArrayExt.removeAllOf(data, 12);        // 2
     * ArrayExt.removeAllOf(data, 17);        // 0
     * ArrayExt.removeAllOf(data, 14, 1, 4);  // 1
     * ```
     */
    function removeAllOf(array, value, start = 0, stop = -1) {
        let n = array.length;
        if (n === 0) {
            return 0;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let count = 0;
        for (let i = 0; i < n; ++i) {
            if (start <= stop && i >= start && i <= stop && array[i] === value) {
                count++;
            }
            else if (stop < start &&
                (i <= stop || i >= start) &&
                array[i] === value) {
                count++;
            }
            else if (count > 0) {
                array[i - count] = array[i];
            }
        }
        if (count > 0) {
            array.length = n - count;
        }
        return count;
    }
    ArrayExt.removeAllOf = removeAllOf;
    /**
     * Remove the first occurrence of a value which matches a predicate.
     *
     * @param array - The array of interest.
     *
     * @param fn - The predicate function to apply to the values.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The removed `{ index, value }`, which will be `-1` and
     *   `undefined` if the value is not contained in the array.
     *
     * #### Notes
     * If `stop < start` the search will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function isEven(value: number): boolean {
     *   return value % 2 === 0;
     * }
     *
     * let data = [0, 12, 23, 39, 14, 12, 75];
     * ArrayExt.removeFirstWhere(data, isEven);     // { index: 0, value: 0 }
     * ArrayExt.removeFirstWhere(data, isEven, 2);  // { index: 3, value: 14 }
     * ArrayExt.removeFirstWhere(data, isEven, 4);  // { index: -1, value: undefined }
     * ```
     */
    function removeFirstWhere(array, fn, start = 0, stop = -1) {
        let value;
        let index = findFirstIndex(array, fn, start, stop);
        if (index !== -1) {
            value = removeAt(array, index);
        }
        return { index, value };
    }
    ArrayExt.removeFirstWhere = removeFirstWhere;
    /**
     * Remove the last occurrence of a value which matches a predicate.
     *
     * @param array - The array of interest.
     *
     * @param fn - The predicate function to apply to the values.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The removed `{ index, value }`, which will be `-1` and
     *   `undefined` if the value is not contained in the array.
     *
     * #### Notes
     * If `start < stop` the search will wrap at the end of the array.
     *
     * #### Complexity
     * Linear.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function isEven(value: number): boolean {
     *   return value % 2 === 0;
     * }
     *
     * let data = [0, 12, 23, 39, 14, 12, 75];
     * ArrayExt.removeLastWhere(data, isEven);        // { index: 5, value: 12 }
     * ArrayExt.removeLastWhere(data, isEven, 2);     // { index: 1, value: 12 }
     * ArrayExt.removeLastWhere(data, isEven, 2, 1);  // { index: -1, value: undefined }
     * ```
     */
    function removeLastWhere(array, fn, start = -1, stop = 0) {
        let value;
        let index = findLastIndex(array, fn, start, stop);
        if (index !== -1) {
            value = removeAt(array, index);
        }
        return { index, value };
    }
    ArrayExt.removeLastWhere = removeLastWhere;
    /**
     * Remove all occurrences of values which match a predicate.
     *
     * @param array - The array of interest.
     *
     * @param fn - The predicate function to apply to the values.
     *
     * @param start - The index of the first element in the range to be
     *   searched, inclusive. The default value is `0`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @param stop - The index of the last element in the range to be
     *   searched, inclusive. The default value is `-1`. Negative values
     *   are taken as an offset from the end of the array.
     *
     * @returns The number of elements removed from the array.
     *
     * #### Notes
     * If `stop < start` the search will conceptually wrap at the end of
     * the array, however the array will be traversed front-to-back.
     *
     * #### Complexity
     * Linear.
     *
     * #### Example
     * ```typescript
     * import { ArrayExt } from '@lumino/algorithm';
     *
     * function isEven(value: number): boolean {
     *   return value % 2 === 0;
     * }
     *
     * function isNegative(value: number): boolean {
     *   return value < 0;
     * }
     *
     * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];
     * ArrayExt.removeAllWhere(data, isEven);            // 4
     * ArrayExt.removeAllWhere(data, isNegative, 0, 3);  // 2
     * ```
     */
    function removeAllWhere(array, fn, start = 0, stop = -1) {
        let n = array.length;
        if (n === 0) {
            return 0;
        }
        if (start < 0) {
            start = Math.max(0, start + n);
        }
        else {
            start = Math.min(start, n - 1);
        }
        if (stop < 0) {
            stop = Math.max(0, stop + n);
        }
        else {
            stop = Math.min(stop, n - 1);
        }
        let count = 0;
        for (let i = 0; i < n; ++i) {
            if (start <= stop && i >= start && i <= stop && fn(array[i], i)) {
                count++;
            }
            else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {
                count++;
            }
            else if (count > 0) {
                array[i - count] = array[i];
            }
        }
        if (count > 0) {
            array.length = n - count;
        }
        return count;
    }
    ArrayExt.removeAllWhere = removeAllWhere;
})(ArrayExt || (ArrayExt = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Chain together several iterables.
 *
 * @deprecated
 *
 * @param objects - The iterable objects of interest.
 *
 * @returns An iterator which yields the values of the iterables
 *   in the order in which they are supplied.
 *
 * #### Example
 * ```typescript
 * import { chain } from '@lumino/algorithm';
 *
 * let data1 = [1, 2, 3];
 * let data2 = [4, 5, 6];
 *
 * let stream = chain(data1, data2);
 *
 * Array.from(stream);  // [1, 2, 3, 4, 5, 6]
 * ```
 */
function* chain(...objects) {
    for (const object of objects) {
        yield* object;
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Create an empty iterator.
 *
 * @returns A new iterator which yields nothing.
 *
 * #### Example
 * ```typescript
 * import { empty } from '@lumino/algorithm';
 *
 * let stream = empty<number>();
 *
 * Array.from(stream);  // []
 * ```
 */
// eslint-disable-next-line require-yield
function* empty() {
    return;
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Enumerate an iterable object.
 *
 * @param object - The iterable object of interest.
 *
 * @param start - The starting enum value. The default is `0`.
 *
 * @returns An iterator which yields the enumerated values.
 *
 * #### Example
 * ```typescript
 * import { enumerate } from '@lumino/algorithm';
 *
 * let data = ['foo', 'bar', 'baz'];
 *
 * let stream = enumerate(data, 1);
 *
 * Array.from(stream);  // [[1, 'foo'], [2, 'bar'], [3, 'baz']]
 * ```
 */
function* enumerate(object, start = 0) {
    for (const value of object) {
        yield [start++, value];
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Filter an iterable for values which pass a test.
 *
 * @param object - The iterable object of interest.
 *
 * @param fn - The predicate function to invoke for each value.
 *
 * @returns An iterator which yields the values which pass the test.
 *
 * #### Example
 * ```typescript
 * import { filter } from '@lumino/algorithm';
 *
 * let data = [1, 2, 3, 4, 5, 6];
 *
 * let stream = filter(data, value => value % 2 === 0);
 *
 * Array.from(stream);  // [2, 4, 6]
 * ```
 */
function* filter(object, fn) {
    let index = 0;
    for (const value of object) {
        if (fn(value, index++)) {
            yield value;
        }
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Find the first value in an iterable which matches a predicate.
 *
 * @param object - The iterable object to search.
 *
 * @param fn - The predicate function to apply to the values.
 *
 * @returns The first matching value, or `undefined` if no matching
 *   value is found.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { find } from '@lumino/algorithm';
 *
 * interface IAnimal { species: string, name: string };
 *
 * function isCat(value: IAnimal): boolean {
 *   return value.species === 'cat';
 * }
 *
 * let data: IAnimal[] = [
 *   { species: 'dog', name: 'spot' },
 *   { species: 'cat', name: 'fluffy' },
 *   { species: 'alligator', name: 'pocho' }
 * ];
 *
 * find(data, isCat).name;  // 'fluffy'
 * ```
 */
function find(object, fn) {
    let index = 0;
    for (const value of object) {
        if (fn(value, index++)) {
            return value;
        }
    }
    return undefined;
}
/**
 * Find the index of the first value which matches a predicate.
 *
 * @param object - The iterable object to search.
 *
 * @param fn - The predicate function to apply to the values.
 *
 * @returns The index of the first matching value, or `-1` if no
 *   matching value is found.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { findIndex } from '@lumino/algorithm';
 *
 * interface IAnimal { species: string, name: string };
 *
 * function isCat(value: IAnimal): boolean {
 *   return value.species === 'cat';
 * }
 *
 * let data: IAnimal[] = [
 *   { species: 'dog', name: 'spot' },
 *   { species: 'cat', name: 'fluffy' },
 *   { species: 'alligator', name: 'pocho' }
 * ];
 *
 * findIndex(data, isCat);  // 1
 * ```
 */
function findIndex(object, fn) {
    let index = 0;
    for (const value of object) {
        if (fn(value, index++)) {
            return index - 1;
        }
    }
    return -1;
}
/**
 * Find the minimum value in an iterable.
 *
 * @param object - The iterable object to search.
 *
 * @param fn - The 3-way comparison function to apply to the values.
 *   It should return `< 0` if the first value is less than the second.
 *   `0` if the values are equivalent, or `> 0` if the first value is
 *   greater than the second.
 *
 * @returns The minimum value in the iterable. If multiple values are
 *   equivalent to the minimum, the left-most value is returned. If
 *   the iterable is empty, this returns `undefined`.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { min } from '@lumino/algorithm';
 *
 * function numberCmp(a: number, b: number): number {
 *   return a - b;
 * }
 *
 * min([7, 4, 0, 3, 9, 4], numberCmp);  // 0
 * ```
 */
function min(object, fn) {
    let result = undefined;
    for (const value of object) {
        if (result === undefined) {
            result = value;
            continue;
        }
        if (fn(value, result) < 0) {
            result = value;
        }
    }
    return result;
}
/**
 * Find the maximum value in an iterable.
 *
 * @param object - The iterable object to search.
 *
 * @param fn - The 3-way comparison function to apply to the values.
 *   It should return `< 0` if the first value is less than the second.
 *   `0` if the values are equivalent, or `> 0` if the first value is
 *   greater than the second.
 *
 * @returns The maximum value in the iterable. If multiple values are
 *   equivalent to the maximum, the left-most value is returned. If
 *   the iterable is empty, this returns `undefined`.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { max } from '@lumino/algorithm';
 *
 * function numberCmp(a: number, b: number): number {
 *   return a - b;
 * }
 *
 * max([7, 4, 0, 3, 9, 4], numberCmp);  // 9
 * ```
 */
function max(object, fn) {
    let result = undefined;
    for (const value of object) {
        if (result === undefined) {
            result = value;
            continue;
        }
        if (fn(value, result) > 0) {
            result = value;
        }
    }
    return result;
}
/**
 * Find the minimum and maximum values in an iterable.
 *
 * @param object - The iterable object to search.
 *
 * @param fn - The 3-way comparison function to apply to the values.
 *   It should return `< 0` if the first value is less than the second.
 *   `0` if the values are equivalent, or `> 0` if the first value is
 *   greater than the second.
 *
 * @returns A 2-tuple of the `[min, max]` values in the iterable. If
 *   multiple values are equivalent, the left-most values are returned.
 *   If the iterable is empty, this returns `undefined`.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { minmax } from '@lumino/algorithm';
 *
 * function numberCmp(a: number, b: number): number {
 *   return a - b;
 * }
 *
 * minmax([7, 4, 0, 3, 9, 4], numberCmp);  // [0, 9]
 * ```
 */
function minmax(object, fn) {
    let empty = true;
    let vmin;
    let vmax;
    for (const value of object) {
        if (empty) {
            vmin = value;
            vmax = value;
            empty = false;
        }
        else if (fn(value, vmin) < 0) {
            vmin = value;
        }
        else if (fn(value, vmax) > 0) {
            vmax = value;
        }
    }
    return empty ? undefined : [vmin, vmax];
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Create an array from an iterable of values.
 *
 * @deprecated
 *
 * @param object - The iterable object of interest.
 *
 * @returns A new array of values from the given object.
 *
 * #### Example
 * ```typescript
 * import { toArray } from '@lumino/algorithm';
 *
 * let stream = [1, 2, 3, 4, 5, 6][Symbol.iterator]();
 *
 * toArray(stream);  // [1, 2, 3, 4, 5, 6];
 * ```
 */
function toArray(object) {
    return Array.from(object);
}
/**
 * Create an object from an iterable of key/value pairs.
 *
 * @param object - The iterable object of interest.
 *
 * @returns A new object mapping keys to values.
 *
 * #### Example
 * ```typescript
 * import { toObject } from '@lumino/algorithm';
 *
 * let data: [string, number][] = [['one', 1], ['two', 2], ['three', 3]];
 *
 * toObject(data);  // { one: 1, two: 2, three: 3 }
 * ```
 */
function toObject(object) {
    const result = {};
    for (const [key, value] of object) {
        result[key] = value;
    }
    return result;
}
/**
 * Invoke a function for each value in an iterable.
 *
 * @deprecated
 *
 * @param object - The iterable object of interest.
 *
 * @param fn - The callback function to invoke for each value.
 *
 * #### Notes
 * Iteration can be terminated early by returning `false` from the
 * callback function.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { each } from '@lumino/algorithm';
 *
 * let data = [5, 7, 0, -2, 9];
 *
 * each(data, value => { console.log(value); });
 * ```
 */
function each(object, fn) {
    let index = 0;
    for (const value of object) {
        if (false === fn(value, index++)) {
            return;
        }
    }
}
/**
 * Test whether all values in an iterable satisfy a predicate.
 *
 * @param object - The iterable object of interest.
 *
 * @param fn - The predicate function to invoke for each value.
 *
 * @returns `true` if all values pass the test, `false` otherwise.
 *
 * #### Notes
 * Iteration terminates on the first `false` predicate result.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { every } from '@lumino/algorithm';
 *
 * let data = [5, 7, 1];
 *
 * every(data, value => value % 2 === 0);  // false
 * every(data, value => value % 2 === 1);  // true
 * ```
 */
function every(object, fn) {
    let index = 0;
    for (const value of object) {
        if (false === fn(value, index++)) {
            return false;
        }
    }
    return true;
}
/**
 * Test whether any value in an iterable satisfies a predicate.
 *
 * @param object - The iterable object of interest.
 *
 * @param fn - The predicate function to invoke for each value.
 *
 * @returns `true` if any value passes the test, `false` otherwise.
 *
 * #### Notes
 * Iteration terminates on the first `true` predicate result.
 *
 * #### Complexity
 * Linear.
 *
 * #### Example
 * ```typescript
 * import { some } from '@lumino/algorithm';
 *
 * let data = [5, 7, 1];
 *
 * some(data, value => value === 7);  // true
 * some(data, value => value === 3);  // false
 * ```
 */
function some(object, fn) {
    let index = 0;
    for (const value of object) {
        if (fn(value, index++)) {
            return true;
        }
    }
    return false;
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Transform the values of an iterable with a mapping function.
 *
 * @param object - The iterable object of interest.
 *
 * @param fn - The mapping function to invoke for each value.
 *
 * @returns An iterator which yields the transformed values.
 *
 * #### Example
 * ```typescript
 * import { map } from '@lumino/algorithm';
 *
 * let data = [1, 2, 3];
 *
 * let stream = map(data, value => value * 2);
 *
 * Array.from(stream);  // [2, 4, 6]
 * ```
 */
function* map(object, fn) {
    let index = 0;
    for (const value of object) {
        yield fn(value, index++);
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Create an iterator of evenly spaced values.
 *
 * @param start - The starting value for the range, inclusive.
 *
 * @param stop - The stopping value for the range, exclusive.
 *
 * @param step - The distance between each value.
 *
 * @returns An iterator which produces evenly spaced values.
 *
 * #### Notes
 * In the single argument form of `range(stop)`, `start` defaults to
 * `0` and `step` defaults to `1`.
 *
 * In the two argument form of `range(start, stop)`, `step` defaults
 * to `1`.
 *
 * #### Example
 * ```typescript
 * import { range } from '@lumino/algorithm';
 *
 * let stream = range(2, 4);
 *
 * Array.from(stream);  // [2, 3]
 * ```
 */
function* range(start, stop, step) {
    if (stop === undefined) {
        stop = start;
        start = 0;
        step = 1;
    }
    else if (step === undefined) {
        step = 1;
    }
    const length = Private.rangeLength(start, stop, step);
    for (let index = 0; index < length; index++) {
        yield start + step * index;
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * Compute the effective length of a range.
     *
     * @param start - The starting value for the range, inclusive.
     *
     * @param stop - The stopping value for the range, exclusive.
     *
     * @param step - The distance between each value.
     *
     * @returns The number of steps need to traverse the range.
     */
    function rangeLength(start, stop, step) {
        if (step === 0) {
            return Infinity;
        }
        if (start > stop && step > 0) {
            return 0;
        }
        if (start < stop && step < 0) {
            return 0;
        }
        return Math.ceil((stop - start) / step);
    }
    Private.rangeLength = rangeLength;
})(Private || (Private = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
function reduce(object, fn, initial) {
    // Setup the iterator and fetch the first value.
    const it = object[Symbol.iterator]();
    let index = 0;
    let first = it.next();
    // An empty iterator and no initial value is an error.
    if (first.done && initial === undefined) {
        throw new TypeError('Reduce of empty iterable with no initial value.');
    }
    // If the iterator is empty, return the initial value.
    if (first.done) {
        return initial;
    }
    // If the iterator has a single item and no initial value, the
    // reducer is not invoked and the first item is the return value.
    let second = it.next();
    if (second.done && initial === undefined) {
        return first.value;
    }
    // If iterator has a single item and an initial value is provided,
    // the reducer is invoked and that result is the return value.
    if (second.done) {
        return fn(initial, first.value, index++);
    }
    // Setup the initial accumlated value.
    let accumulator;
    if (initial === undefined) {
        accumulator = fn(first.value, second.value, index++);
    }
    else {
        accumulator = fn(fn(initial, first.value, index++), second.value, index++);
    }
    // Iterate the rest of the values, updating the accumulator.
    let next;
    while (!(next = it.next()).done) {
        accumulator = fn(accumulator, next.value, index++);
    }
    // Return the final accumulated value.
    return accumulator;
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Create an iterator which repeats a value a number of times.
 *
 * @deprecated
 *
 * @param value - The value to repeat.
 *
 * @param count - The number of times to repeat the value.
 *
 * @returns A new iterator which repeats the specified value.
 *
 * #### Example
 * ```typescript
 * import { repeat } from '@lumino/algorithm';
 *
 * let stream = repeat(7, 3);
 *
 * Array.from(stream);  // [7, 7, 7]
 * ```
 */
function* repeat(value, count) {
    while (0 < count--) {
        yield value;
    }
}
/**
 * Create an iterator which yields a value a single time.
 *
 * @deprecated
 *
 * @param value - The value to wrap in an iterator.
 *
 * @returns A new iterator which yields the value a single time.
 *
 * #### Example
 * ```typescript
 * import { once } from '@lumino/algorithm';
 *
 * let stream = once(7);
 *
 * Array.from(stream);  // [7]
 * ```
 */
function* once(value) {
    yield value;
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Create an iterator for a retroable object.
 *
 * @param object - The retroable or array-like object of interest.
 *
 * @returns An iterator which traverses the object's values in reverse.
 *
 * #### Example
 * ```typescript
 * import { retro } from '@lumino/algorithm';
 *
 * let data = [1, 2, 3, 4, 5, 6];
 *
 * let stream = retro(data);
 *
 * Array.from(stream);  // [6, 5, 4, 3, 2, 1]
 * ```
 */
function* retro(object) {
    if (typeof object.retro === 'function') {
        yield* object.retro();
    }
    else {
        for (let index = object.length - 1; index > -1; index--) {
            yield object[index];
        }
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Topologically sort an iterable of edges.
 *
 * @param edges - The iterable object of edges to sort.
 *   An edge is represented as a 2-tuple of `[fromNode, toNode]`.
 *
 * @returns The topologically sorted array of nodes.
 *
 * #### Notes
 * If a cycle is present in the graph, the cycle will be ignored and
 * the return value will be only approximately sorted.
 *
 * #### Example
 * ```typescript
 * import { topologicSort } from '@lumino/algorithm';
 *
 * let data = [
 *   ['d', 'e'],
 *   ['c', 'd'],
 *   ['a', 'b'],
 *   ['b', 'c']
 * ];
 *
 * topologicSort(data);  // ['a', 'b', 'c', 'd', 'e']
 * ```
 */
function topologicSort(edges) {
    // Setup the shared sorting state.
    let sorted = [];
    let visited = new Set();
    let graph = new Map();
    // Add the edges to the graph.
    for (const edge of edges) {
        addEdge(edge);
    }
    // Visit each node in the graph.
    for (const [k] of graph) {
        visit(k);
    }
    // Return the sorted results.
    return sorted;
    // Add an edge to the graph.
    function addEdge(edge) {
        let [fromNode, toNode] = edge;
        let children = graph.get(toNode);
        if (children) {
            children.push(fromNode);
        }
        else {
            graph.set(toNode, [fromNode]);
        }
    }
    // Recursively visit the node.
    function visit(node) {
        if (visited.has(node)) {
            return;
        }
        visited.add(node);
        let children = graph.get(node);
        if (children) {
            for (const child of children) {
                visit(child);
            }
        }
        sorted.push(node);
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Iterate over an iterable using a stepped increment.
 *
 * @param object - The iterable object of interest.
 *
 * @param step - The distance to step on each iteration. A value
 *   of less than `1` will behave the same as a value of `1`.
 *
 * @returns An iterator which traverses the iterable step-wise.
 *
 * #### Example
 * ```typescript
 * import { stride } from '@lumino/algorithm';
 *
 * let data = [1, 2, 3, 4, 5, 6];
 *
 * let stream = stride(data, 2);
 *
 * Array.from(stream);  // [1, 3, 5];
 * ```
 */
function* stride(object, step) {
    let count = 0;
    for (const value of object) {
        if (0 === count++ % step) {
            yield value;
        }
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * The namespace for string-specific algorithms.
 */
var StringExt;
(function (StringExt) {
    /**
     * Find the indices of characters in a source text.
     *
     * @param source - The source text which should be searched.
     *
     * @param query - The characters to locate in the source text.
     *
     * @param start - The index to start the search.
     *
     * @returns The matched indices, or `null` if there is no match.
     *
     * #### Complexity
     * Linear on `sourceText`.
     *
     * #### Notes
     * In order for there to be a match, all of the characters in `query`
     * **must** appear in `source` in the order given by `query`.
     *
     * Characters are matched using strict `===` equality.
     */
    function findIndices(source, query, start = 0) {
        let indices = new Array(query.length);
        for (let i = 0, j = start, n = query.length; i < n; ++i, ++j) {
            j = source.indexOf(query[i], j);
            if (j === -1) {
                return null;
            }
            indices[i] = j;
        }
        return indices;
    }
    StringExt.findIndices = findIndices;
    /**
     * A string matcher which uses a sum-of-squares algorithm.
     *
     * @param source - The source text which should be searched.
     *
     * @param query - The characters to locate in the source text.
     *
     * @param start - The index to start the search.
     *
     * @returns The match result, or `null` if there is no match.
     *   A lower `score` represents a stronger match.
     *
     * #### Complexity
     * Linear on `sourceText`.
     *
     * #### Notes
     * This scoring algorithm uses a sum-of-squares approach to determine
     * the score. In order for there to be a match, all of the characters
     * in `query` **must** appear in `source` in order. The index of each
     * matching character is squared and added to the score. This means
     * that early and consecutive character matches are preferred, while
     * late matches are heavily penalized.
     */
    function matchSumOfSquares(source, query, start = 0) {
        let indices = findIndices(source, query, start);
        if (!indices) {
            return null;
        }
        let score = 0;
        for (let i = 0, n = indices.length; i < n; ++i) {
            let j = indices[i] - start;
            score += j * j;
        }
        return { score, indices };
    }
    StringExt.matchSumOfSquares = matchSumOfSquares;
    /**
     * A string matcher which uses a sum-of-deltas algorithm.
     *
     * @param source - The source text which should be searched.
     *
     * @param query - The characters to locate in the source text.
     *
     * @param start - The index to start the search.
     *
     * @returns The match result, or `null` if there is no match.
     *   A lower `score` represents a stronger match.
     *
     * #### Complexity
     * Linear on `sourceText`.
     *
     * #### Notes
     * This scoring algorithm uses a sum-of-deltas approach to determine
     * the score. In order for there to be a match, all of the characters
     * in `query` **must** appear in `source` in order. The delta between
     * the indices are summed to create the score. This means that groups
     * of matched characters are preferred, while fragmented matches are
     * penalized.
     */
    function matchSumOfDeltas(source, query, start = 0) {
        let indices = findIndices(source, query, start);
        if (!indices) {
            return null;
        }
        let score = 0;
        let last = start - 1;
        for (let i = 0, n = indices.length; i < n; ++i) {
            let j = indices[i];
            score += j - last - 1;
            last = j;
        }
        return { score, indices };
    }
    StringExt.matchSumOfDeltas = matchSumOfDeltas;
    /**
     * Highlight the matched characters of a source text.
     *
     * @param source - The text which should be highlighted.
     *
     * @param indices - The indices of the matched characters. They must
     *   appear in increasing order and must be in bounds of the source.
     *
     * @param fn - The function to apply to the matched chunks.
     *
     * @returns An array of unmatched and highlighted chunks.
     */
    function highlight(source, indices, fn) {
        // Set up the result array.
        let result = [];
        // Set up the counter variables.
        let k = 0;
        let last = 0;
        let n = indices.length;
        // Iterator over each index.
        while (k < n) {
            // Set up the chunk indices.
            let i = indices[k];
            let j = indices[k];
            // Advance the right chunk index until it's non-contiguous.
            while (++k < n && indices[k] === j + 1) {
                j++;
            }
            // Extract the unmatched text.
            if (last < i) {
                result.push(source.slice(last, i));
            }
            // Extract and highlight the matched text.
            if (i < j + 1) {
                result.push(fn(source.slice(i, j + 1)));
            }
            // Update the last visited index.
            last = j + 1;
        }
        // Extract any remaining unmatched text.
        if (last < source.length) {
            result.push(source.slice(last));
        }
        // Return the highlighted result.
        return result;
    }
    StringExt.highlight = highlight;
    /**
     * A 3-way string comparison function.
     *
     * @param a - The first string of interest.
     *
     * @param b - The second string of interest.
     *
     * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.
     */
    function cmp(a, b) {
        return a < b ? -1 : a > b ? 1 : 0;
    }
    StringExt.cmp = cmp;
})(StringExt || (StringExt = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Take a fixed number of items from an iterable.
 *
 * @param object - The iterable object of interest.
 *
 * @param count - The number of items to take from the iterable.
 *
 * @returns An iterator which yields the specified number of items
 *   from the source iterable.
 *
 * #### Notes
 * The returned iterator will exhaust early if the source iterable
 * contains an insufficient number of items.
 *
 * #### Example
 * ```typescript
 * import { take } from '@lumino/algorithm';
 *
 * let stream = take([5, 4, 3, 2, 1, 0, -1], 3);
 *
 * Array.from(stream);  // [5, 4, 3]
 * ```
 */
function* take(object, count) {
    if (count < 1) {
        return;
    }
    const it = object[Symbol.iterator]();
    let item;
    while (0 < count-- && !(item = it.next()).done) {
        yield item.value;
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * Iterate several iterables in lockstep.
 *
 * @param objects - The iterable objects of interest.
 *
 * @returns An iterator which yields successive tuples of values where
 *   each value is taken in turn from the provided iterables. It will
 *   be as long as the shortest provided iterable.
 *
 * #### Example
 * ```typescript
 * import { zip } from '@lumino/algorithm';
 *
 * let data1 = [1, 2, 3];
 * let data2 = [4, 5, 6];
 *
 * let stream = zip(data1, data2);
 *
 * Array.from(stream);  // [[1, 4], [2, 5], [3, 6]]
 * ```
 */
function* zip(...objects) {
    const iters = objects.map(obj => obj[Symbol.iterator]());
    let tuple = iters.map(it => it.next());
    for (; every(tuple, item => !item.done); tuple = iters.map(it => it.next())) {
        yield tuple.map(item => item.value);
    }
}


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 16731:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Application: () => (/* binding */ Application)
/* harmony export */ });
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(88532);
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_commands__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23055);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_2__);




// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module application
 */
/**
 * A class for creating pluggable applications.
 *
 * @typeParam T - The type of the application shell.
 *
 * #### Notes
 * The `Application` class is useful when creating large, complex
 * UI applications with the ability to be safely extended by third
 * party code via plugins.
 */
class Application {
    /**
     * Construct a new application.
     *
     * @param options - The options for creating the application.
     */
    constructor(options) {
        var _a;
        this._delegate = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.PromiseDelegate();
        this._started = false;
        this._bubblingKeydown = false;
        this.pluginRegistry =
            (_a = options.pluginRegistry) !== null && _a !== void 0 ? _a : new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.PluginRegistry(options);
        this.pluginRegistry.application = this;
        // Initialize the application state.
        this.commands = new _lumino_commands__WEBPACK_IMPORTED_MODULE_0__.CommandRegistry();
        this.contextMenu = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.ContextMenu({
            commands: this.commands,
            renderer: options.contextMenuRenderer
        });
        this.shell = options.shell;
    }
    /**
     * The list of all the deferred plugins.
     */
    get deferredPlugins() {
        return this.pluginRegistry.deferredPlugins;
    }
    /**
     * A promise which resolves after the application has started.
     *
     * #### Notes
     * This promise will resolve after the `start()` method is called,
     * when all the bootstrapping and shell mounting work is complete.
     */
    get started() {
        return this._delegate.promise;
    }
    /**
     * Activate all the deferred plugins.
     *
     * @returns A promise which will resolve when each plugin is activated
     * or rejects with an error if one cannot be activated.
     */
    async activateDeferredPlugins() {
        await this.pluginRegistry.activatePlugins('defer');
    }
    /**
     * Activate the plugin with the given ID.
     *
     * @param id - The ID of the plugin of interest.
     *
     * @returns A promise which resolves when the plugin is activated
     *   or rejects with an error if it cannot be activated.
     */
    async activatePlugin(id) {
        return this.pluginRegistry.activatePlugin(id);
    }
    /**
     * Deactivate the plugin and its downstream dependents if and only if the
     * plugin and its dependents all support `deactivate`.
     *
     * @param id - The ID of the plugin of interest.
     *
     * @returns A list of IDs of downstream plugins deactivated with this one.
     */
    async deactivatePlugin(id) {
        return this.pluginRegistry.deactivatePlugin(id);
    }
    /**
     * Deregister a plugin with the application.
     *
     * @param id - The ID of the plugin of interest.
     *
     * @param force - Whether to deregister the plugin even if it is active.
     */
    deregisterPlugin(id, force) {
        this.pluginRegistry.deregisterPlugin(id, force);
    }
    /**
     * Get a plugin description.
     *
     * @param id - The ID of the plugin of interest.
     *
     * @returns The plugin description.
     */
    getPluginDescription(id) {
        return this.pluginRegistry.getPluginDescription(id);
    }
    /**
     * Test whether a plugin is registered with the application.
     *
     * @param id - The ID of the plugin of interest.
     *
     * @returns `true` if the plugin is registered, `false` otherwise.
     */
    hasPlugin(id) {
        return this.pluginRegistry.hasPlugin(id);
    }
    /**
     * Test whether a plugin is activated with the application.
     *
     * @param id - The ID of the plugin of interest.
     *
     * @returns `true` if the plugin is activated, `false` otherwise.
     */
    isPluginActivated(id) {
        return this.pluginRegistry.isPluginActivated(id);
    }
    /**
     * List the IDs of the plugins registered with the application.
     *
     * @returns A new array of the registered plugin IDs.
     */
    listPlugins() {
        return this.pluginRegistry.listPlugins();
    }
    /**
     * Register a plugin with the application.
     *
     * @param plugin - The plugin to register.
     *
     * #### Notes
     * An error will be thrown if a plugin with the same ID is already
     * registered, or if the plugin has a circular dependency.
     *
     * If the plugin provides a service which has already been provided
     * by another plugin, the new service will override the old service.
     */
    registerPlugin(plugin) {
        this.pluginRegistry.registerPlugin(plugin);
    }
    /**
     * Register multiple plugins with the application.
     *
     * @param plugins - The plugins to register.
     *
     * #### Notes
     * This calls `registerPlugin()` for each of the given plugins.
     */
    registerPlugins(plugins) {
        this.pluginRegistry.registerPlugins(plugins);
    }
    /**
     * Resolve an optional service of a given type.
     *
     * @param token - The token for the service type of interest.
     *
     * @returns A promise which resolves to an instance of the requested
     *   service, or `null` if it cannot be resolved.
     *
     * #### Notes
     * Services are singletons. The same instance will be returned each
     * time a given service token is resolved.
     *
     * If the plugin which provides the service has not been activated,
     * resolving the service will automatically activate the plugin.
     *
     * User code will not typically call this method directly. Instead,
     * the optional services for the user's plugins will be resolved
     * automatically when the plugin is activated.
     */
    async resolveOptionalService(token) {
        return this.pluginRegistry.resolveOptionalService(token);
    }
    /**
     * Resolve a required service of a given type.
     *
     * @param token - The token for the service type of interest.
     *
     * @returns A promise which resolves to an instance of the requested
     *   service, or rejects with an error if it cannot be resolved.
     *
     * #### Notes
     * Services are singletons. The same instance will be returned each
     * time a given service token is resolved.
     *
     * If the plugin which provides the service has not been activated,
     * resolving the service will automatically activate the plugin.
     *
     * User code will not typically call this method directly. Instead,
     * the required services for the user's plugins will be resolved
     * automatically when the plugin is activated.
     */
    async resolveRequiredService(token) {
        return this.pluginRegistry.resolveRequiredService(token);
    }
    /**
     * Start the application.
     *
     * @param options - The options for starting the application.
     *
     * @returns A promise which resolves when all bootstrapping work
     *   is complete and the shell is mounted to the DOM.
     *
     * #### Notes
     * This should be called once by the application creator after all
     * initial plugins have been registered.
     *
     * If a plugin fails to the load, the error will be logged and the
     * other valid plugins will continue to be loaded.
     *
     * Bootstrapping the application consists of the following steps:
     * 1. Activate the startup plugins
     * 2. Wait for those plugins to activate
     * 3. Attach the shell widget to the DOM
     * 4. Add the application event listeners
     */
    async start(options = {}) {
        var _a, _b;
        // Return immediately if the application is already started.
        if (this._started) {
            return this._delegate.promise;
        }
        // Mark the application as started;
        this._started = true;
        this._bubblingKeydown = (_a = options.bubblingKeydown) !== null && _a !== void 0 ? _a : false;
        // Parse the host ID for attaching the shell.
        const hostID = (_b = options.hostID) !== null && _b !== void 0 ? _b : '';
        // Wait for the plugins to activate, then finalize startup.
        await this.pluginRegistry.activatePlugins('startUp', options);
        this.attachShell(hostID);
        this.addEventListeners();
        this._delegate.resolve();
    }
    /**
     * Handle the DOM events for the application.
     *
     * @param event - The DOM event sent to the application.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events registered for the application. It
     * should not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'resize':
                this.evtResize(event);
                break;
            case 'keydown':
                this.evtKeydown(event);
                break;
            case 'keyup':
                this.evtKeyup(event);
                break;
            case 'contextmenu':
                this.evtContextMenu(event);
                break;
        }
    }
    /**
     * Attach the application shell to the DOM.
     *
     * @param id - The ID of the host node for the shell, or `''`.
     *
     * #### Notes
     * If the ID is not provided, the document body will be the host.
     *
     * A subclass may reimplement this method as needed.
     */
    attachShell(id) {
        _lumino_widgets__WEBPACK_IMPORTED_MODULE_2__.Widget.attach(this.shell, (id && document.getElementById(id)) || document.body);
    }
    /**
     * Add the application event listeners.
     *
     * #### Notes
     * The default implementation of this method adds listeners for
     * `'keydown'` and `'resize'` events.
     *
     * A subclass may reimplement this method as needed.
     */
    addEventListeners() {
        document.addEventListener('contextmenu', this);
        document.addEventListener('keydown', this, !this._bubblingKeydown);
        document.addEventListener('keyup', this, !this._bubblingKeydown);
        window.addEventListener('resize', this);
    }
    /**
     * A method invoked on a document `'keydown'` event.
     *
     * #### Notes
     * The default implementation of this method invokes the key down
     * processing method of the application command registry.
     *
     * A subclass may reimplement this method as needed.
     */
    evtKeydown(event) {
        this.commands.processKeydownEvent(event);
    }
    /**
     * A method invoked on a document `'keyup'` event.
     *
     * #### Notes
     * The default implementation of this method invokes the key up
     * processing method of the application command registry.
     *
     * A subclass may reimplement this method as needed.
     */
    evtKeyup(event) {
        this.commands.processKeyupEvent(event);
    }
    /**
     * A method invoked on a document `'contextmenu'` event.
     *
     * #### Notes
     * The default implementation of this method opens the application
     * `contextMenu` at the current mouse position.
     *
     * If the application context menu has no matching content *or* if
     * the shift key is pressed, the default browser context menu will
     * be opened instead.
     *
     * A subclass may reimplement this method as needed.
     */
    evtContextMenu(event) {
        if (event.shiftKey) {
            return;
        }
        if (this.contextMenu.open(event)) {
            event.preventDefault();
            event.stopPropagation();
        }
    }
    /**
     * A method invoked on a window `'resize'` event.
     *
     * #### Notes
     * The default implementation of this method updates the shell.
     *
     * A subclass may reimplement this method as needed.
     */
    evtResize(event) {
        this.shell.update();
    }
}


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 43301:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CommandRegistry: () => (/* binding */ CommandRegistry)
/* harmony export */ });
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78839);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61533);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19451);
/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _lumino_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10743);
/* harmony import */ var _lumino_keyboard__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_keyboard__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_5__);







// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module commands
 */
/**
 * An object which manages a collection of commands.
 *
 * #### Notes
 * A command registry can be used to populate a variety of action-based
 * widgets, such as command palettes, menus, and toolbars.
 */
class CommandRegistry {
    constructor() {
        this._timerID = 0;
        this._timerModifierID = 0;
        this._replaying = false;
        this._keystrokes = [];
        this._keydownEvents = [];
        this._keyBindings = [];
        this._exactKeyMatch = null;
        this._commands = new Map();
        this._commandChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._commandExecuted = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._keyBindingChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._holdKeyBindingPromises = new Map();
    }
    /**
     * A signal emitted when a command has changed.
     *
     * #### Notes
     * This signal is useful for visual representations of commands which
     * need to refresh when the state of a relevant command has changed.
     */
    get commandChanged() {
        return this._commandChanged;
    }
    /**
     * A signal emitted when a command has executed.
     *
     * #### Notes
     * Care should be taken when consuming this signal. The command system is used
     * by many components for many user actions. Handlers registered with this
     * signal must return quickly to ensure the overall application remains responsive.
     */
    get commandExecuted() {
        return this._commandExecuted;
    }
    /**
     * A signal emitted when a key binding is changed.
     */
    get keyBindingChanged() {
        return this._keyBindingChanged;
    }
    /**
     * A read-only array of the key bindings in the registry.
     */
    get keyBindings() {
        return this._keyBindings;
    }
    /**
     * List the ids of the registered commands.
     *
     * @returns A new array of the registered command ids.
     */
    listCommands() {
        return Array.from(this._commands.keys());
    }
    /**
     * Test whether a specific command is registered.
     *
     * @param id - The id of the command of interest.
     *
     * @returns `true` if the command is registered, `false` otherwise.
     */
    hasCommand(id) {
        return this._commands.has(id);
    }
    /**
     * Add a command to the registry.
     *
     * @param id - The unique id of the command.
     *
     * @param options - The options for the command.
     *
     * @returns A disposable which will remove the command.
     *
     * @throws An error if the given `id` is already registered.
     */
    addCommand(id, options) {
        // Throw an error if the id is already registered.
        if (this._commands.has(id)) {
            throw new Error(`Command '${id}' already registered.`);
        }
        // Add the command to the registry.
        this._commands.set(id, Private.createCommand(options));
        // Emit the `commandChanged` signal.
        this._commandChanged.emit({ id, type: 'added' });
        // Return a disposable which will remove the command.
        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_2__.DisposableDelegate(() => {
            // Remove the command from the registry.
            this._commands.delete(id);
            // Emit the `commandChanged` signal.
            this._commandChanged.emit({ id, type: 'removed' });
        });
    }
    /**
     * Notify listeners that the state of a command has changed.
     *
     * @param id - The id of the command which has changed. If more than
     *   one command has changed, this argument should be omitted.
     *
     * @throws An error if the given `id` is not registered.
     *
     * #### Notes
     * This method should be called by the command author whenever the
     * application state changes such that the results of the command
     * metadata functions may have changed.
     *
     * This will cause the `commandChanged` signal to be emitted.
     */
    notifyCommandChanged(id) {
        if (id !== undefined && !this._commands.has(id)) {
            throw new Error(`Command '${id}' is not registered.`);
        }
        this._commandChanged.emit({ id, type: id ? 'changed' : 'many-changed' });
    }
    /**
     * Get the description for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The description for the command.
     */
    describedBy(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        var _a;
        let cmd = this._commands.get(id);
        return Promise.resolve((_a = cmd === null || cmd === void 0 ? void 0 : cmd.describedBy.call(undefined, args)) !== null && _a !== void 0 ? _a : { args: null });
    }
    /**
     * Get the display label for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The display label for the command, or an empty string
     *   if the command is not registered.
     */
    label(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        var _a;
        let cmd = this._commands.get(id);
        return (_a = cmd === null || cmd === void 0 ? void 0 : cmd.label.call(undefined, args)) !== null && _a !== void 0 ? _a : '';
    }
    /**
     * Get the mnemonic index for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The mnemonic index for the command, or `-1` if the
     *   command is not registered.
     */
    mnemonic(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.mnemonic.call(undefined, args) : -1;
    }
    /**
     * Get the icon renderer for a specific command.
     *
     * DEPRECATED: if set to a string value, the .icon field will
     * function as an alias for the .iconClass field, for backwards
     * compatibility. In the future when this is removed, the default
     * return type will become undefined.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The icon renderer for the command or `undefined`.
     */
    icon(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        var _a;
        return (_a = this._commands.get(id)) === null || _a === void 0 ? void 0 : _a.icon.call(undefined, args);
    }
    /**
     * Get the icon class for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The icon class for the command, or an empty string if
     *   the command is not registered.
     */
    iconClass(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.iconClass.call(undefined, args) : '';
    }
    /**
     * Get the icon label for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The icon label for the command, or an empty string if
     *   the command is not registered.
     */
    iconLabel(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.iconLabel.call(undefined, args) : '';
    }
    /**
     * Get the short form caption for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The caption for the command, or an empty string if the
     *   command is not registered.
     */
    caption(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.caption.call(undefined, args) : '';
    }
    /**
     * Get the usage help text for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The usage text for the command, or an empty string if
     *   the command is not registered.
     */
    usage(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.usage.call(undefined, args) : '';
    }
    /**
     * Get the extra class name for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The class name for the command, or an empty string if
     *   the command is not registered.
     */
    className(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.className.call(undefined, args) : '';
    }
    /**
     * Get the dataset for a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns The dataset for the command, or an empty dataset if
     *   the command is not registered.
     */
    dataset(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.dataset.call(undefined, args) : {};
    }
    /**
     * Test whether a specific command is enabled.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns A boolean indicating whether the command is enabled,
     *   or `false` if the command is not registered.
     */
    isEnabled(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.isEnabled.call(undefined, args) : false;
    }
    /**
     * Test whether a specific command is toggled.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns A boolean indicating whether the command is toggled,
     *   or `false` if the command is not registered.
     */
    isToggled(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.isToggled.call(undefined, args) : false;
    }
    /**
     * Test whether a specific command is toggleable.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns A boolean indicating whether the command is toggleable,
     *   or `false` if the command is not registered.
     */
    isToggleable(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.isToggleable : false;
    }
    /**
     * Test whether a specific command is visible.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns A boolean indicating whether the command is visible,
     *   or `false` if the command is not registered.
     */
    isVisible(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        let cmd = this._commands.get(id);
        return cmd ? cmd.isVisible.call(undefined, args) : false;
    }
    /**
     * Execute a specific command.
     *
     * @param id - The id of the command of interest.
     *
     * @param args - The arguments for the command.
     *
     * @returns A promise which resolves with the result of the command.
     *
     * #### Notes
     * The promise will reject if the command throws an exception,
     * or if the command is not registered.
     */
    execute(id, args = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject) {
        // Reject if the command is not registered.
        let cmd = this._commands.get(id);
        if (!cmd) {
            return Promise.reject(new Error(`Command '${id}' not registered.`));
        }
        // Execute the command and reject if an exception is thrown.
        let value;
        try {
            value = cmd.execute.call(undefined, args);
        }
        catch (err) {
            value = Promise.reject(err);
        }
        // Create the return promise which resolves the result.
        let result = Promise.resolve(value);
        // Emit the command executed signal.
        this._commandExecuted.emit({ id, args, result });
        // Return the result promise to the caller.
        return result;
    }
    /**
     * Add a key binding to the registry.
     *
     * @param options - The options for creating the key binding.
     *
     * @returns A disposable which removes the added key binding.
     *
     * #### Notes
     * If multiple key bindings are registered for the same sequence, the
     * binding with the highest selector specificity is executed first. A
     * tie is broken by using the most recently added key binding.
     *
     * Ambiguous key bindings are resolved with a timeout. As an example,
     * suppose two key bindings are registered: one with the key sequence
     * `['Ctrl D']`, and another with `['Ctrl D', 'Ctrl W']`. If the user
     * presses `Ctrl D`, the first binding cannot be immediately executed
     * since the user may intend to complete the chord with `Ctrl W`. For
     * such cases, a timer is used to allow the chord to be completed. If
     * the chord is not completed before the timeout, the first binding
     * is executed.
     */
    addKeyBinding(options) {
        // Create the binding for the given options.
        let binding = Private.createKeyBinding(options);
        // Add the key binding to the bindings array.
        this._keyBindings.push(binding);
        // Emit the `bindingChanged` signal.
        this._keyBindingChanged.emit({ binding, type: 'added' });
        // Return a disposable which will remove the binding.
        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_2__.DisposableDelegate(() => {
            // Remove the binding from the array.
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeFirstOf(this._keyBindings, binding);
            // Emit the `bindingChanged` signal.
            this._keyBindingChanged.emit({ binding, type: 'removed' });
        });
    }
    /**
     * Process a `'keydown'` event and invoke a matching key binding.
     *
     * @param event - The event object for a `'keydown'` event.
     *
     * #### Notes
     * This should be called in response to a `'keydown'` event in order
     * to invoke the command for the best matching key binding.
     *
     * The registry **does not** install its own listener for `'keydown'`
     * events. This allows the application full control over the nodes
     * and phase for which the registry processes `'keydown'` events.
     *
     * When the keydown event is processed, if the event target or any of its
     * ancestor nodes has a `data-lm-suppress-shortcuts` attribute, its keydown
     * events will not invoke commands.
     */
    processKeydownEvent(event) {
        // Bail immediately if playing back keystrokes.
        if (event.defaultPrevented || this._replaying) {
            return;
        }
        // Get the normalized keystroke for the event.
        const keystroke = CommandRegistry.keystrokeForKeydownEvent(event);
        // If the keystroke is not valid for the keyboard layout, replay
        // any suppressed events and clear the pending state.
        if (!keystroke) {
            this._replayKeydownEvents();
            this._clearPendingState();
            return;
        }
        // Check that only mod key(s) have been pressed.
        if (CommandRegistry.isModifierKeyPressed(event)) {
            // Find the exact match for the modifier keys.
            let { exact } = Private.matchKeyBinding(this._keyBindings, [keystroke], event);
            if (exact) {
                // If the mod keys match an exact shortcut, start a dedicated timer.
                event.preventDefault();
                event.stopPropagation();
                this._startModifierTimer(exact);
            }
            else {
                // Otherwise stop potential existing timer.
                this._clearModifierTimer();
            }
            return;
        }
        // Add the keystroke to the current key sequence.
        this._keystrokes.push(keystroke);
        // Find the exact and partial matches for the key sequence.
        const { exact, partial } = Private.matchKeyBinding(this._keyBindings, this._keystrokes, event);
        // Whether there is any partial match.
        const hasPartial = partial.length !== 0;
        // If there is no exact match and no partial match, replay
        // any suppressed events and clear the pending state.
        if (!exact && !hasPartial) {
            this._replayKeydownEvents();
            this._clearPendingState();
            return;
        }
        // Stop propagation of the event. If there is only a partial match,
        // the event will be replayed if a final exact match never occurs.
        if ((exact === null || exact === void 0 ? void 0 : exact.preventDefault) || partial.some(match => match.preventDefault)) {
            event.preventDefault();
            event.stopPropagation();
        }
        // Store the event for possible playback in the future and for
        // the use in execution hold check.
        this._keydownEvents.push(event);
        // If there is an exact match but no partial match, the exact match
        // can be dispatched immediately. The pending state is cleared so
        // the next key press starts from the default state.
        if (exact && !hasPartial) {
            this._executeKeyBinding(exact);
            this._clearPendingState();
            return;
        }
        // If there is both an exact match and a partial match, the exact
        // match is stored for future dispatch in case the timer expires
        // before a more specific match is triggered.
        if (exact) {
            this._exactKeyMatch = exact;
        }
        // (Re)start the timer to dispatch the most recent exact match
        // in case the partial match fails to result in an exact match.
        this._startTimer();
    }
    /**
     * Delay the execution of any command matched against the given 'keydown' event
     * until the `permission` to execute is granted.
     *
     * @param event - The event object for a `'keydown'` event.
     * @param permission - The promise with value indicating whether to proceed with the execution.
     *
     * ### Note
     * This enables the caller of `processKeydownEvent` to asynchronously prevent the
     * execution of the command based on external events.
     */
    holdKeyBindingExecution(event, permission) {
        this._holdKeyBindingPromises.set(event, permission);
    }
    /**
     * Process a ``keyup`` event to clear the timer on the modifier, if it exists.
     *
     * @param event - The event object for a `'keydown'` event.
     */
    processKeyupEvent(event) {
        this._clearModifierTimer();
    }
    /**
     * Start or restart the timeout on the modifier keys.
     *
     * This timeout will end only if the keys are hold.
     */
    _startModifierTimer(exact) {
        this._clearModifierTimer();
        this._timerModifierID = window.setTimeout(() => {
            this._executeKeyBinding(exact);
        }, Private.modifierkeyTimeOut);
    }
    /**
     * Clear the timeout on modifier keys.
     */
    _clearModifierTimer() {
        if (this._timerModifierID !== 0) {
            clearTimeout(this._timerModifierID);
            this._timerModifierID = 0;
        }
    }
    /**
     * Start or restart the pending timeout.
     */
    _startTimer() {
        this._clearTimer();
        this._timerID = window.setTimeout(() => {
            this._onPendingTimeout();
        }, Private.CHORD_TIMEOUT);
    }
    /**
     * Clear the pending timeout.
     */
    _clearTimer() {
        if (this._timerID !== 0) {
            clearTimeout(this._timerID);
            this._timerID = 0;
        }
    }
    /**
     * Replay the keydown events which were suppressed.
     */
    _replayKeydownEvents() {
        if (this._keydownEvents.length === 0) {
            return;
        }
        this._replaying = true;
        this._keydownEvents.forEach(Private.replayKeyEvent);
        this._replaying = false;
    }
    /**
     * Execute the command for the given key binding.
     *
     * If the command is missing or disabled, a warning will be logged.
     *
     * The execution will not proceed if any of the events leading to
     * the keybinding matching were held with the permission resolving to false.
     */
    async _executeKeyBinding(binding) {
        if (this._holdKeyBindingPromises.size !== 0) {
            // Copy keydown events list to ensure it is available in async code.
            const keydownEvents = [...this._keydownEvents];
            // Wait until all hold requests on execution are lifted.
            const executionAllowed = (await Promise.race([
                Promise.all(keydownEvents.map(async (event) => { var _a; return (_a = this._holdKeyBindingPromises.get(event)) !== null && _a !== void 0 ? _a : Promise.resolve(true); })),
                new Promise(resolve => {
                    setTimeout(() => resolve([false]), Private.KEYBINDING_HOLD_TIMEOUT);
                })
            ])).every(Boolean);
            // Clear the hold requests.
            this._holdKeyBindingPromises.clear();
            // Do not proceed with the execution if any of the hold requests did not get the permission to proceed.
            if (!executionAllowed) {
                return;
            }
        }
        let { command, args } = binding;
        let newArgs = {
            _luminoEvent: { type: 'keybinding', keys: binding.keys },
            ...args
        };
        if (!this.hasCommand(command) || !this.isEnabled(command, newArgs)) {
            let word = this.hasCommand(command) ? 'enabled' : 'registered';
            let keys = binding.keys.join(', ');
            let msg1 = `Cannot execute key binding '${keys}':`;
            let msg2 = `command '${command}' is not ${word}.`;
            console.warn(`${msg1} ${msg2}`);
            return;
        }
        await this.execute(command, newArgs);
    }
    /**
     * Clear the internal pending state.
     */
    _clearPendingState() {
        this._clearTimer();
        this._clearModifierTimer();
        this._exactKeyMatch = null;
        this._keystrokes.length = 0;
        this._keydownEvents.length = 0;
    }
    /**
     * Handle the partial match timeout.
     */
    _onPendingTimeout() {
        this._timerID = 0;
        if (this._exactKeyMatch) {
            this._executeKeyBinding(this._exactKeyMatch);
        }
        else {
            this._replayKeydownEvents();
        }
        this._clearPendingState();
    }
}
/**
 * The namespace for the `CommandRegistry` class statics.
 */
(function (CommandRegistry) {
    /**
     * Parse a keystroke into its constituent components.
     *
     * @param keystroke - The keystroke of interest.
     *
     * @returns The parsed components of the keystroke.
     *
     * #### Notes
     * The keystroke should be of the form:
     *   `[<modifier 1> [<modifier 2> [<modifier N> ]]]<primary key>`
     *
     * The supported modifiers are: `Accel`, `Alt`, `Cmd`, `Ctrl`, and
     * `Shift`. The `Accel` modifier is translated to `Cmd` on Mac and
     * `Ctrl` on all other platforms.
     *
     * The parsing is tolerant and will not throw exceptions. Notably:
     *   - Duplicate modifiers are ignored.
     *   - Extra primary keys are ignored.
     *   - The order of modifiers and primary key is irrelevant.
     *   - The keystroke parts should be separated by whitespace.
     *   - The keystroke is case sensitive.
     */
    function parseKeystroke(keystroke) {
        let key = '';
        let alt = false;
        let cmd = false;
        let ctrl = false;
        let shift = false;
        for (let token of keystroke.split(/\s+/)) {
            if (token === 'Accel') {
                if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_MAC) {
                    cmd = true;
                }
                else {
                    ctrl = true;
                }
            }
            else if (token === 'Alt') {
                alt = true;
            }
            else if (token === 'Cmd') {
                cmd = true;
            }
            else if (token === 'Ctrl') {
                ctrl = true;
            }
            else if (token === 'Shift') {
                shift = true;
            }
            else if (token.length > 0) {
                key = token;
            }
        }
        return { cmd, ctrl, alt, shift, key };
    }
    CommandRegistry.parseKeystroke = parseKeystroke;
    /**
     * Normalize a keystroke into a canonical representation.
     *
     * @param keystroke - The keystroke of interest.
     *
     * @returns The normalized representation of the keystroke.
     *
     * #### Notes
     * This normalizes the keystroke by removing duplicate modifiers and
     * extra primary keys, and assembling the parts in a canonical order.
     *
     * The `Cmd` modifier is ignored on non-Mac platforms.
     */
    function normalizeKeystroke(keystroke) {
        let mods = '';
        let parts = parseKeystroke(keystroke);
        if (parts.ctrl) {
            mods += 'Ctrl ';
        }
        if (parts.alt) {
            mods += 'Alt ';
        }
        if (parts.shift) {
            mods += 'Shift ';
        }
        if (parts.cmd && _lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_MAC) {
            mods += 'Cmd ';
        }
        if (!parts.key) {
            return mods.trim();
        }
        return mods + parts.key;
    }
    CommandRegistry.normalizeKeystroke = normalizeKeystroke;
    /**
     * Get the platform-specific normalized keys for an options object.
     *
     * @param options - The options for the key binding.
     *
     * @returns Array of combined, normalized keys.
     */
    function normalizeKeys(options) {
        let keys;
        if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_WIN) {
            keys = options.winKeys || options.keys;
        }
        else if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_MAC) {
            keys = options.macKeys || options.keys;
        }
        else {
            keys = options.linuxKeys || options.keys;
        }
        return keys.map(normalizeKeystroke);
    }
    CommandRegistry.normalizeKeys = normalizeKeys;
    /**
     * Format keystrokes for display on the local system.
     *
     * If a list of keystrokes is provided, it will be displayed as
     * a comma-separated string
     *
     * @param keystroke The keystrokes to format
     * @returns The keystrokes representation
     */
    function formatKeystroke(keystroke) {
        return typeof keystroke === 'string'
            ? formatSingleKey(keystroke)
            : keystroke.map(formatSingleKey).join(', ');
        function formatSingleKey(key) {
            let mods = [];
            let separator = _lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_MAC ? ' ' : '+';
            let parts = parseKeystroke(key);
            if (parts.ctrl) {
                mods.push('Ctrl');
            }
            if (parts.alt) {
                mods.push('Alt');
            }
            if (parts.shift) {
                mods.push('Shift');
            }
            if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_MAC && parts.cmd) {
                mods.push('Cmd');
            }
            mods.push(parts.key);
            return mods.map(Private.formatKey).join(separator);
        }
    }
    CommandRegistry.formatKeystroke = formatKeystroke;
    /**
     * Check if `'keydown'` event is caused by pressing a modifier key that should be ignored.
     *
     * @param event - The event object for a `'keydown'` event.
     *
     * @returns `true` if modifier key was pressed, `false` otherwise.
     */
    function isModifierKeyPressed(event) {
        let layout = (0,_lumino_keyboard__WEBPACK_IMPORTED_MODULE_4__.getKeyboardLayout)();
        let key = layout.keyForKeydownEvent(event);
        return layout.isModifierKey(key);
    }
    CommandRegistry.isModifierKeyPressed = isModifierKeyPressed;
    /**
     * Create a normalized keystroke for a `'keydown'` event.
     *
     * @param event - The event object for a `'keydown'` event.
     *
     * @returns A normalized keystroke, or an empty string if the event
     *   does not represent a valid keystroke for the given layout.
     */
    function keystrokeForKeydownEvent(event) {
        let layout = (0,_lumino_keyboard__WEBPACK_IMPORTED_MODULE_4__.getKeyboardLayout)();
        let key = layout.keyForKeydownEvent(event);
        let mods = [];
        if (event.ctrlKey) {
            mods.push('Ctrl');
        }
        if (event.altKey) {
            mods.push('Alt');
        }
        if (event.shiftKey) {
            mods.push('Shift');
        }
        if (event.metaKey && _lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_MAC) {
            mods.push('Cmd');
        }
        if (!layout.isModifierKey(key)) {
            mods.push(key);
        }
        // for purely modifier key strings
        return mods.join(' ');
    }
    CommandRegistry.keystrokeForKeydownEvent = keystrokeForKeydownEvent;
})(CommandRegistry || (CommandRegistry = {}));
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * The timeout in ms for triggering a key binding chord.
     */
    Private.CHORD_TIMEOUT = 1000;
    /**
     * The timeout in ms for stopping the hold on keybinding execution.
     */
    Private.KEYBINDING_HOLD_TIMEOUT = 1000;
    /**
     * The timeout in ms for triggering a modifer key binding.
     */
    Private.modifierkeyTimeOut = 500;
    /**
     * Create a normalized command from an options object.
     */
    function createCommand(options) {
        return {
            execute: options.execute,
            describedBy: asFunc(typeof options.describedBy === 'function'
                ? options.describedBy
                : { args: null, ...options.describedBy }, () => {
                return { args: null };
            }),
            label: asFunc(options.label, emptyStringFunc),
            mnemonic: asFunc(options.mnemonic, negativeOneFunc),
            icon: asFunc(options.icon, undefinedFunc),
            iconClass: asFunc(options.iconClass, emptyStringFunc),
            iconLabel: asFunc(options.iconLabel, emptyStringFunc),
            caption: asFunc(options.caption, emptyStringFunc),
            usage: asFunc(options.usage, emptyStringFunc),
            className: asFunc(options.className, emptyStringFunc),
            dataset: asFunc(options.dataset, emptyDatasetFunc),
            isEnabled: options.isEnabled || trueFunc,
            isToggled: options.isToggled || falseFunc,
            isToggleable: options.isToggleable || !!options.isToggled,
            isVisible: options.isVisible || trueFunc
        };
    }
    Private.createCommand = createCommand;
    /**
     * Create a key binding object from key binding options.
     */
    function createKeyBinding(options) {
        var _a;
        return {
            keys: CommandRegistry.normalizeKeys(options),
            selector: validateSelector(options),
            command: options.command,
            args: options.args || _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject,
            preventDefault: (_a = options.preventDefault) !== null && _a !== void 0 ? _a : true
        };
    }
    Private.createKeyBinding = createKeyBinding;
    /**
     * Find the key bindings which match a key sequence.
     *
     * This returns a match result which contains the best exact matching
     * binding, and a flag which indicates if there are partial matches.
     */
    function matchKeyBinding(bindings, keys, event) {
        // The current best exact match.
        let exact = null;
        // Partial matches.
        let partial = [];
        // The match distance for the exact match.
        let distance = Infinity;
        // The specificity for the exact match.
        let specificity = 0;
        // Iterate over the bindings and search for the best match.
        for (let i = 0, n = bindings.length; i < n; ++i) {
            // Lookup the current binding.
            let binding = bindings[i];
            // Check whether the key binding sequence is a match.
            let sqm = matchSequence(binding.keys, keys);
            // If there is no match, the binding is ignored.
            if (sqm === 0 /* SequenceMatch.None */) {
                continue;
            }
            // If it is a partial match and no other partial match has been
            // found, ensure the selector matches and set the partial flag.
            if (sqm === 2 /* SequenceMatch.Partial */) {
                if (targetDistance(binding.selector, event) !== -1) {
                    partial.push(binding);
                }
                continue;
            }
            // Ignore the match if the selector doesn't match, or if the
            // matched node is farther away than the current best match.
            let td = targetDistance(binding.selector, event);
            if (td === -1 || td > distance) {
                continue;
            }
            // Get the specificity for the selector.
            let sp = _lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Selector.calculateSpecificity(binding.selector);
            // Update the best match if this match is stronger.
            if (!exact || td < distance || sp >= specificity) {
                exact = binding;
                distance = td;
                specificity = sp;
            }
        }
        // Return the match result.
        return { exact, partial };
    }
    Private.matchKeyBinding = matchKeyBinding;
    /**
     * Replay a keyboard event.
     *
     * This synthetically dispatches a clone of the keyboard event.
     */
    function replayKeyEvent(event) {
        event.target.dispatchEvent(cloneKeyboardEvent(event));
    }
    Private.replayKeyEvent = replayKeyEvent;
    function formatKey(key) {
        if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Platform.IS_MAC) {
            return MAC_DISPLAY.hasOwnProperty(key) ? MAC_DISPLAY[key] : key;
        }
        else {
            return WIN_DISPLAY.hasOwnProperty(key) ? WIN_DISPLAY[key] : key;
        }
    }
    Private.formatKey = formatKey;
    const MAC_DISPLAY = {
        Backspace: '⌫',
        Tab: '⇥',
        Enter: '⏎',
        Shift: '⇧',
        Ctrl: '⌃',
        Alt: '⌥',
        Escape: '⎋',
        PageUp: '⇞',
        PageDown: '⇟',
        End: '↘',
        Home: '↖',
        ArrowLeft: '←',
        ArrowUp: '↑',
        ArrowRight: '→',
        ArrowDown: '↓',
        Delete: '⌦',
        Cmd: '⌘'
    };
    const WIN_DISPLAY = {
        Escape: 'Esc',
        PageUp: 'Page Up',
        PageDown: 'Page Down',
        ArrowLeft: 'Left',
        ArrowUp: 'Up',
        ArrowRight: 'Right',
        ArrowDown: 'Down',
        Delete: 'Del'
    };
    /**
     * A singleton empty string function.
     */
    const emptyStringFunc = () => '';
    /**
     * A singleton `-1` number function
     */
    const negativeOneFunc = () => -1;
    /**
     * A singleton true boolean function.
     */
    const trueFunc = () => true;
    /**
     * A singleton false boolean function.
     */
    const falseFunc = () => false;
    /**
     * A singleton empty dataset function.
     */
    const emptyDatasetFunc = () => ({});
    /**
     * A singleton undefined function
     */
    const undefinedFunc = () => undefined;
    /**
     * Cast a value or command func to a command func.
     */
    function asFunc(value, dfault) {
        if (value === undefined) {
            return dfault;
        }
        if (typeof value === 'function') {
            return value;
        }
        return () => value;
    }
    /**
     * Validate the selector for an options object.
     *
     * This returns the validated selector, or throws if the selector is
     * invalid or contains commas.
     */
    function validateSelector(options) {
        if (options.selector.indexOf(',') !== -1) {
            throw new Error(`Selector cannot contain commas: ${options.selector}`);
        }
        if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Selector.isValid(options.selector)) {
            throw new Error(`Invalid selector: ${options.selector}`);
        }
        return options.selector;
    }
    /**
     * Test whether a key binding sequence matches a key sequence.
     *
     * Returns a `SequenceMatch` value indicating the type of match.
     */
    function matchSequence(bindKeys, userKeys) {
        if (bindKeys.length < userKeys.length) {
            return 0 /* SequenceMatch.None */;
        }
        for (let i = 0, n = userKeys.length; i < n; ++i) {
            if (bindKeys[i] !== userKeys[i]) {
                return 0 /* SequenceMatch.None */;
            }
        }
        if (bindKeys.length > userKeys.length) {
            return 2 /* SequenceMatch.Partial */;
        }
        return 1 /* SequenceMatch.Exact */;
    }
    /**
     * Find the distance from the target node to the first matching node.
     *
     * This traverses the event path from `target` to `currentTarget` and
     * computes the distance from `target` to the first node which matches
     * the CSS selector. If no match is found, `-1` is returned.
     */
    function targetDistance(selector, event) {
        let targ = event.target;
        let curr = event.currentTarget;
        for (let dist = 0; targ !== null; targ = targ.parentElement, ++dist) {
            if (targ.hasAttribute('data-lm-suppress-shortcuts')) {
                return -1;
            }
            if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_3__.Selector.matches(targ, selector)) {
                return dist;
            }
            if (targ === curr) {
                return -1;
            }
        }
        return -1;
    }
    /**
     * Clone a keyboard event.
     */
    function cloneKeyboardEvent(event) {
        // A custom event is required because Chrome nulls out the
        // `keyCode` field in user-generated `KeyboardEvent` types.
        let clone = document.createEvent('Event');
        let bubbles = event.bubbles || true;
        let cancelable = event.cancelable || true;
        clone.initEvent(event.type || 'keydown', bubbles, cancelable);
        clone.key = event.key || '';
        clone.keyCode = event.keyCode || 0;
        clone.which = event.keyCode || 0;
        clone.ctrlKey = event.ctrlKey || false;
        clone.altKey = event.altKey || false;
        clone.shiftKey = event.shiftKey || false;
        clone.metaKey = event.metaKey || false;
        clone.view = event.view || window;
        return clone;
    }
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 12756:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

(function (global, factory) {
     true ? factory(exports, __webpack_require__(78839)) :
    0;
})(this, (function (exports, algorithm) { 'use strict';

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    /**
     * The namespace for JSON-specific functions.
     */
    exports.JSONExt = void 0;
    (function (JSONExt) {
        /**
         * A shared frozen empty JSONObject
         */
        JSONExt.emptyObject = Object.freeze({});
        /**
         * A shared frozen empty JSONArray
         */
        JSONExt.emptyArray = Object.freeze([]);
        /**
         * Test whether a JSON value is a primitive.
         *
         * @param value - The JSON value of interest.
         *
         * @returns `true` if the value is a primitive,`false` otherwise.
         */
        function isPrimitive(value) {
            return (value === null ||
                typeof value === 'boolean' ||
                typeof value === 'number' ||
                typeof value === 'string');
        }
        JSONExt.isPrimitive = isPrimitive;
        function isArray(value) {
            return Array.isArray(value);
        }
        JSONExt.isArray = isArray;
        function isObject(value) {
            return !isPrimitive(value) && !isArray(value);
        }
        JSONExt.isObject = isObject;
        /**
         * Compare two JSON values for deep equality.
         *
         * @param first - The first JSON value of interest.
         *
         * @param second - The second JSON value of interest.
         *
         * @returns `true` if the values are equivalent, `false` otherwise.
         */
        function deepEqual(first, second) {
            // Check referential and primitive equality first.
            if (first === second) {
                return true;
            }
            // If one is a primitive, the `===` check ruled out the other.
            if (isPrimitive(first) || isPrimitive(second)) {
                return false;
            }
            // Test whether they are arrays.
            let a1 = isArray(first);
            let a2 = isArray(second);
            // Bail if the types are different.
            if (a1 !== a2) {
                return false;
            }
            // If they are both arrays, compare them.
            if (a1 && a2) {
                return deepArrayEqual(first, second);
            }
            // At this point, they must both be objects.
            return deepObjectEqual(first, second);
        }
        JSONExt.deepEqual = deepEqual;
        /**
         * Create a deep copy of a JSON value.
         *
         * @param value - The JSON value to copy.
         *
         * @returns A deep copy of the given JSON value.
         */
        function deepCopy(value) {
            // Do nothing for primitive values.
            if (isPrimitive(value)) {
                return value;
            }
            // Deep copy an array.
            if (isArray(value)) {
                return deepArrayCopy(value);
            }
            // Deep copy an object.
            return deepObjectCopy(value);
        }
        JSONExt.deepCopy = deepCopy;
        /**
         * Compare two JSON arrays for deep equality.
         */
        function deepArrayEqual(first, second) {
            // Check referential equality first.
            if (first === second) {
                return true;
            }
            // Test the arrays for equal length.
            if (first.length !== second.length) {
                return false;
            }
            // Compare the values for equality.
            for (let i = 0, n = first.length; i < n; ++i) {
                if (!deepEqual(first[i], second[i])) {
                    return false;
                }
            }
            // At this point, the arrays are equal.
            return true;
        }
        /**
         * Compare two JSON objects for deep equality.
         */
        function deepObjectEqual(first, second) {
            // Check referential equality first.
            if (first === second) {
                return true;
            }
            // Check for the first object's keys in the second object.
            for (let key in first) {
                if (first[key] !== undefined && !(key in second)) {
                    return false;
                }
            }
            // Check for the second object's keys in the first object.
            for (let key in second) {
                if (second[key] !== undefined && !(key in first)) {
                    return false;
                }
            }
            // Compare the values for equality.
            for (let key in first) {
                // Get the values.
                let firstValue = first[key];
                let secondValue = second[key];
                // If both are undefined, ignore the key.
                if (firstValue === undefined && secondValue === undefined) {
                    continue;
                }
                // If only one value is undefined, the objects are not equal.
                if (firstValue === undefined || secondValue === undefined) {
                    return false;
                }
                // Compare the values.
                if (!deepEqual(firstValue, secondValue)) {
                    return false;
                }
            }
            // At this point, the objects are equal.
            return true;
        }
        /**
         * Create a deep copy of a JSON array.
         */
        function deepArrayCopy(value) {
            let result = new Array(value.length);
            for (let i = 0, n = value.length; i < n; ++i) {
                result[i] = deepCopy(value[i]);
            }
            return result;
        }
        /**
         * Create a deep copy of a JSON object.
         */
        function deepObjectCopy(value) {
            let result = {};
            for (let key in value) {
                // Ignore undefined values.
                let subvalue = value[key];
                if (subvalue === undefined) {
                    continue;
                }
                result[key] = deepCopy(subvalue);
            }
            return result;
        }
    })(exports.JSONExt || (exports.JSONExt = {}));

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    /**
     * An object which stores MIME data for general application use.
     *
     * #### Notes
     * This class does not attempt to enforce "correctness" of MIME types
     * and their associated data. Since this class is designed to transfer
     * arbitrary data and objects within the same application, it assumes
     * that the user provides correct and accurate data.
     */
    class MimeData {
        constructor() {
            this._types = [];
            this._values = [];
        }
        /**
         * Get an array of the MIME types contained within the dataset.
         *
         * @returns A new array of the MIME types, in order of insertion.
         */
        types() {
            return this._types.slice();
        }
        /**
         * Test whether the dataset has an entry for the given type.
         *
         * @param mime - The MIME type of interest.
         *
         * @returns `true` if the dataset contains a value for the given
         *   MIME type, `false` otherwise.
         */
        hasData(mime) {
            return this._types.indexOf(mime) !== -1;
        }
        /**
         * Get the data value for the given MIME type.
         *
         * @param mime - The MIME type of interest.
         *
         * @returns The value for the given MIME type, or `undefined` if
         *   the dataset does not contain a value for the type.
         */
        getData(mime) {
            let i = this._types.indexOf(mime);
            return i !== -1 ? this._values[i] : undefined;
        }
        /**
         * Set the data value for the given MIME type.
         *
         * @param mime - The MIME type of interest.
         *
         * @param data - The data value for the given MIME type.
         *
         * #### Notes
         * This will overwrite any previous entry for the MIME type.
         */
        setData(mime, data) {
            this.clearData(mime);
            this._types.push(mime);
            this._values.push(data);
        }
        /**
         * Remove the data entry for the given MIME type.
         *
         * @param mime - The MIME type of interest.
         *
         * #### Notes
         * This is a no-op if there is no entry for the given MIME type.
         */
        clearData(mime) {
            let i = this._types.indexOf(mime);
            if (i !== -1) {
                this._types.splice(i, 1);
                this._values.splice(i, 1);
            }
        }
        /**
         * Remove all data entries from the dataset.
         */
        clear() {
            this._types.length = 0;
            this._values.length = 0;
        }
    }

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /**
     * Plugin registry.
     */
    class PluginRegistry {
        constructor(options = {}) {
            this._application = null;
            this._validatePlugin = () => true;
            this._plugins = new Map();
            this._services = new Map();
            if (options.validatePlugin) {
                console.info('Plugins may be rejected by the custom validation plugin method.');
                this._validatePlugin = options.validatePlugin;
            }
        }
        /**
         * The application object.
         *
         * It will be provided as first argument to the
         * plugins activation and deactivation functions.
         *
         * It can only be set once.
         *
         * By default, it is `null`.
         */
        get application() {
            return this._application;
        }
        set application(v) {
            if (this._application !== null) {
                throw Error('PluginRegistry.application is already set. It cannot be overridden.');
            }
            this._application = v;
        }
        /**
         * The list of all the deferred plugins.
         */
        get deferredPlugins() {
            return Array.from(this._plugins)
                .filter(([id, plugin]) => plugin.autoStart === 'defer')
                .map(([id, plugin]) => id);
        }
        /**
         * Get a plugin description.
         *
         * @param id - The ID of the plugin of interest.
         *
         * @returns The plugin description.
         */
        getPluginDescription(id) {
            var _a, _b;
            return (_b = (_a = this._plugins.get(id)) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : '';
        }
        /**
         * Test whether a plugin is registered with the application.
         *
         * @param id - The ID of the plugin of interest.
         *
         * @returns `true` if the plugin is registered, `false` otherwise.
         */
        hasPlugin(id) {
            return this._plugins.has(id);
        }
        /**
         * Test whether a plugin is activated with the application.
         *
         * @param id - The ID of the plugin of interest.
         *
         * @returns `true` if the plugin is activated, `false` otherwise.
         */
        isPluginActivated(id) {
            var _a, _b;
            return (_b = (_a = this._plugins.get(id)) === null || _a === void 0 ? void 0 : _a.activated) !== null && _b !== void 0 ? _b : false;
        }
        /**
         * List the IDs of the plugins registered with the application.
         *
         * @returns A new array of the registered plugin IDs.
         */
        listPlugins() {
            return Array.from(this._plugins.keys());
        }
        /**
         * Register a plugin with the application.
         *
         * @param plugin - The plugin to register.
         *
         * #### Notes
         * An error will be thrown if a plugin with the same ID is already
         * registered, or if the plugin has a circular dependency.
         *
         * If the plugin provides a service which has already been provided
         * by another plugin, the new service will override the old service.
         */
        registerPlugin(plugin) {
            // Throw an error if the plugin ID is already registered.
            if (this._plugins.has(plugin.id)) {
                throw new TypeError(`Plugin '${plugin.id}' is already registered.`);
            }
            if (!this._validatePlugin(plugin)) {
                throw new Error(`Plugin '${plugin.id}' is not valid.`);
            }
            // Create the normalized plugin data.
            const data = Private.createPluginData(plugin);
            // Ensure the plugin does not cause a cyclic dependency.
            Private.ensureNoCycle(data, this._plugins, this._services);
            // Add the service token to the service map.
            if (data.provides) {
                this._services.set(data.provides, data.id);
            }
            // Add the plugin to the plugin map.
            this._plugins.set(data.id, data);
        }
        /**
         * Register multiple plugins with the application.
         *
         * @param plugins - The plugins to register.
         *
         * #### Notes
         * This calls `registerPlugin()` for each of the given plugins.
         */
        registerPlugins(plugins) {
            for (const plugin of plugins) {
                this.registerPlugin(plugin);
            }
        }
        /**
         * Deregister a plugin with the application.
         *
         * @param id - The ID of the plugin of interest.
         *
         * @param force - Whether to deregister the plugin even if it is active.
         */
        deregisterPlugin(id, force) {
            const plugin = this._plugins.get(id);
            if (!plugin) {
                return;
            }
            if (plugin.activated && !force) {
                throw new Error(`Plugin '${id}' is still active.`);
            }
            this._plugins.delete(id);
        }
        /**
         * Activate the plugin with the given ID.
         *
         * @param id - The ID of the plugin of interest.
         *
         * @returns A promise which resolves when the plugin is activated
         *   or rejects with an error if it cannot be activated.
         */
        async activatePlugin(id) {
            // Reject the promise if the plugin is not registered.
            const plugin = this._plugins.get(id);
            if (!plugin) {
                throw new ReferenceError(`Plugin '${id}' is not registered.`);
            }
            // Resolve immediately if the plugin is already activated.
            if (plugin.activated) {
                return;
            }
            // Return the pending resolver promise if it exists.
            if (plugin.promise) {
                return plugin.promise;
            }
            // Resolve the required services for the plugin.
            const required = plugin.requires.map(t => this.resolveRequiredService(t));
            // Resolve the optional services for the plugin.
            const optional = plugin.optional.map(t => this.resolveOptionalService(t));
            // Setup the resolver promise for the plugin.
            plugin.promise = Promise.all([...required, ...optional])
                .then(services => plugin.activate.apply(undefined, [this.application, ...services]))
                .then(service => {
                plugin.service = service;
                plugin.activated = true;
                plugin.promise = null;
            })
                .catch(error => {
                plugin.promise = null;
                throw error;
            });
            // Return the pending resolver promise.
            return plugin.promise;
        }
        /**
         * Activate all the deferred plugins.
         *
         * @returns A promise which will resolve when each plugin is activated
         * or rejects with an error if one cannot be activated.
         */
        async activatePlugins(kind, options = {}) {
            switch (kind) {
                case 'defer': {
                    const promises = this.deferredPlugins
                        .filter(pluginId => this._plugins.get(pluginId).autoStart)
                        .map(pluginId => {
                        return this.activatePlugin(pluginId);
                    });
                    await Promise.all(promises);
                    break;
                }
                case 'startUp': {
                    // Collect the ids of the startup plugins.
                    const startups = Private.collectStartupPlugins(this._plugins, options);
                    // Generate the activation promises.
                    const promises = startups.map(async (id) => {
                        try {
                            return await this.activatePlugin(id);
                        }
                        catch (error) {
                            console.error(`Plugin '${id}' failed to activate.`, error);
                        }
                    });
                    await Promise.all(promises);
                    break;
                }
            }
        }
        /**
         * Deactivate the plugin and its downstream dependents if and only if the
         * plugin and its dependents all support `deactivate`.
         *
         * @param id - The ID of the plugin of interest.
         *
         * @returns A list of IDs of downstream plugins deactivated with this one.
         */
        async deactivatePlugin(id) {
            // Reject the promise if the plugin is not registered.
            const plugin = this._plugins.get(id);
            if (!plugin) {
                throw new ReferenceError(`Plugin '${id}' is not registered.`);
            }
            // Bail early if the plugin is not activated.
            if (!plugin.activated) {
                return [];
            }
            // Check that this plugin can deactivate.
            if (!plugin.deactivate) {
                throw new TypeError(`Plugin '${id}'#deactivate() method missing`);
            }
            // Find the optimal deactivation order for plugins downstream of this one.
            const manifest = Private.findDependents(id, this._plugins, this._services);
            const downstream = manifest.map(id => this._plugins.get(id));
            // Check that all downstream plugins can deactivate.
            for (const plugin of downstream) {
                if (!plugin.deactivate) {
                    throw new TypeError(`Plugin ${plugin.id}#deactivate() method missing (depends on ${id})`);
                }
            }
            // Deactivate all downstream plugins.
            for (const plugin of downstream) {
                const services = [...plugin.requires, ...plugin.optional].map(service => {
                    const id = this._services.get(service);
                    return id ? this._plugins.get(id).service : null;
                });
                // Await deactivation so the next plugins only receive active services.
                await plugin.deactivate(this.application, ...services);
                plugin.service = null;
                plugin.activated = false;
            }
            // Remove plugin ID and return manifest of deactivated plugins.
            manifest.pop();
            return manifest;
        }
        /**
         * Resolve a required service of a given type.
         *
         * @param token - The token for the service type of interest.
         *
         * @returns A promise which resolves to an instance of the requested
         *   service, or rejects with an error if it cannot be resolved.
         *
         * #### Notes
         * Services are singletons. The same instance will be returned each
         * time a given service token is resolved.
         *
         * If the plugin which provides the service has not been activated,
         * resolving the service will automatically activate the plugin.
         *
         * User code will not typically call this method directly. Instead,
         * the required services for the user's plugins will be resolved
         * automatically when the plugin is activated.
         */
        async resolveRequiredService(token) {
            // Reject the promise if there is no provider for the type.
            const id = this._services.get(token);
            if (!id) {
                throw new TypeError(`No provider for: ${token.name}.`);
            }
            // Activate the plugin if necessary.
            const plugin = this._plugins.get(id);
            if (!plugin.activated) {
                await this.activatePlugin(id);
            }
            return plugin.service;
        }
        /**
         * Resolve an optional service of a given type.
         *
         * @param token - The token for the service type of interest.
         *
         * @returns A promise which resolves to an instance of the requested
         *   service, or `null` if it cannot be resolved.
         *
         * #### Notes
         * Services are singletons. The same instance will be returned each
         * time a given service token is resolved.
         *
         * If the plugin which provides the service has not been activated,
         * resolving the service will automatically activate the plugin.
         *
         * User code will not typically call this method directly. Instead,
         * the optional services for the user's plugins will be resolved
         * automatically when the plugin is activated.
         */
        async resolveOptionalService(token) {
            // Resolve with `null` if there is no provider for the type.
            const id = this._services.get(token);
            if (!id) {
                return null;
            }
            // Activate the plugin if necessary.
            const plugin = this._plugins.get(id);
            if (!plugin.activated) {
                try {
                    await this.activatePlugin(id);
                }
                catch (reason) {
                    console.error(reason);
                    return null;
                }
            }
            return plugin.service;
        }
    }
    /**
     * The namespace for the module implementation details.
     */
    var Private;
    (function (Private) {
        class PluginData {
            constructor(plugin) {
                var _a, _b, _c, _d;
                this._activated = false;
                this._promise = null;
                this._service = null;
                this.id = plugin.id;
                this.description = (_a = plugin.description) !== null && _a !== void 0 ? _a : '';
                this.activate = plugin.activate;
                this.deactivate = (_b = plugin.deactivate) !== null && _b !== void 0 ? _b : null;
                this.provides = (_c = plugin.provides) !== null && _c !== void 0 ? _c : null;
                this.autoStart = (_d = plugin.autoStart) !== null && _d !== void 0 ? _d : false;
                this.requires = plugin.requires ? plugin.requires.slice() : [];
                this.optional = plugin.optional ? plugin.optional.slice() : [];
            }
            /**
             * Whether the plugin has been activated.
             */
            get activated() {
                return this._activated;
            }
            set activated(a) {
                this._activated = a;
            }
            /**
             * The resolved service for the plugin, or `null`.
             */
            get service() {
                return this._service;
            }
            set service(s) {
                this._service = s;
            }
            /**
             * The pending resolver promise, or `null`.
             */
            get promise() {
                return this._promise;
            }
            set promise(p) {
                this._promise = p;
            }
        }
        /**
         * Create a normalized plugin data object for the given plugin.
         */
        function createPluginData(plugin) {
            return new PluginData(plugin);
        }
        Private.createPluginData = createPluginData;
        /**
         * Ensure no cycle is present in the plugin resolution graph.
         *
         * If a cycle is detected, an error will be thrown.
         */
        function ensureNoCycle(plugin, plugins, services) {
            const dependencies = [...plugin.requires, ...plugin.optional];
            const visit = (token) => {
                if (token === plugin.provides) {
                    return true;
                }
                const id = services.get(token);
                if (!id) {
                    return false;
                }
                const visited = plugins.get(id);
                const dependencies = [...visited.requires, ...visited.optional];
                if (dependencies.length === 0) {
                    return false;
                }
                trace.push(id);
                if (dependencies.some(visit)) {
                    return true;
                }
                trace.pop();
                return false;
            };
            // Bail early if there cannot be a cycle.
            if (!plugin.provides || dependencies.length === 0) {
                return;
            }
            // Setup a stack to trace service resolution.
            const trace = [plugin.id];
            // Throw an exception if a cycle is present.
            if (dependencies.some(visit)) {
                throw new ReferenceError(`Cycle detected: ${trace.join(' -> ')}.`);
            }
        }
        Private.ensureNoCycle = ensureNoCycle;
        /**
         * Find dependents in deactivation order.
         *
         * @param id - The ID of the plugin of interest.
         *
         * @param plugins - The map containing all plugins.
         *
         * @param services - The map containing all services.
         *
         * @returns A list of dependent plugin IDs in order of deactivation
         *
         * #### Notes
         * The final item of the returned list is always the plugin of interest.
         */
        function findDependents(id, plugins, services) {
            const edges = new Array();
            const add = (id) => {
                const plugin = plugins.get(id);
                // FIXME In the case of missing optional dependencies, we may consider
                // deactivating and reactivating the plugin without the missing service.
                const dependencies = [...plugin.requires, ...plugin.optional];
                edges.push(...dependencies.reduce((acc, dep) => {
                    const service = services.get(dep);
                    if (service) {
                        // An edge is oriented from dependent to provider.
                        acc.push([id, service]);
                    }
                    return acc;
                }, []));
            };
            for (const id of plugins.keys()) {
                add(id);
            }
            // Filter edges
            // - Get all packages that dependent on the package to be deactivated
            const newEdges = edges.filter(edge => edge[1] === id);
            let oldSize = 0;
            while (newEdges.length > oldSize) {
                const previousSize = newEdges.length;
                // Get all packages that dependent on packages that will be deactivated
                const packagesOfInterest = new Set(newEdges.map(edge => edge[0]));
                for (const poi of packagesOfInterest) {
                    edges
                        .filter(edge => edge[1] === poi)
                        .forEach(edge => {
                        // We check it is not already included to deal with circular dependencies
                        if (!newEdges.includes(edge)) {
                            newEdges.push(edge);
                        }
                    });
                }
                oldSize = previousSize;
            }
            const sorted = algorithm.topologicSort(newEdges);
            const index = sorted.findIndex(candidate => candidate === id);
            if (index === -1) {
                return [id];
            }
            return sorted.slice(0, index + 1);
        }
        Private.findDependents = findDependents;
        /**
         * Collect the IDs of the plugins to activate on startup.
         */
        function collectStartupPlugins(plugins, options) {
            // Create a set to hold the plugin IDs.
            const collection = new Set();
            // Collect the auto-start (non deferred) plugins.
            for (const id of plugins.keys()) {
                if (plugins.get(id).autoStart === true) {
                    collection.add(id);
                }
            }
            // Add the startup plugins.
            if (options.startPlugins) {
                for (const id of options.startPlugins) {
                    collection.add(id);
                }
            }
            // Remove the ignored plugins.
            if (options.ignorePlugins) {
                for (const id of options.ignorePlugins) {
                    collection.delete(id);
                }
            }
            // Return the collected startup plugins.
            return Array.from(collection);
        }
        Private.collectStartupPlugins = collectStartupPlugins;
    })(Private || (Private = {}));

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    /**
     * A class which wraps a promise into a delegate object.
     *
     * #### Notes
     * This class is useful when the logic to resolve or reject a promise
     * cannot be defined at the point where the promise is created.
     */
    class PromiseDelegate {
        /**
         * Construct a new promise delegate.
         */
        constructor() {
            this.promise = new Promise((resolve, reject) => {
                this._resolve = resolve;
                this._reject = reject;
            });
        }
        /**
         * Resolve the wrapped promise with the given value.
         *
         * @param value - The value to use for resolving the promise.
         */
        resolve(value) {
            let resolve = this._resolve;
            resolve(value);
        }
        /**
         * Reject the wrapped promise with the given value.
         *
         * @reason - The reason for rejecting the promise.
         */
        reject(reason) {
            let reject = this._reject;
            reject(reason);
        }
    }

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    /**
     * A runtime object which captures compile-time type information.
     *
     * #### Notes
     * A token captures the compile-time type of an interface or class in
     * an object which can be used at runtime in a type-safe fashion.
     */
    class Token {
        /**
         * Construct a new token.
         *
         * @param name - A human readable name for the token.
         * @param description - Token purpose description for documentation.
         */
        constructor(name, description) {
            this.name = name;
            this.description = description !== null && description !== void 0 ? description : '';
            this._tokenStructuralPropertyT = null;
        }
    }

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    // Fallback
    function fallbackRandomValues(buffer) {
        let value = 0;
        for (let i = 0, n = buffer.length; i < n; ++i) {
            if (i % 4 === 0) {
                value = (Math.random() * 0xffffffff) >>> 0;
            }
            buffer[i] = value & 0xff;
            value >>>= 8;
        }
    }

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    /**
     * The namespace for random number related functionality.
     */
    exports.Random = void 0;
    (function (Random) {
        /**
         * A function which generates random bytes.
         *
         * @param buffer - The `Uint8Array` to fill with random bytes.
         *
         * #### Notes
         * A cryptographically strong random number generator will be used if
         * available. Otherwise, `Math.random` will be used as a fallback for
         * randomness.
         *
         * The following RNGs are supported, listed in order of precedence:
         *   - `window.crypto.getRandomValues`
         *   - `window.msCrypto.getRandomValues`
         *   - `require('crypto').randomFillSync
         *   - `require('crypto').randomBytes
         *   - `Math.random`
         */
        Random.getRandomValues = (() => {
            // Look up the crypto module if available.
            const crypto = (typeof window !== 'undefined' && (window.crypto || window.msCrypto)) ||
                null;
            // Modern browsers and IE 11
            if (crypto && typeof crypto.getRandomValues === 'function') {
                return function getRandomValues(buffer) {
                    return crypto.getRandomValues(buffer);
                };
            }
            // Fallback
            return fallbackRandomValues;
        })();
    })(exports.Random || (exports.Random = {}));

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    /**
     * A function which creates a function that generates UUID v4 identifiers.
     *
     * @returns A new function that creates a UUID v4 string.
     *
     * #### Notes
     * This implementation complies with RFC 4122.
     *
     * This uses `Random.getRandomValues()` for random bytes, which in
     * turn will use the underlying `crypto` module of the platform if
     * it is available. The fallback for randomness is `Math.random`.
     */
    function uuid4Factory(getRandomValues) {
        // Create a 16 byte array to hold the random values.
        const bytes = new Uint8Array(16);
        // Create a look up table from bytes to hex strings.
        const lut = new Array(256);
        // Pad the single character hex digits with a leading zero.
        for (let i = 0; i < 16; ++i) {
            lut[i] = '0' + i.toString(16);
        }
        // Populate the rest of the hex digits.
        for (let i = 16; i < 256; ++i) {
            lut[i] = i.toString(16);
        }
        // Return a function which generates the UUID.
        return function uuid4() {
            // Get a new batch of random values.
            getRandomValues(bytes);
            // Set the UUID version number to 4.
            bytes[6] = 0x40 | (bytes[6] & 0x0f);
            // Set the clock sequence bit to the RFC spec.
            bytes[8] = 0x80 | (bytes[8] & 0x3f);
            // Assemble the UUID string.
            return (lut[bytes[0]] +
                lut[bytes[1]] +
                lut[bytes[2]] +
                lut[bytes[3]] +
                '-' +
                lut[bytes[4]] +
                lut[bytes[5]] +
                '-' +
                lut[bytes[6]] +
                lut[bytes[7]] +
                '-' +
                lut[bytes[8]] +
                lut[bytes[9]] +
                '-' +
                lut[bytes[10]] +
                lut[bytes[11]] +
                lut[bytes[12]] +
                lut[bytes[13]] +
                lut[bytes[14]] +
                lut[bytes[15]]);
        };
    }

    // Copyright (c) Jupyter Development Team.
    // Distributed under the terms of the Modified BSD License.
    /*-----------------------------------------------------------------------------
    | Copyright (c) 2014-2017, PhosphorJS Contributors
    |
    | Distributed under the terms of the BSD 3-Clause License.
    |
    | The full license is in the file LICENSE, distributed with this software.
    |----------------------------------------------------------------------------*/
    /**
     * The namespace for UUID related functionality.
     */
    exports.UUID = void 0;
    (function (UUID) {
        /**
         * A function which generates UUID v4 identifiers.
         *
         * @returns A new UUID v4 string.
         *
         * #### Notes
         * This implementation complies with RFC 4122.
         *
         * This uses `Random.getRandomValues()` for random bytes, which in
         * turn will use the underlying `crypto` module of the platform if
         * it is available. The fallback for randomness is `Math.random`.
         */
        UUID.uuid4 = uuid4Factory(exports.Random.getRandomValues);
    })(exports.UUID || (exports.UUID = {}));

    exports.MimeData = MimeData;
    exports.PluginRegistry = PluginRegistry;
    exports.PromiseDelegate = PromiseDelegate;
    exports.Token = Token;

}));
//# sourceMappingURL=index.js.map


/***/ }),

/***/ 65451:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DisposableDelegate: () => (/* binding */ DisposableDelegate),
/* harmony export */   DisposableSet: () => (/* binding */ DisposableSet),
/* harmony export */   ObservableDisposableDelegate: () => (/* binding */ ObservableDisposableDelegate),
/* harmony export */   ObservableDisposableSet: () => (/* binding */ ObservableDisposableSet)
/* harmony export */ });
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_0__);


// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module disposable
 */
/**
 * A disposable object which delegates to a callback function.
 */
class DisposableDelegate {
    /**
     * Construct a new disposable delegate.
     *
     * @param fn - The callback function to invoke on dispose.
     */
    constructor(fn) {
        this._fn = fn;
    }
    /**
     * Test whether the delegate has been disposed.
     */
    get isDisposed() {
        return !this._fn;
    }
    /**
     * Dispose of the delegate and invoke the callback function.
     */
    dispose() {
        if (!this._fn) {
            return;
        }
        let fn = this._fn;
        this._fn = null;
        fn();
    }
}
/**
 * An observable disposable object which delegates to a callback function.
 */
class ObservableDisposableDelegate extends DisposableDelegate {
    constructor() {
        super(...arguments);
        this._disposed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_0__.Signal(this);
    }
    /**
     * A signal emitted when the delegate is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Dispose of the delegate and invoke the callback function.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
        this._disposed.emit(undefined);
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_0__.Signal.clearData(this);
    }
}
/**
 * An object which manages a collection of disposable items.
 */
class DisposableSet {
    constructor() {
        this._isDisposed = false;
        this._items = new Set();
    }
    /**
     * Test whether the set has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the set and the items it contains.
     *
     * #### Notes
     * Items are disposed in the order they are added to the set.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._items.forEach(item => {
            item.dispose();
        });
        this._items.clear();
    }
    /**
     * Test whether the set contains a specific item.
     *
     * @param item - The item of interest.
     *
     * @returns `true` if the set contains the item, `false` otherwise.
     */
    contains(item) {
        return this._items.has(item);
    }
    /**
     * Add a disposable item to the set.
     *
     * @param item - The item to add to the set.
     *
     * #### Notes
     * If the item is already contained in the set, this is a no-op.
     */
    add(item) {
        this._items.add(item);
    }
    /**
     * Remove a disposable item from the set.
     *
     * @param item - The item to remove from the set.
     *
     * #### Notes
     * If the item is not contained in the set, this is a no-op.
     */
    remove(item) {
        this._items.delete(item);
    }
    /**
     * Remove all items from the set.
     */
    clear() {
        this._items.clear();
    }
}
/**
 * The namespace for the `DisposableSet` class statics.
 */
(function (DisposableSet) {
    /**
     * Create a disposable set from an iterable of items.
     *
     * @param items - The iterable object of interest.
     *
     * @returns A new disposable initialized with the given items.
     */
    function from(items) {
        let set = new DisposableSet();
        for (const item of items) {
            set.add(item);
        }
        return set;
    }
    DisposableSet.from = from;
})(DisposableSet || (DisposableSet = {}));
/**
 * An observable object which manages a collection of disposable items.
 */
class ObservableDisposableSet extends DisposableSet {
    constructor() {
        super(...arguments);
        this._disposed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_0__.Signal(this);
    }
    /**
     * A signal emitted when the set is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Dispose of the set and the items it contains.
     *
     * #### Notes
     * Items are disposed in the order they are added to the set.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        super.dispose();
        this._disposed.emit(undefined);
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_0__.Signal.clearData(this);
    }
}
/**
 * The namespace for the `ObservableDisposableSet` class statics.
 */
(function (ObservableDisposableSet) {
    /**
     * Create an observable disposable set from an iterable of items.
     *
     * @param items - The iterable object of interest.
     *
     * @returns A new disposable initialized with the given items.
     */
    function from(items) {
        let set = new ObservableDisposableSet();
        for (const item of items) {
            set.add(item);
        }
        return set;
    }
    ObservableDisposableSet.from = from;
})(ObservableDisposableSet || (ObservableDisposableSet = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 1696:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ClipboardExt: () => (/* binding */ ClipboardExt),
/* harmony export */   ElementExt: () => (/* binding */ ElementExt),
/* harmony export */   Platform: () => (/* binding */ Platform),
/* harmony export */   Selector: () => (/* binding */ Selector)
/* harmony export */ });
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2019, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * The namespace for clipboard related functionality.
 */
var ClipboardExt;
(function (ClipboardExt) {
    /**
     * Copy text to the system clipboard.
     *
     * @param text - The text to copy to the clipboard.
     */
    function copyText(text) {
        // Fetch the document body.
        const body = document.body;
        // Set up the clipboard event listener.
        const handler = (event) => {
            // Stop the event propagation.
            event.preventDefault();
            event.stopPropagation();
            // Set the clipboard data.
            event.clipboardData.setData('text', text);
            // Remove the event listener.
            body.removeEventListener('copy', handler, true);
        };
        // Add the event listener.
        body.addEventListener('copy', handler, true);
        // Trigger the event.
        document.execCommand('copy');
    }
    ClipboardExt.copyText = copyText;
})(ClipboardExt || (ClipboardExt = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * The namespace for element related utilities.
 */
var ElementExt;
(function (ElementExt) {
    /**
     * Compute the box sizing for an element.
     *
     * @param element - The element of interest.
     *
     * @returns The box sizing data for the specified element.
     */
    function boxSizing(element) {
        let style = window.getComputedStyle(element);
        let bt = parseFloat(style.borderTopWidth) || 0;
        let bl = parseFloat(style.borderLeftWidth) || 0;
        let br = parseFloat(style.borderRightWidth) || 0;
        let bb = parseFloat(style.borderBottomWidth) || 0;
        let pt = parseFloat(style.paddingTop) || 0;
        let pl = parseFloat(style.paddingLeft) || 0;
        let pr = parseFloat(style.paddingRight) || 0;
        let pb = parseFloat(style.paddingBottom) || 0;
        let hs = bl + pl + pr + br;
        let vs = bt + pt + pb + bb;
        return {
            borderTop: bt,
            borderLeft: bl,
            borderRight: br,
            borderBottom: bb,
            paddingTop: pt,
            paddingLeft: pl,
            paddingRight: pr,
            paddingBottom: pb,
            horizontalSum: hs,
            verticalSum: vs
        };
    }
    ElementExt.boxSizing = boxSizing;
    /**
     * Compute the size limits for an element.
     *
     * @param element - The element of interest.
     *
     * @returns The size limit data for the specified element.
     */
    function sizeLimits(element) {
        let style = window.getComputedStyle(element);
        let minWidth = parseFloat(style.minWidth) || 0;
        let minHeight = parseFloat(style.minHeight) || 0;
        let maxWidth = parseFloat(style.maxWidth) || Infinity;
        let maxHeight = parseFloat(style.maxHeight) || Infinity;
        maxWidth = Math.max(minWidth, maxWidth);
        maxHeight = Math.max(minHeight, maxHeight);
        return { minWidth, minHeight, maxWidth, maxHeight };
    }
    ElementExt.sizeLimits = sizeLimits;
    /**
     * Test whether a client position lies within an element.
     *
     * @param element - The DOM element of interest.
     *
     * @param clientX - The client X coordinate of interest.
     *
     * @param clientY - The client Y coordinate of interest.
     *
     * @returns Whether the point is within the given element.
     */
    function hitTest(element, clientX, clientY) {
        let rect = element.getBoundingClientRect();
        return (clientX >= rect.left &&
            clientX < rect.right &&
            clientY >= rect.top &&
            clientY < rect.bottom);
    }
    ElementExt.hitTest = hitTest;
    /**
     * Vertically scroll an element into view if needed.
     *
     * @param area - The scroll area element.
     *
     * @param element - The element of interest.
     *
     * #### Notes
     * This follows the "nearest" behavior of the native `scrollIntoView`
     * method, which is not supported by all browsers.
     * https://drafts.csswg.org/cssom-view/#element-scrolling-members
     *
     * If the element fully covers the visible area or is fully contained
     * within the visible area, no scrolling will take place. Otherwise,
     * the nearest edges of the area and element are aligned.
     */
    function scrollIntoViewIfNeeded(area, element) {
        let ar = area.getBoundingClientRect();
        let er = element.getBoundingClientRect();
        if (er.top <= ar.top && er.bottom >= ar.bottom) {
            return;
        }
        if (er.top < ar.top && er.height <= ar.height) {
            area.scrollTop -= ar.top - er.top;
            return;
        }
        if (er.bottom > ar.bottom && er.height >= ar.height) {
            area.scrollTop -= ar.top - er.top;
            return;
        }
        if (er.top < ar.top && er.height > ar.height) {
            area.scrollTop -= ar.bottom - er.bottom;
            return;
        }
        if (er.bottom > ar.bottom && er.height < ar.height) {
            area.scrollTop -= ar.bottom - er.bottom;
            return;
        }
    }
    ElementExt.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;
})(ElementExt || (ElementExt = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * The namespace for platform related utilities.
 */
var Platform;
(function (Platform) {
    /**
     * A flag indicating whether the platform is Mac.
     */
    Platform.IS_MAC = !!navigator.platform.match(/Mac/i);
    /**
     * A flag indicating whether the platform is Windows.
     */
    Platform.IS_WIN = !!navigator.platform.match(/Win/i);
    /**
     * A flag indicating whether the browser is IE.
     */
    Platform.IS_IE = /Trident/.test(navigator.userAgent);
    /**
     * A flag indicating whether the browser is Edge.
     */
    Platform.IS_EDGE = /Edge/.test(navigator.userAgent);
    /**
     * Test whether the `accel` key is pressed.
     *
     * @param event - The keyboard or mouse event of interest.
     *
     * @returns Whether the `accel` key is pressed.
     *
     * #### Notes
     * On Mac the `accel` key is the command key. On all other
     * platforms the `accel` key is the control key.
     */
    function accelKey(event) {
        return Platform.IS_MAC ? event.metaKey : event.ctrlKey;
    }
    Platform.accelKey = accelKey;
})(Platform || (Platform = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * The namespace for selector related utilities.
 */
var Selector;
(function (Selector) {
    /**
     * Calculate the specificity of a single CSS selector.
     *
     * @param selector - The CSS selector of interest.
     *
     * @returns The specificity of the selector.
     *
     * #### Undefined Behavior
     * The selector is invalid.
     *
     * #### Notes
     * This is based on https://www.w3.org/TR/css3-selectors/#specificity
     *
     * A larger number represents a more specific selector.
     *
     * The smallest possible specificity is `0`.
     *
     * The result is represented as a hex number `0x<aa><bb><cc>` where
     * each component is the count of the respective selector clause.
     *
     * If the selector contains commas, only the first clause is used.
     *
     * The computed result is cached, so subsequent calculations for the
     * same selector are extremely fast.
     */
    function calculateSpecificity(selector) {
        if (selector in Private.specificityCache) {
            return Private.specificityCache[selector];
        }
        let result = Private.calculateSingle(selector);
        return (Private.specificityCache[selector] = result);
    }
    Selector.calculateSpecificity = calculateSpecificity;
    /**
     * Test whether a selector is a valid CSS selector.
     *
     * @param selector - The CSS selector of interest.
     *
     * @returns `true` if the selector is valid, `false` otherwise.
     *
     * #### Notes
     * The computed result is cached, so subsequent tests for the same
     * selector are extremely fast.
     */
    function isValid(selector) {
        if (selector in Private.validityCache) {
            return Private.validityCache[selector];
        }
        let result = true;
        try {
            Private.testElem.querySelector(selector);
        }
        catch (err) {
            result = false;
        }
        return (Private.validityCache[selector] = result);
    }
    Selector.isValid = isValid;
    /**
     * Test whether an element matches a CSS selector.
     *
     * @param element - The element of interest.
     *
     * @param selector - The valid CSS selector of interest.
     *
     * @returns `true` if the element is a match, `false` otherwise.
     *
     * #### Notes
     * This function uses the builtin browser capabilities when possible,
     * falling back onto a document query otherwise.
     */
    function matches(element, selector) {
        return Private.protoMatchFunc.call(element, selector);
    }
    Selector.matches = matches;
})(Selector || (Selector = {}));
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * A cache of computed selector specificity values.
     */
    Private.specificityCache = Object.create(null);
    /**
     * A cache of computed selector validity.
     */
    Private.validityCache = Object.create(null);
    /**
     * An empty element for testing selector validity.
     */
    Private.testElem = document.createElement('div');
    /**
     * A cross-browser CSS selector matching prototype function.
     */
    Private.protoMatchFunc = (() => {
        let proto = Element.prototype;
        return (proto.matches ||
            proto.matchesSelector ||
            proto.mozMatchesSelector ||
            proto.msMatchesSelector ||
            proto.oMatchesSelector ||
            proto.webkitMatchesSelector ||
            function (selector) {
                let elem = this;
                let matches = elem.ownerDocument
                    ? elem.ownerDocument.querySelectorAll(selector)
                    : [];
                return Array.prototype.indexOf.call(matches, elem) !== -1;
            });
    })();
    /**
     * Calculate the specificity of a single selector.
     *
     * The behavior is undefined if the selector is invalid.
     */
    function calculateSingle(selector) {
        // Ignore anything after the first comma.
        selector = selector.split(',', 1)[0];
        // Setup the aggregate counters.
        let a = 0;
        let b = 0;
        let c = 0;
        // Apply a regex to the front of the selector. If it succeeds, that
        // portion of the selector is removed. Returns a success/fail flag.
        function match(re) {
            let match = selector.match(re);
            if (match === null) {
                return false;
            }
            selector = selector.slice(match[0].length);
            return true;
        }
        // Replace the negation pseudo-class (which is ignored),
        // but keep its inner content (which is not ignored).
        selector = selector.replace(NEGATION_RE, ' $1 ');
        // Continue matching until the selector is consumed.
        while (selector.length > 0) {
            // Match an ID selector.
            if (match(ID_RE)) {
                a++;
                continue;
            }
            // Match a class selector.
            if (match(CLASS_RE)) {
                b++;
                continue;
            }
            // Match an attribute selector.
            if (match(ATTR_RE)) {
                b++;
                continue;
            }
            // Match a pseudo-element selector. This is done before matching
            // a pseudo-class since this regex overlaps with that regex.
            if (match(PSEUDO_ELEM_RE)) {
                c++;
                continue;
            }
            // Match a pseudo-class selector.
            if (match(PSEDUO_CLASS_RE)) {
                b++;
                continue;
            }
            // Match a plain type selector.
            if (match(TYPE_RE)) {
                c++;
                continue;
            }
            // Finally, match any ignored characters.
            if (match(IGNORE_RE)) {
                continue;
            }
            // At this point, the selector is assumed to be invalid.
            return 0;
        }
        // Clamp each component to a reasonable base.
        a = Math.min(a, 0xff);
        b = Math.min(b, 0xff);
        c = Math.min(c, 0xff);
        // Combine the components into a single result.
        return (a << 16) | (b << 8) | c;
    }
    Private.calculateSingle = calculateSingle;
    /**
     * A regex which matches an ID selector at string start.
     */
    const ID_RE = /^#[^\s\+>~#\.\[:]+/;
    /**
     * A regex which matches a class selector at string start.
     */
    const CLASS_RE = /^\.[^\s\+>~#\.\[:]+/;
    /**
     * A regex which matches an attribute selector at string start.
     */
    const ATTR_RE = /^\[[^\]]+\]/;
    /**
     * A regex which matches a type selector at string start.
     */
    const TYPE_RE = /^[^\s\+>~#\.\[:]+/;
    /**
     * A regex which matches a pseudo-element selector at string start.
     */
    const PSEUDO_ELEM_RE = /^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/;
    /**
     * A regex which matches a pseudo-class selector at string start.
     */
    const PSEDUO_CLASS_RE = /^:[^\s\+>~#\.\[:]+/;
    /**
     * A regex which matches ignored characters at string start.
     */
    const IGNORE_RE = /^[\s\+>~\*]+/;
    /**
     * A regex which matches the negation pseudo-class globally.
     */
    const NEGATION_RE = /:not\(([^\)]+)\)/g;
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 54291:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Drag: () => (/* binding */ Drag)
/* harmony export */ });
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61533);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_0__);


/**
 * An object which manages a drag-drop operation.
 *
 * A drag object dispatches four different events to drop targets:
 *
 * - `'lm-dragenter'` - Dispatched when the mouse enters the target
 *   element. This event must be canceled in order to receive any
 *   of the other events.
 *
 * - `'lm-dragover'` - Dispatched when the mouse moves over the drop
 *   target. It must cancel the event and set the `dropAction` to one
 *   of the supported actions in order to receive drop events.
 *
 * - `'lm-dragleave'` - Dispatched when the mouse leaves the target
 *   element. This includes moving the mouse into child elements.
 *
 * - `'lm-drop'`- Dispatched when the mouse is released over the target
 *   element when the target indicates an appropriate drop action. If
 *   the event is canceled, the indicated drop action is returned to
 *   the initiator through the resolved promise.
 *
 * A drag operation can be terminated at any time by pressing `Escape`
 * or by disposing the drag object.
 *
 * A drag object has the ability to automatically scroll a scrollable
 * element when the mouse is hovered near one of its edges. To enable
 * this, add the `data-lm-dragscroll` attribute to any element which
 * the drag object should consider for scrolling.
 *
 * #### Notes
 * This class is designed to be used when dragging and dropping custom
 * data *within* a single application. It is *not* a replacement for
 * the native drag-drop API. Instead, it provides an API which allows
 * drag operations to be initiated programmatically and enables the
 * transfer of arbitrary non-string objects; features which are not
 * possible with the native drag-drop API.
 */
class Drag {
    /**
     * Construct a new drag object.
     *
     * @param options - The options for initializing the drag.
     */
    constructor(options) {
        /**
         * The scroll loop handler function.
         */
        this._onScrollFrame = () => {
            // Bail early if there is no scroll target.
            if (!this._scrollTarget) {
                return;
            }
            // Unpack the scroll target.
            let { element, edge, distance } = this._scrollTarget;
            // Calculate the scroll delta using nonlinear acceleration.
            let d = Private.SCROLL_EDGE_SIZE - distance;
            let f = Math.pow(d / Private.SCROLL_EDGE_SIZE, 2);
            let s = Math.max(1, Math.round(f * Private.SCROLL_EDGE_SIZE));
            // Scroll the element in the specified direction.
            switch (edge) {
                case 'top':
                    element.scrollTop -= s;
                    break;
                case 'left':
                    element.scrollLeft -= s;
                    break;
                case 'right':
                    element.scrollLeft += s;
                    break;
                case 'bottom':
                    element.scrollTop += s;
                    break;
            }
            // Request the next cycle of the scroll loop.
            requestAnimationFrame(this._onScrollFrame);
        };
        this._disposed = false;
        this._dropAction = 'none';
        this._override = null;
        this._currentTarget = null;
        this._currentElement = null;
        this._promise = null;
        this._scrollTarget = null;
        this._resolve = null;
        this.document = options.document || document;
        this.mimeData = options.mimeData;
        this.dragImage = options.dragImage || null;
        this.proposedAction = options.proposedAction || 'copy';
        this.supportedActions = options.supportedActions || 'all';
        this.source = options.source || null;
    }
    /**
     * Dispose of the resources held by the drag object.
     *
     * #### Notes
     * This will cancel the drag operation if it is active.
     */
    dispose() {
        // Do nothing if the drag object is already disposed.
        if (this._disposed) {
            return;
        }
        this._disposed = true;
        // If there is a current target, dispatch a drag leave event.
        if (this._currentTarget) {
            let event = new PointerEvent('pointerup', {
                bubbles: true,
                cancelable: true,
                clientX: -1,
                clientY: -1
            });
            Private.dispatchDragLeave(this, this._currentTarget, null, event);
        }
        // Finalize the drag object with `'none'`.
        this._finalize('none');
    }
    /**
     * Test whether the drag object is disposed.
     */
    get isDisposed() {
        return this._disposed;
    }
    /**
     * Start the drag operation at the specified client position.
     *
     * @param clientX - The client X position for the drag start.
     *
     * @param clientY - The client Y position for the drag start.
     *
     * @returns A promise which resolves to the result of the drag.
     *
     * #### Notes
     * If the drag has already been started, the promise created by the
     * first call to `start` is returned.
     *
     * If the drag operation has ended, or if the drag object has been
     * disposed, the returned promise will resolve to `'none'`.
     *
     * The drag object will be automatically disposed when drag operation
     * completes. This means `Drag` objects are for single-use only.
     *
     * This method assumes the left mouse button is already held down.
     */
    start(clientX, clientY) {
        // If the drag object is already disposed, resolve to `none`.
        if (this._disposed) {
            return Promise.resolve('none');
        }
        // If the drag has already been started, return the promise.
        if (this._promise) {
            return this._promise;
        }
        // Install the document listeners for the drag object.
        this._addListeners();
        // Attach the drag image at the specified client position.
        this._attachDragImage(clientX, clientY);
        // Create the promise which will be resolved on completion.
        this._promise = new Promise(resolve => {
            this._resolve = resolve;
        });
        // Trigger a fake move event to kick off the drag operation.
        let event = new PointerEvent('pointermove', {
            bubbles: true,
            cancelable: true,
            clientX,
            clientY
        });
        document.dispatchEvent(event);
        // Return the pending promise for the drag operation.
        return this._promise;
    }
    /**
     * Handle the DOM events for the drag operation.
     *
     * @param event - The DOM event sent to the drag object.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the document. It should not be
     * called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'pointermove':
                this._evtPointerMove(event);
                break;
            case 'pointerup':
                this._evtPointerUp(event);
                break;
            case 'keydown':
                this._evtKeyDown(event);
                break;
            default:
                // Stop all other events during drag-drop.
                event.preventDefault();
                event.stopPropagation();
                break;
        }
    }
    /**
     * Move the drag image element to the specified location.
     *
     * This is a no-op if there is no drag image element.
     */
    moveDragImage(clientX, clientY) {
        if (!this.dragImage) {
            return;
        }
        let style = this.dragImage.style;
        style.transform = `translate(${clientX}px, ${clientY}px)`;
    }
    /**
     * Handle the `'pointermove'` event for the drag object.
     */
    _evtPointerMove(event) {
        // Stop all input events during drag-drop.
        event.preventDefault();
        event.stopPropagation();
        // Update the current target node and dispatch enter/leave events.
        this._updateCurrentTarget(event);
        // Update the drag scroll element.
        this._updateDragScroll(event);
        // Move the drag image to the specified client position. This is
        // performed *after* dispatching to prevent unnecessary reflows.
        this.moveDragImage(event.clientX, event.clientY);
    }
    /**
     * Handle the `'pointerup'` event for the drag object.
     */
    _evtPointerUp(event) {
        // Stop all input events during drag-drop.
        event.preventDefault();
        event.stopPropagation();
        // Do nothing if the left button is not released.
        if (event.button !== 0) {
            return;
        }
        // Update the current target node and dispatch enter/leave events.
        // This prevents a subtle issue where the DOM mutates under the
        // cursor after the last move event but before the drop event.
        this._updateCurrentTarget(event);
        // If there is no current target, finalize with `'none'`.
        if (!this._currentTarget) {
            this._finalize('none');
            return;
        }
        // If the last drop action was `'none'`, dispatch a leave event
        // to the current target and finalize the drag with `'none'`.
        if (this._dropAction === 'none') {
            Private.dispatchDragLeave(this, this._currentTarget, null, event);
            this._finalize('none');
            return;
        }
        // Dispatch the drop event at the current target and finalize
        // with the resulting drop action.
        let action = Private.dispatchDrop(this, this._currentTarget, event);
        this._finalize(action);
    }
    /**
     * Handle the `'keydown'` event for the drag object.
     */
    _evtKeyDown(event) {
        // Stop all input events during drag-drop.
        event.preventDefault();
        event.stopPropagation();
        // Cancel the drag if `Escape` is pressed.
        if (event.keyCode === 27) {
            this.dispose();
        }
    }
    /**
     * Add the document event listeners for the drag object.
     */
    _addListeners() {
        document.addEventListener('pointerdown', this, true);
        document.addEventListener('pointermove', this, true);
        document.addEventListener('pointerup', this, true);
        document.addEventListener('pointerenter', this, true);
        document.addEventListener('pointerleave', this, true);
        document.addEventListener('pointerover', this, true);
        document.addEventListener('pointerout', this, true);
        document.addEventListener('keydown', this, true);
        document.addEventListener('keyup', this, true);
        document.addEventListener('keypress', this, true);
        document.addEventListener('contextmenu', this, true);
    }
    /**
     * Remove the document event listeners for the drag object.
     */
    _removeListeners() {
        document.removeEventListener('pointerdown', this, true);
        document.removeEventListener('pointermove', this, true);
        document.removeEventListener('pointerup', this, true);
        document.removeEventListener('pointerenter', this, true);
        document.removeEventListener('pointerleave', this, true);
        document.removeEventListener('pointerover', this, true);
        document.removeEventListener('pointerout', this, true);
        document.removeEventListener('keydown', this, true);
        document.removeEventListener('keyup', this, true);
        document.removeEventListener('keypress', this, true);
        document.removeEventListener('contextmenu', this, true);
    }
    /**
     * Update the drag scroll element under the mouse.
     */
    _updateDragScroll(event) {
        // Find the scroll target under the mouse.
        let target = Private.findScrollTarget(event);
        // Bail if there is nothing to scroll.
        if (!this._scrollTarget && !target) {
            return;
        }
        // Start the scroll loop if needed.
        if (!this._scrollTarget) {
            setTimeout(this._onScrollFrame, 500);
        }
        // Update the scroll target.
        this._scrollTarget = target;
    }
    /**
     * Update the current target node using the given mouse event.
     */
    _updateCurrentTarget(event) {
        // Fetch common local state.
        let prevTarget = this._currentTarget;
        let currTarget = this._currentTarget;
        let prevElem = this._currentElement;
        // Find the current indicated element at the given position.
        let currElem = Private.findElementBehindBackdrop(event, this.document);
        // Update the current element reference.
        this._currentElement = currElem;
        // If the indicated element changes from the previous iteration,
        // and is different from the current target, dispatch the exit
        // event to the target.
        if (currElem !== prevElem && currElem !== currTarget) {
            Private.dispatchDragExit(this, currTarget, currElem, event);
        }
        // If the indicated element changes from the previous iteration,
        // and is different from the current target, dispatch the enter
        // event and compute the new target element.
        if (currElem !== prevElem && currElem !== currTarget) {
            currTarget = Private.dispatchDragEnter(this, currElem, currTarget, event);
        }
        // If the current target element has changed, update the current
        // target reference and dispatch the leave event to the old target.
        if (currTarget !== prevTarget) {
            this._currentTarget = currTarget;
            Private.dispatchDragLeave(this, prevTarget, currTarget, event);
        }
        // Dispatch the drag over event and update the drop action.
        let action = Private.dispatchDragOver(this, currTarget, event);
        this._setDropAction(action);
    }
    /**
     * Attach the drag image element at the specified location.
     *
     * This is a no-op if there is no drag image element.
     */
    _attachDragImage(clientX, clientY) {
        if (!this.dragImage) {
            return;
        }
        this.dragImage.classList.add('lm-mod-drag-image');
        let style = this.dragImage.style;
        style.pointerEvents = 'none';
        style.position = 'fixed';
        style.transform = `translate(${clientX}px, ${clientY}px)`;
        const body = this.document instanceof Document
            ? this.document.body
            : this.document.firstElementChild;
        body.appendChild(this.dragImage);
    }
    /**
     * Detach the drag image element from the DOM.
     *
     * This is a no-op if there is no drag image element.
     */
    _detachDragImage() {
        if (!this.dragImage) {
            return;
        }
        let parent = this.dragImage.parentNode;
        if (!parent) {
            return;
        }
        parent.removeChild(this.dragImage);
    }
    /**
     * Set the internal drop action state and update the drag cursor.
     */
    _setDropAction(action) {
        action = Private.validateAction(action, this.supportedActions);
        if (this._override && this._dropAction === action) {
            return;
        }
        switch (action) {
            case 'none':
                this._dropAction = action;
                this._override = Drag.overrideCursor('no-drop', this.document);
                break;
            case 'copy':
                this._dropAction = action;
                this._override = Drag.overrideCursor('copy', this.document);
                break;
            case 'link':
                this._dropAction = action;
                this._override = Drag.overrideCursor('alias', this.document);
                break;
            case 'move':
                this._dropAction = action;
                this._override = Drag.overrideCursor('move', this.document);
                break;
        }
    }
    /**
     * Finalize the drag operation and resolve the drag promise.
     */
    _finalize(action) {
        // Store the resolve function as a temp variable.
        let resolve = this._resolve;
        // Remove the document event listeners.
        this._removeListeners();
        // Detach the drag image.
        this._detachDragImage();
        // Dispose of the cursor override.
        if (this._override) {
            this._override.dispose();
            this._override = null;
        }
        // Clear the mime data.
        this.mimeData.clear();
        // Clear the rest of the internal drag state.
        this._disposed = true;
        this._dropAction = 'none';
        this._currentTarget = null;
        this._currentElement = null;
        this._scrollTarget = null;
        this._promise = null;
        this._resolve = null;
        // Finally, resolve the promise to the given drop action.
        if (resolve) {
            resolve(action);
        }
    }
}
/**
 * The namespace for the `Drag` class statics.
 */
(function (Drag) {
    /**
     * A custom event used for drag-drop operations.
     *
     * #### Notes
     * In order to receive `'lm-dragover'`, `'lm-dragleave'`, or `'lm-drop'`
     * events, a drop target must cancel the `'lm-dragenter'` event by
     * calling the event's `preventDefault()` method.
     */
    class Event extends DragEvent {
        constructor(event, options) {
            super(options.type, {
                bubbles: true,
                cancelable: true,
                altKey: event.altKey,
                button: event.button,
                clientX: event.clientX,
                clientY: event.clientY,
                ctrlKey: event.ctrlKey,
                detail: 0,
                metaKey: event.metaKey,
                relatedTarget: options.related,
                screenX: event.screenX,
                screenY: event.screenY,
                shiftKey: event.shiftKey,
                view: window
            });
            const { drag } = options;
            this.dropAction = 'none';
            this.mimeData = drag.mimeData;
            this.proposedAction = drag.proposedAction;
            this.supportedActions = drag.supportedActions;
            this.source = drag.source;
        }
    }
    Drag.Event = Event;
    /**
     * Override the cursor icon for the entire document.
     *
     * @param cursor - The string representing the cursor style.
     *
     * @returns A disposable which will clear the override when disposed.
     *
     * #### Notes
     * The most recent call to `overrideCursor` takes precedence.
     * Disposing an old override has no effect on the current override.
     *
     * This utility function is used by the `Drag` class to override the
     * mouse cursor during a drag-drop operation, but it can also be used
     * by other classes to fix the cursor icon during normal mouse drags.
     *
     * #### Example
     * ```typescript
     * import { Drag } from '@lumino/dragdrop';
     *
     * // Force the cursor to be 'wait' for the entire document.
     * let override = Drag.overrideCursor('wait');
     *
     * // Clear the override by disposing the return value.
     * override.dispose();
     * ```
     */
    function overrideCursor(cursor, doc = document) {
        return Private.overrideCursor(cursor, doc);
    }
    Drag.overrideCursor = overrideCursor;
})(Drag || (Drag = {}));
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * The size of a drag scroll edge, in pixels.
     */
    Private.SCROLL_EDGE_SIZE = 20;
    /**
     * Validate the given action is one of the supported actions.
     *
     * Returns the given action or `'none'` if the action is unsupported.
     */
    function validateAction(action, supported) {
        return actionTable[action] & supportedTable[supported] ? action : 'none';
    }
    Private.validateAction = validateAction;
    /**
     * Find the event target using pointer position if given, or otherwise
     * the central position of the backdrop.
     */
    function findElementBehindBackdrop(event, root = document) {
        if (event) {
            // Check if we already cached element for this event.
            if (lastElementEventSearch && event == lastElementEventSearch.event) {
                return lastElementEventSearch.element;
            }
            Private.cursorBackdrop.style.zIndex = '-1000';
            const element = root.elementFromPoint(event.clientX, event.clientY);
            Private.cursorBackdrop.style.zIndex = '';
            lastElementEventSearch = { event, element };
            return element;
        }
        else {
            const transform = Private.cursorBackdrop.style.transform;
            if (lastElementSearch && transform === lastElementSearch.transform) {
                return lastElementSearch.element;
            }
            const bbox = Private.cursorBackdrop.getBoundingClientRect();
            Private.cursorBackdrop.style.zIndex = '-1000';
            const element = root.elementFromPoint(bbox.left + bbox.width / 2, bbox.top + bbox.height / 2);
            Private.cursorBackdrop.style.zIndex = '';
            lastElementSearch = { transform, element };
            return element;
        }
    }
    Private.findElementBehindBackdrop = findElementBehindBackdrop;
    let lastElementEventSearch = null;
    let lastElementSearch = null;
    /**
     * Find the drag scroll target under the mouse, if any.
     */
    function findScrollTarget(event) {
        // Look up the client mouse position.
        let x = event.clientX;
        let y = event.clientY;
        // Get the element under the mouse.
        let element = findElementBehindBackdrop(event);
        // Search for a scrollable target based on the mouse position.
        // The null assert in third clause of for-loop is required due to:
        // https://github.com/Microsoft/TypeScript/issues/14143
        for (; element; element = element.parentElement) {
            // Ignore elements which are not marked as scrollable.
            if (!element.hasAttribute('data-lm-dragscroll')) {
                continue;
            }
            // Set up the coordinate offsets for the element.
            let offsetX = 0;
            let offsetY = 0;
            if (element === document.body) {
                offsetX = window.pageXOffset;
                offsetY = window.pageYOffset;
            }
            // Get the element bounds in viewport coordinates.
            let r = element.getBoundingClientRect();
            let top = r.top + offsetY;
            let left = r.left + offsetX;
            let right = left + r.width;
            let bottom = top + r.height;
            // Skip the element if it's not under the mouse.
            if (x < left || x >= right || y < top || y >= bottom) {
                continue;
            }
            // Compute the distance to each edge.
            let dl = x - left + 1;
            let dt = y - top + 1;
            let dr = right - x;
            let db = bottom - y;
            // Find the smallest of the edge distances.
            let distance = Math.min(dl, dt, dr, db);
            // Skip the element if the mouse is not within a scroll edge.
            if (distance > Private.SCROLL_EDGE_SIZE) {
                continue;
            }
            // Set up the edge result variable.
            let edge;
            // Find the edge for the computed distance.
            switch (distance) {
                case db:
                    edge = 'bottom';
                    break;
                case dt:
                    edge = 'top';
                    break;
                case dr:
                    edge = 'right';
                    break;
                case dl:
                    edge = 'left';
                    break;
                default:
                    throw 'unreachable';
            }
            // Compute how much the element can scroll in width and height.
            let dsw = element.scrollWidth - element.clientWidth;
            let dsh = element.scrollHeight - element.clientHeight;
            // Determine if the element should be scrolled for the edge.
            let shouldScroll;
            switch (edge) {
                case 'top':
                    shouldScroll = dsh > 0 && element.scrollTop > 0;
                    break;
                case 'left':
                    shouldScroll = dsw > 0 && element.scrollLeft > 0;
                    break;
                case 'right':
                    shouldScroll = dsw > 0 && element.scrollLeft < dsw;
                    break;
                case 'bottom':
                    shouldScroll = dsh > 0 && element.scrollTop < dsh;
                    break;
                default:
                    throw 'unreachable';
            }
            // Skip the element if it should not be scrolled.
            if (!shouldScroll) {
                continue;
            }
            // Return the drag scroll target.
            return { element, edge, distance };
        }
        // No drag scroll target was found.
        return null;
    }
    Private.findScrollTarget = findScrollTarget;
    /**
     * Dispatch a drag enter event to the indicated element.
     *
     * @param drag - The drag object associated with the action.
     *
     * @param currElem - The currently indicated element, or `null`. This
     *   is the "immediate user selection" from the whatwg spec.
     *
     * @param currTarget - The current drag target element, or `null`. This
     *   is the "current target element" from the whatwg spec.
     *
     * @param event - The mouse event related to the action.
     *
     * @returns The element to use as the current drag target. This is the
     *   "current target element" from the whatwg spec, and may be `null`.
     *
     * #### Notes
     * This largely implements the drag enter portion of the whatwg spec:
     * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model
     */
    function dispatchDragEnter(drag, currElem, currTarget, event) {
        // If the current element is null, return null as the new target.
        if (!currElem) {
            return null;
        }
        // Dispatch a drag enter event to the current element.
        let dragEvent = new Drag.Event(event, {
            drag,
            related: currTarget,
            type: 'lm-dragenter'
        });
        let canceled = !currElem.dispatchEvent(dragEvent);
        // If the event was canceled, use the current element as the new target.
        if (canceled) {
            return currElem;
        }
        // If the current element is the document body, keep the original target.
        const body = drag.document instanceof Document
            ? drag.document.body
            : drag.document.firstElementChild;
        if (currElem === body) {
            return currTarget;
        }
        // Dispatch a drag enter event on the document body.
        dragEvent = new Drag.Event(event, {
            drag,
            related: currTarget,
            type: 'lm-dragenter'
        });
        body.dispatchEvent(dragEvent);
        // Ignore the event cancellation, and use the body as the new target.
        return body;
    }
    Private.dispatchDragEnter = dispatchDragEnter;
    /**
     * Dispatch a drag exit event to the indicated element.
     *
     * @param drag - The drag object associated with the action.
     *
     * @param prevTarget - The previous target element, or `null`. This
     *   is the previous "current target element" from the whatwg spec.
     *
     * @param currTarget - The current drag target element, or `null`. This
     *   is the "current target element" from the whatwg spec.
     *
     * @param event - The mouse event related to the action.
     *
     * #### Notes
     * This largely implements the drag exit portion of the whatwg spec:
     * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model
     */
    function dispatchDragExit(drag, prevTarget, currTarget, event) {
        // If the previous target is null, do nothing.
        if (!prevTarget) {
            return;
        }
        // Dispatch the drag exit event to the previous target.
        let dragEvent = new Drag.Event(event, {
            drag,
            related: currTarget,
            type: 'lm-dragexit'
        });
        prevTarget.dispatchEvent(dragEvent);
    }
    Private.dispatchDragExit = dispatchDragExit;
    /**
     * Dispatch a drag leave event to the indicated element.
     *
     * @param drag - The drag object associated with the action.
     *
     * @param prevTarget - The previous target element, or `null`. This
     *   is the previous "current target element" from the whatwg spec.
     *
     * @param currTarget - The current drag target element, or `null`. This
     *   is the "current target element" from the whatwg spec.
     *
     * @param event - The mouse event related to the action.
     *
     * #### Notes
     * This largely implements the drag leave portion of the whatwg spec:
     * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model
     */
    function dispatchDragLeave(drag, prevTarget, currTarget, event) {
        // If the previous target is null, do nothing.
        if (!prevTarget) {
            return;
        }
        // Dispatch the drag leave event to the previous target.
        let dragEvent = new Drag.Event(event, {
            drag,
            related: currTarget,
            type: 'lm-dragleave'
        });
        prevTarget.dispatchEvent(dragEvent);
    }
    Private.dispatchDragLeave = dispatchDragLeave;
    /**
     * Dispatch a drag over event to the indicated element.
     *
     * @param drag - The drag object associated with the action.
     *
     * @param currTarget - The current drag target element, or `null`. This
     *   is the "current target element" from the whatwg spec.
     *
     * @param event - The mouse event related to the action.
     *
     * @returns The `DropAction` result of the drag over event.
     *
     * #### Notes
     * This largely implements the drag over portion of the whatwg spec:
     * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model
     */
    function dispatchDragOver(drag, currTarget, event) {
        // If there is no current target, the drop action is none.
        if (!currTarget) {
            return 'none';
        }
        // Dispatch the drag over event to the current target.
        let dragEvent = new Drag.Event(event, {
            drag,
            related: null,
            type: 'lm-dragover'
        });
        let canceled = !currTarget.dispatchEvent(dragEvent);
        // If the event was canceled, return the drop action result.
        if (canceled) {
            return dragEvent.dropAction;
        }
        // Otherwise, the effective drop action is none.
        return 'none';
    }
    Private.dispatchDragOver = dispatchDragOver;
    /**
     * Dispatch a drop event to the indicated element.
     *
     * @param drag - The drag object associated with the action.
     *
     * @param currTarget - The current drag target element, or `null`. This
     *   is the "current target element" from the whatwg spec.
     *
     * @param event - The mouse event related to the action.
     *
     * @returns The `DropAction` result of the drop event.
     *
     * #### Notes
     * This largely implements the drag over portion of the whatwg spec:
     * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model
     */
    function dispatchDrop(drag, currTarget, event) {
        // If there is no current target, the drop action is none.
        if (!currTarget) {
            return 'none';
        }
        // Dispatch the drop event to the current target.
        let dragEvent = new Drag.Event(event, {
            drag,
            related: null,
            type: 'lm-drop'
        });
        let canceled = !currTarget.dispatchEvent(dragEvent);
        // If the event was canceled, return the drop action result.
        if (canceled) {
            return dragEvent.dropAction;
        }
        // Otherwise, the effective drop action is none.
        return 'none';
    }
    Private.dispatchDrop = dispatchDrop;
    /**
     * A lookup table from drop action to bit value.
     */
    const actionTable = {
        none: 0x0,
        copy: 0x1,
        link: 0x2,
        move: 0x4
    };
    /**
     * A lookup table from supported action to drop action bit mask.
     */
    const supportedTable = {
        none: actionTable['none'],
        copy: actionTable['copy'],
        link: actionTable['link'],
        move: actionTable['move'],
        'copy-link': actionTable['copy'] | actionTable['link'],
        'copy-move': actionTable['copy'] | actionTable['move'],
        'link-move': actionTable['link'] | actionTable['move'],
        all: actionTable['copy'] | actionTable['link'] | actionTable['move']
    };
    /**
     * Implementation of `Drag.overrideCursor`.
     */
    function overrideCursor(cursor, doc = document) {
        let id = ++overrideCursorID;
        const body = doc instanceof Document
            ? doc.body
            : doc.firstElementChild;
        if (!Private.cursorBackdrop.isConnected) {
            // Hide the backdrop until the pointer moves to avoid issues with
            // native double click detection, used in e.g. datagrid editing.
            Private.cursorBackdrop.style.transform = 'scale(0)';
            body.appendChild(Private.cursorBackdrop);
            resetBackdropScroll();
            document.addEventListener('pointermove', alignBackdrop, {
                capture: true,
                passive: true
            });
            Private.cursorBackdrop.addEventListener('scroll', propagateBackdropScroll, {
                capture: true,
                passive: true
            });
        }
        Private.cursorBackdrop.style.cursor = cursor;
        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_0__.DisposableDelegate(() => {
            if (id === overrideCursorID && Private.cursorBackdrop.isConnected) {
                document.removeEventListener('pointermove', alignBackdrop, true);
                Private.cursorBackdrop.removeEventListener('scroll', propagateBackdropScroll, true);
                // Removing the element from the DOM also releases the pointer capture.
                body.removeChild(Private.cursorBackdrop);
            }
        });
    }
    Private.overrideCursor = overrideCursor;
    /**
     * Move cursor backdrop to match cursor position.
     */
    function alignBackdrop(event) {
        if (!Private.cursorBackdrop) {
            return;
        }
        Private.cursorBackdrop.style.transform = `translate(${event.clientX}px, ${event.clientY}px)`;
        // Capture the pointer to the cursor backdrop, ensuring that the cursor
        // override and any other pointer listeners on the document are respected
        // even if the pointer drifts over an iframe. When the backdrop element is
        // removed from the DOM when the override dispose is called, any pointer
        // capture is released.
        try {
            if (!Private.cursorBackdrop.hasPointerCapture(event.pointerId)) {
                Private.cursorBackdrop.setPointerCapture(event.pointerId);
            }
        }
        catch (e) {
            // Ignore errors in pointer capture to guard defensively against failures,
            // e.g., older browsers or synthetic events in tests that don't have
            // active pointers.
        }
    }
    /**
     * Propagate the scroll event from the backdrop element to the scroll target.
     * The scroll target is defined by presence of `data-lm-dragscroll` attribute.
     */
    function propagateBackdropScroll(_event) {
        if (!Private.cursorBackdrop) {
            return;
        }
        // Get the element under behind the centre of the cursor backdrop
        // (essentially behind the cursor, but possibly a few pixels off).
        let element = findElementBehindBackdrop();
        if (!element) {
            return;
        }
        // Find scroll target.
        const scrollTarget = element.closest('[data-lm-dragscroll]');
        if (!scrollTarget) {
            return;
        }
        // Apply the scroll delta to the correct target.
        scrollTarget.scrollTop += Private.cursorBackdrop.scrollTop - backdropScrollOrigin;
        scrollTarget.scrollLeft += Private.cursorBackdrop.scrollLeft - backdropScrollOrigin;
        // Center the scroll position.
        resetBackdropScroll();
    }
    /**
     * Reset the backdrop scroll to allow further scrolling.
     */
    function resetBackdropScroll() {
        Private.cursorBackdrop.scrollTop = backdropScrollOrigin;
        Private.cursorBackdrop.scrollLeft = backdropScrollOrigin;
    }
    /**
     * The center of the backdrop node scroll area.
     */
    const backdropScrollOrigin = 500;
    /**
     * Create cursor backdrop node.
     */
    function createCursorBackdrop() {
        const backdrop = document.createElement('div');
        backdrop.classList.add('lm-cursor-backdrop');
        return backdrop;
    }
    /**
     * The internal id for the active cursor override.
     */
    let overrideCursorID = 0;
    /**
     * A backdrop node overriding pointer cursor.
     *
     * #### Notes
     * We use a backdrop node rather than setting the cursor directly on the body
     * because setting it on body requires more extensive style recalculation for
     * reliable application of the cursor, this is the cursor not being overriden
     * when over child elements with another style like `cursor: other!important`.
     */
    Private.cursorBackdrop = createCursorBackdrop();
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 49868:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@lumino/dragdrop/style/index.css
var style = __webpack_require__(71971);
;// CONCATENATED MODULE: ../node_modules/@lumino/dragdrop/style/index.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(style/* default */.Z, options);




       /* harmony default export */ const dragdrop_style = (style/* default */.Z && style/* default */.Z.locals ? style/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@lumino/dragdrop/style/index.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/




/***/ }),

/***/ 19222:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   EN_US: () => (/* binding */ EN_US),
/* harmony export */   KeycodeLayout: () => (/* binding */ KeycodeLayout),
/* harmony export */   getKeyboardLayout: () => (/* binding */ getKeyboardLayout),
/* harmony export */   setKeyboardLayout: () => (/* binding */ setKeyboardLayout)
/* harmony export */ });
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module keyboard
 */
/**
 * Get the global application keyboard layout instance.
 *
 * @returns The keyboard layout for use by the application.
 *
 * #### Notes
 * The default keyboard layout is US-English.
 */
function getKeyboardLayout() {
    return Private.keyboardLayout;
}
/**
 * Set the global application keyboard layout instance.
 *
 * @param layout The keyboard layout for use by the application.
 *
 * #### Notes
 * The keyboard layout should typically be set on application startup
 * to a layout which is appropriate for the user's system.
 */
function setKeyboardLayout(layout) {
    Private.keyboardLayout = layout;
}
/**
 * A concrete implementation of {@link IKeyboardLayout} based on keycodes.
 *
 * The `keyCode` property of a `'keydown'` event is a browser and OS
 * specific representation of the physical key (not character) which
 * was pressed on a keyboard. While not the most convenient API, it
 * is currently the only one which works reliably on all browsers.
 *
 * This class accepts a user-defined mapping of keycode to key, which
 * allows for reliable shortcuts tailored to the user's system.
 */
class KeycodeLayout {
    /**
     * Construct a new keycode layout.
     *
     * @param name - The human readable name for the layout.
     *
     * @param codes - A mapping of keycode to key value.
     *
     * @param modifierKeys - Array of modifier key names
     */
    constructor(name, codes, modifierKeys = []) {
        this.name = name;
        this._codes = codes;
        this._keys = KeycodeLayout.extractKeys(codes);
        this._modifierKeys = KeycodeLayout.convertToKeySet(modifierKeys);
    }
    /**
     * Get an array of the key values supported by the layout.
     *
     * @returns A new array of the supported key values.
     */
    keys() {
        return Object.keys(this._keys);
    }
    /**
     * Test whether the given key is a valid value for the layout.
     *
     * @param key - The user provided key to test for validity.
     *
     * @returns `true` if the key is valid, `false` otherwise.
     */
    isValidKey(key) {
        return key in this._keys;
    }
    /**
     * Test whether the given key is a modifier key.
     *
     * @param key - The user provided key.
     *
     * @returns `true` if the key is a modifier key, `false` otherwise.
     */
    isModifierKey(key) {
        return key in this._modifierKeys;
    }
    /**
     * Get the key for a `'keydown'` event.
     *
     * @param event - The event object for a `'keydown'` event.
     *
     * @returns The associated key value, or an empty string if
     *   the event does not represent a valid primary key.
     */
    keyForKeydownEvent(event) {
        return this._codes[event.keyCode] || '';
    }
}
/**
 * The namespace for the `KeycodeLayout` class statics.
 */
(function (KeycodeLayout) {
    /**
     * Extract the set of keys from a code map.
     *
     * @param codes - The code map of interest.
     *
     * @returns A set of the keys in the code map.
     */
    function extractKeys(codes) {
        let keys = Object.create(null);
        for (let c in codes) {
            keys[codes[c]] = true;
        }
        return keys;
    }
    KeycodeLayout.extractKeys = extractKeys;
    /**
     * Convert array of keys to a key set.
     *
     * @param keys - The array that needs to be converted
     *
     * @returns A set of the keys in the array.
     */
    function convertToKeySet(keys) {
        let keySet = Object(null);
        for (let i = 0, n = keys.length; i < n; ++i) {
            keySet[keys[i]] = true;
        }
        return keySet;
    }
    KeycodeLayout.convertToKeySet = convertToKeySet;
})(KeycodeLayout || (KeycodeLayout = {}));
/**
 * A keycode-based keyboard layout for US English keyboards.
 *
 * This layout is valid for the following OS/Browser combinations.
 *
 * - Windows
 *   - Chrome
 *   - Firefox
 *   - IE
 *
 * - OSX
 *   - Chrome
 *   - Firefox
 *   - Safari
 *
 * - Linux
 *   - Chrome
 *   - Firefox
 *
 * Other combinations may also work, but are untested.
 */
const EN_US = new KeycodeLayout('en-us', {
    8: 'Backspace',
    9: 'Tab',
    13: 'Enter',
    16: 'Shift',
    17: 'Ctrl',
    18: 'Alt',
    19: 'Pause',
    27: 'Escape',
    32: 'Space',
    33: 'PageUp',
    34: 'PageDown',
    35: 'End',
    36: 'Home',
    37: 'ArrowLeft',
    38: 'ArrowUp',
    39: 'ArrowRight',
    40: 'ArrowDown',
    45: 'Insert',
    46: 'Delete',
    48: '0',
    49: '1',
    50: '2',
    51: '3',
    52: '4',
    53: '5',
    54: '6',
    55: '7',
    56: '8',
    57: '9',
    59: ';',
    61: '=',
    65: 'A',
    66: 'B',
    67: 'C',
    68: 'D',
    69: 'E',
    70: 'F',
    71: 'G',
    72: 'H',
    73: 'I',
    74: 'J',
    75: 'K',
    76: 'L',
    77: 'M',
    78: 'N',
    79: 'O',
    80: 'P',
    81: 'Q',
    82: 'R',
    83: 'S',
    84: 'T',
    85: 'U',
    86: 'V',
    87: 'W',
    88: 'X',
    89: 'Y',
    90: 'Z',
    91: 'Meta',
    93: 'ContextMenu',
    96: '0',
    97: '1',
    98: '2',
    99: '3',
    100: '4',
    101: '5',
    102: '6',
    103: '7',
    104: '8',
    105: '9',
    106: '*',
    107: '+',
    109: '-',
    110: '.',
    111: '/',
    112: 'F1',
    113: 'F2',
    114: 'F3',
    115: 'F4',
    116: 'F5',
    117: 'F6',
    118: 'F7',
    119: 'F8',
    120: 'F9',
    121: 'F10',
    122: 'F11',
    123: 'F12',
    173: '-',
    186: ';',
    187: '=',
    188: ',',
    189: '-',
    190: '.',
    191: '/',
    192: '`',
    219: '[',
    220: '\\',
    221: ']',
    222: "'",
    224: 'Meta' // firefox
}, ['Shift', 'Ctrl', 'Alt', 'Meta'] // modifier keys
);
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * The global keyboard layout instance.
     */
    Private.keyboardLayout = EN_US;
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 77821:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ConflatableMessage: () => (/* binding */ ConflatableMessage),
  Message: () => (/* binding */ Message),
  MessageLoop: () => (/* binding */ MessageLoop)
});

// EXTERNAL MODULE: consume shared module (default) @lumino/algorithm@~2.0.4 (singleton) (fallback: ../node_modules/@lumino/algorithm/dist/index.es6.js)
var index_es6_js_ = __webpack_require__(78839);
;// CONCATENATED MODULE: ../node_modules/@lumino/collections/dist/index.es6.js
/**
 * A generic doubly-linked list.
 */
class LinkedList {
    constructor() {
        this._first = null;
        this._last = null;
        this._size = 0;
    }
    /**
     * Whether the list is empty.
     *
     * #### Complexity
     * Constant.
     */
    get isEmpty() {
        return this._size === 0;
    }
    /**
     * The size of the list.
     *
     * #### Complexity
     * `O(1)`
     *
     * #### Notes
     * This is equivalent to `length`.
     */
    get size() {
        return this._size;
    }
    /**
     * The length of the list.
     *
     * #### Complexity
     * Constant.
     *
     * #### Notes
     * This is equivalent to `size`.
     *
     * This property is deprecated.
     */
    get length() {
        return this._size;
    }
    /**
     * The first value in the list.
     *
     * This is `undefined` if the list is empty.
     *
     * #### Complexity
     * Constant.
     */
    get first() {
        return this._first ? this._first.value : undefined;
    }
    /**
     * The last value in the list.
     *
     * This is `undefined` if the list is empty.
     *
     * #### Complexity
     * Constant.
     */
    get last() {
        return this._last ? this._last.value : undefined;
    }
    /**
     * The first node in the list.
     *
     * This is `null` if the list is empty.
     *
     * #### Complexity
     * Constant.
     */
    get firstNode() {
        return this._first;
    }
    /**
     * The last node in the list.
     *
     * This is `null` if the list is empty.
     *
     * #### Complexity
     * Constant.
     */
    get lastNode() {
        return this._last;
    }
    /**
     * Create an iterator over the values in the list.
     *
     * @returns A new iterator starting with the first value.
     *
     * #### Complexity
     * Constant.
     */
    *[Symbol.iterator]() {
        let node = this._first;
        while (node) {
            yield node.value;
            node = node.next;
        }
    }
    /**
     * Create a reverse iterator over the values in the list.
     *
     * @returns A new iterator starting with the last value.
     *
     * #### Complexity
     * Constant.
     */
    *retro() {
        let node = this._last;
        while (node) {
            yield node.value;
            node = node.prev;
        }
    }
    /**
     * Create an iterator over the nodes in the list.
     *
     * @returns A new iterator starting with the first node.
     *
     * #### Complexity
     * Constant.
     */
    *nodes() {
        let node = this._first;
        while (node) {
            yield node;
            node = node.next;
        }
    }
    /**
     * Create a reverse iterator over the nodes in the list.
     *
     * @returns A new iterator starting with the last node.
     *
     * #### Complexity
     * Constant.
     */
    *retroNodes() {
        let node = this._last;
        while (node) {
            yield node;
            node = node.prev;
        }
    }
    /**
     * Assign new values to the list, replacing all current values.
     *
     * @param values - The values to assign to the list.
     *
     * #### Complexity
     * Linear.
     */
    assign(values) {
        this.clear();
        for (const value of values) {
            this.addLast(value);
        }
    }
    /**
     * Add a value to the end of the list.
     *
     * @param value - The value to add to the end of the list.
     *
     * #### Complexity
     * Constant.
     *
     * #### Notes
     * This is equivalent to `addLast`.
     */
    push(value) {
        this.addLast(value);
    }
    /**
     * Remove and return the value at the end of the list.
     *
     * @returns The removed value, or `undefined` if the list is empty.
     *
     * #### Complexity
     * Constant.
     *
     * #### Notes
     * This is equivalent to `removeLast`.
     */
    pop() {
        return this.removeLast();
    }
    /**
     * Add a value to the beginning of the list.
     *
     * @param value - The value to add to the beginning of the list.
     *
     * #### Complexity
     * Constant.
     *
     * #### Notes
     * This is equivalent to `addFirst`.
     */
    shift(value) {
        this.addFirst(value);
    }
    /**
     * Remove and return the value at the beginning of the list.
     *
     * @returns The removed value, or `undefined` if the list is empty.
     *
     * #### Complexity
     * Constant.
     *
     * #### Notes
     * This is equivalent to `removeFirst`.
     */
    unshift() {
        return this.removeFirst();
    }
    /**
     * Add a value to the beginning of the list.
     *
     * @param value - The value to add to the beginning of the list.
     *
     * @returns The list node which holds the value.
     *
     * #### Complexity
     * Constant.
     */
    addFirst(value) {
        let node = new Private.LinkedListNode(this, value);
        if (!this._first) {
            this._first = node;
            this._last = node;
        }
        else {
            node.next = this._first;
            this._first.prev = node;
            this._first = node;
        }
        this._size++;
        return node;
    }
    /**
     * Add a value to the end of the list.
     *
     * @param value - The value to add to the end of the list.
     *
     * @returns The list node which holds the value.
     *
     * #### Complexity
     * Constant.
     */
    addLast(value) {
        let node = new Private.LinkedListNode(this, value);
        if (!this._last) {
            this._first = node;
            this._last = node;
        }
        else {
            node.prev = this._last;
            this._last.next = node;
            this._last = node;
        }
        this._size++;
        return node;
    }
    /**
     * Insert a value before a specific node in the list.
     *
     * @param value - The value to insert before the reference node.
     *
     * @param ref - The reference node of interest. If this is `null`,
     *   the value will be added to the beginning of the list.
     *
     * @returns The list node which holds the value.
     *
     * #### Notes
     * The reference node must be owned by the list.
     *
     * #### Complexity
     * Constant.
     */
    insertBefore(value, ref) {
        if (!ref || ref === this._first) {
            return this.addFirst(value);
        }
        if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {
            throw new Error('Reference node is not owned by the list.');
        }
        let node = new Private.LinkedListNode(this, value);
        let _ref = ref;
        let prev = _ref.prev;
        node.next = _ref;
        node.prev = prev;
        _ref.prev = node;
        prev.next = node;
        this._size++;
        return node;
    }
    /**
     * Insert a value after a specific node in the list.
     *
     * @param value - The value to insert after the reference node.
     *
     * @param ref - The reference node of interest. If this is `null`,
     *   the value will be added to the end of the list.
     *
     * @returns The list node which holds the value.
     *
     * #### Notes
     * The reference node must be owned by the list.
     *
     * #### Complexity
     * Constant.
     */
    insertAfter(value, ref) {
        if (!ref || ref === this._last) {
            return this.addLast(value);
        }
        if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {
            throw new Error('Reference node is not owned by the list.');
        }
        let node = new Private.LinkedListNode(this, value);
        let _ref = ref;
        let next = _ref.next;
        node.next = next;
        node.prev = _ref;
        _ref.next = node;
        next.prev = node;
        this._size++;
        return node;
    }
    /**
     * Remove and return the value at the beginning of the list.
     *
     * @returns The removed value, or `undefined` if the list is empty.
     *
     * #### Complexity
     * Constant.
     */
    removeFirst() {
        let node = this._first;
        if (!node) {
            return undefined;
        }
        if (node === this._last) {
            this._first = null;
            this._last = null;
        }
        else {
            this._first = node.next;
            this._first.prev = null;
        }
        node.list = null;
        node.next = null;
        node.prev = null;
        this._size--;
        return node.value;
    }
    /**
     * Remove and return the value at the end of the list.
     *
     * @returns The removed value, or `undefined` if the list is empty.
     *
     * #### Complexity
     * Constant.
     */
    removeLast() {
        let node = this._last;
        if (!node) {
            return undefined;
        }
        if (node === this._first) {
            this._first = null;
            this._last = null;
        }
        else {
            this._last = node.prev;
            this._last.next = null;
        }
        node.list = null;
        node.next = null;
        node.prev = null;
        this._size--;
        return node.value;
    }
    /**
     * Remove a specific node from the list.
     *
     * @param node - The node to remove from the list.
     *
     * #### Complexity
     * Constant.
     *
     * #### Notes
     * The node must be owned by the list.
     */
    removeNode(node) {
        if (!(node instanceof Private.LinkedListNode) || node.list !== this) {
            throw new Error('Node is not owned by the list.');
        }
        let _node = node;
        if (_node === this._first && _node === this._last) {
            this._first = null;
            this._last = null;
        }
        else if (_node === this._first) {
            this._first = _node.next;
            this._first.prev = null;
        }
        else if (_node === this._last) {
            this._last = _node.prev;
            this._last.next = null;
        }
        else {
            _node.next.prev = _node.prev;
            _node.prev.next = _node.next;
        }
        _node.list = null;
        _node.next = null;
        _node.prev = null;
        this._size--;
    }
    /**
     * Remove all values from the list.
     *
     * #### Complexity
     * Linear.
     */
    clear() {
        let node = this._first;
        while (node) {
            let next = node.next;
            node.list = null;
            node.prev = null;
            node.next = null;
            node = next;
        }
        this._first = null;
        this._last = null;
        this._size = 0;
    }
}
/**
 * The namespace for the `LinkedList` class statics.
 */
(function (LinkedList) {
    /**
     * Create a linked list from an iterable of values.
     *
     * @param values - The iterable object of interest.
     *
     * @returns A new linked list initialized with the given values.
     *
     * #### Complexity
     * Linear.
     */
    function from(values) {
        let list = new LinkedList();
        list.assign(values);
        return list;
    }
    LinkedList.from = from;
})(LinkedList || (LinkedList = {}));
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * The internal linked list node implementation.
     */
    class LinkedListNode {
        /**
         * Construct a new linked list node.
         *
         * @param list - The list which owns the node.
         *
         * @param value - The value for the link.
         */
        constructor(list, value) {
            /**
             * The linked list which created and owns the node.
             */
            this.list = null;
            /**
             * The next node in the list.
             */
            this.next = null;
            /**
             * The previous node in the list.
             */
            this.prev = null;
            this.list = list;
            this.value = value;
        }
    }
    Private.LinkedListNode = LinkedListNode;
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map

;// CONCATENATED MODULE: ../node_modules/@lumino/messaging/dist/index.es6.js



// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module messaging
 */
/**
 * A message which can be delivered to a message handler.
 *
 * #### Notes
 * This class may be subclassed to create complex message types.
 */
class Message {
    /**
     * Construct a new message.
     *
     * @param type - The type of the message.
     */
    constructor(type) {
        this.type = type;
    }
    /**
     * Test whether the message is conflatable.
     *
     * #### Notes
     * Message conflation is an advanced topic. Most message types will
     * not make use of this feature.
     *
     * If a conflatable message is posted to a handler while another
     * conflatable message of the same `type` has already been posted
     * to the handler, the `conflate()` method of the existing message
     * will be invoked. If that method returns `true`, the new message
     * will not be enqueued. This allows messages to be compressed, so
     * that only a single instance of the message type is processed per
     * cycle, no matter how many times messages of that type are posted.
     *
     * Custom message types may reimplement this property.
     *
     * The default implementation is always `false`.
     */
    get isConflatable() {
        return false;
    }
    /**
     * Conflate this message with another message of the same `type`.
     *
     * @param other - A conflatable message of the same `type`.
     *
     * @returns `true` if the message was successfully conflated, or
     *   `false` otherwise.
     *
     * #### Notes
     * Message conflation is an advanced topic. Most message types will
     * not make use of this feature.
     *
     * This method is called automatically by the message loop when the
     * given message is posted to the handler paired with this message.
     * This message will already be enqueued and conflatable, and the
     * given message will have the same `type` and also be conflatable.
     *
     * This method should merge the state of the other message into this
     * message as needed so that when this message is finally delivered
     * to the handler, it receives the most up-to-date information.
     *
     * If this method returns `true`, it signals that the other message
     * was successfully conflated and that message will not be enqueued.
     *
     * If this method returns `false`, the other message will be enqueued
     * for normal delivery.
     *
     * Custom message types may reimplement this method.
     *
     * The default implementation always returns `false`.
     */
    conflate(other) {
        return false;
    }
}
/**
 * A convenience message class which conflates automatically.
 *
 * #### Notes
 * Message conflation is an advanced topic. Most user code will not
 * make use of this class.
 *
 * This message class is useful for creating message instances which
 * should be conflated, but which have no state other than `type`.
 *
 * If conflation of stateful messages is required, a custom `Message`
 * subclass should be created.
 */
class ConflatableMessage extends Message {
    /**
     * Test whether the message is conflatable.
     *
     * #### Notes
     * This property is always `true`.
     */
    get isConflatable() {
        return true;
    }
    /**
     * Conflate this message with another message of the same `type`.
     *
     * #### Notes
     * This method always returns `true`.
     */
    conflate(other) {
        return true;
    }
}
/**
 * The namespace for the global singleton message loop.
 */
var MessageLoop;
(function (MessageLoop) {
    /**
     * A function that cancels the pending loop task; `null` if unavailable.
     */
    let pending = null;
    /**
     * Schedules a function for invocation as soon as possible asynchronously.
     *
     * @param fn The function to invoke when called back.
     *
     * @returns An anonymous function that will unschedule invocation if possible.
     */
    const schedule = (resolved => (fn) => {
        let rejected = false;
        resolved.then(() => !rejected && fn());
        return () => {
            rejected = true;
        };
    })(Promise.resolve());
    /**
     * Send a message to a message handler to process immediately.
     *
     * @param handler - The handler which should process the message.
     *
     * @param msg - The message to deliver to the handler.
     *
     * #### Notes
     * The message will first be sent through any installed message hooks
     * for the handler. If the message passes all hooks, it will then be
     * delivered to the `processMessage` method of the handler.
     *
     * The message will not be conflated with pending posted messages.
     *
     * Exceptions in hooks and handlers will be caught and logged.
     */
    function sendMessage(handler, msg) {
        // Lookup the message hooks for the handler.
        let hooks = messageHooks.get(handler);
        // Handle the common case of no installed hooks.
        if (!hooks || hooks.length === 0) {
            invokeHandler(handler, msg);
            return;
        }
        // Invoke the message hooks starting with the newest first.
        let passed = (0,index_es6_js_.every)((0,index_es6_js_.retro)(hooks), hook => {
            return hook ? invokeHook(hook, handler, msg) : true;
        });
        // Invoke the handler if the message passes all hooks.
        if (passed) {
            invokeHandler(handler, msg);
        }
    }
    MessageLoop.sendMessage = sendMessage;
    /**
     * Post a message to a message handler to process in the future.
     *
     * @param handler - The handler which should process the message.
     *
     * @param msg - The message to post to the handler.
     *
     * #### Notes
     * The message will be conflated with the pending posted messages for
     * the handler, if possible. If the message is not conflated, it will
     * be queued for normal delivery on the next cycle of the event loop.
     *
     * Exceptions in hooks and handlers will be caught and logged.
     */
    function postMessage(handler, msg) {
        // Handle the common case of a non-conflatable message.
        if (!msg.isConflatable) {
            enqueueMessage(handler, msg);
            return;
        }
        // Conflate the message with an existing message if possible.
        let conflated = (0,index_es6_js_.some)(messageQueue, posted => {
            if (posted.handler !== handler) {
                return false;
            }
            if (!posted.msg) {
                return false;
            }
            if (posted.msg.type !== msg.type) {
                return false;
            }
            if (!posted.msg.isConflatable) {
                return false;
            }
            return posted.msg.conflate(msg);
        });
        // Enqueue the message if it was not conflated.
        if (!conflated) {
            enqueueMessage(handler, msg);
        }
    }
    MessageLoop.postMessage = postMessage;
    /**
     * Install a message hook for a message handler.
     *
     * @param handler - The message handler of interest.
     *
     * @param hook - The message hook to install.
     *
     * #### Notes
     * A message hook is invoked before a message is delivered to the
     * handler. If the hook returns `false`, no other hooks will be
     * invoked and the message will not be delivered to the handler.
     *
     * The most recently installed message hook is executed first.
     *
     * If the hook is already installed, this is a no-op.
     */
    function installMessageHook(handler, hook) {
        // Look up the hooks for the handler.
        let hooks = messageHooks.get(handler);
        // Bail early if the hook is already installed.
        if (hooks && hooks.indexOf(hook) !== -1) {
            return;
        }
        // Add the hook to the end, so it will be the first to execute.
        if (!hooks) {
            messageHooks.set(handler, [hook]);
        }
        else {
            hooks.push(hook);
        }
    }
    MessageLoop.installMessageHook = installMessageHook;
    /**
     * Remove an installed message hook for a message handler.
     *
     * @param handler - The message handler of interest.
     *
     * @param hook - The message hook to remove.
     *
     * #### Notes
     * It is safe to call this function while the hook is executing.
     *
     * If the hook is not installed, this is a no-op.
     */
    function removeMessageHook(handler, hook) {
        // Lookup the hooks for the handler.
        let hooks = messageHooks.get(handler);
        // Bail early if the hooks do not exist.
        if (!hooks) {
            return;
        }
        // Lookup the index of the hook and bail if not found.
        let i = hooks.indexOf(hook);
        if (i === -1) {
            return;
        }
        // Clear the hook and schedule a cleanup of the array.
        hooks[i] = null;
        scheduleCleanup(hooks);
    }
    MessageLoop.removeMessageHook = removeMessageHook;
    /**
     * Clear all message data associated with a message handler.
     *
     * @param handler - The message handler of interest.
     *
     * #### Notes
     * This will clear all posted messages and hooks for the handler.
     */
    function clearData(handler) {
        // Lookup the hooks for the handler.
        let hooks = messageHooks.get(handler);
        // Clear all messsage hooks for the handler.
        if (hooks && hooks.length > 0) {
            index_es6_js_.ArrayExt.fill(hooks, null);
            scheduleCleanup(hooks);
        }
        // Clear all posted messages for the handler.
        for (const posted of messageQueue) {
            if (posted.handler === handler) {
                posted.handler = null;
                posted.msg = null;
            }
        }
    }
    MessageLoop.clearData = clearData;
    /**
     * Process the pending posted messages in the queue immediately.
     *
     * #### Notes
     * This function is useful when posted messages must be processed immediately.
     *
     * This function should normally not be needed, but it may be
     * required to work around certain browser idiosyncrasies.
     *
     * Recursing into this function is a no-op.
     */
    function flush() {
        // Bail if recursion is detected or if there is no pending task.
        if (flushGuard || pending === null) {
            return;
        }
        // Unschedule the pending loop task.
        pending();
        pending = null;
        // Run the message loop within the recursion guard.
        flushGuard = true;
        runMessageLoop();
        flushGuard = false;
    }
    MessageLoop.flush = flush;
    /**
     * Get the message loop exception handler.
     *
     * @returns The current exception handler.
     *
     * #### Notes
     * The default exception handler is `console.error`.
     */
    function getExceptionHandler() {
        return exceptionHandler;
    }
    MessageLoop.getExceptionHandler = getExceptionHandler;
    /**
     * Set the message loop exception handler.
     *
     * @param handler - The function to use as the exception handler.
     *
     * @returns The old exception handler.
     *
     * #### Notes
     * The exception handler is invoked when a message handler or a
     * message hook throws an exception.
     */
    function setExceptionHandler(handler) {
        let old = exceptionHandler;
        exceptionHandler = handler;
        return old;
    }
    MessageLoop.setExceptionHandler = setExceptionHandler;
    /**
     * The queue of posted message pairs.
     */
    const messageQueue = new LinkedList();
    /**
     * A mapping of handler to array of installed message hooks.
     */
    const messageHooks = new WeakMap();
    /**
     * A set of message hook arrays which are pending cleanup.
     */
    const dirtySet = new Set();
    /**
     * The message loop exception handler.
     */
    let exceptionHandler = (err) => {
        console.error(err);
    };
    /**
     * A guard flag to prevent flush recursion.
     */
    let flushGuard = false;
    /**
     * Invoke a message hook with the specified handler and message.
     *
     * Returns the result of the hook, or `true` if the hook throws.
     *
     * Exceptions in the hook will be caught and logged.
     */
    function invokeHook(hook, handler, msg) {
        let result = true;
        try {
            if (typeof hook === 'function') {
                result = hook(handler, msg);
            }
            else {
                result = hook.messageHook(handler, msg);
            }
        }
        catch (err) {
            exceptionHandler(err);
        }
        return result;
    }
    /**
     * Invoke a message handler with the specified message.
     *
     * Exceptions in the handler will be caught and logged.
     */
    function invokeHandler(handler, msg) {
        try {
            handler.processMessage(msg);
        }
        catch (err) {
            exceptionHandler(err);
        }
    }
    /**
     * Add a message to the end of the message queue.
     *
     * This will automatically schedule a run of the message loop.
     */
    function enqueueMessage(handler, msg) {
        // Add the posted message to the queue.
        messageQueue.addLast({ handler, msg });
        // Bail if a loop task is already pending.
        if (pending !== null) {
            return;
        }
        // Schedule a run of the message loop.
        pending = schedule(runMessageLoop);
    }
    /**
     * Run an iteration of the message loop.
     *
     * This will process all pending messages in the queue. If a message
     * is added to the queue while the message loop is running, it will
     * be processed on the next cycle of the loop.
     */
    function runMessageLoop() {
        // Clear the task so the next loop can be scheduled.
        pending = null;
        // If the message queue is empty, there is nothing else to do.
        if (messageQueue.isEmpty) {
            return;
        }
        // Add a sentinel value to the end of the queue. The queue will
        // only be processed up to the sentinel. Messages posted during
        // this cycle will execute on the next cycle.
        let sentinel = { handler: null, msg: null };
        messageQueue.addLast(sentinel);
        // Enter the message loop.
        // eslint-disable-next-line no-constant-condition
        while (true) {
            // Remove the first posted message in the queue.
            let posted = messageQueue.removeFirst();
            // If the value is the sentinel, exit the loop.
            if (posted === sentinel) {
                return;
            }
            // Dispatch the message if it has not been cleared.
            if (posted.handler && posted.msg) {
                sendMessage(posted.handler, posted.msg);
            }
        }
    }
    /**
     * Schedule a cleanup of a message hooks array.
     *
     * This will add the array to the dirty set and schedule a deferred
     * cleanup of the array contents. On cleanup, any `null` hook will
     * be removed from the array.
     */
    function scheduleCleanup(hooks) {
        if (dirtySet.size === 0) {
            schedule(cleanupDirtySet);
        }
        dirtySet.add(hooks);
    }
    /**
     * Cleanup the message hook arrays in the dirty set.
     *
     * This function should only be invoked asynchronously, when the
     * stack frame is guaranteed to not be on the path of user code.
     */
    function cleanupDirtySet() {
        dirtySet.forEach(cleanupHooks);
        dirtySet.clear();
    }
    /**
     * Cleanup the dirty hooks in a message hooks array.
     *
     * This will remove any `null` hook from the array.
     *
     * This function should only be invoked asynchronously, when the
     * stack frame is guaranteed to not be on the path of user code.
     */
    function cleanupHooks(hooks) {
        index_es6_js_.ArrayExt.removeAllWhere(hooks, isNull);
    }
    /**
     * Test whether a value is `null`.
     */
    function isNull(value) {
        return value === null;
    }
})(MessageLoop || (MessageLoop = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 64271:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Debouncer: () => (/* binding */ Debouncer),
/* harmony export */   Poll: () => (/* binding */ Poll),
/* harmony export */   RateLimiter: () => (/* binding */ RateLimiter),
/* harmony export */   Throttler: () => (/* binding */ Throttler)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_1__);



// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * A class that wraps an asynchronous function to poll at a regular interval
 * with exponential increases to the interval length if the poll fails.
 *
 * @typeparam T - The resolved type of the factory's promises.
 * Defaults to `any`.
 *
 * @typeparam U - The rejected type of the factory's promises.
 * Defaults to `any`.
 *
 * @typeparam V - An optional type to extend the phases supported by a poll.
 * Defaults to `standby`, which already exists in the `Phase` type.
 */
class Poll {
    /**
     * Instantiate a new poll with exponential backoff in case of failure.
     *
     * @param options - The poll instantiation options.
     */
    constructor(options) {
        var _a;
        this._disposed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(this);
        this._lingered = 0;
        this._tick = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        this._ticked = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(this);
        this._factory = options.factory;
        this._linger = (_a = options.linger) !== null && _a !== void 0 ? _a : Private.DEFAULT_LINGER;
        this._standby = options.standby || Private.DEFAULT_STANDBY;
        this._state = { ...Private.DEFAULT_STATE, timestamp: new Date().getTime() };
        // Normalize poll frequency `max` to be the greater of
        // default `max`, `options.frequency.max`, or `options.frequency.interval`.
        const frequency = options.frequency || {};
        const max = Math.max(frequency.interval || 0, frequency.max || 0, Private.DEFAULT_FREQUENCY.max);
        this.frequency = { ...Private.DEFAULT_FREQUENCY, ...frequency, ...{ max } };
        this.name = options.name || Private.DEFAULT_NAME;
        if ('auto' in options ? options.auto : true) {
            setTimeout(() => this.start());
        }
    }
    /**
     * A signal emitted when the poll is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * The polling frequency parameters.
     */
    get frequency() {
        return this._frequency;
    }
    set frequency(frequency) {
        if (this.isDisposed || _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.JSONExt.deepEqual(frequency, this.frequency || {})) {
            return;
        }
        let { backoff, interval, max } = frequency;
        interval = Math.round(interval);
        max = Math.round(max);
        if (typeof backoff === 'number' && backoff < 1) {
            throw new Error('Poll backoff growth factor must be at least 1');
        }
        if ((interval < 0 || interval > max) && interval !== Poll.NEVER) {
            throw new Error('Poll interval must be between 0 and max');
        }
        if (max > Poll.MAX_INTERVAL && max !== Poll.NEVER) {
            throw new Error(`Max interval must be less than ${Poll.MAX_INTERVAL}`);
        }
        this._frequency = { backoff, interval, max };
    }
    /**
     * Whether the poll is disposed.
     */
    get isDisposed() {
        return this.state.phase === 'disposed';
    }
    /**
     * Indicates when the poll switches to standby.
     */
    get standby() {
        return this._standby;
    }
    set standby(standby) {
        if (this.isDisposed || this.standby === standby) {
            return;
        }
        this._standby = standby;
    }
    /**
     * The poll state, which is the content of the current poll tick.
     */
    get state() {
        return this._state;
    }
    /**
     * A promise that resolves when the poll next ticks.
     */
    get tick() {
        return this._tick.promise;
    }
    /**
     * A signal emitted when the poll ticks and fires off a new request.
     */
    get ticked() {
        return this._ticked;
    }
    /**
     * Return an async iterator that yields every tick.
     */
    async *[Symbol.asyncIterator]() {
        while (!this.isDisposed) {
            yield this.state;
            await this.tick.catch(() => undefined);
        }
    }
    /**
     * Dispose the poll.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._state = {
            ...Private.DISPOSED_STATE,
            timestamp: new Date().getTime()
        };
        this._tick.promise.catch(_ => undefined);
        this._tick.reject(new Error(`Poll (${this.name}) is disposed.`));
        this._disposed.emit(undefined);
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal.clearData(this);
    }
    /**
     * Refreshes the poll. Schedules `refreshed` tick if necessary.
     *
     * @returns A promise that resolves after tick is scheduled and never rejects.
     *
     * #### Notes
     * The returned promise resolves after the tick is scheduled, but before
     * the polling action is run. To wait until after the poll action executes,
     * await the `poll.tick` promise: `await poll.refresh(); await poll.tick;`
     */
    refresh() {
        return this.schedule({
            cancel: ({ phase }) => phase === 'refreshed',
            interval: Poll.IMMEDIATE,
            phase: 'refreshed'
        });
    }
    /**
     * Schedule the next poll tick.
     *
     * @param next - The next poll state data to schedule. Defaults to standby.
     *
     * @param next.cancel - Cancels state transition if function returns `true`.
     *
     * @returns A promise that resolves when the next poll state is active.
     *
     * #### Notes
     * This method is not meant to be invoked by user code typically. It is public
     * to allow poll instances to be composed into classes that schedule ticks.
     */
    async schedule(next = {}) {
        if (this.isDisposed) {
            return;
        }
        // Check if the phase transition should be canceled.
        if (next.cancel && next.cancel(this.state)) {
            return;
        }
        // Update poll state.
        const pending = this._tick;
        const scheduled = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        const state = {
            interval: this.frequency.interval,
            payload: null,
            phase: 'standby',
            timestamp: new Date().getTime(),
            ...next
        };
        this._state = state;
        this._tick = scheduled;
        // Clear the schedule if possible.
        clearTimeout(this._timeout);
        // Emit ticked signal, resolve pending promise, and await its settlement.
        this._ticked.emit(this.state);
        pending.resolve(this);
        await pending.promise;
        if (state.interval === Poll.NEVER) {
            this._timeout = undefined;
            return;
        }
        // Schedule next execution and cache its timeout handle.
        const execute = () => {
            if (this.isDisposed || this.tick !== scheduled.promise) {
                return;
            }
            this._execute();
        };
        // Cache the handle in case it needs to be unscheduled.
        this._timeout = setTimeout(execute, state.interval);
    }
    /**
     * Starts the poll. Schedules `started` tick if necessary.
     *
     * @returns A promise that resolves after tick is scheduled and never rejects.
     */
    start() {
        return this.schedule({
            cancel: ({ phase }) => phase !== 'constructed' && phase !== 'standby' && phase !== 'stopped',
            interval: Poll.IMMEDIATE,
            phase: 'started'
        });
    }
    /**
     * Stops the poll. Schedules `stopped` tick if necessary.
     *
     * @returns A promise that resolves after tick is scheduled and never rejects.
     */
    stop() {
        return this.schedule({
            cancel: ({ phase }) => phase === 'stopped',
            interval: Poll.NEVER,
            phase: 'stopped'
        });
    }
    /**
     * Whether the poll is hidden.
     *
     * #### Notes
     * This property is only relevant in a browser context.
     */
    get hidden() {
        return Private.hidden;
    }
    /**
     * Execute a new poll factory promise or stand by if necessary.
     */
    _execute() {
        let standby = typeof this.standby === 'function' ? this.standby() : this.standby;
        // Check if execution should proceed, linger, or stand by.
        if (standby === 'never') {
            standby = false;
        }
        else if (standby === 'when-hidden') {
            if (this.hidden) {
                standby = ++this._lingered > this._linger;
            }
            else {
                this._lingered = 0;
                standby = false;
            }
        }
        // If in standby mode schedule next tick without calling the factory.
        if (standby) {
            void this.schedule();
            return;
        }
        const pending = this.tick;
        this._factory(this.state)
            .then((resolved) => {
            if (this.isDisposed || this.tick !== pending) {
                return;
            }
            void this.schedule({
                payload: resolved,
                phase: this.state.phase === 'rejected' ? 'reconnected' : 'resolved'
            });
        })
            .catch((rejected) => {
            if (this.isDisposed || this.tick !== pending) {
                return;
            }
            void this.schedule({
                interval: Private.sleep(this.frequency, this.state),
                payload: rejected,
                phase: 'rejected'
            });
        });
    }
}
/**
 * A namespace for `Poll` types, interfaces, and statics.
 */
(function (Poll) {
    /**
     * An interval value in ms that indicates the poll should tick immediately.
     */
    Poll.IMMEDIATE = 0;
    /**
     * Delays are 32-bit integers in many browsers so intervals need to be capped.
     *
     * #### Notes
     * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout#Maximum_delay_value
     */
    Poll.MAX_INTERVAL = 2147483647;
    /**
     * An interval value that indicates the poll should never tick.
     */
    Poll.NEVER = Infinity;
})(Poll || (Poll = {}));
/**
 * A namespace for private module data.
 */
var Private;
(function (Private) {
    /**
     * The default backoff growth rate if `backoff` is `true`.
     */
    Private.DEFAULT_BACKOFF = 3;
    /**
     * The default polling frequency.
     */
    Private.DEFAULT_FREQUENCY = {
        backoff: true,
        interval: 1000,
        max: 30 * 1000
    };
    /**
     * The default number of times to `linger` when a poll is hidden.
     */
    Private.DEFAULT_LINGER = 1;
    /**
     * The default poll name.
     */
    Private.DEFAULT_NAME = 'unknown';
    /**
     * The default poll standby behavior.
     */
    Private.DEFAULT_STANDBY = 'when-hidden';
    /**
     * The first poll tick state's default values superseded in constructor.
     */
    Private.DEFAULT_STATE = {
        interval: Poll.NEVER,
        payload: null,
        phase: 'constructed',
        timestamp: new Date(0).getTime()
    };
    /**
     * The disposed tick state values.
     */
    Private.DISPOSED_STATE = {
        interval: Poll.NEVER,
        payload: null,
        phase: 'disposed',
        timestamp: new Date(0).getTime()
    };
    /**
     * Returns the number of milliseconds to sleep before the next tick.
     *
     * @param frequency - The poll's base frequency.
     * @param last - The poll's last tick.
     */
    function sleep(frequency, last) {
        const { backoff, interval, max } = frequency;
        if (interval === Poll.NEVER) {
            return interval;
        }
        const growth = backoff === true ? Private.DEFAULT_BACKOFF : backoff === false ? 1 : backoff;
        const random = getRandomIntInclusive(interval, last.interval * growth);
        return Math.min(max, random);
    }
    Private.sleep = sleep;
    /**
     * Keep track of whether the document is hidden. This flag is only relevant in
     * a browser context.
     *
     * Listen to `visibilitychange` event to set the `hidden` flag.
     *
     * Listening to `pagehide` is also necessary because Safari support for
     * `visibilitychange` events is partial, cf.
     * https://developer.mozilla.org/docs/Web/API/Document/visibilitychange_event
     */
    Private.hidden = (() => {
        if (typeof document === 'undefined') {
            return false;
        }
        document.addEventListener('visibilitychange', () => {
            Private.hidden = document.visibilityState === 'hidden';
        });
        document.addEventListener('pagehide', () => {
            Private.hidden = document.visibilityState === 'hidden';
        });
        return document.visibilityState === 'hidden';
    })();
    /**
     * Get a random integer between min and max, inclusive of both.
     *
     * #### Notes
     * From
     * https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values_inclusive
     *
     * From the MDN page: It might be tempting to use Math.round() to accomplish
     * that, but doing so would cause your random numbers to follow a non-uniform
     * distribution, which may not be acceptable for your needs.
     */
    function getRandomIntInclusive(min, max) {
        min = Math.ceil(min);
        max = Math.floor(max);
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }
})(Private || (Private = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * A base class to implement rate limiters with different invocation strategies.
 *
 * @typeparam T - The resolved type of the underlying function.
 *
 * @typeparam U - The rejected type of the underlying function.
 *
 * @typeparam V - Arguments for the underlying function.
 */
class RateLimiter {
    /**
     * Instantiate a rate limiter.
     *
     * @param fn - The function to rate limit.
     *
     * @param limit - The rate limit; defaults to 500ms.
     */
    constructor(fn, limit = 500) {
        /**
         * Arguments for the underlying function.
         */
        this.args = undefined;
        /**
         * A promise that resolves on each successful invocation.
         */
        this.payload = null;
        this.limit = limit;
        this.poll = new Poll({
            auto: false,
            factory: async () => {
                const { args } = this;
                this.args = undefined;
                return fn(...args);
            },
            frequency: { backoff: false, interval: Poll.NEVER, max: Poll.NEVER },
            standby: 'never'
        });
        this.payload = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
        this.poll.ticked.connect((_, state) => {
            const { payload } = this;
            if (state.phase === 'resolved') {
                this.payload = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
                payload.resolve(state.payload);
                return;
            }
            if (state.phase === 'rejected' || state.phase === 'stopped') {
                this.payload = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.PromiseDelegate();
                payload.promise.catch(_ => undefined);
                payload.reject(state.payload);
                return;
            }
        }, this);
    }
    /**
     * Whether the rate limiter is disposed.
     */
    get isDisposed() {
        return this.payload === null;
    }
    /**
     * Disposes the rate limiter.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.args = undefined;
        this.payload = null;
        this.poll.dispose();
    }
    /**
     * Stop the function if it is mid-flight.
     */
    async stop() {
        return this.poll.stop();
    }
}
/**
 * Wraps and debounces a function that can be called multiple times and only
 * executes the underlying function one `interval` after the last invocation.
 *
 * @typeparam T - The resolved type of the underlying function. Defaults to any.
 *
 * @typeparam U - The rejected type of the underlying function. Defaults to any.
 *
 * @typeparam V - Arguments for the underlying function. Defaults to any[].
 */
class Debouncer extends RateLimiter {
    /**
     * Invokes the function and only executes after rate limit has elapsed.
     * Each invocation resets the timer.
     */
    invoke(...args) {
        this.args = args;
        void this.poll.schedule({ interval: this.limit, phase: 'invoked' });
        return this.payload.promise;
    }
}
/**
 * Wraps and throttles a function that can be called multiple times and only
 * executes the underlying function once per `interval`.
 *
 * @typeparam T - The resolved type of the underlying function. Defaults to any.
 *
 * @typeparam U - The rejected type of the underlying function. Defaults to any.
 *
 * @typeparam V - Arguments for the underlying function. Defaults to any[].
 */
class Throttler extends RateLimiter {
    /**
     * Instantiate a throttler.
     *
     * @param fn - The function being throttled.
     *
     * @param options - Throttling configuration or throttling limit in ms.
     *
     * #### Notes
     * The `edge` defaults to `leading`; the `limit` defaults to `500`.
     */
    constructor(fn, options) {
        super(fn, typeof options === 'number' ? options : options && options.limit);
        this._trailing = false;
        if (typeof options !== 'number' && options && options.edge === 'trailing') {
            this._trailing = true;
        }
        this._interval = this._trailing ? this.limit : Poll.IMMEDIATE;
    }
    /**
     * Throttles function invocations if one is currently in flight.
     */
    invoke(...args) {
        const idle = this.poll.state.phase !== 'invoked';
        if (idle || this._trailing) {
            this.args = args;
        }
        if (idle) {
            void this.poll.schedule({ interval: this._interval, phase: 'invoked' });
        }
        return this.payload.promise;
    }
}


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 13733:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AttachedProperty: () => (/* binding */ AttachedProperty)
/* harmony export */ });
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module properties
 */
/**
 * A class which attaches a value to an external object.
 *
 * #### Notes
 * Attached properties are used to extend the state of an object with
 * semantic data from an unrelated class. They also encapsulate value
 * creation, coercion, and notification.
 *
 * Because attached property values are stored in a hash table, which
 * in turn is stored in a WeakMap keyed on the owner object, there is
 * non-trivial storage overhead involved in their use. The pattern is
 * therefore best used for the storage of rare data.
 */
class AttachedProperty {
    /**
     * Construct a new attached property.
     *
     * @param options - The options for initializing the property.
     */
    constructor(options) {
        this._pid = Private.nextPID();
        this.name = options.name;
        this._create = options.create;
        this._coerce = options.coerce || null;
        this._compare = options.compare || null;
        this._changed = options.changed || null;
    }
    /**
     * Get the current value of the property for a given owner.
     *
     * @param owner - The property owner of interest.
     *
     * @returns The current value of the property.
     *
     * #### Notes
     * If the value has not yet been set, the default value will be
     * computed and assigned as the current value of the property.
     */
    get(owner) {
        let value;
        let map = Private.ensureMap(owner);
        if (this._pid in map) {
            value = map[this._pid];
        }
        else {
            value = map[this._pid] = this._createValue(owner);
        }
        return value;
    }
    /**
     * Set the current value of the property for a given owner.
     *
     * @param owner - The property owner of interest.
     *
     * @param value - The value for the property.
     *
     * #### Notes
     * If the value has not yet been set, the default value will be
     * computed and used as the previous value for the comparison.
     */
    set(owner, value) {
        let oldValue;
        let map = Private.ensureMap(owner);
        if (this._pid in map) {
            oldValue = map[this._pid];
        }
        else {
            oldValue = map[this._pid] = this._createValue(owner);
        }
        let newValue = this._coerceValue(owner, value);
        this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));
    }
    /**
     * Explicitly coerce the current property value for a given owner.
     *
     * @param owner - The property owner of interest.
     *
     * #### Notes
     * If the value has not yet been set, the default value will be
     * computed and used as the previous value for the comparison.
     */
    coerce(owner) {
        let oldValue;
        let map = Private.ensureMap(owner);
        if (this._pid in map) {
            oldValue = map[this._pid];
        }
        else {
            oldValue = map[this._pid] = this._createValue(owner);
        }
        let newValue = this._coerceValue(owner, oldValue);
        this._maybeNotify(owner, oldValue, (map[this._pid] = newValue));
    }
    /**
     * Get or create the default value for the given owner.
     */
    _createValue(owner) {
        let create = this._create;
        return create(owner);
    }
    /**
     * Coerce the value for the given owner.
     */
    _coerceValue(owner, value) {
        let coerce = this._coerce;
        return coerce ? coerce(owner, value) : value;
    }
    /**
     * Compare the old value and new value for equality.
     */
    _compareValue(oldValue, newValue) {
        let compare = this._compare;
        return compare ? compare(oldValue, newValue) : oldValue === newValue;
    }
    /**
     * Run the change notification if the given values are different.
     */
    _maybeNotify(owner, oldValue, newValue) {
        let changed = this._changed;
        if (changed && !this._compareValue(oldValue, newValue)) {
            changed(owner, oldValue, newValue);
        }
    }
}
/**
 * The namespace for the `AttachedProperty` class statics.
 */
(function (AttachedProperty) {
    /**
     * Clear the stored property data for the given owner.
     *
     * @param owner - The property owner of interest.
     *
     * #### Notes
     * This will clear all property values for the owner, but it will
     * **not** run the change notification for any of the properties.
     */
    function clearData(owner) {
        Private.ownerData.delete(owner);
    }
    AttachedProperty.clearData = clearData;
})(AttachedProperty || (AttachedProperty = {}));
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * A weak mapping of property owner to property map.
     */
    Private.ownerData = new WeakMap();
    /**
     * A function which computes successive unique property ids.
     */
    Private.nextPID = (() => {
        let id = 0;
        return () => {
            let rand = Math.random();
            let stem = `${rand}`.slice(2);
            return `pid-${stem}-${id++}`;
        };
    })();
    /**
     * Lookup the data map for the property owner.
     *
     * This will create the map if one does not already exist.
     */
    function ensureMap(owner) {
        let map = Private.ownerData.get(owner);
        if (map) {
            return map;
        }
        map = Object.create(null);
        Private.ownerData.set(owner, map);
        return map;
    }
    Private.ensureMap = ensureMap;
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 40409:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Signal: () => (/* binding */ Signal),
/* harmony export */   Stream: () => (/* binding */ Stream)
/* harmony export */ });
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78839);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);



// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module signaling
 */
/**
 * A concrete implementation of `ISignal`.
 *
 * #### Example
 * ```typescript
 * import { ISignal, Signal } from '@lumino/signaling';
 *
 * class SomeClass {
 *
 *   constructor(name: string) {
 *     this.name = name;
 *   }
 *
 *   readonly name: string;
 *
 *   get valueChanged: ISignal<this, number> {
 *     return this._valueChanged;
 *   }
 *
 *   get value(): number {
 *     return this._value;
 *   }
 *
 *   set value(value: number) {
 *     if (value === this._value) {
 *       return;
 *     }
 *     this._value = value;
 *     this._valueChanged.emit(value);
 *   }
 *
 *   private _value = 0;
 *   private _valueChanged = new Signal<this, number>(this);
 * }
 *
 * function logger(sender: SomeClass, value: number): void {
 *   console.log(sender.name, value);
 * }
 *
 * let m1 = new SomeClass('foo');
 * let m2 = new SomeClass('bar');
 *
 * m1.valueChanged.connect(logger);
 * m2.valueChanged.connect(logger);
 *
 * m1.value = 42;  // logs: foo 42
 * m2.value = 17;  // logs: bar 17
 * ```
 */
class Signal {
    /**
     * Construct a new signal.
     *
     * @param sender - The sender which owns the signal.
     */
    constructor(sender) {
        this.sender = sender;
    }
    /**
     * Connect a slot to the signal.
     *
     * @param slot - The slot to invoke when the signal is emitted.
     *
     * @param thisArg - The `this` context for the slot. If provided,
     *   this must be a non-primitive object.
     *
     * @returns `true` if the connection succeeds, `false` otherwise.
     */
    connect(slot, thisArg) {
        return Private.connect(this, slot, thisArg);
    }
    /**
     * Disconnect a slot from the signal.
     *
     * @param slot - The slot to disconnect from the signal.
     *
     * @param thisArg - The `this` context for the slot. If provided,
     *   this must be a non-primitive object.
     *
     * @returns `true` if the connection is removed, `false` otherwise.
     */
    disconnect(slot, thisArg) {
        return Private.disconnect(this, slot, thisArg);
    }
    /**
     * Emit the signal and invoke the connected slots.
     *
     * @param args - The args to pass to the connected slots.
     *
     * #### Notes
     * Slots are invoked synchronously in connection order.
     *
     * Exceptions thrown by connected slots will be caught and logged.
     */
    emit(args) {
        Private.emit(this, args);
    }
}
/**
 * The namespace for the `Signal` class statics.
 */
(function (Signal) {
    /**
     * Remove all connections between a sender and receiver.
     *
     * @param sender - The sender object of interest.
     *
     * @param receiver - The receiver object of interest.
     *
     * #### Notes
     * If a `thisArg` is provided when connecting a signal, that object
     * is considered the receiver. Otherwise, the `slot` is considered
     * the receiver.
     */
    function disconnectBetween(sender, receiver) {
        Private.disconnectBetween(sender, receiver);
    }
    Signal.disconnectBetween = disconnectBetween;
    /**
     * Remove all connections where the given object is the sender.
     *
     * @param sender - The sender object of interest.
     */
    function disconnectSender(sender) {
        Private.disconnectSender(sender);
    }
    Signal.disconnectSender = disconnectSender;
    /**
     * Remove all connections where the given object is the receiver.
     *
     * @param receiver - The receiver object of interest.
     *
     * #### Notes
     * If a `thisArg` is provided when connecting a signal, that object
     * is considered the receiver. Otherwise, the `slot` is considered
     * the receiver.
     */
    function disconnectReceiver(receiver) {
        Private.disconnectReceiver(receiver);
    }
    Signal.disconnectReceiver = disconnectReceiver;
    /**
     * Remove all connections where an object is the sender or receiver.
     *
     * @param object - The object of interest.
     *
     * #### Notes
     * If a `thisArg` is provided when connecting a signal, that object
     * is considered the receiver. Otherwise, the `slot` is considered
     * the receiver.
     */
    function disconnectAll(object) {
        Private.disconnectAll(object);
    }
    Signal.disconnectAll = disconnectAll;
    /**
     * Clear all signal data associated with the given object.
     *
     * @param object - The object for which the data should be cleared.
     *
     * #### Notes
     * This removes all signal connections and any other signal data
     * associated with the object.
     */
    function clearData(object) {
        Private.disconnectAll(object);
    }
    Signal.clearData = clearData;
    /**
     * Get the signal exception handler.
     *
     * @returns The current exception handler.
     *
     * #### Notes
     * The default exception handler is `console.error`.
     */
    function getExceptionHandler() {
        return Private.exceptionHandler;
    }
    Signal.getExceptionHandler = getExceptionHandler;
    /**
     * Set the signal exception handler.
     *
     * @param handler - The function to use as the exception handler.
     *
     * @returns The old exception handler.
     *
     * #### Notes
     * The exception handler is invoked when a slot throws an exception.
     */
    function setExceptionHandler(handler) {
        let old = Private.exceptionHandler;
        Private.exceptionHandler = handler;
        return old;
    }
    Signal.setExceptionHandler = setExceptionHandler;
})(Signal || (Signal = {}));
/**
 * A concrete implementation of `IStream`.
 *
 * #### Example
 * ```typescript
 * import { IStream, Stream } from '@lumino/signaling';
 *
 * class SomeClass {
 *
 *   constructor(name: string) {
 *     this.name = name;
 *   }
 *
 *   readonly name: string;
 *
 *   get pings(): IStream<this, string> {
 *     return this._pings;
 *   }
 *
 *   ping(value: string) {
 *     this._pings.emit(value);
 *   }
 *
 *   private _pings = new Stream<this, string>(this);
 * }
 *
 * let m1 = new SomeClass('foo');
 *
 * m1.pings.connect((_, value: string) => {
 *   console.log('connect', value);
 * });
 *
 * void (async () => {
 *   for await (const ping of m1.pings) {
 *     console.log('iterator', ping);
 *   }
 * })();
 *
 * m1.ping('alpha');  // logs: connect alpha
 *                    // logs: iterator alpha
 * m1.ping('beta');   // logs: connect beta
 *                    // logs: iterator beta
 * ```
 */
class Stream extends Signal {
    constructor() {
        super(...arguments);
        this._pending = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.PromiseDelegate();
    }
    /**
     * Return an async iterator that yields every emission.
     */
    async *[Symbol.asyncIterator]() {
        let pending = this._pending;
        while (true) {
            try {
                const { args, next } = await pending.promise;
                pending = next;
                yield args;
            }
            catch (_) {
                return; // Any promise rejection stops the iterator.
            }
        }
    }
    /**
     * Emit the signal, invoke the connected slots, and yield the emission.
     *
     * @param args - The args to pass to the connected slots.
     */
    emit(args) {
        const pending = this._pending;
        const next = (this._pending = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.PromiseDelegate());
        pending.resolve({ args, next });
        super.emit(args);
    }
    /**
     * Stop the stream's async iteration.
     */
    stop() {
        this._pending.promise.catch(() => undefined);
        this._pending.reject('stop');
        this._pending = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.PromiseDelegate();
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * The signal exception handler function.
     */
    Private.exceptionHandler = (err) => {
        console.error(err);
    };
    /**
     * Connect a slot to a signal.
     *
     * @param signal - The signal of interest.
     *
     * @param slot - The slot to invoke when the signal is emitted.
     *
     * @param thisArg - The `this` context for the slot. If provided,
     *   this must be a non-primitive object.
     *
     * @returns `true` if the connection succeeds, `false` otherwise.
     */
    function connect(signal, slot, thisArg) {
        // Coerce a `null` `thisArg` to `undefined`.
        thisArg = thisArg || undefined;
        // Ensure the sender's array of receivers is created.
        let receivers = receiversForSender.get(signal.sender);
        if (!receivers) {
            receivers = [];
            receiversForSender.set(signal.sender, receivers);
        }
        // Bail if a matching connection already exists.
        if (findConnection(receivers, signal, slot, thisArg)) {
            return false;
        }
        // Choose the best object for the receiver.
        let receiver = thisArg || slot;
        // Ensure the receiver's array of senders is created.
        let senders = sendersForReceiver.get(receiver);
        if (!senders) {
            senders = [];
            sendersForReceiver.set(receiver, senders);
        }
        // Create a new connection and add it to the end of each array.
        let connection = { signal, slot, thisArg };
        receivers.push(connection);
        senders.push(connection);
        // Indicate a successful connection.
        return true;
    }
    Private.connect = connect;
    /**
     * Disconnect a slot from a signal.
     *
     * @param signal - The signal of interest.
     *
     * @param slot - The slot to disconnect from the signal.
     *
     * @param thisArg - The `this` context for the slot. If provided,
     *   this must be a non-primitive object.
     *
     * @returns `true` if the connection is removed, `false` otherwise.
     */
    function disconnect(signal, slot, thisArg) {
        // Coerce a `null` `thisArg` to `undefined`.
        thisArg = thisArg || undefined;
        // Lookup the list of receivers, and bail if none exist.
        let receivers = receiversForSender.get(signal.sender);
        if (!receivers || receivers.length === 0) {
            return false;
        }
        // Bail if no matching connection exits.
        let connection = findConnection(receivers, signal, slot, thisArg);
        if (!connection) {
            return false;
        }
        // Choose the best object for the receiver.
        let receiver = thisArg || slot;
        // Lookup the array of senders, which is now known to exist.
        let senders = sendersForReceiver.get(receiver);
        // Clear the connection and schedule cleanup of the arrays.
        connection.signal = null;
        scheduleCleanup(receivers);
        scheduleCleanup(senders);
        // Indicate a successful disconnection.
        return true;
    }
    Private.disconnect = disconnect;
    /**
     * Remove all connections between a sender and receiver.
     *
     * @param sender - The sender object of interest.
     *
     * @param receiver - The receiver object of interest.
     */
    function disconnectBetween(sender, receiver) {
        // If there are no receivers, there is nothing to do.
        let receivers = receiversForSender.get(sender);
        if (!receivers || receivers.length === 0) {
            return;
        }
        // If there are no senders, there is nothing to do.
        let senders = sendersForReceiver.get(receiver);
        if (!senders || senders.length === 0) {
            return;
        }
        // Clear each connection between the sender and receiver.
        for (const connection of senders) {
            // Skip connections which have already been cleared.
            if (!connection.signal) {
                continue;
            }
            // Clear the connection if it matches the sender.
            if (connection.signal.sender === sender) {
                connection.signal = null;
            }
        }
        // Schedule a cleanup of the senders and receivers.
        scheduleCleanup(receivers);
        scheduleCleanup(senders);
    }
    Private.disconnectBetween = disconnectBetween;
    /**
     * Remove all connections where the given object is the sender.
     *
     * @param sender - The sender object of interest.
     */
    function disconnectSender(sender) {
        // If there are no receivers, there is nothing to do.
        let receivers = receiversForSender.get(sender);
        if (!receivers || receivers.length === 0) {
            return;
        }
        // Clear each receiver connection.
        for (const connection of receivers) {
            // Skip connections which have already been cleared.
            if (!connection.signal) {
                continue;
            }
            // Choose the best object for the receiver.
            let receiver = connection.thisArg || connection.slot;
            // Clear the connection.
            connection.signal = null;
            // Cleanup the array of senders, which is now known to exist.
            scheduleCleanup(sendersForReceiver.get(receiver));
        }
        // Schedule a cleanup of the receivers.
        scheduleCleanup(receivers);
    }
    Private.disconnectSender = disconnectSender;
    /**
     * Remove all connections where the given object is the receiver.
     *
     * @param receiver - The receiver object of interest.
     */
    function disconnectReceiver(receiver) {
        // If there are no senders, there is nothing to do.
        let senders = sendersForReceiver.get(receiver);
        if (!senders || senders.length === 0) {
            return;
        }
        // Clear each sender connection.
        for (const connection of senders) {
            // Skip connections which have already been cleared.
            if (!connection.signal) {
                continue;
            }
            // Lookup the sender for the connection.
            let sender = connection.signal.sender;
            // Clear the connection.
            connection.signal = null;
            // Cleanup the array of receivers, which is now known to exist.
            scheduleCleanup(receiversForSender.get(sender));
        }
        // Schedule a cleanup of the list of senders.
        scheduleCleanup(senders);
    }
    Private.disconnectReceiver = disconnectReceiver;
    /**
     * Remove all connections where an object is the sender or receiver.
     *
     * @param object - The object of interest.
     */
    function disconnectAll(object) {
        // Remove all connections where the given object is the sender.
        disconnectSender(object);
        // Remove all connections where the given object is the receiver.
        disconnectReceiver(object);
    }
    Private.disconnectAll = disconnectAll;
    /**
     * Emit a signal and invoke its connected slots.
     *
     * @param signal - The signal of interest.
     *
     * @param args - The args to pass to the connected slots.
     *
     * #### Notes
     * Slots are invoked synchronously in connection order.
     *
     * Exceptions thrown by connected slots will be caught and logged.
     */
    function emit(signal, args) {
        // If there are no receivers, there is nothing to do.
        let receivers = receiversForSender.get(signal.sender);
        if (!receivers || receivers.length === 0) {
            return;
        }
        // Invoke the slots for connections with a matching signal.
        // Any connections added during emission are not invoked.
        for (let i = 0, n = receivers.length; i < n; ++i) {
            let connection = receivers[i];
            if (connection.signal === signal) {
                invokeSlot(connection, args);
            }
        }
    }
    Private.emit = emit;
    /**
     * A weak mapping of sender to array of receiver connections.
     */
    const receiversForSender = new WeakMap();
    /**
     * A weak mapping of receiver to array of sender connections.
     */
    const sendersForReceiver = new WeakMap();
    /**
     * A set of connection arrays which are pending cleanup.
     */
    const dirtySet = new Set();
    /**
     * A function to schedule an event loop callback.
     */
    const schedule = (() => {
        let ok = typeof requestAnimationFrame === 'function';
        return ok ? requestAnimationFrame : setImmediate;
    })();
    /**
     * Find a connection which matches the given parameters.
     */
    function findConnection(connections, signal, slot, thisArg) {
        return (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.find)(connections, connection => connection.signal === signal &&
            connection.slot === slot &&
            connection.thisArg === thisArg);
    }
    /**
     * Invoke a slot with the given parameters.
     *
     * The connection is assumed to be valid.
     *
     * Exceptions in the slot will be caught and logged.
     */
    function invokeSlot(connection, args) {
        let { signal, slot, thisArg } = connection;
        try {
            slot.call(thisArg, signal.sender, args);
        }
        catch (err) {
            Private.exceptionHandler(err);
        }
    }
    /**
     * Schedule a cleanup of a connection array.
     *
     * This will add the array to the dirty set and schedule a deferred
     * cleanup of the array contents. On cleanup, any connection with a
     * `null` signal will be removed from the array.
     */
    function scheduleCleanup(array) {
        if (dirtySet.size === 0) {
            schedule(cleanupDirtySet);
        }
        dirtySet.add(array);
    }
    /**
     * Cleanup the connection lists in the dirty set.
     *
     * This function should only be invoked asynchronously, when the
     * stack frame is guaranteed to not be on the path of user code.
     */
    function cleanupDirtySet() {
        dirtySet.forEach(cleanupConnections);
        dirtySet.clear();
    }
    /**
     * Cleanup the dirty connections in a connections array.
     *
     * This will remove any connection with a `null` signal.
     *
     * This function should only be invoked asynchronously, when the
     * stack frame is guaranteed to not be on the path of user code.
     */
    function cleanupConnections(connections) {
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAllWhere(connections, isDeadConnection);
    }
    /**
     * Test whether a connection is dead.
     *
     * A dead connection has a `null` signal.
     */
    function isDeadConnection(connection) {
        return connection.signal === null;
    }
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 85234:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   VirtualDOM: () => (/* binding */ VirtualDOM),
/* harmony export */   VirtualElement: () => (/* binding */ VirtualElement),
/* harmony export */   VirtualElementPass: () => (/* binding */ VirtualElementPass),
/* harmony export */   VirtualText: () => (/* binding */ VirtualText),
/* harmony export */   h: () => (/* binding */ h),
/* harmony export */   hpass: () => (/* binding */ hpass)
/* harmony export */ });
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78839);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__);


// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * @packageDocumentation
 * @module virtualdom
 */
/**
 * A virtual node which represents plain text content.
 *
 * #### Notes
 * User code will not typically create a `VirtualText` node directly.
 * Instead, the `h()` function will be used to create an element tree.
 */
class VirtualText {
    /**
     * Construct a new virtual text node.
     *
     * @param content - The text content for the node.
     */
    constructor(content) {
        /**
         * The type of the node.
         *
         * This value can be used as a type guard for discriminating the
         * `VirtualNode` union type.
         */
        this.type = 'text';
        this.content = content;
    }
}
/**
 * A virtual node which represents an HTML element.
 *
 * #### Notes
 * User code will not typically create a `VirtualElement` node directly.
 * Instead, the `h()` function will be used to create an element tree.
 */
class VirtualElement {
    /**
     * Construct a new virtual element node.
     *
     * @param tag - The element tag name.
     *
     * @param attrs - The element attributes.
     *
     * @param children - The element children.
     *
     * @param renderer - An optional custom renderer for the element.
     */
    constructor(tag, attrs, children, renderer) {
        /**
         * The type of the node.
         *
         * This value can be used as a type guard for discriminating the
         * `VirtualNode` union type.
         */
        this.type = 'element';
        this.tag = tag;
        this.attrs = attrs;
        this.children = children;
        this.renderer = renderer;
    }
}
/**
 * DEPRECATED - use VirtualElement with a defined renderer param instead.
 * This class is provided as a backwards compatibility shim
 *
 * A "pass thru" virtual node whose children are managed by a render and an
 * unrender callback. The intent of this flavor of virtual node is to make
 * it easy to blend other kinds of virtualdom (eg React) into Phosphor's
 * virtualdom.
 *
 * #### Notes
 * User code will not typically create a `VirtualElementPass` node directly.
 * Instead, the `hpass()` function will be used to create an element tree.
 */
class VirtualElementPass extends VirtualElement {
    /**
     * DEPRECATED - use VirtualElement with a defined renderer param instead
     *
     * Construct a new virtual element pass thru node.
     *
     * @param tag - the tag of the parent element of this node. Once the parent
     * element is rendered, it will be passed as an argument to
     * renderer.render
     *
     * @param attrs - attributes that will assigned to the
     * parent element
     *
     * @param renderer - an object with render and unrender
     * functions, each of which should take a single argument of type
     * HTMLElement and return nothing. If null, the parent element
     * will be rendered barren without any children.
     */
    constructor(tag, attrs, renderer) {
        super(tag, attrs, [], renderer || undefined);
    }
}
function h(tag) {
    let attrs = {};
    let renderer;
    let children = [];
    for (let i = 1, n = arguments.length; i < n; ++i) {
        // eslint-disable-next-line prefer-rest-params
        let arg = arguments[i];
        if (typeof arg === 'string') {
            children.push(new VirtualText(arg));
        }
        else if (arg instanceof VirtualText) {
            children.push(arg);
        }
        else if (arg instanceof VirtualElement) {
            children.push(arg);
        }
        else if (arg instanceof Array) {
            extend(children, arg);
        }
        else if ((i === 1 || i === 2) && arg && typeof arg === 'object') {
            if ('render' in arg) {
                renderer = arg;
            }
            else {
                attrs = arg;
            }
        }
    }
    return new VirtualElement(tag, attrs, children, renderer);
    function extend(array, values) {
        for (let child of values) {
            if (typeof child === 'string') {
                array.push(new VirtualText(child));
            }
            else if (child instanceof VirtualText) {
                array.push(child);
            }
            else if (child instanceof VirtualElement) {
                array.push(child);
            }
        }
    }
}
/**
 * The namespace for the `h` function statics.
 */
(function (h) {
    h.a = h.bind(undefined, 'a');
    h.abbr = h.bind(undefined, 'abbr');
    h.address = h.bind(undefined, 'address');
    h.area = h.bind(undefined, 'area');
    h.article = h.bind(undefined, 'article');
    h.aside = h.bind(undefined, 'aside');
    h.audio = h.bind(undefined, 'audio');
    h.b = h.bind(undefined, 'b');
    h.bdi = h.bind(undefined, 'bdi');
    h.bdo = h.bind(undefined, 'bdo');
    h.blockquote = h.bind(undefined, 'blockquote');
    h.br = h.bind(undefined, 'br');
    h.button = h.bind(undefined, 'button');
    h.canvas = h.bind(undefined, 'canvas');
    h.caption = h.bind(undefined, 'caption');
    h.cite = h.bind(undefined, 'cite');
    h.code = h.bind(undefined, 'code');
    h.col = h.bind(undefined, 'col');
    h.colgroup = h.bind(undefined, 'colgroup');
    h.data = h.bind(undefined, 'data');
    h.datalist = h.bind(undefined, 'datalist');
    h.dd = h.bind(undefined, 'dd');
    h.del = h.bind(undefined, 'del');
    h.dfn = h.bind(undefined, 'dfn');
    h.div = h.bind(undefined, 'div');
    h.dl = h.bind(undefined, 'dl');
    h.dt = h.bind(undefined, 'dt');
    h.em = h.bind(undefined, 'em');
    h.embed = h.bind(undefined, 'embed');
    h.fieldset = h.bind(undefined, 'fieldset');
    h.figcaption = h.bind(undefined, 'figcaption');
    h.figure = h.bind(undefined, 'figure');
    h.footer = h.bind(undefined, 'footer');
    h.form = h.bind(undefined, 'form');
    h.h1 = h.bind(undefined, 'h1');
    h.h2 = h.bind(undefined, 'h2');
    h.h3 = h.bind(undefined, 'h3');
    h.h4 = h.bind(undefined, 'h4');
    h.h5 = h.bind(undefined, 'h5');
    h.h6 = h.bind(undefined, 'h6');
    h.header = h.bind(undefined, 'header');
    h.hr = h.bind(undefined, 'hr');
    h.i = h.bind(undefined, 'i');
    h.iframe = h.bind(undefined, 'iframe');
    h.img = h.bind(undefined, 'img');
    h.input = h.bind(undefined, 'input');
    h.ins = h.bind(undefined, 'ins');
    h.kbd = h.bind(undefined, 'kbd');
    h.label = h.bind(undefined, 'label');
    h.legend = h.bind(undefined, 'legend');
    h.li = h.bind(undefined, 'li');
    h.main = h.bind(undefined, 'main');
    h.map = h.bind(undefined, 'map');
    h.mark = h.bind(undefined, 'mark');
    h.meter = h.bind(undefined, 'meter');
    h.nav = h.bind(undefined, 'nav');
    h.noscript = h.bind(undefined, 'noscript');
    h.object = h.bind(undefined, 'object');
    h.ol = h.bind(undefined, 'ol');
    h.optgroup = h.bind(undefined, 'optgroup');
    h.option = h.bind(undefined, 'option');
    h.output = h.bind(undefined, 'output');
    h.p = h.bind(undefined, 'p');
    h.param = h.bind(undefined, 'param');
    h.pre = h.bind(undefined, 'pre');
    h.progress = h.bind(undefined, 'progress');
    h.q = h.bind(undefined, 'q');
    h.rp = h.bind(undefined, 'rp');
    h.rt = h.bind(undefined, 'rt');
    h.ruby = h.bind(undefined, 'ruby');
    h.s = h.bind(undefined, 's');
    h.samp = h.bind(undefined, 'samp');
    h.section = h.bind(undefined, 'section');
    h.select = h.bind(undefined, 'select');
    h.small = h.bind(undefined, 'small');
    h.source = h.bind(undefined, 'source');
    h.span = h.bind(undefined, 'span');
    h.strong = h.bind(undefined, 'strong');
    h.sub = h.bind(undefined, 'sub');
    h.summary = h.bind(undefined, 'summary');
    h.sup = h.bind(undefined, 'sup');
    h.table = h.bind(undefined, 'table');
    h.tbody = h.bind(undefined, 'tbody');
    h.td = h.bind(undefined, 'td');
    h.textarea = h.bind(undefined, 'textarea');
    h.tfoot = h.bind(undefined, 'tfoot');
    h.th = h.bind(undefined, 'th');
    h.thead = h.bind(undefined, 'thead');
    h.time = h.bind(undefined, 'time');
    h.title = h.bind(undefined, 'title');
    h.tr = h.bind(undefined, 'tr');
    h.track = h.bind(undefined, 'track');
    h.u = h.bind(undefined, 'u');
    h.ul = h.bind(undefined, 'ul');
    h.var_ = h.bind(undefined, 'var');
    h.video = h.bind(undefined, 'video');
    h.wbr = h.bind(undefined, 'wbr');
})(h || (h = {}));
function hpass(tag) {
    let attrs = {};
    let renderer = null;
    if (arguments.length === 2) {
        // eslint-disable-next-line prefer-rest-params
        const arg = arguments[1];
        if ('render' in arg) {
            renderer = arg;
        }
        else {
            attrs = arg;
        }
    }
    else if (arguments.length === 3) {
        // eslint-disable-next-line prefer-rest-params
        attrs = arguments[1];
        // eslint-disable-next-line prefer-rest-params
        renderer = arguments[2];
    }
    else if (arguments.length > 3) {
        throw new Error('hpass() should be called with 1, 2, or 3 arguments');
    }
    return new VirtualElementPass(tag, attrs, renderer);
}
/**
 * The namespace for the virtual DOM rendering functions.
 */
var VirtualDOM;
(function (VirtualDOM) {
    function realize(node) {
        return Private.createDOMNode(node);
    }
    VirtualDOM.realize = realize;
    /**
     * Render virtual DOM content into a host element.
     *
     * @param content - The virtual DOM content to render.
     *
     * @param host - The host element for the rendered content.
     *
     * #### Notes
     * This renders the delta from the previous rendering. It assumes that
     * the content of the host element is not manipulated by external code.
     *
     * Providing `null` content will clear the rendering.
     *
     * Externally modifying the provided content or the host element will
     * result in undefined rendering behavior.
     */
    function render(content, host) {
        let oldContent = Private.hostMap.get(host) || [];
        let newContent = Private.asContentArray(content);
        Private.hostMap.set(host, newContent);
        Private.updateContent(host, oldContent, newContent);
    }
    VirtualDOM.render = render;
})(VirtualDOM || (VirtualDOM = {}));
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * A weak mapping of host element to virtual DOM content.
     */
    Private.hostMap = new WeakMap();
    /**
     * Cast a content value to a content array.
     */
    function asContentArray(value) {
        if (!value) {
            return [];
        }
        if (value instanceof Array) {
            return value;
        }
        return [value];
    }
    Private.asContentArray = asContentArray;
    function createDOMNode(node) {
        // eslint-disable-next-line prefer-rest-params
        let host = arguments[1] || null;
        // eslint-disable-next-line prefer-rest-params
        const before = arguments[2] || null;
        if (host) {
            host.insertBefore(createDOMNode(node), before);
        }
        else {
            // Create a text node for a virtual text node.
            if (node.type === 'text') {
                return document.createTextNode(node.content);
            }
            // Create the HTML element with the specified tag.
            host = document.createElement(node.tag);
            // Add the attributes for the new element.
            addAttrs(host, node.attrs);
            if (node.renderer) {
                node.renderer.render(host, {
                    attrs: node.attrs,
                    children: node.children
                });
                return host;
            }
            // Recursively populate the element with child content.
            for (let i = 0, n = node.children.length; i < n; ++i) {
                createDOMNode(node.children[i], host);
            }
        }
        return host;
    }
    Private.createDOMNode = createDOMNode;
    /**
     * Update a host element with the delta of the virtual content.
     *
     * This is the core "diff" algorithm. There is no explicit "patch"
     * phase. The host is patched at each step as the diff progresses.
     */
    function updateContent(host, oldContent, newContent) {
        // Bail early if the content is identical.
        if (oldContent === newContent) {
            return;
        }
        // Collect the old keyed elems into a mapping.
        let oldKeyed = collectKeys(host, oldContent);
        // Create a copy of the old content which can be modified in-place.
        let oldCopy = oldContent.slice();
        // Update the host with the new content. The diff always proceeds
        // forward and never modifies a previously visited index. The old
        // copy array is modified in-place to reflect the changes made to
        // the host children. This causes the stale nodes to be pushed to
        // the end of the host node and removed at the end of the loop.
        let currElem = host.firstChild;
        let newCount = newContent.length;
        for (let i = 0; i < newCount; ++i) {
            // If the old content is exhausted, create a new node.
            if (i >= oldCopy.length) {
                createDOMNode(newContent[i], host);
                continue;
            }
            // Lookup the old and new virtual nodes.
            let oldVNode = oldCopy[i];
            let newVNode = newContent[i];
            // If both elements are identical, there is nothing to do.
            if (oldVNode === newVNode) {
                currElem = currElem.nextSibling;
                continue;
            }
            // Handle the simplest case of in-place text update first.
            if (oldVNode.type === 'text' && newVNode.type === 'text') {
                // Avoid spurious updates for performance.
                if (currElem.textContent !== newVNode.content) {
                    currElem.textContent = newVNode.content;
                }
                currElem = currElem.nextSibling;
                continue;
            }
            // If the old or new node is a text node, the other node is now
            // known to be an element node, so create and insert a new node.
            if (oldVNode.type === 'text' || newVNode.type === 'text') {
                _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(oldCopy, i, newVNode);
                createDOMNode(newVNode, host, currElem);
                continue;
            }
            // If the old XOR new node has a custom renderer,
            // create and insert a new node.
            if (!oldVNode.renderer != !newVNode.renderer) {
                _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(oldCopy, i, newVNode);
                createDOMNode(newVNode, host, currElem);
                continue;
            }
            // At this point, both nodes are known to be element nodes.
            // If the new elem is keyed, move an old keyed elem to the proper
            // location before proceeding with the diff. The search can start
            // at the current index, since the unmatched old keyed elems are
            // pushed forward in the old copy array.
            let newKey = newVNode.attrs.key;
            if (newKey && newKey in oldKeyed) {
                let pair = oldKeyed[newKey];
                if (pair.vNode !== oldVNode) {
                    _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(oldCopy, oldCopy.indexOf(pair.vNode, i + 1), i);
                    host.insertBefore(pair.element, currElem);
                    oldVNode = pair.vNode;
                    currElem = pair.element;
                }
            }
            // If both elements are identical, there is nothing to do.
            if (oldVNode === newVNode) {
                currElem = currElem.nextSibling;
                continue;
            }
            // If the old elem is keyed and does not match the new elem key,
            // create a new node. This is necessary since the old keyed elem
            // may be matched at a later point in the diff.
            let oldKey = oldVNode.attrs.key;
            if (oldKey && oldKey !== newKey) {
                _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(oldCopy, i, newVNode);
                createDOMNode(newVNode, host, currElem);
                continue;
            }
            // If the tags are different, create a new node.
            if (oldVNode.tag !== newVNode.tag) {
                _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(oldCopy, i, newVNode);
                createDOMNode(newVNode, host, currElem);
                continue;
            }
            // At this point, the element can be updated in-place.
            // Update the element attributes.
            updateAttrs(currElem, oldVNode.attrs, newVNode.attrs);
            // Update the element content.
            if (newVNode.renderer) {
                newVNode.renderer.render(currElem, {
                    attrs: newVNode.attrs,
                    children: newVNode.children
                });
            }
            else {
                updateContent(currElem, oldVNode.children, newVNode.children);
            }
            // Step to the next sibling element.
            currElem = currElem.nextSibling;
        }
        // Cleanup stale DOM
        removeContent(host, oldCopy, newCount, true);
    }
    Private.updateContent = updateContent;
    /**
     * Handle cleanup of stale vdom and its associated DOM. The host node is
     * traversed recursively (in depth-first order), and any explicit cleanup
     * required by a child node is carried out when it is visited (eg if a node
     * has a custom renderer, the renderer.unrender function will be called).
     * Once the subtree beneath each child of host has been completely visited,
     * that child will be removed via a call to host.removeChild.
     */
    function removeContent(host, oldContent, newCount, _sentinel) {
        // Dispose of the old nodes pushed to the end of the host.
        for (let i = oldContent.length - 1; i >= newCount; --i) {
            const oldNode = oldContent[i];
            const child = (_sentinel ? host.lastChild : host.childNodes[i]);
            // recursively clean up host children
            if (oldNode.type === 'text') ;
            else if (oldNode.renderer && oldNode.renderer.unrender) {
                oldNode.renderer.unrender(child, {
                    attrs: oldNode.attrs,
                    children: oldNode.children
                });
            }
            else {
                removeContent(child, oldNode.children, 0, false);
            }
            if (_sentinel) {
                host.removeChild(child);
            }
        }
    }
    /**
     * A set of special-cased attribute names.
     */
    const specialAttrs = {
        key: true,
        className: true,
        htmlFor: true,
        dataset: true,
        style: true
    };
    /**
     * Add element attributes to a newly created HTML element.
     */
    function addAttrs(element, attrs) {
        // Add the inline event listeners and node attributes.
        for (let name in attrs) {
            if (name in specialAttrs) {
                continue;
            }
            if (name.substr(0, 2) === 'on') {
                element[name] = attrs[name];
            }
            else {
                element.setAttribute(name, attrs[name]);
            }
        }
        // Add the element `class` attribute.
        if (attrs.className !== undefined) {
            element.setAttribute('class', attrs.className);
        }
        // Add the element `for` attribute.
        if (attrs.htmlFor !== undefined) {
            element.setAttribute('for', attrs.htmlFor);
        }
        // Add the dataset values.
        if (attrs.dataset) {
            addDataset(element, attrs.dataset);
        }
        // Add the inline styles.
        if (attrs.style) {
            addStyle(element, attrs.style);
        }
    }
    /**
     * Update the element attributes of an HTML element.
     */
    function updateAttrs(element, oldAttrs, newAttrs) {
        // Do nothing if the attrs are the same object.
        if (oldAttrs === newAttrs) {
            return;
        }
        // Setup the strongly typed loop variable.
        let name;
        // Remove attributes and listeners which no longer exist.
        for (name in oldAttrs) {
            if (name in specialAttrs || name in newAttrs) {
                continue;
            }
            if (name.substr(0, 2) === 'on') {
                element[name] = null;
            }
            else {
                element.removeAttribute(name);
            }
        }
        // Add and update new and existing attributes and listeners.
        for (name in newAttrs) {
            if (name in specialAttrs || oldAttrs[name] === newAttrs[name]) {
                continue;
            }
            if (name.substr(0, 2) === 'on') {
                element[name] = newAttrs[name];
            }
            else {
                element.setAttribute(name, newAttrs[name]);
            }
        }
        // Update the element `class` attribute.
        if (oldAttrs.className !== newAttrs.className) {
            if (newAttrs.className !== undefined) {
                element.setAttribute('class', newAttrs.className);
            }
            else {
                element.removeAttribute('class');
            }
        }
        // Add the element `for` attribute.
        if (oldAttrs.htmlFor !== newAttrs.htmlFor) {
            if (newAttrs.htmlFor !== undefined) {
                element.setAttribute('for', newAttrs.htmlFor);
            }
            else {
                element.removeAttribute('for');
            }
        }
        // Update the dataset values.
        if (oldAttrs.dataset !== newAttrs.dataset) {
            updateDataset(element, oldAttrs.dataset || {}, newAttrs.dataset || {});
        }
        // Update the inline styles.
        if (oldAttrs.style !== newAttrs.style) {
            updateStyle(element, oldAttrs.style || {}, newAttrs.style || {});
        }
    }
    /**
     * Add dataset values to a newly created HTML element.
     */
    function addDataset(element, dataset) {
        for (let name in dataset) {
            element.setAttribute(`data-${name}`, dataset[name]);
        }
    }
    /**
     * Update the dataset values of an HTML element.
     */
    function updateDataset(element, oldDataset, newDataset) {
        for (let name in oldDataset) {
            if (!(name in newDataset)) {
                element.removeAttribute(`data-${name}`);
            }
        }
        for (let name in newDataset) {
            if (oldDataset[name] !== newDataset[name]) {
                element.setAttribute(`data-${name}`, newDataset[name]);
            }
        }
    }
    /**
     * Add inline style values to a newly created HTML element.
     */
    function addStyle(element, style) {
        let elemStyle = element.style;
        let name;
        for (name in style) {
            elemStyle[name] = style[name];
        }
    }
    /**
     * Update the inline style values of an HTML element.
     */
    function updateStyle(element, oldStyle, newStyle) {
        let elemStyle = element.style;
        let name;
        for (name in oldStyle) {
            if (!(name in newStyle)) {
                elemStyle[name] = '';
            }
        }
        for (name in newStyle) {
            if (oldStyle[name] !== newStyle[name]) {
                elemStyle[name] = newStyle[name];
            }
        }
    }
    /**
     * Collect a mapping of keyed elements for the host content.
     */
    function collectKeys(host, content) {
        let node = host.firstChild;
        let keyMap = Object.create(null);
        for (let vNode of content) {
            if (vNode.type === 'element' && vNode.attrs.key) {
                keyMap[vNode.attrs.key] = { vNode, element: node };
            }
            node = node.nextSibling;
        }
        return keyMap;
    }
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 30911:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AccordionLayout: () => (/* binding */ AccordionLayout),
/* harmony export */   AccordionPanel: () => (/* binding */ AccordionPanel),
/* harmony export */   BoxEngine: () => (/* binding */ BoxEngine),
/* harmony export */   BoxLayout: () => (/* binding */ BoxLayout),
/* harmony export */   BoxPanel: () => (/* binding */ BoxPanel),
/* harmony export */   BoxSizer: () => (/* binding */ BoxSizer),
/* harmony export */   CommandPalette: () => (/* binding */ CommandPalette),
/* harmony export */   ContextMenu: () => (/* binding */ ContextMenu),
/* harmony export */   DockLayout: () => (/* binding */ DockLayout),
/* harmony export */   DockPanel: () => (/* binding */ DockPanel),
/* harmony export */   FocusTracker: () => (/* binding */ FocusTracker),
/* harmony export */   GridLayout: () => (/* binding */ GridLayout),
/* harmony export */   Layout: () => (/* binding */ Layout),
/* harmony export */   LayoutItem: () => (/* binding */ LayoutItem),
/* harmony export */   Menu: () => (/* binding */ Menu),
/* harmony export */   MenuBar: () => (/* binding */ MenuBar),
/* harmony export */   Panel: () => (/* binding */ Panel),
/* harmony export */   PanelLayout: () => (/* binding */ PanelLayout),
/* harmony export */   ScrollBar: () => (/* binding */ ScrollBar),
/* harmony export */   SingletonLayout: () => (/* binding */ SingletonLayout),
/* harmony export */   SplitLayout: () => (/* binding */ SplitLayout),
/* harmony export */   SplitPanel: () => (/* binding */ SplitPanel),
/* harmony export */   StackedLayout: () => (/* binding */ StackedLayout),
/* harmony export */   StackedPanel: () => (/* binding */ StackedPanel),
/* harmony export */   TabBar: () => (/* binding */ TabBar),
/* harmony export */   TabPanel: () => (/* binding */ TabPanel),
/* harmony export */   Title: () => (/* binding */ Title),
/* harmony export */   Widget: () => (/* binding */ Widget)
/* harmony export */ });
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78839);
/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72215);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19451);
/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(87297);
/* harmony import */ var _lumino_messaging__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_messaging__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10249);
/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_properties__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(46257);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58980);
/* harmony import */ var _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88532);
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_commands__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17197);
/* harmony import */ var _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(61533);
/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _lumino_keyboard__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(10743);
/* harmony import */ var _lumino_keyboard__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_lumino_keyboard__WEBPACK_IMPORTED_MODULE_10__);












// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A sizer object for use with the box engine layout functions.
 *
 * #### Notes
 * A box sizer holds the geometry information for an object along an
 * arbitrary layout orientation.
 *
 * For best performance, this class should be treated as a raw data
 * struct. It should not typically be subclassed.
 */
class BoxSizer {
    constructor() {
        /**
         * The preferred size for the sizer.
         *
         * #### Notes
         * The sizer will be given this initial size subject to its size
         * bounds. The sizer will not deviate from this size unless such
         * deviation is required to fit into the available layout space.
         *
         * There is no limit to this value, but it will be clamped to the
         * bounds defined by {@link minSize} and {@link maxSize}.
         *
         * The default value is `0`.
         */
        this.sizeHint = 0;
        /**
         * The minimum size of the sizer.
         *
         * #### Notes
         * The sizer will never be sized less than this value, even if
         * it means the sizer will overflow the available layout space.
         *
         * It is assumed that this value lies in the range `[0, Infinity)`
         * and that it is `<=` to {@link maxSize}. Failure to adhere to this
         * constraint will yield undefined results.
         *
         * The default value is `0`.
         */
        this.minSize = 0;
        /**
         * The maximum size of the sizer.
         *
         * #### Notes
         * The sizer will never be sized greater than this value, even if
         * it means the sizer will underflow the available layout space.
         *
         * It is assumed that this value lies in the range `[0, Infinity]`
         * and that it is `>=` to {@link minSize}. Failure to adhere to this
         * constraint will yield undefined results.
         *
         * The default value is `Infinity`.
         */
        this.maxSize = Infinity;
        /**
         * The stretch factor for the sizer.
         *
         * #### Notes
         * This controls how much the sizer stretches relative to its sibling
         * sizers when layout space is distributed. A stretch factor of zero
         * is special and will cause the sizer to only be resized after all
         * other sizers with a stretch factor greater than zero have been
         * resized to their limits.
         *
         * It is assumed that this value is an integer that lies in the range
         * `[0, Infinity)`. Failure to adhere to this constraint will yield
         * undefined results.
         *
         * The default value is `1`.
         */
        this.stretch = 1;
        /**
         * The computed size of the sizer.
         *
         * #### Notes
         * This value is the output of a call to {@link BoxEngine.calc}. It represents
         * the computed size for the object along the layout orientation,
         * and will always lie in the range `[minSize, maxSize]`.
         *
         * This value is output only.
         *
         * Changing this value will have no effect.
         */
        this.size = 0;
        /**
         * An internal storage property for the layout algorithm.
         *
         * #### Notes
         * This value is used as temporary storage by the layout algorithm.
         *
         * Changing this value will have no effect.
         */
        this.done = false;
    }
}
/**
 * The namespace for the box engine layout functions.
 */
var BoxEngine;
(function (BoxEngine) {
    /**
     * Calculate the optimal layout sizes for a sequence of box sizers.
     *
     * This distributes the available layout space among the box sizers
     * according to the following algorithm:
     *
     * 1. Initialize the sizers's size to its size hint and compute the
     *    sums for each of size hint, min size, and max size.
     *
     * 2. If the total size hint equals the available space, return.
     *
     * 3. If the available space is less than the total min size, set all
     *    sizers to their min size and return.
     *
     * 4. If the available space is greater than the total max size, set
     *    all sizers to their max size and return.
     *
     * 5. If the layout space is less than the total size hint, distribute
     *    the negative delta as follows:
     *
     *    a. Shrink each sizer with a stretch factor greater than zero by
     *       an amount proportional to the negative space and the sum of
     *       stretch factors. If the sizer reaches its min size, remove
     *       it and its stretch factor from the computation.
     *
     *    b. If after adjusting all stretch sizers there remains negative
     *       space, distribute the space equally among the sizers with a
     *       stretch factor of zero. If a sizer reaches its min size,
     *       remove it from the computation.
     *
     * 6. If the layout space is greater than the total size hint,
     *    distribute the positive delta as follows:
     *
     *    a. Expand each sizer with a stretch factor greater than zero by
     *       an amount proportional to the postive space and the sum of
     *       stretch factors. If the sizer reaches its max size, remove
     *       it and its stretch factor from the computation.
     *
     *    b. If after adjusting all stretch sizers there remains positive
     *       space, distribute the space equally among the sizers with a
     *       stretch factor of zero. If a sizer reaches its max size,
     *       remove it from the computation.
     *
     * 7. return
     *
     * @param sizers - The sizers for a particular layout line.
     *
     * @param space - The available layout space for the sizers.
     *
     * @returns The delta between the provided available space and the
     *   actual consumed space. This value will be zero if the sizers
     *   can be adjusted to fit, negative if the available space is too
     *   small, and positive if the available space is too large.
     *
     * #### Notes
     * The {@link BoxSizer.size} of each sizer is updated with the computed size.
     *
     * This function can be called at any time to recompute the layout for
     * an existing sequence of sizers. The previously computed results will
     * have no effect on the new output. It is therefore not necessary to
     * create new sizer objects on each resize event.
     */
    function calc(sizers, space) {
        // Bail early if there is nothing to do.
        let count = sizers.length;
        if (count === 0) {
            return space;
        }
        // Setup the size and stretch counters.
        let totalMin = 0;
        let totalMax = 0;
        let totalSize = 0;
        let totalStretch = 0;
        let stretchCount = 0;
        // Setup the sizers and compute the totals.
        for (let i = 0; i < count; ++i) {
            let sizer = sizers[i];
            let min = sizer.minSize;
            let max = sizer.maxSize;
            let hint = sizer.sizeHint;
            sizer.done = false;
            sizer.size = Math.max(min, Math.min(hint, max));
            totalSize += sizer.size;
            totalMin += min;
            totalMax += max;
            if (sizer.stretch > 0) {
                totalStretch += sizer.stretch;
                stretchCount++;
            }
        }
        // If the space is equal to the total size, return early.
        if (space === totalSize) {
            return 0;
        }
        // If the space is less than the total min, minimize each sizer.
        if (space <= totalMin) {
            for (let i = 0; i < count; ++i) {
                let sizer = sizers[i];
                sizer.size = sizer.minSize;
            }
            return space - totalMin;
        }
        // If the space is greater than the total max, maximize each sizer.
        if (space >= totalMax) {
            for (let i = 0; i < count; ++i) {
                let sizer = sizers[i];
                sizer.size = sizer.maxSize;
            }
            return space - totalMax;
        }
        // The loops below perform sub-pixel precision sizing. A near zero
        // value is used for compares instead of zero to ensure that the
        // loop terminates when the subdivided space is reasonably small.
        let nearZero = 0.01;
        // A counter which is decremented each time a sizer is resized to
        // its limit. This ensures the loops terminate even if there is
        // space remaining to distribute.
        let notDoneCount = count;
        // Distribute negative delta space.
        if (space < totalSize) {
            // Shrink each stretchable sizer by an amount proportional to its
            // stretch factor. If a sizer reaches its min size it's marked as
            // done. The loop progresses in phases where each sizer is given
            // a chance to consume its fair share for the pass, regardless of
            // whether a sizer before it reached its limit. This continues
            // until the stretchable sizers or the free space is exhausted.
            let freeSpace = totalSize - space;
            while (stretchCount > 0 && freeSpace > nearZero) {
                let distSpace = freeSpace;
                let distStretch = totalStretch;
                for (let i = 0; i < count; ++i) {
                    let sizer = sizers[i];
                    if (sizer.done || sizer.stretch === 0) {
                        continue;
                    }
                    let amt = (sizer.stretch * distSpace) / distStretch;
                    if (sizer.size - amt <= sizer.minSize) {
                        freeSpace -= sizer.size - sizer.minSize;
                        totalStretch -= sizer.stretch;
                        sizer.size = sizer.minSize;
                        sizer.done = true;
                        notDoneCount--;
                        stretchCount--;
                    }
                    else {
                        freeSpace -= amt;
                        sizer.size -= amt;
                    }
                }
            }
            // Distribute any remaining space evenly among the non-stretchable
            // sizers. This progresses in phases in the same manner as above.
            while (notDoneCount > 0 && freeSpace > nearZero) {
                let amt = freeSpace / notDoneCount;
                for (let i = 0; i < count; ++i) {
                    let sizer = sizers[i];
                    if (sizer.done) {
                        continue;
                    }
                    if (sizer.size - amt <= sizer.minSize) {
                        freeSpace -= sizer.size - sizer.minSize;
                        sizer.size = sizer.minSize;
                        sizer.done = true;
                        notDoneCount--;
                    }
                    else {
                        freeSpace -= amt;
                        sizer.size -= amt;
                    }
                }
            }
        }
        // Distribute positive delta space.
        else {
            // Expand each stretchable sizer by an amount proportional to its
            // stretch factor. If a sizer reaches its max size it's marked as
            // done. The loop progresses in phases where each sizer is given
            // a chance to consume its fair share for the pass, regardless of
            // whether a sizer before it reached its limit. This continues
            // until the stretchable sizers or the free space is exhausted.
            let freeSpace = space - totalSize;
            while (stretchCount > 0 && freeSpace > nearZero) {
                let distSpace = freeSpace;
                let distStretch = totalStretch;
                for (let i = 0; i < count; ++i) {
                    let sizer = sizers[i];
                    if (sizer.done || sizer.stretch === 0) {
                        continue;
                    }
                    let amt = (sizer.stretch * distSpace) / distStretch;
                    if (sizer.size + amt >= sizer.maxSize) {
                        freeSpace -= sizer.maxSize - sizer.size;
                        totalStretch -= sizer.stretch;
                        sizer.size = sizer.maxSize;
                        sizer.done = true;
                        notDoneCount--;
                        stretchCount--;
                    }
                    else {
                        freeSpace -= amt;
                        sizer.size += amt;
                    }
                }
            }
            // Distribute any remaining space evenly among the non-stretchable
            // sizers. This progresses in phases in the same manner as above.
            while (notDoneCount > 0 && freeSpace > nearZero) {
                let amt = freeSpace / notDoneCount;
                for (let i = 0; i < count; ++i) {
                    let sizer = sizers[i];
                    if (sizer.done) {
                        continue;
                    }
                    if (sizer.size + amt >= sizer.maxSize) {
                        freeSpace -= sizer.maxSize - sizer.size;
                        sizer.size = sizer.maxSize;
                        sizer.done = true;
                        notDoneCount--;
                    }
                    else {
                        freeSpace -= amt;
                        sizer.size += amt;
                    }
                }
            }
        }
        // Indicate that the consumed space equals the available space.
        return 0;
    }
    BoxEngine.calc = calc;
    /**
     * Adjust a sizer by a delta and update its neighbors accordingly.
     *
     * @param sizers - The sizers which should be adjusted.
     *
     * @param index - The index of the sizer to grow.
     *
     * @param delta - The amount to adjust the sizer, positive or negative.
     *
     * #### Notes
     * This will adjust the indicated sizer by the specified amount, along
     * with the sizes of the appropriate neighbors, subject to the limits
     * specified by each of the sizers.
     *
     * This is useful when implementing box layouts where the boundaries
     * between the sizers are interactively adjustable by the user.
     */
    function adjust(sizers, index, delta) {
        // Bail early when there is nothing to do.
        if (sizers.length === 0 || delta === 0) {
            return;
        }
        // Dispatch to the proper implementation.
        if (delta > 0) {
            growSizer(sizers, index, delta);
        }
        else {
            shrinkSizer(sizers, index, -delta);
        }
    }
    BoxEngine.adjust = adjust;
    /**
     * Grow a sizer by a positive delta and adjust neighbors.
     */
    function growSizer(sizers, index, delta) {
        // Compute how much the items to the left can expand.
        let growLimit = 0;
        for (let i = 0; i <= index; ++i) {
            let sizer = sizers[i];
            growLimit += sizer.maxSize - sizer.size;
        }
        // Compute how much the items to the right can shrink.
        let shrinkLimit = 0;
        for (let i = index + 1, n = sizers.length; i < n; ++i) {
            let sizer = sizers[i];
            shrinkLimit += sizer.size - sizer.minSize;
        }
        // Clamp the delta adjustment to the limits.
        delta = Math.min(delta, growLimit, shrinkLimit);
        // Grow the sizers to the left by the delta.
        let grow = delta;
        for (let i = index; i >= 0 && grow > 0; --i) {
            let sizer = sizers[i];
            let limit = sizer.maxSize - sizer.size;
            if (limit >= grow) {
                sizer.sizeHint = sizer.size + grow;
                grow = 0;
            }
            else {
                sizer.sizeHint = sizer.size + limit;
                grow -= limit;
            }
        }
        // Shrink the sizers to the right by the delta.
        let shrink = delta;
        for (let i = index + 1, n = sizers.length; i < n && shrink > 0; ++i) {
            let sizer = sizers[i];
            let limit = sizer.size - sizer.minSize;
            if (limit >= shrink) {
                sizer.sizeHint = sizer.size - shrink;
                shrink = 0;
            }
            else {
                sizer.sizeHint = sizer.size - limit;
                shrink -= limit;
            }
        }
    }
    /**
     * Shrink a sizer by a positive delta and adjust neighbors.
     */
    function shrinkSizer(sizers, index, delta) {
        // Compute how much the items to the right can expand.
        let growLimit = 0;
        for (let i = index + 1, n = sizers.length; i < n; ++i) {
            let sizer = sizers[i];
            growLimit += sizer.maxSize - sizer.size;
        }
        // Compute how much the items to the left can shrink.
        let shrinkLimit = 0;
        for (let i = 0; i <= index; ++i) {
            let sizer = sizers[i];
            shrinkLimit += sizer.size - sizer.minSize;
        }
        // Clamp the delta adjustment to the limits.
        delta = Math.min(delta, growLimit, shrinkLimit);
        // Grow the sizers to the right by the delta.
        let grow = delta;
        for (let i = index + 1, n = sizers.length; i < n && grow > 0; ++i) {
            let sizer = sizers[i];
            let limit = sizer.maxSize - sizer.size;
            if (limit >= grow) {
                sizer.sizeHint = sizer.size + grow;
                grow = 0;
            }
            else {
                sizer.sizeHint = sizer.size + limit;
                grow -= limit;
            }
        }
        // Shrink the sizers to the left by the delta.
        let shrink = delta;
        for (let i = index; i >= 0 && shrink > 0; --i) {
            let sizer = sizers[i];
            let limit = sizer.size - sizer.minSize;
            if (limit >= shrink) {
                sizer.sizeHint = sizer.size - shrink;
                shrink = 0;
            }
            else {
                sizer.sizeHint = sizer.size - limit;
                shrink -= limit;
            }
        }
    }
})(BoxEngine || (BoxEngine = {}));

/**
 * An object which holds data related to an object's title.
 *
 * #### Notes
 * A title object is intended to hold the data necessary to display a
 * header for a particular object. A common example is the `TabPanel`,
 * which uses the widget title to populate the tab for a child widget.
 *
 * It is the responsibility of the owner to call the title disposal.
 */
class Title {
    /**
     * Construct a new title.
     *
     * @param options - The options for initializing the title.
     */
    constructor(options) {
        this._label = '';
        this._caption = '';
        this._mnemonic = -1;
        this._icon = undefined;
        this._iconClass = '';
        this._iconLabel = '';
        this._className = '';
        this._closable = false;
        this._changed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._isDisposed = false;
        this.owner = options.owner;
        if (options.label !== undefined) {
            this._label = options.label;
        }
        if (options.mnemonic !== undefined) {
            this._mnemonic = options.mnemonic;
        }
        if (options.icon !== undefined) {
            this._icon = options.icon;
        }
        if (options.iconClass !== undefined) {
            this._iconClass = options.iconClass;
        }
        if (options.iconLabel !== undefined) {
            this._iconLabel = options.iconLabel;
        }
        if (options.caption !== undefined) {
            this._caption = options.caption;
        }
        if (options.className !== undefined) {
            this._className = options.className;
        }
        if (options.closable !== undefined) {
            this._closable = options.closable;
        }
        this._dataset = options.dataset || {};
    }
    /**
     * A signal emitted when the state of the title changes.
     */
    get changed() {
        return this._changed;
    }
    /**
     * Get the label for the title.
     *
     * #### Notes
     * The default value is an empty string.
     */
    get label() {
        return this._label;
    }
    /**
     * Set the label for the title.
     */
    set label(value) {
        if (this._label === value) {
            return;
        }
        this._label = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the mnemonic index for the title.
     *
     * #### Notes
     * The default value is `-1`.
     */
    get mnemonic() {
        return this._mnemonic;
    }
    /**
     * Set the mnemonic index for the title.
     */
    set mnemonic(value) {
        if (this._mnemonic === value) {
            return;
        }
        this._mnemonic = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the icon renderer for the title.
     *
     * #### Notes
     * The default value is undefined.
     */
    get icon() {
        return this._icon;
    }
    /**
     * Set the icon renderer for the title.
     *
     * #### Notes
     * A renderer is an object that supplies a render and unrender function.
     */
    set icon(value) {
        if (this._icon === value) {
            return;
        }
        this._icon = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the icon class name for the title.
     *
     * #### Notes
     * The default value is an empty string.
     */
    get iconClass() {
        return this._iconClass;
    }
    /**
     * Set the icon class name for the title.
     *
     * #### Notes
     * Multiple class names can be separated with whitespace.
     */
    set iconClass(value) {
        if (this._iconClass === value) {
            return;
        }
        this._iconClass = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the icon label for the title.
     *
     * #### Notes
     * The default value is an empty string.
     */
    get iconLabel() {
        return this._iconLabel;
    }
    /**
     * Set the icon label for the title.
     *
     * #### Notes
     * Multiple class names can be separated with whitespace.
     */
    set iconLabel(value) {
        if (this._iconLabel === value) {
            return;
        }
        this._iconLabel = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the caption for the title.
     *
     * #### Notes
     * The default value is an empty string.
     */
    get caption() {
        return this._caption;
    }
    /**
     * Set the caption for the title.
     */
    set caption(value) {
        if (this._caption === value) {
            return;
        }
        this._caption = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the extra class name for the title.
     *
     * #### Notes
     * The default value is an empty string.
     */
    get className() {
        return this._className;
    }
    /**
     * Set the extra class name for the title.
     *
     * #### Notes
     * Multiple class names can be separated with whitespace.
     */
    set className(value) {
        if (this._className === value) {
            return;
        }
        this._className = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the closable state for the title.
     *
     * #### Notes
     * The default value is `false`.
     */
    get closable() {
        return this._closable;
    }
    /**
     * Set the closable state for the title.
     *
     * #### Notes
     * This controls the presence of a close icon when applicable.
     */
    set closable(value) {
        if (this._closable === value) {
            return;
        }
        this._closable = value;
        this._changed.emit(undefined);
    }
    /**
     * Get the dataset for the title.
     *
     * #### Notes
     * The default value is an empty dataset.
     */
    get dataset() {
        return this._dataset;
    }
    /**
     * Set the dataset for the title.
     *
     * #### Notes
     * This controls the data attributes when applicable.
     */
    set dataset(value) {
        if (this._dataset === value) {
            return;
        }
        this._dataset = value;
        this._changed.emit(undefined);
    }
    /**
     * Test whether the title has been disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Dispose of the resources held by the title.
     *
     * #### Notes
     * It is the responsibility of the owner to call the title disposal.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal.clearData(this);
    }
}

/**
 * The base class of the lumino widget hierarchy.
 *
 * #### Notes
 * This class will typically be subclassed in order to create a useful
 * widget. However, it can be used directly to host externally created
 * content.
 */
class Widget {
    /**
     * Construct a new widget.
     *
     * @param options - The options for initializing the widget.
     */
    constructor(options = {}) {
        this._flags = 0;
        this._layout = null;
        this._parent = null;
        this._disposed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._hiddenMode = Widget.HiddenMode.Display;
        this.node = Private$j.createNode(options);
        this.addClass('lm-Widget');
    }
    /**
     * Dispose of the widget and its descendant widgets.
     *
     * #### Notes
     * It is unsafe to use the widget after it has been disposed.
     *
     * All calls made to this method after the first are a no-op.
     */
    dispose() {
        // Do nothing if the widget is already disposed.
        if (this.isDisposed) {
            return;
        }
        // Set the disposed flag and emit the disposed signal.
        this.setFlag(Widget.Flag.IsDisposed);
        this._disposed.emit(undefined);
        // Remove or detach the widget if necessary.
        if (this.parent) {
            this.parent = null;
        }
        else if (this.isAttached) {
            Widget.detach(this);
        }
        // Dispose of the widget layout.
        if (this._layout) {
            this._layout.dispose();
            this._layout = null;
        }
        // Dispose the title
        this.title.dispose();
        // Clear the extra data associated with the widget.
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal.clearData(this);
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.clearData(this);
        _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty.clearData(this);
    }
    /**
     * A signal emitted when the widget is disposed.
     */
    get disposed() {
        return this._disposed;
    }
    /**
     * Test whether the widget has been disposed.
     */
    get isDisposed() {
        return this.testFlag(Widget.Flag.IsDisposed);
    }
    /**
     * Test whether the widget's node is attached to the DOM.
     */
    get isAttached() {
        return this.testFlag(Widget.Flag.IsAttached);
    }
    /**
     * Test whether the widget is explicitly hidden.
     *
     * #### Notes
     * You should prefer `!{@link isVisible}` over `{@link isHidden}` if you want to know if the
     * widget is hidden as this does not test if the widget is hidden because one of its ancestors is hidden.
     */
    get isHidden() {
        return this.testFlag(Widget.Flag.IsHidden);
    }
    /**
     * Test whether the widget is visible.
     *
     * #### Notes
     * A widget is visible when it is attached to the DOM, is not
     * explicitly hidden, and has no explicitly hidden ancestors.
     *
     * Since 2.7.0, this does not rely on the {@link Widget.Flag.IsVisible} flag.
     * It recursively checks the visibility of all parent widgets.
     */
    get isVisible() {
        // eslint-disable-next-line @typescript-eslint/no-this-alias
        let parent = this;
        do {
            if (parent.isHidden || !parent.isAttached) {
                return false;
            }
            parent = parent.parent;
        } while (parent != null);
        return true;
    }
    /**
     * The title object for the widget.
     *
     * #### Notes
     * The title object is used by some container widgets when displaying
     * the widget alongside some title, such as a tab panel or side bar.
     *
     * Since not all widgets will use the title, it is created on demand.
     *
     * The `owner` property of the title is set to this widget.
     */
    get title() {
        return Private$j.titleProperty.get(this);
    }
    /**
     * Get the id of the widget's DOM node.
     */
    get id() {
        return this.node.id;
    }
    /**
     * Set the id of the widget's DOM node.
     */
    set id(value) {
        this.node.id = value;
    }
    /**
     * The dataset for the widget's DOM node.
     */
    get dataset() {
        return this.node.dataset;
    }
    /**
     * Get the method for hiding the widget.
     */
    get hiddenMode() {
        return this._hiddenMode;
    }
    /**
     * Set the method for hiding the widget.
     */
    set hiddenMode(value) {
        if (this._hiddenMode === value) {
            return;
        }
        if (this.isHidden) {
            // Reset styles set by previous mode.
            this._toggleHidden(false);
        }
        if (value == Widget.HiddenMode.Scale) {
            this.node.style.willChange = 'transform';
        }
        else {
            this.node.style.willChange = 'auto';
        }
        this._hiddenMode = value;
        if (this.isHidden) {
            // Set styles for new mode.
            this._toggleHidden(true);
        }
    }
    /**
     * Get the parent of the widget.
     */
    get parent() {
        return this._parent;
    }
    /**
     * Set the parent of the widget.
     *
     * #### Notes
     * Children are typically added to a widget by using a layout, which
     * means user code will not normally set the parent widget directly.
     *
     * The widget will be automatically removed from its old parent.
     *
     * This is a no-op if there is no effective parent change.
     */
    set parent(value) {
        if (this._parent === value) {
            return;
        }
        if (value && this.contains(value)) {
            throw new Error('Invalid parent widget.');
        }
        if (this._parent && !this._parent.isDisposed) {
            let msg = new Widget.ChildMessage('child-removed', this);
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this._parent, msg);
        }
        this._parent = value;
        if (this._parent && !this._parent.isDisposed) {
            let msg = new Widget.ChildMessage('child-added', this);
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this._parent, msg);
        }
        if (!this.isDisposed) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.ParentChanged);
        }
    }
    /**
     * Get the layout for the widget.
     */
    get layout() {
        return this._layout;
    }
    /**
     * Set the layout for the widget.
     *
     * #### Notes
     * The layout is single-use only. It cannot be changed after the
     * first assignment.
     *
     * The layout is disposed automatically when the widget is disposed.
     */
    set layout(value) {
        if (this._layout === value) {
            return;
        }
        if (this.testFlag(Widget.Flag.DisallowLayout)) {
            throw new Error('Cannot set widget layout.');
        }
        if (this._layout) {
            throw new Error('Cannot change widget layout.');
        }
        if (value.parent) {
            throw new Error('Cannot change layout parent.');
        }
        this._layout = value;
        value.parent = this;
    }
    /**
     * Create an iterator over the widget's children.
     *
     * @returns A new iterator over the children of the widget.
     *
     * #### Notes
     * The widget must have a populated layout in order to have children.
     *
     * If a layout is not installed, the returned iterator will be empty.
     */
    *children() {
        if (this._layout) {
            yield* this._layout;
        }
    }
    /**
     * Test whether a widget is a descendant of this widget.
     *
     * @param widget - The descendant widget of interest.
     *
     * @returns `true` if the widget is a descendant, `false` otherwise.
     */
    contains(widget) {
        for (let value = widget; value; value = value._parent) {
            if (value === this) {
                return true;
            }
        }
        return false;
    }
    /**
     * Test whether the widget's DOM node has the given class name.
     *
     * @param name - The class name of interest.
     *
     * @returns `true` if the node has the class, `false` otherwise.
     */
    hasClass(name) {
        return this.node.classList.contains(name);
    }
    /**
     * Add a class name to the widget's DOM node.
     *
     * @param name - The class name to add to the node.
     *
     * #### Notes
     * If the class name is already added to the node, this is a no-op.
     *
     * The class name must not contain whitespace.
     */
    addClass(name) {
        this.node.classList.add(name);
    }
    /**
     * Remove a class name from the widget's DOM node.
     *
     * @param name - The class name to remove from the node.
     *
     * #### Notes
     * If the class name is not yet added to the node, this is a no-op.
     *
     * The class name must not contain whitespace.
     */
    removeClass(name) {
        this.node.classList.remove(name);
    }
    /**
     * Toggle a class name on the widget's DOM node.
     *
     * @param name - The class name to toggle on the node.
     *
     * @param force - Whether to force add the class (`true`) or force
     *   remove the class (`false`). If not provided, the presence of
     *   the class will be toggled from its current state.
     *
     * @returns `true` if the class is now present, `false` otherwise.
     *
     * #### Notes
     * The class name must not contain whitespace.
     */
    toggleClass(name, force) {
        if (force === true) {
            this.node.classList.add(name);
            return true;
        }
        if (force === false) {
            this.node.classList.remove(name);
            return false;
        }
        return this.node.classList.toggle(name);
    }
    /**
     * Post an `'update-request'` message to the widget.
     *
     * #### Notes
     * This is a simple convenience method for posting the message.
     */
    update() {
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Widget.Msg.UpdateRequest);
    }
    /**
     * Post a `'fit-request'` message to the widget.
     *
     * #### Notes
     * This is a simple convenience method for posting the message.
     */
    fit() {
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Widget.Msg.FitRequest);
    }
    /**
     * Post an `'activate-request'` message to the widget.
     *
     * #### Notes
     * This is a simple convenience method for posting the message.
     */
    activate() {
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Widget.Msg.ActivateRequest);
    }
    /**
     * Send a `'close-request'` message to the widget.
     *
     * #### Notes
     * This is a simple convenience method for sending the message.
     */
    close() {
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.CloseRequest);
    }
    /**
     * Show the widget and make it visible to its parent widget.
     *
     * #### Notes
     * This causes the {@link isHidden} property to be `false`.
     *
     * If the widget is not explicitly hidden, this is a no-op.
     */
    show() {
        if (!this.testFlag(Widget.Flag.IsHidden)) {
            return;
        }
        if (this.isAttached && (!this.parent || this.parent.isVisible)) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.BeforeShow);
        }
        this.clearFlag(Widget.Flag.IsHidden);
        this._toggleHidden(false);
        if (this.isAttached && (!this.parent || this.parent.isVisible)) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.AfterShow);
        }
        if (this.parent) {
            let msg = new Widget.ChildMessage('child-shown', this);
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, msg);
        }
    }
    /**
     * Hide the widget and make it hidden to its parent widget.
     *
     * #### Notes
     * This causes the {@link isHidden} property to be `true`.
     *
     * If the widget is explicitly hidden, this is a no-op.
     */
    hide() {
        if (this.testFlag(Widget.Flag.IsHidden)) {
            return;
        }
        if (this.isAttached && (!this.parent || this.parent.isVisible)) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.BeforeHide);
        }
        this.setFlag(Widget.Flag.IsHidden);
        this._toggleHidden(true);
        if (this.isAttached && (!this.parent || this.parent.isVisible)) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.AfterHide);
        }
        if (this.parent) {
            let msg = new Widget.ChildMessage('child-hidden', this);
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, msg);
        }
    }
    /**
     * Show or hide the widget according to a boolean value.
     *
     * @param hidden - `true` to hide the widget, or `false` to show it.
     *
     * #### Notes
     * This is a convenience method for `hide()` and `show()`.
     */
    setHidden(hidden) {
        if (hidden) {
            this.hide();
        }
        else {
            this.show();
        }
    }
    /**
     * Test whether the given widget flag is set.
     *
     * #### Notes
     * This will not typically be called directly by user code.
     *
     * Since 2.7.0, {@link Widget.Flag.IsVisible} is deprecated.
     * It will be removed in a future version.
     */
    testFlag(flag) {
        return (this._flags & flag) !== 0;
    }
    /**
     * Set the given widget flag.
     *
     * #### Notes
     * This will not typically be called directly by user code.
     *
     * Since 2.7.0, {@link Widget.Flag.IsVisible} is deprecated.
     * It will be removed in a future version.
     */
    setFlag(flag) {
        this._flags |= flag;
    }
    /**
     * Clear the given widget flag.
     *
     * #### Notes
     * This will not typically be called directly by user code.
     *
     * Since 2.7.0, {@link Widget.Flag.IsVisible} is deprecated.
     * It will be removed in a future version.
     */
    clearFlag(flag) {
        this._flags &= ~flag;
    }
    /**
     * Process a message sent to the widget.
     *
     * @param msg - The message sent to the widget.
     *
     * #### Notes
     * Subclasses may reimplement this method as needed.
     */
    processMessage(msg) {
        switch (msg.type) {
            case 'resize':
                this.notifyLayout(msg);
                this.onResize(msg);
                break;
            case 'update-request':
                this.notifyLayout(msg);
                this.onUpdateRequest(msg);
                break;
            case 'fit-request':
                this.notifyLayout(msg);
                this.onFitRequest(msg);
                break;
            case 'before-show':
                this.notifyLayout(msg);
                this.onBeforeShow(msg);
                break;
            case 'after-show':
                this.setFlag(Widget.Flag.IsVisible);
                this.notifyLayout(msg);
                this.onAfterShow(msg);
                break;
            case 'before-hide':
                this.notifyLayout(msg);
                this.onBeforeHide(msg);
                break;
            case 'after-hide':
                this.clearFlag(Widget.Flag.IsVisible);
                this.notifyLayout(msg);
                this.onAfterHide(msg);
                break;
            case 'before-attach':
                this.notifyLayout(msg);
                this.onBeforeAttach(msg);
                break;
            case 'after-attach':
                if (!this.isHidden && (!this.parent || this.parent.isVisible)) {
                    this.setFlag(Widget.Flag.IsVisible);
                }
                this.setFlag(Widget.Flag.IsAttached);
                this.notifyLayout(msg);
                this.onAfterAttach(msg);
                break;
            case 'before-detach':
                this.notifyLayout(msg);
                this.onBeforeDetach(msg);
                break;
            case 'after-detach':
                this.clearFlag(Widget.Flag.IsVisible);
                this.clearFlag(Widget.Flag.IsAttached);
                this.notifyLayout(msg);
                this.onAfterDetach(msg);
                break;
            case 'activate-request':
                this.notifyLayout(msg);
                this.onActivateRequest(msg);
                break;
            case 'close-request':
                this.notifyLayout(msg);
                this.onCloseRequest(msg);
                break;
            case 'child-added':
                this.notifyLayout(msg);
                this.onChildAdded(msg);
                break;
            case 'child-removed':
                this.notifyLayout(msg);
                this.onChildRemoved(msg);
                break;
            default:
                this.notifyLayout(msg);
                break;
        }
    }
    /**
     * Invoke the message processing routine of the widget's layout.
     *
     * @param msg - The message to dispatch to the layout.
     *
     * #### Notes
     * This is a no-op if the widget does not have a layout.
     *
     * This will not typically be called directly by user code.
     */
    notifyLayout(msg) {
        if (this._layout) {
            this._layout.processParentMessage(msg);
        }
    }
    /**
     * A message handler invoked on a `'close-request'` message.
     *
     * #### Notes
     * The default implementation unparents or detaches the widget.
     */
    onCloseRequest(msg) {
        if (this.parent) {
            this.parent = null;
        }
        else if (this.isAttached) {
            Widget.detach(this);
        }
    }
    /**
     * A message handler invoked on a `'resize'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onResize(msg) { }
    /**
     * A message handler invoked on an `'update-request'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onUpdateRequest(msg) { }
    /**
     * A message handler invoked on a `'fit-request'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onFitRequest(msg) { }
    /**
     * A message handler invoked on an `'activate-request'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onActivateRequest(msg) { }
    /**
     * A message handler invoked on a `'before-show'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onBeforeShow(msg) { }
    /**
     * A message handler invoked on an `'after-show'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onAfterShow(msg) { }
    /**
     * A message handler invoked on a `'before-hide'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onBeforeHide(msg) { }
    /**
     * A message handler invoked on an `'after-hide'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onAfterHide(msg) { }
    /**
     * A message handler invoked on a `'before-attach'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onBeforeAttach(msg) { }
    /**
     * A message handler invoked on an `'after-attach'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onAfterAttach(msg) { }
    /**
     * A message handler invoked on a `'before-detach'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onBeforeDetach(msg) { }
    /**
     * A message handler invoked on an `'after-detach'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onAfterDetach(msg) { }
    /**
     * A message handler invoked on a `'child-added'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onChildAdded(msg) { }
    /**
     * A message handler invoked on a `'child-removed'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onChildRemoved(msg) { }
    _toggleHidden(hidden) {
        if (hidden) {
            switch (this._hiddenMode) {
                case Widget.HiddenMode.Display:
                    this.addClass('lm-mod-hidden');
                    break;
                case Widget.HiddenMode.Scale:
                    this.node.style.transform = 'scale(0)';
                    this.node.setAttribute('aria-hidden', 'true');
                    break;
                case Widget.HiddenMode.ContentVisibility:
                    // @ts-expect-error content-visibility unknown by DOM lib types
                    this.node.style.contentVisibility = 'hidden';
                    this.node.style.zIndex = '-1';
                    break;
            }
        }
        else {
            switch (this._hiddenMode) {
                case Widget.HiddenMode.Display:
                    this.removeClass('lm-mod-hidden');
                    break;
                case Widget.HiddenMode.Scale:
                    this.node.style.transform = '';
                    this.node.removeAttribute('aria-hidden');
                    break;
                case Widget.HiddenMode.ContentVisibility:
                    // @ts-expect-error content-visibility unknown by DOM lib types
                    this.node.style.contentVisibility = '';
                    this.node.style.zIndex = '';
                    break;
            }
        }
    }
}
/**
 * The namespace for the `Widget` class statics.
 */
(function (Widget) {
    (function (HiddenMode) {
        /**
         * Set a `lm-mod-hidden` CSS class to hide the widget using `display:none`
         * CSS from the standard Lumino CSS.
         */
        HiddenMode[HiddenMode["Display"] = 0] = "Display";
        /**
         * Hide the widget by setting the `transform` to `'scale(0)'`.
         */
        HiddenMode[HiddenMode["Scale"] = 1] = "Scale";
        /**
         *Hide the widget by setting the `content-visibility` to `'hidden'`.
         */
        HiddenMode[HiddenMode["ContentVisibility"] = 2] = "ContentVisibility";
    })(Widget.HiddenMode || (Widget.HiddenMode = {}));
    (function (Flag) {
        /**
         * The widget has been disposed.
         */
        Flag[Flag["IsDisposed"] = 1] = "IsDisposed";
        /**
         * The widget is attached to the DOM.
         */
        Flag[Flag["IsAttached"] = 2] = "IsAttached";
        /**
         * The widget is hidden.
         */
        Flag[Flag["IsHidden"] = 4] = "IsHidden";
        /**
         * The widget is visible.
         *
         * @deprecated since 2.7.0, apply that flag consistently was not reliable
         * so it was dropped in favor of a recursive check of the visibility of all parents.
         */
        Flag[Flag["IsVisible"] = 8] = "IsVisible";
        /**
         * A layout cannot be set on the widget.
         */
        Flag[Flag["DisallowLayout"] = 16] = "DisallowLayout";
    })(Widget.Flag || (Widget.Flag = {}));
    (function (Msg) {
        /**
         * A singleton `'before-show'` message.
         *
         * #### Notes
         * This message is sent to a widget before it becomes visible.
         *
         * This message is **not** sent when the widget is being attached.
         */
        Msg.BeforeShow = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('before-show');
        /**
         * A singleton `'after-show'` message.
         *
         * #### Notes
         * This message is sent to a widget after it becomes visible.
         *
         * This message is **not** sent when the widget is being attached.
         */
        Msg.AfterShow = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('after-show');
        /**
         * A singleton `'before-hide'` message.
         *
         * #### Notes
         * This message is sent to a widget before it becomes not-visible.
         *
         * This message is **not** sent when the widget is being detached.
         */
        Msg.BeforeHide = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('before-hide');
        /**
         * A singleton `'after-hide'` message.
         *
         * #### Notes
         * This message is sent to a widget after it becomes not-visible.
         *
         * This message is **not** sent when the widget is being detached.
         */
        Msg.AfterHide = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('after-hide');
        /**
         * A singleton `'before-attach'` message.
         *
         * #### Notes
         * This message is sent to a widget before it is attached.
         */
        Msg.BeforeAttach = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('before-attach');
        /**
         * A singleton `'after-attach'` message.
         *
         * #### Notes
         * This message is sent to a widget after it is attached.
         */
        Msg.AfterAttach = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('after-attach');
        /**
         * A singleton `'before-detach'` message.
         *
         * #### Notes
         * This message is sent to a widget before it is detached.
         */
        Msg.BeforeDetach = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('before-detach');
        /**
         * A singleton `'after-detach'` message.
         *
         * #### Notes
         * This message is sent to a widget after it is detached.
         */
        Msg.AfterDetach = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('after-detach');
        /**
         * A singleton `'parent-changed'` message.
         *
         * #### Notes
         * This message is sent to a widget when its parent has changed.
         */
        Msg.ParentChanged = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message('parent-changed');
        /**
         * A singleton conflatable `'update-request'` message.
         *
         * #### Notes
         * This message can be dispatched to supporting widgets in order to
         * update their content based on the current widget state. Not all
         * widgets will respond to messages of this type.
         *
         * For widgets with a layout, this message will inform the layout to
         * update the position and size of its child widgets.
         */
        Msg.UpdateRequest = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.ConflatableMessage('update-request');
        /**
         * A singleton conflatable `'fit-request'` message.
         *
         * #### Notes
         * For widgets with a layout, this message will inform the layout to
         * recalculate its size constraints to fit the space requirements of
         * its child widgets, and to update their position and size. Not all
         * layouts will respond to messages of this type.
         */
        Msg.FitRequest = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.ConflatableMessage('fit-request');
        /**
         * A singleton conflatable `'activate-request'` message.
         *
         * #### Notes
         * This message should be dispatched to a widget when it should
         * perform the actions necessary to activate the widget, which
         * may include focusing its node or descendant node.
         */
        Msg.ActivateRequest = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.ConflatableMessage('activate-request');
        /**
         * A singleton conflatable `'close-request'` message.
         *
         * #### Notes
         * This message should be dispatched to a widget when it should close
         * and remove itself from the widget hierarchy.
         */
        Msg.CloseRequest = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.ConflatableMessage('close-request');
    })(Widget.Msg || (Widget.Msg = {}));
    /**
     * A message class for child related messages.
     */
    class ChildMessage extends _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message {
        /**
         * Construct a new child message.
         *
         * @param type - The message type.
         *
         * @param child - The child widget for the message.
         */
        constructor(type, child) {
            super(type);
            this.child = child;
        }
    }
    Widget.ChildMessage = ChildMessage;
    /**
     * A message class for `'resize'` messages.
     */
    class ResizeMessage extends _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.Message {
        /**
         * Construct a new resize message.
         *
         * @param width - The **offset width** of the widget, or `-1` if
         *   the width is not known.
         *
         * @param height - The **offset height** of the widget, or `-1` if
         *   the height is not known.
         */
        constructor(width, height) {
            super('resize');
            this.width = width;
            this.height = height;
        }
    }
    Widget.ResizeMessage = ResizeMessage;
    /**
     * The namespace for the `ResizeMessage` class statics.
     */
    (function (ResizeMessage) {
        /**
         * A singleton `'resize'` message with an unknown size.
         */
        ResizeMessage.UnknownSize = new ResizeMessage(-1, -1);
    })(ResizeMessage = Widget.ResizeMessage || (Widget.ResizeMessage = {}));
    /**
     * Attach a widget to a host DOM node.
     *
     * @param widget - The widget of interest.
     *
     * @param host - The DOM node to use as the widget's host.
     *
     * @param ref - The child of `host` to use as the reference element.
     *   If this is provided, the widget will be inserted before this
     *   node in the host. The default is `null`, which will cause the
     *   widget to be added as the last child of the host.
     *
     * #### Notes
     * This will throw an error if the widget is not a root widget, if
     * the widget is already attached, or if the host is not attached
     * to the DOM.
     */
    function attach(widget, host, ref = null) {
        if (widget.parent) {
            throw new Error('Cannot attach a child widget.');
        }
        if (widget.isAttached || widget.node.isConnected) {
            throw new Error('Widget is already attached.');
        }
        if (!host.isConnected) {
            throw new Error('Host is not attached.');
        }
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        host.insertBefore(widget.node, ref);
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
    }
    Widget.attach = attach;
    /**
     * Detach the widget from its host DOM node.
     *
     * @param widget - The widget of interest.
     *
     * #### Notes
     * This will throw an error if the widget is not a root widget,
     * or if the widget is not attached to the DOM.
     */
    function detach(widget) {
        if (widget.parent) {
            throw new Error('Cannot detach a child widget.');
        }
        if (!widget.isAttached || !widget.node.isConnected) {
            throw new Error('Widget is not attached.');
        }
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        widget.node.parentNode.removeChild(widget.node);
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
    }
    Widget.detach = detach;
})(Widget || (Widget = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$j;
(function (Private) {
    /**
     * An attached property for the widget title object.
     */
    Private.titleProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'title',
        create: owner => new Title({ owner })
    });
    /**
     * Create a DOM node for the given widget options.
     */
    function createNode(options) {
        return options.node || document.createElement(options.tag || 'div');
    }
    Private.createNode = createNode;
})(Private$j || (Private$j = {}));

/**
 * An abstract base class for creating lumino layouts.
 *
 * #### Notes
 * A layout is used to add widgets to a parent and to arrange those
 * widgets within the parent's DOM node.
 *
 * This class implements the base functionality which is required of
 * nearly all layouts. It must be subclassed in order to be useful.
 *
 * Notably, this class does not define a uniform interface for adding
 * widgets to the layout. A subclass should define that API in a way
 * which is meaningful for its intended use.
 */
class Layout {
    /**
     * Construct a new layout.
     *
     * @param options - The options for initializing the layout.
     */
    constructor(options = {}) {
        this._disposed = false;
        this._parent = null;
        this._fitPolicy = options.fitPolicy || 'set-min-size';
    }
    /**
     * Dispose of the resources held by the layout.
     *
     * #### Notes
     * This should be reimplemented to clear and dispose of the widgets.
     *
     * All reimplementations should call the superclass method.
     *
     * This method is called automatically when the parent is disposed.
     */
    dispose() {
        this._parent = null;
        this._disposed = true;
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal.clearData(this);
        _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty.clearData(this);
    }
    /**
     * Test whether the layout is disposed.
     */
    get isDisposed() {
        return this._disposed;
    }
    /**
     * Get the parent widget of the layout.
     */
    get parent() {
        return this._parent;
    }
    /**
     * Set the parent widget of the layout.
     *
     * #### Notes
     * This is set automatically when installing the layout on the parent
     * widget. The parent widget should not be set directly by user code.
     */
    set parent(value) {
        if (this._parent === value) {
            return;
        }
        if (this._parent) {
            throw new Error('Cannot change parent widget.');
        }
        if (value.layout !== this) {
            throw new Error('Invalid parent widget.');
        }
        this._parent = value;
        this.init();
    }
    /**
     * Get the fit policy for the layout.
     *
     * #### Notes
     * The fit policy controls the computed size constraints which are
     * applied to the parent widget by the layout.
     *
     * Some layout implementations may ignore the fit policy.
     */
    get fitPolicy() {
        return this._fitPolicy;
    }
    /**
     * Set the fit policy for the layout.
     *
     * #### Notes
     * The fit policy controls the computed size constraints which are
     * applied to the parent widget by the layout.
     *
     * Some layout implementations may ignore the fit policy.
     *
     * Changing the fit policy will clear the current size constraint
     * for the parent widget and then re-fit the parent.
     */
    set fitPolicy(value) {
        // Bail if the policy does not change
        if (this._fitPolicy === value) {
            return;
        }
        // Update the internal policy.
        this._fitPolicy = value;
        // Clear the size constraints and schedule a fit of the parent.
        if (this._parent) {
            let style = this._parent.node.style;
            style.minWidth = '';
            style.minHeight = '';
            style.maxWidth = '';
            style.maxHeight = '';
            this._parent.fit();
        }
    }
    /**
     * Process a message sent to the parent widget.
     *
     * @param msg - The message sent to the parent widget.
     *
     * #### Notes
     * This method is called by the parent widget to process a message.
     *
     * Subclasses may reimplement this method as needed.
     */
    processParentMessage(msg) {
        switch (msg.type) {
            case 'resize':
                this.onResize(msg);
                break;
            case 'update-request':
                this.onUpdateRequest(msg);
                break;
            case 'fit-request':
                this.onFitRequest(msg);
                break;
            case 'before-show':
                this.onBeforeShow(msg);
                break;
            case 'after-show':
                this.onAfterShow(msg);
                break;
            case 'before-hide':
                this.onBeforeHide(msg);
                break;
            case 'after-hide':
                this.onAfterHide(msg);
                break;
            case 'before-attach':
                this.onBeforeAttach(msg);
                break;
            case 'after-attach':
                this.onAfterAttach(msg);
                break;
            case 'before-detach':
                this.onBeforeDetach(msg);
                break;
            case 'after-detach':
                this.onAfterDetach(msg);
                break;
            case 'child-removed':
                this.onChildRemoved(msg);
                break;
            case 'child-shown':
                this.onChildShown(msg);
                break;
            case 'child-hidden':
                this.onChildHidden(msg);
                break;
        }
    }
    /**
     * Perform layout initialization which requires the parent widget.
     *
     * #### Notes
     * This method is invoked immediately after the layout is installed
     * on the parent widget.
     *
     * The default implementation reparents all of the widgets to the
     * layout parent widget.
     *
     * Subclasses should reimplement this method and attach the child
     * widget nodes to the parent widget's node.
     */
    init() {
        for (const widget of this) {
            widget.parent = this.parent;
        }
    }
    /**
     * A message handler invoked on a `'resize'` message.
     *
     * #### Notes
     * The layout should ensure that its widgets are resized according
     * to the specified layout space, and that they are sent a `'resize'`
     * message if appropriate.
     *
     * The default implementation of this method sends an `UnknownSize`
     * resize message to all widgets.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onResize(msg) {
        for (const widget of this) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.ResizeMessage.UnknownSize);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     *
     * #### Notes
     * The layout should ensure that its widgets are resized according
     * to the available layout space, and that they are sent a `'resize'`
     * message if appropriate.
     *
     * The default implementation of this method sends an `UnknownSize`
     * resize message to all widgets.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onUpdateRequest(msg) {
        for (const widget of this) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.ResizeMessage.UnknownSize);
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onBeforeAttach(msg) {
        for (const widget of this) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
        }
    }
    /**
     * A message handler invoked on an `'after-attach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onAfterAttach(msg) {
        for (const widget of this) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
        }
    }
    /**
     * A message handler invoked on a `'before-detach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onBeforeDetach(msg) {
        for (const widget of this) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
        }
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message
     * to all widgets. It assumes all widget nodes are attached to the
     * parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onAfterDetach(msg) {
        for (const widget of this) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
        }
    }
    /**
     * A message handler invoked on a `'before-show'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message to
     * all non-hidden widgets. It assumes all widget nodes are attached
     * to the parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onBeforeShow(msg) {
        for (const widget of this) {
            if (!widget.isHidden) {
                _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
            }
        }
    }
    /**
     * A message handler invoked on an `'after-show'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message to
     * all non-hidden widgets. It assumes all widget nodes are attached
     * to the parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onAfterShow(msg) {
        for (const widget of this) {
            if (!widget.isHidden) {
                _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
            }
        }
    }
    /**
     * A message handler invoked on a `'before-hide'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message to
     * all non-hidden widgets. It assumes all widget nodes are attached
     * to the parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onBeforeHide(msg) {
        for (const widget of this) {
            if (!widget.isHidden) {
                _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
            }
        }
    }
    /**
     * A message handler invoked on an `'after-hide'` message.
     *
     * #### Notes
     * The default implementation of this method forwards the message to
     * all non-hidden widgets. It assumes all widget nodes are attached
     * to the parent widget node.
     *
     * This may be reimplemented by subclasses as needed.
     */
    onAfterHide(msg) {
        for (const widget of this) {
            if (!widget.isHidden) {
                _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, msg);
            }
        }
    }
    /**
     * A message handler invoked on a `'child-removed'` message.
     *
     * #### Notes
     * This will remove the child widget from the layout.
     *
     * Subclasses should **not** typically reimplement this method.
     */
    onChildRemoved(msg) {
        this.removeWidget(msg.child);
    }
    /**
     * A message handler invoked on a `'fit-request'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onFitRequest(msg) { }
    /**
     * A message handler invoked on a `'child-shown'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onChildShown(msg) { }
    /**
     * A message handler invoked on a `'child-hidden'` message.
     *
     * #### Notes
     * The default implementation of this handler is a no-op.
     */
    onChildHidden(msg) { }
}
/**
 * The namespace for the `Layout` class statics.
 */
(function (Layout) {
    /**
     * Get the horizontal alignment for a widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The horizontal alignment for the widget.
     *
     * #### Notes
     * If the layout width allocated to a widget is larger than its max
     * width, the horizontal alignment controls how the widget is placed
     * within the extra horizontal space.
     *
     * If the allocated width is less than the widget's max width, the
     * horizontal alignment has no effect.
     *
     * Some layout implementations may ignore horizontal alignment.
     */
    function getHorizontalAlignment(widget) {
        return Private$i.horizontalAlignmentProperty.get(widget);
    }
    Layout.getHorizontalAlignment = getHorizontalAlignment;
    /**
     * Set the horizontal alignment for a widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the horizontal alignment.
     *
     * #### Notes
     * If the layout width allocated to a widget is larger than its max
     * width, the horizontal alignment controls how the widget is placed
     * within the extra horizontal space.
     *
     * If the allocated width is less than the widget's max width, the
     * horizontal alignment has no effect.
     *
     * Some layout implementations may ignore horizontal alignment.
     *
     * Changing the horizontal alignment will post an `update-request`
     * message to widget's parent, provided the parent has a layout
     * installed.
     */
    function setHorizontalAlignment(widget, value) {
        Private$i.horizontalAlignmentProperty.set(widget, value);
    }
    Layout.setHorizontalAlignment = setHorizontalAlignment;
    /**
     * Get the vertical alignment for a widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The vertical alignment for the widget.
     *
     * #### Notes
     * If the layout height allocated to a widget is larger than its max
     * height, the vertical alignment controls how the widget is placed
     * within the extra vertical space.
     *
     * If the allocated height is less than the widget's max height, the
     * vertical alignment has no effect.
     *
     * Some layout implementations may ignore vertical alignment.
     */
    function getVerticalAlignment(widget) {
        return Private$i.verticalAlignmentProperty.get(widget);
    }
    Layout.getVerticalAlignment = getVerticalAlignment;
    /**
     * Set the vertical alignment for a widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the vertical alignment.
     *
     * #### Notes
     * If the layout height allocated to a widget is larger than its max
     * height, the vertical alignment controls how the widget is placed
     * within the extra vertical space.
     *
     * If the allocated height is less than the widget's max height, the
     * vertical alignment has no effect.
     *
     * Some layout implementations may ignore vertical alignment.
     *
     * Changing the horizontal alignment will post an `update-request`
     * message to widget's parent, provided the parent has a layout
     * installed.
     */
    function setVerticalAlignment(widget, value) {
        Private$i.verticalAlignmentProperty.set(widget, value);
    }
    Layout.setVerticalAlignment = setVerticalAlignment;
})(Layout || (Layout = {}));
/**
 * An object which assists in the absolute layout of widgets.
 *
 * #### Notes
 * This class is useful when implementing a layout which arranges its
 * widgets using absolute positioning.
 *
 * This class is used by nearly all of the built-in lumino layouts.
 */
class LayoutItem {
    /**
     * Construct a new layout item.
     *
     * @param widget - The widget to be managed by the item.
     *
     * #### Notes
     * The widget will be set to absolute positioning.
     * The widget will use strict CSS containment.
     */
    constructor(widget) {
        this._top = NaN;
        this._left = NaN;
        this._width = NaN;
        this._height = NaN;
        this._minWidth = 0;
        this._minHeight = 0;
        this._maxWidth = Infinity;
        this._maxHeight = Infinity;
        this._disposed = false;
        this.widget = widget;
        this.widget.node.style.position = 'absolute';
        this.widget.node.style.contain = 'strict';
    }
    /**
     * Dispose of the the layout item.
     *
     * #### Notes
     * This will reset the positioning of the widget.
     */
    dispose() {
        // Do nothing if the item is already disposed.
        if (this._disposed) {
            return;
        }
        // Mark the item as disposed.
        this._disposed = true;
        // Reset the widget style.
        let style = this.widget.node.style;
        style.position = '';
        style.top = '';
        style.left = '';
        style.width = '';
        style.height = '';
        style.contain = '';
    }
    /**
     * The computed minimum width of the widget.
     *
     * #### Notes
     * This value can be updated by calling the `fit` method.
     */
    get minWidth() {
        return this._minWidth;
    }
    /**
     * The computed minimum height of the widget.
     *
     * #### Notes
     * This value can be updated by calling the `fit` method.
     */
    get minHeight() {
        return this._minHeight;
    }
    /**
     * The computed maximum width of the widget.
     *
     * #### Notes
     * This value can be updated by calling the `fit` method.
     */
    get maxWidth() {
        return this._maxWidth;
    }
    /**
     * The computed maximum height of the widget.
     *
     * #### Notes
     * This value can be updated by calling the `fit` method.
     */
    get maxHeight() {
        return this._maxHeight;
    }
    /**
     * Whether the layout item is disposed.
     */
    get isDisposed() {
        return this._disposed;
    }
    /**
     * Whether the managed widget is hidden.
     */
    get isHidden() {
        return this.widget.isHidden;
    }
    /**
     * Whether the managed widget is visible.
     */
    get isVisible() {
        return this.widget.isVisible;
    }
    /**
     * Whether the managed widget is attached.
     */
    get isAttached() {
        return this.widget.isAttached;
    }
    /**
     * Update the computed size limits of the managed widget.
     */
    fit() {
        let limits = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.sizeLimits(this.widget.node);
        this._minWidth = limits.minWidth;
        this._minHeight = limits.minHeight;
        this._maxWidth = limits.maxWidth;
        this._maxHeight = limits.maxHeight;
    }
    /**
     * Update the position and size of the managed widget.
     *
     * @param left - The left edge position of the layout box.
     *
     * @param top - The top edge position of the layout box.
     *
     * @param width - The width of the layout box.
     *
     * @param height - The height of the layout box.
     */
    update(left, top, width, height) {
        // Clamp the size to the computed size limits.
        let clampW = Math.max(this._minWidth, Math.min(width, this._maxWidth));
        let clampH = Math.max(this._minHeight, Math.min(height, this._maxHeight));
        // Adjust the left edge for the horizontal alignment, if needed.
        if (clampW < width) {
            switch (Layout.getHorizontalAlignment(this.widget)) {
                case 'left':
                    break;
                case 'center':
                    left += (width - clampW) / 2;
                    break;
                case 'right':
                    left += width - clampW;
                    break;
                default:
                    throw 'unreachable';
            }
        }
        // Adjust the top edge for the vertical alignment, if needed.
        if (clampH < height) {
            switch (Layout.getVerticalAlignment(this.widget)) {
                case 'top':
                    break;
                case 'center':
                    top += (height - clampH) / 2;
                    break;
                case 'bottom':
                    top += height - clampH;
                    break;
                default:
                    throw 'unreachable';
            }
        }
        // Set up the resize variables.
        let resized = false;
        let style = this.widget.node.style;
        // Update the top edge of the widget if needed.
        if (this._top !== top) {
            this._top = top;
            style.top = `${top}px`;
        }
        // Update the left edge of the widget if needed.
        if (this._left !== left) {
            this._left = left;
            style.left = `${left}px`;
        }
        // Update the width of the widget if needed.
        if (this._width !== clampW) {
            resized = true;
            this._width = clampW;
            style.width = `${clampW}px`;
        }
        // Update the height of the widget if needed.
        if (this._height !== clampH) {
            resized = true;
            this._height = clampH;
            style.height = `${clampH}px`;
        }
        // Send a resize message to the widget if needed.
        if (resized) {
            let msg = new Widget.ResizeMessage(clampW, clampH);
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.widget, msg);
        }
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private$i;
(function (Private) {
    /**
     * The attached property for a widget horizontal alignment.
     */
    Private.horizontalAlignmentProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'horizontalAlignment',
        create: () => 'center',
        changed: onAlignmentChanged
    });
    /**
     * The attached property for a widget vertical alignment.
     */
    Private.verticalAlignmentProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'verticalAlignment',
        create: () => 'top',
        changed: onAlignmentChanged
    });
    /**
     * The change handler for the attached alignment properties.
     */
    function onAlignmentChanged(child) {
        if (child.parent && child.parent.layout) {
            child.parent.update();
        }
    }
})(Private$i || (Private$i = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A concrete layout implementation suitable for many use cases.
 *
 * #### Notes
 * This class is suitable as a base class for implementing a variety of
 * layouts, but can also be used directly with standard CSS to layout a
 * collection of widgets.
 */
class PanelLayout extends Layout {
    constructor() {
        super(...arguments);
        this._widgets = [];
    }
    /**
     * Dispose of the resources held by the layout.
     *
     * #### Notes
     * This will clear and dispose all widgets in the layout.
     *
     * All reimplementations should call the superclass method.
     *
     * This method is called automatically when the parent is disposed.
     */
    dispose() {
        while (this._widgets.length > 0) {
            this._widgets.pop().dispose();
        }
        super.dispose();
    }
    /**
     * A read-only array of the widgets in the layout.
     */
    get widgets() {
        return this._widgets;
    }
    /**
     * Create an iterator over the widgets in the layout.
     *
     * @returns A new iterator over the widgets in the layout.
     */
    *[Symbol.iterator]() {
        yield* this._widgets;
    }
    /**
     * Add a widget to the end of the layout.
     *
     * @param widget - The widget to add to the layout.
     *
     * #### Notes
     * If the widget is already contained in the layout, it will be moved.
     */
    addWidget(widget) {
        this.insertWidget(this._widgets.length, widget);
    }
    /**
     * Insert a widget into the layout at the specified index.
     *
     * @param index - The index at which to insert the widget.
     *
     * @param widget - The widget to insert into the layout.
     *
     * #### Notes
     * The index will be clamped to the bounds of the widgets.
     *
     * If the widget is already added to the layout, it will be moved.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     */
    insertWidget(index, widget) {
        // Remove the widget from its current parent. This is a no-op
        // if the widget's parent is already the layout parent widget.
        widget.parent = this.parent;
        // Look up the current index of the widget.
        let i = this._widgets.indexOf(widget);
        // Clamp the insert index to the array bounds.
        let j = Math.max(0, Math.min(index, this._widgets.length));
        // If the widget is not in the array, insert it.
        if (i === -1) {
            // Insert the widget into the array.
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._widgets, j, widget);
            // If the layout is parented, attach the widget to the DOM.
            if (this.parent) {
                this.attachWidget(j, widget);
            }
            // There is nothing more to do.
            return;
        }
        // Otherwise, the widget exists in the array and should be moved.
        // Adjust the index if the location is at the end of the array.
        if (j === this._widgets.length) {
            j--;
        }
        // Bail if there is no effective move.
        if (i === j) {
            return;
        }
        // Move the widget to the new location.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._widgets, i, j);
        // If the layout is parented, move the widget in the DOM.
        if (this.parent) {
            this.moveWidget(i, j, widget);
        }
    }
    /**
     * Remove a widget from the layout.
     *
     * @param widget - The widget to remove from the layout.
     *
     * #### Notes
     * A widget is automatically removed from the layout when its `parent`
     * is set to `null`. This method should only be invoked directly when
     * removing a widget from a layout which has yet to be installed on a
     * parent widget.
     *
     * This method does *not* modify the widget's `parent`.
     */
    removeWidget(widget) {
        this.removeWidgetAt(this._widgets.indexOf(widget));
    }
    /**
     * Remove the widget at a given index from the layout.
     *
     * @param index - The index of the widget to remove.
     *
     * #### Notes
     * A widget is automatically removed from the layout when its `parent`
     * is set to `null`. This method should only be invoked directly when
     * removing a widget from a layout which has yet to be installed on a
     * parent widget.
     *
     * This method does *not* modify the widget's `parent`.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     */
    removeWidgetAt(index) {
        // Remove the widget from the array.
        let widget = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._widgets, index);
        // If the layout is parented, detach the widget from the DOM.
        if (widget && this.parent) {
            this.detachWidget(index, widget);
        }
    }
    /**
     * Perform layout initialization which requires the parent widget.
     */
    init() {
        super.init();
        let index = 0;
        for (const widget of this) {
            this.attachWidget(index++, widget);
        }
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation adds the widgets's node to the parent's
     * node at the proper location, and sends the appropriate attach
     * messages to the widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is added to the parent's node.
     */
    attachWidget(index, widget) {
        // Look up the next sibling reference node.
        let ref = this.parent.node.children[index];
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Insert the widget's node before the sibling.
        this.parent.node.insertBefore(widget.node, ref);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
    }
    /**
     * Move a widget in the parent's DOM node.
     *
     * @param fromIndex - The previous index of the widget in the layout.
     *
     * @param toIndex - The current index of the widget in the layout.
     *
     * @param widget - The widget to move in the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation moves the widget's node to the proper
     * location in the parent's node and sends the appropriate attach and
     * detach messages to the widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is moved in the parent's node.
     */
    moveWidget(fromIndex, toIndex, widget) {
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.node.removeChild(widget.node);
        // Send an `'after-detach'` and  message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
        // Look up the next sibling reference node.
        let ref = this.parent.node.children[toIndex];
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Insert the widget's node before the sibling.
        this.parent.node.insertBefore(widget.node, ref);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This method is called automatically by the panel layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation removes the widget's node from the
     * parent's node, and sends the appropriate detach messages to the
     * widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is removed from the parent's node.
     */
    detachWidget(index, widget) {
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.node.removeChild(widget.node);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
    }
}

/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
var Utils;
(function (Utils) {
    /**
     * Clamp a dimension value to an integer >= 0.
     */
    function clampDimension(value) {
        return Math.max(0, Math.floor(value));
    }
    Utils.clampDimension = clampDimension;
})(Utils || (Utils = {}));
var Utils$1 = Utils;

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A layout which arranges its widgets into resizable sections.
 */
class SplitLayout extends PanelLayout {
    /**
     * Construct a new split layout.
     *
     * @param options - The options for initializing the layout.
     */
    constructor(options) {
        super();
        this.widgetOffset = 0;
        this._fixed = 0;
        this._spacing = 4;
        this._dirty = false;
        this._hasNormedSizes = false;
        this._sizers = [];
        this._items = [];
        this._handles = [];
        this._box = null;
        this._alignment = 'start';
        this._orientation = 'horizontal';
        this.renderer = options.renderer;
        if (options.orientation !== undefined) {
            this._orientation = options.orientation;
        }
        if (options.alignment !== undefined) {
            this._alignment = options.alignment;
        }
        if (options.spacing !== undefined) {
            this._spacing = Utils.clampDimension(options.spacing);
        }
    }
    /**
     * Dispose of the resources held by the layout.
     */
    dispose() {
        // Dispose of the layout items.
        for (const item of this._items) {
            item.dispose();
        }
        // Clear the layout state.
        this._box = null;
        this._items.length = 0;
        this._sizers.length = 0;
        this._handles.length = 0;
        // Dispose of the rest of the layout.
        super.dispose();
    }
    /**
     * Get the layout orientation for the split layout.
     */
    get orientation() {
        return this._orientation;
    }
    /**
     * Set the layout orientation for the split layout.
     */
    set orientation(value) {
        if (this._orientation === value) {
            return;
        }
        this._orientation = value;
        if (!this.parent) {
            return;
        }
        this.parent.dataset['orientation'] = value;
        this.parent.fit();
    }
    /**
     * Get the content alignment for the split layout.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand  to fill the
     * entire split layout.
     */
    get alignment() {
        return this._alignment;
    }
    /**
     * Set the content alignment for the split layout.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand  to fill the
     * entire split layout.
     */
    set alignment(value) {
        if (this._alignment === value) {
            return;
        }
        this._alignment = value;
        if (!this.parent) {
            return;
        }
        this.parent.dataset['alignment'] = value;
        this.parent.update();
    }
    /**
     * Get the inter-element spacing for the split layout.
     */
    get spacing() {
        return this._spacing;
    }
    /**
     * Set the inter-element spacing for the split layout.
     */
    set spacing(value) {
        value = Utils.clampDimension(value);
        if (this._spacing === value) {
            return;
        }
        this._spacing = value;
        if (!this.parent) {
            return;
        }
        this.parent.fit();
    }
    /**
     * A read-only array of the split handles in the layout.
     */
    get handles() {
        return this._handles;
    }
    /**
     * Get the absolute sizes of the widgets in the layout.
     *
     * @returns A new array of the absolute sizes of the widgets.
     *
     * This method **does not** measure the DOM nodes.
     */
    absoluteSizes() {
        return this._sizers.map(sizer => sizer.size);
    }
    /**
     * Get the relative sizes of the widgets in the layout.
     *
     * @returns A new array of the relative sizes of the widgets.
     *
     * #### Notes
     * The returned sizes reflect the sizes of the widgets normalized
     * relative to their siblings.
     *
     * This method **does not** measure the DOM nodes.
     */
    relativeSizes() {
        return Private$h.normalize(this._sizers.map(sizer => sizer.size));
    }
    /**
     * Set the relative sizes for the widgets in the layout.
     *
     * @param sizes - The relative sizes for the widgets in the panel.
     * @param update - Update the layout after setting relative sizes.
     * Default is True.
     *
     * #### Notes
     * Extra values are ignored, too few will yield an undefined layout.
     *
     * The actual geometry of the DOM nodes is updated asynchronously.
     */
    setRelativeSizes(sizes, update = true) {
        // Copy the sizes and pad with zeros as needed.
        let n = this._sizers.length;
        let temp = sizes.slice(0, n);
        while (temp.length < n) {
            temp.push(0);
        }
        // Normalize the padded sizes.
        let normed = Private$h.normalize(temp);
        // Apply the normalized sizes to the sizers.
        for (let i = 0; i < n; ++i) {
            let sizer = this._sizers[i];
            sizer.sizeHint = normed[i];
            sizer.size = normed[i];
        }
        // Set the flag indicating the sizes are normalized.
        this._hasNormedSizes = true;
        // Trigger an update of the parent widget.
        if (update && this.parent) {
            this.parent.update();
        }
    }
    /**
     * Move the offset position of a split handle.
     *
     * @param index - The index of the handle of the interest.
     *
     * @param position - The desired offset position of the handle.
     *
     * #### Notes
     * The position is relative to the offset parent.
     *
     * This will move the handle as close as possible to the desired
     * position. The sibling widgets will be adjusted as necessary.
     */
    moveHandle(index, position) {
        // Bail if the index is invalid or the handle is hidden.
        let handle = this._handles[index];
        if (!handle || handle.classList.contains('lm-mod-hidden')) {
            return;
        }
        // Compute the desired delta movement for the handle.
        let delta;
        if (this._orientation === 'horizontal') {
            delta = position - handle.offsetLeft;
        }
        else {
            delta = position - handle.offsetTop;
        }
        // Bail if there is no handle movement.
        if (delta === 0) {
            return;
        }
        // Prevent widget resizing unless needed.
        for (let sizer of this._sizers) {
            if (sizer.size > 0) {
                sizer.sizeHint = sizer.size;
            }
        }
        // Adjust the sizers to reflect the handle movement.
        BoxEngine.adjust(this._sizers, index, delta);
        // Update the layout of the widgets.
        if (this.parent) {
            this.parent.update();
        }
    }
    /**
     * Perform layout initialization which requires the parent widget.
     */
    init() {
        this.parent.dataset['orientation'] = this.orientation;
        this.parent.dataset['alignment'] = this.alignment;
        super.init();
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    attachWidget(index, widget) {
        // Create the item, handle, and sizer for the new widget.
        let item = new LayoutItem(widget);
        let handle = Private$h.createHandle(this.renderer);
        let average = Private$h.averageSize(this._sizers);
        let sizer = Private$h.createSizer(average);
        // Insert the item, handle, and sizer into the internal arrays.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._items, index, item);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._sizers, index, sizer);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._handles, index, handle);
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Add the widget and handle nodes to the parent.
        this.parent.node.appendChild(widget.node);
        this.parent.node.appendChild(handle);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Move a widget in the parent's DOM node.
     *
     * @param fromIndex - The previous index of the widget in the layout.
     *
     * @param toIndex - The current index of the widget in the layout.
     *
     * @param widget - The widget to move in the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    moveWidget(fromIndex, toIndex, widget) {
        // Move the item, sizer, and handle for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._items, fromIndex, toIndex);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._sizers, fromIndex, toIndex);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._handles, fromIndex, toIndex);
        // Post a fit request to the parent to show/hide last handle.
        this.parent.fit();
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    detachWidget(index, widget) {
        // Remove the item, handle, and sizer for the widget.
        let item = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._items, index);
        let handle = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._handles, index);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._sizers, index);
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget and handle nodes from the parent.
        this.parent.node.removeChild(widget.node);
        this.parent.node.removeChild(handle);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
        // Dispose of the layout item.
        item.dispose();
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'before-show'` message.
     */
    onBeforeShow(msg) {
        super.onBeforeShow(msg);
        this.parent.update();
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        super.onBeforeAttach(msg);
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-shown'` message.
     */
    onChildShown(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-hidden'` message.
     */
    onChildHidden(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'resize'` message.
     */
    onResize(msg) {
        if (this.parent.isVisible) {
            this._update(msg.width, msg.height);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        if (this.parent.isVisible) {
            this._update(-1, -1);
        }
    }
    /**
     * A message handler invoked on a `'fit-request'` message.
     */
    onFitRequest(msg) {
        if (this.parent.isAttached) {
            this._fit();
        }
    }
    /**
     * Update the item position.
     *
     * @param i Item index
     * @param isHorizontal Whether the layout is horizontal or not
     * @param left Left position in pixels
     * @param top Top position in pixels
     * @param height Item height
     * @param width Item width
     * @param size Item size
     */
    updateItemPosition(i, isHorizontal, left, top, height, width, size) {
        const item = this._items[i];
        if (item.isHidden) {
            return;
        }
        // Fetch the style for the handle.
        let handleStyle = this._handles[i].style;
        // Update the widget and handle, and advance the relevant edge.
        if (isHorizontal) {
            left += this.widgetOffset;
            item.update(left, top, size, height);
            left += size;
            handleStyle.top = `${top}px`;
            handleStyle.left = `${left}px`;
            handleStyle.width = `${this._spacing}px`;
            handleStyle.height = `${height}px`;
        }
        else {
            top += this.widgetOffset;
            item.update(left, top, width, size);
            top += size;
            handleStyle.top = `${top}px`;
            handleStyle.left = `${left}px`;
            handleStyle.width = `${width}px`;
            handleStyle.height = `${this._spacing}px`;
        }
    }
    /**
     * Fit the layout to the total size required by the widgets.
     */
    _fit() {
        // Update the handles and track the visible widget count.
        let nVisible = 0;
        let lastHandleIndex = -1;
        for (let i = 0, n = this._items.length; i < n; ++i) {
            if (this._items[i].isHidden) {
                this._handles[i].classList.add('lm-mod-hidden');
            }
            else {
                this._handles[i].classList.remove('lm-mod-hidden');
                lastHandleIndex = i;
                nVisible++;
            }
        }
        // Hide the handle for the last visible widget.
        if (lastHandleIndex !== -1) {
            this._handles[lastHandleIndex].classList.add('lm-mod-hidden');
        }
        // Update the fixed space for the visible items.
        this._fixed =
            this._spacing * Math.max(0, nVisible - 1) +
                this.widgetOffset * this._items.length;
        // Setup the computed minimum size.
        let horz = this._orientation === 'horizontal';
        let minW = horz ? this._fixed : 0;
        let minH = horz ? 0 : this._fixed;
        // Update the sizers and computed size limits.
        for (let i = 0, n = this._items.length; i < n; ++i) {
            // Fetch the item and corresponding box sizer.
            let item = this._items[i];
            let sizer = this._sizers[i];
            // Prevent resizing unless necessary.
            if (sizer.size > 0) {
                sizer.sizeHint = sizer.size;
            }
            // If the item is hidden, it should consume zero size.
            if (item.isHidden) {
                sizer.minSize = 0;
                sizer.maxSize = 0;
                continue;
            }
            // Update the size limits for the item.
            item.fit();
            // Update the stretch factor.
            sizer.stretch = SplitLayout.getStretch(item.widget);
            // Update the sizer limits and computed min size.
            if (horz) {
                sizer.minSize = item.minWidth;
                sizer.maxSize = item.maxWidth;
                minW += item.minWidth;
                minH = Math.max(minH, item.minHeight);
            }
            else {
                sizer.minSize = item.minHeight;
                sizer.maxSize = item.maxHeight;
                minH += item.minHeight;
                minW = Math.max(minW, item.minWidth);
            }
        }
        // Update the box sizing and add it to the computed min size.
        let box = (this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node));
        minW += box.horizontalSum;
        minH += box.verticalSum;
        // Update the parent's min size constraints.
        let style = this.parent.node.style;
        style.minWidth = `${minW}px`;
        style.minHeight = `${minH}px`;
        // Set the dirty flag to ensure only a single update occurs.
        this._dirty = true;
        // Notify the ancestor that it should fit immediately. This may
        // cause a resize of the parent, fulfilling the required update.
        if (this.parent.parent) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);
        }
        // If the dirty flag is still set, the parent was not resized.
        // Trigger the required update on the parent widget immediately.
        if (this._dirty) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);
        }
    }
    /**
     * Update the layout position and size of the widgets.
     *
     * The parent offset dimensions should be `-1` if unknown.
     */
    _update(offsetWidth, offsetHeight) {
        // Clear the dirty flag to indicate the update occurred.
        this._dirty = false;
        // Compute the visible item count.
        let nVisible = 0;
        for (let i = 0, n = this._items.length; i < n; ++i) {
            nVisible += +!this._items[i].isHidden;
        }
        // Bail early if there are no visible items to layout.
        if (nVisible === 0 && this.widgetOffset === 0) {
            return;
        }
        // Measure the parent if the offset dimensions are unknown.
        if (offsetWidth < 0) {
            offsetWidth = this.parent.node.offsetWidth;
        }
        if (offsetHeight < 0) {
            offsetHeight = this.parent.node.offsetHeight;
        }
        // Ensure the parent box sizing data is computed.
        if (!this._box) {
            this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node);
        }
        // Compute the actual layout bounds adjusted for border and padding.
        let top = this._box.paddingTop;
        let left = this._box.paddingLeft;
        let width = offsetWidth - this._box.horizontalSum;
        let height = offsetHeight - this._box.verticalSum;
        // Set up the variables for justification and alignment offset.
        let extra = 0;
        let offset = 0;
        let horz = this._orientation === 'horizontal';
        if (nVisible > 0) {
            // Compute the adjusted layout space.
            let space;
            if (horz) {
                // left += this.widgetOffset;
                space = Math.max(0, width - this._fixed);
            }
            else {
                // top += this.widgetOffset;
                space = Math.max(0, height - this._fixed);
            }
            // Scale the size hints if they are normalized.
            if (this._hasNormedSizes) {
                for (let sizer of this._sizers) {
                    sizer.sizeHint *= space;
                }
                this._hasNormedSizes = false;
            }
            // Distribute the layout space to the box sizers.
            let delta = BoxEngine.calc(this._sizers, space);
            // Account for alignment if there is extra layout space.
            if (delta > 0) {
                switch (this._alignment) {
                    case 'start':
                        break;
                    case 'center':
                        extra = 0;
                        offset = delta / 2;
                        break;
                    case 'end':
                        extra = 0;
                        offset = delta;
                        break;
                    case 'justify':
                        extra = delta / nVisible;
                        offset = 0;
                        break;
                    default:
                        throw 'unreachable';
                }
            }
        }
        // Layout the items using the computed box sizes.
        for (let i = 0, n = this._items.length; i < n; ++i) {
            // Fetch the item.
            const item = this._items[i];
            // Fetch the computed size for the widget.
            const size = item.isHidden ? 0 : this._sizers[i].size + extra;
            this.updateItemPosition(i, horz, horz ? left + offset : left, horz ? top : top + offset, height, width, size);
            const fullOffset = this.widgetOffset +
                (this._handles[i].classList.contains('lm-mod-hidden')
                    ? 0
                    : this._spacing);
            if (horz) {
                left += size + fullOffset;
            }
            else {
                top += size + fullOffset;
            }
        }
    }
}
/**
 * The namespace for the `SplitLayout` class statics.
 */
(function (SplitLayout) {
    /**
     * Get the split layout stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The split layout stretch factor for the widget.
     */
    function getStretch(widget) {
        return Private$h.stretchProperty.get(widget);
    }
    SplitLayout.getStretch = getStretch;
    /**
     * Set the split layout stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the stretch factor.
     */
    function setStretch(widget, value) {
        Private$h.stretchProperty.set(widget, value);
    }
    SplitLayout.setStretch = setStretch;
})(SplitLayout || (SplitLayout = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$h;
(function (Private) {
    /**
     * The property descriptor for a widget stretch factor.
     */
    Private.stretchProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'stretch',
        create: () => 0,
        coerce: (owner, value) => Math.max(0, Math.floor(value)),
        changed: onChildSizingChanged
    });
    /**
     * Create a new box sizer with the given size hint.
     */
    function createSizer(size) {
        let sizer = new BoxSizer();
        sizer.sizeHint = Math.floor(size);
        return sizer;
    }
    Private.createSizer = createSizer;
    /**
     * Create a new split handle node using the given renderer.
     */
    function createHandle(renderer) {
        let handle = renderer.createHandle();
        handle.style.position = 'absolute';
        // Do not use size containment to allow the handle to fill the available space
        handle.style.contain = 'style';
        return handle;
    }
    Private.createHandle = createHandle;
    /**
     * Compute the average size of an array of box sizers.
     */
    function averageSize(sizers) {
        return sizers.reduce((v, s) => v + s.size, 0) / sizers.length || 0;
    }
    Private.averageSize = averageSize;
    /**
     * Normalize an array of values.
     */
    function normalize(values) {
        let n = values.length;
        if (n === 0) {
            return [];
        }
        let sum = values.reduce((a, b) => a + Math.abs(b), 0);
        return sum === 0 ? values.map(v => 1 / n) : values.map(v => v / sum);
    }
    Private.normalize = normalize;
    /**
     * The change handler for the attached sizing properties.
     */
    function onChildSizingChanged(child) {
        if (child.parent && child.parent.layout instanceof SplitLayout) {
            child.parent.fit();
        }
    }
})(Private$h || (Private$h = {}));

/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */
/**
 * A layout which arranges its widgets into collapsible resizable sections.
 */
class AccordionLayout extends SplitLayout {
    /**
     * Construct a new accordion layout.
     *
     * @param options - The options for initializing the layout.
     *
     * #### Notes
     * The default orientation will be vertical.
     *
     * Titles must be rotated for horizontal accordion panel using CSS: see accordionpanel.css
     */
    constructor(options) {
        super({ ...options, orientation: options.orientation || 'vertical' });
        this._titles = [];
        this.titleSpace = options.titleSpace || 22;
    }
    /**
     * The section title height or width depending on the orientation.
     */
    get titleSpace() {
        return this.widgetOffset;
    }
    set titleSpace(value) {
        value = Utils$1.clampDimension(value);
        if (this.widgetOffset === value) {
            return;
        }
        this.widgetOffset = value;
        if (!this.parent) {
            return;
        }
        this.parent.fit();
    }
    /**
     * A read-only array of the section titles in the panel.
     */
    get titles() {
        return this._titles;
    }
    /**
     * Dispose of the resources held by the layout.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        // Clear the layout state.
        this._titles.length = 0;
        // Dispose of the rest of the layout.
        super.dispose();
    }
    updateTitle(index, widget) {
        const oldTitle = this._titles[index];
        const expanded = oldTitle.classList.contains('lm-mod-expanded');
        const newTitle = Private$g.createTitle(this.renderer, widget.title, expanded);
        this._titles[index] = newTitle;
        // Add the title node to the parent before the widget.
        this.parent.node.replaceChild(newTitle, oldTitle);
    }
    /**
     * Insert a widget into the layout at the specified index.
     *
     * @param index - The index at which to insert the widget.
     *
     * @param widget - The widget to insert into the layout.
     *
     * #### Notes
     * The index will be clamped to the bounds of the widgets.
     *
     * If the widget is already added to the layout, it will be moved.
     *
     * #### Undefined Behavior
     * An `index` which is non-integral.
     */
    insertWidget(index, widget) {
        if (!widget.id) {
            widget.id = `id-${_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.UUID.uuid4()}`;
        }
        super.insertWidget(index, widget);
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     */
    attachWidget(index, widget) {
        const title = Private$g.createTitle(this.renderer, widget.title);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._titles, index, title);
        // Add the title node to the parent before the widget.
        this.parent.node.appendChild(title);
        widget.node.setAttribute('role', 'region');
        widget.node.setAttribute('aria-labelledby', title.id);
        super.attachWidget(index, widget);
    }
    /**
     * Move a widget in the parent's DOM node.
     *
     * @param fromIndex - The previous index of the widget in the layout.
     *
     * @param toIndex - The current index of the widget in the layout.
     *
     * @param widget - The widget to move in the parent.
     */
    moveWidget(fromIndex, toIndex, widget) {
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._titles, fromIndex, toIndex);
        super.moveWidget(fromIndex, toIndex, widget);
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    detachWidget(index, widget) {
        const title = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._titles, index);
        this.parent.node.removeChild(title);
        super.detachWidget(index, widget);
    }
    /**
     * Update the item position.
     *
     * @param i Item index
     * @param isHorizontal Whether the layout is horizontal or not
     * @param left Left position in pixels
     * @param top Top position in pixels
     * @param height Item height
     * @param width Item width
     * @param size Item size
     */
    updateItemPosition(i, isHorizontal, left, top, height, width, size) {
        const titleStyle = this._titles[i].style;
        // Titles must be rotated for horizontal accordion panel using CSS: see accordionpanel.css
        titleStyle.top = `${top}px`;
        titleStyle.left = `${left}px`;
        titleStyle.height = `${this.widgetOffset}px`;
        if (isHorizontal) {
            titleStyle.width = `${height}px`;
        }
        else {
            titleStyle.width = `${width}px`;
        }
        super.updateItemPosition(i, isHorizontal, left, top, height, width, size);
    }
}
var Private$g;
(function (Private) {
    /**
     * Create the title HTML element.
     *
     * @param renderer Accordion renderer
     * @param data Widget title
     * @returns Title HTML element
     */
    function createTitle(renderer, data, expanded = true) {
        const title = renderer.createSectionTitle(data);
        title.style.position = 'absolute';
        title.style.contain = 'strict';
        title.setAttribute('aria-label', `${data.label} Section`);
        title.setAttribute('aria-expanded', expanded ? 'true' : 'false');
        title.setAttribute('aria-controls', data.owner.id);
        if (expanded) {
            title.classList.add('lm-mod-expanded');
        }
        return title;
    }
    Private.createTitle = createTitle;
})(Private$g || (Private$g = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A simple and convenient panel widget class.
 *
 * #### Notes
 * This class is suitable as a base class for implementing a variety of
 * convenience panel widgets, but can also be used directly with CSS to
 * arrange a collection of widgets.
 *
 * This class provides a convenience wrapper around a {@link PanelLayout}.
 */
class Panel extends Widget {
    /**
     * Construct a new panel.
     *
     * @param options - The options for initializing the panel.
     */
    constructor(options = {}) {
        super();
        this.addClass('lm-Panel');
        this.layout = Private$f.createLayout(options);
    }
    /**
     * A read-only array of the widgets in the panel.
     */
    get widgets() {
        return this.layout.widgets;
    }
    /**
     * Add a widget to the end of the panel.
     *
     * @param widget - The widget to add to the panel.
     *
     * #### Notes
     * If the widget is already contained in the panel, it will be moved.
     */
    addWidget(widget) {
        this.layout.addWidget(widget);
    }
    /**
     * Insert a widget at the specified index.
     *
     * @param index - The index at which to insert the widget.
     *
     * @param widget - The widget to insert into to the panel.
     *
     * #### Notes
     * If the widget is already contained in the panel, it will be moved.
     */
    insertWidget(index, widget) {
        this.layout.insertWidget(index, widget);
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private$f;
(function (Private) {
    /**
     * Create a panel layout for the given panel options.
     */
    function createLayout(options) {
        return options.layout || new PanelLayout();
    }
    Private.createLayout = createLayout;
})(Private$f || (Private$f = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A panel which arranges its widgets into resizable sections.
 *
 * #### Notes
 * This class provides a convenience wrapper around a {@link SplitLayout}.
 */
class SplitPanel extends Panel {
    /**
     * Construct a new split panel.
     *
     * @param options - The options for initializing the split panel.
     */
    constructor(options = {}) {
        super({ layout: Private$e.createLayout(options) });
        this._handleMoved = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._pressData = null;
        this.addClass('lm-SplitPanel');
    }
    /**
     * Dispose of the resources held by the panel.
     */
    dispose() {
        this._releaseMouse();
        super.dispose();
    }
    /**
     * Get the layout orientation for the split panel.
     */
    get orientation() {
        return this.layout.orientation;
    }
    /**
     * Set the layout orientation for the split panel.
     */
    set orientation(value) {
        this.layout.orientation = value;
    }
    /**
     * Get the content alignment for the split panel.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand to fill the
     * entire split panel.
     */
    get alignment() {
        return this.layout.alignment;
    }
    /**
     * Set the content alignment for the split panel.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand to fill the
     * entire split panel.
     */
    set alignment(value) {
        this.layout.alignment = value;
    }
    /**
     * Get the inter-element spacing for the split panel.
     */
    get spacing() {
        return this.layout.spacing;
    }
    /**
     * Set the inter-element spacing for the split panel.
     */
    set spacing(value) {
        this.layout.spacing = value;
    }
    /**
     * The renderer used by the split panel.
     */
    get renderer() {
        return this.layout.renderer;
    }
    /**
     * A signal emitted when a split handle has moved.
     */
    get handleMoved() {
        return this._handleMoved;
    }
    /**
     * A read-only array of the split handles in the panel.
     */
    get handles() {
        return this.layout.handles;
    }
    /**
     * Get the relative sizes of the widgets in the panel.
     *
     * @returns A new array of the relative sizes of the widgets.
     *
     * #### Notes
     * The returned sizes reflect the sizes of the widgets normalized
     * relative to their siblings.
     *
     * This method **does not** measure the DOM nodes.
     */
    relativeSizes() {
        return this.layout.relativeSizes();
    }
    /**
     * Set the relative sizes for the widgets in the panel.
     *
     * @param sizes - The relative sizes for the widgets in the panel.
     * @param update - Update the layout after setting relative sizes.
     * Default is True.
     *
     * #### Notes
     * Extra values are ignored, too few will yield an undefined layout.
     *
     * The actual geometry of the DOM nodes is updated asynchronously.
     */
    setRelativeSizes(sizes, update = true) {
        this.layout.setRelativeSizes(sizes, update);
    }
    /**
     * Handle the DOM events for the split panel.
     *
     * @param event - The DOM event sent to the panel.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'pointerdown':
                this._evtPointerDown(event);
                break;
            case 'pointermove':
                this._evtPointerMove(event);
                break;
            case 'pointerup':
                this._evtPointerUp(event);
                break;
            case 'keydown':
                this._evtKeyDown(event);
                break;
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('pointerdown', this);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('pointerdown', this);
        this._releaseMouse();
    }
    /**
     * A message handler invoked on a `'child-added'` message.
     */
    onChildAdded(msg) {
        msg.child.addClass('lm-SplitPanel-child');
        this._releaseMouse();
    }
    /**
     * A message handler invoked on a `'child-removed'` message.
     */
    onChildRemoved(msg) {
        msg.child.removeClass('lm-SplitPanel-child');
        this._releaseMouse();
    }
    /**
     * Handle the `'keydown'` event for the split panel.
     */
    _evtKeyDown(event) {
        // Stop input events during drag.
        if (this._pressData) {
            event.preventDefault();
            event.stopPropagation();
        }
        // Release the mouse if `Escape` is pressed.
        if (event.keyCode === 27) {
            this._releaseMouse();
        }
    }
    /**
     * Handle the `'pointerdown'` event for the split panel.
     */
    _evtPointerDown(event) {
        // Do nothing if the primary button is not pressed.
        if (event.button !== 0) {
            return;
        }
        // Find the handle which contains the target, if any.
        let layout = this.layout;
        let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(layout.handles, handle => {
            return handle.contains(event.target);
        });
        // Bail early if the mouse press was not on a handle.
        if (index === -1) {
            return;
        }
        // Stop the event when a split handle is pressed.
        event.preventDefault();
        event.stopPropagation();
        // Add the extra document listeners.
        document.addEventListener('pointerup', this, true);
        document.addEventListener('pointermove', this, true);
        document.addEventListener('keydown', this, true);
        document.addEventListener('contextmenu', this, true);
        // Compute the offset delta for the handle press.
        let delta;
        let handle = layout.handles[index];
        let rect = handle.getBoundingClientRect();
        if (layout.orientation === 'horizontal') {
            delta = event.clientX - rect.left;
        }
        else {
            delta = event.clientY - rect.top;
        }
        // Override the cursor and store the press data.
        let style = window.getComputedStyle(handle);
        let override = _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6__.Drag.overrideCursor(style.cursor);
        this._pressData = { index, delta, override };
    }
    /**
     * Handle the `'pointermove'` event for the split panel.
     */
    _evtPointerMove(event) {
        // Stop the event when dragging a split handle.
        event.preventDefault();
        event.stopPropagation();
        // Compute the desired offset position for the handle.
        let pos;
        let layout = this.layout;
        let rect = this.node.getBoundingClientRect();
        if (layout.orientation === 'horizontal') {
            pos = event.clientX - rect.left - this._pressData.delta;
        }
        else {
            pos = event.clientY - rect.top - this._pressData.delta;
        }
        // Move the handle as close to the desired position as possible.
        layout.moveHandle(this._pressData.index, pos);
    }
    /**
     * Handle the `'pointerup'` event for the split panel.
     */
    _evtPointerUp(event) {
        // Do nothing if the primary button is not released.
        if (event.button !== 0) {
            return;
        }
        // Stop the event when releasing a handle.
        event.preventDefault();
        event.stopPropagation();
        // Finalize the mouse release.
        this._releaseMouse();
    }
    /**
     * Release the mouse grab for the split panel.
     */
    _releaseMouse() {
        // Bail early if no drag is in progress.
        if (!this._pressData) {
            return;
        }
        // Clear the override cursor.
        this._pressData.override.dispose();
        this._pressData = null;
        // Emit the handle moved signal.
        this._handleMoved.emit();
        // Remove the extra document listeners.
        document.removeEventListener('keydown', this, true);
        document.removeEventListener('pointerup', this, true);
        document.removeEventListener('pointermove', this, true);
        document.removeEventListener('contextmenu', this, true);
    }
}
/**
 * The namespace for the `SplitPanel` class statics.
 */
(function (SplitPanel) {
    /**
     * The default implementation of `IRenderer`.
     */
    class Renderer {
        /**
         * Create a new handle for use with a split panel.
         *
         * @returns A new handle element for a split panel.
         */
        createHandle() {
            let handle = document.createElement('div');
            handle.className = 'lm-SplitPanel-handle';
            return handle;
        }
    }
    SplitPanel.Renderer = Renderer;
    /**
     * The default `Renderer` instance.
     */
    SplitPanel.defaultRenderer = new Renderer();
    /**
     * Get the split panel stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The split panel stretch factor for the widget.
     */
    function getStretch(widget) {
        return SplitLayout.getStretch(widget);
    }
    SplitPanel.getStretch = getStretch;
    /**
     * Set the split panel stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the stretch factor.
     */
    function setStretch(widget, value) {
        SplitLayout.setStretch(widget, value);
    }
    SplitPanel.setStretch = setStretch;
})(SplitPanel || (SplitPanel = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$e;
(function (Private) {
    /**
     * Create a split layout for the given panel options.
     */
    function createLayout(options) {
        return (options.layout ||
            new SplitLayout({
                renderer: options.renderer || SplitPanel.defaultRenderer,
                orientation: options.orientation,
                alignment: options.alignment,
                spacing: options.spacing
            }));
    }
    Private.createLayout = createLayout;
})(Private$e || (Private$e = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
 * A panel which arranges its widgets into resizable sections separated by a title widget.
 *
 * #### Notes
 * This class provides a convenience wrapper around {@link AccordionLayout}.
 *
 * See also the related [example](../../examples/accordionpanel/index.html) and
 * its [source](https://github.com/jupyterlab/lumino/tree/main/examples/example-accordionpanel).
 */
class AccordionPanel extends SplitPanel {
    /**
     * Construct a new accordion panel.
     *
     * @param options - The options for initializing the accordion panel.
     *
     */
    constructor(options = {}) {
        super({ ...options, layout: Private$d.createLayout(options) });
        this._widgetSizesCache = new WeakMap();
        this._expansionToggled = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this.addClass('lm-AccordionPanel');
    }
    /**
     * The renderer used by the accordion panel.
     */
    get renderer() {
        return this.layout.renderer;
    }
    /**
     * The section title space.
     *
     * This is the height if the panel is vertical and the width if it is
     * horizontal.
     */
    get titleSpace() {
        return this.layout.titleSpace;
    }
    set titleSpace(value) {
        this.layout.titleSpace = value;
    }
    /**
     * A read-only array of the section titles in the panel.
     */
    get titles() {
        return this.layout.titles;
    }
    /**
     * A signal emitted when a widget of the AccordionPanel is collapsed or expanded.
     */
    get expansionToggled() {
        return this._expansionToggled;
    }
    /**
     * Add a widget to the end of the panel.
     *
     * @param widget - The widget to add to the panel.
     *
     * #### Notes
     * If the widget is already contained in the panel, it will be moved.
     */
    addWidget(widget) {
        super.addWidget(widget);
        widget.title.changed.connect(this._onTitleChanged, this);
    }
    /**
     * Collapse the widget at position `index`.
     *
     * #### Notes
     * If no widget is found for `index`, this will bail.
     *
     * @param index Widget index
     */
    collapse(index) {
        const widget = this.layout.widgets[index];
        if (widget && !widget.isHidden) {
            this._toggleExpansion(index);
        }
    }
    /**
     * Expand the widget at position `index`.
     *
     * #### Notes
     * If no widget is found for `index`, this will bail.
     *
     * @param index Widget index
     */
    expand(index) {
        const widget = this.layout.widgets[index];
        if (widget && widget.isHidden) {
            this._toggleExpansion(index);
        }
    }
    /**
     * Insert a widget at the specified index.
     *
     * @param index - The index at which to insert the widget.
     *
     * @param widget - The widget to insert into to the panel.
     *
     * #### Notes
     * If the widget is already contained in the panel, it will be moved.
     */
    insertWidget(index, widget) {
        super.insertWidget(index, widget);
        widget.title.changed.connect(this._onTitleChanged, this);
    }
    /**
     * Handle the DOM events for the accordion panel.
     *
     * @param event - The DOM event sent to the panel.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        super.handleEvent(event);
        switch (event.type) {
            case 'click':
                this._evtClick(event);
                break;
            case 'keydown':
                this._eventKeyDown(event);
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('click', this);
        this.node.addEventListener('keydown', this);
        super.onBeforeAttach(msg);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        super.onAfterDetach(msg);
        this.node.removeEventListener('click', this);
        this.node.removeEventListener('keydown', this);
    }
    /**
     * Handle the `changed` signal of a title object.
     */
    _onTitleChanged(sender) {
        const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.widgets, widget => {
            return widget.contains(sender.owner);
        });
        if (index >= 0) {
            this.layout.updateTitle(index, sender.owner);
            this.update();
        }
    }
    /**
     * Compute the size of widgets in this panel on the title click event.
     * On closing, the size of the widget is cached and we will try to expand
     * the last opened widget.
     * On opening, we will use the cached size if it is available to restore the
     * widget.
     * In both cases, if we can not compute the size of widgets, we will let
     * `SplitLayout` decide.
     *
     * @param index - The index of widget to be opened of closed
     *
     * @returns Relative size of widgets in this panel, if this size can
     * not be computed, return `undefined`
     */
    _computeWidgetSize(index) {
        const layout = this.layout;
        const widget = layout.widgets[index];
        if (!widget) {
            return undefined;
        }
        const isHidden = widget.isHidden;
        const widgetSizes = layout.absoluteSizes();
        const delta = (isHidden ? -1 : 1) * this.spacing;
        const totalSize = widgetSizes.reduce((prev, curr) => prev + curr);
        let newSize = [...widgetSizes];
        if (!isHidden) {
            // Hide the widget
            const currentSize = widgetSizes[index];
            this._widgetSizesCache.set(widget, currentSize);
            newSize[index] = 0;
            const widgetToCollapse = newSize.map(sz => sz > 0).lastIndexOf(true);
            if (widgetToCollapse === -1) {
                // All widget are closed, let the `SplitLayout` compute widget sizes.
                return undefined;
            }
            newSize[widgetToCollapse] =
                widgetSizes[widgetToCollapse] + currentSize + delta;
        }
        else {
            // Show the widget
            const previousSize = this._widgetSizesCache.get(widget);
            if (!previousSize) {
                // Previous size is unavailable, let the `SplitLayout` compute widget sizes.
                return undefined;
            }
            newSize[index] += previousSize;
            const widgetToCollapse = newSize
                .map(sz => sz - previousSize > 0)
                .lastIndexOf(true);
            if (widgetToCollapse === -1) {
                // Can not reduce the size of one widget, reduce all opened widgets
                // proportionally with its size.
                newSize.forEach((_, idx) => {
                    if (idx !== index) {
                        newSize[idx] -=
                            (widgetSizes[idx] / totalSize) * (previousSize - delta);
                    }
                });
            }
            else {
                newSize[widgetToCollapse] -= previousSize - delta;
            }
        }
        return newSize.map(sz => sz / (totalSize + delta));
    }
    /**
     * Handle the `'click'` event for the accordion panel
     */
    _evtClick(event) {
        const target = event.target;
        if (target) {
            const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.titles, title => {
                return title.contains(target);
            });
            if (index >= 0) {
                event.preventDefault();
                event.stopPropagation();
                this._toggleExpansion(index);
            }
        }
    }
    /**
     * Handle the `'keydown'` event for the accordion panel.
     */
    _eventKeyDown(event) {
        if (event.defaultPrevented) {
            return;
        }
        const target = event.target;
        let handled = false;
        if (target) {
            const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.titles, title => {
                return title.contains(target);
            });
            if (index >= 0) {
                const keyCode = event.keyCode.toString();
                // If Space or Enter is pressed on title, emulate click event
                if (event.key.match(/Space|Enter/) || keyCode.match(/13|32/)) {
                    target.click();
                    handled = true;
                }
                else if (this.orientation === 'horizontal'
                    ? event.key.match(/ArrowLeft|ArrowRight/) || keyCode.match(/37|39/)
                    : event.key.match(/ArrowUp|ArrowDown/) || keyCode.match(/38|40/)) {
                    // If Up or Down (for vertical) / Left or Right (for horizontal) is pressed on title, loop on titles
                    const direction = event.key.match(/ArrowLeft|ArrowUp/) || keyCode.match(/37|38/)
                        ? -1
                        : 1;
                    const length = this.titles.length;
                    const newIndex = (index + length + direction) % length;
                    this.titles[newIndex].focus();
                    handled = true;
                }
                else if (event.key === 'End' || keyCode === '35') {
                    // If End is pressed on title, focus on the last title
                    this.titles[this.titles.length - 1].focus();
                    handled = true;
                }
                else if (event.key === 'Home' || keyCode === '36') {
                    // If Home is pressed on title, focus on the first title
                    this.titles[0].focus();
                    handled = true;
                }
            }
            if (handled) {
                event.preventDefault();
            }
        }
    }
    _toggleExpansion(index) {
        const title = this.titles[index];
        const widget = this.layout.widgets[index];
        const newSize = this._computeWidgetSize(index);
        if (newSize) {
            this.setRelativeSizes(newSize, false);
        }
        if (widget.isHidden) {
            title.classList.add('lm-mod-expanded');
            title.setAttribute('aria-expanded', 'true');
            widget.show();
        }
        else {
            title.classList.remove('lm-mod-expanded');
            title.setAttribute('aria-expanded', 'false');
            widget.hide();
        }
        // Emit the expansion state signal.
        this._expansionToggled.emit(index);
    }
}
/**
 * The namespace for the `AccordionPanel` class statics.
 */
(function (AccordionPanel) {
    /**
     * The default implementation of `IRenderer`.
     */
    class Renderer extends SplitPanel.Renderer {
        constructor() {
            super();
            /**
             * A selector which matches any title node in the accordion.
             */
            this.titleClassName = 'lm-AccordionPanel-title';
            this._titleID = 0;
            this._titleKeys = new WeakMap();
            this._uuid = ++Renderer._nInstance;
        }
        /**
         * Render the collapse indicator for a section title.
         *
         * @param data - The data to use for rendering the section title.
         *
         * @returns A element representing the collapse indicator.
         */
        createCollapseIcon(data) {
            return document.createElement('span');
        }
        /**
         * Render the element for a section title.
         *
         * @param data - The data to use for rendering the section title.
         *
         * @returns A element representing the section title.
         */
        createSectionTitle(data) {
            const handle = document.createElement('h3');
            handle.setAttribute('tabindex', '0');
            handle.id = this.createTitleKey(data);
            handle.className = this.titleClassName;
            for (const aData in data.dataset) {
                handle.dataset[aData] = data.dataset[aData];
            }
            const collapser = handle.appendChild(this.createCollapseIcon(data));
            collapser.className = 'lm-AccordionPanel-titleCollapser';
            const label = handle.appendChild(document.createElement('span'));
            label.className = 'lm-AccordionPanel-titleLabel';
            label.textContent = data.label;
            label.title = data.caption || data.label;
            return handle;
        }
        /**
         * Create a unique render key for the title.
         *
         * @param data - The data to use for the title.
         *
         * @returns The unique render key for the title.
         *
         * #### Notes
         * This method caches the key against the section title the first time
         * the key is generated.
         */
        createTitleKey(data) {
            let key = this._titleKeys.get(data);
            if (key === undefined) {
                key = `title-key-${this._uuid}-${this._titleID++}`;
                this._titleKeys.set(data, key);
            }
            return key;
        }
    }
    Renderer._nInstance = 0;
    AccordionPanel.Renderer = Renderer;
    /**
     * The default `Renderer` instance.
     */
    AccordionPanel.defaultRenderer = new Renderer();
})(AccordionPanel || (AccordionPanel = {}));
var Private$d;
(function (Private) {
    /**
     * Create an accordion layout for the given panel options.
     *
     * @param options Panel options
     * @returns Panel layout
     */
    function createLayout(options) {
        return (options.layout ||
            new AccordionLayout({
                renderer: options.renderer || AccordionPanel.defaultRenderer,
                orientation: options.orientation,
                alignment: options.alignment,
                spacing: options.spacing,
                titleSpace: options.titleSpace
            }));
    }
    Private.createLayout = createLayout;
})(Private$d || (Private$d = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A layout which arranges its widgets in a single row or column.
 */
class BoxLayout extends PanelLayout {
    /**
     * Construct a new box layout.
     *
     * @param options - The options for initializing the layout.
     */
    constructor(options = {}) {
        super();
        this._fixed = 0;
        this._spacing = 4;
        this._dirty = false;
        this._sizers = [];
        this._items = [];
        this._box = null;
        this._alignment = 'start';
        this._direction = 'top-to-bottom';
        if (options.direction !== undefined) {
            this._direction = options.direction;
        }
        if (options.alignment !== undefined) {
            this._alignment = options.alignment;
        }
        if (options.spacing !== undefined) {
            this._spacing = Utils$1.clampDimension(options.spacing);
        }
    }
    /**
     * Dispose of the resources held by the layout.
     */
    dispose() {
        // Dispose of the layout items.
        for (const item of this._items) {
            item.dispose();
        }
        // Clear the layout state.
        this._box = null;
        this._items.length = 0;
        this._sizers.length = 0;
        // Dispose of the rest of the layout.
        super.dispose();
    }
    /**
     * Get the layout direction for the box layout.
     */
    get direction() {
        return this._direction;
    }
    /**
     * Set the layout direction for the box layout.
     */
    set direction(value) {
        if (this._direction === value) {
            return;
        }
        this._direction = value;
        if (!this.parent) {
            return;
        }
        this.parent.dataset['direction'] = value;
        this.parent.fit();
    }
    /**
     * Get the content alignment for the box layout.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand to fill the
     * entire box layout.
     */
    get alignment() {
        return this._alignment;
    }
    /**
     * Set the content alignment for the box layout.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand to fill the
     * entire box layout.
     */
    set alignment(value) {
        if (this._alignment === value) {
            return;
        }
        this._alignment = value;
        if (!this.parent) {
            return;
        }
        this.parent.dataset['alignment'] = value;
        this.parent.update();
    }
    /**
     * Get the inter-element spacing for the box layout.
     */
    get spacing() {
        return this._spacing;
    }
    /**
     * Set the inter-element spacing for the box layout.
     */
    set spacing(value) {
        value = Utils$1.clampDimension(value);
        if (this._spacing === value) {
            return;
        }
        this._spacing = value;
        if (!this.parent) {
            return;
        }
        this.parent.fit();
    }
    /**
     * Perform layout initialization which requires the parent widget.
     */
    init() {
        this.parent.dataset['direction'] = this.direction;
        this.parent.dataset['alignment'] = this.alignment;
        super.init();
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    attachWidget(index, widget) {
        // Create and add a new layout item for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._items, index, new LayoutItem(widget));
        // Create and add a new sizer for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._sizers, index, new BoxSizer());
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Add the widget's node to the parent.
        this.parent.node.appendChild(widget.node);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Move a widget in the parent's DOM node.
     *
     * @param fromIndex - The previous index of the widget in the layout.
     *
     * @param toIndex - The current index of the widget in the layout.
     *
     * @param widget - The widget to move in the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    moveWidget(fromIndex, toIndex, widget) {
        // Move the layout item for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._items, fromIndex, toIndex);
        // Move the sizer for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._sizers, fromIndex, toIndex);
        // Post an update request for the parent widget.
        this.parent.update();
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    detachWidget(index, widget) {
        // Remove the layout item for the widget.
        let item = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._items, index);
        // Remove the sizer for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._sizers, index);
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.node.removeChild(widget.node);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
        // Dispose of the layout item.
        item.dispose();
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'before-show'` message.
     */
    onBeforeShow(msg) {
        super.onBeforeShow(msg);
        this.parent.update();
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        super.onBeforeAttach(msg);
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-shown'` message.
     */
    onChildShown(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-hidden'` message.
     */
    onChildHidden(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'resize'` message.
     */
    onResize(msg) {
        if (this.parent.isVisible) {
            this._update(msg.width, msg.height);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        if (this.parent.isVisible) {
            this._update(-1, -1);
        }
    }
    /**
     * A message handler invoked on a `'fit-request'` message.
     */
    onFitRequest(msg) {
        if (this.parent.isAttached) {
            this._fit();
        }
    }
    /**
     * Fit the layout to the total size required by the widgets.
     */
    _fit() {
        // Compute the visible item count.
        let nVisible = 0;
        for (let i = 0, n = this._items.length; i < n; ++i) {
            nVisible += +!this._items[i].isHidden;
        }
        // Update the fixed space for the visible items.
        this._fixed = this._spacing * Math.max(0, nVisible - 1);
        // Setup the computed minimum size.
        let horz = Private$c.isHorizontal(this._direction);
        let minW = horz ? this._fixed : 0;
        let minH = horz ? 0 : this._fixed;
        // Update the sizers and computed minimum size.
        for (let i = 0, n = this._items.length; i < n; ++i) {
            // Fetch the item and corresponding box sizer.
            let item = this._items[i];
            let sizer = this._sizers[i];
            // If the item is hidden, it should consume zero size.
            if (item.isHidden) {
                sizer.minSize = 0;
                sizer.maxSize = 0;
                continue;
            }
            // Update the size limits for the item.
            item.fit();
            // Update the size basis and stretch factor.
            sizer.sizeHint = BoxLayout.getSizeBasis(item.widget);
            sizer.stretch = BoxLayout.getStretch(item.widget);
            // Update the sizer limits and computed min size.
            if (horz) {
                sizer.minSize = item.minWidth;
                sizer.maxSize = item.maxWidth;
                minW += item.minWidth;
                minH = Math.max(minH, item.minHeight);
            }
            else {
                sizer.minSize = item.minHeight;
                sizer.maxSize = item.maxHeight;
                minH += item.minHeight;
                minW = Math.max(minW, item.minWidth);
            }
        }
        // Update the box sizing and add it to the computed min size.
        let box = (this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node));
        minW += box.horizontalSum;
        minH += box.verticalSum;
        // Update the parent's min size constraints.
        let style = this.parent.node.style;
        style.minWidth = `${minW}px`;
        style.minHeight = `${minH}px`;
        // Set the dirty flag to ensure only a single update occurs.
        this._dirty = true;
        // Notify the ancestor that it should fit immediately. This may
        // cause a resize of the parent, fulfilling the required update.
        if (this.parent.parent) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);
        }
        // If the dirty flag is still set, the parent was not resized.
        // Trigger the required update on the parent widget immediately.
        if (this._dirty) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);
        }
    }
    /**
     * Update the layout position and size of the widgets.
     *
     * The parent offset dimensions should be `-1` if unknown.
     */
    _update(offsetWidth, offsetHeight) {
        // Clear the dirty flag to indicate the update occurred.
        this._dirty = false;
        // Compute the visible item count.
        let nVisible = 0;
        for (let i = 0, n = this._items.length; i < n; ++i) {
            nVisible += +!this._items[i].isHidden;
        }
        // Bail early if there are no visible items to layout.
        if (nVisible === 0) {
            return;
        }
        // Measure the parent if the offset dimensions are unknown.
        if (offsetWidth < 0) {
            offsetWidth = this.parent.node.offsetWidth;
        }
        if (offsetHeight < 0) {
            offsetHeight = this.parent.node.offsetHeight;
        }
        // Ensure the parent box sizing data is computed.
        if (!this._box) {
            this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node);
        }
        // Compute the layout area adjusted for border and padding.
        let top = this._box.paddingTop;
        let left = this._box.paddingLeft;
        let width = offsetWidth - this._box.horizontalSum;
        let height = offsetHeight - this._box.verticalSum;
        // Distribute the layout space and adjust the start position.
        let delta;
        switch (this._direction) {
            case 'left-to-right':
                delta = BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));
                break;
            case 'top-to-bottom':
                delta = BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));
                break;
            case 'right-to-left':
                delta = BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));
                left += width;
                break;
            case 'bottom-to-top':
                delta = BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));
                top += height;
                break;
            default:
                throw 'unreachable';
        }
        // Setup the variables for justification and alignment offset.
        let extra = 0;
        let offset = 0;
        // Account for alignment if there is extra layout space.
        if (delta > 0) {
            switch (this._alignment) {
                case 'start':
                    break;
                case 'center':
                    extra = 0;
                    offset = delta / 2;
                    break;
                case 'end':
                    extra = 0;
                    offset = delta;
                    break;
                case 'justify':
                    extra = delta / nVisible;
                    offset = 0;
                    break;
                default:
                    throw 'unreachable';
            }
        }
        // Layout the items using the computed box sizes.
        for (let i = 0, n = this._items.length; i < n; ++i) {
            // Fetch the item.
            let item = this._items[i];
            // Ignore hidden items.
            if (item.isHidden) {
                continue;
            }
            // Fetch the computed size for the widget.
            let size = this._sizers[i].size;
            // Update the widget geometry and advance the relevant edge.
            switch (this._direction) {
                case 'left-to-right':
                    item.update(left + offset, top, size + extra, height);
                    left += size + extra + this._spacing;
                    break;
                case 'top-to-bottom':
                    item.update(left, top + offset, width, size + extra);
                    top += size + extra + this._spacing;
                    break;
                case 'right-to-left':
                    item.update(left - offset - size - extra, top, size + extra, height);
                    left -= size + extra + this._spacing;
                    break;
                case 'bottom-to-top':
                    item.update(left, top - offset - size - extra, width, size + extra);
                    top -= size + extra + this._spacing;
                    break;
                default:
                    throw 'unreachable';
            }
        }
    }
}
/**
 * The namespace for the `BoxLayout` class statics.
 */
(function (BoxLayout) {
    /**
     * Get the box layout stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The box layout stretch factor for the widget.
     */
    function getStretch(widget) {
        return Private$c.stretchProperty.get(widget);
    }
    BoxLayout.getStretch = getStretch;
    /**
     * Set the box layout stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the stretch factor.
     */
    function setStretch(widget, value) {
        Private$c.stretchProperty.set(widget, value);
    }
    BoxLayout.setStretch = setStretch;
    /**
     * Get the box layout size basis for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The box layout size basis for the widget.
     */
    function getSizeBasis(widget) {
        return Private$c.sizeBasisProperty.get(widget);
    }
    BoxLayout.getSizeBasis = getSizeBasis;
    /**
     * Set the box layout size basis for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the size basis.
     */
    function setSizeBasis(widget, value) {
        Private$c.sizeBasisProperty.set(widget, value);
    }
    BoxLayout.setSizeBasis = setSizeBasis;
})(BoxLayout || (BoxLayout = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$c;
(function (Private) {
    /**
     * The property descriptor for a widget stretch factor.
     */
    Private.stretchProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'stretch',
        create: () => 0,
        coerce: (owner, value) => Math.max(0, Math.floor(value)),
        changed: onChildSizingChanged
    });
    /**
     * The property descriptor for a widget size basis.
     */
    Private.sizeBasisProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'sizeBasis',
        create: () => 0,
        coerce: (owner, value) => Math.max(0, Math.floor(value)),
        changed: onChildSizingChanged
    });
    /**
     * Test whether a direction has horizontal orientation.
     */
    function isHorizontal(dir) {
        return dir === 'left-to-right' || dir === 'right-to-left';
    }
    Private.isHorizontal = isHorizontal;
    /**
     * Clamp a spacing value to an integer >= 0.
     */
    function clampSpacing(value) {
        return Math.max(0, Math.floor(value));
    }
    Private.clampSpacing = clampSpacing;
    /**
     * The change handler for the attached sizing properties.
     */
    function onChildSizingChanged(child) {
        if (child.parent && child.parent.layout instanceof BoxLayout) {
            child.parent.fit();
        }
    }
})(Private$c || (Private$c = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A panel which arranges its widgets in a single row or column.
 *
 * #### Notes
 * This class provides a convenience wrapper around a {@link BoxLayout}.
 */
class BoxPanel extends Panel {
    /**
     * Construct a new box panel.
     *
     * @param options - The options for initializing the box panel.
     */
    constructor(options = {}) {
        super({ layout: Private$b.createLayout(options) });
        this.addClass('lm-BoxPanel');
    }
    /**
     * Get the layout direction for the box panel.
     */
    get direction() {
        return this.layout.direction;
    }
    /**
     * Set the layout direction for the box panel.
     */
    set direction(value) {
        this.layout.direction = value;
    }
    /**
     * Get the content alignment for the box panel.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand to fill the
     * entire box layout.
     */
    get alignment() {
        return this.layout.alignment;
    }
    /**
     * Set the content alignment for the box panel.
     *
     * #### Notes
     * This is the alignment of the widgets in the layout direction.
     *
     * The alignment has no effect if the widgets can expand to fill the
     * entire box layout.
     */
    set alignment(value) {
        this.layout.alignment = value;
    }
    /**
     * Get the inter-element spacing for the box panel.
     */
    get spacing() {
        return this.layout.spacing;
    }
    /**
     * Set the inter-element spacing for the box panel.
     */
    set spacing(value) {
        this.layout.spacing = value;
    }
    /**
     * A message handler invoked on a `'child-added'` message.
     */
    onChildAdded(msg) {
        msg.child.addClass('lm-BoxPanel-child');
    }
    /**
     * A message handler invoked on a `'child-removed'` message.
     */
    onChildRemoved(msg) {
        msg.child.removeClass('lm-BoxPanel-child');
    }
}
/**
 * The namespace for the `BoxPanel` class statics.
 */
(function (BoxPanel) {
    /**
     * Get the box panel stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The box panel stretch factor for the widget.
     */
    function getStretch(widget) {
        return BoxLayout.getStretch(widget);
    }
    BoxPanel.getStretch = getStretch;
    /**
     * Set the box panel stretch factor for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the stretch factor.
     */
    function setStretch(widget, value) {
        BoxLayout.setStretch(widget, value);
    }
    BoxPanel.setStretch = setStretch;
    /**
     * Get the box panel size basis for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The box panel size basis for the widget.
     */
    function getSizeBasis(widget) {
        return BoxLayout.getSizeBasis(widget);
    }
    BoxPanel.getSizeBasis = getSizeBasis;
    /**
     * Set the box panel size basis for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the size basis.
     */
    function setSizeBasis(widget, value) {
        BoxLayout.setSizeBasis(widget, value);
    }
    BoxPanel.setSizeBasis = setSizeBasis;
})(BoxPanel || (BoxPanel = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$b;
(function (Private) {
    /**
     * Create a box layout for the given panel options.
     */
    function createLayout(options) {
        return options.layout || new BoxLayout(options);
    }
    Private.createLayout = createLayout;
})(Private$b || (Private$b = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A widget which displays command items as a searchable palette.
 */
class CommandPalette extends Widget {
    /**
     * Construct a new command palette.
     *
     * @param options - The options for initializing the palette.
     */
    constructor(options) {
        super({ node: Private$a.createNode() });
        this._activeIndex = -1;
        this._items = [];
        this._results = null;
        this.addClass('lm-CommandPalette');
        this.setFlag(Widget.Flag.DisallowLayout);
        this.commands = options.commands;
        this.renderer = options.renderer || CommandPalette.defaultRenderer;
        this.commands.commandChanged.connect(this._onGenericChange, this);
        this.commands.keyBindingChanged.connect(this._onGenericChange, this);
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        this._items.length = 0;
        this._results = null;
        super.dispose();
    }
    /**
     * The command palette search node.
     *
     * #### Notes
     * This is the node which contains the search-related elements.
     */
    get searchNode() {
        return this.node.getElementsByClassName('lm-CommandPalette-search')[0];
    }
    /**
     * The command palette input node.
     *
     * #### Notes
     * This is the actual input node for the search area.
     */
    get inputNode() {
        return this.node.getElementsByClassName('lm-CommandPalette-input')[0];
    }
    /**
     * The command palette content node.
     *
     * #### Notes
     * This is the node which holds the command item nodes.
     *
     * Modifying this node directly can lead to undefined behavior.
     */
    get contentNode() {
        return this.node.getElementsByClassName('lm-CommandPalette-content')[0];
    }
    /**
     * A read-only array of the command items in the palette.
     */
    get items() {
        return this._items;
    }
    /**
     * Add a command item to the command palette.
     *
     * @param options - The options for creating the command item.
     *
     * @returns The command item added to the palette.
     */
    addItem(options) {
        // Create a new command item for the options.
        let item = Private$a.createItem(this.commands, options);
        // Add the item to the array.
        this._items.push(item);
        // Refresh the search results.
        this.refresh();
        // Return the item added to the palette.
        return item;
    }
    /**
     * Adds command items to the command palette.
     *
     * @param items - An array of options for creating each command item.
     *
     * @returns The command items added to the palette.
     */
    addItems(items) {
        const newItems = items.map(item => Private$a.createItem(this.commands, item));
        newItems.forEach(item => this._items.push(item));
        this.refresh();
        return newItems;
    }
    /**
     * Remove an item from the command palette.
     *
     * @param item - The item to remove from the palette.
     *
     * #### Notes
     * This is a no-op if the item is not in the palette.
     */
    removeItem(item) {
        this.removeItemAt(this._items.indexOf(item));
    }
    /**
     * Remove the item at a given index from the command palette.
     *
     * @param index - The index of the item to remove.
     *
     * #### Notes
     * This is a no-op if the index is out of range.
     */
    removeItemAt(index) {
        // Remove the item from the array.
        let item = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._items, index);
        // Bail if the index is out of range.
        if (!item) {
            return;
        }
        // Refresh the search results.
        this.refresh();
    }
    /**
     * Remove all items from the command palette.
     */
    clearItems() {
        // Bail if there is nothing to remove.
        if (this._items.length === 0) {
            return;
        }
        // Clear the array of items.
        this._items.length = 0;
        // Refresh the search results.
        this.refresh();
    }
    /**
     * Clear the search results and schedule an update.
     *
     * #### Notes
     * This should be called whenever the search results of the palette
     * should be updated.
     *
     * This is typically called automatically by the palette as needed,
     * but can be called manually if the input text is programatically
     * changed.
     *
     * The rendered results are updated asynchronously.
     */
    refresh() {
        this._results = null;
        if (this.inputNode.value !== '') {
            let clear = this.node.getElementsByClassName('lm-close-icon')[0];
            clear.style.display = 'inherit';
        }
        else {
            let clear = this.node.getElementsByClassName('lm-close-icon')[0];
            clear.style.display = 'none';
        }
        this.update();
    }
    /**
     * Handle the DOM events for the command palette.
     *
     * @param event - The DOM event sent to the command palette.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the command palette's DOM node.
     * It should not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'click':
                this._evtClick(event);
                break;
            case 'keydown':
                this._evtKeyDown(event);
                break;
            case 'input':
                this.refresh();
                break;
            case 'focus':
            case 'blur':
                this._toggleFocused();
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('click', this);
        this.node.addEventListener('keydown', this);
        this.node.addEventListener('input', this);
        this.node.addEventListener('focus', this, true);
        this.node.addEventListener('blur', this, true);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('click', this);
        this.node.removeEventListener('keydown', this);
        this.node.removeEventListener('input', this);
        this.node.removeEventListener('focus', this, true);
        this.node.removeEventListener('blur', this, true);
    }
    /**
     * A message handler invoked on an `'after-show'` message.
     */
    onAfterShow(msg) {
        this.update();
        super.onAfterShow(msg);
    }
    /**
     * A message handler invoked on an `'activate-request'` message.
     */
    onActivateRequest(msg) {
        if (this.isAttached) {
            let input = this.inputNode;
            input.focus();
            input.select();
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        if (!this.isVisible) {
            // Ensure to clear the content if the widget is hidden
            _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.render(null, this.contentNode);
            return;
        }
        // Fetch the current query text and content node.
        let query = this.inputNode.value;
        let contentNode = this.contentNode;
        // Ensure the search results are generated.
        let results = this._results;
        if (!results) {
            // Generate and store the new search results.
            results = this._results = Private$a.search(this._items, query);
            // Reset the active index.
            this._activeIndex = query
                ? _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(results, Private$a.canActivate)
                : -1;
        }
        // If there is no query and no results, clear the content.
        if (!query && results.length === 0) {
            _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.render(null, contentNode);
            return;
        }
        // If the is a query but no results, render the empty message.
        if (query && results.length === 0) {
            let content = this.renderer.renderEmptyMessage({ query });
            _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.render(content, contentNode);
            return;
        }
        // Create the render content for the search results.
        let renderer = this.renderer;
        let activeIndex = this._activeIndex;
        let content = new Array(results.length);
        for (let i = 0, n = results.length; i < n; ++i) {
            let result = results[i];
            if (result.type === 'header') {
                let indices = result.indices;
                let category = result.category;
                content[i] = renderer.renderHeader({ category, indices });
            }
            else {
                let item = result.item;
                let indices = result.indices;
                let active = i === activeIndex;
                content[i] = renderer.renderItem({ item, indices, active });
            }
        }
        // Render the search result content.
        _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.render(content, contentNode);
        // Adjust the scroll position as needed.
        if (activeIndex < 0 || activeIndex >= results.length) {
            contentNode.scrollTop = 0;
        }
        else {
            let element = contentNode.children[activeIndex];
            _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.scrollIntoViewIfNeeded(contentNode, element);
        }
    }
    /**
     * Handle the `'click'` event for the command palette.
     */
    _evtClick(event) {
        // Bail if the click is not the left button.
        if (event.button !== 0) {
            return;
        }
        // Clear input if the target is clear button
        if (event.target.classList.contains('lm-close-icon')) {
            this.inputNode.value = '';
            this.refresh();
            return;
        }
        // Find the index of the item which was clicked.
        let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.contentNode.children, node => {
            return node.contains(event.target);
        });
        // Bail if the click was not on an item.
        if (index === -1) {
            return;
        }
        // Kill the event when a content item is clicked.
        event.preventDefault();
        event.stopPropagation();
        // Execute the item if possible.
        this._execute(index);
    }
    /**
     * Handle the `'keydown'` event for the command palette.
     */
    _evtKeyDown(event) {
        if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
            return;
        }
        switch (event.keyCode) {
            case 13: // Enter
                event.preventDefault();
                event.stopPropagation();
                this._execute(this._activeIndex);
                break;
            case 38: // Up Arrow
                event.preventDefault();
                event.stopPropagation();
                this._activatePreviousItem();
                break;
            case 40: // Down Arrow
                event.preventDefault();
                event.stopPropagation();
                this._activateNextItem();
                break;
        }
    }
    /**
     * Activate the next enabled command item.
     */
    _activateNextItem() {
        // Bail if there are no search results.
        if (!this._results || this._results.length === 0) {
            return;
        }
        // Find the next enabled item index.
        let ai = this._activeIndex;
        let n = this._results.length;
        let start = ai < n - 1 ? ai + 1 : 0;
        let stop = start === 0 ? n - 1 : start - 1;
        this._activeIndex = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this._results, Private$a.canActivate, start, stop);
        // Schedule an update of the items.
        this.update();
    }
    /**
     * Activate the previous enabled command item.
     */
    _activatePreviousItem() {
        // Bail if there are no search results.
        if (!this._results || this._results.length === 0) {
            return;
        }
        // Find the previous enabled item index.
        let ai = this._activeIndex;
        let n = this._results.length;
        let start = ai <= 0 ? n - 1 : ai - 1;
        let stop = start === n - 1 ? 0 : start + 1;
        this._activeIndex = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findLastIndex(this._results, Private$a.canActivate, start, stop);
        // Schedule an update of the items.
        this.update();
    }
    /**
     * Execute the command item at the given index, if possible.
     */
    _execute(index) {
        // Bail if there are no search results.
        if (!this._results) {
            return;
        }
        // Bail if the index is out of range.
        let part = this._results[index];
        if (!part) {
            return;
        }
        // Update the search text if the item is a header.
        if (part.type === 'header') {
            let input = this.inputNode;
            input.value = `${part.category.toLowerCase()} `;
            input.focus();
            this.refresh();
            return;
        }
        // Bail if item is not enabled.
        if (!part.item.isEnabled) {
            return;
        }
        // Execute the item.
        this.commands.execute(part.item.command, part.item.args);
        // Clear the query text.
        this.inputNode.value = '';
        // Refresh the search results.
        this.refresh();
    }
    /**
     * Toggle the focused modifier based on the input node focus state.
     */
    _toggleFocused() {
        let focused = document.activeElement === this.inputNode;
        this.toggleClass('lm-mod-focused', focused);
    }
    /**
     * A signal handler for generic command changes.
     */
    _onGenericChange() {
        this.refresh();
    }
}
/**
 * The namespace for the `CommandPalette` class statics.
 */
(function (CommandPalette) {
    /**
     * The default implementation of `IRenderer`.
     */
    class Renderer {
        /**
         * Render the virtual element for a command palette header.
         *
         * @param data - The data to use for rendering the header.
         *
         * @returns A virtual element representing the header.
         */
        renderHeader(data) {
            let content = this.formatHeader(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({ className: 'lm-CommandPalette-header' }, content);
        }
        /**
         * Render the virtual element for a command palette item.
         *
         * @param data - The data to use for rendering the item.
         *
         * @returns A virtual element representing the item.
         */
        renderItem(data) {
            let className = this.createItemClass(data);
            let dataset = this.createItemDataset(data);
            if (data.item.isToggleable) {
                return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({
                    className,
                    dataset,
                    role: 'menuitemcheckbox',
                    'aria-checked': `${data.item.isToggled}`
                }, this.renderItemIcon(data), this.renderItemContent(data), this.renderItemShortcut(data));
            }
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({
                className,
                dataset,
                role: 'menuitem'
            }, this.renderItemIcon(data), this.renderItemContent(data), this.renderItemShortcut(data));
        }
        /**
         * Render the empty results message for a command palette.
         *
         * @param data - The data to use for rendering the message.
         *
         * @returns A virtual element representing the message.
         */
        renderEmptyMessage(data) {
            let content = this.formatEmptyMessage(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({ className: 'lm-CommandPalette-emptyMessage' }, content);
        }
        /**
         * Render the icon for a command palette item.
         *
         * @param data - The data to use for rendering the icon.
         *
         * @returns A virtual element representing the icon.
         */
        renderItemIcon(data) {
            let className = this.createIconClass(data);
            // If data.item.icon is undefined, it will be ignored.
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className }, data.item.icon, data.item.iconLabel);
        }
        /**
         * Render the content for a command palette item.
         *
         * @param data - The data to use for rendering the content.
         *
         * @returns A virtual element representing the content.
         */
        renderItemContent(data) {
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-CommandPalette-itemContent' }, this.renderItemLabel(data), this.renderItemCaption(data));
        }
        /**
         * Render the label for a command palette item.
         *
         * @param data - The data to use for rendering the label.
         *
         * @returns A virtual element representing the label.
         */
        renderItemLabel(data) {
            let content = this.formatItemLabel(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-CommandPalette-itemLabel' }, content);
        }
        /**
         * Render the caption for a command palette item.
         *
         * @param data - The data to use for rendering the caption.
         *
         * @returns A virtual element representing the caption.
         */
        renderItemCaption(data) {
            let content = this.formatItemCaption(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-CommandPalette-itemCaption' }, content);
        }
        /**
         * Render the shortcut for a command palette item.
         *
         * @param data - The data to use for rendering the shortcut.
         *
         * @returns A virtual element representing the shortcut.
         */
        renderItemShortcut(data) {
            let content = this.formatItemShortcut(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-CommandPalette-itemShortcut' }, content);
        }
        /**
         * Create the class name for the command palette item.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the command palette item.
         */
        createItemClass(data) {
            // Set up the initial class name.
            let name = 'lm-CommandPalette-item';
            // Add the boolean state classes.
            if (!data.item.isEnabled) {
                name += ' lm-mod-disabled';
            }
            if (data.item.isToggled) {
                name += ' lm-mod-toggled';
            }
            if (data.active) {
                name += ' lm-mod-active';
            }
            // Add the extra class.
            let extra = data.item.className;
            if (extra) {
                name += ` ${extra}`;
            }
            // Return the complete class name.
            return name;
        }
        /**
         * Create the dataset for the command palette item.
         *
         * @param data - The data to use for creating the dataset.
         *
         * @returns The dataset for the command palette item.
         */
        createItemDataset(data) {
            return { ...data.item.dataset, command: data.item.command };
        }
        /**
         * Create the class name for the command item icon.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the item icon.
         */
        createIconClass(data) {
            let name = 'lm-CommandPalette-itemIcon';
            let extra = data.item.iconClass;
            return extra ? `${name} ${extra}` : name;
        }
        /**
         * Create the render content for the header node.
         *
         * @param data - The data to use for the header content.
         *
         * @returns The content to add to the header node.
         */
        formatHeader(data) {
            if (!data.indices || data.indices.length === 0) {
                return data.category;
            }
            return _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.StringExt.highlight(data.category, data.indices, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.mark);
        }
        /**
         * Create the render content for the empty message node.
         *
         * @param data - The data to use for the empty message content.
         *
         * @returns The content to add to the empty message node.
         */
        formatEmptyMessage(data) {
            return `No commands found that match '${data.query}'`;
        }
        /**
         * Create the render content for the item shortcut node.
         *
         * @param data - The data to use for the shortcut content.
         *
         * @returns The content to add to the shortcut node.
         */
        formatItemShortcut(data) {
            let kb = data.item.keyBinding;
            return kb ? _lumino_commands__WEBPACK_IMPORTED_MODULE_7__.CommandRegistry.formatKeystroke(kb.keys) : null;
        }
        /**
         * Create the render content for the item label node.
         *
         * @param data - The data to use for the label content.
         *
         * @returns The content to add to the label node.
         */
        formatItemLabel(data) {
            if (!data.indices || data.indices.length === 0) {
                return data.item.label;
            }
            return _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.StringExt.highlight(data.item.label, data.indices, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.mark);
        }
        /**
         * Create the render content for the item caption node.
         *
         * @param data - The data to use for the caption content.
         *
         * @returns The content to add to the caption node.
         */
        formatItemCaption(data) {
            return data.item.caption;
        }
    }
    CommandPalette.Renderer = Renderer;
    /**
     * The default `Renderer` instance.
     */
    CommandPalette.defaultRenderer = new Renderer();
})(CommandPalette || (CommandPalette = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$a;
(function (Private) {
    /**
     * Create the DOM node for a command palette.
     */
    function createNode() {
        let node = document.createElement('div');
        let search = document.createElement('div');
        let wrapper = document.createElement('div');
        let input = document.createElement('input');
        let content = document.createElement('ul');
        let clear = document.createElement('button');
        search.className = 'lm-CommandPalette-search';
        wrapper.className = 'lm-CommandPalette-wrapper';
        input.className = 'lm-CommandPalette-input';
        clear.className = 'lm-close-icon';
        content.className = 'lm-CommandPalette-content';
        content.setAttribute('role', 'menu');
        input.spellcheck = false;
        wrapper.appendChild(input);
        wrapper.appendChild(clear);
        search.appendChild(wrapper);
        node.appendChild(search);
        node.appendChild(content);
        return node;
    }
    Private.createNode = createNode;
    /**
     * Create a new command item from a command registry and options.
     */
    function createItem(commands, options) {
        return new CommandItem(commands, options);
    }
    Private.createItem = createItem;
    /**
     * Search an array of command items for fuzzy matches.
     */
    function search(items, query) {
        // Fuzzy match the items for the query.
        let scores = matchItems(items, query);
        // Sort the items based on their score.
        scores.sort(scoreCmp);
        // Create the results for the search.
        return createResults(scores);
    }
    Private.search = search;
    /**
     * Test whether a result item can be activated.
     */
    function canActivate(result) {
        return result.type === 'item' && result.item.isEnabled;
    }
    Private.canActivate = canActivate;
    /**
     * Normalize a category for a command item.
     */
    function normalizeCategory(category) {
        return category.trim().replace(/\s+/g, ' ');
    }
    /**
     * Normalize the query text for a fuzzy search.
     */
    function normalizeQuery(text) {
        return text.replace(/\s+/g, '').toLowerCase();
    }
    /**
     * Perform a fuzzy match on an array of command items.
     */
    function matchItems(items, query) {
        // Normalize the query text to lower case with no whitespace.
        query = normalizeQuery(query);
        // Create the array to hold the scores.
        let scores = [];
        // Iterate over the items and match against the query.
        for (let i = 0, n = items.length; i < n; ++i) {
            // Ignore items which are not visible.
            let item = items[i];
            if (!item.isVisible) {
                continue;
            }
            // If the query is empty, all items are matched by default.
            if (!query) {
                scores.push({
                    matchType: 3 /* MatchType.Default */,
                    categoryIndices: null,
                    labelIndices: null,
                    score: 0,
                    item
                });
                continue;
            }
            // Run the fuzzy search for the item and query.
            let score = fuzzySearch(item, query);
            // Ignore the item if it is not a match.
            if (!score) {
                continue;
            }
            // Penalize disabled items.
            // TODO - push disabled items all the way down in sort cmp?
            if (!item.isEnabled) {
                score.score += 1000;
            }
            // Add the score to the results.
            scores.push(score);
        }
        // Return the final array of scores.
        return scores;
    }
    /**
     * Perform a fuzzy search on a single command item.
     */
    function fuzzySearch(item, query) {
        // Create the source text to be searched.
        let category = item.category.toLowerCase();
        let label = item.label.toLowerCase();
        let source = `${category} ${label}`;
        // Set up the match score and indices array.
        let score = Infinity;
        let indices = null;
        // The regex for search word boundaries
        let rgx = /\b\w/g;
        // Search the source by word boundary.
        // eslint-disable-next-line no-constant-condition
        while (true) {
            // Find the next word boundary in the source.
            let rgxMatch = rgx.exec(source);
            // Break if there is no more source context.
            if (!rgxMatch) {
                break;
            }
            // Run the string match on the relevant substring.
            let match = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.StringExt.matchSumOfDeltas(source, query, rgxMatch.index);
            // Break if there is no match.
            if (!match) {
                break;
            }
            // Update the match if the score is better.
            if (match.score <= score) {
                score = match.score;
                indices = match.indices;
            }
        }
        // Bail if there was no match.
        if (!indices || score === Infinity) {
            return null;
        }
        // Compute the pivot index between category and label text.
        let pivot = category.length + 1;
        // Find the slice index to separate matched indices.
        let j = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.lowerBound(indices, pivot, (a, b) => a - b);
        // Extract the matched category and label indices.
        let categoryIndices = indices.slice(0, j);
        let labelIndices = indices.slice(j);
        // Adjust the label indices for the pivot offset.
        for (let i = 0, n = labelIndices.length; i < n; ++i) {
            labelIndices[i] -= pivot;
        }
        // Handle a pure label match.
        if (categoryIndices.length === 0) {
            return {
                matchType: 0 /* MatchType.Label */,
                categoryIndices: null,
                labelIndices,
                score,
                item
            };
        }
        // Handle a pure category match.
        if (labelIndices.length === 0) {
            return {
                matchType: 1 /* MatchType.Category */,
                categoryIndices,
                labelIndices: null,
                score,
                item
            };
        }
        // Handle a split match.
        return {
            matchType: 2 /* MatchType.Split */,
            categoryIndices,
            labelIndices,
            score,
            item
        };
    }
    /**
     * A sort comparison function for a match score.
     */
    function scoreCmp(a, b) {
        // First compare based on the match type
        let m1 = a.matchType - b.matchType;
        if (m1 !== 0) {
            return m1;
        }
        // Otherwise, compare based on the match score.
        let d1 = a.score - b.score;
        if (d1 !== 0) {
            return d1;
        }
        // Find the match index based on the match type.
        let i1 = 0;
        let i2 = 0;
        switch (a.matchType) {
            case 0 /* MatchType.Label */:
                i1 = a.labelIndices[0];
                i2 = b.labelIndices[0];
                break;
            case 1 /* MatchType.Category */:
            case 2 /* MatchType.Split */:
                i1 = a.categoryIndices[0];
                i2 = b.categoryIndices[0];
                break;
        }
        // Compare based on the match index.
        if (i1 !== i2) {
            return i1 - i2;
        }
        // Otherwise, compare by category.
        let d2 = a.item.category.localeCompare(b.item.category);
        if (d2 !== 0) {
            return d2;
        }
        // Otherwise, compare by rank.
        let r1 = a.item.rank;
        let r2 = b.item.rank;
        if (r1 !== r2) {
            return r1 < r2 ? -1 : 1; // Infinity safe
        }
        // Finally, compare by label.
        return a.item.label.localeCompare(b.item.label);
    }
    /**
     * Create the results from an array of sorted scores.
     */
    function createResults(scores) {
        // Set up the search results array.
        let results = [];
        // Iterate over each score in the array.
        for (let i = 0, n = scores.length; i < n; ++i) {
            // Extract the current item and indices.
            let { item, categoryIndices, labelIndices } = scores[i];
            // Extract the category for the current item.
            let category = item.category;
            // Is this the same category as the preceding result?
            if (i === 0 || category !== scores[i - 1].item.category) {
                // Add the header result for the category.
                results.push({ type: 'header', category, indices: categoryIndices });
            }
            // Create the item result for the score.
            results.push({ type: 'item', item, indices: labelIndices });
        }
        // Return the final results.
        return results;
    }
    /**
     * A concrete implementation of `CommandPalette.IItem`.
     */
    class CommandItem {
        /**
         * Construct a new command item.
         */
        constructor(commands, options) {
            this._commands = commands;
            this.category = normalizeCategory(options.category);
            this.command = options.command;
            this.args = options.args || _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject;
            this.rank = options.rank !== undefined ? options.rank : Infinity;
        }
        /**
         * The display label for the command item.
         */
        get label() {
            return this._commands.label(this.command, this.args);
        }
        /**
         * The icon renderer for the command item.
         */
        get icon() {
            return this._commands.icon(this.command, this.args);
        }
        /**
         * The icon class for the command item.
         */
        get iconClass() {
            return this._commands.iconClass(this.command, this.args);
        }
        /**
         * The icon label for the command item.
         */
        get iconLabel() {
            return this._commands.iconLabel(this.command, this.args);
        }
        /**
         * The display caption for the command item.
         */
        get caption() {
            return this._commands.caption(this.command, this.args);
        }
        /**
         * The extra class name for the command item.
         */
        get className() {
            return this._commands.className(this.command, this.args);
        }
        /**
         * The dataset for the command item.
         */
        get dataset() {
            return this._commands.dataset(this.command, this.args);
        }
        /**
         * Whether the command item is enabled.
         */
        get isEnabled() {
            return this._commands.isEnabled(this.command, this.args);
        }
        /**
         * Whether the command item is toggled.
         */
        get isToggled() {
            return this._commands.isToggled(this.command, this.args);
        }
        /**
         * Whether the command item is toggleable.
         */
        get isToggleable() {
            return this._commands.isToggleable(this.command, this.args);
        }
        /**
         * Whether the command item is visible.
         */
        get isVisible() {
            return this._commands.isVisible(this.command, this.args);
        }
        /**
         * The key binding for the command item.
         */
        get keyBinding() {
            let { command, args } = this;
            return (_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findLastValue(this._commands.keyBindings, kb => {
                return kb.command === command && _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.deepEqual(kb.args, args);
            }) || null);
        }
    }
})(Private$a || (Private$a = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A widget which displays items as a canonical menu.
 */
class Menu extends Widget {
    /**
     * Construct a new menu.
     *
     * @param options - The options for initializing the menu.
     */
    constructor(options) {
        super({ node: Private$9.createNode() });
        this._childIndex = -1;
        this._activeIndex = -1;
        this._openTimerID = 0;
        this._closeTimerID = 0;
        this._items = [];
        this._childMenu = null;
        this._parentMenu = null;
        this._aboutToClose = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._menuRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this.addClass('lm-Menu');
        this.setFlag(Widget.Flag.DisallowLayout);
        this.commands = options.commands;
        this.renderer = options.renderer || Menu.defaultRenderer;
    }
    /**
     * Dispose of the resources held by the menu.
     */
    dispose() {
        this.close();
        this._items.length = 0;
        super.dispose();
    }
    /**
     * A signal emitted just before the menu is closed.
     *
     * #### Notes
     * This signal is emitted when the menu receives a `'close-request'`
     * message, just before it removes itself from the DOM.
     *
     * This signal is not emitted if the menu is already detached from
     * the DOM when it receives the `'close-request'` message.
     */
    get aboutToClose() {
        return this._aboutToClose;
    }
    /**
     * A signal emitted when a new menu is requested by the user.
     *
     * #### Notes
     * This signal is emitted whenever the user presses the right or left
     * arrow keys, and a submenu cannot be opened or closed in response.
     *
     * This signal is useful when implementing menu bars in order to open
     * the next or previous menu in response to a user key press.
     *
     * This signal is only emitted for the root menu in a hierarchy.
     */
    get menuRequested() {
        return this._menuRequested;
    }
    /**
     * The parent menu of the menu.
     *
     * #### Notes
     * This is `null` unless the menu is an open submenu.
     */
    get parentMenu() {
        return this._parentMenu;
    }
    /**
     * The child menu of the menu.
     *
     * #### Notes
     * This is `null` unless the menu has an open submenu.
     */
    get childMenu() {
        return this._childMenu;
    }
    /**
     * The root menu of the menu hierarchy.
     */
    get rootMenu() {
        // eslint-disable-next-line @typescript-eslint/no-this-alias
        let menu = this;
        while (menu._parentMenu) {
            menu = menu._parentMenu;
        }
        return menu;
    }
    /**
     * The leaf menu of the menu hierarchy.
     */
    get leafMenu() {
        // eslint-disable-next-line @typescript-eslint/no-this-alias
        let menu = this;
        while (menu._childMenu) {
            menu = menu._childMenu;
        }
        return menu;
    }
    /**
     * The menu content node.
     *
     * #### Notes
     * This is the node which holds the menu item nodes.
     *
     * Modifying this node directly can lead to undefined behavior.
     */
    get contentNode() {
        return this.node.getElementsByClassName('lm-Menu-content')[0];
    }
    /**
     * Get the currently active menu item.
     */
    get activeItem() {
        return this._items[this._activeIndex] || null;
    }
    /**
     * Set the currently active menu item.
     *
     * #### Notes
     * If the item cannot be activated, the item will be set to `null`.
     */
    set activeItem(value) {
        this.activeIndex = value ? this._items.indexOf(value) : -1;
    }
    /**
     * Get the index of the currently active menu item.
     *
     * #### Notes
     * This will be `-1` if no menu item is active.
     */
    get activeIndex() {
        return this._activeIndex;
    }
    /**
     * Set the index of the currently active menu item.
     *
     * #### Notes
     * If the item cannot be activated, the index will be set to `-1`.
     */
    set activeIndex(value) {
        // Adjust the value for an out of range index.
        if (value < 0 || value >= this._items.length) {
            value = -1;
        }
        // Ensure the item can be activated.
        if (value !== -1 && !Private$9.canActivate(this._items[value])) {
            value = -1;
        }
        // Bail if the index will not change.
        if (this._activeIndex === value) {
            return;
        }
        // Update the active index.
        this._activeIndex = value;
        // Make active element in focus
        if (this._activeIndex >= 0 &&
            this.contentNode.childNodes[this._activeIndex]) {
            this.contentNode.childNodes[this._activeIndex].focus();
        }
        // schedule an update of the items.
        this.update();
    }
    /**
     * A read-only array of the menu items in the menu.
     */
    get items() {
        return this._items;
    }
    /**
     * Activate the next selectable item in the menu.
     *
     * #### Notes
     * If no item is selectable, the index will be set to `-1`.
     */
    activateNextItem() {
        let n = this._items.length;
        let ai = this._activeIndex;
        let start = ai < n - 1 ? ai + 1 : 0;
        let stop = start === 0 ? n - 1 : start - 1;
        this.activeIndex = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this._items, Private$9.canActivate, start, stop);
    }
    /**
     * Activate the previous selectable item in the menu.
     *
     * #### Notes
     * If no item is selectable, the index will be set to `-1`.
     */
    activatePreviousItem() {
        let n = this._items.length;
        let ai = this._activeIndex;
        let start = ai <= 0 ? n - 1 : ai - 1;
        let stop = start === n - 1 ? 0 : start + 1;
        this.activeIndex = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findLastIndex(this._items, Private$9.canActivate, start, stop);
    }
    /**
     * Trigger the active menu item.
     *
     * #### Notes
     * If the active item is a submenu, it will be opened and the first
     * item will be activated.
     *
     * If the active item is a command, the command will be executed.
     *
     * If the menu is not attached, this is a no-op.
     *
     * If there is no active item, this is a no-op.
     */
    triggerActiveItem() {
        // Bail if the menu is not attached.
        if (!this.isAttached) {
            return;
        }
        // Bail if there is no active item.
        let item = this.activeItem;
        if (!item) {
            return;
        }
        // Cancel the pending timers.
        this._cancelOpenTimer();
        this._cancelCloseTimer();
        // If the item is a submenu, open it.
        if (item.type === 'submenu') {
            this._openChildMenu(true);
            return;
        }
        // Close the root menu before executing the command.
        this.rootMenu.close();
        // Execute the command for the item.
        let { command, args } = item;
        if (this.commands.isEnabled(command, args)) {
            this.commands.execute(command, args);
        }
        else {
            console.log(`Command '${command}' is disabled.`);
        }
    }
    /**
     * Add a menu item to the end of the menu.
     *
     * @param options - The options for creating the menu item.
     *
     * @returns The menu item added to the menu.
     */
    addItem(options) {
        return this.insertItem(this._items.length, options);
    }
    /**
     * Insert a menu item into the menu at the specified index.
     *
     * @param index - The index at which to insert the item.
     *
     * @param options - The options for creating the menu item.
     *
     * @returns The menu item added to the menu.
     *
     * #### Notes
     * The index will be clamped to the bounds of the items.
     */
    insertItem(index, options) {
        // Close the menu if it's attached.
        if (this.isAttached) {
            this.close();
        }
        // Reset the active index.
        this.activeIndex = -1;
        // Clamp the insert index to the array bounds.
        let i = Math.max(0, Math.min(index, this._items.length));
        // Create the item for the options.
        let item = Private$9.createItem(this, options);
        // Insert the item into the array.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._items, i, item);
        // Schedule an update of the items.
        this.update();
        // Return the item added to the menu.
        return item;
    }
    /**
     * Remove an item from the menu.
     *
     * @param item - The item to remove from the menu.
     *
     * #### Notes
     * This is a no-op if the item is not in the menu.
     */
    removeItem(item) {
        let index = this._items.indexOf(item);
        if (index === -1) {
            return;
        }
        this.removeItemAt(index);
    }
    /**
     * Remove the item at a given index from the menu.
     *
     * @param index - The index of the item to remove.
     *
     * #### Notes
     * This is a no-op if the index is out of range.
     */
    removeItemAt(index) {
        // Close the menu if it's attached.
        if (this.isAttached) {
            this.close();
        }
        // Reset the active index.
        this.activeIndex = -1;
        // Remove the item from the array.
        let item = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._items, index);
        // Bail if the index is out of range.
        if (!item) {
            return;
        }
        // Schedule an update of the items.
        this.update();
    }
    /**
     * Remove all menu items from the menu.
     */
    clearItems() {
        // Close the menu if it's attached.
        if (this.isAttached) {
            this.close();
        }
        // Reset the active index.
        this.activeIndex = -1;
        // Bail if there is nothing to remove.
        if (this._items.length === 0) {
            return;
        }
        // Clear the items.
        this._items.length = 0;
        // Schedule an update of the items.
        this.update();
    }
    /**
     * Open the menu at the specified location.
     *
     * @param x - The client X coordinate of the menu location.
     *
     * @param y - The client Y coordinate of the menu location.
     *
     * @param options - The additional options for opening the menu.
     *
     * #### Notes
     * The menu will be opened at the given location unless it will not
     * fully fit on the screen. If it will not fit, it will be adjusted
     * to fit naturally on the screen.
     *
     * The menu will be attached under the `host` element in the DOM
     * (or `document.body` if `host` is `null`) and before the `ref`
     * element (or as the last child of `host` if `ref` is `null`).
     * The menu may be displayed outside of the `host` element
     * following the rules of CSS absolute positioning.
     *
     * This is a no-op if the menu is already attached to the DOM.
     */
    open(x, y, options = {}) {
        var _a, _b, _c;
        // Bail early if the menu is already attached.
        if (this.isAttached) {
            return;
        }
        // Extract the menu options.
        let forceX = options.forceX || false;
        let forceY = options.forceY || false;
        const host = (_a = options.host) !== null && _a !== void 0 ? _a : null;
        const ref = (_b = options.ref) !== null && _b !== void 0 ? _b : null;
        const horizontalAlignment = (_c = options.horizontalAlignment) !== null && _c !== void 0 ? _c : (document.documentElement.dir === 'rtl' ? 'right' : 'left');
        // Open the menu as a root menu.
        Private$9.openRootMenu(this, x, y, forceX, forceY, horizontalAlignment, host, ref);
        // Activate the menu to accept keyboard input.
        this.activate();
    }
    /**
     * Handle the DOM events for the menu.
     *
     * @param event - The DOM event sent to the menu.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the menu's DOM nodes. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'keydown':
                this._evtKeyDown(event);
                break;
            case 'mouseup':
                this._evtMouseUp(event);
                break;
            case 'mousemove':
                this._evtMouseMove(event);
                break;
            case 'mouseenter':
                this._evtMouseEnter(event);
                break;
            case 'mouseleave':
                this._evtMouseLeave(event);
                break;
            case 'mousedown':
                this._evtMouseDown(event);
                break;
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('keydown', this);
        this.node.addEventListener('mouseup', this);
        this.node.addEventListener('mousemove', this);
        this.node.addEventListener('mouseenter', this);
        this.node.addEventListener('mouseleave', this);
        this.node.addEventListener('contextmenu', this);
        document.addEventListener('mousedown', this, true);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('keydown', this);
        this.node.removeEventListener('mouseup', this);
        this.node.removeEventListener('mousemove', this);
        this.node.removeEventListener('mouseenter', this);
        this.node.removeEventListener('mouseleave', this);
        this.node.removeEventListener('contextmenu', this);
        document.removeEventListener('mousedown', this, true);
    }
    /**
     * A message handler invoked on an `'activate-request'` message.
     */
    onActivateRequest(msg) {
        if (this.isAttached) {
            this.node.focus();
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        let items = this._items;
        let renderer = this.renderer;
        let activeIndex = this._activeIndex;
        let collapsedFlags = Private$9.computeCollapsed(items);
        let content = new Array(items.length);
        for (let i = 0, n = items.length; i < n; ++i) {
            let item = items[i];
            let active = i === activeIndex;
            let collapsed = collapsedFlags[i];
            content[i] = renderer.renderItem({
                item,
                active,
                collapsed,
                onfocus: () => {
                    this.activeIndex = i;
                }
            });
        }
        _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.render(content, this.contentNode);
    }
    /**
     * A message handler invoked on a `'close-request'` message.
     */
    onCloseRequest(msg) {
        // Cancel the pending timers.
        this._cancelOpenTimer();
        this._cancelCloseTimer();
        // Reset the active index.
        this.activeIndex = -1;
        // Close any open child menu.
        let childMenu = this._childMenu;
        if (childMenu) {
            this._childIndex = -1;
            this._childMenu = null;
            childMenu._parentMenu = null;
            childMenu.close();
        }
        // Remove this menu from its parent and activate the parent.
        let parentMenu = this._parentMenu;
        if (parentMenu) {
            this._parentMenu = null;
            parentMenu._childIndex = -1;
            parentMenu._childMenu = null;
            parentMenu.activate();
        }
        // Emit the `aboutToClose` signal if the menu is attached.
        if (this.isAttached) {
            this._aboutToClose.emit(undefined);
        }
        // Finish closing the menu.
        super.onCloseRequest(msg);
    }
    /**
     * Handle the `'keydown'` event for the menu.
     *
     * #### Notes
     * This listener is attached to the menu node.
     */
    _evtKeyDown(event) {
        // A menu handles all keydown events.
        event.preventDefault();
        event.stopPropagation();
        // Fetch the key code for the event.
        let kc = event.keyCode;
        // Enter
        if (kc === 13) {
            this.triggerActiveItem();
            return;
        }
        // Escape
        if (kc === 27) {
            this.close();
            return;
        }
        // Left Arrow
        if (kc === 37) {
            if (this._parentMenu) {
                this.close();
            }
            else {
                this._menuRequested.emit('previous');
            }
            return;
        }
        // Up Arrow
        if (kc === 38) {
            this.activatePreviousItem();
            return;
        }
        // Right Arrow
        if (kc === 39) {
            let item = this.activeItem;
            if (item && item.type === 'submenu') {
                this.triggerActiveItem();
            }
            else {
                this.rootMenu._menuRequested.emit('next');
            }
            return;
        }
        // Down Arrow
        if (kc === 40) {
            this.activateNextItem();
            return;
        }
        // Get the pressed key character.
        let key = (0,_lumino_keyboard__WEBPACK_IMPORTED_MODULE_10__.getKeyboardLayout)().keyForKeydownEvent(event);
        // Bail if the key is not valid.
        if (!key) {
            return;
        }
        // Search for the next best matching mnemonic item.
        let start = this._activeIndex + 1;
        let result = Private$9.findMnemonic(this._items, key, start);
        // Handle the requested mnemonic based on the search results.
        // If exactly one mnemonic is matched, that item is triggered.
        // Otherwise, the next mnemonic is activated if available,
        // followed by the auto mnemonic if available.
        if (result.index !== -1 && !result.multiple) {
            this.activeIndex = result.index;
            this.triggerActiveItem();
        }
        else if (result.index !== -1) {
            this.activeIndex = result.index;
        }
        else if (result.auto !== -1) {
            this.activeIndex = result.auto;
        }
    }
    /**
     * Handle the `'mouseup'` event for the menu.
     *
     * #### Notes
     * This listener is attached to the menu node.
     */
    _evtMouseUp(event) {
        if (event.button !== 0) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();
        this.triggerActiveItem();
    }
    /**
     * Handle the `'mousemove'` event for the menu.
     *
     * #### Notes
     * This listener is attached to the menu node.
     */
    _evtMouseMove(event) {
        // Hit test the item nodes for the item under the mouse.
        let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.contentNode.children, node => {
            return _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(node, event.clientX, event.clientY);
        });
        // Bail early if the mouse is already over the active index.
        if (index === this._activeIndex) {
            return;
        }
        // Update and coerce the active index.
        this.activeIndex = index;
        index = this.activeIndex;
        // If the index is the current child index, cancel the timers.
        if (index === this._childIndex) {
            this._cancelOpenTimer();
            this._cancelCloseTimer();
            return;
        }
        // If a child menu is currently open, start the close timer.
        if (this._childIndex !== -1) {
            this._startCloseTimer();
        }
        // Cancel the open timer to give a full delay for opening.
        this._cancelOpenTimer();
        // Bail if the active item is not a valid submenu item.
        let item = this.activeItem;
        if (!item || item.type !== 'submenu' || !item.submenu) {
            return;
        }
        // Start the open timer to open the active item submenu.
        this._startOpenTimer();
    }
    /**
     * Handle the `'mouseenter'` event for the menu.
     *
     * #### Notes
     * This listener is attached to the menu node.
     */
    _evtMouseEnter(event) {
        // Synchronize the active ancestor items.
        for (let menu = this._parentMenu; menu; menu = menu._parentMenu) {
            menu._cancelOpenTimer();
            menu._cancelCloseTimer();
            menu.activeIndex = menu._childIndex;
        }
    }
    /**
     * Handle the `'mouseleave'` event for the menu.
     *
     * #### Notes
     * This listener is attached to the menu node.
     */
    _evtMouseLeave(event) {
        // Cancel any pending submenu opening.
        this._cancelOpenTimer();
        // If there is no open child menu, just reset the active index.
        if (!this._childMenu) {
            this.activeIndex = -1;
            return;
        }
        // If the mouse is over the child menu, cancel the close timer.
        let { clientX, clientY } = event;
        if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(this._childMenu.node, clientX, clientY)) {
            this._cancelCloseTimer();
            return;
        }
        // Otherwise, reset the active index and start the close timer.
        this.activeIndex = -1;
        this._startCloseTimer();
    }
    /**
     * Handle the `'mousedown'` event for the menu.
     *
     * #### Notes
     * This listener is attached to the document node.
     */
    _evtMouseDown(event) {
        // Bail if the menu is not a root menu.
        if (this._parentMenu) {
            return;
        }
        // The mouse button which is pressed is irrelevant. If the press
        // is not on a menu, the entire hierarchy is closed and the event
        // is allowed to propagate. This allows other code to act on the
        // event, such as focusing the clicked element.
        if (Private$9.hitTestMenus(this, event.clientX, event.clientY)) {
            event.preventDefault();
            event.stopPropagation();
        }
        else {
            this.close();
        }
    }
    /**
     * Open the child menu at the active index immediately.
     *
     * If a different child menu is already open, it will be closed,
     * even if the active item is not a valid submenu.
     */
    _openChildMenu(activateFirst = false) {
        // If the item is not a valid submenu, close the child menu.
        let item = this.activeItem;
        if (!item || item.type !== 'submenu' || !item.submenu) {
            this._closeChildMenu();
            return;
        }
        // Do nothing if the child menu will not change.
        let submenu = item.submenu;
        if (submenu === this._childMenu) {
            return;
        }
        // Prior to any DOM modifications save window data
        Menu.saveWindowData();
        // Ensure the current child menu is closed.
        this._closeChildMenu();
        // Update the private child state.
        this._childMenu = submenu;
        this._childIndex = this._activeIndex;
        // Set the parent menu reference for the child.
        submenu._parentMenu = this;
        // Ensure the menu is updated and lookup the item node.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest);
        let itemNode = this.contentNode.children[this._activeIndex];
        // Open the submenu at the active node.
        Private$9.openSubmenu(submenu, itemNode);
        // Activate the first item if desired.
        if (activateFirst) {
            submenu.activeIndex = -1;
            submenu.activateNextItem();
        }
        // Activate the child menu.
        submenu.activate();
    }
    /**
     * Close the child menu immediately.
     *
     * This is a no-op if a child menu is not open.
     */
    _closeChildMenu() {
        if (this._childMenu) {
            this._childMenu.close();
        }
    }
    /**
     * Start the open timer, unless it is already pending.
     */
    _startOpenTimer() {
        if (this._openTimerID === 0) {
            this._openTimerID = window.setTimeout(() => {
                this._openTimerID = 0;
                this._openChildMenu();
            }, Private$9.TIMER_DELAY);
        }
    }
    /**
     * Start the close timer, unless it is already pending.
     */
    _startCloseTimer() {
        if (this._closeTimerID === 0) {
            this._closeTimerID = window.setTimeout(() => {
                this._closeTimerID = 0;
                this._closeChildMenu();
            }, Private$9.TIMER_DELAY);
        }
    }
    /**
     * Cancel the open timer, if the timer is pending.
     */
    _cancelOpenTimer() {
        if (this._openTimerID !== 0) {
            clearTimeout(this._openTimerID);
            this._openTimerID = 0;
        }
    }
    /**
     * Cancel the close timer, if the timer is pending.
     */
    _cancelCloseTimer() {
        if (this._closeTimerID !== 0) {
            clearTimeout(this._closeTimerID);
            this._closeTimerID = 0;
        }
    }
    /**
     * Save window data used for menu positioning in transient cache.
     *
     * In order to avoid layout trashing it is recommended to invoke this
     * method immediately prior to opening the menu and any DOM modifications
     * (like closing previously visible menu, or adding a class to menu widget).
     *
     * The transient cache will be released upon `open()` call.
     */
    static saveWindowData() {
        Private$9.saveWindowData();
    }
}
/**
 * The namespace for the `Menu` class statics.
 */
(function (Menu) {
    /**
     * The default implementation of `IRenderer`.
     *
     * #### Notes
     * Subclasses are free to reimplement rendering methods as needed.
     */
    class Renderer {
        /**
         * Render the virtual element for a menu item.
         *
         * @param data - The data to use for rendering the item.
         *
         * @returns A virtual element representing the item.
         */
        renderItem(data) {
            let className = this.createItemClass(data);
            let dataset = this.createItemDataset(data);
            let aria = this.createItemARIA(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({
                className,
                dataset,
                tabindex: '0',
                onfocus: data.onfocus,
                ...aria
            }, this.renderIcon(data), this.renderLabel(data), this.renderShortcut(data), this.renderSubmenu(data));
        }
        /**
         * Render the icon element for a menu item.
         *
         * @param data - The data to use for rendering the icon.
         *
         * @returns A virtual element representing the item icon.
         */
        renderIcon(data) {
            let className = this.createIconClass(data);
            // If data.item.icon is undefined, it will be ignored.
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className }, data.item.icon, data.item.iconLabel);
        }
        /**
         * Render the label element for a menu item.
         *
         * @param data - The data to use for rendering the label.
         *
         * @returns A virtual element representing the item label.
         */
        renderLabel(data) {
            let content = this.formatLabel(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-Menu-itemLabel' }, content);
        }
        /**
         * Render the shortcut element for a menu item.
         *
         * @param data - The data to use for rendering the shortcut.
         *
         * @returns A virtual element representing the item shortcut.
         */
        renderShortcut(data) {
            let content = this.formatShortcut(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-Menu-itemShortcut' }, content);
        }
        /**
         * Render the submenu icon element for a menu item.
         *
         * @param data - The data to use for rendering the submenu icon.
         *
         * @returns A virtual element representing the submenu icon.
         */
        renderSubmenu(data) {
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-Menu-itemSubmenuIcon' });
        }
        /**
         * Create the class name for the menu item.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the menu item.
         */
        createItemClass(data) {
            // Setup the initial class name.
            let name = 'lm-Menu-item';
            // Add the boolean state classes.
            if (!data.item.isEnabled) {
                name += ' lm-mod-disabled';
            }
            if (data.item.isToggled) {
                name += ' lm-mod-toggled';
            }
            if (!data.item.isVisible) {
                name += ' lm-mod-hidden';
            }
            if (data.active) {
                name += ' lm-mod-active';
            }
            if (data.collapsed) {
                name += ' lm-mod-collapsed';
            }
            // Add the extra class.
            let extra = data.item.className;
            if (extra) {
                name += ` ${extra}`;
            }
            // Return the complete class name.
            return name;
        }
        /**
         * Create the dataset for the menu item.
         *
         * @param data - The data to use for creating the dataset.
         *
         * @returns The dataset for the menu item.
         */
        createItemDataset(data) {
            let result;
            let { type, command, dataset } = data.item;
            if (type === 'command') {
                result = { ...dataset, type, command };
            }
            else {
                result = { ...dataset, type };
            }
            return result;
        }
        /**
         * Create the class name for the menu item icon.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the item icon.
         */
        createIconClass(data) {
            let name = 'lm-Menu-itemIcon';
            let extra = data.item.iconClass;
            return extra ? `${name} ${extra}` : name;
        }
        /**
         * Create the aria attributes for menu item.
         *
         * @param data - The data to use for the aria attributes.
         *
         * @returns The aria attributes object for the item.
         */
        createItemARIA(data) {
            let aria = {};
            switch (data.item.type) {
                case 'separator':
                    aria.role = 'presentation';
                    break;
                case 'submenu':
                    aria['aria-haspopup'] = 'true';
                    if (!data.item.isEnabled) {
                        aria['aria-disabled'] = 'true';
                    }
                    break;
                default:
                    if (!data.item.isEnabled) {
                        aria['aria-disabled'] = 'true';
                    }
                    if (data.item.isToggled) {
                        aria.role = 'menuitemcheckbox';
                        aria['aria-checked'] = 'true';
                    }
                    else {
                        aria.role = 'menuitem';
                    }
            }
            return aria;
        }
        /**
         * Create the render content for the label node.
         *
         * @param data - The data to use for the label content.
         *
         * @returns The content to add to the label node.
         */
        formatLabel(data) {
            // Fetch the label text and mnemonic index.
            let { label, mnemonic } = data.item;
            // If the index is out of range, do not modify the label.
            if (mnemonic < 0 || mnemonic >= label.length) {
                return label;
            }
            // Split the label into parts.
            let prefix = label.slice(0, mnemonic);
            let suffix = label.slice(mnemonic + 1);
            let char = label[mnemonic];
            // Wrap the mnemonic character in a span.
            let span = _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: 'lm-Menu-itemMnemonic' }, char);
            // Return the content parts.
            return [prefix, span, suffix];
        }
        /**
         * Create the render content for the shortcut node.
         *
         * @param data - The data to use for the shortcut content.
         *
         * @returns The content to add to the shortcut node.
         */
        formatShortcut(data) {
            let kb = data.item.keyBinding;
            return kb ? _lumino_commands__WEBPACK_IMPORTED_MODULE_7__.CommandRegistry.formatKeystroke(kb.keys) : null;
        }
    }
    Menu.Renderer = Renderer;
    /**
     * The default `Renderer` instance.
     */
    Menu.defaultRenderer = new Renderer();
})(Menu || (Menu = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$9;
(function (Private) {
    /**
     * The ms delay for opening and closing a submenu.
     */
    Private.TIMER_DELAY = 300;
    /**
     * The horizontal pixel overlap for an open submenu.
     */
    Private.SUBMENU_OVERLAP = 3;
    let transientWindowDataCache = null;
    let transientCacheCounter = 0;
    function getWindowData() {
        // if transient cache is in use, take one from it
        if (transientCacheCounter > 0) {
            transientCacheCounter--;
            return transientWindowDataCache;
        }
        return _getWindowData();
    }
    /**
     * Store window data in transient cache.
     *
     * The transient cache will be released upon `getWindowData()` call.
     * If this function is called multiple times, the cache will be
     * retained until as many calls to `getWindowData()` were made.
     *
     * Note: should be called before any DOM modifications.
     */
    function saveWindowData() {
        transientWindowDataCache = _getWindowData();
        transientCacheCounter++;
    }
    Private.saveWindowData = saveWindowData;
    /**
     * Create the DOM node for a menu.
     */
    function createNode() {
        let node = document.createElement('div');
        let content = document.createElement('ul');
        content.className = 'lm-Menu-content';
        node.appendChild(content);
        content.setAttribute('role', 'menu');
        node.tabIndex = 0;
        return node;
    }
    Private.createNode = createNode;
    /**
     * Test whether a menu item can be activated.
     */
    function canActivate(item) {
        return item.type !== 'separator' && item.isEnabled && item.isVisible;
    }
    Private.canActivate = canActivate;
    /**
     * Create a new menu item for an owner menu.
     */
    function createItem(owner, options) {
        return new MenuItem(owner.commands, options);
    }
    Private.createItem = createItem;
    /**
     * Hit test a menu hierarchy starting at the given root.
     */
    function hitTestMenus(menu, x, y) {
        for (let temp = menu; temp; temp = temp.childMenu) {
            if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(temp.node, x, y)) {
                return true;
            }
        }
        return false;
    }
    Private.hitTestMenus = hitTestMenus;
    /**
     * Compute which extra separator items should be collapsed.
     */
    function computeCollapsed(items) {
        // Allocate the return array and fill it with `false`.
        let result = new Array(items.length);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.fill(result, false);
        // Collapse the leading separators.
        let k1 = 0;
        let n = items.length;
        for (; k1 < n; ++k1) {
            let item = items[k1];
            if (!item.isVisible) {
                continue;
            }
            if (item.type !== 'separator') {
                break;
            }
            result[k1] = true;
        }
        // Hide the trailing separators.
        let k2 = n - 1;
        for (; k2 >= 0; --k2) {
            let item = items[k2];
            if (!item.isVisible) {
                continue;
            }
            if (item.type !== 'separator') {
                break;
            }
            result[k2] = true;
        }
        // Hide the remaining consecutive separators.
        let hide = false;
        while (++k1 < k2) {
            let item = items[k1];
            if (!item.isVisible) {
                continue;
            }
            if (item.type !== 'separator') {
                hide = false;
            }
            else if (hide) {
                result[k1] = true;
            }
            else {
                hide = true;
            }
        }
        // Return the resulting flags.
        return result;
    }
    Private.computeCollapsed = computeCollapsed;
    function _getWindowData() {
        return {
            pageXOffset: window.pageXOffset,
            pageYOffset: window.pageYOffset,
            clientWidth: document.documentElement.clientWidth,
            clientHeight: document.documentElement.clientHeight
        };
    }
    /**
     * Open a menu as a root menu at the target location.
     */
    function openRootMenu(menu, x, y, forceX, forceY, horizontalAlignment, host, ref) {
        // Get the current position and size of the main viewport.
        const windowData = getWindowData();
        let px = windowData.pageXOffset;
        let py = windowData.pageYOffset;
        let cw = windowData.clientWidth;
        let ch = windowData.clientHeight;
        // Ensure the menu is updated before attaching and measuring.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(menu, Widget.Msg.UpdateRequest);
        // Compute the maximum allowed height for the menu.
        let maxHeight = ch - (forceY ? y : 0);
        // Fetch common variables.
        let node = menu.node;
        let style = node.style;
        // Clear the menu geometry and prepare it for measuring.
        style.opacity = '0';
        style.maxHeight = `${maxHeight}px`;
        // Attach the menu to the document.
        Widget.attach(menu, host || document.body, ref);
        // Measure the size of the menu.
        let { width, height } = node.getBoundingClientRect();
        // align the menu to the right of the target if requested or language is RTL
        if (horizontalAlignment === 'right') {
            x -= width;
        }
        // Adjust the X position of the menu to fit on-screen.
        if (!forceX && x + width > px + cw) {
            x = px + cw - width;
        }
        // Adjust the Y position of the menu to fit on-screen.
        if (!forceY && y + height > py + ch) {
            if (y > py + ch) {
                y = py + ch - height;
            }
            else {
                y = y - height;
            }
        }
        // Update the position of the menu to the computed position.
        style.transform = `translate(${Math.max(0, x)}px, ${Math.max(0, y)}px`;
        // Finally, make the menu visible on the screen.
        style.opacity = '1';
    }
    Private.openRootMenu = openRootMenu;
    /**
     * Open a menu as a submenu using an item node for positioning.
     */
    function openSubmenu(submenu, itemNode) {
        // Get the current position and size of the main viewport.
        const windowData = getWindowData();
        let px = windowData.pageXOffset;
        let py = windowData.pageYOffset;
        let cw = windowData.clientWidth;
        let ch = windowData.clientHeight;
        // Ensure the menu is updated before opening.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(submenu, Widget.Msg.UpdateRequest);
        // Compute the maximum allowed height for the menu.
        let maxHeight = ch;
        // Fetch common variables.
        let node = submenu.node;
        let style = node.style;
        // Clear the menu geometry and prepare it for measuring.
        style.opacity = '0';
        style.maxHeight = `${maxHeight}px`;
        // Attach the menu to the document.
        Widget.attach(submenu, document.body);
        // Measure the size of the menu.
        let { width, height } = node.getBoundingClientRect();
        // Compute the box sizing for the menu.
        let box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(submenu.node);
        // Get the bounding rect for the target item node.
        let itemRect = itemNode.getBoundingClientRect();
        // Compute the target X position.
        let x = itemRect.right - Private.SUBMENU_OVERLAP;
        // Adjust the X position to fit on the screen.
        if (x + width > px + cw) {
            x = itemRect.left + Private.SUBMENU_OVERLAP - width;
        }
        // Compute the target Y position.
        let y = itemRect.top - box.borderTop - box.paddingTop;
        // Adjust the Y position to fit on the screen.
        if (y + height > py + ch) {
            y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;
        }
        // Update the position of the menu to the computed position.
        style.transform = `translate(${Math.max(0, x)}px, ${Math.max(0, y)}px`;
        // Finally, make the menu visible on the screen.
        style.opacity = '1';
    }
    Private.openSubmenu = openSubmenu;
    /**
     * Find the best matching mnemonic item.
     *
     * The search starts at the given index and wraps around.
     */
    function findMnemonic(items, key, start) {
        // Setup the result variables.
        let index = -1;
        let auto = -1;
        let multiple = false;
        // Normalize the key to upper case.
        let upperKey = key.toUpperCase();
        // Search the items from the given start index.
        for (let i = 0, n = items.length; i < n; ++i) {
            // Compute the wrapped index.
            let k = (i + start) % n;
            // Lookup the item
            let item = items[k];
            // Ignore items which cannot be activated.
            if (!canActivate(item)) {
                continue;
            }
            // Ignore items with an empty label.
            let label = item.label;
            if (label.length === 0) {
                continue;
            }
            // Lookup the mnemonic index for the label.
            let mn = item.mnemonic;
            // Handle a valid mnemonic index.
            if (mn >= 0 && mn < label.length) {
                if (label[mn].toUpperCase() === upperKey) {
                    if (index === -1) {
                        index = k;
                    }
                    else {
                        multiple = true;
                    }
                }
                continue;
            }
            // Finally, handle the auto index if possible.
            if (auto === -1 && label[0].toUpperCase() === upperKey) {
                auto = k;
            }
        }
        // Return the search results.
        return { index, multiple, auto };
    }
    Private.findMnemonic = findMnemonic;
    /**
     * A concrete implementation of `Menu.IItem`.
     */
    class MenuItem {
        /**
         * Construct a new menu item.
         */
        constructor(commands, options) {
            this._commands = commands;
            this.type = options.type || 'command';
            this.command = options.command || '';
            this.args = options.args || _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.emptyObject;
            this.submenu = options.submenu || null;
        }
        /**
         * The display label for the menu item.
         */
        get label() {
            if (this.type === 'command') {
                return this._commands.label(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.label;
            }
            return '';
        }
        /**
         * The mnemonic index for the menu item.
         */
        get mnemonic() {
            if (this.type === 'command') {
                return this._commands.mnemonic(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.mnemonic;
            }
            return -1;
        }
        /**
         * The icon renderer for the menu item.
         */
        get icon() {
            if (this.type === 'command') {
                return this._commands.icon(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.icon;
            }
            return undefined;
        }
        /**
         * The icon class for the menu item.
         */
        get iconClass() {
            if (this.type === 'command') {
                return this._commands.iconClass(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.iconClass;
            }
            return '';
        }
        /**
         * The icon label for the menu item.
         */
        get iconLabel() {
            if (this.type === 'command') {
                return this._commands.iconLabel(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.iconLabel;
            }
            return '';
        }
        /**
         * The display caption for the menu item.
         */
        get caption() {
            if (this.type === 'command') {
                return this._commands.caption(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.caption;
            }
            return '';
        }
        /**
         * The extra class name for the menu item.
         */
        get className() {
            if (this.type === 'command') {
                return this._commands.className(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.className;
            }
            return '';
        }
        /**
         * The dataset for the menu item.
         */
        get dataset() {
            if (this.type === 'command') {
                return this._commands.dataset(this.command, this.args);
            }
            if (this.type === 'submenu' && this.submenu) {
                return this.submenu.title.dataset;
            }
            return {};
        }
        /**
         * Whether the menu item is enabled.
         */
        get isEnabled() {
            if (this.type === 'command') {
                return this._commands.isEnabled(this.command, this.args);
            }
            if (this.type === 'submenu') {
                return this.submenu !== null;
            }
            return true;
        }
        /**
         * Whether the menu item is toggled.
         */
        get isToggled() {
            if (this.type === 'command') {
                return this._commands.isToggled(this.command, this.args);
            }
            return false;
        }
        /**
         * Whether the menu item is visible.
         */
        get isVisible() {
            if (this.type === 'command') {
                return this._commands.isVisible(this.command, this.args);
            }
            if (this.type === 'submenu') {
                return this.submenu !== null;
            }
            return true;
        }
        /**
         * The key binding for the menu item.
         */
        get keyBinding() {
            if (this.type === 'command') {
                let { command, args } = this;
                return (_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findLastValue(this._commands.keyBindings, kb => {
                    return kb.command === command && _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.JSONExt.deepEqual(kb.args, args);
                }) || null);
            }
            return null;
        }
    }
})(Private$9 || (Private$9 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * An object which implements a universal context menu.
 *
 * #### Notes
 * The items shown in the context menu are determined by CSS selector
 * matching against the DOM hierarchy at the site of the mouse click.
 * This is similar in concept to how keyboard shortcuts are matched
 * in the command registry.
 */
class ContextMenu {
    /**
     * Construct a new context menu.
     *
     * @param options - The options for initializing the menu.
     */
    constructor(options) {
        this._groupByTarget = true;
        this._idTick = 0;
        this._items = [];
        this._sortBySelector = true;
        const { groupByTarget, sortBySelector, ...others } = options;
        this.menu = new Menu(others);
        this._groupByTarget = groupByTarget !== false;
        this._sortBySelector = sortBySelector !== false;
    }
    /**
     * Add an item to the context menu.
     *
     * @param options - The options for creating the item.
     *
     * @returns A disposable which will remove the item from the menu.
     */
    addItem(options) {
        // Create an item from the given options.
        let item = Private$8.createItem(options, this._idTick++);
        // Add the item to the internal array.
        this._items.push(item);
        // Return a disposable which will remove the item.
        return new _lumino_disposable__WEBPACK_IMPORTED_MODULE_9__.DisposableDelegate(() => {
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeFirstOf(this._items, item);
        });
    }
    /**
     * Open the context menu in response to a `'contextmenu'` event.
     *
     * @param event - The `'contextmenu'` event of interest.
     *
     * @returns `true` if the menu was opened, or `false` if no items
     *   matched the event and the menu was not opened.
     *
     * #### Notes
     * This method will populate the context menu with items which match
     * the propagation path of the event, then open the menu at the mouse
     * position indicated by the event.
     */
    open(event) {
        // Prior to any DOM modifications update the window data.
        Menu.saveWindowData();
        // Clear the current contents of the context menu.
        this.menu.clearItems();
        // Bail early if there are no items to match.
        if (this._items.length === 0) {
            return false;
        }
        // Find the matching items for the event.
        let items = Private$8.matchItems(this._items, event, this._groupByTarget, this._sortBySelector);
        // Bail if there are no matching items.
        if (!items || items.length === 0) {
            return false;
        }
        // Add the filtered items to the menu.
        for (const item of items) {
            this.menu.addItem(item);
        }
        // Open the context menu at the current mouse position.
        this.menu.open(event.clientX, event.clientY);
        // Indicate success.
        return true;
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private$8;
(function (Private) {
    /**
     * Create a normalized context menu item from an options object.
     */
    function createItem(options, id) {
        let selector = validateSelector(options.selector);
        let rank = options.rank !== undefined ? options.rank : Infinity;
        return { ...options, selector, rank, id };
    }
    Private.createItem = createItem;
    /**
     * Find the items which match a context menu event.
     *
     * The results are sorted by DOM level, specificity, and rank.
     */
    function matchItems(items, event, groupByTarget, sortBySelector) {
        // Look up the target of the event.
        let target = event.target;
        // Bail if there is no target.
        if (!target) {
            return null;
        }
        // Look up the current target of the event.
        let currentTarget = event.currentTarget;
        // Bail if there is no current target.
        if (!currentTarget) {
            return null;
        }
        // There are some third party libraries that cause the `target` to
        // be detached from the DOM before lumino can process the event.
        // If that happens, search for a new target node by point. If that
        // node is still dangling, bail.
        if (!currentTarget.contains(target)) {
            target = document.elementFromPoint(event.clientX, event.clientY);
            if (!target || !currentTarget.contains(target)) {
                return null;
            }
        }
        // Set up the result array.
        let result = [];
        // Copy the items array to allow in-place modification.
        let availableItems = items.slice();
        // Walk up the DOM hierarchy searching for matches.
        while (target !== null) {
            // Set up the match array for this DOM level.
            let matches = [];
            // Search the remaining items for matches.
            for (let i = 0, n = availableItems.length; i < n; ++i) {
                // Fetch the item.
                let item = availableItems[i];
                // Skip items which are already consumed.
                if (!item) {
                    continue;
                }
                // Skip items which do not match the element.
                if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Selector.matches(target, item.selector)) {
                    continue;
                }
                // Add the matched item to the result for this DOM level.
                matches.push(item);
                // Mark the item as consumed.
                availableItems[i] = null;
            }
            // Sort the matches for this level and add them to the results.
            if (matches.length !== 0) {
                if (groupByTarget) {
                    matches.sort(sortBySelector ? itemCmp : itemCmpRank);
                }
                result.push(...matches);
            }
            // Stop searching at the limits of the DOM range.
            if (target === currentTarget) {
                break;
            }
            // Step to the parent DOM level.
            target = target.parentElement;
        }
        if (!groupByTarget) {
            result.sort(sortBySelector ? itemCmp : itemCmpRank);
        }
        // Return the matched and sorted results.
        return result;
    }
    Private.matchItems = matchItems;
    /**
     * Validate the selector for a menu item.
     *
     * This returns the validated selector, or throws if the selector is
     * invalid or contains commas.
     */
    function validateSelector(selector) {
        if (selector.indexOf(',') !== -1) {
            throw new Error(`Selector cannot contain commas: ${selector}`);
        }
        if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Selector.isValid(selector)) {
            throw new Error(`Invalid selector: ${selector}`);
        }
        return selector;
    }
    /**
     * A sort comparison function for a context menu item by ranks.
     */
    function itemCmpRank(a, b) {
        // Sort based on rank.
        let r1 = a.rank;
        let r2 = b.rank;
        if (r1 !== r2) {
            return r1 < r2 ? -1 : 1; // Infinity-safe
        }
        // When all else fails, sort by item id.
        return a.id - b.id;
    }
    /**
     * A sort comparison function for a context menu item by selectors and ranks.
     */
    function itemCmp(a, b) {
        // Sort first based on selector specificity.
        let s1 = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Selector.calculateSpecificity(a.selector);
        let s2 = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Selector.calculateSpecificity(b.selector);
        if (s1 !== s2) {
            return s2 - s1;
        }
        // If specificities are equal
        return itemCmpRank(a, b);
    }
})(Private$8 || (Private$8 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
const ARROW_KEYS = [
    'ArrowLeft',
    'ArrowUp',
    'ArrowRight',
    'ArrowDown',
    'Home',
    'End'
];
/**
 * A widget which displays titles as a single row or column of tabs.
 *
 * #### Notes
 * If CSS transforms are used to rotate nodes for vertically oriented
 * text, then tab dragging will not work correctly. The `tabsMovable`
 * property should be set to `false` when rotating nodes from CSS.
 */
class TabBar extends Widget {
    /**
     * Construct a new tab bar.
     *
     * @param options - The options for initializing the tab bar.
     */
    constructor(options = {}) {
        super({ node: Private$7.createNode() });
        this._currentIndex = -1;
        this._titles = [];
        this._titlesEditable = false;
        this._previousTitle = null;
        this._dragData = null;
        this._addButtonEnabled = false;
        this._tabMoved = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._currentChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._addRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._tabCloseRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._tabDetachRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._tabActivateRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this.addClass('lm-TabBar');
        this.contentNode.setAttribute('role', 'tablist');
        this.setFlag(Widget.Flag.DisallowLayout);
        this._document = options.document || document;
        this.tabsMovable = options.tabsMovable || false;
        this.titlesEditable = options.titlesEditable || false;
        this.allowDeselect = options.allowDeselect || false;
        this.addButtonEnabled = options.addButtonEnabled || false;
        this.insertBehavior = options.insertBehavior || 'select-tab-if-needed';
        this.name = options.name || '';
        this.orientation = options.orientation || 'horizontal';
        this.removeBehavior = options.removeBehavior || 'select-tab-after';
        this.renderer = options.renderer || TabBar.defaultRenderer;
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        this._releaseMouse();
        this._titles.length = 0;
        this._previousTitle = null;
        super.dispose();
    }
    /**
     * A signal emitted when the current tab is changed.
     *
     * #### Notes
     * This signal is emitted when the currently selected tab is changed
     * either through user or programmatic interaction.
     *
     * Notably, this signal is not emitted when the index of the current
     * tab changes due to tabs being inserted, removed, or moved. It is
     * only emitted when the actual current tab node is changed.
     */
    get currentChanged() {
        return this._currentChanged;
    }
    /**
     * A signal emitted when a tab is moved by the user.
     *
     * #### Notes
     * This signal is emitted when a tab is moved by user interaction.
     *
     * This signal is not emitted when a tab is moved programmatically.
     */
    get tabMoved() {
        return this._tabMoved;
    }
    /**
     * A signal emitted when a tab is clicked by the user.
     *
     * #### Notes
     * If the clicked tab is not the current tab, the clicked tab will be
     * made current and the `currentChanged` signal will be emitted first.
     *
     * This signal is emitted even if the clicked tab is the current tab.
     */
    get tabActivateRequested() {
        return this._tabActivateRequested;
    }
    /**
     * A signal emitted when the tab bar add button is clicked.
     */
    get addRequested() {
        return this._addRequested;
    }
    /**
     * A signal emitted when a tab close icon is clicked.
     *
     * #### Notes
     * This signal is not emitted unless the tab title is `closable`.
     */
    get tabCloseRequested() {
        return this._tabCloseRequested;
    }
    /**
     * A signal emitted when a tab is dragged beyond the detach threshold.
     *
     * #### Notes
     * This signal is emitted when the user drags a tab with the mouse,
     * and mouse is dragged beyond the detach threshold.
     *
     * The consumer of the signal should call `releaseMouse` and remove
     * the tab in order to complete the detach.
     *
     * This signal is only emitted once per drag cycle.
     */
    get tabDetachRequested() {
        return this._tabDetachRequested;
    }
    /**
     * The document to use with the tab bar.
     *
     * The default is the global `document` instance.
     */
    get document() {
        return this._document;
    }
    /**
     * Whether the titles can be user-edited.
     *
     */
    get titlesEditable() {
        return this._titlesEditable;
    }
    /**
     * Set whether titles can be user edited.
     *
     */
    set titlesEditable(value) {
        this._titlesEditable = value;
    }
    /**
     * Get the currently selected title.
     *
     * #### Notes
     * This will be `null` if no tab is selected.
     */
    get currentTitle() {
        return this._titles[this._currentIndex] || null;
    }
    /**
     * Set the currently selected title.
     *
     * #### Notes
     * If the title does not exist, the title will be set to `null`.
     */
    set currentTitle(value) {
        this.currentIndex = value ? this._titles.indexOf(value) : -1;
    }
    /**
     * Get the index of the currently selected tab.
     *
     * #### Notes
     * This will be `-1` if no tab is selected.
     */
    get currentIndex() {
        return this._currentIndex;
    }
    /**
     * Set the index of the currently selected tab.
     *
     * #### Notes
     * If the value is out of range, the index will be set to `-1`.
     */
    set currentIndex(value) {
        // Adjust for an out of range index.
        if (value < 0 || value >= this._titles.length) {
            value = -1;
        }
        // Bail early if the index will not change.
        if (this._currentIndex === value) {
            return;
        }
        // Look up the previous index and title.
        let pi = this._currentIndex;
        let pt = this._titles[pi] || null;
        // Look up the current index and title.
        let ci = value;
        let ct = this._titles[ci] || null;
        // Update the current index and previous title.
        this._currentIndex = ci;
        this._previousTitle = pt;
        // Schedule an update of the tabs.
        this.update();
        // Emit the current changed signal.
        this._currentChanged.emit({
            previousIndex: pi,
            previousTitle: pt,
            currentIndex: ci,
            currentTitle: ct
        });
    }
    /**
     * Get the name of the tab bar.
     */
    get name() {
        return this._name;
    }
    /**
     * Set the name of the tab bar.
     */
    set name(value) {
        this._name = value;
        if (value) {
            this.contentNode.setAttribute('aria-label', value);
        }
        else {
            this.contentNode.removeAttribute('aria-label');
        }
    }
    /**
     * Get the orientation of the tab bar.
     *
     * #### Notes
     * This controls whether the tabs are arranged in a row or column.
     */
    get orientation() {
        return this._orientation;
    }
    /**
     * Set the orientation of the tab bar.
     *
     * #### Notes
     * This controls whether the tabs are arranged in a row or column.
     */
    set orientation(value) {
        // Do nothing if the orientation does not change.
        if (this._orientation === value) {
            return;
        }
        // Release the mouse before making any changes.
        this._releaseMouse();
        // Toggle the orientation values.
        this._orientation = value;
        this.dataset['orientation'] = value;
        this.contentNode.setAttribute('aria-orientation', value);
    }
    /**
     * Whether the add button is enabled.
     */
    get addButtonEnabled() {
        return this._addButtonEnabled;
    }
    /**
     * Set whether the add button is enabled.
     */
    set addButtonEnabled(value) {
        // Do nothing if the value does not change.
        if (this._addButtonEnabled === value) {
            return;
        }
        this._addButtonEnabled = value;
        if (value) {
            this.addButtonNode.classList.remove('lm-mod-hidden');
        }
        else {
            this.addButtonNode.classList.add('lm-mod-hidden');
        }
    }
    /**
     * A read-only array of the titles in the tab bar.
     */
    get titles() {
        return this._titles;
    }
    /**
     * The tab bar content node.
     *
     * #### Notes
     * This is the node which holds the tab nodes.
     *
     * Modifying this node directly can lead to undefined behavior.
     */
    get contentNode() {
        return this.node.getElementsByClassName('lm-TabBar-content')[0];
    }
    /**
     * The tab bar add button node.
     *
     * #### Notes
     * This is the node which holds the add button.
     *
     * Modifying this node directly can lead to undefined behavior.
     */
    get addButtonNode() {
        return this.node.getElementsByClassName('lm-TabBar-addButton')[0];
    }
    /**
     * Add a tab to the end of the tab bar.
     *
     * @param value - The title which holds the data for the tab,
     *   or an options object to convert to a title.
     *
     * @returns The title object added to the tab bar.
     *
     * #### Notes
     * If the title is already added to the tab bar, it will be moved.
     */
    addTab(value) {
        return this.insertTab(this._titles.length, value);
    }
    /**
     * Insert a tab into the tab bar at the specified index.
     *
     * @param index - The index at which to insert the tab.
     *
     * @param value - The title which holds the data for the tab,
     *   or an options object to convert to a title.
     *
     * @returns The title object added to the tab bar.
     *
     * #### Notes
     * The index will be clamped to the bounds of the tabs.
     *
     * If the title is already added to the tab bar, it will be moved.
     */
    insertTab(index, value) {
        // Release the mouse before making any changes.
        this._releaseMouse();
        // Coerce the value to a title.
        let title = Private$7.asTitle(value);
        // Look up the index of the title.
        let i = this._titles.indexOf(title);
        // Clamp the insert index to the array bounds.
        let j = Math.max(0, Math.min(index, this._titles.length));
        // If the title is not in the array, insert it.
        if (i === -1) {
            // Insert the title into the array.
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._titles, j, title);
            // Connect to the title changed signal.
            title.changed.connect(this._onTitleChanged, this);
            // Schedule an update of the tabs.
            this.update();
            // Adjust the current index for the insert.
            this._adjustCurrentForInsert(j, title);
            // Return the title added to the tab bar.
            return title;
        }
        // Otherwise, the title exists in the array and should be moved.
        // Adjust the index if the location is at the end of the array.
        if (j === this._titles.length) {
            j--;
        }
        // Bail if there is no effective move.
        if (i === j) {
            return title;
        }
        // Move the title to the new location.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._titles, i, j);
        // Schedule an update of the tabs.
        this.update();
        // Adjust the current index for the move.
        this._adjustCurrentForMove(i, j);
        // Return the title added to the tab bar.
        return title;
    }
    /**
     * Remove a tab from the tab bar.
     *
     * @param title - The title for the tab to remove.
     *
     * #### Notes
     * This is a no-op if the title is not in the tab bar.
     */
    removeTab(title) {
        this.removeTabAt(this._titles.indexOf(title));
    }
    /**
     * Remove the tab at a given index from the tab bar.
     *
     * @param index - The index of the tab to remove.
     *
     * #### Notes
     * This is a no-op if the index is out of range.
     */
    removeTabAt(index) {
        // Release the mouse before making any changes.
        this._releaseMouse();
        // Remove the title from the array.
        let title = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._titles, index);
        // Bail if the index is out of range.
        if (!title) {
            return;
        }
        // Disconnect from the title changed signal.
        title.changed.disconnect(this._onTitleChanged, this);
        // Clear the previous title if it's being removed.
        if (title === this._previousTitle) {
            this._previousTitle = null;
        }
        // Schedule an update of the tabs.
        this.update();
        // Adjust the current index for the remove.
        this._adjustCurrentForRemove(index, title);
    }
    /**
     * Remove all tabs from the tab bar.
     */
    clearTabs() {
        // Bail if there is nothing to remove.
        if (this._titles.length === 0) {
            return;
        }
        // Release the mouse before making any changes.
        this._releaseMouse();
        // Disconnect from the title changed signals.
        for (let title of this._titles) {
            title.changed.disconnect(this._onTitleChanged, this);
        }
        // Get the current index and title.
        let pi = this.currentIndex;
        let pt = this.currentTitle;
        // Reset the current index and previous title.
        this._currentIndex = -1;
        this._previousTitle = null;
        // Clear the title array.
        this._titles.length = 0;
        // Schedule an update of the tabs.
        this.update();
        // If no tab was selected, there's nothing else to do.
        if (pi === -1) {
            return;
        }
        // Emit the current changed signal.
        this._currentChanged.emit({
            previousIndex: pi,
            previousTitle: pt,
            currentIndex: -1,
            currentTitle: null
        });
    }
    /**
     * Release the mouse and restore the non-dragged tab positions.
     *
     * #### Notes
     * This will cause the tab bar to stop handling mouse events and to
     * restore the tabs to their non-dragged positions.
     */
    releaseMouse() {
        this._releaseMouse();
    }
    /**
     * Handle the DOM events for the tab bar.
     *
     * @param event - The DOM event sent to the tab bar.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the tab bar's DOM node.
     *
     * This should not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'pointerdown':
                this._evtPointerDown(event);
                break;
            case 'pointermove':
                this._evtPointerMove(event);
                break;
            case 'pointerup':
                this._evtPointerUp(event);
                break;
            case 'dblclick':
                this._evtDblClick(event);
                break;
            case 'keydown':
                event.eventPhase === Event.CAPTURING_PHASE
                    ? this._evtKeyDownCapturing(event)
                    : this._evtKeyDown(event);
                break;
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('pointerdown', this);
        this.node.addEventListener('dblclick', this);
        this.node.addEventListener('keydown', this);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('pointerdown', this);
        this.node.removeEventListener('dblclick', this);
        this.node.removeEventListener('keydown', this);
        this._releaseMouse();
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        var _a;
        let titles = this._titles;
        let renderer = this.renderer;
        let currentTitle = this.currentTitle;
        let content = new Array(titles.length);
        // Keep the tabindex="0" attribute to the tab which handled it before the update.
        // If the add button handles it, no need to do anything. If no element of the tab
        // bar handles it, set it on the current or the first tab to ensure one element
        // handles it after update.
        const tabHandlingTabindex = (_a = this._getCurrentTabindex()) !== null && _a !== void 0 ? _a : (this._currentIndex > -1 ? this._currentIndex : 0);
        for (let i = 0, n = titles.length; i < n; ++i) {
            let title = titles[i];
            let current = title === currentTitle;
            let zIndex = current ? n : n - i - 1;
            let tabIndex = tabHandlingTabindex === i ? 0 : -1;
            content[i] = renderer.renderTab({ title, current, zIndex, tabIndex });
        }
        _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.render(content, this.contentNode);
    }
    /**
     * Get the index of the tab which handles tabindex="0".
     * If the add button handles tabindex="0", -1 is returned.
     * If none of the previous handles tabindex="0", null is returned.
     */
    _getCurrentTabindex() {
        let index = null;
        const elemTabindex = this.contentNode.querySelector('li[tabindex="0"]');
        if (elemTabindex) {
            index = [...this.contentNode.children].indexOf(elemTabindex);
        }
        else if (this._addButtonEnabled &&
            this.addButtonNode.getAttribute('tabindex') === '0') {
            index = -1;
        }
        return index;
    }
    /**
     * Handle the `'dblclick'` event for the tab bar.
     */
    _evtDblClick(event) {
        // Do nothing if titles are not editable
        if (!this.titlesEditable) {
            return;
        }
        let tabs = this.contentNode.children;
        // Find the index of the targeted tab.
        let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(tabs, tab => {
            return _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(tab, event.clientX, event.clientY);
        });
        // Do nothing if the press is not on a tab.
        if (index === -1) {
            return;
        }
        let title = this.titles[index];
        let label = tabs[index].querySelector('.lm-TabBar-tabLabel');
        if (label && label.contains(event.target)) {
            let value = title.label || '';
            // Clear the label element
            let oldValue = label.innerHTML;
            label.innerHTML = '';
            let input = document.createElement('input');
            input.classList.add('lm-TabBar-tabInput');
            input.value = value;
            label.appendChild(input);
            let onblur = () => {
                input.removeEventListener('blur', onblur);
                label.innerHTML = oldValue;
                this.node.addEventListener('keydown', this);
            };
            input.addEventListener('dblclick', (event) => event.stopPropagation());
            input.addEventListener('blur', onblur);
            input.addEventListener('keydown', (event) => {
                if (event.key === 'Enter') {
                    if (input.value !== '') {
                        title.label = title.caption = input.value;
                    }
                    onblur();
                }
                else if (event.key === 'Escape') {
                    onblur();
                }
            });
            this.node.removeEventListener('keydown', this);
            input.select();
            input.focus();
            if (label.children.length > 0) {
                label.children[0].focus();
            }
        }
    }
    /**
     * Handle the `'keydown'` event for the tab bar at capturing phase.
     */
    _evtKeyDownCapturing(event) {
        if (event.eventPhase !== Event.CAPTURING_PHASE) {
            return;
        }
        // Stop all input events during drag.
        event.preventDefault();
        event.stopPropagation();
        // Release the mouse if `Escape` is pressed.
        if (event.key === 'Escape') {
            this._releaseMouse();
        }
    }
    /**
     * Handle the `'keydown'` event for the tab bar at target phase.
     */
    _evtKeyDown(event) {
        var _a, _b, _c;
        // Allow for navigation using tab key
        if (event.key === 'Tab' || event.eventPhase === Event.CAPTURING_PHASE) {
            return;
        }
        // Check if Enter or Spacebar key has been pressed and open that tab
        if (event.key === 'Enter' ||
            event.key === 'Spacebar' ||
            event.key === ' ') {
            // Get focus element that is in focus by the tab key
            const focusedElement = document.activeElement;
            // Test first if the focus is on the add button node
            if (this.addButtonEnabled &&
                this.addButtonNode.contains(focusedElement)) {
                event.preventDefault();
                event.stopPropagation();
                this._addRequested.emit();
            }
            else {
                const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.contentNode.children, tab => tab.contains(focusedElement));
                if (index >= 0) {
                    event.preventDefault();
                    event.stopPropagation();
                    this.currentIndex = index;
                }
            }
            // Handle the arrow keys to switch tabs.
        }
        else if (ARROW_KEYS.includes(event.key)) {
            // Create a list of all focusable elements in the tab bar.
            const focusable = [...this.contentNode.children];
            if (this.addButtonEnabled) {
                focusable.push(this.addButtonNode);
            }
            // If the tab bar contains only one element, nothing to do.
            if (focusable.length <= 1) {
                return;
            }
            event.preventDefault();
            event.stopPropagation();
            // Get the current focused element.
            let focusedIndex = focusable.indexOf(document.activeElement);
            if (focusedIndex === -1) {
                focusedIndex = this._currentIndex;
            }
            // Find the next element to focus on.
            let nextFocused;
            if ((event.key === 'ArrowRight' && this._orientation === 'horizontal') ||
                (event.key === 'ArrowDown' && this._orientation === 'vertical')) {
                nextFocused = (_a = focusable[focusedIndex + 1]) !== null && _a !== void 0 ? _a : focusable[0];
            }
            else if ((event.key === 'ArrowLeft' && this._orientation === 'horizontal') ||
                (event.key === 'ArrowUp' && this._orientation === 'vertical')) {
                nextFocused =
                    (_b = focusable[focusedIndex - 1]) !== null && _b !== void 0 ? _b : focusable[focusable.length - 1];
            }
            else if (event.key === 'Home') {
                nextFocused = focusable[0];
            }
            else if (event.key === 'End') {
                nextFocused = focusable[focusable.length - 1];
            }
            // Change the focused element and the tabindex value.
            if (nextFocused) {
                (_c = focusable[focusedIndex]) === null || _c === void 0 ? void 0 : _c.setAttribute('tabindex', '-1');
                nextFocused === null || nextFocused === void 0 ? void 0 : nextFocused.setAttribute('tabindex', '0');
                nextFocused.focus();
            }
        }
    }
    /**
     * Handle the `'pointerdown'` event for the tab bar.
     */
    _evtPointerDown(event) {
        // Do nothing if it's not a left or middle mouse press.
        if (event.button !== 0 && event.button !== 1) {
            return;
        }
        // Do nothing if a drag is in progress.
        if (this._dragData) {
            return;
        }
        // Do nothing if a title editable input was clicked.
        if (event.target.classList.contains('lm-TabBar-tabInput')) {
            return;
        }
        // Check if the add button was clicked.
        let addButtonClicked = this.addButtonEnabled &&
            this.addButtonNode.contains(event.target);
        // Lookup the tab nodes.
        let tabs = this.contentNode.children;
        // Find the index of the pressed tab.
        let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(tabs, tab => {
            return _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(tab, event.clientX, event.clientY);
        });
        // Do nothing if the press is not on a tab or the add button.
        if (index === -1 && !addButtonClicked) {
            return;
        }
        // Pressing on a tab stops the event propagation.
        event.preventDefault();
        event.stopPropagation();
        // Initialize the non-measured parts of the drag data.
        this._dragData = {
            tab: tabs[index],
            index: index,
            pressX: event.clientX,
            pressY: event.clientY,
            tabPos: -1,
            tabSize: -1,
            tabPressPos: -1,
            targetIndex: -1,
            tabLayout: null,
            contentRect: null,
            override: null,
            dragActive: false,
            dragAborted: false,
            detachRequested: false
        };
        // Add the document pointer up listener.
        this.document.addEventListener('pointerup', this, true);
        // Do nothing else if the middle button or add button is clicked.
        if (event.button === 1 || addButtonClicked) {
            return;
        }
        // Do nothing else if the close icon is clicked.
        let icon = tabs[index].querySelector(this.renderer.closeIconSelector);
        if (icon && icon.contains(event.target)) {
            return;
        }
        // Add the extra listeners if the tabs are movable.
        if (this.tabsMovable) {
            this.document.addEventListener('pointermove', this, true);
            this.document.addEventListener('keydown', this, true);
            this.document.addEventListener('contextmenu', this, true);
        }
        // Update the current index as appropriate.
        if (this.allowDeselect && this.currentIndex === index) {
            this.currentIndex = -1;
        }
        else {
            this.currentIndex = index;
        }
        // Do nothing else if there is no current tab.
        if (this.currentIndex === -1) {
            return;
        }
        // Emit the tab activate request signal.
        this._tabActivateRequested.emit({
            index: this.currentIndex,
            title: this.currentTitle
        });
    }
    /**
     * Handle the `'pointermove'` event for the tab bar.
     */
    _evtPointerMove(event) {
        // Do nothing if no drag is in progress.
        let data = this._dragData;
        if (!data) {
            return;
        }
        // Suppress the event during a drag.
        event.preventDefault();
        event.stopPropagation();
        // Lookup the tab nodes.
        let tabs = this.contentNode.children;
        // Bail early if the drag threshold has not been met.
        if (!data.dragActive && !Private$7.dragExceeded(data, event)) {
            return;
        }
        // Activate the drag if necessary.
        if (!data.dragActive) {
            // Fill in the rest of the drag data measurements.
            let tabRect = data.tab.getBoundingClientRect();
            if (this._orientation === 'horizontal') {
                data.tabPos = data.tab.offsetLeft;
                data.tabSize = tabRect.width;
                data.tabPressPos = data.pressX - tabRect.left;
            }
            else {
                data.tabPos = data.tab.offsetTop;
                data.tabSize = tabRect.height;
                data.tabPressPos = data.pressY - tabRect.top;
            }
            data.tabPressOffset = {
                x: data.pressX - tabRect.left,
                y: data.pressY - tabRect.top
            };
            data.tabLayout = Private$7.snapTabLayout(tabs, this._orientation);
            data.contentRect = this.contentNode.getBoundingClientRect();
            data.override = _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6__.Drag.overrideCursor('default');
            // Add the dragging style classes.
            data.tab.classList.add('lm-mod-dragging');
            this.addClass('lm-mod-dragging');
            // Mark the drag as active.
            data.dragActive = true;
        }
        // Emit the detach requested signal if the threshold is exceeded.
        if (!data.detachRequested && Private$7.detachExceeded(data, event)) {
            // Only emit the signal once per drag cycle.
            data.detachRequested = true;
            // Setup the arguments for the signal.
            let index = data.index;
            let clientX = event.clientX;
            let clientY = event.clientY;
            let tab = tabs[index];
            let title = this._titles[index];
            // Emit the tab detach requested signal.
            this._tabDetachRequested.emit({
                index,
                title,
                tab,
                clientX,
                clientY,
                offset: data.tabPressOffset
            });
            // Bail if the signal handler aborted the drag.
            if (data.dragAborted) {
                return;
            }
        }
        // Update the positions of the tabs.
        Private$7.layoutTabs(tabs, data, event, this._orientation);
    }
    /**
     * Handle the `'pointerup'` event for the document.
     */
    _evtPointerUp(event) {
        // Do nothing if it's not a left or middle mouse release.
        if (event.button !== 0 && event.button !== 1) {
            return;
        }
        // Do nothing if no drag is in progress.
        const data = this._dragData;
        if (!data) {
            return;
        }
        // Stop the event propagation.
        event.preventDefault();
        event.stopPropagation();
        // Remove the extra mouse event listeners.
        this.document.removeEventListener('pointermove', this, true);
        this.document.removeEventListener('pointerup', this, true);
        this.document.removeEventListener('keydown', this, true);
        this.document.removeEventListener('contextmenu', this, true);
        // Handle a release when the drag is not active.
        if (!data.dragActive) {
            // Clear the drag data.
            this._dragData = null;
            // Handle clicking the add button.
            let addButtonClicked = this.addButtonEnabled &&
                this.addButtonNode.contains(event.target);
            if (addButtonClicked) {
                this._addRequested.emit(undefined);
                return;
            }
            // Lookup the tab nodes.
            let tabs = this.contentNode.children;
            // Find the index of the released tab.
            let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(tabs, tab => {
                return _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(tab, event.clientX, event.clientY);
            });
            // Do nothing if the release is not on the original pressed tab.
            if (index !== data.index) {
                return;
            }
            // Ignore the release if the title is not closable.
            let title = this._titles[index];
            if (!title.closable) {
                return;
            }
            // Emit the close requested signal if the middle button is released.
            if (event.button === 1) {
                this._tabCloseRequested.emit({ index, title });
                return;
            }
            // Emit the close requested signal if the close icon was released.
            let icon = tabs[index].querySelector(this.renderer.closeIconSelector);
            if (icon && icon.contains(event.target)) {
                this._tabCloseRequested.emit({ index, title });
                return;
            }
            // Otherwise, there is nothing left to do.
            return;
        }
        // Do nothing if the left button is not released.
        if (event.button !== 0) {
            return;
        }
        // Position the tab at its final resting position.
        Private$7.finalizeTabPosition(data, this._orientation);
        // Remove the dragging class from the tab so it can be transitioned.
        data.tab.classList.remove('lm-mod-dragging');
        // Parse the transition duration for releasing the tab.
        let duration = Private$7.parseTransitionDuration(data.tab);
        // Complete the release on a timer to allow the tab to transition.
        setTimeout(() => {
            // Do nothing if the drag has been aborted.
            if (data.dragAborted) {
                return;
            }
            // Clear the drag data reference.
            this._dragData = null;
            // Reset the positions of the tabs.
            Private$7.resetTabPositions(this.contentNode.children, this._orientation);
            // Clear the cursor grab.
            data.override.dispose();
            // Remove the remaining dragging style.
            this.removeClass('lm-mod-dragging');
            // If the tab was not moved, there is nothing else to do.
            let i = data.index;
            let j = data.targetIndex;
            if (j === -1 || i === j) {
                return;
            }
            // Move the title to the new locations.
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._titles, i, j);
            // Adjust the current index for the move.
            this._adjustCurrentForMove(i, j);
            // Emit the tab moved signal.
            this._tabMoved.emit({
                fromIndex: i,
                toIndex: j,
                title: this._titles[j]
            });
            // Update the tabs immediately to prevent flicker.
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest);
        }, duration);
    }
    /**
     * Release the mouse and restore the non-dragged tab positions.
     */
    _releaseMouse() {
        // Do nothing if no drag is in progress.
        let data = this._dragData;
        if (!data) {
            return;
        }
        // Clear the drag data reference.
        this._dragData = null;
        // Remove the extra document event listeners.
        this.document.removeEventListener('pointermove', this, true);
        this.document.removeEventListener('pointerup', this, true);
        this.document.removeEventListener('keydown', this, true);
        this.document.removeEventListener('contextmenu', this, true);
        // Indicate the drag has been aborted. This allows the mouse
        // event handlers to return early when the drag is canceled.
        data.dragAborted = true;
        // If the drag is not active, there's nothing more to do.
        if (!data.dragActive) {
            return;
        }
        // Reset the tabs to their non-dragged positions.
        Private$7.resetTabPositions(this.contentNode.children, this._orientation);
        // Clear the cursor override.
        data.override.dispose();
        // Clear the dragging style classes.
        data.tab.classList.remove('lm-mod-dragging');
        this.removeClass('lm-mod-dragging');
    }
    /**
     * Adjust the current index for a tab insert operation.
     *
     * This method accounts for the tab bar's insertion behavior when
     * adjusting the current index and emitting the changed signal.
     */
    _adjustCurrentForInsert(i, title) {
        // Lookup commonly used variables.
        let ct = this.currentTitle;
        let ci = this._currentIndex;
        let bh = this.insertBehavior;
        // TODO: do we need to do an update to update the aria-selected attribute?
        // Handle the behavior where the new tab is always selected,
        // or the behavior where the new tab is selected if needed.
        if (bh === 'select-tab' || (bh === 'select-tab-if-needed' && ci === -1)) {
            this._currentIndex = i;
            this._previousTitle = ct;
            this._currentChanged.emit({
                previousIndex: ci,
                previousTitle: ct,
                currentIndex: i,
                currentTitle: title
            });
            return;
        }
        // Otherwise, silently adjust the current index if needed.
        if (ci >= i) {
            this._currentIndex++;
        }
    }
    /**
     * Adjust the current index for a tab move operation.
     *
     * This method will not cause the actual current tab to change.
     * It silently adjusts the index to account for the given move.
     */
    _adjustCurrentForMove(i, j) {
        if (this._currentIndex === i) {
            this._currentIndex = j;
        }
        else if (this._currentIndex < i && this._currentIndex >= j) {
            this._currentIndex++;
        }
        else if (this._currentIndex > i && this._currentIndex <= j) {
            this._currentIndex--;
        }
    }
    /**
     * Adjust the current index for a tab remove operation.
     *
     * This method accounts for the tab bar's remove behavior when
     * adjusting the current index and emitting the changed signal.
     */
    _adjustCurrentForRemove(i, title) {
        // Lookup commonly used variables.
        let ci = this._currentIndex;
        let bh = this.removeBehavior;
        // Silently adjust the index if the current tab is not removed.
        if (ci !== i) {
            if (ci > i) {
                this._currentIndex--;
            }
            return;
        }
        // TODO: do we need to do an update to adjust the aria-selected value?
        // No tab gets selected if the tab bar is empty.
        if (this._titles.length === 0) {
            this._currentIndex = -1;
            this._currentChanged.emit({
                previousIndex: i,
                previousTitle: title,
                currentIndex: -1,
                currentTitle: null
            });
            return;
        }
        // Handle behavior where the next sibling tab is selected.
        if (bh === 'select-tab-after') {
            this._currentIndex = Math.min(i, this._titles.length - 1);
            this._currentChanged.emit({
                previousIndex: i,
                previousTitle: title,
                currentIndex: this._currentIndex,
                currentTitle: this.currentTitle
            });
            return;
        }
        // Handle behavior where the previous sibling tab is selected.
        if (bh === 'select-tab-before') {
            this._currentIndex = Math.max(0, i - 1);
            this._currentChanged.emit({
                previousIndex: i,
                previousTitle: title,
                currentIndex: this._currentIndex,
                currentTitle: this.currentTitle
            });
            return;
        }
        // Handle behavior where the previous history tab is selected.
        if (bh === 'select-previous-tab') {
            if (this._previousTitle) {
                this._currentIndex = this._titles.indexOf(this._previousTitle);
                this._previousTitle = null;
            }
            else {
                this._currentIndex = Math.min(i, this._titles.length - 1);
            }
            this._currentChanged.emit({
                previousIndex: i,
                previousTitle: title,
                currentIndex: this._currentIndex,
                currentTitle: this.currentTitle
            });
            return;
        }
        // Otherwise, no tab gets selected.
        this._currentIndex = -1;
        this._currentChanged.emit({
            previousIndex: i,
            previousTitle: title,
            currentIndex: -1,
            currentTitle: null
        });
    }
    /**
     * Handle the `changed` signal of a title object.
     */
    _onTitleChanged(sender) {
        this.update();
    }
}
/**
 * The namespace for the `TabBar` class statics.
 */
(function (TabBar) {
    /**
     * The default implementation of `IRenderer`.
     *
     * #### Notes
     * Subclasses are free to reimplement rendering methods as needed.
     */
    class Renderer {
        constructor() {
            /**
             * A selector which matches the close icon node in a tab.
             */
            this.closeIconSelector = '.lm-TabBar-tabCloseIcon';
            this._tabID = 0;
            this._tabKeys = new WeakMap();
            this._uuid = ++Renderer._nInstance;
        }
        /**
         * Render the virtual element for a tab.
         *
         * @param data - The data to use for rendering the tab.
         *
         * @returns A virtual element representing the tab.
         */
        renderTab(data) {
            let title = data.title.caption;
            let key = this.createTabKey(data);
            let id = key;
            let style = this.createTabStyle(data);
            let className = this.createTabClass(data);
            let dataset = this.createTabDataset(data);
            let aria = this.createTabARIA(data);
            if (data.title.closable) {
                return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({ id, key, className, title, style, dataset, ...aria }, this.renderIcon(data), this.renderLabel(data), this.renderCloseIcon(data));
            }
            else {
                return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({ id, key, className, title, style, dataset, ...aria }, this.renderIcon(data), this.renderLabel(data));
            }
        }
        /**
         * Render the icon element for a tab.
         *
         * @param data - The data to use for rendering the tab.
         *
         * @returns A virtual element representing the tab icon.
         */
        renderIcon(data) {
            const { title } = data;
            let className = this.createIconClass(data);
            // If title.icon is undefined, it will be ignored.
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className }, title.icon, title.iconLabel);
        }
        /**
         * Render the label element for a tab.
         *
         * @param data - The data to use for rendering the tab.
         *
         * @returns A virtual element representing the tab label.
         */
        renderLabel(data) {
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-TabBar-tabLabel' }, data.title.label);
        }
        /**
         * Render the close icon element for a tab.
         *
         * @param data - The data to use for rendering the tab.
         *
         * @returns A virtual element representing the tab close icon.
         */
        renderCloseIcon(data) {
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-TabBar-tabCloseIcon' });
        }
        /**
         * Create a unique render key for the tab.
         *
         * @param data - The data to use for the tab.
         *
         * @returns The unique render key for the tab.
         *
         * #### Notes
         * This method caches the key against the tab title the first time
         * the key is generated. This enables efficient rendering of moved
         * tabs and avoids subtle hover style artifacts.
         */
        createTabKey(data) {
            let key = this._tabKeys.get(data.title);
            if (key === undefined) {
                key = `tab-key-${this._uuid}-${this._tabID++}`;
                this._tabKeys.set(data.title, key);
            }
            return key;
        }
        /**
         * Create the inline style object for a tab.
         *
         * @param data - The data to use for the tab.
         *
         * @returns The inline style data for the tab.
         */
        createTabStyle(data) {
            return { zIndex: `${data.zIndex}` };
        }
        /**
         * Create the class name for the tab.
         *
         * @param data - The data to use for the tab.
         *
         * @returns The full class name for the tab.
         */
        createTabClass(data) {
            let name = 'lm-TabBar-tab';
            if (data.title.className) {
                name += ` ${data.title.className}`;
            }
            if (data.title.closable) {
                name += ' lm-mod-closable';
            }
            if (data.current) {
                name += ' lm-mod-current';
            }
            return name;
        }
        /**
         * Create the dataset for a tab.
         *
         * @param data - The data to use for the tab.
         *
         * @returns The dataset for the tab.
         */
        createTabDataset(data) {
            return data.title.dataset;
        }
        /**
         * Create the ARIA attributes for a tab.
         *
         * @param data - The data to use for the tab.
         *
         * @returns The ARIA attributes for the tab.
         */
        createTabARIA(data) {
            var _a;
            return {
                role: 'tab',
                'aria-selected': data.current.toString(),
                tabindex: `${(_a = data.tabIndex) !== null && _a !== void 0 ? _a : '-1'}`
            };
        }
        /**
         * Create the class name for the tab icon.
         *
         * @param data - The data to use for the tab.
         *
         * @returns The full class name for the tab icon.
         */
        createIconClass(data) {
            let name = 'lm-TabBar-tabIcon';
            let extra = data.title.iconClass;
            return extra ? `${name} ${extra}` : name;
        }
    }
    Renderer._nInstance = 0;
    TabBar.Renderer = Renderer;
    /**
     * The default `Renderer` instance.
     */
    TabBar.defaultRenderer = new Renderer();
    /**
     * A selector which matches the add button node in the tab bar.
     */
    TabBar.addButtonSelector = '.lm-TabBar-addButton';
})(TabBar || (TabBar = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$7;
(function (Private) {
    /**
     * The start drag distance threshold.
     */
    Private.DRAG_THRESHOLD = 5;
    /**
     * The detach distance threshold.
     */
    Private.DETACH_THRESHOLD = 20;
    /**
     * Create the DOM node for a tab bar.
     */
    function createNode() {
        let node = document.createElement('div');
        let content = document.createElement('ul');
        content.setAttribute('role', 'tablist');
        content.className = 'lm-TabBar-content';
        node.appendChild(content);
        let add = document.createElement('div');
        add.className = 'lm-TabBar-addButton lm-mod-hidden';
        add.setAttribute('tabindex', '-1');
        add.setAttribute('role', 'button');
        node.appendChild(add);
        return node;
    }
    Private.createNode = createNode;
    /**
     * Coerce a title or options into a real title.
     */
    function asTitle(value) {
        return value instanceof Title ? value : new Title(value);
    }
    Private.asTitle = asTitle;
    /**
     * Parse the transition duration for a tab node.
     */
    function parseTransitionDuration(tab) {
        let style = window.getComputedStyle(tab);
        return 1000 * (parseFloat(style.transitionDuration) || 0);
    }
    Private.parseTransitionDuration = parseTransitionDuration;
    /**
     * Get a snapshot of the current tab layout values.
     */
    function snapTabLayout(tabs, orientation) {
        let layout = new Array(tabs.length);
        for (let i = 0, n = tabs.length; i < n; ++i) {
            let node = tabs[i];
            let style = window.getComputedStyle(node);
            if (orientation === 'horizontal') {
                layout[i] = {
                    pos: node.offsetLeft,
                    size: node.offsetWidth,
                    margin: parseFloat(style.marginLeft) || 0
                };
            }
            else {
                layout[i] = {
                    pos: node.offsetTop,
                    size: node.offsetHeight,
                    margin: parseFloat(style.marginTop) || 0
                };
            }
        }
        return layout;
    }
    Private.snapTabLayout = snapTabLayout;
    /**
     * Test if the event exceeds the drag threshold.
     */
    function dragExceeded(data, event) {
        let dx = Math.abs(event.clientX - data.pressX);
        let dy = Math.abs(event.clientY - data.pressY);
        return dx >= Private.DRAG_THRESHOLD || dy >= Private.DRAG_THRESHOLD;
    }
    Private.dragExceeded = dragExceeded;
    /**
     * Test if the event exceeds the drag detach threshold.
     */
    function detachExceeded(data, event) {
        let rect = data.contentRect;
        return (event.clientX < rect.left - Private.DETACH_THRESHOLD ||
            event.clientX >= rect.right + Private.DETACH_THRESHOLD ||
            event.clientY < rect.top - Private.DETACH_THRESHOLD ||
            event.clientY >= rect.bottom + Private.DETACH_THRESHOLD);
    }
    Private.detachExceeded = detachExceeded;
    /**
     * Update the relative tab positions and computed target index.
     */
    function layoutTabs(tabs, data, event, orientation) {
        // Compute the orientation-sensitive values.
        let pressPos;
        let localPos;
        let clientPos;
        let clientSize;
        if (orientation === 'horizontal') {
            pressPos = data.pressX;
            localPos = event.clientX - data.contentRect.left;
            clientPos = event.clientX;
            clientSize = data.contentRect.width;
        }
        else {
            pressPos = data.pressY;
            localPos = event.clientY - data.contentRect.top;
            clientPos = event.clientY;
            clientSize = data.contentRect.height;
        }
        // Compute the target data.
        let targetIndex = data.index;
        let targetPos = localPos - data.tabPressPos;
        let targetEnd = targetPos + data.tabSize;
        // Update the relative tab positions.
        for (let i = 0, n = tabs.length; i < n; ++i) {
            let pxPos;
            let layout = data.tabLayout[i];
            let threshold = layout.pos + (layout.size >> 1);
            if (i < data.index && targetPos < threshold) {
                pxPos = `${data.tabSize + data.tabLayout[i + 1].margin}px`;
                targetIndex = Math.min(targetIndex, i);
            }
            else if (i > data.index && targetEnd > threshold) {
                pxPos = `${-data.tabSize - layout.margin}px`;
                targetIndex = Math.max(targetIndex, i);
            }
            else if (i === data.index) {
                let ideal = clientPos - pressPos;
                let limit = clientSize - (data.tabPos + data.tabSize);
                pxPos = `${Math.max(-data.tabPos, Math.min(ideal, limit))}px`;
            }
            else {
                pxPos = '';
            }
            if (orientation === 'horizontal') {
                tabs[i].style.left = pxPos;
            }
            else {
                tabs[i].style.top = pxPos;
            }
        }
        // Update the computed target index.
        data.targetIndex = targetIndex;
    }
    Private.layoutTabs = layoutTabs;
    /**
     * Position the drag tab at its final resting relative position.
     */
    function finalizeTabPosition(data, orientation) {
        // Compute the orientation-sensitive client size.
        let clientSize;
        if (orientation === 'horizontal') {
            clientSize = data.contentRect.width;
        }
        else {
            clientSize = data.contentRect.height;
        }
        // Compute the ideal final tab position.
        let ideal;
        if (data.targetIndex === data.index) {
            ideal = 0;
        }
        else if (data.targetIndex > data.index) {
            let tgt = data.tabLayout[data.targetIndex];
            ideal = tgt.pos + tgt.size - data.tabSize - data.tabPos;
        }
        else {
            let tgt = data.tabLayout[data.targetIndex];
            ideal = tgt.pos - data.tabPos;
        }
        // Compute the tab position limit.
        let limit = clientSize - (data.tabPos + data.tabSize);
        let final = Math.max(-data.tabPos, Math.min(ideal, limit));
        // Set the final orientation-sensitive position.
        if (orientation === 'horizontal') {
            data.tab.style.left = `${final}px`;
        }
        else {
            data.tab.style.top = `${final}px`;
        }
    }
    Private.finalizeTabPosition = finalizeTabPosition;
    /**
     * Reset the relative positions of the given tabs.
     */
    function resetTabPositions(tabs, orientation) {
        for (const tab of tabs) {
            if (orientation === 'horizontal') {
                tab.style.left = '';
            }
            else {
                tab.style.top = '';
            }
        }
    }
    Private.resetTabPositions = resetTabPositions;
})(Private$7 || (Private$7 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A layout which provides a flexible docking arrangement.
 *
 * #### Notes
 * The consumer of this layout is responsible for handling all signals
 * from the generated tab bars and managing the visibility of widgets
 * and tab bars as needed.
 */
class DockLayout extends Layout {
    /**
     * Construct a new dock layout.
     *
     * @param options - The options for initializing the layout.
     */
    constructor(options) {
        super();
        this._spacing = 4;
        this._dirty = false;
        this._root = null;
        this._box = null;
        this._items = new Map();
        this.renderer = options.renderer;
        if (options.spacing !== undefined) {
            this._spacing = Utils$1.clampDimension(options.spacing);
        }
        this._document = options.document || document;
        this._hiddenMode =
            options.hiddenMode !== undefined
                ? options.hiddenMode
                : Widget.HiddenMode.Display;
    }
    /**
     * Dispose of the resources held by the layout.
     *
     * #### Notes
     * This will clear and dispose all widgets in the layout.
     */
    dispose() {
        // Get an iterator over the widgets in the layout.
        let widgets = this[Symbol.iterator]();
        // Dispose of the layout items.
        this._items.forEach(item => {
            item.dispose();
        });
        // Clear the layout state before disposing the widgets.
        this._box = null;
        this._root = null;
        this._items.clear();
        // Dispose of the widgets contained in the old layout root.
        for (const widget of widgets) {
            widget.dispose();
        }
        // Dispose of the base class.
        super.dispose();
    }
    /**
     * The method for hiding child widgets.
     *
     * #### Notes
     * If there is only one child widget, `Display` hiding mode will be used
     * regardless of this setting.
     */
    get hiddenMode() {
        return this._hiddenMode;
    }
    set hiddenMode(v) {
        if (this._hiddenMode === v) {
            return;
        }
        this._hiddenMode = v;
        for (const bar of this.tabBars()) {
            if (bar.titles.length > 1) {
                for (const title of bar.titles) {
                    title.owner.hiddenMode = this._hiddenMode;
                }
            }
        }
    }
    /**
     * Get the inter-element spacing for the dock layout.
     */
    get spacing() {
        return this._spacing;
    }
    /**
     * Set the inter-element spacing for the dock layout.
     */
    set spacing(value) {
        value = Utils$1.clampDimension(value);
        if (this._spacing === value) {
            return;
        }
        this._spacing = value;
        if (!this.parent) {
            return;
        }
        this.parent.fit();
    }
    /**
     * Whether the dock layout is empty.
     */
    get isEmpty() {
        return this._root === null;
    }
    /**
     * Create an iterator over all widgets in the layout.
     *
     * @returns A new iterator over the widgets in the layout.
     *
     * #### Notes
     * This iterator includes the generated tab bars.
     */
    [Symbol.iterator]() {
        return this._root ? this._root.iterAllWidgets() : (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.empty)();
    }
    /**
     * Create an iterator over the user widgets in the layout.
     *
     * @returns A new iterator over the user widgets in the layout.
     *
     * #### Notes
     * This iterator does not include the generated tab bars.
     */
    widgets() {
        return this._root ? this._root.iterUserWidgets() : (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.empty)();
    }
    /**
     * Create an iterator over the selected widgets in the layout.
     *
     * @returns A new iterator over the selected user widgets.
     *
     * #### Notes
     * This iterator yields the widgets corresponding to the current tab
     * of each tab bar in the layout.
     */
    selectedWidgets() {
        return this._root ? this._root.iterSelectedWidgets() : (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.empty)();
    }
    /**
     * Create an iterator over the tab bars in the layout.
     *
     * @returns A new iterator over the tab bars in the layout.
     *
     * #### Notes
     * This iterator does not include the user widgets.
     */
    tabBars() {
        return this._root ? this._root.iterTabBars() : (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.empty)();
    }
    /**
     * Create an iterator over the handles in the layout.
     *
     * @returns A new iterator over the handles in the layout.
     */
    handles() {
        return this._root ? this._root.iterHandles() : (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.empty)();
    }
    /**
     * Move a handle to the given offset position.
     *
     * @param handle - The handle to move.
     *
     * @param offsetX - The desired offset X position of the handle.
     *
     * @param offsetY - The desired offset Y position of the handle.
     *
     * #### Notes
     * If the given handle is not contained in the layout, this is no-op.
     *
     * The handle will be moved as close as possible to the desired
     * position without violating any of the layout constraints.
     *
     * Only one of the coordinates is used depending on the orientation
     * of the handle. This method accepts both coordinates to make it
     * easy to invoke from a mouse move event without needing to know
     * the handle orientation.
     */
    moveHandle(handle, offsetX, offsetY) {
        // Bail early if there is no root or if the handle is hidden.
        let hidden = handle.classList.contains('lm-mod-hidden');
        if (!this._root || hidden) {
            return;
        }
        // Lookup the split node for the handle.
        let data = this._root.findSplitNode(handle);
        if (!data) {
            return;
        }
        // Compute the desired delta movement for the handle.
        let delta;
        if (data.node.orientation === 'horizontal') {
            delta = offsetX - handle.offsetLeft;
        }
        else {
            delta = offsetY - handle.offsetTop;
        }
        // Bail if there is no handle movement.
        if (delta === 0) {
            return;
        }
        // Prevent sibling resizing unless needed.
        data.node.holdSizes();
        // Adjust the sizers to reflect the handle movement.
        BoxEngine.adjust(data.node.sizers, data.index, delta);
        // Update the layout of the widgets.
        if (this.parent) {
            this.parent.update();
        }
    }
    /**
     * Save the current configuration of the dock layout.
     *
     * @returns A new config object for the current layout state.
     *
     * #### Notes
     * The return value can be provided to the `restoreLayout` method
     * in order to restore the layout to its current configuration.
     */
    saveLayout() {
        // Bail early if there is no root.
        if (!this._root) {
            return { main: null };
        }
        // Hold the current sizes in the layout tree.
        this._root.holdAllSizes();
        // Return the layout config.
        return { main: this._root.createConfig() };
    }
    /**
     * Restore the layout to a previously saved configuration.
     *
     * @param config - The layout configuration to restore.
     *
     * #### Notes
     * Widgets which currently belong to the layout but which are not
     * contained in the config will be unparented.
     */
    restoreLayout(config) {
        // Create the widget set for validating the config.
        let widgetSet = new Set();
        // Normalize the main area config and collect the widgets.
        let mainConfig;
        if (config.main) {
            mainConfig = Private$6.normalizeAreaConfig(config.main, widgetSet);
        }
        else {
            mainConfig = null;
        }
        // Create iterators over the old content.
        let oldWidgets = this.widgets();
        let oldTabBars = this.tabBars();
        let oldHandles = this.handles();
        // Clear the root before removing the old content.
        this._root = null;
        // Unparent the old widgets which are not in the new config.
        for (const widget of oldWidgets) {
            if (!widgetSet.has(widget)) {
                widget.parent = null;
            }
        }
        // Dispose of the old tab bars.
        for (const tabBar of oldTabBars) {
            tabBar.dispose();
        }
        // Remove the old handles.
        for (const handle of oldHandles) {
            if (handle.parentNode) {
                handle.parentNode.removeChild(handle);
            }
        }
        // Reparent the new widgets to the current parent.
        for (const widget of widgetSet) {
            widget.parent = this.parent;
        }
        // Create the root node for the new config.
        if (mainConfig) {
            this._root = Private$6.realizeAreaConfig(mainConfig, {
                // Ignoring optional `document` argument as we must reuse `this._document`
                createTabBar: (document) => this._createTabBar(),
                createHandle: () => this._createHandle()
            }, this._document);
        }
        else {
            this._root = null;
        }
        // If there is no parent, there is nothing more to do.
        if (!this.parent) {
            return;
        }
        // Attach the new widgets to the parent.
        widgetSet.forEach(widget => {
            this.attachWidget(widget);
        });
        // Post a fit request to the parent.
        this.parent.fit();
    }
    /**
     * Add a widget to the dock layout.
     *
     * @param widget - The widget to add to the dock layout.
     *
     * @param options - The additional options for adding the widget.
     *
     * #### Notes
     * The widget will be moved if it is already contained in the layout.
     *
     * An error will be thrown if the reference widget is invalid.
     */
    addWidget(widget, options = {}) {
        // Parse the options.
        let ref = options.ref || null;
        let mode = options.mode || 'tab-after';
        // Find the tab node which holds the reference widget.
        let refNode = null;
        if (this._root && ref) {
            refNode = this._root.findTabNode(ref);
        }
        // Throw an error if the reference widget is invalid.
        if (ref && !refNode) {
            throw new Error('Reference widget is not in the layout.');
        }
        // Reparent the widget to the current layout parent.
        widget.parent = this.parent;
        // Insert the widget according to the insert mode.
        switch (mode) {
            case 'tab-after':
                this._insertTab(widget, ref, refNode, true);
                break;
            case 'tab-before':
                this._insertTab(widget, ref, refNode, false);
                break;
            case 'split-top':
                this._insertSplit(widget, ref, refNode, 'vertical', false);
                break;
            case 'split-left':
                this._insertSplit(widget, ref, refNode, 'horizontal', false);
                break;
            case 'split-right':
                this._insertSplit(widget, ref, refNode, 'horizontal', true);
                break;
            case 'split-bottom':
                this._insertSplit(widget, ref, refNode, 'vertical', true);
                break;
            case 'merge-top':
                this._insertSplit(widget, ref, refNode, 'vertical', false, true);
                break;
            case 'merge-left':
                this._insertSplit(widget, ref, refNode, 'horizontal', false, true);
                break;
            case 'merge-right':
                this._insertSplit(widget, ref, refNode, 'horizontal', true, true);
                break;
            case 'merge-bottom':
                this._insertSplit(widget, ref, refNode, 'vertical', true, true);
                break;
        }
        // Do nothing else if there is no parent widget.
        if (!this.parent) {
            return;
        }
        // Ensure the widget is attached to the parent widget.
        this.attachWidget(widget);
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Remove a widget from the layout.
     *
     * @param widget - The widget to remove from the layout.
     *
     * #### Notes
     * A widget is automatically removed from the layout when its `parent`
     * is set to `null`. This method should only be invoked directly when
     * removing a widget from a layout which has yet to be installed on a
     * parent widget.
     *
     * This method does *not* modify the widget's `parent`.
     */
    removeWidget(widget) {
        // Remove the widget from its current layout location.
        this._removeWidget(widget);
        // Do nothing else if there is no parent widget.
        if (!this.parent) {
            return;
        }
        // Detach the widget from the parent widget.
        this.detachWidget(widget);
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Find the tab area which contains the given client position.
     *
     * @param clientX - The client X position of interest.
     *
     * @param clientY - The client Y position of interest.
     *
     * @returns The geometry of the tab area at the given position, or
     *   `null` if there is no tab area at the given position.
     */
    hitTestTabAreas(clientX, clientY) {
        // Bail early if hit testing cannot produce valid results.
        if (!this._root || !this.parent || !this.parent.isVisible) {
            return null;
        }
        // Ensure the parent box sizing data is computed.
        if (!this._box) {
            this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node);
        }
        // Convert from client to local coordinates.
        let rect = this.parent.node.getBoundingClientRect();
        let x = clientX - rect.left - this._box.borderLeft;
        let y = clientY - rect.top - this._box.borderTop;
        // Find the tab layout node at the local position.
        let tabNode = this._root.hitTestTabNodes(x, y);
        // Bail if a tab layout node was not found.
        if (!tabNode) {
            return null;
        }
        // Extract the data from the tab node.
        let { tabBar, top, left, width, height } = tabNode;
        // Compute the right and bottom edges of the tab area.
        let borderWidth = this._box.borderLeft + this._box.borderRight;
        let borderHeight = this._box.borderTop + this._box.borderBottom;
        let right = rect.width - borderWidth - (left + width);
        let bottom = rect.height - borderHeight - (top + height);
        // Return the hit test results.
        return { tabBar, x, y, top, left, right, bottom, width, height };
    }
    /**
     * Perform layout initialization which requires the parent widget.
     */
    init() {
        // Perform superclass initialization.
        super.init();
        // Attach each widget to the parent.
        for (const widget of this) {
            this.attachWidget(widget);
        }
        // Attach each handle to the parent.
        for (const handle of this.handles()) {
            this.parent.node.appendChild(handle);
        }
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Attach the widget to the layout parent widget.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This is a no-op if the widget is already attached.
     */
    attachWidget(widget) {
        // Do nothing if the widget is already attached.
        if (this.parent.node === widget.node.parentNode) {
            return;
        }
        // Create the layout item for the widget.
        this._items.set(widget, new LayoutItem(widget));
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Add the widget's node to the parent.
        this.parent.node.appendChild(widget.node);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
    }
    /**
     * Detach the widget from the layout parent widget.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This is a no-op if the widget is not attached.
     */
    detachWidget(widget) {
        // Do nothing if the widget is not attached.
        if (this.parent.node !== widget.node.parentNode) {
            return;
        }
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.node.removeChild(widget.node);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
        // Delete the layout item for the widget.
        let item = this._items.get(widget);
        if (item) {
            this._items.delete(widget);
            item.dispose();
        }
    }
    /**
     * A message handler invoked on a `'before-show'` message.
     */
    onBeforeShow(msg) {
        super.onBeforeShow(msg);
        this.parent.update();
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        super.onBeforeAttach(msg);
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-shown'` message.
     */
    onChildShown(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-hidden'` message.
     */
    onChildHidden(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'resize'` message.
     */
    onResize(msg) {
        if (this.parent.isVisible) {
            this._update(msg.width, msg.height);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        if (this.parent.isVisible) {
            this._update(-1, -1);
        }
    }
    /**
     * A message handler invoked on a `'fit-request'` message.
     */
    onFitRequest(msg) {
        if (this.parent.isAttached) {
            this._fit();
        }
    }
    /**
     * Remove the specified widget from the layout structure.
     *
     * #### Notes
     * This is a no-op if the widget is not in the layout tree.
     *
     * This does not detach the widget from the parent node.
     */
    _removeWidget(widget) {
        // Bail early if there is no layout root.
        if (!this._root) {
            return;
        }
        // Find the tab node which contains the given widget.
        let tabNode = this._root.findTabNode(widget);
        // Bail early if the tab node is not found.
        if (!tabNode) {
            return;
        }
        Private$6.removeAria(widget);
        // If there are multiple tabs, just remove the widget's tab.
        if (tabNode.tabBar.titles.length > 1) {
            tabNode.tabBar.removeTab(widget.title);
            if (this._hiddenMode === Widget.HiddenMode.Scale &&
                tabNode.tabBar.titles.length == 1) {
                const existingWidget = tabNode.tabBar.titles[0].owner;
                existingWidget.hiddenMode = Widget.HiddenMode.Display;
            }
            return;
        }
        // Otherwise, the tab node needs to be removed...
        // Dispose the tab bar.
        tabNode.tabBar.dispose();
        // Handle the case where the tab node is the root.
        if (this._root === tabNode) {
            this._root = null;
            return;
        }
        // Otherwise, remove the tab node from its parent...
        // Prevent widget resizing unless needed.
        this._root.holdAllSizes();
        // Clear the parent reference on the tab node.
        let splitNode = tabNode.parent;
        tabNode.parent = null;
        // Remove the tab node from its parent split node.
        let i = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeFirstOf(splitNode.children, tabNode);
        let handle = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(splitNode.handles, i);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(splitNode.sizers, i);
        // Remove the handle from its parent DOM node.
        if (handle.parentNode) {
            handle.parentNode.removeChild(handle);
        }
        // If there are multiple children, just update the handles.
        if (splitNode.children.length > 1) {
            splitNode.syncHandles();
            return;
        }
        // Otherwise, the split node also needs to be removed...
        // Clear the parent reference on the split node.
        let maybeParent = splitNode.parent;
        splitNode.parent = null;
        // Lookup the remaining child node and handle.
        let childNode = splitNode.children[0];
        let childHandle = splitNode.handles[0];
        // Clear the split node data.
        splitNode.children.length = 0;
        splitNode.handles.length = 0;
        splitNode.sizers.length = 0;
        // Remove the child handle from its parent node.
        if (childHandle.parentNode) {
            childHandle.parentNode.removeChild(childHandle);
        }
        // Handle the case where the split node is the root.
        if (this._root === splitNode) {
            childNode.parent = null;
            this._root = childNode;
            return;
        }
        // Otherwise, move the child node to the parent node...
        let parentNode = maybeParent;
        // Lookup the index of the split node.
        let j = parentNode.children.indexOf(splitNode);
        // Handle the case where the child node is a tab node.
        if (childNode instanceof Private$6.TabLayoutNode) {
            childNode.parent = parentNode;
            parentNode.children[j] = childNode;
            return;
        }
        // Remove the split data from the parent.
        let splitHandle = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(parentNode.handles, j);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(parentNode.children, j);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(parentNode.sizers, j);
        // Remove the handle from its parent node.
        if (splitHandle.parentNode) {
            splitHandle.parentNode.removeChild(splitHandle);
        }
        // The child node and the split parent node will have the same
        // orientation. Merge the grand-children with the parent node.
        for (let i = 0, n = childNode.children.length; i < n; ++i) {
            let gChild = childNode.children[i];
            let gHandle = childNode.handles[i];
            let gSizer = childNode.sizers[i];
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(parentNode.children, j + i, gChild);
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(parentNode.handles, j + i, gHandle);
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(parentNode.sizers, j + i, gSizer);
            gChild.parent = parentNode;
        }
        // Clear the child node.
        childNode.children.length = 0;
        childNode.handles.length = 0;
        childNode.sizers.length = 0;
        childNode.parent = null;
        // Sync the handles on the parent node.
        parentNode.syncHandles();
    }
    /**
     * Create the tab layout node to hold the widget.
     */
    _createTabNode(widget) {
        let tabNode = new Private$6.TabLayoutNode(this._createTabBar());
        tabNode.tabBar.addTab(widget.title);
        Private$6.addAria(widget, tabNode.tabBar);
        return tabNode;
    }
    /**
     * Insert a widget next to an existing tab.
     *
     * #### Notes
     * This does not attach the widget to the parent widget.
     */
    _insertTab(widget, ref, refNode, after) {
        // Do nothing if the tab is inserted next to itself.
        if (widget === ref) {
            return;
        }
        // Create the root if it does not exist.
        if (!this._root) {
            let tabNode = new Private$6.TabLayoutNode(this._createTabBar());
            tabNode.tabBar.addTab(widget.title);
            this._root = tabNode;
            Private$6.addAria(widget, tabNode.tabBar);
            return;
        }
        // Use the first tab node as the ref node if needed.
        if (!refNode) {
            refNode = this._root.findFirstTabNode();
        }
        // If the widget is not contained in the ref node, ensure it is
        // removed from the layout and hidden before being added again.
        if (refNode.tabBar.titles.indexOf(widget.title) === -1) {
            this._removeWidget(widget);
            widget.hide();
        }
        // Lookup the target index for inserting the tab.
        let index;
        if (ref) {
            index = refNode.tabBar.titles.indexOf(ref.title);
        }
        else {
            index = refNode.tabBar.currentIndex;
        }
        // Using transform create an additional layer in the pixel pipeline
        // to limit the number of layer, it is set only if there is more than one widget.
        if (this._hiddenMode === Widget.HiddenMode.Scale) {
            if (refNode.tabBar.titles.length === 0) {
                // Singular tab should use display mode to limit number of layers.
                widget.hiddenMode = Widget.HiddenMode.Display;
            }
            else if (refNode.tabBar.titles.length == 1) {
                // If we are adding a second tab, switch the existing tab back to scale.
                const existingWidget = refNode.tabBar.titles[0].owner;
                existingWidget.hiddenMode = Widget.HiddenMode.Scale;
            }
            else {
                // For the third and subsequent tabs no special action is needed.
                widget.hiddenMode = Widget.HiddenMode.Scale;
            }
        }
        else {
            // For all other modes just propagate the current mode.
            widget.hiddenMode = this._hiddenMode;
        }
        // Insert the widget's tab relative to the target index.
        refNode.tabBar.insertTab(index + (after ? 1 : 0), widget.title);
        Private$6.addAria(widget, refNode.tabBar);
    }
    /**
     * Insert a widget as a new split area.
     *
     * #### Notes
     * This does not attach the widget to the parent widget.
     */
    _insertSplit(widget, ref, refNode, orientation, after, merge = false) {
        // Do nothing if there is no effective split.
        if (widget === ref && refNode && refNode.tabBar.titles.length === 1) {
            return;
        }
        // Ensure the widget is removed from the current layout.
        this._removeWidget(widget);
        // Set the root if it does not exist.
        if (!this._root) {
            this._root = this._createTabNode(widget);
            return;
        }
        // If the ref node parent is null, split the root.
        if (!refNode || !refNode.parent) {
            // Ensure the root is split with the correct orientation.
            let root = this._splitRoot(orientation);
            // Determine the insert index for the new tab node.
            let i = after ? root.children.length : 0;
            // Normalize the split node.
            root.normalizeSizes();
            // Create the sizer for new tab node.
            let sizer = Private$6.createSizer(refNode ? 1 : Private$6.GOLDEN_RATIO);
            // Insert the tab node sized to the golden ratio.
            let tabNode = this._createTabNode(widget);
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(root.children, i, tabNode);
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(root.sizers, i, sizer);
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(root.handles, i, this._createHandle());
            tabNode.parent = root;
            // Re-normalize the split node to maintain the ratios.
            root.normalizeSizes();
            // Finally, synchronize the visibility of the handles.
            root.syncHandles();
            return;
        }
        // Lookup the split node for the ref widget.
        let splitNode = refNode.parent;
        // If the split node already had the correct orientation,
        // the widget can be inserted into the split node directly.
        if (splitNode.orientation === orientation) {
            // Find the index of the ref node.
            let i = splitNode.children.indexOf(refNode);
            // Conditionally reuse a tab layout found in the wanted position.
            if (merge) {
                let j = i + (after ? 1 : -1);
                let sibling = splitNode.children[j];
                if (sibling instanceof Private$6.TabLayoutNode) {
                    this._insertTab(widget, null, sibling, true);
                    ++sibling.tabBar.currentIndex;
                    return;
                }
            }
            // Normalize the split node.
            splitNode.normalizeSizes();
            // Consume half the space for the insert location.
            let s = (splitNode.sizers[i].sizeHint /= 2);
            // Insert the tab node sized to the other half.
            let j = i + (after ? 1 : 0);
            let tabNode = this._createTabNode(widget);
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(splitNode.children, j, tabNode);
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(splitNode.sizers, j, Private$6.createSizer(s));
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(splitNode.handles, j, this._createHandle());
            tabNode.parent = splitNode;
            // Finally, synchronize the visibility of the handles.
            splitNode.syncHandles();
            return;
        }
        // Remove the ref node from the split node.
        let i = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeFirstOf(splitNode.children, refNode);
        // Create a new normalized split node for the children.
        let childNode = new Private$6.SplitLayoutNode(orientation);
        childNode.normalized = true;
        // Add the ref node sized to half the space.
        childNode.children.push(refNode);
        childNode.sizers.push(Private$6.createSizer(0.5));
        childNode.handles.push(this._createHandle());
        refNode.parent = childNode;
        // Add the tab node sized to the other half.
        let j = after ? 1 : 0;
        let tabNode = this._createTabNode(widget);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(childNode.children, j, tabNode);
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(childNode.sizers, j, Private$6.createSizer(0.5));
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(childNode.handles, j, this._createHandle());
        tabNode.parent = childNode;
        // Synchronize the visibility of the handles.
        childNode.syncHandles();
        // Finally, add the new child node to the original split node.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(splitNode.children, i, childNode);
        childNode.parent = splitNode;
    }
    /**
     * Ensure the root is a split node with the given orientation.
     */
    _splitRoot(orientation) {
        // Bail early if the root already meets the requirements.
        let oldRoot = this._root;
        if (oldRoot instanceof Private$6.SplitLayoutNode) {
            if (oldRoot.orientation === orientation) {
                return oldRoot;
            }
        }
        // Create a new root node with the specified orientation.
        let newRoot = (this._root = new Private$6.SplitLayoutNode(orientation));
        // Add the old root to the new root.
        if (oldRoot) {
            newRoot.children.push(oldRoot);
            newRoot.sizers.push(Private$6.createSizer(0));
            newRoot.handles.push(this._createHandle());
            oldRoot.parent = newRoot;
        }
        // Return the new root as a convenience.
        return newRoot;
    }
    /**
     * Fit the layout to the total size required by the widgets.
     */
    _fit() {
        // Set up the computed minimum size.
        let minW = 0;
        let minH = 0;
        // Update the size limits for the layout tree.
        if (this._root) {
            let limits = this._root.fit(this._spacing, this._items);
            minW = limits.minWidth;
            minH = limits.minHeight;
        }
        // Update the box sizing and add it to the computed min size.
        let box = (this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node));
        minW += box.horizontalSum;
        minH += box.verticalSum;
        // Update the parent's min size constraints.
        let style = this.parent.node.style;
        style.minWidth = `${minW}px`;
        style.minHeight = `${minH}px`;
        // Set the dirty flag to ensure only a single update occurs.
        this._dirty = true;
        // Notify the ancestor that it should fit immediately. This may
        // cause a resize of the parent, fulfilling the required update.
        if (this.parent.parent) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);
        }
        // If the dirty flag is still set, the parent was not resized.
        // Trigger the required update on the parent widget immediately.
        if (this._dirty) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);
        }
    }
    /**
     * Update the layout position and size of the widgets.
     *
     * The parent offset dimensions should be `-1` if unknown.
     */
    _update(offsetWidth, offsetHeight) {
        // Clear the dirty flag to indicate the update occurred.
        this._dirty = false;
        // Bail early if there is no root layout node.
        if (!this._root) {
            return;
        }
        // Measure the parent if the offset dimensions are unknown.
        if (offsetWidth < 0) {
            offsetWidth = this.parent.node.offsetWidth;
        }
        if (offsetHeight < 0) {
            offsetHeight = this.parent.node.offsetHeight;
        }
        // Ensure the parent box sizing data is computed.
        if (!this._box) {
            this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node);
        }
        // Compute the actual layout bounds adjusted for border and padding.
        let x = this._box.paddingTop;
        let y = this._box.paddingLeft;
        let width = offsetWidth - this._box.horizontalSum;
        let height = offsetHeight - this._box.verticalSum;
        // Update the geometry of the layout tree.
        this._root.update(x, y, width, height, this._spacing, this._items);
    }
    /**
     * Create a new tab bar for use by the dock layout.
     *
     * #### Notes
     * The tab bar will be attached to the parent if it exists.
     */
    _createTabBar() {
        // Create the tab bar using the renderer.
        let tabBar = this.renderer.createTabBar(this._document);
        // Enforce necessary tab bar behavior.
        tabBar.orientation = 'horizontal';
        // Attach the tab bar to the parent if possible.
        if (this.parent) {
            this.attachWidget(tabBar);
        }
        // Return the initialized tab bar.
        return tabBar;
    }
    /**
     * Create a new handle for the dock layout.
     *
     * #### Notes
     * The handle will be attached to the parent if it exists.
     */
    _createHandle() {
        // Create the handle using the renderer.
        let handle = this.renderer.createHandle();
        // Initialize the handle layout behavior.
        let style = handle.style;
        style.position = 'absolute';
        style.contain = 'strict';
        style.top = '0';
        style.left = '0';
        style.width = '0';
        style.height = '0';
        // Attach the handle to the parent if it exists.
        if (this.parent) {
            this.parent.node.appendChild(handle);
        }
        // Return the initialized handle.
        return handle;
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private$6;
(function (Private) {
    /**
     * A fraction used for sizing root panels; ~= `1 / golden_ratio`.
     */
    Private.GOLDEN_RATIO = 0.618;
    /**
     * Create a box sizer with an initial size hint.
     */
    function createSizer(hint) {
        let sizer = new BoxSizer();
        sizer.sizeHint = hint;
        sizer.size = hint;
        return sizer;
    }
    Private.createSizer = createSizer;
    /**
     * Normalize an area config object and collect the visited widgets.
     */
    function normalizeAreaConfig(config, widgetSet) {
        let result;
        if (config.type === 'tab-area') {
            result = normalizeTabAreaConfig(config, widgetSet);
        }
        else {
            result = normalizeSplitAreaConfig(config, widgetSet);
        }
        return result;
    }
    Private.normalizeAreaConfig = normalizeAreaConfig;
    /**
     * Convert a normalized area config into a layout tree.
     */
    function realizeAreaConfig(config, renderer, document) {
        let node;
        if (config.type === 'tab-area') {
            node = realizeTabAreaConfig(config, renderer, document);
        }
        else {
            node = realizeSplitAreaConfig(config, renderer, document);
        }
        return node;
    }
    Private.realizeAreaConfig = realizeAreaConfig;
    /**
     * A layout node which holds the data for a tabbed area.
     */
    class TabLayoutNode {
        /**
         * Construct a new tab layout node.
         *
         * @param tabBar - The tab bar to use for the layout node.
         */
        constructor(tabBar) {
            /**
             * The parent of the layout node.
             */
            this.parent = null;
            this._top = 0;
            this._left = 0;
            this._width = 0;
            this._height = 0;
            let tabSizer = new BoxSizer();
            let widgetSizer = new BoxSizer();
            tabSizer.stretch = 0;
            widgetSizer.stretch = 1;
            this.tabBar = tabBar;
            this.sizers = [tabSizer, widgetSizer];
        }
        /**
         * The most recent value for the `top` edge of the layout box.
         */
        get top() {
            return this._top;
        }
        /**
         * The most recent value for the `left` edge of the layout box.
         */
        get left() {
            return this._left;
        }
        /**
         * The most recent value for the `width` of the layout box.
         */
        get width() {
            return this._width;
        }
        /**
         * The most recent value for the `height` of the layout box.
         */
        get height() {
            return this._height;
        }
        /**
         * Create an iterator for all widgets in the layout tree.
         */
        *iterAllWidgets() {
            yield this.tabBar;
            yield* this.iterUserWidgets();
        }
        /**
         * Create an iterator for the user widgets in the layout tree.
         */
        *iterUserWidgets() {
            for (const title of this.tabBar.titles) {
                yield title.owner;
            }
        }
        /**
         * Create an iterator for the selected widgets in the layout tree.
         */
        *iterSelectedWidgets() {
            let title = this.tabBar.currentTitle;
            if (title) {
                yield title.owner;
            }
        }
        /**
         * Create an iterator for the tab bars in the layout tree.
         */
        *iterTabBars() {
            yield this.tabBar;
        }
        /**
         * Create an iterator for the handles in the layout tree.
         */
        // eslint-disable-next-line require-yield
        *iterHandles() {
            return;
        }
        /**
         * Find the tab layout node which contains the given widget.
         */
        findTabNode(widget) {
            return this.tabBar.titles.indexOf(widget.title) !== -1 ? this : null;
        }
        /**
         * Find the split layout node which contains the given handle.
         */
        findSplitNode(handle) {
            return null;
        }
        /**
         * Find the first tab layout node in a layout tree.
         */
        findFirstTabNode() {
            return this;
        }
        /**
         * Find the tab layout node which contains the local point.
         */
        hitTestTabNodes(x, y) {
            if (x < this._left || x >= this._left + this._width) {
                return null;
            }
            if (y < this._top || y >= this._top + this._height) {
                return null;
            }
            return this;
        }
        /**
         * Create a configuration object for the layout tree.
         */
        createConfig() {
            let widgets = this.tabBar.titles.map(title => title.owner);
            let currentIndex = this.tabBar.currentIndex;
            return { type: 'tab-area', widgets, currentIndex };
        }
        /**
         * Recursively hold all of the sizes in the layout tree.
         *
         * This ignores the sizers of tab layout nodes.
         */
        holdAllSizes() {
            return;
        }
        /**
         * Fit the layout tree.
         */
        fit(spacing, items) {
            // Set up the limit variables.
            let minWidth = 0;
            let minHeight = 0;
            let maxWidth = Infinity;
            let maxHeight = Infinity;
            // Lookup the tab bar layout item.
            let tabBarItem = items.get(this.tabBar);
            // Lookup the widget layout item.
            let current = this.tabBar.currentTitle;
            let widgetItem = current ? items.get(current.owner) : undefined;
            // Lookup the tab bar and widget sizers.
            let [tabBarSizer, widgetSizer] = this.sizers;
            // Update the tab bar limits.
            if (tabBarItem) {
                tabBarItem.fit();
            }
            // Update the widget limits.
            if (widgetItem) {
                widgetItem.fit();
            }
            // Update the results and sizer for the tab bar.
            if (tabBarItem && !tabBarItem.isHidden) {
                minWidth = Math.max(minWidth, tabBarItem.minWidth);
                minHeight += tabBarItem.minHeight;
                tabBarSizer.minSize = tabBarItem.minHeight;
                tabBarSizer.maxSize = tabBarItem.maxHeight;
            }
            else {
                tabBarSizer.minSize = 0;
                tabBarSizer.maxSize = 0;
            }
            // Update the results and sizer for the current widget.
            if (widgetItem && !widgetItem.isHidden) {
                minWidth = Math.max(minWidth, widgetItem.minWidth);
                minHeight += widgetItem.minHeight;
                widgetSizer.minSize = widgetItem.minHeight;
                widgetSizer.maxSize = Infinity;
            }
            else {
                widgetSizer.minSize = 0;
                widgetSizer.maxSize = Infinity;
            }
            // Return the computed size limits for the layout node.
            return { minWidth, minHeight, maxWidth, maxHeight };
        }
        /**
         * Update the layout tree.
         */
        update(left, top, width, height, spacing, items) {
            // Update the layout box values.
            this._top = top;
            this._left = left;
            this._width = width;
            this._height = height;
            // Lookup the tab bar layout item.
            let tabBarItem = items.get(this.tabBar);
            // Lookup the widget layout item.
            let current = this.tabBar.currentTitle;
            let widgetItem = current ? items.get(current.owner) : undefined;
            // Distribute the layout space to the sizers.
            BoxEngine.calc(this.sizers, height);
            // Update the tab bar item using the computed size.
            if (tabBarItem && !tabBarItem.isHidden) {
                let size = this.sizers[0].size;
                tabBarItem.update(left, top, width, size);
                top += size;
            }
            // Layout the widget using the computed size.
            if (widgetItem && !widgetItem.isHidden) {
                let size = this.sizers[1].size;
                widgetItem.update(left, top, width, size);
            }
        }
    }
    Private.TabLayoutNode = TabLayoutNode;
    /**
     * A layout node which holds the data for a split area.
     */
    class SplitLayoutNode {
        /**
         * Construct a new split layout node.
         *
         * @param orientation - The orientation of the node.
         */
        constructor(orientation) {
            /**
             * The parent of the layout node.
             */
            this.parent = null;
            /**
             * Whether the sizers have been normalized.
             */
            this.normalized = false;
            /**
             * The child nodes for the split node.
             */
            this.children = [];
            /**
             * The box sizers for the layout children.
             */
            this.sizers = [];
            /**
             * The handles for the layout children.
             */
            this.handles = [];
            this.orientation = orientation;
        }
        /**
         * Create an iterator for all widgets in the layout tree.
         */
        *iterAllWidgets() {
            for (const child of this.children) {
                yield* child.iterAllWidgets();
            }
        }
        /**
         * Create an iterator for the user widgets in the layout tree.
         */
        *iterUserWidgets() {
            for (const child of this.children) {
                yield* child.iterUserWidgets();
            }
        }
        /**
         * Create an iterator for the selected widgets in the layout tree.
         */
        *iterSelectedWidgets() {
            for (const child of this.children) {
                yield* child.iterSelectedWidgets();
            }
        }
        /**
         * Create an iterator for the tab bars in the layout tree.
         */
        *iterTabBars() {
            for (const child of this.children) {
                yield* child.iterTabBars();
            }
        }
        /**
         * Create an iterator for the handles in the layout tree.
         */
        *iterHandles() {
            yield* this.handles;
            for (const child of this.children) {
                yield* child.iterHandles();
            }
        }
        /**
         * Find the tab layout node which contains the given widget.
         */
        findTabNode(widget) {
            for (let i = 0, n = this.children.length; i < n; ++i) {
                let result = this.children[i].findTabNode(widget);
                if (result) {
                    return result;
                }
            }
            return null;
        }
        /**
         * Find the split layout node which contains the given handle.
         */
        findSplitNode(handle) {
            let index = this.handles.indexOf(handle);
            if (index !== -1) {
                return { index, node: this };
            }
            for (let i = 0, n = this.children.length; i < n; ++i) {
                let result = this.children[i].findSplitNode(handle);
                if (result) {
                    return result;
                }
            }
            return null;
        }
        /**
         * Find the first tab layout node in a layout tree.
         */
        findFirstTabNode() {
            if (this.children.length === 0) {
                return null;
            }
            return this.children[0].findFirstTabNode();
        }
        /**
         * Find the tab layout node which contains the local point.
         */
        hitTestTabNodes(x, y) {
            for (let i = 0, n = this.children.length; i < n; ++i) {
                let result = this.children[i].hitTestTabNodes(x, y);
                if (result) {
                    return result;
                }
            }
            return null;
        }
        /**
         * Create a configuration object for the layout tree.
         */
        createConfig() {
            let orientation = this.orientation;
            let sizes = this.createNormalizedSizes();
            let children = this.children.map(child => child.createConfig());
            return { type: 'split-area', orientation, children, sizes };
        }
        /**
         * Sync the visibility and orientation of the handles.
         */
        syncHandles() {
            this.handles.forEach((handle, i) => {
                handle.setAttribute('data-orientation', this.orientation);
                if (i === this.handles.length - 1) {
                    handle.classList.add('lm-mod-hidden');
                }
                else {
                    handle.classList.remove('lm-mod-hidden');
                }
            });
        }
        /**
         * Hold the current sizes of the box sizers.
         *
         * This sets the size hint of each sizer to its current size.
         */
        holdSizes() {
            for (const sizer of this.sizers) {
                sizer.sizeHint = sizer.size;
            }
        }
        /**
         * Recursively hold all of the sizes in the layout tree.
         *
         * This ignores the sizers of tab layout nodes.
         */
        holdAllSizes() {
            for (const child of this.children) {
                child.holdAllSizes();
            }
            this.holdSizes();
        }
        /**
         * Normalize the sizes of the split layout node.
         */
        normalizeSizes() {
            // Bail early if the sizers are empty.
            let n = this.sizers.length;
            if (n === 0) {
                return;
            }
            // Hold the current sizes of the sizers.
            this.holdSizes();
            // Compute the sum of the sizes.
            let sum = this.sizers.reduce((v, sizer) => v + sizer.sizeHint, 0);
            // Normalize the sizes based on the sum.
            if (sum === 0) {
                for (const sizer of this.sizers) {
                    sizer.size = sizer.sizeHint = 1 / n;
                }
            }
            else {
                for (const sizer of this.sizers) {
                    sizer.size = sizer.sizeHint /= sum;
                }
            }
            // Mark the sizes as normalized.
            this.normalized = true;
        }
        /**
         * Snap the normalized sizes of the split layout node.
         */
        createNormalizedSizes() {
            // Bail early if the sizers are empty.
            let n = this.sizers.length;
            if (n === 0) {
                return [];
            }
            // Grab the current sizes of the sizers.
            let sizes = this.sizers.map(sizer => sizer.size);
            // Compute the sum of the sizes.
            let sum = sizes.reduce((v, size) => v + size, 0);
            // Normalize the sizes based on the sum.
            if (sum === 0) {
                for (let i = sizes.length - 1; i > -1; i--) {
                    sizes[i] = 1 / n;
                }
            }
            else {
                for (let i = sizes.length - 1; i > -1; i--) {
                    sizes[i] /= sum;
                }
            }
            // Return the normalized sizes.
            return sizes;
        }
        /**
         * Fit the layout tree.
         */
        fit(spacing, items) {
            // Compute the required fixed space.
            let horizontal = this.orientation === 'horizontal';
            let fixed = Math.max(0, this.children.length - 1) * spacing;
            // Set up the limit variables.
            let minWidth = horizontal ? fixed : 0;
            let minHeight = horizontal ? 0 : fixed;
            let maxWidth = Infinity;
            let maxHeight = Infinity;
            // Fit the children and update the limits.
            for (let i = 0, n = this.children.length; i < n; ++i) {
                let limits = this.children[i].fit(spacing, items);
                if (horizontal) {
                    minHeight = Math.max(minHeight, limits.minHeight);
                    minWidth += limits.minWidth;
                    this.sizers[i].minSize = limits.minWidth;
                }
                else {
                    minWidth = Math.max(minWidth, limits.minWidth);
                    minHeight += limits.minHeight;
                    this.sizers[i].minSize = limits.minHeight;
                }
            }
            // Return the computed limits for the layout node.
            return { minWidth, minHeight, maxWidth, maxHeight };
        }
        /**
         * Update the layout tree.
         */
        update(left, top, width, height, spacing, items) {
            // Compute the available layout space.
            let horizontal = this.orientation === 'horizontal';
            let fixed = Math.max(0, this.children.length - 1) * spacing;
            let space = Math.max(0, (horizontal ? width : height) - fixed);
            // De-normalize the sizes if needed.
            if (this.normalized) {
                for (const sizer of this.sizers) {
                    sizer.sizeHint *= space;
                }
                this.normalized = false;
            }
            // Distribute the layout space to the sizers.
            BoxEngine.calc(this.sizers, space);
            // Update the geometry of the child nodes and handles.
            for (let i = 0, n = this.children.length; i < n; ++i) {
                let child = this.children[i];
                let size = this.sizers[i].size;
                let handleStyle = this.handles[i].style;
                if (horizontal) {
                    child.update(left, top, size, height, spacing, items);
                    left += size;
                    handleStyle.top = `${top}px`;
                    handleStyle.left = `${left}px`;
                    handleStyle.width = `${spacing}px`;
                    handleStyle.height = `${height}px`;
                    left += spacing;
                }
                else {
                    child.update(left, top, width, size, spacing, items);
                    top += size;
                    handleStyle.top = `${top}px`;
                    handleStyle.left = `${left}px`;
                    handleStyle.width = `${width}px`;
                    handleStyle.height = `${spacing}px`;
                    top += spacing;
                }
            }
        }
    }
    Private.SplitLayoutNode = SplitLayoutNode;
    function addAria(widget, tabBar) {
        widget.node.setAttribute('role', 'tabpanel');
        let renderer = tabBar.renderer;
        if (renderer instanceof TabBar.Renderer) {
            let tabId = renderer.createTabKey({
                title: widget.title,
                current: false,
                zIndex: 0
            });
            widget.node.setAttribute('aria-labelledby', tabId);
        }
    }
    Private.addAria = addAria;
    function removeAria(widget) {
        widget.node.removeAttribute('role');
        widget.node.removeAttribute('aria-labelledby');
    }
    Private.removeAria = removeAria;
    /**
     * Normalize a tab area config and collect the visited widgets.
     */
    function normalizeTabAreaConfig(config, widgetSet) {
        // Bail early if there is no content.
        if (config.widgets.length === 0) {
            return null;
        }
        // Setup the filtered widgets array.
        let widgets = [];
        // Filter the config for unique widgets.
        for (const widget of config.widgets) {
            if (!widgetSet.has(widget)) {
                widgetSet.add(widget);
                widgets.push(widget);
            }
        }
        // Bail if there are no effective widgets.
        if (widgets.length === 0) {
            return null;
        }
        // Normalize the current index.
        let index = config.currentIndex;
        if (index !== -1 && (index < 0 || index >= widgets.length)) {
            index = 0;
        }
        // Return a normalized config object.
        return { type: 'tab-area', widgets, currentIndex: index };
    }
    /**
     * Normalize a split area config and collect the visited widgets.
     */
    function normalizeSplitAreaConfig(config, widgetSet) {
        // Set up the result variables.
        let orientation = config.orientation;
        let children = [];
        let sizes = [];
        // Normalize the config children.
        for (let i = 0, n = config.children.length; i < n; ++i) {
            // Normalize the child config.
            let child = normalizeAreaConfig(config.children[i], widgetSet);
            // Ignore an empty child.
            if (!child) {
                continue;
            }
            // Add the child or hoist its content as appropriate.
            if (child.type === 'tab-area' || child.orientation !== orientation) {
                children.push(child);
                sizes.push(Math.abs(config.sizes[i] || 0));
            }
            else {
                children.push(...child.children);
                sizes.push(...child.sizes);
            }
        }
        // Bail if there are no effective children.
        if (children.length === 0) {
            return null;
        }
        // If there is only one effective child, return that child.
        if (children.length === 1) {
            return children[0];
        }
        // Return a normalized config object.
        return { type: 'split-area', orientation, children, sizes };
    }
    /**
     * Convert a normalized tab area config into a layout tree.
     */
    function realizeTabAreaConfig(config, renderer, document) {
        // Create the tab bar for the layout node.
        let tabBar = renderer.createTabBar(document);
        // Hide each widget and add it to the tab bar.
        for (const widget of config.widgets) {
            widget.hide();
            tabBar.addTab(widget.title);
            Private.addAria(widget, tabBar);
        }
        // Set the current index of the tab bar.
        tabBar.currentIndex = config.currentIndex;
        // Return the new tab layout node.
        return new TabLayoutNode(tabBar);
    }
    /**
     * Convert a normalized split area config into a layout tree.
     */
    function realizeSplitAreaConfig(config, renderer, document) {
        // Create the split layout node.
        let node = new SplitLayoutNode(config.orientation);
        // Add each child to the layout node.
        config.children.forEach((child, i) => {
            // Create the child data for the layout node.
            let childNode = realizeAreaConfig(child, renderer, document);
            let sizer = createSizer(config.sizes[i]);
            let handle = renderer.createHandle();
            // Add the child data to the layout node.
            node.children.push(childNode);
            node.handles.push(handle);
            node.sizers.push(sizer);
            // Update the parent for the child node.
            childNode.parent = node;
        });
        // Synchronize the handle state for the layout node.
        node.syncHandles();
        // Normalize the sizes for the layout node.
        node.normalizeSizes();
        // Return the new layout node.
        return node;
    }
})(Private$6 || (Private$6 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A widget which provides a flexible docking area for widgets.
 *
 * #### Notes
 * See also the related [example](../../examples/dockpanel/index.html) and
 * its [source](https://github.com/jupyterlab/lumino/tree/main/examples/example-dockpanel).
 */
class DockPanel extends Widget {
    /**
     * Construct a new dock panel.
     *
     * @param options - The options for initializing the panel.
     */
    constructor(options = {}) {
        super();
        this._drag = null;
        this._tabsMovable = true;
        this._tabsConstrained = false;
        this._addButtonEnabled = false;
        this._pressData = null;
        this._layoutModified = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._addRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this.addClass('lm-DockPanel');
        this._document = options.document || document;
        this._mode = options.mode || 'multiple-document';
        this._renderer = options.renderer || DockPanel.defaultRenderer;
        this._edges = options.edges || Private$5.DEFAULT_EDGES;
        if (options.tabsMovable !== undefined) {
            this._tabsMovable = options.tabsMovable;
        }
        if (options.tabsConstrained !== undefined) {
            this._tabsConstrained = options.tabsConstrained;
        }
        if (options.addButtonEnabled !== undefined) {
            this._addButtonEnabled = options.addButtonEnabled;
        }
        // Toggle the CSS mode attribute.
        this.dataset['mode'] = this._mode;
        // Create the delegate renderer for the layout.
        let renderer = {
            createTabBar: () => this._createTabBar(),
            createHandle: () => this._createHandle()
        };
        // Set up the dock layout for the panel.
        this.layout = new DockLayout({
            document: this._document,
            renderer,
            spacing: options.spacing,
            hiddenMode: options.hiddenMode
        });
        // Set up the overlay drop indicator.
        this.overlay = options.overlay || new DockPanel.Overlay();
        this.node.appendChild(this.overlay.node);
    }
    /**
     * Dispose of the resources held by the panel.
     */
    dispose() {
        // Ensure the mouse is released.
        this._releaseMouse();
        // Hide the overlay.
        this.overlay.hide(0);
        // Cancel a drag if one is in progress.
        if (this._drag) {
            this._drag.dispose();
        }
        // Dispose of the base class.
        super.dispose();
    }
    /**
     * The method for hiding widgets.
     */
    get hiddenMode() {
        return this.layout.hiddenMode;
    }
    /**
     * Set the method for hiding widgets.
     */
    set hiddenMode(v) {
        this.layout.hiddenMode = v;
    }
    /**
     * A signal emitted when the layout configuration is modified.
     *
     * #### Notes
     * This signal is emitted whenever the current layout configuration
     * may have changed.
     *
     * This signal is emitted asynchronously in a collapsed fashion, so
     * that multiple synchronous modifications results in only a single
     * emit of the signal.
     */
    get layoutModified() {
        return this._layoutModified;
    }
    /**
     * A signal emitted when the add button on a tab bar is clicked.
     *
     */
    get addRequested() {
        return this._addRequested;
    }
    /**
     * The renderer used by the dock panel.
     */
    get renderer() {
        return this.layout.renderer;
    }
    /**
     * Get the spacing between the widgets.
     */
    get spacing() {
        return this.layout.spacing;
    }
    /**
     * Set the spacing between the widgets.
     */
    set spacing(value) {
        this.layout.spacing = value;
    }
    /**
     * Get the mode for the dock panel.
     */
    get mode() {
        return this._mode;
    }
    /**
     * Set the mode for the dock panel.
     *
     * #### Notes
     * Changing the mode is a destructive operation with respect to the
     * panel's layout configuration. If layout state must be preserved,
     * save the current layout config before changing the mode.
     */
    set mode(value) {
        // Bail early if the mode does not change.
        if (this._mode === value) {
            return;
        }
        // Update the internal mode.
        this._mode = value;
        // Toggle the CSS mode attribute.
        this.dataset['mode'] = value;
        // Get the layout for the panel.
        let layout = this.layout;
        // Configure the layout for the specified mode.
        switch (value) {
            case 'multiple-document':
                for (const tabBar of layout.tabBars()) {
                    tabBar.show();
                }
                break;
            case 'single-document':
                layout.restoreLayout(Private$5.createSingleDocumentConfig(this));
                break;
            default:
                throw 'unreachable';
        }
        // Schedule an emit of the layout modified signal.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
    }
    /**
     * Whether the tabs can be dragged / moved at runtime.
     */
    get tabsMovable() {
        return this._tabsMovable;
    }
    /**
     * Enable / Disable draggable / movable tabs.
     */
    set tabsMovable(value) {
        this._tabsMovable = value;
        for (const tabBar of this.tabBars()) {
            tabBar.tabsMovable = value;
        }
    }
    /**
     * Whether the tabs are constrained to their source dock panel
     */
    get tabsConstrained() {
        return this._tabsConstrained;
    }
    /**
     * Constrain/Allow tabs to be dragged outside of this dock panel
     */
    set tabsConstrained(value) {
        this._tabsConstrained = value;
    }
    /**
     * Whether the add buttons for each tab bar are enabled.
     */
    get addButtonEnabled() {
        return this._addButtonEnabled;
    }
    /**
     * Set whether the add buttons for each tab bar are enabled.
     */
    set addButtonEnabled(value) {
        this._addButtonEnabled = value;
        for (const tabBar of this.tabBars()) {
            tabBar.addButtonEnabled = value;
        }
    }
    /**
     * Whether the dock panel is empty.
     */
    get isEmpty() {
        return this.layout.isEmpty;
    }
    /**
     * Create an iterator over the user widgets in the panel.
     *
     * @returns A new iterator over the user widgets in the panel.
     *
     * #### Notes
     * This iterator does not include the generated tab bars.
     */
    *widgets() {
        yield* this.layout.widgets();
    }
    /**
     * Create an iterator over the selected widgets in the panel.
     *
     * @returns A new iterator over the selected user widgets.
     *
     * #### Notes
     * This iterator yields the widgets corresponding to the current tab
     * of each tab bar in the panel.
     */
    *selectedWidgets() {
        yield* this.layout.selectedWidgets();
    }
    /**
     * Create an iterator over the tab bars in the panel.
     *
     * @returns A new iterator over the tab bars in the panel.
     *
     * #### Notes
     * This iterator does not include the user widgets.
     */
    *tabBars() {
        yield* this.layout.tabBars();
    }
    /**
     * Create an iterator over the handles in the panel.
     *
     * @returns A new iterator over the handles in the panel.
     */
    *handles() {
        yield* this.layout.handles();
    }
    /**
     * Select a specific widget in the dock panel.
     *
     * @param widget - The widget of interest.
     *
     * #### Notes
     * This will make the widget the current widget in its tab area.
     */
    selectWidget(widget) {
        // Find the tab bar which contains the widget.
        let tabBar = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.find)(this.tabBars(), bar => {
            return bar.titles.indexOf(widget.title) !== -1;
        });
        // Throw an error if no tab bar is found.
        if (!tabBar) {
            throw new Error('Widget is not contained in the dock panel.');
        }
        // Ensure the widget is the current widget.
        tabBar.currentTitle = widget.title;
    }
    /**
     * Activate a specified widget in the dock panel.
     *
     * @param widget - The widget of interest.
     *
     * #### Notes
     * This will select and activate the given widget.
     */
    activateWidget(widget) {
        this.selectWidget(widget);
        widget.activate();
    }
    /**
     * Save the current layout configuration of the dock panel.
     *
     * @returns A new config object for the current layout state.
     *
     * #### Notes
     * The return value can be provided to the `restoreLayout` method
     * in order to restore the layout to its current configuration.
     */
    saveLayout() {
        return this.layout.saveLayout();
    }
    /**
     * Restore the layout to a previously saved configuration.
     *
     * @param config - The layout configuration to restore.
     *
     * #### Notes
     * Widgets which currently belong to the layout but which are not
     * contained in the config will be unparented.
     *
     * The dock panel automatically reverts to `'multiple-document'`
     * mode when a layout config is restored.
     */
    restoreLayout(config) {
        // Reset the mode.
        this._mode = 'multiple-document';
        // Restore the layout.
        this.layout.restoreLayout(config);
        // Flush the message loop on IE and Edge to prevent flicker.
        if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Platform.IS_EDGE || _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Platform.IS_IE) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.flush();
        }
        // Schedule an emit of the layout modified signal.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
    }
    /**
     * Add a widget to the dock panel.
     *
     * @param widget - The widget to add to the dock panel.
     *
     * @param options - The additional options for adding the widget.
     *
     * #### Notes
     * If the panel is in single document mode, the options are ignored
     * and the widget is always added as tab in the hidden tab bar.
     */
    addWidget(widget, options = {}) {
        // Add the widget to the layout.
        if (this._mode === 'single-document') {
            this.layout.addWidget(widget);
        }
        else {
            this.layout.addWidget(widget, options);
        }
        // Schedule an emit of the layout modified signal.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
    }
    /**
     * Process a message sent to the widget.
     *
     * @param msg - The message sent to the widget.
     */
    processMessage(msg) {
        if (msg.type === 'layout-modified') {
            this._layoutModified.emit(undefined);
        }
        else {
            super.processMessage(msg);
        }
    }
    /**
     * Handle the DOM events for the dock panel.
     *
     * @param event - The DOM event sent to the panel.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the panel's DOM node. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'lm-dragenter':
                this._evtDragEnter(event);
                break;
            case 'lm-dragleave':
                this._evtDragLeave(event);
                break;
            case 'lm-dragover':
                this._evtDragOver(event);
                break;
            case 'lm-drop':
                this._evtDrop(event);
                break;
            case 'pointerdown':
                this._evtPointerDown(event);
                break;
            case 'pointermove':
                this._evtPointerMove(event);
                break;
            case 'pointerup':
                this._evtPointerUp(event);
                break;
            case 'keydown':
                this._evtKeyDown(event);
                break;
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('lm-dragenter', this);
        this.node.addEventListener('lm-dragleave', this);
        this.node.addEventListener('lm-dragover', this);
        this.node.addEventListener('lm-drop', this);
        this.node.addEventListener('pointerdown', this);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('lm-dragenter', this);
        this.node.removeEventListener('lm-dragleave', this);
        this.node.removeEventListener('lm-dragover', this);
        this.node.removeEventListener('lm-drop', this);
        this.node.removeEventListener('pointerdown', this);
        this._releaseMouse();
    }
    /**
     * A message handler invoked on a `'child-added'` message.
     */
    onChildAdded(msg) {
        // Ignore the generated tab bars.
        if (Private$5.isGeneratedTabBarProperty.get(msg.child)) {
            return;
        }
        // Add the widget class to the child.
        msg.child.addClass('lm-DockPanel-widget');
    }
    /**
     * A message handler invoked on a `'child-removed'` message.
     */
    onChildRemoved(msg) {
        // Ignore the generated tab bars.
        if (Private$5.isGeneratedTabBarProperty.get(msg.child)) {
            return;
        }
        // Remove the widget class from the child.
        msg.child.removeClass('lm-DockPanel-widget');
        // Schedule an emit of the layout modified signal.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
    }
    /**
     * Handle the `'lm-dragenter'` event for the dock panel.
     */
    _evtDragEnter(event) {
        // If the factory mime type is present, mark the event as
        // handled in order to get the rest of the drag events.
        if (event.mimeData.hasData('application/vnd.lumino.widget-factory')) {
            event.preventDefault();
            event.stopPropagation();
        }
    }
    /**
     * Handle the `'lm-dragleave'` event for the dock panel.
     */
    _evtDragLeave(event) {
        // Mark the event as handled.
        event.preventDefault();
        if (this._tabsConstrained && event.source !== this)
            return;
        event.stopPropagation();
        // The new target might be a descendant, so we might still handle the drop.
        // Hide asynchronously so that if a lm-dragover event bubbles up to us, the
        // hide is cancelled by the lm-dragover handler's show overlay logic.
        this.overlay.hide(1);
    }
    /**
     * Handle the `'lm-dragover'` event for the dock panel.
     */
    _evtDragOver(event) {
        // Mark the event as handled.
        event.preventDefault();
        // Show the drop indicator overlay and update the drop
        // action based on the drop target zone under the mouse.
        if ((this._tabsConstrained && event.source !== this) ||
            this._showOverlay(event.clientX, event.clientY) === 'invalid') {
            event.dropAction = 'none';
        }
        else {
            event.stopPropagation();
            event.dropAction = event.proposedAction;
        }
    }
    /**
     * Handle the `'lm-drop'` event for the dock panel.
     */
    _evtDrop(event) {
        // Mark the event as handled.
        event.preventDefault();
        // Hide the drop indicator overlay.
        this.overlay.hide(0);
        // Bail if the proposed action is to do nothing.
        if (event.proposedAction === 'none') {
            event.dropAction = 'none';
            return;
        }
        // Find the drop target under the mouse.
        let { clientX, clientY } = event;
        let { zone, target } = Private$5.findDropTarget(this, clientX, clientY, this._edges);
        // Bail if the drop zone is invalid.
        if ((this._tabsConstrained && event.source !== this) ||
            zone === 'invalid') {
            event.dropAction = 'none';
            return;
        }
        // Bail if the factory mime type has invalid data.
        let mimeData = event.mimeData;
        let factory = mimeData.getData('application/vnd.lumino.widget-factory');
        if (typeof factory !== 'function') {
            event.dropAction = 'none';
            return;
        }
        // Bail if the factory does not produce a widget.
        let widget = factory();
        if (!(widget instanceof Widget)) {
            event.dropAction = 'none';
            return;
        }
        // Bail if the widget is an ancestor of the dock panel.
        if (widget.contains(this)) {
            event.dropAction = 'none';
            return;
        }
        // Find the reference widget for the drop target.
        let ref = target ? Private$5.getDropRef(target.tabBar) : null;
        // Add the widget according to the indicated drop zone.
        switch (zone) {
            case 'root-all':
                this.addWidget(widget);
                break;
            case 'root-top':
                this.addWidget(widget, { mode: 'split-top' });
                break;
            case 'root-left':
                this.addWidget(widget, { mode: 'split-left' });
                break;
            case 'root-right':
                this.addWidget(widget, { mode: 'split-right' });
                break;
            case 'root-bottom':
                this.addWidget(widget, { mode: 'split-bottom' });
                break;
            case 'widget-all':
                this.addWidget(widget, { mode: 'tab-after', ref });
                break;
            case 'widget-top':
                this.addWidget(widget, { mode: 'split-top', ref });
                break;
            case 'widget-left':
                this.addWidget(widget, { mode: 'split-left', ref });
                break;
            case 'widget-right':
                this.addWidget(widget, { mode: 'split-right', ref });
                break;
            case 'widget-bottom':
                this.addWidget(widget, { mode: 'split-bottom', ref });
                break;
            case 'widget-tab':
                this.addWidget(widget, { mode: 'tab-after', ref });
                break;
            default:
                throw 'unreachable';
        }
        // Accept the proposed drop action.
        event.dropAction = event.proposedAction;
        // Stop propagation if we have not bailed so far.
        event.stopPropagation();
        // Activate the dropped widget.
        this.activateWidget(widget);
    }
    /**
     * Handle the `'keydown'` event for the dock panel.
     */
    _evtKeyDown(event) {
        // Stop input events during drag.
        event.preventDefault();
        event.stopPropagation();
        // Release the mouse if `Escape` is pressed.
        if (event.keyCode === 27) {
            // Finalize the mouse release.
            this._releaseMouse();
            // Schedule an emit of the layout modified signal.
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
        }
    }
    /**
     * Handle the `'pointerdown'` event for the dock panel.
     */
    _evtPointerDown(event) {
        // Do nothing if the left mouse button is not pressed.
        if (event.button !== 0) {
            return;
        }
        // Find the handle which contains the mouse target, if any.
        let layout = this.layout;
        let target = event.target;
        let handle = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.find)(layout.handles(), handle => handle.contains(target));
        if (!handle) {
            return;
        }
        // Stop the event when a handle is pressed.
        event.preventDefault();
        event.stopPropagation();
        // Add the extra document listeners.
        this._document.addEventListener('keydown', this, true);
        this._document.addEventListener('pointerup', this, true);
        this._document.addEventListener('pointermove', this, true);
        this._document.addEventListener('contextmenu', this, true);
        // Compute the offset deltas for the handle press.
        let rect = handle.getBoundingClientRect();
        let deltaX = event.clientX - rect.left;
        let deltaY = event.clientY - rect.top;
        // Override the cursor and store the press data.
        let style = window.getComputedStyle(handle);
        let override = _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6__.Drag.overrideCursor(style.cursor, this._document);
        this._pressData = { handle, deltaX, deltaY, override };
    }
    /**
     * Handle the `'pointermove'` event for the dock panel.
     */
    _evtPointerMove(event) {
        // Bail early if no drag is in progress.
        if (!this._pressData) {
            return;
        }
        // Stop the event when dragging a handle.
        event.preventDefault();
        event.stopPropagation();
        // Compute the desired offset position for the handle.
        let rect = this.node.getBoundingClientRect();
        let xPos = event.clientX - rect.left - this._pressData.deltaX;
        let yPos = event.clientY - rect.top - this._pressData.deltaY;
        // Set the handle as close to the desired position as possible.
        let layout = this.layout;
        layout.moveHandle(this._pressData.handle, xPos, yPos);
    }
    /**
     * Handle the `'pointerup'` event for the dock panel.
     */
    _evtPointerUp(event) {
        // Do nothing if the left mouse button is not released.
        if (event.button !== 0) {
            return;
        }
        // Stop the event when releasing a handle.
        event.preventDefault();
        event.stopPropagation();
        // Finalize the mouse release.
        this._releaseMouse();
        // Schedule an emit of the layout modified signal.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
    }
    /**
     * Release the mouse grab for the dock panel.
     */
    _releaseMouse() {
        // Bail early if no drag is in progress.
        if (!this._pressData) {
            return;
        }
        // Clear the override cursor.
        this._pressData.override.dispose();
        this._pressData = null;
        // Remove the extra document listeners.
        this._document.removeEventListener('keydown', this, true);
        this._document.removeEventListener('pointerup', this, true);
        this._document.removeEventListener('pointermove', this, true);
        this._document.removeEventListener('contextmenu', this, true);
    }
    /**
     * Show the overlay indicator at the given client position.
     *
     * Returns the drop zone at the specified client position.
     *
     * #### Notes
     * If the position is not over a valid zone, the overlay is hidden.
     */
    _showOverlay(clientX, clientY) {
        // Find the dock target for the given client position.
        let { zone, target } = Private$5.findDropTarget(this, clientX, clientY, this._edges);
        // If the drop zone is invalid, hide the overlay and bail.
        if (zone === 'invalid') {
            this.overlay.hide(100);
            return zone;
        }
        // Setup the variables needed to compute the overlay geometry.
        let top;
        let left;
        let right;
        let bottom;
        let box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.node); // TODO cache this?
        let rect = this.node.getBoundingClientRect();
        // Compute the overlay geometry based on the dock zone.
        switch (zone) {
            case 'root-all':
                top = box.paddingTop;
                left = box.paddingLeft;
                right = box.paddingRight;
                bottom = box.paddingBottom;
                break;
            case 'root-top':
                top = box.paddingTop;
                left = box.paddingLeft;
                right = box.paddingRight;
                bottom = rect.height * Private$5.GOLDEN_RATIO;
                break;
            case 'root-left':
                top = box.paddingTop;
                left = box.paddingLeft;
                right = rect.width * Private$5.GOLDEN_RATIO;
                bottom = box.paddingBottom;
                break;
            case 'root-right':
                top = box.paddingTop;
                left = rect.width * Private$5.GOLDEN_RATIO;
                right = box.paddingRight;
                bottom = box.paddingBottom;
                break;
            case 'root-bottom':
                top = rect.height * Private$5.GOLDEN_RATIO;
                left = box.paddingLeft;
                right = box.paddingRight;
                bottom = box.paddingBottom;
                break;
            case 'widget-all':
                top = target.top;
                left = target.left;
                right = target.right;
                bottom = target.bottom;
                break;
            case 'widget-top':
                top = target.top;
                left = target.left;
                right = target.right;
                bottom = target.bottom + target.height / 2;
                break;
            case 'widget-left':
                top = target.top;
                left = target.left;
                right = target.right + target.width / 2;
                bottom = target.bottom;
                break;
            case 'widget-right':
                top = target.top;
                left = target.left + target.width / 2;
                right = target.right;
                bottom = target.bottom;
                break;
            case 'widget-bottom':
                top = target.top + target.height / 2;
                left = target.left;
                right = target.right;
                bottom = target.bottom;
                break;
            case 'widget-tab': {
                const tabHeight = target.tabBar.node.getBoundingClientRect().height;
                top = target.top;
                left = target.left;
                right = target.right;
                bottom = target.bottom + target.height - tabHeight;
                break;
            }
            default:
                throw 'unreachable';
        }
        // Show the overlay with the computed geometry.
        this.overlay.show({ top, left, right, bottom });
        // Finally, return the computed drop zone.
        return zone;
    }
    /**
     * Create a new tab bar for use by the panel.
     */
    _createTabBar() {
        // Create the tab bar.
        let tabBar = this._renderer.createTabBar(this._document);
        // Set the generated tab bar property for the tab bar.
        Private$5.isGeneratedTabBarProperty.set(tabBar, true);
        // Hide the tab bar when in single document mode.
        if (this._mode === 'single-document') {
            tabBar.hide();
        }
        // Enforce necessary tab bar behavior.
        // TODO do we really want to enforce *all* of these?
        tabBar.tabsMovable = this._tabsMovable;
        tabBar.allowDeselect = false;
        tabBar.addButtonEnabled = this._addButtonEnabled;
        tabBar.removeBehavior = 'select-previous-tab';
        tabBar.insertBehavior = 'select-tab-if-needed';
        // Connect the signal handlers for the tab bar.
        tabBar.tabMoved.connect(this._onTabMoved, this);
        tabBar.currentChanged.connect(this._onCurrentChanged, this);
        tabBar.tabCloseRequested.connect(this._onTabCloseRequested, this);
        tabBar.tabDetachRequested.connect(this._onTabDetachRequested, this);
        tabBar.tabActivateRequested.connect(this._onTabActivateRequested, this);
        tabBar.addRequested.connect(this._onTabAddRequested, this);
        // Return the initialized tab bar.
        return tabBar;
    }
    /**
     * Create a new handle for use by the panel.
     */
    _createHandle() {
        return this._renderer.createHandle();
    }
    /**
     * Handle the `tabMoved` signal from a tab bar.
     */
    _onTabMoved() {
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
    }
    /**
     * Handle the `currentChanged` signal from a tab bar.
     */
    _onCurrentChanged(sender, args) {
        // Extract the previous and current title from the args.
        let { previousTitle, currentTitle } = args;
        // Hide the previous widget.
        if (previousTitle) {
            previousTitle.owner.hide();
        }
        // Show the current widget.
        if (currentTitle) {
            currentTitle.owner.show();
        }
        // Flush the message loop on IE and Edge to prevent flicker.
        if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Platform.IS_EDGE || _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Platform.IS_IE) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.flush();
        }
        // Schedule an emit of the layout modified signal.
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.postMessage(this, Private$5.LayoutModified);
    }
    /**
     * Handle the `addRequested` signal from a tab bar.
     */
    _onTabAddRequested(sender) {
        this._addRequested.emit(sender);
    }
    /**
     * Handle the `tabActivateRequested` signal from a tab bar.
     */
    _onTabActivateRequested(sender, args) {
        args.title.owner.activate();
    }
    /**
     * Handle the `tabCloseRequested` signal from a tab bar.
     */
    _onTabCloseRequested(sender, args) {
        args.title.owner.close();
    }
    /**
     * Handle the `tabDetachRequested` signal from a tab bar.
     */
    _onTabDetachRequested(sender, args) {
        // Do nothing if a drag is already in progress.
        if (this._drag) {
            return;
        }
        // Release the tab bar's hold on the mouse.
        sender.releaseMouse();
        // Extract the data from the args.
        let { title, tab, clientX, clientY, offset } = args;
        // Setup the mime data for the drag operation.
        let mimeData = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.MimeData();
        let factory = () => title.owner;
        mimeData.setData('application/vnd.lumino.widget-factory', factory);
        // Create the drag image for the drag operation.
        let dragImage = tab.cloneNode(true);
        if (offset) {
            dragImage.style.top = `-${offset.y}px`;
            dragImage.style.left = `-${offset.x}px`;
        }
        // Create the drag object to manage the drag-drop operation.
        this._drag = new _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6__.Drag({
            document: this._document,
            mimeData,
            dragImage,
            proposedAction: 'move',
            supportedActions: 'move',
            source: this
        });
        // Hide the tab node in the original tab.
        tab.classList.add('lm-mod-hidden');
        let cleanup = () => {
            this._drag = null;
            tab.classList.remove('lm-mod-hidden');
        };
        // Start the drag operation and cleanup when done.
        this._drag.start(clientX, clientY).then(cleanup);
    }
}
/**
 * The namespace for the `DockPanel` class statics.
 */
(function (DockPanel) {
    /**
     * A concrete implementation of `IOverlay`.
     *
     * This is the default overlay implementation for a dock panel.
     */
    class Overlay {
        /**
         * Construct a new overlay.
         */
        constructor() {
            this._timer = -1;
            this._hidden = true;
            this.node = document.createElement('div');
            this.node.classList.add('lm-DockPanel-overlay');
            this.node.classList.add('lm-mod-hidden');
            this.node.style.position = 'absolute';
            this.node.style.contain = 'strict';
        }
        /**
         * Show the overlay using the given overlay geometry.
         *
         * @param geo - The desired geometry for the overlay.
         */
        show(geo) {
            // Update the position of the overlay.
            let style = this.node.style;
            style.top = `${geo.top}px`;
            style.left = `${geo.left}px`;
            style.right = `${geo.right}px`;
            style.bottom = `${geo.bottom}px`;
            // Clear any pending hide timer.
            clearTimeout(this._timer);
            this._timer = -1;
            // If the overlay is already visible, we're done.
            if (!this._hidden) {
                return;
            }
            // Clear the hidden flag.
            this._hidden = false;
            // Finally, show the overlay.
            this.node.classList.remove('lm-mod-hidden');
        }
        /**
         * Hide the overlay node.
         *
         * @param delay - The delay (in ms) before hiding the overlay.
         *   A delay value <= 0 will hide the overlay immediately.
         */
        hide(delay) {
            // Do nothing if the overlay is already hidden.
            if (this._hidden) {
                return;
            }
            // Hide immediately if the delay is <= 0.
            if (delay <= 0) {
                clearTimeout(this._timer);
                this._timer = -1;
                this._hidden = true;
                this.node.classList.add('lm-mod-hidden');
                return;
            }
            // Do nothing if a hide is already pending.
            if (this._timer !== -1) {
                return;
            }
            // Otherwise setup the hide timer.
            this._timer = window.setTimeout(() => {
                this._timer = -1;
                this._hidden = true;
                this.node.classList.add('lm-mod-hidden');
            }, delay);
        }
    }
    DockPanel.Overlay = Overlay;
    /**
     * The default implementation of `IRenderer`.
     */
    class Renderer {
        /**
         * Create a new tab bar for use with a dock panel.
         *
         * @returns A new tab bar for a dock panel.
         */
        createTabBar(document) {
            let bar = new TabBar({ document });
            bar.addClass('lm-DockPanel-tabBar');
            return bar;
        }
        /**
         * Create a new handle node for use with a dock panel.
         *
         * @returns A new handle node for a dock panel.
         */
        createHandle() {
            let handle = document.createElement('div');
            handle.className = 'lm-DockPanel-handle';
            return handle;
        }
    }
    DockPanel.Renderer = Renderer;
    /**
     * The default `Renderer` instance.
     */
    DockPanel.defaultRenderer = new Renderer();
})(DockPanel || (DockPanel = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$5;
(function (Private) {
    /**
     * A fraction used for sizing root panels; ~= `1 / golden_ratio`.
     */
    Private.GOLDEN_RATIO = 0.618;
    /**
     * The default sizes for the edge drop zones, in pixels.
     */
    Private.DEFAULT_EDGES = {
        /**
         * The size of the top edge dock zone for the root panel, in pixels.
         * This is different from the others to distinguish between the top
         * tab bar and the top root zone.
         */
        top: 12,
        /**
         * The size of the edge dock zone for the root panel, in pixels.
         */
        right: 40,
        /**
         * The size of the edge dock zone for the root panel, in pixels.
         */
        bottom: 40,
        /**
         * The size of the edge dock zone for the root panel, in pixels.
         */
        left: 40
    };
    /**
     * A singleton `'layout-modified'` conflatable message.
     */
    Private.LayoutModified = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.ConflatableMessage('layout-modified');
    /**
     * An attached property used to track generated tab bars.
     */
    Private.isGeneratedTabBarProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'isGeneratedTabBar',
        create: () => false
    });
    /**
     * Create a single document config for the widgets in a dock panel.
     */
    function createSingleDocumentConfig(panel) {
        // Return an empty config if the panel is empty.
        if (panel.isEmpty) {
            return { main: null };
        }
        // Get a flat array of the widgets in the panel.
        let widgets = Array.from(panel.widgets());
        // Get the first selected widget in the panel.
        let selected = panel.selectedWidgets().next().value;
        // Compute the current index for the new config.
        let currentIndex = selected ? widgets.indexOf(selected) : -1;
        // Return the single document config.
        return { main: { type: 'tab-area', widgets, currentIndex } };
    }
    Private.createSingleDocumentConfig = createSingleDocumentConfig;
    /**
     * Find the drop target at the given client position.
     */
    function findDropTarget(panel, clientX, clientY, edges) {
        // Bail if the mouse is not over the dock panel.
        if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(panel.node, clientX, clientY)) {
            return { zone: 'invalid', target: null };
        }
        // Look up the layout for the panel.
        let layout = panel.layout;
        // If the layout is empty, indicate the entire root drop zone.
        if (layout.isEmpty) {
            return { zone: 'root-all', target: null };
        }
        // Test the edge zones when in multiple document mode.
        if (panel.mode === 'multiple-document') {
            // Get the client rect for the dock panel.
            let panelRect = panel.node.getBoundingClientRect();
            // Compute the distance to each edge of the panel.
            let pl = clientX - panelRect.left + 1;
            let pt = clientY - panelRect.top + 1;
            let pr = panelRect.right - clientX;
            let pb = panelRect.bottom - clientY;
            // Find the minimum distance to an edge.
            let pd = Math.min(pt, pr, pb, pl);
            // Return a root zone if the mouse is within an edge.
            switch (pd) {
                case pt:
                    if (pt < edges.top) {
                        return { zone: 'root-top', target: null };
                    }
                    break;
                case pr:
                    if (pr < edges.right) {
                        return { zone: 'root-right', target: null };
                    }
                    break;
                case pb:
                    if (pb < edges.bottom) {
                        return { zone: 'root-bottom', target: null };
                    }
                    break;
                case pl:
                    if (pl < edges.left) {
                        return { zone: 'root-left', target: null };
                    }
                    break;
                default:
                    throw 'unreachable';
            }
        }
        // Hit test the dock layout at the given client position.
        let target = layout.hitTestTabAreas(clientX, clientY);
        // Bail if no target area was found.
        if (!target) {
            return { zone: 'invalid', target: null };
        }
        // Return the whole tab area when in single document mode.
        if (panel.mode === 'single-document') {
            return { zone: 'widget-all', target };
        }
        // Compute the distance to each edge of the tab area.
        let al = target.x - target.left + 1;
        let at = target.y - target.top + 1;
        let ar = target.left + target.width - target.x;
        let ab = target.top + target.height - target.y;
        const tabHeight = target.tabBar.node.getBoundingClientRect().height;
        if (at < tabHeight) {
            return { zone: 'widget-tab', target };
        }
        // Get the X and Y edge sizes for the area.
        let rx = Math.round(target.width / 3);
        let ry = Math.round(target.height / 3);
        // If the mouse is not within an edge, indicate the entire area.
        if (al > rx && ar > rx && at > ry && ab > ry) {
            return { zone: 'widget-all', target };
        }
        // Scale the distances by the slenderness ratio.
        al /= rx;
        at /= ry;
        ar /= rx;
        ab /= ry;
        // Find the minimum distance to the area edge.
        let ad = Math.min(al, at, ar, ab);
        // Find the widget zone for the area edge.
        let zone;
        switch (ad) {
            case al:
                zone = 'widget-left';
                break;
            case at:
                zone = 'widget-top';
                break;
            case ar:
                zone = 'widget-right';
                break;
            case ab:
                zone = 'widget-bottom';
                break;
            default:
                throw 'unreachable';
        }
        // Return the final drop target.
        return { zone, target };
    }
    Private.findDropTarget = findDropTarget;
    /**
     * Get the drop reference widget for a tab bar.
     */
    function getDropRef(tabBar) {
        if (tabBar.titles.length === 0) {
            return null;
        }
        if (tabBar.currentTitle) {
            return tabBar.currentTitle.owner;
        }
        return tabBar.titles[tabBar.titles.length - 1].owner;
    }
    Private.getDropRef = getDropRef;
})(Private$5 || (Private$5 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A class which tracks focus among a set of widgets.
 *
 * This class is useful when code needs to keep track of the most
 * recently focused widget(s) among a set of related widgets.
 */
class FocusTracker {
    constructor() {
        this._counter = 0;
        this._widgets = [];
        this._activeWidget = null;
        this._currentWidget = null;
        this._numbers = new Map();
        this._nodes = new Map();
        this._activeChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._currentChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
    }
    /**
     * Dispose of the resources held by the tracker.
     */
    dispose() {
        // Do nothing if the tracker is already disposed.
        if (this._counter < 0) {
            return;
        }
        // Mark the tracker as disposed.
        this._counter = -1;
        // Clear the connections for the tracker.
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal.clearData(this);
        // Remove all event listeners.
        for (const widget of this._widgets) {
            widget.node.removeEventListener('focus', this, true);
            widget.node.removeEventListener('blur', this, true);
        }
        // Clear the internal data structures.
        this._activeWidget = null;
        this._currentWidget = null;
        this._nodes.clear();
        this._numbers.clear();
        this._widgets.length = 0;
    }
    /**
     * A signal emitted when the current widget has changed.
     */
    get currentChanged() {
        return this._currentChanged;
    }
    /**
     * A signal emitted when the active widget has changed.
     */
    get activeChanged() {
        return this._activeChanged;
    }
    /**
     * A flag indicating whether the tracker is disposed.
     */
    get isDisposed() {
        return this._counter < 0;
    }
    /**
     * The current widget in the tracker.
     *
     * #### Notes
     * The current widget is the widget among the tracked widgets which
     * has the *descendant node* which has most recently been focused.
     *
     * The current widget will not be updated if the node loses focus. It
     * will only be updated when a different tracked widget gains focus.
     *
     * If the current widget is removed from the tracker, the previous
     * current widget will be restored.
     *
     * This behavior is intended to follow a user's conceptual model of
     * a semantically "current" widget, where the "last thing of type X"
     * to be interacted with is the "current instance of X", regardless
     * of whether that instance still has focus.
     */
    get currentWidget() {
        return this._currentWidget;
    }
    /**
     * The active widget in the tracker.
     *
     * #### Notes
     * The active widget is the widget among the tracked widgets which
     * has the *descendant node* which is currently focused.
     */
    get activeWidget() {
        return this._activeWidget;
    }
    /**
     * A read only array of the widgets being tracked.
     */
    get widgets() {
        return this._widgets;
    }
    /**
     * Get the focus number for a particular widget in the tracker.
     *
     * @param widget - The widget of interest.
     *
     * @returns The focus number for the given widget, or `-1` if the
     *   widget has not had focus since being added to the tracker, or
     *   is not contained by the tracker.
     *
     * #### Notes
     * The focus number indicates the relative order in which the widgets
     * have gained focus. A widget with a larger number has gained focus
     * more recently than a widget with a smaller number.
     *
     * The `currentWidget` will always have the largest focus number.
     *
     * All widgets start with a focus number of `-1`, which indicates that
     * the widget has not been focused since being added to the tracker.
     */
    focusNumber(widget) {
        let n = this._numbers.get(widget);
        return n === undefined ? -1 : n;
    }
    /**
     * Test whether the focus tracker contains a given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns `true` if the widget is tracked, `false` otherwise.
     */
    has(widget) {
        return this._numbers.has(widget);
    }
    /**
     * Add a widget to the focus tracker.
     *
     * @param widget - The widget of interest.
     *
     * #### Notes
     * A widget will be automatically removed from the tracker if it
     * is disposed after being added.
     *
     * If the widget is already tracked, this is a no-op.
     */
    add(widget) {
        // Do nothing if the widget is already tracked.
        if (this._numbers.has(widget)) {
            return;
        }
        // Test whether the widget has focus.
        let focused = widget.node.contains(document.activeElement);
        // Set up the initial focus number.
        let n = focused ? this._counter++ : -1;
        // Add the widget to the internal data structures.
        this._widgets.push(widget);
        this._numbers.set(widget, n);
        this._nodes.set(widget.node, widget);
        // Set up the event listeners. The capturing phase must be used
        // since the 'focus' and 'blur' events don't bubble and Firefox
        // doesn't support the 'focusin' or 'focusout' events.
        widget.node.addEventListener('focus', this, true);
        widget.node.addEventListener('blur', this, true);
        // Connect the disposed signal handler.
        widget.disposed.connect(this._onWidgetDisposed, this);
        // Set the current and active widgets if needed.
        if (focused) {
            this._setWidgets(widget, widget);
        }
    }
    /**
     * Remove a widget from the focus tracker.
     *
     * #### Notes
     * If the widget is the `currentWidget`, the previous current widget
     * will become the new `currentWidget`.
     *
     * A widget will be automatically removed from the tracker if it
     * is disposed after being added.
     *
     * If the widget is not tracked, this is a no-op.
     */
    remove(widget) {
        // Bail early if the widget is not tracked.
        if (!this._numbers.has(widget)) {
            return;
        }
        // Disconnect the disposed signal handler.
        widget.disposed.disconnect(this._onWidgetDisposed, this);
        // Remove the event listeners.
        widget.node.removeEventListener('focus', this, true);
        widget.node.removeEventListener('blur', this, true);
        // Remove the widget from the internal data structures.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeFirstOf(this._widgets, widget);
        this._nodes.delete(widget.node);
        this._numbers.delete(widget);
        // Bail early if the widget is not the current widget.
        if (this._currentWidget !== widget) {
            return;
        }
        // Filter the widgets for those which have had focus.
        let valid = this._widgets.filter(w => this._numbers.get(w) !== -1);
        // Get the valid widget with the max focus number.
        let previous = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.max)(valid, (first, second) => {
            let a = this._numbers.get(first);
            let b = this._numbers.get(second);
            return a - b;
        }) || null;
        // Set the current and active widgets.
        this._setWidgets(previous, null);
    }
    /**
     * Handle the DOM events for the focus tracker.
     *
     * @param event - The DOM event sent to the panel.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the tracked nodes. It should
     * not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'focus':
                this._evtFocus(event);
                break;
            case 'blur':
                this._evtBlur(event);
                break;
        }
    }
    /**
     * Set the current and active widgets for the tracker.
     */
    _setWidgets(current, active) {
        // Swap the current widget.
        let oldCurrent = this._currentWidget;
        this._currentWidget = current;
        // Swap the active widget.
        let oldActive = this._activeWidget;
        this._activeWidget = active;
        // Emit the `currentChanged` signal if needed.
        if (oldCurrent !== current) {
            this._currentChanged.emit({ oldValue: oldCurrent, newValue: current });
        }
        // Emit the `activeChanged` signal if needed.
        if (oldActive !== active) {
            this._activeChanged.emit({ oldValue: oldActive, newValue: active });
        }
    }
    /**
     * Handle the `'focus'` event for a tracked widget.
     */
    _evtFocus(event) {
        // Find the widget which gained focus, which is known to exist.
        let widget = this._nodes.get(event.currentTarget);
        // Update the focus number if necessary.
        if (widget !== this._currentWidget) {
            this._numbers.set(widget, this._counter++);
        }
        // Set the current and active widgets.
        this._setWidgets(widget, widget);
    }
    /**
     * Handle the `'blur'` event for a tracked widget.
     */
    _evtBlur(event) {
        // Find the widget which lost focus, which is known to exist.
        let widget = this._nodes.get(event.currentTarget);
        // Get the node which being focused after this blur.
        let focusTarget = event.relatedTarget;
        // If no other node is being focused, clear the active widget.
        if (!focusTarget) {
            this._setWidgets(this._currentWidget, null);
            return;
        }
        // Bail if the focus widget is not changing.
        if (widget.node.contains(focusTarget)) {
            return;
        }
        // If no tracked widget is being focused, clear the active widget.
        if (!(0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.find)(this._widgets, w => w.node.contains(focusTarget))) {
            this._setWidgets(this._currentWidget, null);
            return;
        }
    }
    /**
     * Handle the `disposed` signal for a tracked widget.
     */
    _onWidgetDisposed(sender) {
        this.remove(sender);
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A layout which arranges its widgets in a grid.
 */
class GridLayout extends Layout {
    /**
     * Construct a new grid layout.
     *
     * @param options - The options for initializing the layout.
     */
    constructor(options = {}) {
        super(options);
        this._dirty = false;
        this._rowSpacing = 4;
        this._columnSpacing = 4;
        this._items = [];
        this._rowStarts = [];
        this._columnStarts = [];
        this._rowSizers = [new BoxSizer()];
        this._columnSizers = [new BoxSizer()];
        this._box = null;
        if (options.rowCount !== undefined) {
            Private$4.reallocSizers(this._rowSizers, options.rowCount);
        }
        if (options.columnCount !== undefined) {
            Private$4.reallocSizers(this._columnSizers, options.columnCount);
        }
        if (options.rowSpacing !== undefined) {
            this._rowSpacing = Private$4.clampValue(options.rowSpacing);
        }
        if (options.columnSpacing !== undefined) {
            this._columnSpacing = Private$4.clampValue(options.columnSpacing);
        }
    }
    /**
     * Dispose of the resources held by the layout.
     */
    dispose() {
        // Dispose of the widgets and layout items.
        for (const item of this._items) {
            let widget = item.widget;
            item.dispose();
            widget.dispose();
        }
        // Clear the layout state.
        this._box = null;
        this._items.length = 0;
        this._rowStarts.length = 0;
        this._rowSizers.length = 0;
        this._columnStarts.length = 0;
        this._columnSizers.length = 0;
        // Dispose of the rest of the layout.
        super.dispose();
    }
    /**
     * Get the number of rows in the layout.
     */
    get rowCount() {
        return this._rowSizers.length;
    }
    /**
     * Set the number of rows in the layout.
     *
     * #### Notes
     * The minimum row count is `1`.
     */
    set rowCount(value) {
        // Do nothing if the row count does not change.
        if (value === this.rowCount) {
            return;
        }
        // Reallocate the row sizers.
        Private$4.reallocSizers(this._rowSizers, value);
        // Schedule a fit of the parent.
        if (this.parent) {
            this.parent.fit();
        }
    }
    /**
     * Get the number of columns in the layout.
     */
    get columnCount() {
        return this._columnSizers.length;
    }
    /**
     * Set the number of columns in the layout.
     *
     * #### Notes
     * The minimum column count is `1`.
     */
    set columnCount(value) {
        // Do nothing if the column count does not change.
        if (value === this.columnCount) {
            return;
        }
        // Reallocate the column sizers.
        Private$4.reallocSizers(this._columnSizers, value);
        // Schedule a fit of the parent.
        if (this.parent) {
            this.parent.fit();
        }
    }
    /**
     * Get the row spacing for the layout.
     */
    get rowSpacing() {
        return this._rowSpacing;
    }
    /**
     * Set the row spacing for the layout.
     */
    set rowSpacing(value) {
        // Clamp the spacing to the allowed range.
        value = Private$4.clampValue(value);
        // Bail if the spacing does not change
        if (this._rowSpacing === value) {
            return;
        }
        // Update the internal spacing.
        this._rowSpacing = value;
        // Schedule a fit of the parent.
        if (this.parent) {
            this.parent.fit();
        }
    }
    /**
     * Get the column spacing for the layout.
     */
    get columnSpacing() {
        return this._columnSpacing;
    }
    /**
     * Set the col spacing for the layout.
     */
    set columnSpacing(value) {
        // Clamp the spacing to the allowed range.
        value = Private$4.clampValue(value);
        // Bail if the spacing does not change
        if (this._columnSpacing === value) {
            return;
        }
        // Update the internal spacing.
        this._columnSpacing = value;
        // Schedule a fit of the parent.
        if (this.parent) {
            this.parent.fit();
        }
    }
    /**
     * Get the stretch factor for a specific row.
     *
     * @param index - The row index of interest.
     *
     * @returns The stretch factor for the row.
     *
     * #### Notes
     * This returns `-1` if the index is out of range.
     */
    rowStretch(index) {
        let sizer = this._rowSizers[index];
        return sizer ? sizer.stretch : -1;
    }
    /**
     * Set the stretch factor for a specific row.
     *
     * @param index - The row index of interest.
     *
     * @param value - The stretch factor for the row.
     *
     * #### Notes
     * This is a no-op if the index is out of range.
     */
    setRowStretch(index, value) {
        // Look up the row sizer.
        let sizer = this._rowSizers[index];
        // Bail if the index is out of range.
        if (!sizer) {
            return;
        }
        // Clamp the value to the allowed range.
        value = Private$4.clampValue(value);
        // Bail if the stretch does not change.
        if (sizer.stretch === value) {
            return;
        }
        // Update the sizer stretch.
        sizer.stretch = value;
        // Schedule an update of the parent.
        if (this.parent) {
            this.parent.update();
        }
    }
    /**
     * Get the stretch factor for a specific column.
     *
     * @param index - The column index of interest.
     *
     * @returns The stretch factor for the column.
     *
     * #### Notes
     * This returns `-1` if the index is out of range.
     */
    columnStretch(index) {
        let sizer = this._columnSizers[index];
        return sizer ? sizer.stretch : -1;
    }
    /**
     * Set the stretch factor for a specific column.
     *
     * @param index - The column index of interest.
     *
     * @param value - The stretch factor for the column.
     *
     * #### Notes
     * This is a no-op if the index is out of range.
     */
    setColumnStretch(index, value) {
        // Look up the column sizer.
        let sizer = this._columnSizers[index];
        // Bail if the index is out of range.
        if (!sizer) {
            return;
        }
        // Clamp the value to the allowed range.
        value = Private$4.clampValue(value);
        // Bail if the stretch does not change.
        if (sizer.stretch === value) {
            return;
        }
        // Update the sizer stretch.
        sizer.stretch = value;
        // Schedule an update of the parent.
        if (this.parent) {
            this.parent.update();
        }
    }
    /**
     * Create an iterator over the widgets in the layout.
     *
     * @returns A new iterator over the widgets in the layout.
     */
    *[Symbol.iterator]() {
        for (const item of this._items) {
            yield item.widget;
        }
    }
    /**
     * Add a widget to the grid layout.
     *
     * @param widget - The widget to add to the layout.
     *
     * #### Notes
     * If the widget is already contained in the layout, this is no-op.
     */
    addWidget(widget) {
        // Look up the index for the widget.
        let i = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this._items, it => it.widget === widget);
        // Bail if the widget is already in the layout.
        if (i !== -1) {
            return;
        }
        // Add the widget to the layout.
        this._items.push(new LayoutItem(widget));
        // Attach the widget to the parent.
        if (this.parent) {
            this.attachWidget(widget);
        }
    }
    /**
     * Remove a widget from the grid layout.
     *
     * @param widget - The widget to remove from the layout.
     *
     * #### Notes
     * A widget is automatically removed from the layout when its `parent`
     * is set to `null`. This method should only be invoked directly when
     * removing a widget from a layout which has yet to be installed on a
     * parent widget.
     *
     * This method does *not* modify the widget's `parent`.
     */
    removeWidget(widget) {
        // Look up the index for the widget.
        let i = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this._items, it => it.widget === widget);
        // Bail if the widget is not in the layout.
        if (i === -1) {
            return;
        }
        // Remove the widget from the layout.
        let item = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._items, i);
        // Detach the widget from the parent.
        if (this.parent) {
            this.detachWidget(widget);
        }
        // Dispose the layout item.
        item.dispose();
    }
    /**
     * Perform layout initialization which requires the parent widget.
     */
    init() {
        super.init();
        for (const widget of this) {
            this.attachWidget(widget);
        }
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param widget - The widget to attach to the parent.
     */
    attachWidget(widget) {
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Add the widget's node to the parent.
        this.parent.node.appendChild(widget.node);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param widget - The widget to detach from the parent.
     */
    detachWidget(widget) {
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.node.removeChild(widget.node);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'before-show'` message.
     */
    onBeforeShow(msg) {
        super.onBeforeShow(msg);
        this.parent.update();
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        super.onBeforeAttach(msg);
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-shown'` message.
     */
    onChildShown(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-hidden'` message.
     */
    onChildHidden(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'resize'` message.
     */
    onResize(msg) {
        if (this.parent.isVisible) {
            this._update(msg.width, msg.height);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        if (this.parent.isVisible) {
            this._update(-1, -1);
        }
    }
    /**
     * A message handler invoked on a `'fit-request'` message.
     */
    onFitRequest(msg) {
        if (this.parent.isAttached) {
            this._fit();
        }
    }
    /**
     * Fit the layout to the total size required by the widgets.
     */
    _fit() {
        // Reset the min sizes of the sizers.
        for (let i = 0, n = this.rowCount; i < n; ++i) {
            this._rowSizers[i].minSize = 0;
        }
        for (let i = 0, n = this.columnCount; i < n; ++i) {
            this._columnSizers[i].minSize = 0;
        }
        // Filter for the visible layout items.
        let items = this._items.filter(it => !it.isHidden);
        // Fit the layout items.
        for (let i = 0, n = items.length; i < n; ++i) {
            items[i].fit();
        }
        // Get the max row and column index.
        let maxRow = this.rowCount - 1;
        let maxCol = this.columnCount - 1;
        // Sort the items by row span.
        items.sort(Private$4.rowSpanCmp);
        // Update the min sizes of the row sizers.
        for (let i = 0, n = items.length; i < n; ++i) {
            // Fetch the item.
            let item = items[i];
            // Get the row bounds for the item.
            let config = GridLayout.getCellConfig(item.widget);
            let r1 = Math.min(config.row, maxRow);
            let r2 = Math.min(config.row + config.rowSpan - 1, maxRow);
            // Distribute the minimum height to the sizers as needed.
            Private$4.distributeMin(this._rowSizers, r1, r2, item.minHeight);
        }
        // Sort the items by column span.
        items.sort(Private$4.columnSpanCmp);
        // Update the min sizes of the column sizers.
        for (let i = 0, n = items.length; i < n; ++i) {
            // Fetch the item.
            let item = items[i];
            // Get the column bounds for the item.
            let config = GridLayout.getCellConfig(item.widget);
            let c1 = Math.min(config.column, maxCol);
            let c2 = Math.min(config.column + config.columnSpan - 1, maxCol);
            // Distribute the minimum width to the sizers as needed.
            Private$4.distributeMin(this._columnSizers, c1, c2, item.minWidth);
        }
        // If no size constraint is needed, just update the parent.
        if (this.fitPolicy === 'set-no-constraint') {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);
            return;
        }
        // Set up the computed min size.
        let minH = maxRow * this._rowSpacing;
        let minW = maxCol * this._columnSpacing;
        // Add the sizer minimums to the computed min size.
        for (let i = 0, n = this.rowCount; i < n; ++i) {
            minH += this._rowSizers[i].minSize;
        }
        for (let i = 0, n = this.columnCount; i < n; ++i) {
            minW += this._columnSizers[i].minSize;
        }
        // Update the box sizing and add it to the computed min size.
        let box = (this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node));
        minW += box.horizontalSum;
        minH += box.verticalSum;
        // Update the parent's min size constraints.
        let style = this.parent.node.style;
        style.minWidth = `${minW}px`;
        style.minHeight = `${minH}px`;
        // Set the dirty flag to ensure only a single update occurs.
        this._dirty = true;
        // Notify the ancestor that it should fit immediately. This may
        // cause a resize of the parent, fulfilling the required update.
        if (this.parent.parent) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);
        }
        // If the dirty flag is still set, the parent was not resized.
        // Trigger the required update on the parent widget immediately.
        if (this._dirty) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);
        }
    }
    /**
     * Update the layout position and size of the widgets.
     *
     * The parent offset dimensions should be `-1` if unknown.
     */
    _update(offsetWidth, offsetHeight) {
        // Clear the dirty flag to indicate the update occurred.
        this._dirty = false;
        // Measure the parent if the offset dimensions are unknown.
        if (offsetWidth < 0) {
            offsetWidth = this.parent.node.offsetWidth;
        }
        if (offsetHeight < 0) {
            offsetHeight = this.parent.node.offsetHeight;
        }
        // Ensure the parent box sizing data is computed.
        if (!this._box) {
            this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node);
        }
        // Compute the layout area adjusted for border and padding.
        let top = this._box.paddingTop;
        let left = this._box.paddingLeft;
        let width = offsetWidth - this._box.horizontalSum;
        let height = offsetHeight - this._box.verticalSum;
        // Get the max row and column index.
        let maxRow = this.rowCount - 1;
        let maxCol = this.columnCount - 1;
        // Compute the total fixed row and column space.
        let fixedRowSpace = maxRow * this._rowSpacing;
        let fixedColSpace = maxCol * this._columnSpacing;
        // Distribute the available space to the box sizers.
        BoxEngine.calc(this._rowSizers, Math.max(0, height - fixedRowSpace));
        BoxEngine.calc(this._columnSizers, Math.max(0, width - fixedColSpace));
        // Update the row start positions.
        for (let i = 0, pos = top, n = this.rowCount; i < n; ++i) {
            this._rowStarts[i] = pos;
            pos += this._rowSizers[i].size + this._rowSpacing;
        }
        // Update the column start positions.
        for (let i = 0, pos = left, n = this.columnCount; i < n; ++i) {
            this._columnStarts[i] = pos;
            pos += this._columnSizers[i].size + this._columnSpacing;
        }
        // Update the geometry of the layout items.
        for (let i = 0, n = this._items.length; i < n; ++i) {
            // Fetch the item.
            let item = this._items[i];
            // Ignore hidden items.
            if (item.isHidden) {
                continue;
            }
            // Fetch the cell bounds for the widget.
            let config = GridLayout.getCellConfig(item.widget);
            let r1 = Math.min(config.row, maxRow);
            let c1 = Math.min(config.column, maxCol);
            let r2 = Math.min(config.row + config.rowSpan - 1, maxRow);
            let c2 = Math.min(config.column + config.columnSpan - 1, maxCol);
            // Compute the cell geometry.
            let x = this._columnStarts[c1];
            let y = this._rowStarts[r1];
            let w = this._columnStarts[c2] + this._columnSizers[c2].size - x;
            let h = this._rowStarts[r2] + this._rowSizers[r2].size - y;
            // Update the geometry of the layout item.
            item.update(x, y, w, h);
        }
    }
}
/**
 * The namespace for the `GridLayout` class statics.
 */
(function (GridLayout) {
    /**
     * Get the cell config for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @returns The cell config for the widget.
     */
    function getCellConfig(widget) {
        return Private$4.cellConfigProperty.get(widget);
    }
    GridLayout.getCellConfig = getCellConfig;
    /**
     * Set the cell config for the given widget.
     *
     * @param widget - The widget of interest.
     *
     * @param value - The value for the cell config.
     */
    function setCellConfig(widget, value) {
        Private$4.cellConfigProperty.set(widget, Private$4.normalizeConfig(value));
    }
    GridLayout.setCellConfig = setCellConfig;
})(GridLayout || (GridLayout = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$4;
(function (Private) {
    /**
     * The property descriptor for the widget cell config.
     */
    Private.cellConfigProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_4__.AttachedProperty({
        name: 'cellConfig',
        create: () => ({ row: 0, column: 0, rowSpan: 1, columnSpan: 1 }),
        changed: onChildCellConfigChanged
    });
    /**
     * Normalize a partial cell config object.
     */
    function normalizeConfig(config) {
        let row = Math.max(0, Math.floor(config.row || 0));
        let column = Math.max(0, Math.floor(config.column || 0));
        let rowSpan = Math.max(1, Math.floor(config.rowSpan || 0));
        let columnSpan = Math.max(1, Math.floor(config.columnSpan || 0));
        return { row, column, rowSpan, columnSpan };
    }
    Private.normalizeConfig = normalizeConfig;
    /**
     * Clamp a value to an integer >= 0.
     */
    function clampValue(value) {
        return Math.max(0, Math.floor(value));
    }
    Private.clampValue = clampValue;
    /**
     * A sort comparison function for row spans.
     */
    function rowSpanCmp(a, b) {
        let c1 = Private.cellConfigProperty.get(a.widget);
        let c2 = Private.cellConfigProperty.get(b.widget);
        return c1.rowSpan - c2.rowSpan;
    }
    Private.rowSpanCmp = rowSpanCmp;
    /**
     * A sort comparison function for column spans.
     */
    function columnSpanCmp(a, b) {
        let c1 = Private.cellConfigProperty.get(a.widget);
        let c2 = Private.cellConfigProperty.get(b.widget);
        return c1.columnSpan - c2.columnSpan;
    }
    Private.columnSpanCmp = columnSpanCmp;
    /**
     * Reallocate the box sizers for the given grid dimensions.
     */
    function reallocSizers(sizers, count) {
        // Coerce the count to the valid range.
        count = Math.max(1, Math.floor(count));
        // Add the missing sizers.
        while (sizers.length < count) {
            sizers.push(new BoxSizer());
        }
        // Remove the extra sizers.
        if (sizers.length > count) {
            sizers.length = count;
        }
    }
    Private.reallocSizers = reallocSizers;
    /**
     * Distribute a min size constraint across a range of sizers.
     */
    function distributeMin(sizers, i1, i2, minSize) {
        // Sanity check the indices.
        if (i2 < i1) {
            return;
        }
        // Handle the simple case of no cell span.
        if (i1 === i2) {
            let sizer = sizers[i1];
            sizer.minSize = Math.max(sizer.minSize, minSize);
            return;
        }
        // Compute the total current min size of the span.
        let totalMin = 0;
        for (let i = i1; i <= i2; ++i) {
            totalMin += sizers[i].minSize;
        }
        // Do nothing if the total is greater than the required.
        if (totalMin >= minSize) {
            return;
        }
        // Compute the portion of the space to allocate to each sizer.
        let portion = (minSize - totalMin) / (i2 - i1 + 1);
        // Add the portion to each sizer.
        for (let i = i1; i <= i2; ++i) {
            sizers[i].minSize += portion;
        }
    }
    Private.distributeMin = distributeMin;
    /**
     * The change handler for the child cell config property.
     */
    function onChildCellConfigChanged(child) {
        if (child.parent && child.parent.layout instanceof GridLayout) {
            child.parent.fit();
        }
    }
})(Private$4 || (Private$4 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A widget which displays menus as a canonical menu bar.
 *
 * #### Notes
 * See also the related [example](../../examples/menubar/index.html) and
 * its [source](https://github.com/jupyterlab/lumino/tree/main/examples/example-menubar).
 */
class MenuBar extends Widget {
    /**
     * Construct a new menu bar.
     *
     * @param options - The options for initializing the menu bar.
     */
    constructor(options = {}) {
        super({ node: Private$3.createNode() });
        // Track the index of the item that is currently focused or hovered. -1 means nothing focused or hovered.
        this._activeIndex = -1;
        // Track which item can be focused using the TAB key. Unlike _activeIndex will
        // always point to a menuitem. Whenever you update this value, it's important
        // to follow it with an "update-request" message so that the `tabindex`
        // attribute on each menubar item gets properly updated.
        this._tabFocusIndex = 0;
        this._menus = [];
        this._childMenu = null;
        this._overflowMenu = null;
        this._menuItemSizes = [];
        this._overflowIndex = -1;
        this.addClass('lm-MenuBar');
        this.setFlag(Widget.Flag.DisallowLayout);
        this.renderer = options.renderer || MenuBar.defaultRenderer;
        this._forceItemsPosition = options.forceItemsPosition || {
            forceX: true,
            forceY: true
        };
        this._overflowMenuOptions = options.overflowMenuOptions || {
            isVisible: true
        };
    }
    /**
     * Dispose of the resources held by the widget.
     */
    dispose() {
        this._closeChildMenu();
        this._menus.length = 0;
        super.dispose();
    }
    /**
     * The child menu of the menu bar.
     *
     * #### Notes
     * This will be `null` if the menu bar does not have an open menu.
     */
    get childMenu() {
        return this._childMenu;
    }
    /**
     * The overflow index of the menu bar.
     */
    get overflowIndex() {
        return this._overflowIndex;
    }
    /**
     * The overflow menu of the menu bar.
     */
    get overflowMenu() {
        return this._overflowMenu;
    }
    /**
     * Get the menu bar content node.
     *
     * #### Notes
     * This is the node which holds the menu title nodes.
     *
     * Modifying this node directly can lead to undefined behavior.
     */
    get contentNode() {
        return this.node.getElementsByClassName('lm-MenuBar-content')[0];
    }
    /**
     * Get the currently active menu.
     */
    get activeMenu() {
        return this._menus[this._activeIndex] || null;
    }
    /**
     * Set the currently active menu.
     *
     * #### Notes
     * If the menu does not exist, the menu will be set to `null`.
     */
    set activeMenu(value) {
        this.activeIndex = value ? this._menus.indexOf(value) : -1;
    }
    /**
     * Get the index of the currently active menu.
     *
     * #### Notes
     * This will be `-1` if no menu is active.
     */
    get activeIndex() {
        return this._activeIndex;
    }
    /**
     * Set the index of the currently active menu.
     *
     * #### Notes
     * If the menu cannot be activated, the index will be set to `-1`.
     */
    set activeIndex(value) {
        // Adjust the value for an out of range index.
        if (value < 0 || value >= this._menus.length) {
            value = -1;
        }
        // An empty menu cannot be active
        if (value > -1 && this._menus[value].items.length === 0) {
            value = -1;
        }
        // Bail early if the index will not change.
        if (this._activeIndex === value) {
            return;
        }
        // Update the active index.
        this._activeIndex = value;
        // Schedule an update of the items.
        this.update();
    }
    /**
     * A read-only array of the menus in the menu bar.
     */
    get menus() {
        return this._menus;
    }
    /**
     * Open the active menu and activate its first menu item.
     *
     * #### Notes
     * If there is no active menu, this is a no-op.
     */
    openActiveMenu() {
        // Bail early if there is no active item.
        if (this._activeIndex === -1) {
            return;
        }
        // Open the child menu.
        this._openChildMenu();
        // Activate the first item in the child menu.
        if (this._childMenu) {
            this._childMenu.activeIndex = -1;
            this._childMenu.activateNextItem();
        }
    }
    /**
     * Add a menu to the end of the menu bar.
     *
     * @param menu - The menu to add to the menu bar.
     *
     * #### Notes
     * If the menu is already added to the menu bar, it will be moved.
     */
    addMenu(menu, update = true) {
        this.insertMenu(this._menus.length, menu, update);
    }
    /**
     * Insert a menu into the menu bar at the specified index.
     *
     * @param index - The index at which to insert the menu.
     *
     * @param menu - The menu to insert into the menu bar.
     *
     * #### Notes
     * The index will be clamped to the bounds of the menus.
     *
     * If the menu is already added to the menu bar, it will be moved.
     */
    insertMenu(index, menu, update = true) {
        // Close the child menu before making changes.
        this._closeChildMenu();
        // Look up the index of the menu.
        let i = this._menus.indexOf(menu);
        // Clamp the insert index to the array bounds.
        let j = Math.max(0, Math.min(index, this._menus.length));
        // If the menu is not in the array, insert it.
        if (i === -1) {
            // Insert the menu into the array.
            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._menus, j, menu);
            // Add the styling class to the menu.
            menu.addClass('lm-MenuBar-menu');
            // Connect to the menu signals.
            menu.aboutToClose.connect(this._onMenuAboutToClose, this);
            menu.menuRequested.connect(this._onMenuMenuRequested, this);
            menu.title.changed.connect(this._onTitleChanged, this);
            // Schedule an update of the items.
            if (update) {
                this.update();
            }
            // There is nothing more to do.
            return;
        }
        // Otherwise, the menu exists in the array and should be moved.
        // Adjust the index if the location is at the end of the array.
        if (j === this._menus.length) {
            j--;
        }
        // Bail if there is no effective move.
        if (i === j) {
            return;
        }
        // Move the menu to the new locations.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._menus, i, j);
        // Schedule an update of the items.
        if (update) {
            this.update();
        }
    }
    /**
     * Remove a menu from the menu bar.
     *
     * @param menu - The menu to remove from the menu bar.
     *
     * #### Notes
     * This is a no-op if the menu is not in the menu bar.
     */
    removeMenu(menu, update = true) {
        this.removeMenuAt(this._menus.indexOf(menu), update);
    }
    /**
     * Remove the menu at a given index from the menu bar.
     *
     * @param index - The index of the menu to remove.
     *
     * #### Notes
     * This is a no-op if the index is out of range.
     */
    removeMenuAt(index, update = true) {
        // Close the child menu before making changes.
        this._closeChildMenu();
        // Remove the menu from the array.
        let menu = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._menus, index);
        // Bail if the index is out of range.
        if (!menu) {
            return;
        }
        // Disconnect from the menu signals.
        menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);
        menu.menuRequested.disconnect(this._onMenuMenuRequested, this);
        menu.title.changed.disconnect(this._onTitleChanged, this);
        // Remove the styling class from the menu.
        menu.removeClass('lm-MenuBar-menu');
        // Schedule an update of the items.
        if (update) {
            this.update();
        }
    }
    /**
     * Remove all menus from the menu bar.
     */
    clearMenus() {
        // Bail if there is nothing to remove.
        if (this._menus.length === 0) {
            return;
        }
        // Close the child menu before making changes.
        this._closeChildMenu();
        // Disconnect from the menu signals and remove the styling class.
        for (let menu of this._menus) {
            menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);
            menu.menuRequested.disconnect(this._onMenuMenuRequested, this);
            menu.title.changed.disconnect(this._onTitleChanged, this);
            menu.removeClass('lm-MenuBar-menu');
        }
        // Clear the menus array.
        this._menus.length = 0;
        // Schedule an update of the items.
        this.update();
    }
    /**
     * Handle the DOM events for the menu bar.
     *
     * @param event - The DOM event sent to the menu bar.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the menu bar's DOM nodes. It
     * should not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'keydown':
                this._evtKeyDown(event);
                break;
            case 'mousedown':
                this._evtMouseDown(event);
                break;
            case 'mousemove':
            case 'mouseleave':
                this._evtMouseMove(event);
                break;
            case 'focusout':
                this._evtFocusOut(event);
                break;
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
        }
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('keydown', this);
        this.node.addEventListener('mousedown', this);
        this.node.addEventListener('mousemove', this);
        this.node.addEventListener('mouseleave', this);
        this.node.addEventListener('focusout', this);
        this.node.addEventListener('contextmenu', this);
    }
    /**
     * A message handler invoked on an `'after-detach'` message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('keydown', this);
        this.node.removeEventListener('mousedown', this);
        this.node.removeEventListener('mousemove', this);
        this.node.removeEventListener('mouseleave', this);
        this.node.removeEventListener('focusout', this);
        this.node.removeEventListener('contextmenu', this);
        this._closeChildMenu();
    }
    /**
     * A message handler invoked on an `'activate-request'` message.
     */
    onActivateRequest(msg) {
        if (this.isAttached) {
            this._focusItemAt(0);
        }
    }
    /**
     * A message handler invoked on a `'resize'` message.
     */
    onResize(msg) {
        this.update();
        super.onResize(msg);
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        var _a;
        let menus = this._menus;
        let renderer = this.renderer;
        let activeIndex = this._activeIndex;
        let tabFocusIndex = this._tabFocusIndex >= 0 && this._tabFocusIndex < menus.length
            ? this._tabFocusIndex
            : 0;
        let length = this._overflowIndex > -1 ? this._overflowIndex : menus.length;
        let totalMenuSize = 0;
        let isVisible = false;
        // Check that the overflow menu doesn't count
        length = this._overflowMenu !== null ? length - 1 : length;
        let content = new Array(length);
        // Render visible menus
        for (let i = 0; i < length; ++i) {
            content[i] = renderer.renderItem({
                title: menus[i].title,
                active: i === activeIndex,
                tabbable: i === tabFocusIndex,
                disabled: menus[i].items.length === 0,
                onfocus: () => {
                    this._tabFocusIndex = i;
                    this.activeIndex = i;
                }
            });
            // Calculate size of current menu
            totalMenuSize += this._menuItemSizes[i];
            // Check if overflow menu is already rendered
            if (menus[i].title.label === this._overflowMenuOptions.title) {
                isVisible = true;
                length--;
            }
        }
        // Render overflow menu if needed and active
        if (this._overflowMenuOptions.isVisible) {
            if (this._overflowIndex > -1 && !isVisible) {
                // Create overflow menu
                if (this._overflowMenu === null) {
                    const overflowMenuTitle = (_a = this._overflowMenuOptions.title) !== null && _a !== void 0 ? _a : '...';
                    this._overflowMenu = new Menu({ commands: new _lumino_commands__WEBPACK_IMPORTED_MODULE_7__.CommandRegistry() });
                    this._overflowMenu.title.label = overflowMenuTitle;
                    this._overflowMenu.title.mnemonic = 0;
                    this.addMenu(this._overflowMenu, false);
                }
                // Move menus to overflow menu
                for (let i = menus.length - 2; i >= length; i--) {
                    const submenu = this.menus[i];
                    submenu.title.mnemonic = 0;
                    this._overflowMenu.insertItem(0, {
                        type: 'submenu',
                        submenu: submenu
                    });
                    this.removeMenu(submenu, false);
                }
                content[length] = renderer.renderItem({
                    title: this._overflowMenu.title,
                    active: length === activeIndex && menus[length].items.length !== 0,
                    tabbable: length === tabFocusIndex,
                    disabled: menus[length].items.length === 0,
                    onfocus: () => {
                        this._tabFocusIndex = length;
                        this.activeIndex = length;
                    }
                });
                length++;
            }
            else if (this._overflowMenu !== null) {
                // Remove submenus from overflow menu
                let overflowMenuItems = this._overflowMenu.items;
                let screenSize = this.node.offsetWidth;
                let n = this._overflowMenu.items.length;
                for (let i = 0; i < n; ++i) {
                    let index = menus.length - 1 - i;
                    if (screenSize - totalMenuSize > this._menuItemSizes[index]) {
                        let menu = overflowMenuItems[0].submenu;
                        this._overflowMenu.removeItemAt(0);
                        this.insertMenu(length, menu, false);
                        content[length] = renderer.renderItem({
                            title: menu.title,
                            active: false,
                            tabbable: length === tabFocusIndex,
                            disabled: menus[length].items.length === 0,
                            onfocus: () => {
                                this._tabFocusIndex = length;
                                this.activeIndex = length;
                            }
                        });
                        length++;
                    }
                }
                if (this._overflowMenu.items.length === 0) {
                    this.removeMenu(this._overflowMenu, false);
                    content.pop();
                    this._overflowMenu = null;
                    this._overflowIndex = -1;
                }
            }
        }
        _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.render(content, this.contentNode);
        this._updateOverflowIndex();
    }
    /**
     * Calculate and update the current overflow index.
     */
    _updateOverflowIndex() {
        if (!this._overflowMenuOptions.isVisible) {
            return;
        }
        // Get elements visible in the main menu bar
        const itemMenus = this.contentNode.childNodes;
        let screenSize = this.node.offsetWidth;
        let totalMenuSize = 0;
        let index = -1;
        let n = itemMenus.length;
        if (this._menuItemSizes.length == 0) {
            // Check if it is the first resize and get info about menu items sizes
            for (let i = 0; i < n; i++) {
                let item = itemMenus[i];
                // Add sizes to array
                totalMenuSize += item.offsetWidth;
                this._menuItemSizes.push(item.offsetWidth);
                if (totalMenuSize > screenSize && index === -1) {
                    index = i;
                }
            }
        }
        else {
            // Calculate current menu size
            for (let i = 0; i < this._menuItemSizes.length; i++) {
                totalMenuSize += this._menuItemSizes[i];
                if (totalMenuSize > screenSize) {
                    index = i;
                    break;
                }
            }
        }
        this._overflowIndex = index;
    }
    /**
     * Handle the `'keydown'` event for the menu bar.
     *
     * #### Notes
     * All keys are trapped except the tab key that is ignored.
     */
    _evtKeyDown(event) {
        // Fetch the key code for the event.
        let kc = event.keyCode;
        // Reset the active index on tab, but do not trap the tab key.
        if (kc === 9) {
            this.activeIndex = -1;
            return;
        }
        // A menu bar handles all other keydown events.
        event.preventDefault();
        event.stopPropagation();
        // Enter, Space, Up Arrow, Down Arrow
        if (kc === 13 || kc === 32 || kc === 38 || kc === 40) {
            // The active index may have changed (for example, user hovers over an
            // item with the mouse), so be sure to use the focus index.
            this.activeIndex = this._tabFocusIndex;
            if (this.activeIndex !== this._tabFocusIndex) {
                // Bail if the setter refused to set activeIndex to tabFocusIndex
                // because it means that the item at tabFocusIndex cannot be opened (for
                // example, it has an empty menu)
                return;
            }
            this.openActiveMenu();
            return;
        }
        // Escape
        if (kc === 27) {
            this._closeChildMenu();
            this._focusItemAt(this.activeIndex);
            return;
        }
        // Left or Right Arrow
        if (kc === 37 || kc === 39) {
            let direction = kc === 37 ? -1 : 1;
            let start = this._tabFocusIndex + direction;
            let n = this._menus.length;
            for (let i = 0; i < n; i++) {
                let index = (n + start + direction * i) % n;
                if (this._menus[index].items.length) {
                    this._focusItemAt(index);
                    return;
                }
            }
            return;
        }
        // Get the pressed key character.
        let key = (0,_lumino_keyboard__WEBPACK_IMPORTED_MODULE_10__.getKeyboardLayout)().keyForKeydownEvent(event);
        // Bail if the key is not valid.
        if (!key) {
            return;
        }
        // Search for the next best matching mnemonic item.
        let start = this._activeIndex + 1;
        let result = Private$3.findMnemonic(this._menus, key, start);
        // Handle the requested mnemonic based on the search results.
        // If exactly one mnemonic is matched, that menu is opened.
        // Otherwise, the next mnemonic is activated if available,
        // followed by the auto mnemonic if available.
        if (result.index !== -1 && !result.multiple) {
            this.activeIndex = result.index;
            this.openActiveMenu();
        }
        else if (result.index !== -1) {
            this.activeIndex = result.index;
            this._focusItemAt(this.activeIndex);
        }
        else if (result.auto !== -1) {
            this.activeIndex = result.auto;
            this._focusItemAt(this.activeIndex);
        }
    }
    /**
     * Handle the `'mousedown'` event for the menu bar.
     */
    _evtMouseDown(event) {
        // Bail if the mouse press was not on the menu bar. This can occur
        // when the document listener is installed for an active menu bar.
        if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(this.node, event.clientX, event.clientY)) {
            return;
        }
        // Stop the propagation of the event. Immediate propagation is
        // also stopped so that an open menu does not handle the event.
        event.stopPropagation();
        event.stopImmediatePropagation();
        // Check if the mouse is over one of the menu items.
        let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.contentNode.children, node => {
            return _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(node, event.clientX, event.clientY);
        });
        // If the press was not on an item, close the child menu.
        if (index === -1) {
            this._closeChildMenu();
            return;
        }
        // If the press was not the left mouse button, do nothing further.
        if (event.button !== 0) {
            return;
        }
        // Otherwise, toggle the open state of the child menu.
        if (this._childMenu) {
            this._closeChildMenu();
            this.activeIndex = index;
        }
        else {
            // If we don't call preventDefault() here, then the item in the menu
            // bar will take focus over the menu that is being opened.
            event.preventDefault();
            const position = this._positionForMenu(index);
            Menu.saveWindowData();
            // Begin DOM modifications.
            this.activeIndex = index;
            this._openChildMenu(position);
        }
    }
    /**
     * Handle the `'mousemove'` event for the menu bar.
     */
    _evtMouseMove(event) {
        // Check if the mouse is over one of the menu items.
        let index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.findFirstIndex(this.contentNode.children, node => {
            return _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(node, event.clientX, event.clientY);
        });
        // Bail early if the active index will not change.
        if (index === this._activeIndex) {
            return;
        }
        // Bail early if a child menu is open and the mouse is not over
        // an item. This allows the child menu to be kept open when the
        // mouse is over the empty part of the menu bar.
        if (index === -1 && this._childMenu) {
            return;
        }
        // Get position for the new menu >before< updating active index.
        const position = index >= 0 && this._childMenu ? this._positionForMenu(index) : null;
        // Before any modification, update window data.
        Menu.saveWindowData();
        // Begin DOM modifications.
        // Update the active index to the hovered item.
        this.activeIndex = index;
        // Open the new menu if a menu is already open.
        if (position) {
            this._openChildMenu(position);
        }
    }
    /**
     * Find initial position for the menu based on menubar item position.
     *
     * NOTE: this should be called before updating active index to avoid
     * an additional layout and style invalidation as changing active
     * index modifies DOM.
     */
    _positionForMenu(index) {
        let itemNode = this.contentNode.children[index];
        let { left, bottom } = itemNode.getBoundingClientRect();
        return {
            top: bottom,
            left
        };
    }
    /**
     * Handle the `'focusout'` event for the menu bar.
     */
    _evtFocusOut(event) {
        // Reset the active index if there is no open menu and the menubar is losing focus.
        if (!this._childMenu && !this.node.contains(event.relatedTarget)) {
            this.activeIndex = -1;
        }
    }
    /**
     * Focus an item in the menu bar.
     *
     * #### Notes
     * Does not open the associated menu.
     */
    _focusItemAt(index) {
        const itemNode = this.contentNode.childNodes[index];
        if (itemNode) {
            itemNode.focus();
        }
    }
    /**
     * Open the child menu at the active index immediately.
     *
     * If a different child menu is already open, it will be closed,
     * even if there is no active menu.
     */
    _openChildMenu(options = {}) {
        // If there is no active menu, close the current menu.
        let newMenu = this.activeMenu;
        if (!newMenu) {
            this._closeChildMenu();
            return;
        }
        // Bail if there is no effective menu change.
        let oldMenu = this._childMenu;
        if (oldMenu === newMenu) {
            return;
        }
        // Swap the internal menu reference.
        this._childMenu = newMenu;
        // Close the current menu, or setup for the new menu.
        if (oldMenu) {
            oldMenu.close();
        }
        else {
            document.addEventListener('mousedown', this, true);
        }
        // Update the tab focus index and ensure the menu bar is updated.
        this._tabFocusIndex = this.activeIndex;
        _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest);
        // Get the positioning data for the new menu.
        let { left, top } = options;
        if (typeof left === 'undefined' || typeof top === 'undefined') {
            ({ left, top } = this._positionForMenu(this._activeIndex));
        }
        // Begin DOM modifications
        if (!oldMenu) {
            // Continue setup for new menu
            this.addClass('lm-mod-active');
        }
        // Open the new menu at the computed location.
        if (newMenu.items.length > 0) {
            newMenu.open(left, top, this._forceItemsPosition);
        }
    }
    /**
     * Close the child menu immediately.
     *
     * This is a no-op if a child menu is not open.
     */
    _closeChildMenu() {
        // Bail if no child menu is open.
        if (!this._childMenu) {
            return;
        }
        // Remove the active class from the menu bar.
        this.removeClass('lm-mod-active');
        // Remove the document listeners.
        document.removeEventListener('mousedown', this, true);
        // Clear the internal menu reference.
        let menu = this._childMenu;
        this._childMenu = null;
        // Close the menu.
        menu.close();
        // Reset the active index.
        this.activeIndex = -1;
    }
    /**
     * Handle the `aboutToClose` signal of a menu.
     */
    _onMenuAboutToClose(sender) {
        // Bail if the sender is not the child menu.
        if (sender !== this._childMenu) {
            return;
        }
        // Remove the active class from the menu bar.
        this.removeClass('lm-mod-active');
        // Remove the document listeners.
        document.removeEventListener('mousedown', this, true);
        // Clear the internal menu reference.
        this._childMenu = null;
        // Reset the active index.
        this.activeIndex = -1;
    }
    /**
     * Handle the `menuRequested` signal of a child menu.
     */
    _onMenuMenuRequested(sender, args) {
        // Bail if the sender is not the child menu.
        if (sender !== this._childMenu) {
            return;
        }
        // Look up the active index and menu count.
        let i = this._activeIndex;
        let n = this._menus.length;
        // Active the next requested index.
        switch (args) {
            case 'next':
                this.activeIndex = i === n - 1 ? 0 : i + 1;
                break;
            case 'previous':
                this.activeIndex = i === 0 ? n - 1 : i - 1;
                break;
        }
        // Open the active menu.
        this.openActiveMenu();
    }
    /**
     * Handle the `changed` signal of a title object.
     */
    _onTitleChanged() {
        this.update();
    }
}
/**
 * The namespace for the `MenuBar` class statics.
 */
(function (MenuBar) {
    /**
     * The default implementation of `IRenderer`.
     *
     * #### Notes
     * Subclasses are free to reimplement rendering methods as needed.
     */
    class Renderer {
        /**
         * Render the virtual element for a menu bar item.
         *
         * @param data - The data to use for rendering the item.
         *
         * @returns A virtual element representing the item.
         */
        renderItem(data) {
            let className = this.createItemClass(data);
            let dataset = this.createItemDataset(data);
            let aria = this.createItemARIA(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.li({
                className,
                dataset,
                ...(data.disabled ? {} : { tabindex: data.tabbable ? '0' : '-1' }),
                onfocus: data.onfocus,
                ...aria
            }, this.renderIcon(data), this.renderLabel(data));
        }
        /**
         * Render the icon element for a menu bar item.
         *
         * @param data - The data to use for rendering the icon.
         *
         * @returns A virtual element representing the item icon.
         */
        renderIcon(data) {
            let className = this.createIconClass(data);
            // If data.title.icon is undefined, it will be ignored.
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className }, data.title.icon, data.title.iconLabel);
        }
        /**
         * Render the label element for a menu item.
         *
         * @param data - The data to use for rendering the label.
         *
         * @returns A virtual element representing the item label.
         */
        renderLabel(data) {
            let content = this.formatLabel(data);
            return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: 'lm-MenuBar-itemLabel' }, content);
        }
        /**
         * Create the class name for the menu bar item.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the menu item.
         */
        createItemClass(data) {
            let name = 'lm-MenuBar-item';
            if (data.title.className) {
                name += ` ${data.title.className}`;
            }
            if (data.active && !data.disabled) {
                name += ' lm-mod-active';
            }
            return name;
        }
        /**
         * Create the dataset for a menu bar item.
         *
         * @param data - The data to use for the item.
         *
         * @returns The dataset for the menu bar item.
         */
        createItemDataset(data) {
            return data.title.dataset;
        }
        /**
         * Create the aria attributes for menu bar item.
         *
         * @param data - The data to use for the aria attributes.
         *
         * @returns The aria attributes object for the item.
         */
        createItemARIA(data) {
            return {
                role: 'menuitem',
                'aria-haspopup': 'true',
                'aria-disabled': data.disabled ? 'true' : 'false'
            };
        }
        /**
         * Create the class name for the menu bar item icon.
         *
         * @param data - The data to use for the class name.
         *
         * @returns The full class name for the item icon.
         */
        createIconClass(data) {
            let name = 'lm-MenuBar-itemIcon';
            let extra = data.title.iconClass;
            return extra ? `${name} ${extra}` : name;
        }
        /**
         * Create the render content for the label node.
         *
         * @param data - The data to use for the label content.
         *
         * @returns The content to add to the label node.
         */
        formatLabel(data) {
            // Fetch the label text and mnemonic index.
            let { label, mnemonic } = data.title;
            // If the index is out of range, do not modify the label.
            if (mnemonic < 0 || mnemonic >= label.length) {
                return label;
            }
            // Split the label into parts.
            let prefix = label.slice(0, mnemonic);
            let suffix = label.slice(mnemonic + 1);
            let char = label[mnemonic];
            // Wrap the mnemonic character in a span.
            let span = _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: 'lm-MenuBar-itemMnemonic' }, char);
            // Return the content parts.
            return [prefix, span, suffix];
        }
    }
    MenuBar.Renderer = Renderer;
    /**
     * The default `Renderer` instance.
     */
    MenuBar.defaultRenderer = new Renderer();
})(MenuBar || (MenuBar = {}));
/**
 * The namespace for the module implementation details.
 */
var Private$3;
(function (Private) {
    /**
     * Create the DOM node for a menu bar.
     */
    function createNode() {
        let node = document.createElement('div');
        let content = document.createElement('ul');
        content.className = 'lm-MenuBar-content';
        node.appendChild(content);
        content.setAttribute('role', 'menubar');
        return node;
    }
    Private.createNode = createNode;
    /**
     * Find the best matching mnemonic item.
     *
     * The search starts at the given index and wraps around.
     */
    function findMnemonic(menus, key, start) {
        // Setup the result variables.
        let index = -1;
        let auto = -1;
        let multiple = false;
        // Normalize the key to upper case.
        let upperKey = key.toUpperCase();
        // Search the items from the given start index.
        for (let i = 0, n = menus.length; i < n; ++i) {
            // Compute the wrapped index.
            let k = (i + start) % n;
            // Look up the menu title.
            let title = menus[k].title;
            // Ignore titles with an empty label.
            if (title.label.length === 0) {
                continue;
            }
            // Look up the mnemonic index for the label.
            let mn = title.mnemonic;
            // Handle a valid mnemonic index.
            if (mn >= 0 && mn < title.label.length) {
                if (title.label[mn].toUpperCase() === upperKey) {
                    if (index === -1) {
                        index = k;
                    }
                    else {
                        multiple = true;
                    }
                }
                continue;
            }
            // Finally, handle the auto index if possible.
            if (auto === -1 && title.label[0].toUpperCase() === upperKey) {
                auto = k;
            }
        }
        // Return the search results.
        return { index, multiple, auto };
    }
    Private.findMnemonic = findMnemonic;
})(Private$3 || (Private$3 = {}));

/**
 * A widget which implements a canonical scroll bar.
 */
class ScrollBar extends Widget {
    /**
     * Construct a new scroll bar.
     *
     * @param options - The options for initializing the scroll bar.
     */
    constructor(options = {}) {
        super({ node: Private$2.createNode() });
        /**
         * A timeout callback for repeating the mouse press.
         */
        this._onRepeat = () => {
            // Clear the repeat timer id.
            this._repeatTimer = -1;
            // Bail if the mouse has been released.
            if (!this._pressData) {
                return;
            }
            // Look up the part that was pressed.
            let part = this._pressData.part;
            // Bail if the thumb was pressed.
            if (part === 'thumb') {
                return;
            }
            // Schedule the timer for another repeat.
            this._repeatTimer = window.setTimeout(this._onRepeat, 20);
            // Get the current mouse position.
            let mouseX = this._pressData.mouseX;
            let mouseY = this._pressData.mouseY;
            // Handle a decrement button repeat.
            if (part === 'decrement') {
                // Bail if the mouse is not over the button.
                if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(this.decrementNode, mouseX, mouseY)) {
                    return;
                }
                // Emit the step requested signal.
                this._stepRequested.emit('decrement');
                // Finished.
                return;
            }
            // Handle an increment button repeat.
            if (part === 'increment') {
                // Bail if the mouse is not over the button.
                if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(this.incrementNode, mouseX, mouseY)) {
                    return;
                }
                // Emit the step requested signal.
                this._stepRequested.emit('increment');
                // Finished.
                return;
            }
            // Handle a track repeat.
            if (part === 'track') {
                // Bail if the mouse is not over the track.
                if (!_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(this.trackNode, mouseX, mouseY)) {
                    return;
                }
                // Fetch the thumb node.
                let thumbNode = this.thumbNode;
                // Bail if the mouse is over the thumb.
                if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.hitTest(thumbNode, mouseX, mouseY)) {
                    return;
                }
                // Fetch the client rect for the thumb.
                let thumbRect = thumbNode.getBoundingClientRect();
                // Determine the direction for the page request.
                let dir;
                if (this._orientation === 'horizontal') {
                    dir = mouseX < thumbRect.left ? 'decrement' : 'increment';
                }
                else {
                    dir = mouseY < thumbRect.top ? 'decrement' : 'increment';
                }
                // Emit the page requested signal.
                this._pageRequested.emit(dir);
                // Finished.
                return;
            }
        };
        this._value = 0;
        this._page = 10;
        this._maximum = 100;
        this._repeatTimer = -1;
        this._pressData = null;
        this._thumbMoved = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._stepRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._pageRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this.addClass('lm-ScrollBar');
        this.setFlag(Widget.Flag.DisallowLayout);
        // Set the orientation.
        this._orientation = options.orientation || 'vertical';
        this.dataset['orientation'] = this._orientation;
        // Parse the rest of the options.
        if (options.maximum !== undefined) {
            this._maximum = Math.max(0, options.maximum);
        }
        if (options.page !== undefined) {
            this._page = Math.max(0, options.page);
        }
        if (options.value !== undefined) {
            this._value = Math.max(0, Math.min(options.value, this._maximum));
        }
    }
    /**
     * A signal emitted when the user moves the scroll thumb.
     *
     * #### Notes
     * The payload is the current value of the scroll bar.
     */
    get thumbMoved() {
        return this._thumbMoved;
    }
    /**
     * A signal emitted when the user clicks a step button.
     *
     * #### Notes
     * The payload is whether a decrease or increase is requested.
     */
    get stepRequested() {
        return this._stepRequested;
    }
    /**
     * A signal emitted when the user clicks the scroll track.
     *
     * #### Notes
     * The payload is whether a decrease or increase is requested.
     */
    get pageRequested() {
        return this._pageRequested;
    }
    /**
     * Get the orientation of the scroll bar.
     */
    get orientation() {
        return this._orientation;
    }
    /**
     * Set the orientation of the scroll bar.
     */
    set orientation(value) {
        // Do nothing if the orientation does not change.
        if (this._orientation === value) {
            return;
        }
        // Release the mouse before making changes.
        this._releaseMouse();
        // Update the internal orientation.
        this._orientation = value;
        this.dataset['orientation'] = value;
        // Schedule an update the scroll bar.
        this.update();
    }
    /**
     * Get the current value of the scroll bar.
     */
    get value() {
        return this._value;
    }
    /**
     * Set the current value of the scroll bar.
     *
     * #### Notes
     * The value will be clamped to the range `[0, maximum]`.
     */
    set value(value) {
        // Clamp the value to the allowable range.
        value = Math.max(0, Math.min(value, this._maximum));
        // Do nothing if the value does not change.
        if (this._value === value) {
            return;
        }
        // Update the internal value.
        this._value = value;
        // Schedule an update the scroll bar.
        this.update();
    }
    /**
     * Get the page size of the scroll bar.
     *
     * #### Notes
     * The page size is the amount of visible content in the scrolled
     * region, expressed in data units. It determines the size of the
     * scroll bar thumb.
     */
    get page() {
        return this._page;
    }
    /**
     * Set the page size of the scroll bar.
     *
     * #### Notes
     * The page size will be clamped to the range `[0, Infinity]`.
     */
    set page(value) {
        // Clamp the page size to the allowable range.
        value = Math.max(0, value);
        // Do nothing if the value does not change.
        if (this._page === value) {
            return;
        }
        // Update the internal page size.
        this._page = value;
        // Schedule an update the scroll bar.
        this.update();
    }
    /**
     * Get the maximum value of the scroll bar.
     */
    get maximum() {
        return this._maximum;
    }
    /**
     * Set the maximum value of the scroll bar.
     *
     * #### Notes
     * The max size will be clamped to the range `[0, Infinity]`.
     */
    set maximum(value) {
        // Clamp the value to the allowable range.
        value = Math.max(0, value);
        // Do nothing if the value does not change.
        if (this._maximum === value) {
            return;
        }
        // Update the internal values.
        this._maximum = value;
        // Clamp the current value to the new range.
        this._value = Math.min(this._value, value);
        // Schedule an update the scroll bar.
        this.update();
    }
    /**
     * The scroll bar decrement button node.
     *
     * #### Notes
     * Modifying this node directly can lead to undefined behavior.
     */
    get decrementNode() {
        return this.node.getElementsByClassName('lm-ScrollBar-button')[0];
    }
    /**
     * The scroll bar increment button node.
     *
     * #### Notes
     * Modifying this node directly can lead to undefined behavior.
     */
    get incrementNode() {
        return this.node.getElementsByClassName('lm-ScrollBar-button')[1];
    }
    /**
     * The scroll bar track node.
     *
     * #### Notes
     * Modifying this node directly can lead to undefined behavior.
     */
    get trackNode() {
        return this.node.getElementsByClassName('lm-ScrollBar-track')[0];
    }
    /**
     * The scroll bar thumb node.
     *
     * #### Notes
     * Modifying this node directly can lead to undefined behavior.
     */
    get thumbNode() {
        return this.node.getElementsByClassName('lm-ScrollBar-thumb')[0];
    }
    /**
     * Handle the DOM events for the scroll bar.
     *
     * @param event - The DOM event sent to the scroll bar.
     *
     * #### Notes
     * This method implements the DOM `EventListener` interface and is
     * called in response to events on the scroll bar's DOM node.
     *
     * This should not be called directly by user code.
     */
    handleEvent(event) {
        switch (event.type) {
            case 'mousedown':
                this._evtMouseDown(event);
                break;
            case 'mousemove':
                this._evtMouseMove(event);
                break;
            case 'mouseup':
                this._evtMouseUp(event);
                break;
            case 'keydown':
                this._evtKeyDown(event);
                break;
            case 'contextmenu':
                event.preventDefault();
                event.stopPropagation();
                break;
        }
    }
    /**
     * A method invoked on a 'before-attach' message.
     */
    onBeforeAttach(msg) {
        this.node.addEventListener('mousedown', this);
        this.update();
    }
    /**
     * A method invoked on an 'after-detach' message.
     */
    onAfterDetach(msg) {
        this.node.removeEventListener('mousedown', this);
        this._releaseMouse();
    }
    /**
     * A method invoked on an 'update-request' message.
     */
    onUpdateRequest(msg) {
        // Convert the value and page into percentages.
        let value = (this._value * 100) / this._maximum;
        let page = (this._page * 100) / (this._page + this._maximum);
        // Clamp the value and page to the relevant range.
        value = Math.max(0, Math.min(value, 100));
        page = Math.max(0, Math.min(page, 100));
        // Fetch the thumb style.
        let thumbStyle = this.thumbNode.style;
        // Update the thumb style for the current orientation.
        if (this._orientation === 'horizontal') {
            thumbStyle.top = '';
            thumbStyle.height = '';
            thumbStyle.left = `${value}%`;
            thumbStyle.width = `${page}%`;
            thumbStyle.transform = `translate(${-value}%, 0%)`;
        }
        else {
            thumbStyle.left = '';
            thumbStyle.width = '';
            thumbStyle.top = `${value}%`;
            thumbStyle.height = `${page}%`;
            thumbStyle.transform = `translate(0%, ${-value}%)`;
        }
    }
    /**
     * Handle the `'keydown'` event for the scroll bar.
     */
    _evtKeyDown(event) {
        // Stop all input events during drag.
        event.preventDefault();
        event.stopPropagation();
        // Ignore anything except the `Escape` key.
        if (event.keyCode !== 27) {
            return;
        }
        // Fetch the previous scroll value.
        let value = this._pressData ? this._pressData.value : -1;
        // Release the mouse.
        this._releaseMouse();
        // Restore the old scroll value if possible.
        if (value !== -1) {
            this._moveThumb(value);
        }
    }
    /**
     * Handle the `'mousedown'` event for the scroll bar.
     */
    _evtMouseDown(event) {
        // Do nothing if it's not a left mouse press.
        if (event.button !== 0) {
            return;
        }
        // Send an activate request to the scroll bar. This can be
        // used by message hooks to activate something relevant.
        this.activate();
        // Do nothing if the mouse is already captured.
        if (this._pressData) {
            return;
        }
        // Find the pressed scroll bar part.
        let part = Private$2.findPart(this, event.target);
        // Do nothing if the part is not of interest.
        if (!part) {
            return;
        }
        // Stop the event propagation.
        event.preventDefault();
        event.stopPropagation();
        // Override the mouse cursor.
        let override = _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_6__.Drag.overrideCursor('default');
        // Set up the press data.
        this._pressData = {
            part,
            override,
            delta: -1,
            value: -1,
            mouseX: event.clientX,
            mouseY: event.clientY
        };
        // Add the extra event listeners.
        document.addEventListener('mousemove', this, true);
        document.addEventListener('mouseup', this, true);
        document.addEventListener('keydown', this, true);
        document.addEventListener('contextmenu', this, true);
        // Handle a thumb press.
        if (part === 'thumb') {
            // Fetch the thumb node.
            let thumbNode = this.thumbNode;
            // Fetch the client rect for the thumb.
            let thumbRect = thumbNode.getBoundingClientRect();
            // Update the press data delta for the current orientation.
            if (this._orientation === 'horizontal') {
                this._pressData.delta = event.clientX - thumbRect.left;
            }
            else {
                this._pressData.delta = event.clientY - thumbRect.top;
            }
            // Add the active class to the thumb node.
            thumbNode.classList.add('lm-mod-active');
            // Store the current value in the press data.
            this._pressData.value = this._value;
            // Finished.
            return;
        }
        // Handle a track press.
        if (part === 'track') {
            // Fetch the client rect for the thumb.
            let thumbRect = this.thumbNode.getBoundingClientRect();
            // Determine the direction for the page request.
            let dir;
            if (this._orientation === 'horizontal') {
                dir = event.clientX < thumbRect.left ? 'decrement' : 'increment';
            }
            else {
                dir = event.clientY < thumbRect.top ? 'decrement' : 'increment';
            }
            // Start the repeat timer.
            this._repeatTimer = window.setTimeout(this._onRepeat, 350);
            // Emit the page requested signal.
            this._pageRequested.emit(dir);
            // Finished.
            return;
        }
        // Handle a decrement button press.
        if (part === 'decrement') {
            // Add the active class to the decrement node.
            this.decrementNode.classList.add('lm-mod-active');
            // Start the repeat timer.
            this._repeatTimer = window.setTimeout(this._onRepeat, 350);
            // Emit the step requested signal.
            this._stepRequested.emit('decrement');
            // Finished.
            return;
        }
        // Handle an increment button press.
        if (part === 'increment') {
            // Add the active class to the increment node.
            this.incrementNode.classList.add('lm-mod-active');
            // Start the repeat timer.
            this._repeatTimer = window.setTimeout(this._onRepeat, 350);
            // Emit the step requested signal.
            this._stepRequested.emit('increment');
            // Finished.
            return;
        }
    }
    /**
     * Handle the `'mousemove'` event for the scroll bar.
     */
    _evtMouseMove(event) {
        // Do nothing if no drag is in progress.
        if (!this._pressData) {
            return;
        }
        // Stop the event propagation.
        event.preventDefault();
        event.stopPropagation();
        // Update the mouse position.
        this._pressData.mouseX = event.clientX;
        this._pressData.mouseY = event.clientY;
        // Bail if the thumb is not being dragged.
        if (this._pressData.part !== 'thumb') {
            return;
        }
        // Get the client rect for the thumb and track.
        let thumbRect = this.thumbNode.getBoundingClientRect();
        let trackRect = this.trackNode.getBoundingClientRect();
        // Fetch the scroll geometry based on the orientation.
        let trackPos;
        let trackSpan;
        if (this._orientation === 'horizontal') {
            trackPos = event.clientX - trackRect.left - this._pressData.delta;
            trackSpan = trackRect.width - thumbRect.width;
        }
        else {
            trackPos = event.clientY - trackRect.top - this._pressData.delta;
            trackSpan = trackRect.height - thumbRect.height;
        }
        // Compute the desired value from the scroll geometry.
        let value = trackSpan === 0 ? 0 : (trackPos * this._maximum) / trackSpan;
        // Move the thumb to the computed value.
        this._moveThumb(value);
    }
    /**
     * Handle the `'mouseup'` event for the scroll bar.
     */
    _evtMouseUp(event) {
        // Do nothing if it's not a left mouse release.
        if (event.button !== 0) {
            return;
        }
        // Stop the event propagation.
        event.preventDefault();
        event.stopPropagation();
        // Release the mouse.
        this._releaseMouse();
    }
    /**
     * Release the mouse and restore the node states.
     */
    _releaseMouse() {
        // Bail if there is no press data.
        if (!this._pressData) {
            return;
        }
        // Clear the repeat timer.
        clearTimeout(this._repeatTimer);
        this._repeatTimer = -1;
        // Clear the press data.
        this._pressData.override.dispose();
        this._pressData = null;
        // Remove the extra event listeners.
        document.removeEventListener('mousemove', this, true);
        document.removeEventListener('mouseup', this, true);
        document.removeEventListener('keydown', this, true);
        document.removeEventListener('contextmenu', this, true);
        // Remove the active classes from the nodes.
        this.thumbNode.classList.remove('lm-mod-active');
        this.decrementNode.classList.remove('lm-mod-active');
        this.incrementNode.classList.remove('lm-mod-active');
    }
    /**
     * Move the thumb to the specified position.
     */
    _moveThumb(value) {
        // Clamp the value to the allowed range.
        value = Math.max(0, Math.min(value, this._maximum));
        // Bail if the value does not change.
        if (this._value === value) {
            return;
        }
        // Update the internal value.
        this._value = value;
        // Schedule an update of the scroll bar.
        this.update();
        // Emit the thumb moved signal.
        this._thumbMoved.emit(value);
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private$2;
(function (Private) {
    /**
     * Create the DOM node for a scroll bar.
     */
    function createNode() {
        let node = document.createElement('div');
        let decrement = document.createElement('div');
        let increment = document.createElement('div');
        let track = document.createElement('div');
        let thumb = document.createElement('div');
        decrement.className = 'lm-ScrollBar-button';
        increment.className = 'lm-ScrollBar-button';
        decrement.dataset['action'] = 'decrement';
        increment.dataset['action'] = 'increment';
        track.className = 'lm-ScrollBar-track';
        thumb.className = 'lm-ScrollBar-thumb';
        track.appendChild(thumb);
        node.appendChild(decrement);
        node.appendChild(track);
        node.appendChild(increment);
        return node;
    }
    Private.createNode = createNode;
    /**
     * Find the scroll bar part which contains the given target.
     */
    function findPart(scrollBar, target) {
        // Test the thumb.
        if (scrollBar.thumbNode.contains(target)) {
            return 'thumb';
        }
        // Test the track.
        if (scrollBar.trackNode.contains(target)) {
            return 'track';
        }
        // Test the decrement button.
        if (scrollBar.decrementNode.contains(target)) {
            return 'decrement';
        }
        // Test the increment button.
        if (scrollBar.incrementNode.contains(target)) {
            return 'increment';
        }
        // Indicate no match.
        return null;
    }
    Private.findPart = findPart;
})(Private$2 || (Private$2 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A concrete layout implementation which holds a single widget.
 *
 * #### Notes
 * This class is useful for creating simple container widgets which
 * hold a single child. The child should be positioned with CSS.
 */
class SingletonLayout extends Layout {
    constructor() {
        super(...arguments);
        this._widget = null;
    }
    /**
     * Dispose of the resources held by the layout.
     */
    dispose() {
        if (this._widget) {
            let widget = this._widget;
            this._widget = null;
            widget.dispose();
        }
        super.dispose();
    }
    /**
     * Get the child widget for the layout.
     */
    get widget() {
        return this._widget;
    }
    /**
     * Set the child widget for the layout.
     *
     * #### Notes
     * Setting the child widget will cause the old child widget to be
     * automatically disposed. If that is not desired, set the parent
     * of the old child to `null` before assigning a new child.
     */
    set widget(widget) {
        // Remove the widget from its current parent. This is a no-op
        // if the widget's parent is already the layout parent widget.
        if (widget) {
            widget.parent = this.parent;
        }
        // Bail early if the widget does not change.
        if (this._widget === widget) {
            return;
        }
        // Dispose of the old child widget.
        if (this._widget) {
            this._widget.dispose();
        }
        // Update the internal widget.
        this._widget = widget;
        // Attach the new child widget if needed.
        if (this.parent && widget) {
            this.attachWidget(widget);
        }
    }
    /**
     * Create an iterator over the widgets in the layout.
     *
     * @returns A new iterator over the widgets in the layout.
     */
    *[Symbol.iterator]() {
        if (this._widget) {
            yield this._widget;
        }
    }
    /**
     * Remove a widget from the layout.
     *
     * @param widget - The widget to remove from the layout.
     *
     * #### Notes
     * A widget is automatically removed from the layout when its `parent`
     * is set to `null`. This method should only be invoked directly when
     * removing a widget from a layout which has yet to be installed on a
     * parent widget.
     *
     * This method does *not* modify the widget's `parent`.
     */
    removeWidget(widget) {
        // Bail early if the widget does not exist in the layout.
        if (this._widget !== widget) {
            return;
        }
        // Clear the internal widget.
        this._widget = null;
        // If the layout is parented, detach the widget from the DOM.
        if (this.parent) {
            this.detachWidget(widget);
        }
    }
    /**
     * Perform layout initialization which requires the parent widget.
     */
    init() {
        super.init();
        for (const widget of this) {
            this.attachWidget(widget);
        }
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This method is called automatically by the single layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation adds the widgets's node to the parent's
     * node at the proper location, and sends the appropriate attach
     * messages to the widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is added to the parent's node.
     */
    attachWidget(widget) {
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Add the widget's node to the parent.
        this.parent.node.appendChild(widget.node);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This method is called automatically by the single layout at the
     * appropriate time. It should not be called directly by user code.
     *
     * The default implementation removes the widget's node from the
     * parent's node, and sends the appropriate detach messages to the
     * widget if the parent is attached to the DOM.
     *
     * Subclasses may reimplement this method to control how the widget's
     * node is removed from the parent's node.
     */
    detachWidget(widget) {
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.node.removeChild(widget.node);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A layout where visible widgets are stacked atop one another.
 *
 * #### Notes
 * The Z-order of the visible widgets follows their layout order.
 */
class StackedLayout extends PanelLayout {
    constructor(options = {}) {
        super(options);
        this._dirty = false;
        this._items = [];
        this._box = null;
        this._hiddenMode =
            options.hiddenMode !== undefined
                ? options.hiddenMode
                : Widget.HiddenMode.Display;
    }
    /**
     * The method for hiding widgets.
     *
     * #### Notes
     * If there is only one child widget, `Display` hiding mode will be used
     * regardless of this setting.
     */
    get hiddenMode() {
        return this._hiddenMode;
    }
    /**
     * Set the method for hiding widgets.
     *
     * #### Notes
     * If there is only one child widget, `Display` hiding mode will be used
     * regardless of this setting.
     */
    set hiddenMode(v) {
        if (this._hiddenMode === v) {
            return;
        }
        this._hiddenMode = v;
        if (this.widgets.length > 1) {
            this.widgets.forEach(w => {
                w.hiddenMode = this._hiddenMode;
            });
        }
    }
    /**
     * Dispose of the resources held by the layout.
     */
    dispose() {
        // Dispose of the layout items.
        for (const item of this._items) {
            item.dispose();
        }
        // Clear the layout state.
        this._box = null;
        this._items.length = 0;
        // Dispose of the rest of the layout.
        super.dispose();
    }
    /**
     * Attach a widget to the parent's DOM node.
     *
     * @param index - The current index of the widget in the layout.
     *
     * @param widget - The widget to attach to the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    attachWidget(index, widget) {
        // Using transform create an additional layer in the pixel pipeline
        // to limit the number of layer, it is set only if there is more than one widget.
        if (this._hiddenMode === Widget.HiddenMode.Scale &&
            this._items.length > 0) {
            if (this._items.length === 1) {
                this.widgets[0].hiddenMode = Widget.HiddenMode.Scale;
            }
            widget.hiddenMode = Widget.HiddenMode.Scale;
        }
        else {
            widget.hiddenMode = Widget.HiddenMode.Display;
        }
        // Create and add a new layout item for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.insert(this._items, index, new LayoutItem(widget));
        // Send a `'before-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
        }
        // Add the widget's node to the parent.
        this.parent.node.appendChild(widget.node);
        // Send an `'after-attach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);
        }
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * Move a widget in the parent's DOM node.
     *
     * @param fromIndex - The previous index of the widget in the layout.
     *
     * @param toIndex - The current index of the widget in the layout.
     *
     * @param widget - The widget to move in the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    moveWidget(fromIndex, toIndex, widget) {
        // Move the layout item for the widget.
        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.move(this._items, fromIndex, toIndex);
        // Post an update request for the parent widget.
        this.parent.update();
    }
    /**
     * Detach a widget from the parent's DOM node.
     *
     * @param index - The previous index of the widget in the layout.
     *
     * @param widget - The widget to detach from the parent.
     *
     * #### Notes
     * This is a reimplementation of the superclass method.
     */
    detachWidget(index, widget) {
        // Remove the layout item for the widget.
        let item = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.ArrayExt.removeAt(this._items, index);
        // Send a `'before-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);
        }
        // Remove the widget's node from the parent.
        this.parent.node.removeChild(widget.node);
        // Send an `'after-detach'` message if the parent is attached.
        if (this.parent.isAttached) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);
        }
        // Reset the z-index for the widget.
        item.widget.node.style.zIndex = '';
        // Reset the hidden mode for the widget.
        if (this._hiddenMode === Widget.HiddenMode.Scale) {
            widget.hiddenMode = Widget.HiddenMode.Display;
            // Reset the hidden mode for the first widget if necessary.
            if (this._items.length === 1) {
                this._items[0].widget.hiddenMode = Widget.HiddenMode.Display;
            }
        }
        // Dispose of the layout item.
        item.dispose();
        // Post a fit request for the parent widget.
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'before-show'` message.
     */
    onBeforeShow(msg) {
        super.onBeforeShow(msg);
        this.parent.update();
    }
    /**
     * A message handler invoked on a `'before-attach'` message.
     */
    onBeforeAttach(msg) {
        super.onBeforeAttach(msg);
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-shown'` message.
     */
    onChildShown(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'child-hidden'` message.
     */
    onChildHidden(msg) {
        this.parent.fit();
    }
    /**
     * A message handler invoked on a `'resize'` message.
     */
    onResize(msg) {
        if (this.parent.isVisible) {
            this._update(msg.width, msg.height);
        }
    }
    /**
     * A message handler invoked on an `'update-request'` message.
     */
    onUpdateRequest(msg) {
        if (this.parent.isVisible) {
            this._update(-1, -1);
        }
    }
    /**
     * A message handler invoked on a `'fit-request'` message.
     */
    onFitRequest(msg) {
        if (this.parent.isAttached) {
            this._fit();
        }
    }
    /**
     * Fit the layout to the total size required by the widgets.
     */
    _fit() {
        // Set up the computed minimum size.
        let minW = 0;
        let minH = 0;
        // Update the computed minimum size.
        for (let i = 0, n = this._items.length; i < n; ++i) {
            // Fetch the item.
            let item = this._items[i];
            // Ignore hidden items.
            if (item.isHidden) {
                continue;
            }
            // Update the size limits for the item.
            item.fit();
            // Update the computed minimum size.
            minW = Math.max(minW, item.minWidth);
            minH = Math.max(minH, item.minHeight);
        }
        // Update the box sizing and add it to the computed min size.
        let box = (this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node));
        minW += box.horizontalSum;
        minH += box.verticalSum;
        // Update the parent's min size constraints.
        let style = this.parent.node.style;
        style.minWidth = `${minW}px`;
        style.minHeight = `${minH}px`;
        // Set the dirty flag to ensure only a single update occurs.
        this._dirty = true;
        // Notify the ancestor that it should fit immediately. This may
        // cause a resize of the parent, fulfilling the required update.
        if (this.parent.parent) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent.parent, Widget.Msg.FitRequest);
        }
        // If the dirty flag is still set, the parent was not resized.
        // Trigger the required update on the parent widget immediately.
        if (this._dirty) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.sendMessage(this.parent, Widget.Msg.UpdateRequest);
        }
    }
    /**
     * Update the layout position and size of the widgets.
     *
     * The parent offset dimensions should be `-1` if unknown.
     */
    _update(offsetWidth, offsetHeight) {
        // Clear the dirty flag to indicate the update occurred.
        this._dirty = false;
        // Compute the visible item count.
        let nVisible = 0;
        for (let i = 0, n = this._items.length; i < n; ++i) {
            nVisible += +!this._items[i].isHidden;
        }
        // Bail early if there are no visible items to layout.
        if (nVisible === 0) {
            return;
        }
        // Measure the parent if the offset dimensions are unknown.
        if (offsetWidth < 0) {
            offsetWidth = this.parent.node.offsetWidth;
        }
        if (offsetHeight < 0) {
            offsetHeight = this.parent.node.offsetHeight;
        }
        // Ensure the parent box sizing data is computed.
        if (!this._box) {
            this._box = _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.ElementExt.boxSizing(this.parent.node);
        }
        // Compute the actual layout bounds adjusted for border and padding.
        let top = this._box.paddingTop;
        let left = this._box.paddingLeft;
        let width = offsetWidth - this._box.horizontalSum;
        let height = offsetHeight - this._box.verticalSum;
        // Update the widget stacking order and layout geometry.
        for (let i = 0, n = this._items.length; i < n; ++i) {
            // Fetch the item.
            let item = this._items[i];
            // Ignore hidden items.
            if (item.isHidden) {
                continue;
            }
            // Set the z-index for the widget.
            item.widget.node.style.zIndex = `${i}`;
            // Update the item geometry.
            item.update(left, top, width, height);
        }
    }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A panel where visible widgets are stacked atop one another.
 *
 * #### Notes
 * This class provides a convenience wrapper around a {@link StackedLayout}.
 */
class StackedPanel extends Panel {
    /**
     * Construct a new stacked panel.
     *
     * @param options - The options for initializing the panel.
     */
    constructor(options = {}) {
        super({ layout: Private$1.createLayout(options) });
        this._widgetRemoved = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this.addClass('lm-StackedPanel');
    }
    /**
     * The method for hiding widgets.
     *
     * #### Notes
     * If there is only one child widget, `Display` hiding mode will be used
     * regardless of this setting.
     */
    get hiddenMode() {
        return this.layout.hiddenMode;
    }
    /**
     * Set the method for hiding widgets.
     *
     * #### Notes
     * If there is only one child widget, `Display` hiding mode will be used
     * regardless of this setting.
     */
    set hiddenMode(v) {
        this.layout.hiddenMode = v;
    }
    /**
     * A signal emitted when a widget is removed from a stacked panel.
     */
    get widgetRemoved() {
        return this._widgetRemoved;
    }
    /**
     * A message handler invoked on a `'child-added'` message.
     */
    onChildAdded(msg) {
        msg.child.addClass('lm-StackedPanel-child');
    }
    /**
     * A message handler invoked on a `'child-removed'` message.
     */
    onChildRemoved(msg) {
        msg.child.removeClass('lm-StackedPanel-child');
        this._widgetRemoved.emit(msg.child);
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private$1;
(function (Private) {
    /**
     * Create a stacked layout for the given panel options.
     */
    function createLayout(options) {
        return options.layout || new StackedLayout();
    }
    Private.createLayout = createLayout;
})(Private$1 || (Private$1 = {}));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
/**
 * A widget which combines a `TabBar` and a `StackedPanel`.
 *
 * #### Notes
 * This is a simple panel which handles the common case of a tab bar
 * placed next to a content area. The selected tab controls the widget
 * which is shown in the content area.
 *
 * For use cases which require more control than is provided by this
 * panel, the `TabBar` widget may be used independently.
 */
class TabPanel extends Widget {
    /**
     * Construct a new tab panel.
     *
     * @param options - The options for initializing the tab panel.
     */
    constructor(options = {}) {
        super();
        this._currentChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this._addRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_5__.Signal(this);
        this.addClass('lm-TabPanel');
        // Create the tab bar and stacked panel.
        this.tabBar = new TabBar(options);
        this.tabBar.addClass('lm-TabPanel-tabBar');
        this.stackedPanel = new StackedPanel();
        this.stackedPanel.addClass('lm-TabPanel-stackedPanel');
        // Connect the tab bar signal handlers.
        this.tabBar.tabMoved.connect(this._onTabMoved, this);
        this.tabBar.currentChanged.connect(this._onCurrentChanged, this);
        this.tabBar.tabCloseRequested.connect(this._onTabCloseRequested, this);
        this.tabBar.tabActivateRequested.connect(this._onTabActivateRequested, this);
        this.tabBar.addRequested.connect(this._onTabAddRequested, this);
        // Connect the stacked panel signal handlers.
        this.stackedPanel.widgetRemoved.connect(this._onWidgetRemoved, this);
        // Get the data related to the placement.
        this._tabPlacement = options.tabPlacement || 'top';
        let direction = Private.directionFromPlacement(this._tabPlacement);
        let orientation = Private.orientationFromPlacement(this._tabPlacement);
        // Configure the tab bar for the placement.
        this.tabBar.orientation = orientation;
        this.tabBar.dataset['placement'] = this._tabPlacement;
        // Create the box layout.
        let layout = new BoxLayout({ direction, spacing: 0 });
        // Set the stretch factors for the child widgets.
        BoxLayout.setStretch(this.tabBar, 0);
        BoxLayout.setStretch(this.stackedPanel, 1);
        // Add the child widgets to the layout.
        layout.addWidget(this.tabBar);
        layout.addWidget(this.stackedPanel);
        // Install the layout on the tab panel.
        this.layout = layout;
    }
    /**
     * A signal emitted when the current tab is changed.
     *
     * #### Notes
     * This signal is emitted when the currently selected tab is changed
     * either through user or programmatic interaction.
     *
     * Notably, this signal is not emitted when the index of the current
     * tab changes due to tabs being inserted, removed, or moved. It is
     * only emitted when the actual current tab node is changed.
     */
    get currentChanged() {
        return this._currentChanged;
    }
    /**
     * Get the index of the currently selected tab.
     *
     * #### Notes
     * This will be `-1` if no tab is selected.
     */
    get currentIndex() {
        return this.tabBar.currentIndex;
    }
    /**
     * Set the index of the currently selected tab.
     *
     * #### Notes
     * If the index is out of range, it will be set to `-1`.
     */
    set currentIndex(value) {
        this.tabBar.currentIndex = value;
    }
    /**
     * Get the currently selected widget.
     *
     * #### Notes
     * This will be `null` if there is no selected tab.
     */
    get currentWidget() {
        let title = this.tabBar.currentTitle;
        return title ? title.owner : null;
    }
    /**
     * Set the currently selected widget.
     *
     * #### Notes
     * If the widget is not in the panel, it will be set to `null`.
     */
    set currentWidget(value) {
        this.tabBar.currentTitle = value ? value.title : null;
    }
    /**
     * Get the whether the tabs are movable by the user.
     *
     * #### Notes
     * Tabs can always be moved programmatically.
     */
    get tabsMovable() {
        return this.tabBar.tabsMovable;
    }
    /**
     * Set the whether the tabs are movable by the user.
     *
     * #### Notes
     * Tabs can always be moved programmatically.
     */
    set tabsMovable(value) {
        this.tabBar.tabsMovable = value;
    }
    /**
     * Get the whether the add button is enabled.
     *
     */
    get addButtonEnabled() {
        return this.tabBar.addButtonEnabled;
    }
    /**
     * Set the whether the add button is enabled.
     *
     */
    set addButtonEnabled(value) {
        this.tabBar.addButtonEnabled = value;
    }
    /**
     * Get the tab placement for the tab panel.
     *
     * #### Notes
     * This controls the position of the tab bar relative to the content.
     */
    get tabPlacement() {
        return this._tabPlacement;
    }
    /**
     * Set the tab placement for the tab panel.
     *
     * #### Notes
     * This controls the position of the tab bar relative to the content.
     */
    set tabPlacement(value) {
        // Bail if the placement does not change.
        if (this._tabPlacement === value) {
            return;
        }
        // Update the internal value.
        this._tabPlacement = value;
        // Get the values related to the placement.
        let direction = Private.directionFromPlacement(value);
        let orientation = Private.orientationFromPlacement(value);
        // Configure the tab bar for the placement.
        this.tabBar.orientation = orientation;
        this.tabBar.dataset['placement'] = value;
        // Update the layout direction.
        this.layout.direction = direction;
    }
    /**
     * A signal emitted when the add button on a tab bar is clicked.
     *
     */
    get addRequested() {
        return this._addRequested;
    }
    /**
     * A read-only array of the widgets in the panel.
     */
    get widgets() {
        return this.stackedPanel.widgets;
    }
    /**
     * Add a widget to the end of the tab panel.
     *
     * @param widget - The widget to add to the tab panel.
     *
     * #### Notes
     * If the widget is already contained in the panel, it will be moved.
     *
     * The widget's `title` is used to populate the tab.
     */
    addWidget(widget) {
        this.insertWidget(this.widgets.length, widget);
    }
    /**
     * Insert a widget into the tab panel at a specified index.
     *
     * @param index - The index at which to insert the widget.
     *
     * @param widget - The widget to insert into to the tab panel.
     *
     * #### Notes
     * If the widget is already contained in the panel, it will be moved.
     *
     * The widget's `title` is used to populate the tab.
     */
    insertWidget(index, widget) {
        if (widget !== this.currentWidget) {
            widget.hide();
        }
        this.stackedPanel.insertWidget(index, widget);
        this.tabBar.insertTab(index, widget.title);
        widget.node.setAttribute('role', 'tabpanel');
        let renderer = this.tabBar.renderer;
        if (renderer instanceof TabBar.Renderer) {
            let tabId = renderer.createTabKey({
                title: widget.title,
                current: false,
                zIndex: 0
            });
            widget.node.setAttribute('aria-labelledby', tabId);
        }
    }
    /**
     * Handle the `currentChanged` signal from the tab bar.
     */
    _onCurrentChanged(sender, args) {
        // Extract the previous and current title from the args.
        let { previousIndex, previousTitle, currentIndex, currentTitle } = args;
        // Extract the widgets from the titles.
        let previousWidget = previousTitle ? previousTitle.owner : null;
        let currentWidget = currentTitle ? currentTitle.owner : null;
        // Hide the previous widget.
        if (previousWidget) {
            previousWidget.hide();
        }
        // Show the current widget.
        if (currentWidget) {
            currentWidget.show();
        }
        // Emit the `currentChanged` signal for the tab panel.
        this._currentChanged.emit({
            previousIndex,
            previousWidget,
            currentIndex,
            currentWidget
        });
        // Flush the message loop on IE and Edge to prevent flicker.
        if (_lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Platform.IS_EDGE || _lumino_domutils__WEBPACK_IMPORTED_MODULE_2__.Platform.IS_IE) {
            _lumino_messaging__WEBPACK_IMPORTED_MODULE_3__.MessageLoop.flush();
        }
    }
    /**
     * Handle the `tabAddRequested` signal from the tab bar.
     */
    _onTabAddRequested(sender, args) {
        this._addRequested.emit(sender);
    }
    /**
     * Handle the `tabActivateRequested` signal from the tab bar.
     */
    _onTabActivateRequested(sender, args) {
        args.title.owner.activate();
    }
    /**
     * Handle the `tabCloseRequested` signal from the tab bar.
     */
    _onTabCloseRequested(sender, args) {
        args.title.owner.close();
    }
    /**
     * Handle the `tabMoved` signal from the tab bar.
     */
    _onTabMoved(sender, args) {
        this.stackedPanel.insertWidget(args.toIndex, args.title.owner);
    }
    /**
     * Handle the `widgetRemoved` signal from the stacked panel.
     */
    _onWidgetRemoved(sender, widget) {
        widget.node.removeAttribute('role');
        widget.node.removeAttribute('aria-labelledby');
        this.tabBar.removeTab(widget.title);
    }
}
/**
 * The namespace for the module implementation details.
 */
var Private;
(function (Private) {
    /**
     * Convert a tab placement to tab bar orientation.
     */
    function orientationFromPlacement(plc) {
        return placementToOrientationMap[plc];
    }
    Private.orientationFromPlacement = orientationFromPlacement;
    /**
     * Convert a tab placement to a box layout direction.
     */
    function directionFromPlacement(plc) {
        return placementToDirectionMap[plc];
    }
    Private.directionFromPlacement = directionFromPlacement;
    /**
     * A mapping of tab placement to tab bar orientation.
     */
    const placementToOrientationMap = {
        top: 'horizontal',
        left: 'vertical',
        right: 'vertical',
        bottom: 'horizontal'
    };
    /**
     * A mapping of tab placement to box layout direction.
     */
    const placementToDirectionMap = {
        top: 'top-to-bottom',
        left: 'left-to-right',
        right: 'right-to-left',
        bottom: 'bottom-to-top'
    };
})(Private || (Private = {}));


//# sourceMappingURL=index.es6.js.map


/***/ }),

/***/ 20959:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";

// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(94830);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(80592);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(99763);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(28915);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(80366);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(17352);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/@jupyterlab/builder/node_modules/css-loader/dist/cjs.js!../node_modules/@lumino/widgets/style/index.css
var style = __webpack_require__(79387);
;// CONCATENATED MODULE: ../node_modules/@lumino/widgets/style/index.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(style/* default */.Z, options);




       /* harmony default export */ const widgets_style = (style/* default */.Z && style/* default */.Z.locals ? style/* default */.Z.locals : undefined);

;// CONCATENATED MODULE: ../node_modules/@lumino/widgets/style/index.js
/*
 * Copyright (c) Jupyter Development Team.
 * Distributed under the terms of the Modified BSD License.
 */

/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/




/***/ }),

/***/ 34580:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 20 20'%3e %3cpath fill='%23616161' d='M9.9 13.6 3.6 7.4l.8-.8 5.5 5.6 5.5-5.5.7.7z' class='jp-icon3' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 79279:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M5.2 5.9 9 9.7l3.8-3.8L14 7.1l-4.9 5-4.9-5z' class='jp-icon3' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 27646:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M5.2 7.5 9 11.2l3.8-3.8H5.2z' class='jp-icon3' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 89446:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M10.8 12.8 7.1 9l3.8-3.8v7.6z' class='jp-icon3' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 63793:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M7.2 5.2 10.9 9l-3.8 3.8V5.2z' class='jp-icon3' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 92650:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 20 20'%3e %3cpath fill='%23616161' d='M15.4 13.3 9.9 7.7l-5.5 5.5-.8-.7 6.3-6.2 6.2 6.3z' class='jp-icon3' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 25853:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M5.2 10.5 9 6.8l3.8 3.8H5.2z' class='jp-icon3' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 87770:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3e %3cg fill='var(--jp-error-color1%2c %23d32f2f)'%3e %3ccircle cx='10' cy='7' r='6' /%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 65230:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3cpath d='M16.48 17.248A7.5 7.5 0 0 0 6.32 7.706a7 7 0 1 1 10.16 9.542'/%3e %3cpath d='M19.16 14.248A7.5 7.5 0 0 0 9 4.706a7 7 0 1 1 10.16 9.542M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0m-4.209-4L13 12.209 10.209 15 13 17.791 11.791 19 9 16.209 6.209 19 5 17.791 7.791 15 5 12.209 6.209 11 9 13.791z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 70880:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3cpath d='m12.039.5-.753 1.506L.5 23.576l23.082-.001zm.001 4.017 8.528 17.05-17.055.001z'/%3e %3cpath d='M11 8h2v10h-2zm0 11h2v2h-2z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 22978:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M5 2h10l5 5v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6h1v2l4-3-4-3v2H3V4a2 2 0 0 1 2-2m7 16h4v-2h-4zm0-4h6v-2h-6zm0-4h6V8h-6zm-2 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2m-7-2v2H1v-2z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 60682:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M7 6h4v12H7Zm6 0h4v12h-4z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 80687:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3e %3ccircle cx='10' cy='7' r='6' fill='var(--jp-warn-color1%2c %23f57c00)' /%3e %3ccircle cx='10' cy='7' r='4' stroke='var(--jp-layout-color0%2c white)' stroke-width='1.3' /%3e %3c/svg%3e";

/***/ }),

/***/ 29012:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e %3cpath fill='%23616161' d='M8 9.532h.542l3.905-3.905-1.061-1.06-2.637 2.61V1H7.251v6.177l-2.637-2.61-1.061 1.06 3.905 3.905zm1.956 3.481a2 2 0 1 1-4 0 2 2 0 0 1 4 0' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 42882:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e %3cpath fill='%23616161' d='M8 1h-.542L3.553 4.905l1.061 1.06 2.637-2.61v6.177h1.498V3.355l2.637 2.61 1.061-1.06L8.542 1zm1.956 12.013a2 2 0 1 1-4 0 2 2 0 0 1 4 0' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 82371:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e %3cpath fill='%23616161' d='M14.25 5.75v-4h-1.5v2.542c-1.145-1.359-2.911-2.209-4.84-2.209-3.177 0-5.92 2.307-6.16 5.398l-.02.269h1.5l.022-.226c.212-2.195 2.202-3.94 4.656-3.94 1.736 0 3.244.875 4.05 2.166h-2.83v1.5h4.163l.962-.975V5.75zM8 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 62892:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3e %3cpath fill='%23007ACC' fill-rule='evenodd' d='m1.5 4-.5.5v8l.5.5H4v-1H2V5h2V4zm13 9 .5-.5v-8l-.5-.5H12v1h2v7h-2v1zM8.797 5l-4.5 2L4 7.457v2.5l.243.429 2.5 1.5.46.028 4.5-2L12 9.457v-2.5l-.243-.429-2.5-1.5zM5 8.34v1.334l1.5.9V9.24zm2.5.942v1.406L11 9.131V7.726zm2.918-2.391-1.452-.872-3.384 1.504 1.452.871z' clip-rule='evenodd'/%3e %3c/svg%3e";

/***/ }),

/***/ 24502:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M5 2h10l5 5v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6h1v2l4-3-4-3v2H3V4a2 2 0 0 1 2-2m7 16h4v-2h-4zm0-4h6v-2h-6zm0-4h6V8h-6zm-2 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2m-7-2v2H1v-2z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 26774:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3ccircle cx='12' cy='19' r='2'/%3e %3cpath d='M10 3h4v12h-4z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 18203:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath class='jp-icon3 jp-icon-selectable' fill='%23616161' d='M13%2c4V20a1%2c1%2c0%2c0%2c1-2%2c0V4a1%2c1%2c0%2c0%2c1%2c2%2c0ZM8%2c5A1%2c1%2c0%2c0%2c0%2c7%2c6V18a1%2c1%2c0%2c0%2c0%2c2%2c0V6A1%2c1%2c0%2c0%2c0%2c8%2c5ZM4%2c7A1%2c1%2c0%2c0%2c0%2c3%2c8v8a1%2c1%2c0%2c0%2c0%2c2%2c0V8A1%2c1%2c0%2c0%2c0%2c4%2c7ZM16%2c5a1%2c1%2c0%2c0%2c0-1%2c1V18a1%2c1%2c0%2c0%2c0%2c2%2c0V6A1%2c1%2c0%2c0%2c0%2c16%2c5Zm4%2c2a1%2c1%2c0%2c0%2c0-1%2c1v8a1%2c1%2c0%2c0%2c0%2c2%2c0V8A1%2c1%2c0%2c0%2c0%2c20%2c7Z'/%3e %3c/svg%3e";

/***/ }),

/***/ 85349:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 200 200'%3e %3cpath fill='%230288D1' d='M20 19.8h160v159.9H20z' class='jp-console-icon-background-color jp-icon-selectable'/%3e %3cpath fill='white' d='M105 127.3h40v12.8h-40zM51.1 77 74 99.9l-23.3 23.3 10.5 10.5 23.3-23.3L95 99.9 84.5 89.4 61.6 66.5z' class='jp-console-icon-color jp-icon-selectable-inverse'/%3e %3c/svg%3e";

/***/ }),

/***/ 17779:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cpath fill='%23616161' d='m19.3 8.2-5.5-5.5c-.3-.3-.7-.5-1.2-.5H3.9c-.8.1-1.6.9-1.6 1.8v14.1c0 .9.7 1.6 1.6 1.6h14.2c.9 0 1.6-.7 1.6-1.6V9.4c.1-.5-.1-.9-.4-1.2m-5.8-3.3 3.4 3.6h-3.4zm3.9 12.7H4.7c-.1 0-.2 0-.2-.2V4.7c0-.2.1-.3.2-.3h7.2v4.4s0 .8.3 1.1 1.1.3 1.1.3h4.3v7.2s-.1.2-.2.2' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 13593:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='black' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24z' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 75517:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 90717:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='black' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 25075:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 512 512'%3e %3cpath fill='black' d='M108.4 0h23v22.8h21.2V0h23v69h-23V46h-21v23h-23.2M206 23h-20.3V0h63.7v23H229v46h-23m53.5-69h24.1l14.8 24.3L313.2 0h24.1v69h-23V34.8l-16.1 24.8-16.1-24.8V69h-22.6m89.2-69h23v46.2h32.6V69h-55.6' class='jp-icon0 jp-icon-selectable'/%3e %3cpath fill='%23e44d26' d='m107.6 471-33-370.4h362.8l-33 370.2L255.7 512' class='jp-icon-selectable'/%3e %3cpath fill='%23f16529' d='M256 480.5V131h148.3L376 447' class='jp-icon-selectable'/%3e %3cpath fill='%23ebebeb' d='M142 176.3h114v45.4h-64.2l4.2 46.5h60v45.3H154.4m2 22.8H202l3.2 36.3 50.8 13.6v47.4l-93.2-26' class='jp-icon-selectable-inverse'/%3e %3cpath fill='white' d='M369.6 176.3H255.8v45.4h109.6m-4.1 46.5H255.8v45.4h56l-5.3 59-50.7 13.6v47.2l93-25.8' class='jp-icon-selectable-inverse'/%3e %3c/svg%3e";

/***/ }),

/***/ 81856:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cpath fill='white' d='M2.2 2.2h17.5v17.5H2.2z' class='jp-icon-brand4 jp-icon-selectable-inverse'/%3e %3cpath fill='%233F51B5' d='M2.2 2.2v17.5h17.5l.1-17.5zm12.1 2.2c1.2 0 2.2 1 2.2 2.2s-1 2.2-2.2 2.2-2.2-1-2.2-2.2 1-2.2 2.2-2.2M4.4 17.6l3.3-8.8 3.3 6.6 2.2-3.2 4.4 5.4z' class='jp-icon-brand0 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 42048:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z' class='jp-inspector-icon-color jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 70941:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cg fill='%23F9A825' class='jp-json-icon-color jp-icon-selectable'%3e %3cpath d='M20.2 11.8c-1.6 0-1.7.5-1.7 1 0 .4.1.9.1 1.3.1.5.1.9.1 1.3 0 1.7-1.4 2.3-3.5 2.3h-.9v-1.9h.5c1.1 0 1.4 0 1.4-.8 0-.3 0-.6-.1-1 0-.4-.1-.8-.1-1.2 0-1.3 0-1.8 1.3-2-1.3-.2-1.3-.7-1.3-2 0-.4.1-.8.1-1.2.1-.4.1-.7.1-1 0-.8-.4-.7-1.4-.8h-.5V4.1h.9c2.2 0 3.5.7 3.5 2.3 0 .4-.1.9-.1 1.3-.1.5-.1.9-.1 1.3 0 .5.2 1 1.7 1zM1.8 10.1c1.6 0 1.7-.5 1.7-1 0-.4-.1-.9-.1-1.3-.1-.5-.1-.9-.1-1.3 0-1.6 1.4-2.3 3.5-2.3h.9v1.9h-.5c-1 0-1.4 0-1.4.8 0 .3 0 .6.1 1 0 .2.1.6.1 1 0 1.3 0 1.8-1.3 2C6 11.2 6 11.7 6 13c0 .4-.1.8-.1 1.2-.1.3-.1.7-.1 1 0 .8.3.8 1.4.8h.5v1.9h-.9c-2.1 0-3.5-.6-3.5-2.3 0-.4.1-.9.1-1.3.1-.5.1-.9.1-1.3 0-.5-.2-1-1.7-1z'/%3e %3ccircle cx='11' cy='13.8' r='2.1'/%3e %3ccircle cx='11' cy='8.2' r='2.1'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 70063:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 325 300'%3e %3cpath fill='%23cb3c33' d='M150.898 225c0 41.422-33.578 75-75 75s-75-33.578-75-75 33.579-75 75-75 75 33.578 75 75' class='jp-brand0 jp-icon-selectable'/%3e %3cpath fill='%23389826' d='M237.5 75c0 41.422-33.578 75-75 75s-75-33.578-75-75 33.578-75 75-75 75 33.578 75 75' class='jp-brand0 jp-icon-selectable'/%3e %3cpath fill='%239558b2' d='M324.102 225c0 41.422-33.579 75-75 75s-75-33.578-75-75 33.578-75 75-75 75 33.578 75 75' class='jp-brand0 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 71349:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m-9 3h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-1 2H5v-2h2zm0-3H5V8h2zm9 7H8v-2h8zm0-4h-2v-2h2zm0-3h-2V8h2zm3 3h-2v-2h2zm0-3h-2V8h2z' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 27346:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 57220:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cpath fill='%237B1FA2' d='M5 14.9h12l-6.1 6zm9.4-6.8c0-1.3-.1-2.9-.1-4.5-.4 1.4-.9 2.9-1.3 4.3l-1.3 4.3h-2L8.5 7.9c-.4-1.3-.7-2.9-1-4.3-.1 1.6-.1 3.2-.2 4.6L7 12.4H4.8l.7-11h3.3L10 5c.4 1.2.7 2.7 1 3.9.3-1.2.7-2.6 1-3.9l1.2-3.7h3.3l.6 11h-2.4z' class='jp-icon-contrast0 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 73428:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' version='1.1' viewBox='0 0 491 675'%3e %3cpath fill='%23ff3670' d='M85 92c-46 0-85 37-85 85v321c0 46 37 85 85 85h321c46 0 85-37 85-85V177c0-46-37-85-85-85zm-2 111c72-3.1 139 41 162 109 25-67 91-112 162-109 2.4 57-25 111-72 144-24 16-39 44-39 74v51H192v-51c.08-29-15-57-39-74-47-32-75-86-72-144z' class='jp-icon-contrast2 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 33168:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cg fill='%23EF6C00' class='jp-notebook-icon-color jp-icon-selectable'%3e %3cpath d='M18.7 3.3v15.4H3.3V3.3zm1.5-1.5H1.8v18.3h18.3z'/%3e %3cpath d='m16.5 16.5-5.4-4.3-5.6 4.3v-11h11z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 58441:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cpath fill='%23FF2A2A' d='m17.933 13.667 3.987 3.987-1.117 1.117-2.51-2.51-1.066 1.067 2.36 2.36-1.117 1.117-2.36-2.36-2.43 2.429-1.477-1.478zm-6.163-3.93-3.496 3.496.53.53q.905.906 1.83.932.929.031 1.784-.825.852-.852.822-1.773t-.94-1.83zm-.36-2.594 1.557 1.558q1.305 1.305 1.754 2.13.456.825.468 1.727.015.79-.296 1.493-.31.702-.951 1.343-.649.648-1.355.963-.702.31-1.493.295-.905-.015-1.738-.472-.829-.46-2.118-1.75L5.68 12.874zm-5.76-5.76L8.1 3.835Q9.195 4.93 9.291 6q.103 1.07-.795 1.968-.901.902-1.976.802-1.067-.1-2.16-1.193l-.975-.975L1.397 8.59-.08 7.113Zm.406 2.548-1.6 1.6.817.818q.43.43.871.457.445.023.829-.361t.357-.825-.457-.871z' class='jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 33003:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='-10 -10 131.161 132.389'%3e %3cpath fill='%23306998' d='M54.919 0c-4.584.022-8.961.413-12.813 1.095C30.76 3.099 28.7 7.295 28.7 15.032v10.219h26.813v3.406H18.638c-7.793 0-14.616 4.684-16.75 13.594-2.462 10.213-2.571 16.586 0 27.25 1.905 7.938 6.457 13.594 14.25 13.594h9.218v-12.25c0-8.85 7.657-16.657 16.75-16.657h26.782c7.454 0 13.406-6.138 13.406-13.625v-25.53c0-7.267-6.13-12.726-13.406-13.938C64.282.328 59.502-.02 54.918 0m-14.5 8.22c2.77 0 5.031 2.298 5.031 5.125 0 2.816-2.262 5.093-5.031 5.093-2.78 0-5.031-2.277-5.031-5.093 0-2.827 2.251-5.125 5.03-5.125' class='jp-icon-selectable'/%3e %3cpath fill='%23ffd43b' d='M85.638 28.657v11.906c0 9.231-7.826 17-16.75 17H42.106c-7.336 0-13.406 6.279-13.406 13.625V96.72c0 7.266 6.319 11.54 13.406 13.625 8.488 2.495 16.627 2.946 26.782 0 6.75-1.955 13.406-5.888 13.406-13.625V86.5H55.513v-3.405H95.7c7.793 0 10.696-5.436 13.406-13.594 2.8-8.399 2.68-16.476 0-27.25-1.925-7.758-5.604-13.594-13.406-13.594zM70.575 93.313c2.78 0 5.031 2.278 5.031 5.094 0 2.827-2.251 5.125-5.031 5.125-2.77 0-5.031-2.298-5.031-5.125 0-2.816 2.261-5.094 5.031-5.094' class='jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 16460:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid' width='16' height='16' viewBox='0 0 724 561'%3e %3cpath class='jp-icon-selectable' d='M361.453%2c485.937 C162.329%2c485.937 0.906%2c377.828 0.906%2c244.469 C0.906%2c111.109 162.329%2c3.000 361.453%2c3.000 C560.578%2c3.000 722.000%2c111.109 722.000%2c244.469 C722.000%2c377.828 560.578%2c485.937 361.453%2c485.937 ZM416.641%2c97.406 C265.289%2c97.406 142.594%2c171.314 142.594%2c262.484 C142.594%2c353.654 265.289%2c427.562 416.641%2c427.562 C567.992%2c427.562 679.687%2c377.033 679.687%2c262.484 C679.687%2c147.971 567.992%2c97.406 416.641%2c97.406 Z' fill='rgb(179%2c179%2c179)' fill-rule='evenodd'/%3e %3cpath class='jp-icon-selectable' d='M550.000%2c377.000 C550.000%2c377.000 571.822%2c383.585 584.500%2c390.000 C588.899%2c392.226 596.510%2c396.668 602.000%2c402.500 C607.378%2c408.212 610.000%2c414.000 610.000%2c414.000 L696.000%2c559.000 L557.000%2c559.062 L492.000%2c437.000 C492.000%2c437.000 478.690%2c414.131 470.500%2c407.500 C463.668%2c401.969 460.755%2c400.000 454.000%2c400.000 C449.298%2c400.000 420.974%2c400.000 420.974%2c400.000 L421.000%2c558.974 L298.000%2c559.026 L298.000%2c152.938 L545.000%2c152.938 C545.000%2c152.938 657.500%2c154.967 657.500%2c262.000 C657.500%2c369.033 550.000%2c377.000 550.000%2c377.000 ZM496.500%2c241.024 L422.037%2c240.976 L422.000%2c310.026 L496.500%2c310.002 C496.500%2c310.002 531.000%2c309.895 531.000%2c274.877 C531.000%2c239.155 496.500%2c241.024 496.500%2c241.024 Z' fill='rgb(52%2c101%2c176)' fill-rule='evenodd'/%3e %3c/svg%3e";

/***/ }),

/***/ 86352:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='150 150 541.9 295.3'%3e %3cg fill='%2361DAFB' class='jp-icon-brand2 jp-icon-selectable'%3e %3cpath d='M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4'/%3e %3ccircle cx='420.9' cy='296.5' r='45.7'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 32167:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.49.49 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 60056:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cpath fill='%234CAF50' d='M2.2 2.2v17.6h17.6V2.2zm15.4 7.7h-5.5V4.4h5.5zM9.9 4.4v5.5H4.4V4.4zm-5.5 7.7h5.5v5.5H4.4zm7.7 5.5v-5.5h5.5v5.5z' class='jp-icon-contrast1 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 87521:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z' class='jp-text-editor-icon-color jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 7898:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cg fill='%23212121' class='jp-icon1 jp-icon-selectable'%3e %3cpath d='m10.6 5.4 2.2-3.2H2.2v7.3l4-6.6z'/%3e %3cpath d='m15.8 2.2-4.4 6.6L7 6.3l-4.8 8v5.5h17.6V2.2zm-7 15.4H5.5v-4.4h3.3zm4.4 0H9.8V9.8h3.4zm4.4 0h-3.4V6.5h3.4z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 87157:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath class='jp-icon3 jp-icon-selectable' fill='%23616161' d='M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3h-2zM8 17H6v-2h2v2zm0-4H6v-2h2v2zm0-4H6V7h2v2zm10 8h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V7h2v2z'/%3e %3cpath d='M0 0h24v24H0z' fill='none'/%3e %3c/svg%3e";

/***/ }),

/***/ 85272:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 22 22'%3e %3cg fill='%23D81B60' class='jp-icon-contrast2 jp-icon-selectable'%3e %3cpath d='M7.2 18.6v-5.4L3 5.6h3.3l1.4 3.1c.3.9.6 1.6 1 2.5.3-.8.6-1.6 1-2.5l1.4-3.1h3.4l-4.4 7.6v5.5z'/%3e %3ccircle cx='17.6' cy='16.5' r='2.1'/%3e %3ccircle cx='17.6' cy='11' r='2.1'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 98311:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M13.5 8H12v5l4.28 2.54.72-1.21-3.5-2.08zM13 3a9 9 0 0 0-9 9H1l3.96 4.03L9 12H6a7 7 0 0 1 7-7 7 7 0 0 1 7 7 7 7 0 0 1-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.9 8.9 0 0 0 13 21a9 9 0 0 0 9-9 9 9 0 0 0-9-9' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 52101:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 50.978 50.978'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3cpath d='M43.52 7.458C38.711 2.648 32.307 0 25.489 0 18.67 0 12.266 2.648 7.458 7.458c-9.943 9.941-9.943 26.119 0 36.062 4.809 4.809 11.212 7.456 18.031 7.458h.002c6.816 0 13.221-2.648 18.029-7.458 4.809-4.809 7.457-11.212 7.457-18.03 0-6.82-2.649-13.224-7.457-18.032m-1.414 34.647c-4.432 4.431-10.332 6.872-16.615 6.872h-.002c-6.285-.001-12.187-2.441-16.617-6.872-9.162-9.163-9.162-24.071 0-33.233C13.303 4.44 19.204 2 25.489 2c6.284 0 12.186 2.44 16.617 6.872 4.431 4.431 6.871 10.332 6.871 16.617 0 6.283-2.441 12.186-6.871 16.616'/%3e %3cpath d='M23.578 32.218q-.034-2.602.496-3.972t2.272-3.253q.702-.805 1.367-1.575.939-1.13 1.436-2.175.496-1.061.495-2.5 0-1.643-.779-2.979-.848-1.319-2.806-1.369-2.703.085-3.55 1.832a5.3 5.3 0 0 0-.607 1.814 11.3 11.3 0 0 0-.207 2.174h-2.937q-.136-3.312 1.493-5.719 1.593-2.459 5.378-2.527 3.24.034 5.141 1.758 1.918 1.74 1.95 4.811 0 1.712-.41 2.911a7.6 7.6 0 0 1-1.268 2.243 22 22 0 0 1-1.73 2.002 34 34 0 0 0-1.987 2.346 5.2 5.2 0 0 0-.565 1.199q-.24 1.438-.171 2.979zm0 6.002v-3.484h3.076v3.484z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 91474:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='152' height='165' version='1.1' viewBox='0 0 152 165'%3e %3cpath fill='%23F37726' d='M76.021 140.163c-32.64 0-61.145-11.927-75.942-29.58 5.51 15.84 15.781 29.567 29.39 39.278a80.17 80.17 0 0 0 46.57 14.929 80.17 80.17 0 0 0 46.57-14.929c13.61-9.711 23.88-23.437 29.391-39.278-14.833 17.653-43.338 29.58-75.979 29.58m-.005-114.832c32.64 0 61.146 11.927 75.943 29.58a80.9 80.9 0 0 0-29.391-39.278A80.16 80.16 0 0 0 75.998.705a80.16 80.16 0 0 0-46.57 14.928A80.9 80.9 0 0 0 .038 54.912c14.832-17.617 43.338-29.58 75.978-29.58' class='jp-jupyter-icon-color'/%3e %3c/svg%3e";

/***/ }),

/***/ 74835:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='39' height='51' viewBox='0 0 39 51'%3e %3cpath fill='%23F37726' d='M20.005 38.114c-7.85 0-14.706-2.876-18.265-7.134a19.5 19.5 0 0 0 7.069 9.473 19.24 19.24 0 0 0 11.2 3.6c4.013 0 7.927-1.258 11.2-3.6a19.5 19.5 0 0 0 7.069-9.473c-3.567 4.258-10.423 7.134-18.273 7.134m-.002-27.694c7.85 0 14.706 2.876 18.265 7.133a19.5 19.5 0 0 0-7.069-9.473A19.24 19.24 0 0 0 20 4.48a19.24 19.24 0 0 0-11.2 3.6 19.5 19.5 0 0 0-7.069 9.473c3.567-4.248 10.423-7.134 18.273-7.134' class='jp-jupyter-icon-color'/%3e %3cpath fill='%23616161' d='M37.194 3.154a3 3 0 0 1-.426 1.672 2.96 2.96 0 0 1-1.275 1.153 2.93 2.93 0 0 1-3.238-.505 3 3 0 0 1-.776-3.21c.2-.553.558-1.033 1.029-1.38a2.93 2.93 0 0 1 3.733.209c.576.532.919 1.274.953 2.061M9.228 46.393a3.77 3.77 0 0 1-.536 2.11 3.73 3.73 0 0 1-1.608 1.452 3.69 3.69 0 0 1-4.082-.638 3.75 3.75 0 0 1-1.097-1.875 3.8 3.8 0 0 1 .122-2.173 3.74 3.74 0 0 1 1.299-1.739 3.696 3.696 0 0 1 4.704.268 3.76 3.76 0 0 1 1.198 2.595M2.635 9.456a2.17 2.17 0 0 1-1.227-.318 2.2 2.2 0 0 1-.845-.951A2.22 2.22 0 0 1 .935 5.77a2.16 2.16 0 0 1 2.356-.577c.405.15.757.418 1.011.77a2.21 2.21 0 0 1-.156 2.783 2.17 2.17 0 0 1-1.511.71' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 31179:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='200' viewBox='0 0 1860.8 475'%3e %3cpath fill='%234E4E4E' d='M53.324 293.087c0 48.7-3.7 64.7-13.6 76.4-10.8 10-25 15.5-39.7 15.5l3.7 29c22.8.3 44.8-7.9 61.9-23.1 17.8-18.5 24-44.1 24-83.3v-184.3h-36.4v170.1zm271.42-22.179c0 21 0 39.5 1.7 55.4h-31.8l-2.1-33.3h-.8c-6.7 11.6-16.4 21.3-28 27.9s-24.8 10-38.2 9.8c-31.4 0-69-17.7-69-89v-118.8h36.4v112.7c0 38.7 11.6 64.7 44.6 64.7 10.3-.2 20.4-3.5 28.9-9.4s15.1-14.3 18.9-23.9c2.2-6.1 3.3-12.5 3.3-18.9v-125h36.4v147.8zm68.512-81.525c0-26-.8-47-1.7-66.7h32.7l1.7 34.8h.8c7.1-12.5 17.5-22.8 30.1-29.7 12.5-7 26.7-10.3 41-9.8 48.3 0 84.7 41.7 84.7 103.3 0 73.1-43.7 109.2-91 109.2-12.1.5-24.2-2.2-35-7.8s-19.9-13.9-26.6-24.2h-.8v110.5h-36v-220zm36 54.2c.1 5.1.6 10.1 1.7 15.1 3 12.3 9.9 23.3 19.8 31.1s22.1 12.1 34.7 12.1c38.5 0 60.7-31.9 60.7-78.5 0-40.7-21.1-75.6-59.5-75.6-12.9.4-25.3 5.1-35.3 13.4-9.9 8.3-16.9 19.7-19.6 32.4-1.5 4.9-2.3 10-2.5 15.1zm217.572-120.485 43.7 120.1c4.5 13.4 9.5 29.4 12.8 41.7h.8c3.7-12.2 7.9-27.7 12.8-42.4l39.7-119.2h38.5l-54.4 144.8c-26 69.7-43.7 105.4-68.6 127.2-12.5 11.7-27.9 20-44.6 23.9l-9.1-31.1c11.7-3.9 22.5-10.1 31.8-18.1 13.2-11.1 23.7-25.2 30.6-41.2 1.5-2.8 2.5-5.7 2.9-8.8-.3-3.3-1.2-6.6-2.5-9.7l-73.8-187.1h39.7zM890.649 64.65v58.3h52v28.2h-52v109.5c0 25 7 39.5 27.3 39.5 7.1.1 14.2-.7 21.1-2.5l1.7 27.7c-10.3 3.7-21.3 5.4-32.2 5-7.3.4-14.6-.7-21.3-3.4-6.8-2.7-12.9-6.8-17.9-12.1-10.3-10.9-14.1-29-14.1-52.9v-110.8h-31v-28.2h31v-48.7zm119.111 166.711c.8 50 32.2 70.6 68.6 70.6 19 .6 37.9-3 55.3-10.5l6.2 26.4c-20.9 8.9-43.5 13.1-66.2 12.6-61.5 0-98.3-41.2-98.3-102.5 0-61.4 35.5-109.6 93.7-109.6 65.2 0 82.7 58.3 82.7 95.7-.1 5.8-.5 11.5-1.2 17.2h-140.8zm106.6-26.4c.4-23.5-9.5-60.1-50.4-60.1-36.8 0-52.8 34.4-55.7 60.1zm88.317-18.505c0-23.9-.4-44.5-1.7-63.4h31.8l1.2 39.9h1.7c9.1-27.3 31-44.5 55.3-44.5 3.5-.1 7 .4 10.3 1.2v34.8c-4.1-.9-8.2-1.3-12.4-1.2-25.6 0-43.7 19.7-48.7 47.4-1 5.7-1.6 11.5-1.7 17.2v108.3h-36v-139.7z' class='jp-icon2'/%3e %3cpath fill='%23F37726' d='M1352.3 326.2h37V28h-37zm252.5 0c-2.5-13.9-3.4-31.1-3.4-48.7v-76c0-40.7-15.1-83.1-77.3-83.1-25.6 0-50 7.1-66.8 18.1l8.4 24.4c14.3-9.2 34-15.1 53-15.1 41.6 0 46.2 30.2 46.2 47v4.2c-78.6-.4-122.3 26.5-122.3 75.6 0 29.4 21 58.4 62.2 58.4 29 0 50.9-14.3 62.2-30.2h1.3l2.9 25.6h33.6zm-39.1-68.5c0 3.8-.8 8-2.1 11.8-5.9 17.2-22.7 34-49.2 34-18.9 0-34.9-11.3-34.9-35.3 0-39.5 45.8-46.6 86.2-45.8zm132.8 68.5 1.7-33.6h1.3c15.1 26.9 38.7 38.2 68.1 38.2 45.4 0 91.2-36.1 91.2-108.8.4-61.7-35.3-103.7-85.7-103.7-32.8 0-56.3 14.7-69.3 37.4h-.8V28h-36.6v245.7c0 18.1-.8 38.6-1.7 52.5zm6.3-118c0-5.9 1.3-10.9 2.1-15.1 7.6-28.1 31.1-45.4 56.3-45.4 39.5 0 60.5 34.9 60.5 75.6 0 46.6-23.1 78.1-61.8 78.1-26.9 0-48.3-17.6-55.5-43.3-.8-4.2-1.7-8.8-1.7-13.4v-36.5z' class='jp-jupyter-icon-color'/%3e %3c/svg%3e";

/***/ }),

/***/ 26702:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M11.88 9.14c1.28.06 1.61 1.15 1.63 1.66h1.79c-.08-1.98-1.49-3.19-3.45-3.19C9.64 7.61 8 9 8 12.14c0 1.94.93 4.24 3.84 4.24 2.22 0 3.41-1.65 3.44-2.95h-1.79c-.03.59-.45 1.38-1.63 1.44-1.31-.04-1.86-1.06-1.86-2.73 0-2.89 1.28-2.98 1.88-3M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 56555:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 23'%3e %3cpath fill='%23333' d='M12 17a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m6-9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2h1V6a5 5 0 0 1 5-5 5 5 0 0 1 5 5v2zm-6-5a3 3 0 0 0-3 3v2h6V6a3 3 0 0 0-3-3' class='jp-icon4'/%3e %3c/svg%3e";

/***/ }),

/***/ 16932:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M6.59 3.41 2 8l4.59 4.6L8 11.18 4.82 8 8 4.82zm5.82 0L11 4.82 14.18 8 11 11.18l1.41 1.42L17 8zm9.18 8.18-8.09 8.09L9.83 16l-1.41 1.41 5.08 5.09L23 13z' class='jp-icon3 jp-icon-selectable' shape-rendering='geometricPrecision'/%3e %3c/svg%3e";

/***/ }),

/***/ 15768:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 8.5 10.5'%3e %3cg fill='%23BDBDBD' class='jp-icon-output'%3e %3cpath d='M.019 0h8.458v1.064H.019zM0 9.52h8.491v1.059H0zm4.776-6.608H3.72V1.323h1.056z'/%3e %3cpath d='m4.244 5.243-1.06-1.167-1.06-1.167h4.24l-1.06 1.167zm.528 4.014H3.716V7.665h1.056z'/%3e %3cpath d='M4.242 5.332 5.302 6.5l1.06 1.167h-4.24L3.182 6.5z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 11893:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 8.5 10.5'%3e %3cg fill='%23BDBDBD' class='jp-icon-output'%3e %3cpath d='M.019 0h8.458v1.064H.019zM0 9.521h8.491v1.059H0zm3.712-5.822h1.056v1.589H3.712z'/%3e %3cpath d='m4.244 1.368 1.06 1.167 1.06 1.167h-4.24l1.06-1.167zm-.532 3.92h1.056V6.88H3.712z'/%3e %3cpath d='m4.242 9.213-1.06-1.167-1.06-1.167h4.24l-1.06 1.167z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 16084:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 20 20'%3e %3cpath fill='%23414141' d='M2 2h16v16H2z' class='jp-icon2'/%3e %3cpath fill='white' d='M7.6 8h.9l3.5 8h-1.1l-.9-2H6l-.9 2H4zM8 9.1 6.4 13h3.2zm8.6.7c-.2.1-.4.1-.7.1-.2 0-.4-.1-.6-.2-.1-.1-.2-.4-.2-.7-.3.3-.6.5-.9.7-.3.1-.7.2-1.1.2-.3 0-.5 0-.7-.1l-.6-.3c-.2-.1-.3-.3-.4-.5s-.1-.4-.1-.7.1-.6.2-.8.3-.4.4-.5c.1 0 .3-.1.6-.2.2-.1.5-.1.7-.2.3-.1.5-.1.7-.1s.4-.1.6-.1.3-.1.4-.2.2-.2.2-.4c0-1-1.1-1-1.3-1-.4 0-1.4 0-1.4 1.2h-.9c0-.4.1-.7.2-1 .1-.2.3-.4.5-.6s.5-.3.8-.3c.3-.1.6-.1.9-.1s.5 0 .8.1c.3 0 .5.1.7.2s.4.3.5.5.1.4.1.8V9c0 .1.1.2.3.2h.3zm-1.4-2.9c-1.2.6-3.1.2-3.1 1.4 0 1.4 3.1 1 3.1-.5z' class='jp-icon-accent2'/%3e %3c/svg%3e";

/***/ }),

/***/ 32174:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='white' d='M14 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0l-2.01-2.01a.99.99 0 0 1-.29-.83V12h-.03L4.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L14.03 12z' class='jp-icon3'/%3e %3ccircle cx='18' cy='17' r='3' fill='white' class='jp-icon-dot'/%3e %3c/svg%3e";

/***/ }),

/***/ 43237:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='white' d='M14 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0l-2.01-2.01a.99.99 0 0 1-.29-.83V12h-.03L4.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L14.03 12z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 24213:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 20 20'%3e %3cpath fill='%23414141' d='M2 2h16v16H2z' class='jp-icon2'/%3e %3cg fill='white' class='jp-icon-accent2'%3e %3ccircle cx='5.5' cy='14.5' r='1.5'/%3e %3cpath d='M12 4h1v8h-1z'/%3e %3cpath d='m8.786 9.567 6.928-4 .5.866-6.928 4z'/%3e %3cpath d='m8.786 6.433.5-.866 6.928 4-.5.866z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 63879:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 20 20'%3e %3cpath fill='%23414141' d='M2 2h16v16H2z' class='jp-icon2'/%3e %3cpath fill='white' d='M4.57 8.8q.068-1.89 2.42-1.89 1.16 0 1.68.42.567.41.567 1.16v3.47q0 .462.514.462.103 0 .2-.023v.714q-.399.103-.651.103-.452 0-.693-.22-.231-.2-.284-.662-.956.872-2 .872-.903 0-1.47-.472-.525-.472-.525-1.26 0-.262.045-.472.057-.22.116-.378.068-.168.231-.304l.262-.242q.116-.091.368-.168.262-.091.4-.126.135-.045.471-.103t.504-.08l.567-.08q.556-.068.777-.22.22-.153.22-.442v-.252q0-.43-.357-.662-.336-.23-.976-.23-.662 0-.998.261-.336.252-.399.798zm1.89 3.68q.788 0 1.26-.41.504-.42.504-.903v-1.05q-.284.136-.861.231l-.987.158q-.42.068-.766.326-.336.252-.336.704t.304.704.861.252zm3.97-7.88h.945v3.15q.651-.976 1.89-.976 1.16 0 1.89.84.682.84.682 2.31t-.704 2.42q-.704.882-1.89.882-1.26 0-1.89-1.02v.766h-.85zm2.62 3.04q-.746 0-1.16.64-.452.63-.452 1.68t.452 1.68 1.16.63q.777 0 1.26-.63.494-.64.494-1.68 0-1.05-.472-1.68-.462-.64-1.26-.64zm-9.89 8.2 13.6.008c.007 0 0-2.6 0-2.6 0-.008-1.15 0-1.15 0-.007 0-.008 1.5-.008 1.5l-11.3-.001-.006-1.5c0-.008-1.17.001-1.17.001z' class='jp-icon-accent2'/%3e %3c/svg%3e";

/***/ }),

/***/ 15156:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M14.9 17.45c1.35 0 2.45-1.1 2.45-2.45s-1.1-2.45-2.45-2.45c-1.36 0-2.45 1.1-2.45 2.45s1.09 2.45 2.45 2.45m5.2-1.77 1.48 1.16c.13.11.17.29.08.45l-1.4 2.42a.35.35 0 0 1-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.27 1.85c-.02.17-.17.3-.34.3h-2.8c-.18 0-.32-.13-.35-.3l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.75.7c-.15.06-.34 0-.42-.15l-1.4-2.42a.35.35 0 0 1 .08-.45l1.48-1.16-.05-.68.05-.69-1.48-1.15a.35.35 0 0 1-.08-.45l1.4-2.42c.08-.16.27-.22.42-.16l1.75.71c.36-.28.75-.52 1.18-.69l.26-1.86c.03-.16.17-.29.35-.29h2.8c.17 0 .32.13.34.29l.27 1.86c.42.17.82.41 1.18.69l1.74-.71c.17-.06.34 0 .43.16l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.15.05.69zM7.33 7.445A1.566 1.566 0 0 0 7.904 5.3a1.575 1.575 0 1 0-.574 2.145m2.327-2.65 1.21.157c.096.025.173.12.171.236v1.8a.214.214 0 0 1-.183.223l-1.195.17-.42.75.43 1.126c.037.106 0 .22-.096.275l-1.559.9a.23.23 0 0 1-.294-.05l-.734-.95-.878-.001-.762.96c-.058.08-.173.1-.275.043l-1.56-.901a.23.23 0 0 1-.101-.276l.452-1.116-.246-.366-.194-.396-1.192-.166a.23.23 0 0 1-.189-.226V5.186c.002-.117.077-.206.175-.217l1.204-.175.446-.766-.456-1.11a.23.23 0 0 1 .104-.28l1.56-.9a.225.225 0 0 1 .285.054l.76.936.86.01.745-.949a.214.214 0 0 1 .284-.048l1.56.9a.24.24 0 0 1 .118.267l-.47 1.126.246.366z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 23326:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5a2.5 2.5 0 0 0-5 0V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5a2.5 2.5 0 0 0 0-5' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 8477:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3cpath d='M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5zm1.3-4.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12zM15.5 9a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5'/%3e %3cpath fill-rule='evenodd' d='M4 6h5.019a6.5 6.5 0 0 0 3.015 6H9v2h7v-1.019c.57-.043 1.12-.16 1.64-.341L18 13v7H4zm4 2H6v2h2zm-2 4h2v2H6zm2 4H6v2h2zm1 0h7v2H9z' clip-rule='evenodd'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 3512:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 512 512'%3e %3cpath fill='%23616161' d='M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8m96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 38457:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M18 2c-1.645 0-3 1.355-3 3 0 .191.022.377.057.559L7.922 9.72A2.97 2.97 0 0 0 6 9c-1.645 0-3 1.355-3 3s1.355 3 3 3c.732 0 1.399-.278 1.922-.72l7.135 4.16A3 3 0 0 0 15 19c0 1.645 1.355 3 3 3s3-1.355 3-3-1.355-3-3-3a2.97 2.97 0 0 0-1.922.723l-7.135-4.164C8.978 12.377 9 12.19 9 12s-.022-.377-.057-.559l7.135-4.162C16.601 7.722 17.268 8 18 8c1.645 0 3-1.355 3-3s-1.355-3-3-3m0 2c.564 0 1 .436 1 1s-.436 1-1 1-1-.436-1-1 .436-1 1-1M6 11c.564 0 1 .436 1 1s-.436 1-1 1-1-.436-1-1 .436-1 1-1m12 7c.564 0 1 .436 1 1s-.436 1-1 1-1-.436-1-1 .436-1 1-1' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 98413:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H3V5h10v4h8z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 89131:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M7 5h14v2H7zm0 8v-2h14v2zM4 4.5A1.5 1.5 0 0 1 5.5 6 1.5 1.5 0 0 1 4 7.5 1.5 1.5 0 0 1 2.5 6 1.5 1.5 0 0 1 4 4.5m0 6A1.5 1.5 0 0 1 5.5 12 1.5 1.5 0 0 1 4 13.5 1.5 1.5 0 0 1 2.5 12 1.5 1.5 0 0 1 4 10.5M7 19v-2h14v2zm-3-2.5A1.5 1.5 0 0 1 5.5 18 1.5 1.5 0 0 1 4 19.5 1.5 1.5 0 0 1 2.5 18 1.5 1.5 0 0 1 4 16.5' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 91106:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0m-4 7a7 7 0 0 0-7 7h14a7 7 0 0 0-7-7' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 19444:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' version='1.1' viewBox='0 0 36 24'%3e %3cg fill='%23616161' class='jp-icon3' transform='translate(-3.628 .1)scale(1.7327)'%3e %3cpath d='M18.279 5.265c-1.58 0-2.964.85-3.718 2.115a6.7 6.7 0 0 1 2.81 2.21h5.23a4.32 4.32 0 0 0-4.322-4.325m2.186-2.875a2.19 2.19 0 0 1-2.188 2.188 2.19 2.19 0 0 1-2.189-2.189A2.19 2.19 0 0 1 18.277.201a2.19 2.19 0 0 1 2.188 2.188M5.385 6.633a3.02 3.02 0 0 0-3.02 3.02h4.22a6.7 6.7 0 0 1 1.44-1.467 3.02 3.02 0 0 0-2.64-1.553m1.53-2.01a1.53 1.53 0 0 1-1.529 1.53 1.53 1.53 0 0 1-1.53-1.53 1.53 1.53 0 0 1 1.53-1.53 1.53 1.53 0 0 1 1.53 1.53m-.781 8.912a5.865 5.865 0 0 1 11.73 0z'/%3e %3ccircle cx='12' cy='3.768' r='2.969'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 61681:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' version='1.1' viewBox='0 0 16 16'%3e %3cpath fill='%23333' d='M8 .29c-1.4 0-2.7.73-3.6 1.8-1.2 1.5-1.4 3.4-1.5 5.2-.18 2.2-.44 4-2.3 5.3l.28 1.3h5c.026.66.32 1.1.71 1.5.84.61 2 .61 2.8 0 .52-.4.6-1 .71-1.5h5l.28-1.3c-1.9-.97-2.2-3.3-2.3-5.3-.13-1.8-.26-3.7-1.5-5.2-.85-1-2.2-1.8-3.6-1.8zm0 1.4c.88 0 1.9.55 2.5 1.3.88 1.1 1.1 2.7 1.2 4.4.13 1.7.23 3.6 1.3 5.2H3c1.1-1.6 1.2-3.4 1.3-5.2.13-1.7.3-3.3 1.2-4.4.59-.72 1.6-1.3 2.5-1.3m-.74 12h1.5c-.001.28.015.79-.74.79-.73.002-.72-.53-.74-.79z' class='jp-icon2 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 93107:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M15 9H9v6h6zm-2 4h-2v-2h2zm8-2V9h-2V7c0-1.1-.9-2-2-2h-2V3h-2v2h-2V3H9v2H7c-1.1 0-2 .9-2 2v2H3v2h2v2H3v2h2v2c0 1.1.9 2 2 2h2v2h2v-2h2v2h2v-2h2c1.1 0 2-.9 2-2v-2h2v-2h-2v-2zm-4 6H7V7h10z' class='jp-icon2'/%3e %3c/svg%3e";

/***/ }),

/***/ 47699:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='white' d='M5.88 4.12 13.76 12l-7.88 7.88L8 22l10-10L8 2z'/%3e %3c/svg%3e";

/***/ }),

/***/ 19804:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z' class='jp-icon2 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 88449:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' fill='none' viewBox='0 0 25 25'%3e %3cpath stroke='%23333' stroke-width='2' d='M4.86 14.44c-1.034-2.67-.996-5.382-.61-7.24 1.232-.267 2.83-.797 4.351-1.355a92 92 0 0 0 4.387-1.75 68 68 0 0 0 4.23 1.748c1.532.57 3.182 1.11 4.536 1.37.382 1.859.417 4.564-.615 7.228-1.109 2.862-3.472 5.743-8.139 7.494-4.667-1.75-7.03-4.632-8.14-7.494Zm11.824-5.12-7.368 7.365m7.368-.001L9.316 9.319' class='jp-icon2'/%3e %3c/svg%3e";

/***/ }),

/***/ 51824:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23333' d='M2 2h20v20H2z' class='jp-terminal-icon-background-color jp-icon-selectable'/%3e %3cpath fill='white' d='M9.01 14.762q0-.246-.077-.434a.9.9 0 0 0-.234-.351 1.6 1.6 0 0 0-.422-.288 5 5 0 0 0-.627-.263q-.592-.211-1.078-.446a3.5 3.5 0 0 1-.832-.544 2.2 2.2 0 0 1-.528-.721 2.4 2.4 0 0 1-.187-.985q0-.498.17-.908a2.1 2.1 0 0 1 .48-.72q.31-.306.75-.493.44-.188.979-.24V7.11h.937v1.272q.527.07.95.287.421.217.714.568.3.345.457.82.165.47.164 1.055H8.998q0-.709-.323-1.072-.322-.37-.873-.37-.299 0-.521.083a.9.9 0 0 0-.358.223.9.9 0 0 0-.21.334q-.066.194-.065.421 0 .23.064.41a.9.9 0 0 0 .229.329q.165.152.428.293.263.134.656.275.591.223 1.072.463.48.235.82.55.346.312.528.727.187.41.187.973 0 .515-.17.932-.17.41-.486.709t-.762.48a3.7 3.7 0 0 1-.996.229v1.148h-.931V17.1a4 4 0 0 1-.967-.217 2.6 2.6 0 0 1-.832-.504 2.4 2.4 0 0 1-.574-.826q-.217-.505-.217-1.207h1.635q0 .421.123.709.123.281.316.45.2.165.451.235.252.07.516.07.627 0 .949-.292a.98.98 0 0 0 .322-.756m8.36 3.51h-5.343V17h5.344z' class='jp-terminal-icon-color jp-icon-selectable-inverse'/%3e %3c/svg%3e";

/***/ }),

/***/ 16168:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' fill='none' viewBox='0 0 24 25'%3e %3cpath stroke='%23333' stroke-width='2' d='M3.86 14.44c-1.034-2.67-.996-5.382-.61-7.24 1.232-.267 2.83-.797 4.351-1.355a92 92 0 0 0 4.387-1.75 68 68 0 0 0 4.23 1.748c1.532.57 3.182 1.11 4.536 1.37.382 1.859.417 4.564-.615 7.228-1.109 2.862-3.472 5.743-8.139 7.494-4.667-1.75-7.03-4.632-8.14-7.494Z' class='jp-icon2'/%3e %3cpath fill='%23333' stroke='%23333' d='m10.86 14.733-2.133-1.866-.727.63L10.86 16 16 10.5l-.721-.632z' class='jp-icon2'/%3e %3c/svg%3e";

/***/ }),

/***/ 92700:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3e %3cg clip-path='url(%23addabovea)'%3e %3cpath fill='%23616161' stroke='%23616161' stroke-width='.7' d='M4.75 4.93h1.875v1.876c0 .206.169.375.375.375a.376.376 0 0 0 .375-.375V4.93H9.25a.376.376 0 0 0 .375-.375.376.376 0 0 0-.375-.375H7.375V2.306A.376.376 0 0 0 7 1.93a.376.376 0 0 0-.375.375V4.18H4.75a.376.376 0 0 0-.375.375c0 .206.169.375.375.375Z' class='jp-icon3'/%3e %3c/g%3e %3cpath fill='%23616161' fill-rule='evenodd' d='M11.5 9.5v2h-9v-2zM12 8a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z' class='jp-icon3' clip-rule='evenodd'/%3e %3cdefs%3e %3cclipPath id='addabovea'%3e %3cpath fill='white' d='M10 1.556H4v6h6z' class='jp-icon3'/%3e %3c/clipPath%3e %3c/defs%3e %3c/svg%3e";

/***/ }),

/***/ 15716:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3e %3cg clip-path='url(%23addbelowa)'%3e %3cpath fill='%23616161' stroke='%23616161' stroke-width='.7' d='M9.25 10.07H7.375V8.193A.376.376 0 0 0 7 7.82a.376.376 0 0 0-.375.375v1.875H4.75a.376.376 0 0 0-.375.375c0 .207.169.375.375.375h1.875v1.875c0 .207.169.375.375.375a.376.376 0 0 0 .375-.375V10.82H9.25a.376.376 0 0 0 .375-.375.376.376 0 0 0-.375-.375Z' class='jp-icon3'/%3e %3c/g%3e %3cpath fill='%23616161' fill-rule='evenodd' d='M2.5 5.5v-2h9v2zM2 7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1z' class='jp-icon3' clip-rule='evenodd'/%3e %3cdefs%3e %3cclipPath id='addbelowa'%3e %3cpath fill='white' d='M4 13.444h6v-6H4z' class='jp-icon3'/%3e %3c/clipPath%3e %3c/defs%3e %3c/svg%3e";

/***/ }),

/***/ 25979:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 93275:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3 jp-icon-selectable'%3e %3cpath fill-rule='evenodd' d='M17.19 8H20v2h-2.09c.05.33.09.66.09 1v1h2v2h-2v.027a4.5 4.5 0 0 0-3.545 6.447A5.997 5.997 0 0 1 6.81 18H4v-2h2.09c-.05-.33-.09-.66-.09-1v-1H4v-2h2v-1c0-.34.04-.67.09-1H4V8h2.81c.45-.78 1.07-1.45 1.81-1.96L7 4.41 8.41 3l2.18 2.17c.45-.11.92-.17 1.41-.17s.96.06 1.42.17L15.59 3 17 4.41l-1.63 1.63c.75.51 1.37 1.18 1.82 1.96M10 16h4v-2h-4zm0-4h4v-2h-4z' clip-rule='evenodd'/%3e %3cpath d='M22 18.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 67945:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M20 8h-2.81a6 6 0 0 0-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 17641:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z' class='jp-icon3 jp-icon-selectable'/%3e %3c/svg%3e";

/***/ }),

/***/ 27449:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 28072:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3ccircle cx='9' cy='9' r='8' fill='%23616161' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 71179:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M16 11h-1V3c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v8H8c-2.76 0-5 2.24-5 5v7h18v-7c0-2.76-2.24-5-5-5m3 10h-2v-3c0-.55-.45-1-1-1s-1 .45-1 1v3h-2v-3c0-.55-.45-1-1-1s-1 .45-1 1v3H9v-3c0-.55-.45-1-1-1s-1 .45-1 1v3H5v-5c0-1.65 1.35-3 3-3h8c1.65 0 3 1.35 3 3z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 31075:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cmask id='cleara'%3e %3cpath fill='white' d='M0 0h24v24H0z'/%3e %3ccircle cx='12' cy='12' r='8' fill='black'/%3e %3c/mask%3e %3cg fill='%23616161' class='jp-icon3'%3e %3cpath d='M4.929 6.343 6.343 4.93l12.728 12.728-1.414 1.414z'/%3e %3ccircle cx='12' cy='12' r='10' mask='url(%23cleara)'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 37004:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3ccircle cx='12' cy='12' r='11' fill='none' class='jp-icon-none jp-icon-selectable-inverse jp-icon3-hover'/%3e %3cpath fill='%23616161' d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z' class='jp-icon3 jp-icon-selectable jp-icon-accent2-hover'/%3e %3ccircle cx='12' cy='12' r='7' fill='none' class='jp-icon-none jp-icon-busy'/%3e %3c/svg%3e";

/***/ }),

/***/ 89630:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 28 28'%3e %3cpath fill='%23616161' d='M11.4 18.6 6.8 14l4.6-4.6L10 8l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L18 8l6 6-6 6z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 98689:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3cpath d='M8 2h12c1 0 2 1 2 2v12c0 1 0 2-2 2V4H6c0-2 1-2 2-2'/%3e %3cpath d='M18 8c0-1-1-2-2-2H4C3 6 2 7 2 8v12c0 1 1 2 2 2h12c1 0 2-1 2-2zm-2 0v12H4V8z'/%3e %3cpath d='M6 13v2h8v-2z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 60435:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M11.9 1H3.2c-.8 0-1.5.7-1.5 1.5v10.2h1.5V2.5h8.7zm2.2 2.9h-8c-.8 0-1.5.7-1.5 1.5v10.2c0 .8.7 1.5 1.5 1.5h8c.8 0 1.5-.7 1.5-1.5V5.4c-.1-.8-.7-1.5-1.5-1.5m0 11.6h-8V5.4h8z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 47162:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2m0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2m6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5M19 3l-6 6 2 2 7-7V3z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 75136:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3e %3cpath fill='%23626262' d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 42081:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg width='16' version='1.1' viewBox='0 0 22 22' xmlns='http://www.w3.org/2000/svg'%3e %3cpath class='jp-icon3' d='m19.8 19.8v-17.6h-17.6v17.6zm-15.408-2.2v-3.8027h13.208v3.8027zm13.208-5.5301h-13.218v-7.6699h13.218z' fill='%23616161'/%3e %3c/svg%3e";

/***/ }),

/***/ 28052:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg width='16' version='1.1' viewBox='0 0 22 22' xmlns='http://www.w3.org/2000/svg'%3e %3cpath class='jp-icon3' d='m2.2 19.8h17.6v-17.6h-17.6zm2.2-15.408h3.8027v13.208h-3.8027zm5.5301 13.208v-13.218h7.6699v13.218z' fill='%23616161'/%3e %3c/svg%3e";

/***/ }),

/***/ 65886:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg width='16' version='1.1' viewBox='0 0 22 22' xmlns='http://www.w3.org/2000/svg'%3e %3cpath class='jp-icon3' d='m19.8 2.2h-17.6v17.6h17.6zm-2.2 15.408h-3.8027v-13.208h3.8027zm-5.5301-13.208v13.218h-7.6699v-13.218z' fill='%23616161'/%3e %3c/svg%3e";

/***/ }),

/***/ 47252:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg width='16' version='1.1' viewBox='0 0 22 22' xmlns='http://www.w3.org/2000/svg'%3e %3cpath class='jp-icon3' d='m2.2 2.2v17.6h17.6v-17.6zm15.408 2.2v3.8027h-13.208v-3.8027zm-13.208 5.5301h13.218v7.6699h-13.218z' fill='%23616161'/%3e %3c/svg%3e";

/***/ }),

/***/ 91609:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e %3csvg width='16' version='1.1' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3e %3cg class='jp-icon3' transform='rotate(90%2c12%2c12)' fill='%23616161'%3e %3ccircle cx='5' cy='12' r='2'/%3e %3ccircle cx='12' cy='12' r='2'/%3e %3ccircle cx='19' cy='12' r='2'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 68781:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 74161:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3e %3cpath fill='%23616161' fill-rule='evenodd' d='M2.8.875h6.096c.305 0 .554.264.554.587s-.25.587-.554.587H3.354c-.305 0-.554.264-.554.587V9.68c0 .322-.25.587-.554.587s-.554-.264-.554-.587V2.049c0-.646.498-1.174 1.108-1.174M5.367 11.9V4.55h5.716v7.35zM4.142 4.142c0-.451.365-.817.816-.817h6.534c.45 0 .816.366.816.817v8.166a.817.817 0 0 1-.816.817H4.958a.817.817 0 0 1-.816-.817z' class='jp-icon3' clip-rule='evenodd'/%3e %3cpath fill='%23616161' stroke='%23616161' stroke-width='.5' d='M9.436 8.265H8.364v1.071a.215.215 0 0 1-.214.215.215.215 0 0 1-.214-.215v-1.07H6.864a.215.215 0 0 1-.214-.215c0-.118.096-.215.214-.215h1.072v-1.07a.214.214 0 1 1 .428-.001v1.072h1.072c.118 0 .214.096.214.214a.215.215 0 0 1-.214.214Z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 81338:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 24364:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3ccircle cx='5' cy='12' r='2'/%3e %3ccircle cx='12' cy='12' r='2'/%3e %3ccircle cx='19' cy='12' r='2'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 63704:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cg fill='%23616161' class='jp-icon3'%3e %3cpath d='M8 2h12c1 0 2 1 2 2v12c0 1 0 2-2 2V4H6c0-2 1-2 2-2'/%3e %3cpath d='M18 8c0-1-1-2-2-2H4C3 6 2 7 2 8v12c0 1 1 2 2 2h12c1 0 2-1 2-2zm-2 0v12H4V8z'/%3e %3cpath d='M11 10H9v3H6v2h3v3h2v-3h3v-2h-3z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 65110:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='m4 18 8.5-6L4 6zm9-12v12l8.5-6z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 1357:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 44540:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 27807:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='32' viewBox='0 0 32 32'%3e %3cg fill='%23616161' class='jp-icon3 jp-icon-selectable'%3e %3cpath d='M26 28H6a2.003 2.003 0 0 1-2-2V6a2.003 2.003 0 0 1 2-2h10v2H6v20h20V16h2v10a2.003 2.003 0 0 1-2 2'/%3e %3cpath d='M20 2v2h6.586L18 12.586 19.414 14 28 5.414V12h2V2z'/%3e %3c/g%3e %3c/svg%3e";

/***/ }),

/***/ 2599:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 10729:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3e %3cpath fill='%23616161' d='M12.471 7.529a.748.748 0 0 0-1.057-1.058L7.75 10.127V1.75a.75.75 0 0 0-1.5 0v8.378l-3.653-3.66a.753.753 0 1 0-1.065 1.064l4.76 4.76a1 1 0 0 0 1.415 0z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 25665:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3e %3cpath fill='%23616161' d='M1.529 6.471a.748.748 0 0 0 1.057 1.058L6.25 3.873v8.377a.75.75 0 0 0 1.5 0V3.873l3.653 3.659a.753.753 0 1 0 1.065-1.064l-4.76-4.76a1 1 0 0 0-1.415 0z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 78563:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-1 8h-3v3h-2v-3h-3v-2h3V9h2v3h3z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 94051:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 28 28'%3e %3cpath fill='%23616161' d='M4 19h2v.5H5v1h1v.5H4v1h3v-4H4zm1-9h1V6H4v1h1zm-1 3h1.8L4 15.1v.9h3v-1H5.2L7 12.9V12H4zm5-6v2h14V7zm0 14h14v-2H9zm0-6h14v-2H9z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 21936:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M12 2.02c-5.51 0-9.98 4.47-9.98 9.98s4.47 9.98 9.98 9.98 9.98-4.47 9.98-9.98S17.51 2.02 12 2.02M11.48 20v-6.26H8L13 4v6.26h3.35z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 16580:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m7 18H5V4h2v3h10V4h2z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 50110:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8 8 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 99947:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M9 13.5c-2.49 0-4.5-2.01-4.5-4.5S6.51 4.5 9 4.5c1.24 0 2.36.52 3.17 1.33L10 8h5V3l-1.76 1.76A6 6 0 0 0 9 3C5.69 3 3.01 5.69 3.01 9S5.69 15 9 15a5.98 5.98 0 0 0 5.9-5h-1.52c-.46 2-2.24 3.5-4.38 3.5' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 88959:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M8 5v14l11-7z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 36911:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 33109:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 18 18'%3e %3cpath fill='%23616161' d='M12.1 10.9h-.7l-.2-.2c.8-.9 1.3-2.2 1.3-3.5 0-3-2.4-5.4-5.4-5.4S1.8 4.2 1.8 7.1s2.4 5.4 5.4 5.4c1.3 0 2.5-.5 3.5-1.3l.2.2v.7l4.1 4.1 1.2-1.2zm-5 0c-2.1 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7 3.7 1.7 3.7 3.7-1.6 3.7-3.7 3.7' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 73621:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M6 6h12v12H6z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 53217:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M21 8H3V4h18zm0 2H3v4h18zm0 6H3v4h18z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 707:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 43 28'%3e %3cpath fill='%23616161' d='M28.833 12.334 33 16.501l4.166-4.167zM16.21 21.61c-.523.52-1.366.52-1.885 0l-7.342-6.885c-.41-.386-.9-1.115-.935-1.677-.095-1.52-.028-4.429.018-5.971A1.093 1.093 0 0 1 7.118 6.03c1.97-.046 6.146-.095 6.534.293l8.085 7.315c.519.52.048 1.833-.475 2.356zM9.775 8.265a1.126 1.126 0 1 0-1.593 1.592 1.126 1.126 0 0 0 1.593-1.592' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 89423:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 67092:
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' viewBox='0 0 24 24'%3e %3cpath fill='%23616161' d='M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8' class='jp-icon3'/%3e %3c/svg%3e";

/***/ }),

/***/ 80705:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}');

/***/ }),

/***/ 61327:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}');

/***/ })

}]);
//# sourceMappingURL=notebook_core.df310bda0e2ec4176fde.js.map?v=df310bda0e2ec4176fde